From 22c7929ffa99daf88eb8b215c3fcca99c51ee87a Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 19 Jun 2024 00:09:49 +0000 Subject: [PATCH 001/993] initial commit --- .devcontainer/Dockerfile | 9 + .devcontainer/devcontainer.json | 40 + .github/workflows/ci.yml | 52 + .gitignore | 15 + .python-version | 1 + .stats.yml | 2 + Brewfile | 2 + CONTRIBUTING.md | 125 ++ LICENSE | 201 ++ README.md | 304 ++- SECURITY.md | 27 + api.md | 160 ++ bin/publish-pypi | 6 + examples/.keep | 4 + mypy.ini | 47 + noxfile.py | 9 + pyproject.toml | 196 ++ requirements-dev.lock | 96 + requirements.lock | 43 + scripts/bootstrap | 19 + scripts/format | 8 + scripts/lint | 12 + scripts/mock | 41 + scripts/test | 56 + scripts/utils/ruffen-docs.py | 167 ++ src/runloop/__init__.py | 83 + src/runloop/_base_client.py | 1997 +++++++++++++++++ src/runloop/_client.py | 446 ++++ src/runloop/_compat.py | 222 ++ src/runloop/_constants.py | 14 + src/runloop/_exceptions.py | 108 + src/runloop/_files.py | 127 ++ src/runloop/_models.py | 739 ++++++ src/runloop/_qs.py | 150 ++ src/runloop/_resource.py | 43 + src/runloop/_response.py | 820 +++++++ src/runloop/_streaming.py | 333 +++ src/runloop/_types.py | 220 ++ src/runloop/_utils/__init__.py | 51 + src/runloop/_utils/_logs.py | 25 + src/runloop/_utils/_proxy.py | 63 + src/runloop/_utils/_streams.py | 12 + src/runloop/_utils/_sync.py | 64 + src/runloop/_utils/_transform.py | 382 ++++ src/runloop/_utils/_typing.py | 120 + src/runloop/_utils/_utils.py | 402 ++++ src/runloop/_version.py | 4 + src/runloop/lib/.keep | 4 + src/runloop/py.typed | 0 src/runloop/resources/__init__.py | 89 + src/runloop/resources/code_handles.py | 293 +++ src/runloop/resources/devboxes/__init__.py | 33 + src/runloop/resources/devboxes/devboxes.py | 481 ++++ src/runloop/resources/devboxes/logs.py | 143 ++ src/runloop/resources/functions/__init__.py | 47 + src/runloop/resources/functions/functions.py | 408 ++++ .../functions/invocations/__init__.py | 33 + .../functions/invocations/invocations.py | 310 +++ .../resources/functions/invocations/spans.py | 147 ++ src/runloop/resources/functions/openapi.py | 114 + src/runloop/resources/latches.py | 159 ++ src/runloop/resources/projects/__init__.py | 33 + src/runloop/resources/projects/logs.py | 143 ++ src/runloop/resources/projects/projects.py | 155 ++ src/runloop/resources/sessions/__init__.py | 19 + src/runloop/resources/sessions/sessions.py | 81 + .../resources/sessions/sessions/__init__.py | 33 + src/runloop/resources/sessions/sessions/kv.py | 162 ++ .../resources/sessions/sessions/sessions.py | 206 ++ src/runloop/types/__init__.py | 18 + src/runloop/types/code_handle.py | 21 + .../types/code_handle_create_params.py | 21 + src/runloop/types/code_handle_list.py | 13 + src/runloop/types/code_handle_list_params.py | 15 + src/runloop/types/devbox.py | 21 + src/runloop/types/devbox_create_params.py | 30 + src/runloop/types/devbox_list.py | 13 + src/runloop/types/devbox_list_params.py | 12 + src/runloop/types/devboxes/__init__.py | 5 + .../types/devboxes/devbox_logs_list.py | 23 + .../types/function_invoke_async_params.py | 23 + .../types/function_invoke_sync_params.py | 23 + src/runloop/types/function_list.py | 22 + src/runloop/types/functions/__init__.py | 5 + .../functions/function_invocation_list.py | 28 + .../types/functions/invocations/__init__.py | 5 + .../invocations/invocation_span_list.py | 16 + src/runloop/types/latch_fulfill_params.py | 12 + src/runloop/types/project_list.py | 131 ++ src/runloop/types/projects/__init__.py | 5 + src/runloop/types/projects/project_logs.py | 20 + src/runloop/types/sessions/__init__.py | 6 + src/runloop/types/sessions/session.py | 12 + src/runloop/types/sessions/session_list.py | 13 + .../types/sessions/sessions/__init__.py | 6 + .../types/sessions/sessions/kv_list_params.py | 12 + .../types/sessions/sessions/session_kv.py | 66 + src/runloop/types/shared/__init__.py | 3 + .../shared/function_invocation_detail.py | 27 + tests/__init__.py | 1 + tests/api_resources/__init__.py | 1 + tests/api_resources/devboxes/__init__.py | 1 + tests/api_resources/devboxes/test_logs.py | 98 + tests/api_resources/functions/__init__.py | 1 + .../functions/invocations/__init__.py | 1 + .../functions/invocations/test_spans.py | 98 + .../functions/test_invocations.py | 225 ++ tests/api_resources/functions/test_openapi.py | 71 + tests/api_resources/projects/__init__.py | 1 + tests/api_resources/projects/test_logs.py | 98 + tests/api_resources/sessions/__init__.py | 1 + .../sessions/sessions/__init__.py | 1 + .../sessions/sessions/test_kv.py | 114 + tests/api_resources/sessions/test_sessions.py | 122 + tests/api_resources/test_code_handles.py | 158 ++ tests/api_resources/test_devboxes.py | 308 +++ tests/api_resources/test_functions.py | 325 +++ tests/api_resources/test_latches.py | 105 + tests/api_resources/test_projects.py | 72 + tests/conftest.py | 49 + tests/sample_file.txt | 1 + tests/test_client.py | 1475 ++++++++++++ tests/test_deepcopy.py | 59 + tests/test_extract_files.py | 64 + tests/test_files.py | 51 + tests/test_models.py | 829 +++++++ tests/test_qs.py | 78 + tests/test_required_args.py | 111 + tests/test_response.py | 194 ++ tests/test_streaming.py | 248 ++ tests/test_transform.py | 410 ++++ tests/test_utils/test_proxy.py | 23 + tests/test_utils/test_typing.py | 78 + tests/utils.py | 151 ++ 134 files changed, 17409 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .github/workflows/ci.yml create mode 100644 .gitignore create mode 100644 .python-version create mode 100644 .stats.yml create mode 100644 Brewfile create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 SECURITY.md create mode 100644 api.md create mode 100644 bin/publish-pypi create mode 100644 examples/.keep create mode 100644 mypy.ini create mode 100644 noxfile.py create mode 100644 pyproject.toml create mode 100644 requirements-dev.lock create mode 100644 requirements.lock create mode 100755 scripts/bootstrap create mode 100755 scripts/format create mode 100755 scripts/lint create mode 100755 scripts/mock create mode 100755 scripts/test create mode 100644 scripts/utils/ruffen-docs.py create mode 100644 src/runloop/__init__.py create mode 100644 src/runloop/_base_client.py create mode 100644 src/runloop/_client.py create mode 100644 src/runloop/_compat.py create mode 100644 src/runloop/_constants.py create mode 100644 src/runloop/_exceptions.py create mode 100644 src/runloop/_files.py create mode 100644 src/runloop/_models.py create mode 100644 src/runloop/_qs.py create mode 100644 src/runloop/_resource.py create mode 100644 src/runloop/_response.py create mode 100644 src/runloop/_streaming.py create mode 100644 src/runloop/_types.py create mode 100644 src/runloop/_utils/__init__.py create mode 100644 src/runloop/_utils/_logs.py create mode 100644 src/runloop/_utils/_proxy.py create mode 100644 src/runloop/_utils/_streams.py create mode 100644 src/runloop/_utils/_sync.py create mode 100644 src/runloop/_utils/_transform.py create mode 100644 src/runloop/_utils/_typing.py create mode 100644 src/runloop/_utils/_utils.py create mode 100644 src/runloop/_version.py create mode 100644 src/runloop/lib/.keep create mode 100644 src/runloop/py.typed create mode 100644 src/runloop/resources/__init__.py create mode 100644 src/runloop/resources/code_handles.py create mode 100644 src/runloop/resources/devboxes/__init__.py create mode 100644 src/runloop/resources/devboxes/devboxes.py create mode 100644 src/runloop/resources/devboxes/logs.py create mode 100644 src/runloop/resources/functions/__init__.py create mode 100644 src/runloop/resources/functions/functions.py create mode 100644 src/runloop/resources/functions/invocations/__init__.py create mode 100644 src/runloop/resources/functions/invocations/invocations.py create mode 100644 src/runloop/resources/functions/invocations/spans.py create mode 100644 src/runloop/resources/functions/openapi.py create mode 100644 src/runloop/resources/latches.py create mode 100644 src/runloop/resources/projects/__init__.py create mode 100644 src/runloop/resources/projects/logs.py create mode 100644 src/runloop/resources/projects/projects.py create mode 100644 src/runloop/resources/sessions/__init__.py create mode 100644 src/runloop/resources/sessions/sessions.py create mode 100644 src/runloop/resources/sessions/sessions/__init__.py create mode 100644 src/runloop/resources/sessions/sessions/kv.py create mode 100644 src/runloop/resources/sessions/sessions/sessions.py create mode 100644 src/runloop/types/__init__.py create mode 100644 src/runloop/types/code_handle.py create mode 100644 src/runloop/types/code_handle_create_params.py create mode 100644 src/runloop/types/code_handle_list.py create mode 100644 src/runloop/types/code_handle_list_params.py create mode 100644 src/runloop/types/devbox.py create mode 100644 src/runloop/types/devbox_create_params.py create mode 100644 src/runloop/types/devbox_list.py create mode 100644 src/runloop/types/devbox_list_params.py create mode 100644 src/runloop/types/devboxes/__init__.py create mode 100644 src/runloop/types/devboxes/devbox_logs_list.py create mode 100644 src/runloop/types/function_invoke_async_params.py create mode 100644 src/runloop/types/function_invoke_sync_params.py create mode 100644 src/runloop/types/function_list.py create mode 100644 src/runloop/types/functions/__init__.py create mode 100644 src/runloop/types/functions/function_invocation_list.py create mode 100644 src/runloop/types/functions/invocations/__init__.py create mode 100644 src/runloop/types/functions/invocations/invocation_span_list.py create mode 100644 src/runloop/types/latch_fulfill_params.py create mode 100644 src/runloop/types/project_list.py create mode 100644 src/runloop/types/projects/__init__.py create mode 100644 src/runloop/types/projects/project_logs.py create mode 100644 src/runloop/types/sessions/__init__.py create mode 100644 src/runloop/types/sessions/session.py create mode 100644 src/runloop/types/sessions/session_list.py create mode 100644 src/runloop/types/sessions/sessions/__init__.py create mode 100644 src/runloop/types/sessions/sessions/kv_list_params.py create mode 100644 src/runloop/types/sessions/sessions/session_kv.py create mode 100644 src/runloop/types/shared/__init__.py create mode 100644 src/runloop/types/shared/function_invocation_detail.py create mode 100644 tests/__init__.py create mode 100644 tests/api_resources/__init__.py create mode 100644 tests/api_resources/devboxes/__init__.py create mode 100644 tests/api_resources/devboxes/test_logs.py create mode 100644 tests/api_resources/functions/__init__.py create mode 100644 tests/api_resources/functions/invocations/__init__.py create mode 100644 tests/api_resources/functions/invocations/test_spans.py create mode 100644 tests/api_resources/functions/test_invocations.py create mode 100644 tests/api_resources/functions/test_openapi.py create mode 100644 tests/api_resources/projects/__init__.py create mode 100644 tests/api_resources/projects/test_logs.py create mode 100644 tests/api_resources/sessions/__init__.py create mode 100644 tests/api_resources/sessions/sessions/__init__.py create mode 100644 tests/api_resources/sessions/sessions/test_kv.py create mode 100644 tests/api_resources/sessions/test_sessions.py create mode 100644 tests/api_resources/test_code_handles.py create mode 100644 tests/api_resources/test_devboxes.py create mode 100644 tests/api_resources/test_functions.py create mode 100644 tests/api_resources/test_latches.py create mode 100644 tests/api_resources/test_projects.py create mode 100644 tests/conftest.py create mode 100644 tests/sample_file.txt create mode 100644 tests/test_client.py create mode 100644 tests/test_deepcopy.py create mode 100644 tests/test_extract_files.py create mode 100644 tests/test_files.py create mode 100644 tests/test_models.py create mode 100644 tests/test_qs.py create mode 100644 tests/test_required_args.py create mode 100644 tests/test_response.py create mode 100644 tests/test_streaming.py create mode 100644 tests/test_transform.py create mode 100644 tests/test_utils/test_proxy.py create mode 100644 tests/test_utils/test_typing.py create mode 100644 tests/utils.py diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 000000000..83bca8f71 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,9 @@ +ARG VARIANT="3.9" +FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} + +USER vscode + +RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.24.0" RYE_INSTALL_OPTION="--yes" bash +ENV PATH=/home/vscode/.rye/shims:$PATH + +RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..bbeb30b14 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,40 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/debian +{ + "name": "Debian", + "build": { + "dockerfile": "Dockerfile", + "context": ".." + }, + + "postStartCommand": "rye sync --all-features", + + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python" + ], + "settings": { + "terminal.integrated.shell.linux": "/bin/bash", + "python.pythonPath": ".venv/bin/python", + "python.defaultInterpreterPath": ".venv/bin/python", + "python.typeChecking": "basic", + "terminal.integrated.env.linux": { + "PATH": "/home/vscode/.rye/shims:${env:PATH}" + } + } + } + } + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..8c339440b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,52 @@ +name: CI +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + lint: + name: lint + runs-on: ubuntu-latest + + + steps: + - uses: actions/checkout@v4 + + - name: Install Rye + run: | + curl -sSf https://rye.astral.sh/get | bash + echo "$HOME/.rye/shims" >> $GITHUB_PATH + env: + RYE_VERSION: 0.24.0 + RYE_INSTALL_OPTION: '--yes' + + - name: Install dependencies + run: rye sync --all-features + + - name: Run lints + run: ./scripts/lint + test: + name: test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install Rye + run: | + curl -sSf https://rye.astral.sh/get | bash + echo "$HOME/.rye/shims" >> $GITHUB_PATH + env: + RYE_VERSION: 0.24.0 + RYE_INSTALL_OPTION: '--yes' + + - name: Bootstrap + run: ./scripts/bootstrap + + - name: Run tests + run: ./scripts/test + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..0f9a66a97 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +.vscode +_dev + +__pycache__ +.mypy_cache + +dist + +.venv +.idea + +.env +.envrc +codegen.log +Brewfile.lock.json diff --git a/.python-version b/.python-version new file mode 100644 index 000000000..43077b246 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.9.18 diff --git a/.stats.yml b/.stats.yml new file mode 100644 index 000000000..b7a5bc0e5 --- /dev/null +++ b/.stats.yml @@ -0,0 +1,2 @@ +configured_endpoints: 21 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-778b6e08d43e3ffe57654335fe785cace2a54b805a2c2b31421d40beabc44386.yml diff --git a/Brewfile b/Brewfile new file mode 100644 index 000000000..492ca37bb --- /dev/null +++ b/Brewfile @@ -0,0 +1,2 @@ +brew "rye" + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..87045143c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,125 @@ +## Setting up the environment + +### With Rye + +We use [Rye](https://rye.astral.sh/) to manage dependencies so we highly recommend [installing it](https://rye.astral.sh/guide/installation/) as it will automatically provision a Python environment with the expected Python version. + +After installing Rye, you'll just have to run this command: + +```sh +$ rye sync --all-features +``` + +You can then run scripts using `rye run python script.py` or by activating the virtual environment: + +```sh +$ rye shell +# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work +$ source .venv/bin/activate + +# now you can omit the `rye run` prefix +$ python script.py +``` + +### Without Rye + +Alternatively if you don't want to install `Rye`, you can stick with the standard `pip` setup by ensuring you have the Python version specified in `.python-version`, create a virtual environment however you desire and then install dependencies using this command: + +```sh +$ pip install -r requirements-dev.lock +``` + +## Modifying/Adding code + +Most of the SDK is generated code, and any modified code will be overridden on the next generation. The +`src/runloop/lib/` and `examples/` directories are exceptions and will never be overridden. + +## Adding and running examples + +All files in the `examples/` directory are not modified by the Stainless generator and can be freely edited or +added to. + +```bash +# add an example to examples/.py + +#!/usr/bin/env -S rye run python +… +``` + +``` +chmod +x examples/.py +# run the example against your api +./examples/.py +``` + +## Using the repository from source + +If you’d like to use the repository from source, you can either install from git or link to a cloned repository: + +To install via git: + +```bash +pip install git+ssh://git@github.com/stainless-sdks/runloop-python.git +``` + +Alternatively, you can build from source and install the wheel file: + +Building this package will create two files in the `dist/` directory, a `.tar.gz` containing the source files and a `.whl` that can be used to install the package efficiently. + +To create a distributable version of the library, all you have to do is run this command: + +```bash +rye build +# or +python -m build +``` + +Then to install: + +```sh +pip install ./path-to-wheel-file.whl +``` + +## Running tests + +Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. + +```bash +# you will need npm installed +npx prism mock path/to/your/openapi.yml +``` + +```bash +rye run pytest +``` + +## Linting and formatting + +This repository uses [ruff](https://github.com/astral-sh/ruff) and +[black](https://github.com/psf/black) to format the code in the repository. + +To lint: + +```bash +rye run lint +``` + +To format and fix all ruff issues automatically: + +```bash +rye run format +``` + +## Publishing and releases + +Changes made to this repository via the automated release PR pipeline should publish to PyPI automatically. If +the changes aren't made through the automated pipeline, you may want to make releases manually. + +### Publish with a GitHub workflow + +You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/stainless-sdks/runloop-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. + +### Publish manually + +If you need to manually release a package, you can run the `bin/publish-pypi` script with a `PYPI_TOKEN` set on +the environment. diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..b1e5b671d --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2024 Runloop + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index 35ac00c8a..44d93d31a 100644 --- a/README.md +++ b/README.md @@ -1 +1,303 @@ -# runloop-python \ No newline at end of file +# Runloop Python API library + +[![PyPI version](https://img.shields.io/pypi/v/runloop.svg)](https://pypi.org/project/runloop/) + +The Runloop Python library provides convenient access to the Runloop REST API from any Python 3.7+ +application. The library includes type definitions for all request params and response fields, +and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx). + +It is generated with [Stainless](https://www.stainlessapi.com/). + +## Documentation + +The REST API documentation can be found [on runloop.ai](https://runloop.ai). The full API of this library can be found in [api.md](api.md). + +## Installation + +```sh +# install from this staging repo +pip install git+ssh://git@github.com/stainless-sdks/runloop-python.git +``` + +> [!NOTE] +> Once this package is [published to PyPI](https://app.stainlessapi.com/docs/guides/publish), this will become: `pip install --pre runloop` + +## Usage + +The full API of this library can be found in [api.md](api.md). + +```python +import os +from runloop import Runloop + +client = Runloop( + # This is the default and can be omitted + bearer_token=os.environ.get("RUNLOOP_BEARER_TOKEN"), +) + +code_handle = client.code_handles.create() +print(code_handle.id) +``` + +While you can provide a `bearer_token` keyword argument, +we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/) +to add `RUNLOOP_BEARER_TOKEN="My Bearer Token"` to your `.env` file +so that your Bearer Token is not stored in source control. + +## Async usage + +Simply import `AsyncRunloop` instead of `Runloop` and use `await` with each API call: + +```python +import os +import asyncio +from runloop import AsyncRunloop + +client = AsyncRunloop( + # This is the default and can be omitted + bearer_token=os.environ.get("RUNLOOP_BEARER_TOKEN"), +) + + +async def main() -> None: + code_handle = await client.code_handles.create() + print(code_handle.id) + + +asyncio.run(main()) +``` + +Functionality between the synchronous and asynchronous clients is otherwise identical. + +## Using types + +Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like: + +- Serializing back into JSON, `model.to_json()` +- Converting to a dictionary, `model.to_dict()` + +Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`. + +## Handling errors + +When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `runloop.APIConnectionError` is raised. + +When the API returns a non-success status code (that is, 4xx or 5xx +response), a subclass of `runloop.APIStatusError` is raised, containing `status_code` and `response` properties. + +All errors inherit from `runloop.APIError`. + +```python +import runloop +from runloop import Runloop + +client = Runloop() + +try: + client.code_handles.create() +except runloop.APIConnectionError as e: + print("The server could not be reached") + print(e.__cause__) # an underlying Exception, likely raised within httpx. +except runloop.RateLimitError as e: + print("A 429 status code was received; we should back off a bit.") +except runloop.APIStatusError as e: + print("Another non-200-range status code was received") + print(e.status_code) + print(e.response) +``` + +Error codes are as followed: + +| Status Code | Error Type | +| ----------- | -------------------------- | +| 400 | `BadRequestError` | +| 401 | `AuthenticationError` | +| 403 | `PermissionDeniedError` | +| 404 | `NotFoundError` | +| 422 | `UnprocessableEntityError` | +| 429 | `RateLimitError` | +| >=500 | `InternalServerError` | +| N/A | `APIConnectionError` | + +### Retries + +Certain errors are automatically retried 2 times by default, with a short exponential backoff. +Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, +429 Rate Limit, and >=500 Internal errors are all retried by default. + +You can use the `max_retries` option to configure or disable retry settings: + +```python +from runloop import Runloop + +# Configure the default for all requests: +client = Runloop( + # default is 2 + max_retries=0, +) + +# Or, configure per-request: +client.with_options(max_retries=5).code_handles.create() +``` + +### Timeouts + +By default requests time out after 1 minute. You can configure this with a `timeout` option, +which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object: + +```python +from runloop import Runloop + +# Configure the default for all requests: +client = Runloop( + # 20 seconds (default is 1 minute) + timeout=20.0, +) + +# More granular control: +client = Runloop( + timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0), +) + +# Override per-request: +client.with_options(timeout=5.0).code_handles.create() +``` + +On timeout, an `APITimeoutError` is thrown. + +Note that requests that time out are [retried twice by default](#retries). + +## Advanced + +### Logging + +We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module. + +You can enable logging by setting the environment variable `RUNLOOP_LOG` to `debug`. + +```shell +$ export RUNLOOP_LOG=debug +``` + +### How to tell whether `None` means `null` or missing + +In an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`: + +```py +if response.my_field is None: + if 'my_field' not in response.model_fields_set: + print('Got json like {}, without a "my_field" key present at all.') + else: + print('Got json like {"my_field": null}.') +``` + +### Accessing raw response data (e.g. headers) + +The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g., + +```py +from runloop import Runloop + +client = Runloop() +response = client.code_handles.with_raw_response.create() +print(response.headers.get('X-My-Header')) + +code_handle = response.parse() # get the object that `code_handles.create()` would have returned +print(code_handle.id) +``` + +These methods return an [`APIResponse`](https://github.com/stainless-sdks/runloop-python/tree/main/src/runloop/_response.py) object. + +The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/runloop-python/tree/main/src/runloop/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. + +#### `.with_streaming_response` + +The above interface eagerly reads the full response body when you make the request, which may not always be what you want. + +To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods. + +```python +with client.code_handles.with_streaming_response.create() as response: + print(response.headers.get("X-My-Header")) + + for line in response.iter_lines(): + print(line) +``` + +The context manager is required so that the response will reliably be closed. + +### Making custom/undocumented requests + +This library is typed for convenient access to the documented API. + +If you need to access undocumented endpoints, params, or response properties, the library can still be used. + +#### Undocumented endpoints + +To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other +http verbs. Options on the client will be respected (such as retries) will be respected when making this +request. + +```py +import httpx + +response = client.post( + "/foo", + cast_to=httpx.Response, + body={"my_param": True}, +) + +print(response.headers.get("x-foo")) +``` + +#### Undocumented request params + +If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request +options. + +#### Undocumented response properties + +To access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You +can also get all the extra fields on the Pydantic model as a dict with +[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra). + +### Configuring the HTTP client + +You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including: + +- Support for proxies +- Custom transports +- Additional [advanced](https://www.python-httpx.org/advanced/#client-instances) functionality + +```python +from runloop import Runloop, DefaultHttpxClient + +client = Runloop( + # Or use the `RUNLOOP_BASE_URL` env var + base_url="http://my.test.server.example.com:8083", + http_client=DefaultHttpxClient( + proxies="http://my.test.proxy.example.com", + transport=httpx.HTTPTransport(local_address="0.0.0.0"), + ), +) +``` + +### Managing HTTP resources + +By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting. + +## Versioning + +This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions: + +1. Changes that only affect static types, without breaking runtime behavior. +2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_. +3. Changes that we do not expect to impact the vast majority of users in practice. + +We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. + +We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/runloop-python/issues) with questions, bugs, or suggestions. + +## Requirements + +Python 3.7 or higher. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..234cb1f83 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,27 @@ +# Security Policy + +## Reporting Security Issues + +This SDK is generated by [Stainless Software Inc](http://stainlessapi.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. + +To report a security issue, please contact the Stainless team at security@stainlessapi.com. + +## Responsible Disclosure + +We appreciate the efforts of security researchers and individuals who help us maintain the security of +SDKs we generate. If you believe you have found a security vulnerability, please adhere to responsible +disclosure practices by allowing us a reasonable amount of time to investigate and address the issue +before making any information public. + +## Reporting Non-SDK Related Security Issues + +If you encounter security issues that are not directly related to SDKs but pertain to the services +or products provided by Runloop please follow the respective company's security reporting guidelines. + +### Runloop Terms and Policies + +Please contact support@runloop.ai for any questions or concerns regarding security of our services. + +--- + +Thank you for helping us keep the SDKs and systems they interact with secure. diff --git a/api.md b/api.md new file mode 100644 index 000000000..e8481caca --- /dev/null +++ b/api.md @@ -0,0 +1,160 @@ +# Shared Types + +```python +from runloop.types import FunctionInvocationDetail +``` + +# CodeHandles + +Types: + +```python +from runloop.types import CodeHandle, CodeHandleList +``` + +Methods: + +- client.code_handles.create(\*\*params) -> CodeHandle +- client.code_handles.list(\*\*params) -> CodeHandleList + +# Devboxes + +Types: + +```python +from runloop.types import Devbox, DevboxList +``` + +Methods: + +- client.devboxes.create(\*\*params) -> Devbox +- client.devboxes.retrieve(id) -> Devbox +- client.devboxes.list(\*\*params) -> DevboxList +- client.devboxes.shutdown(id) -> Devbox + +## Logs + +Types: + +```python +from runloop.types.devboxes import DevboxLogsList +``` + +Methods: + +- client.devboxes.logs.list(id) -> DevboxLogsList + +# Functions + +Types: + +```python +from runloop.types import FunctionList +``` + +Methods: + +- client.functions.list() -> FunctionList +- client.functions.invoke_async(function_name, \*, project_name, \*\*params) -> FunctionInvocationDetail +- client.functions.invoke_sync(function_name, \*, project_name, \*\*params) -> FunctionInvocationDetail + +## Invocations + +Types: + +```python +from runloop.types.functions import FunctionInvocationList, KillOperationResponse +``` + +Methods: + +- client.functions.invocations.retrieve(invocation_id) -> FunctionInvocationDetail +- client.functions.invocations.list() -> FunctionInvocationList +- client.functions.invocations.kill(invocation_id) -> object + +### Spans + +Types: + +```python +from runloop.types.functions.invocations import InvocationSpanList +``` + +Methods: + +- client.functions.invocations.spans.list(invocation_id) -> InvocationSpanList + +## OpenAPI + +Types: + +```python +from runloop.types.functions import OpenAPIRetrieveResponse +``` + +Methods: + +- client.functions.openapi.retrieve() -> object + +# Latches + +Types: + +```python +from runloop.types import EmptyRecord +``` + +Methods: + +- client.latches.fulfill(latch_id, \*\*params) -> object + +# Projects + +Types: + +```python +from runloop.types import ProjectList +``` + +Methods: + +- client.projects.list() -> ProjectList + +## Logs + +Types: + +```python +from runloop.types.projects import ProjectLogs +``` + +Methods: + +- client.projects.logs.list(id) -> ProjectLogs + +# Sessions + +## Sessions + +Types: + +```python +from runloop.types.sessions import Session, SessionList +``` + +Methods: + +- client.sessions.sessions.create() -> Session +- client.sessions.sessions.list() -> SessionList + +### Kv + +Types: + +```python +from runloop.types.sessions.sessions import SessionKv +``` + +Methods: + +- client.sessions.sessions.kv.list(session_id, \*\*params) -> SessionKv diff --git a/bin/publish-pypi b/bin/publish-pypi new file mode 100644 index 000000000..826054e92 --- /dev/null +++ b/bin/publish-pypi @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -eux +mkdir -p dist +rye build --clean +rye publish --yes --token=$PYPI_TOKEN diff --git a/examples/.keep b/examples/.keep new file mode 100644 index 000000000..d8c73e937 --- /dev/null +++ b/examples/.keep @@ -0,0 +1,4 @@ +File generated from our OpenAPI spec by Stainless. + +This directory can be used to store example files demonstrating usage of this SDK. +It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. \ No newline at end of file diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 000000000..1ee85e698 --- /dev/null +++ b/mypy.ini @@ -0,0 +1,47 @@ +[mypy] +pretty = True +show_error_codes = True + +# Exclude _files.py because mypy isn't smart enough to apply +# the correct type narrowing and as this is an internal module +# it's fine to just use Pyright. +exclude = ^(src/runloop/_files\.py|_dev/.*\.py)$ + +strict_equality = True +implicit_reexport = True +check_untyped_defs = True +no_implicit_optional = True + +warn_return_any = True +warn_unreachable = True +warn_unused_configs = True + +# Turn these options off as it could cause conflicts +# with the Pyright options. +warn_unused_ignores = False +warn_redundant_casts = False + +disallow_any_generics = True +disallow_untyped_defs = True +disallow_untyped_calls = True +disallow_subclassing_any = True +disallow_incomplete_defs = True +disallow_untyped_decorators = True +cache_fine_grained = True + +# By default, mypy reports an error if you assign a value to the result +# of a function call that doesn't return anything. We do this in our test +# cases: +# ``` +# result = ... +# assert result is None +# ``` +# Changing this codegen to make mypy happy would increase complexity +# and would not be worth it. +disable_error_code = func-returns-value + +# https://github.com/python/mypy/issues/12162 +[mypy.overrides] +module = "black.files.*" +ignore_errors = true +ignore_missing_imports = true diff --git a/noxfile.py b/noxfile.py new file mode 100644 index 000000000..53bca7ff2 --- /dev/null +++ b/noxfile.py @@ -0,0 +1,9 @@ +import nox + + +@nox.session(reuse_venv=True, name="test-pydantic-v1") +def test_pydantic_v1(session: nox.Session) -> None: + session.install("-r", "requirements-dev.lock") + session.install("pydantic<2") + + session.run("pytest", "--showlocals", "--ignore=tests/functional", *session.posargs) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..24a36fd0a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,196 @@ +[project] +name = "runloop" +version = "0.0.1-alpha.0" +description = "The official Python library for the runloop API" +dynamic = ["readme"] +license = "Apache-2.0" +authors = [ +{ name = "Runloop", email = "support@runloop.ai" }, +] +dependencies = [ + "httpx>=0.23.0, <1", + "pydantic>=1.9.0, <3", + "typing-extensions>=4.7, <5", + "anyio>=3.5.0, <5", + "distro>=1.7.0, <2", + "sniffio", + "cached-property; python_version < '3.8'", + +] +requires-python = ">= 3.7" +classifiers = [ + "Typing :: Typed", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Operating System :: OS Independent", + "Operating System :: POSIX", + "Operating System :: MacOS", + "Operating System :: POSIX :: Linux", + "Operating System :: Microsoft :: Windows", + "Topic :: Software Development :: Libraries :: Python Modules", + "License :: OSI Approved :: Apache Software License" +] + + + +[project.urls] +Homepage = "https://github.com/stainless-sdks/runloop-python" +Repository = "https://github.com/stainless-sdks/runloop-python" + + + +[tool.rye] +managed = true +# version pins are in requirements-dev.lock +dev-dependencies = [ + "pyright>=1.1.359", + "mypy", + "respx", + "pytest", + "pytest-asyncio", + "ruff", + "time-machine", + "nox", + "dirty-equals>=0.6.0", + "importlib-metadata>=6.7.0", + +] + +[tool.rye.scripts] +format = { chain = [ + "format:ruff", + "format:docs", + "fix:ruff", +]} +"format:black" = "black ." +"format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md" +"format:ruff" = "ruff format" +"format:isort" = "isort ." + +"lint" = { chain = [ + "check:ruff", + "typecheck", +]} +"check:ruff" = "ruff ." +"fix:ruff" = "ruff --fix ." + +typecheck = { chain = [ + "typecheck:pyright", + "typecheck:mypy" +]} +"typecheck:pyright" = "pyright" +"typecheck:verify-types" = "pyright --verifytypes runloop --ignoreexternal" +"typecheck:mypy" = "mypy ." + +[build-system] +requires = ["hatchling", "hatch-fancy-pypi-readme"] +build-backend = "hatchling.build" + +[tool.hatch.build] +include = [ + "src/*" +] + +[tool.hatch.build.targets.wheel] +packages = ["src/runloop"] + +[tool.hatch.metadata.hooks.fancy-pypi-readme] +content-type = "text/markdown" + +[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]] +path = "README.md" + +[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] +# replace relative links with absolute links +pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)' +replacement = '[\1](https://github.com/stainless-sdks/runloop-python/tree/main/\g<2>)' + +[tool.black] +line-length = 120 +target-version = ["py37"] + +[tool.pytest.ini_options] +testpaths = ["tests"] +addopts = "--tb=short" +xfail_strict = true +asyncio_mode = "auto" +filterwarnings = [ + "error" +] + +[tool.pyright] +# this enables practically every flag given by pyright. +# there are a couple of flags that are still disabled by +# default in strict mode as they are experimental and niche. +typeCheckingMode = "strict" +pythonVersion = "3.7" + +exclude = [ + "_dev", + ".venv", + ".nox", +] + +reportImplicitOverride = true + +reportImportCycles = false +reportPrivateUsage = false + + +[tool.ruff] +line-length = 120 +output-format = "grouped" +target-version = "py37" +select = [ + # isort + "I", + # bugbear rules + "B", + # remove unused imports + "F401", + # bare except statements + "E722", + # unused arguments + "ARG", + # print statements + "T201", + "T203", + # misuse of typing.TYPE_CHECKING + "TCH004", + # import rules + "TID251", +] +ignore = [ + # mutable defaults + "B006", +] +unfixable = [ + # disable auto fix for print statements + "T201", + "T203", +] +ignore-init-module-imports = true + +[tool.ruff.format] +docstring-code-format = true + +[tool.ruff.lint.flake8-tidy-imports.banned-api] +"functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead" + +[tool.ruff.lint.isort] +length-sort = true +length-sort-straight = true +combine-as-imports = true +extra-standard-library = ["typing_extensions"] +known-first-party = ["runloop", "tests"] + +[tool.ruff.per-file-ignores] +"bin/**.py" = ["T201", "T203"] +"scripts/**.py" = ["T201", "T203"] +"tests/**.py" = ["T201", "T203"] +"examples/**.py" = ["T201", "T203"] diff --git a/requirements-dev.lock b/requirements-dev.lock new file mode 100644 index 000000000..a29b399e0 --- /dev/null +++ b/requirements-dev.lock @@ -0,0 +1,96 @@ +# generated by rye +# use `rye lock` or `rye sync` to update this lockfile +# +# last locked with the following flags: +# pre: false +# features: [] +# all-features: true +# with-sources: false + +-e file:. +annotated-types==0.6.0 + # via pydantic +anyio==4.1.0 + # via httpx + # via runloop +argcomplete==3.1.2 + # via nox +attrs==23.1.0 + # via pytest +certifi==2023.7.22 + # via httpcore + # via httpx +colorlog==6.7.0 + # via nox +dirty-equals==0.6.0 +distlib==0.3.7 + # via virtualenv +distro==1.8.0 + # via runloop +exceptiongroup==1.1.3 + # via anyio +filelock==3.12.4 + # via virtualenv +h11==0.14.0 + # via httpcore +httpcore==1.0.2 + # via httpx +httpx==0.25.2 + # via respx + # via runloop +idna==3.4 + # via anyio + # via httpx +importlib-metadata==7.0.0 +iniconfig==2.0.0 + # via pytest +mypy==1.7.1 +mypy-extensions==1.0.0 + # via mypy +nodeenv==1.8.0 + # via pyright +nox==2023.4.22 +packaging==23.2 + # via nox + # via pytest +platformdirs==3.11.0 + # via virtualenv +pluggy==1.3.0 + # via pytest +py==1.11.0 + # via pytest +pydantic==2.7.1 + # via runloop +pydantic-core==2.18.2 + # via pydantic +pyright==1.1.364 +pytest==7.1.1 + # via pytest-asyncio +pytest-asyncio==0.21.1 +python-dateutil==2.8.2 + # via time-machine +pytz==2023.3.post1 + # via dirty-equals +respx==0.20.2 +ruff==0.1.9 +setuptools==68.2.2 + # via nodeenv +six==1.16.0 + # via python-dateutil +sniffio==1.3.0 + # via anyio + # via httpx + # via runloop +time-machine==2.9.0 +tomli==2.0.1 + # via mypy + # via pytest +typing-extensions==4.8.0 + # via mypy + # via pydantic + # via pydantic-core + # via runloop +virtualenv==20.24.5 + # via nox +zipp==3.17.0 + # via importlib-metadata diff --git a/requirements.lock b/requirements.lock new file mode 100644 index 000000000..d9b4c33c7 --- /dev/null +++ b/requirements.lock @@ -0,0 +1,43 @@ +# generated by rye +# use `rye lock` or `rye sync` to update this lockfile +# +# last locked with the following flags: +# pre: false +# features: [] +# all-features: true +# with-sources: false + +-e file:. +annotated-types==0.6.0 + # via pydantic +anyio==4.1.0 + # via httpx + # via runloop +certifi==2023.7.22 + # via httpcore + # via httpx +distro==1.8.0 + # via runloop +exceptiongroup==1.1.3 + # via anyio +h11==0.14.0 + # via httpcore +httpcore==1.0.2 + # via httpx +httpx==0.25.2 + # via runloop +idna==3.4 + # via anyio + # via httpx +pydantic==2.7.1 + # via runloop +pydantic-core==2.18.2 + # via pydantic +sniffio==1.3.0 + # via anyio + # via httpx + # via runloop +typing-extensions==4.8.0 + # via pydantic + # via pydantic-core + # via runloop diff --git a/scripts/bootstrap b/scripts/bootstrap new file mode 100755 index 000000000..8c5c60eba --- /dev/null +++ b/scripts/bootstrap @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then + brew bundle check >/dev/null 2>&1 || { + echo "==> Installing Homebrew dependencies…" + brew bundle + } +fi + +echo "==> Installing Python dependencies…" + +# experimental uv support makes installations significantly faster +rye config --set-bool behavior.use-uv=true + +rye sync --all-features diff --git a/scripts/format b/scripts/format new file mode 100755 index 000000000..667ec2d7a --- /dev/null +++ b/scripts/format @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +echo "==> Running formatters" +rye run format diff --git a/scripts/lint b/scripts/lint new file mode 100755 index 000000000..18d34a469 --- /dev/null +++ b/scripts/lint @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +echo "==> Running lints" +rye run lint + +echo "==> Making sure it imports" +rye run python -c 'import runloop' + diff --git a/scripts/mock b/scripts/mock new file mode 100755 index 000000000..fe89a1d08 --- /dev/null +++ b/scripts/mock @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +if [[ -n "$1" && "$1" != '--'* ]]; then + URL="$1" + shift +else + URL="$(grep 'openapi_spec_url' .stats.yml | cut -d' ' -f2)" +fi + +# Check if the URL is empty +if [ -z "$URL" ]; then + echo "Error: No OpenAPI spec path/url provided or found in .stats.yml" + exit 1 +fi + +echo "==> Starting mock server with URL ${URL}" + +# Run prism mock on the given spec +if [ "$1" == "--daemon" ]; then + npm exec --package=@stoplight/prism-cli@~5.8 -- prism mock "$URL" &> .prism.log & + + # Wait for server to come online + echo -n "Waiting for server" + while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + echo -n "." + sleep 0.1 + done + + if grep -q "✖ fatal" ".prism.log"; then + cat .prism.log + exit 1 + fi + + echo +else + npm exec --package=@stoplight/prism-cli@~5.8 -- prism mock "$URL" +fi diff --git a/scripts/test b/scripts/test new file mode 100755 index 000000000..b3ace9013 --- /dev/null +++ b/scripts/test @@ -0,0 +1,56 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +NC='\033[0m' # No Color + +function prism_is_running() { + curl --silent "http://localhost:4010" >/dev/null 2>&1 +} + +kill_server_on_port() { + pids=$(lsof -t -i tcp:"$1" || echo "") + if [ "$pids" != "" ]; then + kill "$pids" + echo "Stopped $pids." + fi +} + +function is_overriding_api_base_url() { + [ -n "$TEST_API_BASE_URL" ] +} + +if ! is_overriding_api_base_url && ! prism_is_running ; then + # When we exit this script, make sure to kill the background mock server process + trap 'kill_server_on_port 4010' EXIT + + # Start the dev server + ./scripts/mock --daemon +fi + +if is_overriding_api_base_url ; then + echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" + echo +elif ! prism_is_running ; then + echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" + echo -e "running against your OpenAPI spec." + echo + echo -e "To run the server, pass in the path or url of your OpenAPI" + echo -e "spec to the prism command:" + echo + echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}" + echo + + exit 1 +else + echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" + echo +fi + +echo "==> Running tests" +rye run pytest "$@" diff --git a/scripts/utils/ruffen-docs.py b/scripts/utils/ruffen-docs.py new file mode 100644 index 000000000..37b3d94f0 --- /dev/null +++ b/scripts/utils/ruffen-docs.py @@ -0,0 +1,167 @@ +# fork of https://github.com/asottile/blacken-docs adapted for ruff +from __future__ import annotations + +import re +import sys +import argparse +import textwrap +import contextlib +import subprocess +from typing import Match, Optional, Sequence, Generator, NamedTuple, cast + +MD_RE = re.compile( + r"(?P^(?P *)```\s*python\n)" r"(?P.*?)" r"(?P^(?P=indent)```\s*$)", + re.DOTALL | re.MULTILINE, +) +MD_PYCON_RE = re.compile( + r"(?P^(?P *)```\s*pycon\n)" r"(?P.*?)" r"(?P^(?P=indent)```.*$)", + re.DOTALL | re.MULTILINE, +) +PYCON_PREFIX = ">>> " +PYCON_CONTINUATION_PREFIX = "..." +PYCON_CONTINUATION_RE = re.compile( + rf"^{re.escape(PYCON_CONTINUATION_PREFIX)}( |$)", +) +DEFAULT_LINE_LENGTH = 100 + + +class CodeBlockError(NamedTuple): + offset: int + exc: Exception + + +def format_str( + src: str, +) -> tuple[str, Sequence[CodeBlockError]]: + errors: list[CodeBlockError] = [] + + @contextlib.contextmanager + def _collect_error(match: Match[str]) -> Generator[None, None, None]: + try: + yield + except Exception as e: + errors.append(CodeBlockError(match.start(), e)) + + def _md_match(match: Match[str]) -> str: + code = textwrap.dedent(match["code"]) + with _collect_error(match): + code = format_code_block(code) + code = textwrap.indent(code, match["indent"]) + return f'{match["before"]}{code}{match["after"]}' + + def _pycon_match(match: Match[str]) -> str: + code = "" + fragment = cast(Optional[str], None) + + def finish_fragment() -> None: + nonlocal code + nonlocal fragment + + if fragment is not None: + with _collect_error(match): + fragment = format_code_block(fragment) + fragment_lines = fragment.splitlines() + code += f"{PYCON_PREFIX}{fragment_lines[0]}\n" + for line in fragment_lines[1:]: + # Skip blank lines to handle Black adding a blank above + # functions within blocks. A blank line would end the REPL + # continuation prompt. + # + # >>> if True: + # ... def f(): + # ... pass + # ... + if line: + code += f"{PYCON_CONTINUATION_PREFIX} {line}\n" + if fragment_lines[-1].startswith(" "): + code += f"{PYCON_CONTINUATION_PREFIX}\n" + fragment = None + + indentation = None + for line in match["code"].splitlines(): + orig_line, line = line, line.lstrip() + if indentation is None and line: + indentation = len(orig_line) - len(line) + continuation_match = PYCON_CONTINUATION_RE.match(line) + if continuation_match and fragment is not None: + fragment += line[continuation_match.end() :] + "\n" + else: + finish_fragment() + if line.startswith(PYCON_PREFIX): + fragment = line[len(PYCON_PREFIX) :] + "\n" + else: + code += orig_line[indentation:] + "\n" + finish_fragment() + return code + + def _md_pycon_match(match: Match[str]) -> str: + code = _pycon_match(match) + code = textwrap.indent(code, match["indent"]) + return f'{match["before"]}{code}{match["after"]}' + + src = MD_RE.sub(_md_match, src) + src = MD_PYCON_RE.sub(_md_pycon_match, src) + return src, errors + + +def format_code_block(code: str) -> str: + return subprocess.check_output( + [ + sys.executable, + "-m", + "ruff", + "format", + "--stdin-filename=script.py", + f"--line-length={DEFAULT_LINE_LENGTH}", + ], + encoding="utf-8", + input=code, + ) + + +def format_file( + filename: str, + skip_errors: bool, +) -> int: + with open(filename, encoding="UTF-8") as f: + contents = f.read() + new_contents, errors = format_str(contents) + for error in errors: + lineno = contents[: error.offset].count("\n") + 1 + print(f"{filename}:{lineno}: code block parse error {error.exc}") + if errors and not skip_errors: + return 1 + if contents != new_contents: + print(f"{filename}: Rewriting...") + with open(filename, "w", encoding="UTF-8") as f: + f.write(new_contents) + return 0 + else: + return 0 + + +def main(argv: Sequence[str] | None = None) -> int: + parser = argparse.ArgumentParser() + parser.add_argument( + "-l", + "--line-length", + type=int, + default=DEFAULT_LINE_LENGTH, + ) + parser.add_argument( + "-S", + "--skip-string-normalization", + action="store_true", + ) + parser.add_argument("-E", "--skip-errors", action="store_true") + parser.add_argument("filenames", nargs="*") + args = parser.parse_args(argv) + + retv = 0 + for filename in args.filenames: + retv |= format_file(filename, skip_errors=args.skip_errors) + return retv + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/src/runloop/__init__.py b/src/runloop/__init__.py new file mode 100644 index 000000000..e41010c25 --- /dev/null +++ b/src/runloop/__init__.py @@ -0,0 +1,83 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from . import types +from ._types import NOT_GIVEN, NoneType, NotGiven, Transport, ProxiesTypes +from ._utils import file_from_path +from ._client import Client, Stream, Runloop, Timeout, Transport, AsyncClient, AsyncStream, AsyncRunloop, RequestOptions +from ._models import BaseModel +from ._version import __title__, __version__ +from ._response import APIResponse as APIResponse, AsyncAPIResponse as AsyncAPIResponse +from ._constants import DEFAULT_TIMEOUT, DEFAULT_MAX_RETRIES, DEFAULT_CONNECTION_LIMITS +from ._exceptions import ( + APIError, + RunloopError, + ConflictError, + NotFoundError, + APIStatusError, + RateLimitError, + APITimeoutError, + BadRequestError, + APIConnectionError, + AuthenticationError, + InternalServerError, + PermissionDeniedError, + UnprocessableEntityError, + APIResponseValidationError, +) +from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient +from ._utils._logs import setup_logging as _setup_logging + +__all__ = [ + "types", + "__version__", + "__title__", + "NoneType", + "Transport", + "ProxiesTypes", + "NotGiven", + "NOT_GIVEN", + "RunloopError", + "APIError", + "APIStatusError", + "APITimeoutError", + "APIConnectionError", + "APIResponseValidationError", + "BadRequestError", + "AuthenticationError", + "PermissionDeniedError", + "NotFoundError", + "ConflictError", + "UnprocessableEntityError", + "RateLimitError", + "InternalServerError", + "Timeout", + "RequestOptions", + "Client", + "AsyncClient", + "Stream", + "AsyncStream", + "Runloop", + "AsyncRunloop", + "file_from_path", + "BaseModel", + "DEFAULT_TIMEOUT", + "DEFAULT_MAX_RETRIES", + "DEFAULT_CONNECTION_LIMITS", + "DefaultHttpxClient", + "DefaultAsyncHttpxClient", +] + +_setup_logging() + +# Update the __module__ attribute for exported symbols so that +# error messages point to this module instead of the module +# it was originally defined in, e.g. +# runloop._exceptions.NotFoundError -> runloop.NotFoundError +__locals = locals() +for __name in __all__: + if not __name.startswith("__"): + try: + __locals[__name].__module__ = "runloop" + except (TypeError, AttributeError): + # Some of our exported symbols are builtins which we can't set attributes for. + pass diff --git a/src/runloop/_base_client.py b/src/runloop/_base_client.py new file mode 100644 index 000000000..c3136ad16 --- /dev/null +++ b/src/runloop/_base_client.py @@ -0,0 +1,1997 @@ +from __future__ import annotations + +import json +import time +import uuid +import email +import asyncio +import inspect +import logging +import platform +import warnings +import email.utils +from types import TracebackType +from random import random +from typing import ( + TYPE_CHECKING, + Any, + Dict, + Type, + Union, + Generic, + Mapping, + TypeVar, + Iterable, + Iterator, + Optional, + Generator, + AsyncIterator, + cast, + overload, +) +from typing_extensions import Literal, override, get_origin + +import anyio +import httpx +import distro +import pydantic +from httpx import URL, Limits +from pydantic import PrivateAttr + +from . import _exceptions +from ._qs import Querystring +from ._files import to_httpx_files, async_to_httpx_files +from ._types import ( + NOT_GIVEN, + Body, + Omit, + Query, + Headers, + Timeout, + NotGiven, + ResponseT, + Transport, + AnyMapping, + PostParser, + ProxiesTypes, + RequestFiles, + HttpxSendArgs, + AsyncTransport, + RequestOptions, + ModelBuilderProtocol, +) +from ._utils import is_dict, is_list, is_given, lru_cache, is_mapping +from ._compat import model_copy, model_dump +from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type +from ._response import ( + APIResponse, + BaseAPIResponse, + AsyncAPIResponse, + extract_response_type, +) +from ._constants import ( + DEFAULT_TIMEOUT, + MAX_RETRY_DELAY, + DEFAULT_MAX_RETRIES, + INITIAL_RETRY_DELAY, + RAW_RESPONSE_HEADER, + OVERRIDE_CAST_TO_HEADER, + DEFAULT_CONNECTION_LIMITS, +) +from ._streaming import Stream, SSEDecoder, AsyncStream, SSEBytesDecoder +from ._exceptions import ( + APIStatusError, + APITimeoutError, + APIConnectionError, + APIResponseValidationError, +) + +log: logging.Logger = logging.getLogger(__name__) + +# TODO: make base page type vars covariant +SyncPageT = TypeVar("SyncPageT", bound="BaseSyncPage[Any]") +AsyncPageT = TypeVar("AsyncPageT", bound="BaseAsyncPage[Any]") + + +_T = TypeVar("_T") +_T_co = TypeVar("_T_co", covariant=True) + +_StreamT = TypeVar("_StreamT", bound=Stream[Any]) +_AsyncStreamT = TypeVar("_AsyncStreamT", bound=AsyncStream[Any]) + +if TYPE_CHECKING: + from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT +else: + try: + from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT + except ImportError: + # taken from https://github.com/encode/httpx/blob/3ba5fe0d7ac70222590e759c31442b1cab263791/httpx/_config.py#L366 + HTTPX_DEFAULT_TIMEOUT = Timeout(5.0) + + +class PageInfo: + """Stores the necessary information to build the request to retrieve the next page. + + Either `url` or `params` must be set. + """ + + url: URL | NotGiven + params: Query | NotGiven + + @overload + def __init__( + self, + *, + url: URL, + ) -> None: + ... + + @overload + def __init__( + self, + *, + params: Query, + ) -> None: + ... + + def __init__( + self, + *, + url: URL | NotGiven = NOT_GIVEN, + params: Query | NotGiven = NOT_GIVEN, + ) -> None: + self.url = url + self.params = params + + +class BasePage(GenericModel, Generic[_T]): + """ + Defines the core interface for pagination. + + Type Args: + ModelT: The pydantic model that represents an item in the response. + + Methods: + has_next_page(): Check if there is another page available + next_page_info(): Get the necessary information to make a request for the next page + """ + + _options: FinalRequestOptions = PrivateAttr() + _model: Type[_T] = PrivateAttr() + + def has_next_page(self) -> bool: + items = self._get_page_items() + if not items: + return False + return self.next_page_info() is not None + + def next_page_info(self) -> Optional[PageInfo]: + ... + + def _get_page_items(self) -> Iterable[_T]: # type: ignore[empty-body] + ... + + def _params_from_url(self, url: URL) -> httpx.QueryParams: + # TODO: do we have to preprocess params here? + return httpx.QueryParams(cast(Any, self._options.params)).merge(url.params) + + def _info_to_options(self, info: PageInfo) -> FinalRequestOptions: + options = model_copy(self._options) + options._strip_raw_response_header() + + if not isinstance(info.params, NotGiven): + options.params = {**options.params, **info.params} + return options + + if not isinstance(info.url, NotGiven): + params = self._params_from_url(info.url) + url = info.url.copy_with(params=params) + options.params = dict(url.params) + options.url = str(url) + return options + + raise ValueError("Unexpected PageInfo state") + + +class BaseSyncPage(BasePage[_T], Generic[_T]): + _client: SyncAPIClient = pydantic.PrivateAttr() + + def _set_private_attributes( + self, + client: SyncAPIClient, + model: Type[_T], + options: FinalRequestOptions, + ) -> None: + self._model = model + self._client = client + self._options = options + + # Pydantic uses a custom `__iter__` method to support casting BaseModels + # to dictionaries. e.g. dict(model). + # As we want to support `for item in page`, this is inherently incompatible + # with the default pydantic behaviour. It is not possible to support both + # use cases at once. Fortunately, this is not a big deal as all other pydantic + # methods should continue to work as expected as there is an alternative method + # to cast a model to a dictionary, model.dict(), which is used internally + # by pydantic. + def __iter__(self) -> Iterator[_T]: # type: ignore + for page in self.iter_pages(): + for item in page._get_page_items(): + yield item + + def iter_pages(self: SyncPageT) -> Iterator[SyncPageT]: + page = self + while True: + yield page + if page.has_next_page(): + page = page.get_next_page() + else: + return + + def get_next_page(self: SyncPageT) -> SyncPageT: + info = self.next_page_info() + if not info: + raise RuntimeError( + "No next page expected; please check `.has_next_page()` before calling `.get_next_page()`." + ) + + options = self._info_to_options(info) + return self._client._request_api_list(self._model, page=self.__class__, options=options) + + +class AsyncPaginator(Generic[_T, AsyncPageT]): + def __init__( + self, + client: AsyncAPIClient, + options: FinalRequestOptions, + page_cls: Type[AsyncPageT], + model: Type[_T], + ) -> None: + self._model = model + self._client = client + self._options = options + self._page_cls = page_cls + + def __await__(self) -> Generator[Any, None, AsyncPageT]: + return self._get_page().__await__() + + async def _get_page(self) -> AsyncPageT: + def _parser(resp: AsyncPageT) -> AsyncPageT: + resp._set_private_attributes( + model=self._model, + options=self._options, + client=self._client, + ) + return resp + + self._options.post_parser = _parser + + return await self._client.request(self._page_cls, self._options) + + async def __aiter__(self) -> AsyncIterator[_T]: + # https://github.com/microsoft/pyright/issues/3464 + page = cast( + AsyncPageT, + await self, # type: ignore + ) + async for item in page: + yield item + + +class BaseAsyncPage(BasePage[_T], Generic[_T]): + _client: AsyncAPIClient = pydantic.PrivateAttr() + + def _set_private_attributes( + self, + model: Type[_T], + client: AsyncAPIClient, + options: FinalRequestOptions, + ) -> None: + self._model = model + self._client = client + self._options = options + + async def __aiter__(self) -> AsyncIterator[_T]: + async for page in self.iter_pages(): + for item in page._get_page_items(): + yield item + + async def iter_pages(self: AsyncPageT) -> AsyncIterator[AsyncPageT]: + page = self + while True: + yield page + if page.has_next_page(): + page = await page.get_next_page() + else: + return + + async def get_next_page(self: AsyncPageT) -> AsyncPageT: + info = self.next_page_info() + if not info: + raise RuntimeError( + "No next page expected; please check `.has_next_page()` before calling `.get_next_page()`." + ) + + options = self._info_to_options(info) + return await self._client._request_api_list(self._model, page=self.__class__, options=options) + + +_HttpxClientT = TypeVar("_HttpxClientT", bound=Union[httpx.Client, httpx.AsyncClient]) +_DefaultStreamT = TypeVar("_DefaultStreamT", bound=Union[Stream[Any], AsyncStream[Any]]) + + +class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]): + _client: _HttpxClientT + _version: str + _base_url: URL + max_retries: int + timeout: Union[float, Timeout, None] + _limits: httpx.Limits + _proxies: ProxiesTypes | None + _transport: Transport | AsyncTransport | None + _strict_response_validation: bool + _idempotency_header: str | None + _default_stream_cls: type[_DefaultStreamT] | None = None + + def __init__( + self, + *, + version: str, + base_url: str | URL, + _strict_response_validation: bool, + max_retries: int = DEFAULT_MAX_RETRIES, + timeout: float | Timeout | None = DEFAULT_TIMEOUT, + limits: httpx.Limits, + transport: Transport | AsyncTransport | None, + proxies: ProxiesTypes | None, + custom_headers: Mapping[str, str] | None = None, + custom_query: Mapping[str, object] | None = None, + ) -> None: + self._version = version + self._base_url = self._enforce_trailing_slash(URL(base_url)) + self.max_retries = max_retries + self.timeout = timeout + self._limits = limits + self._proxies = proxies + self._transport = transport + self._custom_headers = custom_headers or {} + self._custom_query = custom_query or {} + self._strict_response_validation = _strict_response_validation + self._idempotency_header = None + + if max_retries is None: # pyright: ignore[reportUnnecessaryComparison] + raise TypeError( + "max_retries cannot be None. If you want to disable retries, pass `0`; if you want unlimited retries, pass `math.inf` or a very high number; if you want the default behavior, pass `runloop.DEFAULT_MAX_RETRIES`" + ) + + def _enforce_trailing_slash(self, url: URL) -> URL: + if url.raw_path.endswith(b"/"): + return url + return url.copy_with(raw_path=url.raw_path + b"/") + + def _make_status_error_from_response( + self, + response: httpx.Response, + ) -> APIStatusError: + if response.is_closed and not response.is_stream_consumed: + # We can't read the response body as it has been closed + # before it was read. This can happen if an event hook + # raises a status error. + body = None + err_msg = f"Error code: {response.status_code}" + else: + err_text = response.text.strip() + body = err_text + + try: + body = json.loads(err_text) + err_msg = f"Error code: {response.status_code} - {body}" + except Exception: + err_msg = err_text or f"Error code: {response.status_code}" + + return self._make_status_error(err_msg, body=body, response=response) + + def _make_status_error( + self, + err_msg: str, + *, + body: object, + response: httpx.Response, + ) -> _exceptions.APIStatusError: + raise NotImplementedError() + + def _remaining_retries( + self, + remaining_retries: Optional[int], + options: FinalRequestOptions, + ) -> int: + return remaining_retries if remaining_retries is not None else options.get_max_retries(self.max_retries) + + def _build_headers(self, options: FinalRequestOptions) -> httpx.Headers: + custom_headers = options.headers or {} + headers_dict = _merge_mappings(self.default_headers, custom_headers) + self._validate_headers(headers_dict, custom_headers) + + # headers are case-insensitive while dictionaries are not. + headers = httpx.Headers(headers_dict) + + idempotency_header = self._idempotency_header + if idempotency_header and options.method.lower() != "get" and idempotency_header not in headers: + headers[idempotency_header] = options.idempotency_key or self._idempotency_key() + + return headers + + def _prepare_url(self, url: str) -> URL: + """ + Merge a URL argument together with any 'base_url' on the client, + to create the URL used for the outgoing request. + """ + # Copied from httpx's `_merge_url` method. + merge_url = URL(url) + if merge_url.is_relative_url: + merge_raw_path = self.base_url.raw_path + merge_url.raw_path.lstrip(b"/") + return self.base_url.copy_with(raw_path=merge_raw_path) + + return merge_url + + def _make_sse_decoder(self) -> SSEDecoder | SSEBytesDecoder: + return SSEDecoder() + + def _build_request( + self, + options: FinalRequestOptions, + ) -> httpx.Request: + if log.isEnabledFor(logging.DEBUG): + log.debug("Request options: %s", model_dump(options, exclude_unset=True)) + + kwargs: dict[str, Any] = {} + + json_data = options.json_data + if options.extra_json is not None: + if json_data is None: + json_data = cast(Body, options.extra_json) + elif is_mapping(json_data): + json_data = _merge_mappings(json_data, options.extra_json) + else: + raise RuntimeError(f"Unexpected JSON data type, {type(json_data)}, cannot merge with `extra_body`") + + headers = self._build_headers(options) + params = _merge_mappings(self.default_query, options.params) + content_type = headers.get("Content-Type") + + # If the given Content-Type header is multipart/form-data then it + # has to be removed so that httpx can generate the header with + # additional information for us as it has to be in this form + # for the server to be able to correctly parse the request: + # multipart/form-data; boundary=---abc-- + if content_type is not None and content_type.startswith("multipart/form-data"): + if "boundary" not in content_type: + # only remove the header if the boundary hasn't been explicitly set + # as the caller doesn't want httpx to come up with their own boundary + headers.pop("Content-Type") + + # As we are now sending multipart/form-data instead of application/json + # we need to tell httpx to use it, https://www.python-httpx.org/advanced/#multipart-file-encoding + if json_data: + if not is_dict(json_data): + raise TypeError( + f"Expected query input to be a dictionary for multipart requests but got {type(json_data)} instead." + ) + kwargs["data"] = self._serialize_multipartform(json_data) + + # TODO: report this error to httpx + return self._client.build_request( # pyright: ignore[reportUnknownMemberType] + headers=headers, + timeout=self.timeout if isinstance(options.timeout, NotGiven) else options.timeout, + method=options.method, + url=self._prepare_url(options.url), + # the `Query` type that we use is incompatible with qs' + # `Params` type as it needs to be typed as `Mapping[str, object]` + # so that passing a `TypedDict` doesn't cause an error. + # https://github.com/microsoft/pyright/issues/3526#event-6715453066 + params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None, + json=json_data, + files=options.files, + **kwargs, + ) + + def _serialize_multipartform(self, data: Mapping[object, object]) -> dict[str, object]: + items = self.qs.stringify_items( + # TODO: type ignore is required as stringify_items is well typed but we can't be + # well typed without heavy validation. + data, # type: ignore + array_format="brackets", + ) + serialized: dict[str, object] = {} + for key, value in items: + existing = serialized.get(key) + + if not existing: + serialized[key] = value + continue + + # If a value has already been set for this key then that + # means we're sending data like `array[]=[1, 2, 3]` and we + # need to tell httpx that we want to send multiple values with + # the same key which is done by using a list or a tuple. + # + # Note: 2d arrays should never result in the same key at both + # levels so it's safe to assume that if the value is a list, + # it was because we changed it to be a list. + if is_list(existing): + existing.append(value) + else: + serialized[key] = [existing, value] + + return serialized + + def _maybe_override_cast_to(self, cast_to: type[ResponseT], options: FinalRequestOptions) -> type[ResponseT]: + if not is_given(options.headers): + return cast_to + + # make a copy of the headers so we don't mutate user-input + headers = dict(options.headers) + + # we internally support defining a temporary header to override the + # default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response` + # see _response.py for implementation details + override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, NOT_GIVEN) + if is_given(override_cast_to): + options.headers = headers + return cast(Type[ResponseT], override_cast_to) + + return cast_to + + def _should_stream_response_body(self, request: httpx.Request) -> bool: + return request.headers.get(RAW_RESPONSE_HEADER) == "stream" # type: ignore[no-any-return] + + def _process_response_data( + self, + *, + data: object, + cast_to: type[ResponseT], + response: httpx.Response, + ) -> ResponseT: + if data is None: + return cast(ResponseT, None) + + if cast_to is object: + return cast(ResponseT, data) + + try: + if inspect.isclass(cast_to) and issubclass(cast_to, ModelBuilderProtocol): + return cast(ResponseT, cast_to.build(response=response, data=data)) + + if self._strict_response_validation: + return cast(ResponseT, validate_type(type_=cast_to, value=data)) + + return cast(ResponseT, construct_type(type_=cast_to, value=data)) + except pydantic.ValidationError as err: + raise APIResponseValidationError(response=response, body=data) from err + + @property + def qs(self) -> Querystring: + return Querystring() + + @property + def custom_auth(self) -> httpx.Auth | None: + return None + + @property + def auth_headers(self) -> dict[str, str]: + return {} + + @property + def default_headers(self) -> dict[str, str | Omit]: + return { + "Accept": "application/json", + "Content-Type": "application/json", + "User-Agent": self.user_agent, + **self.platform_headers(), + **self.auth_headers, + **self._custom_headers, + } + + @property + def default_query(self) -> dict[str, object]: + return { + **self._custom_query, + } + + def _validate_headers( + self, + headers: Headers, # noqa: ARG002 + custom_headers: Headers, # noqa: ARG002 + ) -> None: + """Validate the given default headers and custom headers. + + Does nothing by default. + """ + return + + @property + def user_agent(self) -> str: + return f"{self.__class__.__name__}/Python {self._version}" + + @property + def base_url(self) -> URL: + return self._base_url + + @base_url.setter + def base_url(self, url: URL | str) -> None: + self._base_url = self._enforce_trailing_slash(url if isinstance(url, URL) else URL(url)) + + def platform_headers(self) -> Dict[str, str]: + return platform_headers(self._version) + + def _parse_retry_after_header(self, response_headers: Optional[httpx.Headers] = None) -> float | None: + """Returns a float of the number of seconds (not milliseconds) to wait after retrying, or None if unspecified. + + About the Retry-After header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After + See also https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After#syntax + """ + if response_headers is None: + return None + + # First, try the non-standard `retry-after-ms` header for milliseconds, + # which is more precise than integer-seconds `retry-after` + try: + retry_ms_header = response_headers.get("retry-after-ms", None) + return float(retry_ms_header) / 1000 + except (TypeError, ValueError): + pass + + # Next, try parsing `retry-after` header as seconds (allowing nonstandard floats). + retry_header = response_headers.get("retry-after") + try: + # note: the spec indicates that this should only ever be an integer + # but if someone sends a float there's no reason for us to not respect it + return float(retry_header) + except (TypeError, ValueError): + pass + + # Last, try parsing `retry-after` as a date. + retry_date_tuple = email.utils.parsedate_tz(retry_header) + if retry_date_tuple is None: + return None + + retry_date = email.utils.mktime_tz(retry_date_tuple) + return float(retry_date - time.time()) + + def _calculate_retry_timeout( + self, + remaining_retries: int, + options: FinalRequestOptions, + response_headers: Optional[httpx.Headers] = None, + ) -> float: + max_retries = options.get_max_retries(self.max_retries) + + # If the API asks us to wait a certain amount of time (and it's a reasonable amount), just do what it says. + retry_after = self._parse_retry_after_header(response_headers) + if retry_after is not None and 0 < retry_after <= 60: + return retry_after + + nb_retries = max_retries - remaining_retries + + # Apply exponential backoff, but not more than the max. + sleep_seconds = min(INITIAL_RETRY_DELAY * pow(2.0, nb_retries), MAX_RETRY_DELAY) + + # Apply some jitter, plus-or-minus half a second. + jitter = 1 - 0.25 * random() + timeout = sleep_seconds * jitter + return timeout if timeout >= 0 else 0 + + def _should_retry(self, response: httpx.Response) -> bool: + # Note: this is not a standard header + should_retry_header = response.headers.get("x-should-retry") + + # If the server explicitly says whether or not to retry, obey. + if should_retry_header == "true": + log.debug("Retrying as header `x-should-retry` is set to `true`") + return True + if should_retry_header == "false": + log.debug("Not retrying as header `x-should-retry` is set to `false`") + return False + + # Retry on request timeouts. + if response.status_code == 408: + log.debug("Retrying due to status code %i", response.status_code) + return True + + # Retry on lock timeouts. + if response.status_code == 409: + log.debug("Retrying due to status code %i", response.status_code) + return True + + # Retry on rate limits. + if response.status_code == 429: + log.debug("Retrying due to status code %i", response.status_code) + return True + + # Retry internal errors. + if response.status_code >= 500: + log.debug("Retrying due to status code %i", response.status_code) + return True + + log.debug("Not retrying") + return False + + def _idempotency_key(self) -> str: + return f"stainless-python-retry-{uuid.uuid4()}" + + +class _DefaultHttpxClient(httpx.Client): + def __init__(self, **kwargs: Any) -> None: + kwargs.setdefault("timeout", DEFAULT_TIMEOUT) + kwargs.setdefault("limits", DEFAULT_CONNECTION_LIMITS) + kwargs.setdefault("follow_redirects", True) + super().__init__(**kwargs) + + +if TYPE_CHECKING: + DefaultHttpxClient = httpx.Client + """An alias to `httpx.Client` that provides the same defaults that this SDK + uses internally. + + This is useful because overriding the `http_client` with your own instance of + `httpx.Client` will result in httpx's defaults being used, not ours. + """ +else: + DefaultHttpxClient = _DefaultHttpxClient + + +class SyncHttpxClientWrapper(DefaultHttpxClient): + def __del__(self) -> None: + try: + self.close() + except Exception: + pass + + +class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]): + _client: httpx.Client + _default_stream_cls: type[Stream[Any]] | None = None + + def __init__( + self, + *, + version: str, + base_url: str | URL, + max_retries: int = DEFAULT_MAX_RETRIES, + timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + transport: Transport | None = None, + proxies: ProxiesTypes | None = None, + limits: Limits | None = None, + http_client: httpx.Client | None = None, + custom_headers: Mapping[str, str] | None = None, + custom_query: Mapping[str, object] | None = None, + _strict_response_validation: bool, + ) -> None: + if limits is not None: + warnings.warn( + "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead", + category=DeprecationWarning, + stacklevel=3, + ) + if http_client is not None: + raise ValueError("The `http_client` argument is mutually exclusive with `connection_pool_limits`") + else: + limits = DEFAULT_CONNECTION_LIMITS + + if transport is not None: + warnings.warn( + "The `transport` argument is deprecated. The `http_client` argument should be passed instead", + category=DeprecationWarning, + stacklevel=3, + ) + if http_client is not None: + raise ValueError("The `http_client` argument is mutually exclusive with `transport`") + + if proxies is not None: + warnings.warn( + "The `proxies` argument is deprecated. The `http_client` argument should be passed instead", + category=DeprecationWarning, + stacklevel=3, + ) + if http_client is not None: + raise ValueError("The `http_client` argument is mutually exclusive with `proxies`") + + if not is_given(timeout): + # if the user passed in a custom http client with a non-default + # timeout set then we use that timeout. + # + # note: there is an edge case here where the user passes in a client + # where they've explicitly set the timeout to match the default timeout + # as this check is structural, meaning that we'll think they didn't + # pass in a timeout and will ignore it + if http_client and http_client.timeout != HTTPX_DEFAULT_TIMEOUT: + timeout = http_client.timeout + else: + timeout = DEFAULT_TIMEOUT + + if http_client is not None and not isinstance(http_client, httpx.Client): # pyright: ignore[reportUnnecessaryIsInstance] + raise TypeError( + f"Invalid `http_client` argument; Expected an instance of `httpx.Client` but got {type(http_client)}" + ) + + super().__init__( + version=version, + limits=limits, + # cast to a valid type because mypy doesn't understand our type narrowing + timeout=cast(Timeout, timeout), + proxies=proxies, + base_url=base_url, + transport=transport, + max_retries=max_retries, + custom_query=custom_query, + custom_headers=custom_headers, + _strict_response_validation=_strict_response_validation, + ) + self._client = http_client or SyncHttpxClientWrapper( + base_url=base_url, + # cast to a valid type because mypy doesn't understand our type narrowing + timeout=cast(Timeout, timeout), + proxies=proxies, + transport=transport, + limits=limits, + follow_redirects=True, + ) + + def is_closed(self) -> bool: + return self._client.is_closed + + def close(self) -> None: + """Close the underlying HTTPX client. + + The client will *not* be usable after this. + """ + # If an error is thrown while constructing a client, self._client + # may not be present + if hasattr(self, "_client"): + self._client.close() + + def __enter__(self: _T) -> _T: + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + self.close() + + def _prepare_options( + self, + options: FinalRequestOptions, # noqa: ARG002 + ) -> None: + """Hook for mutating the given options""" + return None + + def _prepare_request( + self, + request: httpx.Request, # noqa: ARG002 + ) -> None: + """This method is used as a callback for mutating the `Request` object + after it has been constructed. + This is useful for cases where you want to add certain headers based off of + the request properties, e.g. `url`, `method` etc. + """ + return None + + @overload + def request( + self, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + remaining_retries: Optional[int] = None, + *, + stream: Literal[True], + stream_cls: Type[_StreamT], + ) -> _StreamT: + ... + + @overload + def request( + self, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + remaining_retries: Optional[int] = None, + *, + stream: Literal[False] = False, + ) -> ResponseT: + ... + + @overload + def request( + self, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + remaining_retries: Optional[int] = None, + *, + stream: bool = False, + stream_cls: Type[_StreamT] | None = None, + ) -> ResponseT | _StreamT: + ... + + def request( + self, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + remaining_retries: Optional[int] = None, + *, + stream: bool = False, + stream_cls: type[_StreamT] | None = None, + ) -> ResponseT | _StreamT: + return self._request( + cast_to=cast_to, + options=options, + stream=stream, + stream_cls=stream_cls, + remaining_retries=remaining_retries, + ) + + def _request( + self, + *, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + remaining_retries: int | None, + stream: bool, + stream_cls: type[_StreamT] | None, + ) -> ResponseT | _StreamT: + cast_to = self._maybe_override_cast_to(cast_to, options) + self._prepare_options(options) + + retries = self._remaining_retries(remaining_retries, options) + request = self._build_request(options) + self._prepare_request(request) + + kwargs: HttpxSendArgs = {} + if self.custom_auth is not None: + kwargs["auth"] = self.custom_auth + + log.debug("Sending HTTP Request: %s %s", request.method, request.url) + + try: + response = self._client.send( + request, + stream=stream or self._should_stream_response_body(request=request), + **kwargs, + ) + except httpx.TimeoutException as err: + log.debug("Encountered httpx.TimeoutException", exc_info=True) + + if retries > 0: + return self._retry_request( + options, + cast_to, + retries, + stream=stream, + stream_cls=stream_cls, + response_headers=None, + ) + + log.debug("Raising timeout error") + raise APITimeoutError(request=request) from err + except Exception as err: + log.debug("Encountered Exception", exc_info=True) + + if retries > 0: + return self._retry_request( + options, + cast_to, + retries, + stream=stream, + stream_cls=stream_cls, + response_headers=None, + ) + + log.debug("Raising connection error") + raise APIConnectionError(request=request) from err + + log.debug( + 'HTTP Response: %s %s "%i %s" %s', + request.method, + request.url, + response.status_code, + response.reason_phrase, + response.headers, + ) + + try: + response.raise_for_status() + except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code + log.debug("Encountered httpx.HTTPStatusError", exc_info=True) + + if retries > 0 and self._should_retry(err.response): + err.response.close() + return self._retry_request( + options, + cast_to, + retries, + err.response.headers, + stream=stream, + stream_cls=stream_cls, + ) + + # If the response is streamed then we need to explicitly read the response + # to completion before attempting to access the response text. + if not err.response.is_closed: + err.response.read() + + log.debug("Re-raising status error") + raise self._make_status_error_from_response(err.response) from None + + return self._process_response( + cast_to=cast_to, + options=options, + response=response, + stream=stream, + stream_cls=stream_cls, + ) + + def _retry_request( + self, + options: FinalRequestOptions, + cast_to: Type[ResponseT], + remaining_retries: int, + response_headers: httpx.Headers | None, + *, + stream: bool, + stream_cls: type[_StreamT] | None, + ) -> ResponseT | _StreamT: + remaining = remaining_retries - 1 + if remaining == 1: + log.debug("1 retry left") + else: + log.debug("%i retries left", remaining) + + timeout = self._calculate_retry_timeout(remaining, options, response_headers) + log.info("Retrying request to %s in %f seconds", options.url, timeout) + + # In a synchronous context we are blocking the entire thread. Up to the library user to run the client in a + # different thread if necessary. + time.sleep(timeout) + + return self._request( + options=options, + cast_to=cast_to, + remaining_retries=remaining, + stream=stream, + stream_cls=stream_cls, + ) + + def _process_response( + self, + *, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + response: httpx.Response, + stream: bool, + stream_cls: type[Stream[Any]] | type[AsyncStream[Any]] | None, + ) -> ResponseT: + origin = get_origin(cast_to) or cast_to + + if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse): + if not issubclass(origin, APIResponse): + raise TypeError(f"API Response types must subclass {APIResponse}; Received {origin}") + + response_cls = cast("type[BaseAPIResponse[Any]]", cast_to) + return cast( + ResponseT, + response_cls( + raw=response, + client=self, + cast_to=extract_response_type(response_cls), + stream=stream, + stream_cls=stream_cls, + options=options, + ), + ) + + if cast_to == httpx.Response: + return cast(ResponseT, response) + + api_response = APIResponse( + raw=response, + client=self, + cast_to=cast("type[ResponseT]", cast_to), # pyright: ignore[reportUnnecessaryCast] + stream=stream, + stream_cls=stream_cls, + options=options, + ) + if bool(response.request.headers.get(RAW_RESPONSE_HEADER)): + return cast(ResponseT, api_response) + + return api_response.parse() + + def _request_api_list( + self, + model: Type[object], + page: Type[SyncPageT], + options: FinalRequestOptions, + ) -> SyncPageT: + def _parser(resp: SyncPageT) -> SyncPageT: + resp._set_private_attributes( + client=self, + model=model, + options=options, + ) + return resp + + options.post_parser = _parser + + return self.request(page, options, stream=False) + + @overload + def get( + self, + path: str, + *, + cast_to: Type[ResponseT], + options: RequestOptions = {}, + stream: Literal[False] = False, + ) -> ResponseT: + ... + + @overload + def get( + self, + path: str, + *, + cast_to: Type[ResponseT], + options: RequestOptions = {}, + stream: Literal[True], + stream_cls: type[_StreamT], + ) -> _StreamT: + ... + + @overload + def get( + self, + path: str, + *, + cast_to: Type[ResponseT], + options: RequestOptions = {}, + stream: bool, + stream_cls: type[_StreamT] | None = None, + ) -> ResponseT | _StreamT: + ... + + def get( + self, + path: str, + *, + cast_to: Type[ResponseT], + options: RequestOptions = {}, + stream: bool = False, + stream_cls: type[_StreamT] | None = None, + ) -> ResponseT | _StreamT: + opts = FinalRequestOptions.construct(method="get", url=path, **options) + # cast is required because mypy complains about returning Any even though + # it understands the type variables + return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) + + @overload + def post( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + options: RequestOptions = {}, + files: RequestFiles | None = None, + stream: Literal[False] = False, + ) -> ResponseT: + ... + + @overload + def post( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + options: RequestOptions = {}, + files: RequestFiles | None = None, + stream: Literal[True], + stream_cls: type[_StreamT], + ) -> _StreamT: + ... + + @overload + def post( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + options: RequestOptions = {}, + files: RequestFiles | None = None, + stream: bool, + stream_cls: type[_StreamT] | None = None, + ) -> ResponseT | _StreamT: + ... + + def post( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + options: RequestOptions = {}, + files: RequestFiles | None = None, + stream: bool = False, + stream_cls: type[_StreamT] | None = None, + ) -> ResponseT | _StreamT: + opts = FinalRequestOptions.construct( + method="post", url=path, json_data=body, files=to_httpx_files(files), **options + ) + return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) + + def patch( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + options: RequestOptions = {}, + ) -> ResponseT: + opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + return self.request(cast_to, opts) + + def put( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + files: RequestFiles | None = None, + options: RequestOptions = {}, + ) -> ResponseT: + opts = FinalRequestOptions.construct( + method="put", url=path, json_data=body, files=to_httpx_files(files), **options + ) + return self.request(cast_to, opts) + + def delete( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + options: RequestOptions = {}, + ) -> ResponseT: + opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options) + return self.request(cast_to, opts) + + def get_api_list( + self, + path: str, + *, + model: Type[object], + page: Type[SyncPageT], + body: Body | None = None, + options: RequestOptions = {}, + method: str = "get", + ) -> SyncPageT: + opts = FinalRequestOptions.construct(method=method, url=path, json_data=body, **options) + return self._request_api_list(model, page, opts) + + +class _DefaultAsyncHttpxClient(httpx.AsyncClient): + def __init__(self, **kwargs: Any) -> None: + kwargs.setdefault("timeout", DEFAULT_TIMEOUT) + kwargs.setdefault("limits", DEFAULT_CONNECTION_LIMITS) + kwargs.setdefault("follow_redirects", True) + super().__init__(**kwargs) + + +if TYPE_CHECKING: + DefaultAsyncHttpxClient = httpx.AsyncClient + """An alias to `httpx.AsyncClient` that provides the same defaults that this SDK + uses internally. + + This is useful because overriding the `http_client` with your own instance of + `httpx.AsyncClient` will result in httpx's defaults being used, not ours. + """ +else: + DefaultAsyncHttpxClient = _DefaultAsyncHttpxClient + + +class AsyncHttpxClientWrapper(DefaultAsyncHttpxClient): + def __del__(self) -> None: + try: + # TODO(someday): support non asyncio runtimes here + asyncio.get_running_loop().create_task(self.aclose()) + except Exception: + pass + + +class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]): + _client: httpx.AsyncClient + _default_stream_cls: type[AsyncStream[Any]] | None = None + + def __init__( + self, + *, + version: str, + base_url: str | URL, + _strict_response_validation: bool, + max_retries: int = DEFAULT_MAX_RETRIES, + timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + transport: AsyncTransport | None = None, + proxies: ProxiesTypes | None = None, + limits: Limits | None = None, + http_client: httpx.AsyncClient | None = None, + custom_headers: Mapping[str, str] | None = None, + custom_query: Mapping[str, object] | None = None, + ) -> None: + if limits is not None: + warnings.warn( + "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead", + category=DeprecationWarning, + stacklevel=3, + ) + if http_client is not None: + raise ValueError("The `http_client` argument is mutually exclusive with `connection_pool_limits`") + else: + limits = DEFAULT_CONNECTION_LIMITS + + if transport is not None: + warnings.warn( + "The `transport` argument is deprecated. The `http_client` argument should be passed instead", + category=DeprecationWarning, + stacklevel=3, + ) + if http_client is not None: + raise ValueError("The `http_client` argument is mutually exclusive with `transport`") + + if proxies is not None: + warnings.warn( + "The `proxies` argument is deprecated. The `http_client` argument should be passed instead", + category=DeprecationWarning, + stacklevel=3, + ) + if http_client is not None: + raise ValueError("The `http_client` argument is mutually exclusive with `proxies`") + + if not is_given(timeout): + # if the user passed in a custom http client with a non-default + # timeout set then we use that timeout. + # + # note: there is an edge case here where the user passes in a client + # where they've explicitly set the timeout to match the default timeout + # as this check is structural, meaning that we'll think they didn't + # pass in a timeout and will ignore it + if http_client and http_client.timeout != HTTPX_DEFAULT_TIMEOUT: + timeout = http_client.timeout + else: + timeout = DEFAULT_TIMEOUT + + if http_client is not None and not isinstance(http_client, httpx.AsyncClient): # pyright: ignore[reportUnnecessaryIsInstance] + raise TypeError( + f"Invalid `http_client` argument; Expected an instance of `httpx.AsyncClient` but got {type(http_client)}" + ) + + super().__init__( + version=version, + base_url=base_url, + limits=limits, + # cast to a valid type because mypy doesn't understand our type narrowing + timeout=cast(Timeout, timeout), + proxies=proxies, + transport=transport, + max_retries=max_retries, + custom_query=custom_query, + custom_headers=custom_headers, + _strict_response_validation=_strict_response_validation, + ) + self._client = http_client or AsyncHttpxClientWrapper( + base_url=base_url, + # cast to a valid type because mypy doesn't understand our type narrowing + timeout=cast(Timeout, timeout), + proxies=proxies, + transport=transport, + limits=limits, + follow_redirects=True, + ) + + def is_closed(self) -> bool: + return self._client.is_closed + + async def close(self) -> None: + """Close the underlying HTTPX client. + + The client will *not* be usable after this. + """ + await self._client.aclose() + + async def __aenter__(self: _T) -> _T: + return self + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + await self.close() + + async def _prepare_options( + self, + options: FinalRequestOptions, # noqa: ARG002 + ) -> None: + """Hook for mutating the given options""" + return None + + async def _prepare_request( + self, + request: httpx.Request, # noqa: ARG002 + ) -> None: + """This method is used as a callback for mutating the `Request` object + after it has been constructed. + This is useful for cases where you want to add certain headers based off of + the request properties, e.g. `url`, `method` etc. + """ + return None + + @overload + async def request( + self, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + *, + stream: Literal[False] = False, + remaining_retries: Optional[int] = None, + ) -> ResponseT: + ... + + @overload + async def request( + self, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + *, + stream: Literal[True], + stream_cls: type[_AsyncStreamT], + remaining_retries: Optional[int] = None, + ) -> _AsyncStreamT: + ... + + @overload + async def request( + self, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + *, + stream: bool, + stream_cls: type[_AsyncStreamT] | None = None, + remaining_retries: Optional[int] = None, + ) -> ResponseT | _AsyncStreamT: + ... + + async def request( + self, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + *, + stream: bool = False, + stream_cls: type[_AsyncStreamT] | None = None, + remaining_retries: Optional[int] = None, + ) -> ResponseT | _AsyncStreamT: + return await self._request( + cast_to=cast_to, + options=options, + stream=stream, + stream_cls=stream_cls, + remaining_retries=remaining_retries, + ) + + async def _request( + self, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + *, + stream: bool, + stream_cls: type[_AsyncStreamT] | None, + remaining_retries: int | None, + ) -> ResponseT | _AsyncStreamT: + cast_to = self._maybe_override_cast_to(cast_to, options) + await self._prepare_options(options) + + retries = self._remaining_retries(remaining_retries, options) + request = self._build_request(options) + await self._prepare_request(request) + + kwargs: HttpxSendArgs = {} + if self.custom_auth is not None: + kwargs["auth"] = self.custom_auth + + try: + response = await self._client.send( + request, + stream=stream or self._should_stream_response_body(request=request), + **kwargs, + ) + except httpx.TimeoutException as err: + log.debug("Encountered httpx.TimeoutException", exc_info=True) + + if retries > 0: + return await self._retry_request( + options, + cast_to, + retries, + stream=stream, + stream_cls=stream_cls, + response_headers=None, + ) + + log.debug("Raising timeout error") + raise APITimeoutError(request=request) from err + except Exception as err: + log.debug("Encountered Exception", exc_info=True) + + if retries > 0: + return await self._retry_request( + options, + cast_to, + retries, + stream=stream, + stream_cls=stream_cls, + response_headers=None, + ) + + log.debug("Raising connection error") + raise APIConnectionError(request=request) from err + + log.debug( + 'HTTP Request: %s %s "%i %s"', request.method, request.url, response.status_code, response.reason_phrase + ) + + try: + response.raise_for_status() + except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code + log.debug("Encountered httpx.HTTPStatusError", exc_info=True) + + if retries > 0 and self._should_retry(err.response): + await err.response.aclose() + return await self._retry_request( + options, + cast_to, + retries, + err.response.headers, + stream=stream, + stream_cls=stream_cls, + ) + + # If the response is streamed then we need to explicitly read the response + # to completion before attempting to access the response text. + if not err.response.is_closed: + await err.response.aread() + + log.debug("Re-raising status error") + raise self._make_status_error_from_response(err.response) from None + + return await self._process_response( + cast_to=cast_to, + options=options, + response=response, + stream=stream, + stream_cls=stream_cls, + ) + + async def _retry_request( + self, + options: FinalRequestOptions, + cast_to: Type[ResponseT], + remaining_retries: int, + response_headers: httpx.Headers | None, + *, + stream: bool, + stream_cls: type[_AsyncStreamT] | None, + ) -> ResponseT | _AsyncStreamT: + remaining = remaining_retries - 1 + if remaining == 1: + log.debug("1 retry left") + else: + log.debug("%i retries left", remaining) + + timeout = self._calculate_retry_timeout(remaining, options, response_headers) + log.info("Retrying request to %s in %f seconds", options.url, timeout) + + await anyio.sleep(timeout) + + return await self._request( + options=options, + cast_to=cast_to, + remaining_retries=remaining, + stream=stream, + stream_cls=stream_cls, + ) + + async def _process_response( + self, + *, + cast_to: Type[ResponseT], + options: FinalRequestOptions, + response: httpx.Response, + stream: bool, + stream_cls: type[Stream[Any]] | type[AsyncStream[Any]] | None, + ) -> ResponseT: + origin = get_origin(cast_to) or cast_to + + if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse): + if not issubclass(origin, AsyncAPIResponse): + raise TypeError(f"API Response types must subclass {AsyncAPIResponse}; Received {origin}") + + response_cls = cast("type[BaseAPIResponse[Any]]", cast_to) + return cast( + "ResponseT", + response_cls( + raw=response, + client=self, + cast_to=extract_response_type(response_cls), + stream=stream, + stream_cls=stream_cls, + options=options, + ), + ) + + if cast_to == httpx.Response: + return cast(ResponseT, response) + + api_response = AsyncAPIResponse( + raw=response, + client=self, + cast_to=cast("type[ResponseT]", cast_to), # pyright: ignore[reportUnnecessaryCast] + stream=stream, + stream_cls=stream_cls, + options=options, + ) + if bool(response.request.headers.get(RAW_RESPONSE_HEADER)): + return cast(ResponseT, api_response) + + return await api_response.parse() + + def _request_api_list( + self, + model: Type[_T], + page: Type[AsyncPageT], + options: FinalRequestOptions, + ) -> AsyncPaginator[_T, AsyncPageT]: + return AsyncPaginator(client=self, options=options, page_cls=page, model=model) + + @overload + async def get( + self, + path: str, + *, + cast_to: Type[ResponseT], + options: RequestOptions = {}, + stream: Literal[False] = False, + ) -> ResponseT: + ... + + @overload + async def get( + self, + path: str, + *, + cast_to: Type[ResponseT], + options: RequestOptions = {}, + stream: Literal[True], + stream_cls: type[_AsyncStreamT], + ) -> _AsyncStreamT: + ... + + @overload + async def get( + self, + path: str, + *, + cast_to: Type[ResponseT], + options: RequestOptions = {}, + stream: bool, + stream_cls: type[_AsyncStreamT] | None = None, + ) -> ResponseT | _AsyncStreamT: + ... + + async def get( + self, + path: str, + *, + cast_to: Type[ResponseT], + options: RequestOptions = {}, + stream: bool = False, + stream_cls: type[_AsyncStreamT] | None = None, + ) -> ResponseT | _AsyncStreamT: + opts = FinalRequestOptions.construct(method="get", url=path, **options) + return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) + + @overload + async def post( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + files: RequestFiles | None = None, + options: RequestOptions = {}, + stream: Literal[False] = False, + ) -> ResponseT: + ... + + @overload + async def post( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + files: RequestFiles | None = None, + options: RequestOptions = {}, + stream: Literal[True], + stream_cls: type[_AsyncStreamT], + ) -> _AsyncStreamT: + ... + + @overload + async def post( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + files: RequestFiles | None = None, + options: RequestOptions = {}, + stream: bool, + stream_cls: type[_AsyncStreamT] | None = None, + ) -> ResponseT | _AsyncStreamT: + ... + + async def post( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + files: RequestFiles | None = None, + options: RequestOptions = {}, + stream: bool = False, + stream_cls: type[_AsyncStreamT] | None = None, + ) -> ResponseT | _AsyncStreamT: + opts = FinalRequestOptions.construct( + method="post", url=path, json_data=body, files=await async_to_httpx_files(files), **options + ) + return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) + + async def patch( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + options: RequestOptions = {}, + ) -> ResponseT: + opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + return await self.request(cast_to, opts) + + async def put( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + files: RequestFiles | None = None, + options: RequestOptions = {}, + ) -> ResponseT: + opts = FinalRequestOptions.construct( + method="put", url=path, json_data=body, files=await async_to_httpx_files(files), **options + ) + return await self.request(cast_to, opts) + + async def delete( + self, + path: str, + *, + cast_to: Type[ResponseT], + body: Body | None = None, + options: RequestOptions = {}, + ) -> ResponseT: + opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options) + return await self.request(cast_to, opts) + + def get_api_list( + self, + path: str, + *, + model: Type[_T], + page: Type[AsyncPageT], + body: Body | None = None, + options: RequestOptions = {}, + method: str = "get", + ) -> AsyncPaginator[_T, AsyncPageT]: + opts = FinalRequestOptions.construct(method=method, url=path, json_data=body, **options) + return self._request_api_list(model, page, opts) + + +def make_request_options( + *, + query: Query | None = None, + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + idempotency_key: str | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + post_parser: PostParser | NotGiven = NOT_GIVEN, +) -> RequestOptions: + """Create a dict of type RequestOptions without keys of NotGiven values.""" + options: RequestOptions = {} + if extra_headers is not None: + options["headers"] = extra_headers + + if extra_body is not None: + options["extra_json"] = cast(AnyMapping, extra_body) + + if query is not None: + options["params"] = query + + if extra_query is not None: + options["params"] = {**options.get("params", {}), **extra_query} + + if not isinstance(timeout, NotGiven): + options["timeout"] = timeout + + if idempotency_key is not None: + options["idempotency_key"] = idempotency_key + + if is_given(post_parser): + # internal + options["post_parser"] = post_parser # type: ignore + + return options + + +class OtherPlatform: + def __init__(self, name: str) -> None: + self.name = name + + @override + def __str__(self) -> str: + return f"Other:{self.name}" + + +Platform = Union[ + OtherPlatform, + Literal[ + "MacOS", + "Linux", + "Windows", + "FreeBSD", + "OpenBSD", + "iOS", + "Android", + "Unknown", + ], +] + + +def get_platform() -> Platform: + try: + system = platform.system().lower() + platform_name = platform.platform().lower() + except Exception: + return "Unknown" + + if "iphone" in platform_name or "ipad" in platform_name: + # Tested using Python3IDE on an iPhone 11 and Pythonista on an iPad 7 + # system is Darwin and platform_name is a string like: + # - Darwin-21.6.0-iPhone12,1-64bit + # - Darwin-21.6.0-iPad7,11-64bit + return "iOS" + + if system == "darwin": + return "MacOS" + + if system == "windows": + return "Windows" + + if "android" in platform_name: + # Tested using Pydroid 3 + # system is Linux and platform_name is a string like 'Linux-5.10.81-android12-9-00001-geba40aecb3b7-ab8534902-aarch64-with-libc' + return "Android" + + if system == "linux": + # https://distro.readthedocs.io/en/latest/#distro.id + distro_id = distro.id() + if distro_id == "freebsd": + return "FreeBSD" + + if distro_id == "openbsd": + return "OpenBSD" + + return "Linux" + + if platform_name: + return OtherPlatform(platform_name) + + return "Unknown" + + +@lru_cache(maxsize=None) +def platform_headers(version: str) -> Dict[str, str]: + return { + "X-Stainless-Lang": "python", + "X-Stainless-Package-Version": version, + "X-Stainless-OS": str(get_platform()), + "X-Stainless-Arch": str(get_architecture()), + "X-Stainless-Runtime": get_python_runtime(), + "X-Stainless-Runtime-Version": get_python_version(), + } + + +class OtherArch: + def __init__(self, name: str) -> None: + self.name = name + + @override + def __str__(self) -> str: + return f"other:{self.name}" + + +Arch = Union[OtherArch, Literal["x32", "x64", "arm", "arm64", "unknown"]] + + +def get_python_runtime() -> str: + try: + return platform.python_implementation() + except Exception: + return "unknown" + + +def get_python_version() -> str: + try: + return platform.python_version() + except Exception: + return "unknown" + + +def get_architecture() -> Arch: + try: + python_bitness, _ = platform.architecture() + machine = platform.machine().lower() + except Exception: + return "unknown" + + if machine in ("arm64", "aarch64"): + return "arm64" + + # TODO: untested + if machine == "arm": + return "arm" + + if machine == "x86_64": + return "x64" + + # TODO: untested + if python_bitness == "32bit": + return "x32" + + if machine: + return OtherArch(machine) + + return "unknown" + + +def _merge_mappings( + obj1: Mapping[_T_co, Union[_T, Omit]], + obj2: Mapping[_T_co, Union[_T, Omit]], +) -> Dict[_T_co, _T]: + """Merge two mappings of the same type, removing any values that are instances of `Omit`. + + In cases with duplicate keys the second mapping takes precedence. + """ + merged = {**obj1, **obj2} + return {key: value for key, value in merged.items() if not isinstance(value, Omit)} diff --git a/src/runloop/_client.py b/src/runloop/_client.py new file mode 100644 index 000000000..4f85779a6 --- /dev/null +++ b/src/runloop/_client.py @@ -0,0 +1,446 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Union, Mapping +from typing_extensions import Self, override + +import httpx + +from . import resources, _exceptions +from ._qs import Querystring +from ._types import ( + NOT_GIVEN, + Omit, + Timeout, + NotGiven, + Transport, + ProxiesTypes, + RequestOptions, +) +from ._utils import ( + is_given, + get_async_library, +) +from ._version import __version__ +from ._streaming import Stream as Stream, AsyncStream as AsyncStream +from ._exceptions import RunloopError, APIStatusError +from ._base_client import ( + DEFAULT_MAX_RETRIES, + SyncAPIClient, + AsyncAPIClient, +) + +__all__ = [ + "Timeout", + "Transport", + "ProxiesTypes", + "RequestOptions", + "resources", + "Runloop", + "AsyncRunloop", + "Client", + "AsyncClient", +] + + +class Runloop(SyncAPIClient): + code_handles: resources.CodeHandlesResource + devboxes: resources.DevboxesResource + functions: resources.FunctionsResource + latches: resources.LatchesResource + projects: resources.ProjectsResource + sessions: resources.SessionsResource + with_raw_response: RunloopWithRawResponse + with_streaming_response: RunloopWithStreamedResponse + + # client options + bearer_token: str + + def __init__( + self, + *, + bearer_token: str | None = None, + base_url: str | httpx.URL | None = None, + timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, + max_retries: int = DEFAULT_MAX_RETRIES, + default_headers: Mapping[str, str] | None = None, + default_query: Mapping[str, object] | None = None, + # Configure a custom httpx client. + # We provide a `DefaultHttpxClient` class that you can pass to retain the default values we use for `limits`, `timeout` & `follow_redirects`. + # See the [httpx documentation](https://www.python-httpx.org/api/#client) for more details. + http_client: httpx.Client | None = None, + # Enable or disable schema validation for data returned by the API. + # When enabled an error APIResponseValidationError is raised + # if the API responds with invalid data for the expected schema. + # + # This parameter may be removed or changed in the future. + # If you rely on this feature, please open a GitHub issue + # outlining your use-case to help us decide if it should be + # part of our public interface in the future. + _strict_response_validation: bool = False, + ) -> None: + """Construct a new synchronous runloop client instance. + + This automatically infers the `bearer_token` argument from the `RUNLOOP_BEARER_TOKEN` environment variable if it is not provided. + """ + if bearer_token is None: + bearer_token = os.environ.get("RUNLOOP_BEARER_TOKEN") + if bearer_token is None: + raise RunloopError( + "The bearer_token client option must be set either by passing bearer_token to the client or by setting the RUNLOOP_BEARER_TOKEN environment variable" + ) + self.bearer_token = bearer_token + + if base_url is None: + base_url = os.environ.get("RUNLOOP_BASE_URL") + if base_url is None: + base_url = f"https://api.runloop.pro" + + super().__init__( + version=__version__, + base_url=base_url, + max_retries=max_retries, + timeout=timeout, + http_client=http_client, + custom_headers=default_headers, + custom_query=default_query, + _strict_response_validation=_strict_response_validation, + ) + + self.code_handles = resources.CodeHandlesResource(self) + self.devboxes = resources.DevboxesResource(self) + self.functions = resources.FunctionsResource(self) + self.latches = resources.LatchesResource(self) + self.projects = resources.ProjectsResource(self) + self.sessions = resources.SessionsResource(self) + self.with_raw_response = RunloopWithRawResponse(self) + self.with_streaming_response = RunloopWithStreamedResponse(self) + + @property + @override + def qs(self) -> Querystring: + return Querystring(array_format="comma") + + @property + @override + def auth_headers(self) -> dict[str, str]: + bearer_token = self.bearer_token + return {"Authorization": f"Bearer {bearer_token}"} + + @property + @override + def default_headers(self) -> dict[str, str | Omit]: + return { + **super().default_headers, + "X-Stainless-Async": "false", + **self._custom_headers, + } + + def copy( + self, + *, + bearer_token: str | None = None, + base_url: str | httpx.URL | None = None, + timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + http_client: httpx.Client | None = None, + max_retries: int | NotGiven = NOT_GIVEN, + default_headers: Mapping[str, str] | None = None, + set_default_headers: Mapping[str, str] | None = None, + default_query: Mapping[str, object] | None = None, + set_default_query: Mapping[str, object] | None = None, + _extra_kwargs: Mapping[str, Any] = {}, + ) -> Self: + """ + Create a new client instance re-using the same options given to the current client with optional overriding. + """ + if default_headers is not None and set_default_headers is not None: + raise ValueError("The `default_headers` and `set_default_headers` arguments are mutually exclusive") + + if default_query is not None and set_default_query is not None: + raise ValueError("The `default_query` and `set_default_query` arguments are mutually exclusive") + + headers = self._custom_headers + if default_headers is not None: + headers = {**headers, **default_headers} + elif set_default_headers is not None: + headers = set_default_headers + + params = self._custom_query + if default_query is not None: + params = {**params, **default_query} + elif set_default_query is not None: + params = set_default_query + + http_client = http_client or self._client + return self.__class__( + bearer_token=bearer_token or self.bearer_token, + base_url=base_url or self.base_url, + timeout=self.timeout if isinstance(timeout, NotGiven) else timeout, + http_client=http_client, + max_retries=max_retries if is_given(max_retries) else self.max_retries, + default_headers=headers, + default_query=params, + **_extra_kwargs, + ) + + # Alias for `copy` for nicer inline usage, e.g. + # client.with_options(timeout=10).foo.create(...) + with_options = copy + + @override + def _make_status_error( + self, + err_msg: str, + *, + body: object, + response: httpx.Response, + ) -> APIStatusError: + if response.status_code == 400: + return _exceptions.BadRequestError(err_msg, response=response, body=body) + + if response.status_code == 401: + return _exceptions.AuthenticationError(err_msg, response=response, body=body) + + if response.status_code == 403: + return _exceptions.PermissionDeniedError(err_msg, response=response, body=body) + + if response.status_code == 404: + return _exceptions.NotFoundError(err_msg, response=response, body=body) + + if response.status_code == 409: + return _exceptions.ConflictError(err_msg, response=response, body=body) + + if response.status_code == 422: + return _exceptions.UnprocessableEntityError(err_msg, response=response, body=body) + + if response.status_code == 429: + return _exceptions.RateLimitError(err_msg, response=response, body=body) + + if response.status_code >= 500: + return _exceptions.InternalServerError(err_msg, response=response, body=body) + return APIStatusError(err_msg, response=response, body=body) + + +class AsyncRunloop(AsyncAPIClient): + code_handles: resources.AsyncCodeHandlesResource + devboxes: resources.AsyncDevboxesResource + functions: resources.AsyncFunctionsResource + latches: resources.AsyncLatchesResource + projects: resources.AsyncProjectsResource + sessions: resources.AsyncSessionsResource + with_raw_response: AsyncRunloopWithRawResponse + with_streaming_response: AsyncRunloopWithStreamedResponse + + # client options + bearer_token: str + + def __init__( + self, + *, + bearer_token: str | None = None, + base_url: str | httpx.URL | None = None, + timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, + max_retries: int = DEFAULT_MAX_RETRIES, + default_headers: Mapping[str, str] | None = None, + default_query: Mapping[str, object] | None = None, + # Configure a custom httpx client. + # We provide a `DefaultAsyncHttpxClient` class that you can pass to retain the default values we use for `limits`, `timeout` & `follow_redirects`. + # See the [httpx documentation](https://www.python-httpx.org/api/#asyncclient) for more details. + http_client: httpx.AsyncClient | None = None, + # Enable or disable schema validation for data returned by the API. + # When enabled an error APIResponseValidationError is raised + # if the API responds with invalid data for the expected schema. + # + # This parameter may be removed or changed in the future. + # If you rely on this feature, please open a GitHub issue + # outlining your use-case to help us decide if it should be + # part of our public interface in the future. + _strict_response_validation: bool = False, + ) -> None: + """Construct a new async runloop client instance. + + This automatically infers the `bearer_token` argument from the `RUNLOOP_BEARER_TOKEN` environment variable if it is not provided. + """ + if bearer_token is None: + bearer_token = os.environ.get("RUNLOOP_BEARER_TOKEN") + if bearer_token is None: + raise RunloopError( + "The bearer_token client option must be set either by passing bearer_token to the client or by setting the RUNLOOP_BEARER_TOKEN environment variable" + ) + self.bearer_token = bearer_token + + if base_url is None: + base_url = os.environ.get("RUNLOOP_BASE_URL") + if base_url is None: + base_url = f"https://api.runloop.pro" + + super().__init__( + version=__version__, + base_url=base_url, + max_retries=max_retries, + timeout=timeout, + http_client=http_client, + custom_headers=default_headers, + custom_query=default_query, + _strict_response_validation=_strict_response_validation, + ) + + self.code_handles = resources.AsyncCodeHandlesResource(self) + self.devboxes = resources.AsyncDevboxesResource(self) + self.functions = resources.AsyncFunctionsResource(self) + self.latches = resources.AsyncLatchesResource(self) + self.projects = resources.AsyncProjectsResource(self) + self.sessions = resources.AsyncSessionsResource(self) + self.with_raw_response = AsyncRunloopWithRawResponse(self) + self.with_streaming_response = AsyncRunloopWithStreamedResponse(self) + + @property + @override + def qs(self) -> Querystring: + return Querystring(array_format="comma") + + @property + @override + def auth_headers(self) -> dict[str, str]: + bearer_token = self.bearer_token + return {"Authorization": f"Bearer {bearer_token}"} + + @property + @override + def default_headers(self) -> dict[str, str | Omit]: + return { + **super().default_headers, + "X-Stainless-Async": f"async:{get_async_library()}", + **self._custom_headers, + } + + def copy( + self, + *, + bearer_token: str | None = None, + base_url: str | httpx.URL | None = None, + timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + http_client: httpx.AsyncClient | None = None, + max_retries: int | NotGiven = NOT_GIVEN, + default_headers: Mapping[str, str] | None = None, + set_default_headers: Mapping[str, str] | None = None, + default_query: Mapping[str, object] | None = None, + set_default_query: Mapping[str, object] | None = None, + _extra_kwargs: Mapping[str, Any] = {}, + ) -> Self: + """ + Create a new client instance re-using the same options given to the current client with optional overriding. + """ + if default_headers is not None and set_default_headers is not None: + raise ValueError("The `default_headers` and `set_default_headers` arguments are mutually exclusive") + + if default_query is not None and set_default_query is not None: + raise ValueError("The `default_query` and `set_default_query` arguments are mutually exclusive") + + headers = self._custom_headers + if default_headers is not None: + headers = {**headers, **default_headers} + elif set_default_headers is not None: + headers = set_default_headers + + params = self._custom_query + if default_query is not None: + params = {**params, **default_query} + elif set_default_query is not None: + params = set_default_query + + http_client = http_client or self._client + return self.__class__( + bearer_token=bearer_token or self.bearer_token, + base_url=base_url or self.base_url, + timeout=self.timeout if isinstance(timeout, NotGiven) else timeout, + http_client=http_client, + max_retries=max_retries if is_given(max_retries) else self.max_retries, + default_headers=headers, + default_query=params, + **_extra_kwargs, + ) + + # Alias for `copy` for nicer inline usage, e.g. + # client.with_options(timeout=10).foo.create(...) + with_options = copy + + @override + def _make_status_error( + self, + err_msg: str, + *, + body: object, + response: httpx.Response, + ) -> APIStatusError: + if response.status_code == 400: + return _exceptions.BadRequestError(err_msg, response=response, body=body) + + if response.status_code == 401: + return _exceptions.AuthenticationError(err_msg, response=response, body=body) + + if response.status_code == 403: + return _exceptions.PermissionDeniedError(err_msg, response=response, body=body) + + if response.status_code == 404: + return _exceptions.NotFoundError(err_msg, response=response, body=body) + + if response.status_code == 409: + return _exceptions.ConflictError(err_msg, response=response, body=body) + + if response.status_code == 422: + return _exceptions.UnprocessableEntityError(err_msg, response=response, body=body) + + if response.status_code == 429: + return _exceptions.RateLimitError(err_msg, response=response, body=body) + + if response.status_code >= 500: + return _exceptions.InternalServerError(err_msg, response=response, body=body) + return APIStatusError(err_msg, response=response, body=body) + + +class RunloopWithRawResponse: + def __init__(self, client: Runloop) -> None: + self.code_handles = resources.CodeHandlesResourceWithRawResponse(client.code_handles) + self.devboxes = resources.DevboxesResourceWithRawResponse(client.devboxes) + self.functions = resources.FunctionsResourceWithRawResponse(client.functions) + self.latches = resources.LatchesResourceWithRawResponse(client.latches) + self.projects = resources.ProjectsResourceWithRawResponse(client.projects) + self.sessions = resources.SessionsResourceWithRawResponse(client.sessions) + + +class AsyncRunloopWithRawResponse: + def __init__(self, client: AsyncRunloop) -> None: + self.code_handles = resources.AsyncCodeHandlesResourceWithRawResponse(client.code_handles) + self.devboxes = resources.AsyncDevboxesResourceWithRawResponse(client.devboxes) + self.functions = resources.AsyncFunctionsResourceWithRawResponse(client.functions) + self.latches = resources.AsyncLatchesResourceWithRawResponse(client.latches) + self.projects = resources.AsyncProjectsResourceWithRawResponse(client.projects) + self.sessions = resources.AsyncSessionsResourceWithRawResponse(client.sessions) + + +class RunloopWithStreamedResponse: + def __init__(self, client: Runloop) -> None: + self.code_handles = resources.CodeHandlesResourceWithStreamingResponse(client.code_handles) + self.devboxes = resources.DevboxesResourceWithStreamingResponse(client.devboxes) + self.functions = resources.FunctionsResourceWithStreamingResponse(client.functions) + self.latches = resources.LatchesResourceWithStreamingResponse(client.latches) + self.projects = resources.ProjectsResourceWithStreamingResponse(client.projects) + self.sessions = resources.SessionsResourceWithStreamingResponse(client.sessions) + + +class AsyncRunloopWithStreamedResponse: + def __init__(self, client: AsyncRunloop) -> None: + self.code_handles = resources.AsyncCodeHandlesResourceWithStreamingResponse(client.code_handles) + self.devboxes = resources.AsyncDevboxesResourceWithStreamingResponse(client.devboxes) + self.functions = resources.AsyncFunctionsResourceWithStreamingResponse(client.functions) + self.latches = resources.AsyncLatchesResourceWithStreamingResponse(client.latches) + self.projects = resources.AsyncProjectsResourceWithStreamingResponse(client.projects) + self.sessions = resources.AsyncSessionsResourceWithStreamingResponse(client.sessions) + + +Client = Runloop + +AsyncClient = AsyncRunloop diff --git a/src/runloop/_compat.py b/src/runloop/_compat.py new file mode 100644 index 000000000..74c7639b4 --- /dev/null +++ b/src/runloop/_compat.py @@ -0,0 +1,222 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload +from datetime import date, datetime +from typing_extensions import Self + +import pydantic +from pydantic.fields import FieldInfo + +from ._types import StrBytesIntFloat + +_T = TypeVar("_T") +_ModelT = TypeVar("_ModelT", bound=pydantic.BaseModel) + +# --------------- Pydantic v2 compatibility --------------- + +# Pyright incorrectly reports some of our functions as overriding a method when they don't +# pyright: reportIncompatibleMethodOverride=false + +PYDANTIC_V2 = pydantic.VERSION.startswith("2.") + +# v1 re-exports +if TYPE_CHECKING: + + def parse_date(value: date | StrBytesIntFloat) -> date: # noqa: ARG001 + ... + + def parse_datetime(value: Union[datetime, StrBytesIntFloat]) -> datetime: # noqa: ARG001 + ... + + def get_args(t: type[Any]) -> tuple[Any, ...]: # noqa: ARG001 + ... + + def is_union(tp: type[Any] | None) -> bool: # noqa: ARG001 + ... + + def get_origin(t: type[Any]) -> type[Any] | None: # noqa: ARG001 + ... + + def is_literal_type(type_: type[Any]) -> bool: # noqa: ARG001 + ... + + def is_typeddict(type_: type[Any]) -> bool: # noqa: ARG001 + ... + +else: + if PYDANTIC_V2: + from pydantic.v1.typing import ( + get_args as get_args, + is_union as is_union, + get_origin as get_origin, + is_typeddict as is_typeddict, + is_literal_type as is_literal_type, + ) + from pydantic.v1.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime + else: + from pydantic.typing import ( + get_args as get_args, + is_union as is_union, + get_origin as get_origin, + is_typeddict as is_typeddict, + is_literal_type as is_literal_type, + ) + from pydantic.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime + + +# refactored config +if TYPE_CHECKING: + from pydantic import ConfigDict as ConfigDict +else: + if PYDANTIC_V2: + from pydantic import ConfigDict + else: + # TODO: provide an error message here? + ConfigDict = None + + +# renamed methods / properties +def parse_obj(model: type[_ModelT], value: object) -> _ModelT: + if PYDANTIC_V2: + return model.model_validate(value) + else: + return cast(_ModelT, model.parse_obj(value)) # pyright: ignore[reportDeprecated, reportUnnecessaryCast] + + +def field_is_required(field: FieldInfo) -> bool: + if PYDANTIC_V2: + return field.is_required() + return field.required # type: ignore + + +def field_get_default(field: FieldInfo) -> Any: + value = field.get_default() + if PYDANTIC_V2: + from pydantic_core import PydanticUndefined + + if value == PydanticUndefined: + return None + return value + return value + + +def field_outer_type(field: FieldInfo) -> Any: + if PYDANTIC_V2: + return field.annotation + return field.outer_type_ # type: ignore + + +def get_model_config(model: type[pydantic.BaseModel]) -> Any: + if PYDANTIC_V2: + return model.model_config + return model.__config__ # type: ignore + + +def get_model_fields(model: type[pydantic.BaseModel]) -> dict[str, FieldInfo]: + if PYDANTIC_V2: + return model.model_fields + return model.__fields__ # type: ignore + + +def model_copy(model: _ModelT) -> _ModelT: + if PYDANTIC_V2: + return model.model_copy() + return model.copy() # type: ignore + + +def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str: + if PYDANTIC_V2: + return model.model_dump_json(indent=indent) + return model.json(indent=indent) # type: ignore + + +def model_dump( + model: pydantic.BaseModel, + *, + exclude_unset: bool = False, + exclude_defaults: bool = False, +) -> dict[str, Any]: + if PYDANTIC_V2: + return model.model_dump( + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + ) + return cast( + "dict[str, Any]", + model.dict( # pyright: ignore[reportDeprecated, reportUnnecessaryCast] + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + ), + ) + + +def model_parse(model: type[_ModelT], data: Any) -> _ModelT: + if PYDANTIC_V2: + return model.model_validate(data) + return model.parse_obj(data) # pyright: ignore[reportDeprecated] + + +# generic models +if TYPE_CHECKING: + + class GenericModel(pydantic.BaseModel): + ... + +else: + if PYDANTIC_V2: + # there no longer needs to be a distinction in v2 but + # we still have to create our own subclass to avoid + # inconsistent MRO ordering errors + class GenericModel(pydantic.BaseModel): + ... + + else: + import pydantic.generics + + class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel): + ... + + +# cached properties +if TYPE_CHECKING: + cached_property = property + + # we define a separate type (copied from typeshed) + # that represents that `cached_property` is `set`able + # at runtime, which differs from `@property`. + # + # this is a separate type as editors likely special case + # `@property` and we don't want to cause issues just to have + # more helpful internal types. + + class typed_cached_property(Generic[_T]): + func: Callable[[Any], _T] + attrname: str | None + + def __init__(self, func: Callable[[Any], _T]) -> None: + ... + + @overload + def __get__(self, instance: None, owner: type[Any] | None = None) -> Self: + ... + + @overload + def __get__(self, instance: object, owner: type[Any] | None = None) -> _T: + ... + + def __get__(self, instance: object, owner: type[Any] | None = None) -> _T | Self: + raise NotImplementedError() + + def __set_name__(self, owner: type[Any], name: str) -> None: + ... + + # __set__ is not defined at runtime, but @cached_property is designed to be settable + def __set__(self, instance: object, value: _T) -> None: + ... +else: + try: + from functools import cached_property as cached_property + except ImportError: + from cached_property import cached_property as cached_property + + typed_cached_property = cached_property diff --git a/src/runloop/_constants.py b/src/runloop/_constants.py new file mode 100644 index 000000000..a2ac3b6f3 --- /dev/null +++ b/src/runloop/_constants.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import httpx + +RAW_RESPONSE_HEADER = "X-Stainless-Raw-Response" +OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to" + +# default timeout is 1 minute +DEFAULT_TIMEOUT = httpx.Timeout(timeout=60.0, connect=5.0) +DEFAULT_MAX_RETRIES = 2 +DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20) + +INITIAL_RETRY_DELAY = 0.5 +MAX_RETRY_DELAY = 8.0 diff --git a/src/runloop/_exceptions.py b/src/runloop/_exceptions.py new file mode 100644 index 000000000..dd4f7d276 --- /dev/null +++ b/src/runloop/_exceptions.py @@ -0,0 +1,108 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +__all__ = [ + "BadRequestError", + "AuthenticationError", + "PermissionDeniedError", + "NotFoundError", + "ConflictError", + "UnprocessableEntityError", + "RateLimitError", + "InternalServerError", +] + + +class RunloopError(Exception): + pass + + +class APIError(RunloopError): + message: str + request: httpx.Request + + body: object | None + """The API response body. + + If the API responded with a valid JSON structure then this property will be the + decoded result. + + If it isn't a valid JSON structure then this will be the raw response. + + If there was no response associated with this error then it will be `None`. + """ + + def __init__(self, message: str, request: httpx.Request, *, body: object | None) -> None: # noqa: ARG002 + super().__init__(message) + self.request = request + self.message = message + self.body = body + + +class APIResponseValidationError(APIError): + response: httpx.Response + status_code: int + + def __init__(self, response: httpx.Response, body: object | None, *, message: str | None = None) -> None: + super().__init__(message or "Data returned by API invalid for expected schema.", response.request, body=body) + self.response = response + self.status_code = response.status_code + + +class APIStatusError(APIError): + """Raised when an API response has a status code of 4xx or 5xx.""" + + response: httpx.Response + status_code: int + + def __init__(self, message: str, *, response: httpx.Response, body: object | None) -> None: + super().__init__(message, response.request, body=body) + self.response = response + self.status_code = response.status_code + + +class APIConnectionError(APIError): + def __init__(self, *, message: str = "Connection error.", request: httpx.Request) -> None: + super().__init__(message, request, body=None) + + +class APITimeoutError(APIConnectionError): + def __init__(self, request: httpx.Request) -> None: + super().__init__(message="Request timed out.", request=request) + + +class BadRequestError(APIStatusError): + status_code: Literal[400] = 400 # pyright: ignore[reportIncompatibleVariableOverride] + + +class AuthenticationError(APIStatusError): + status_code: Literal[401] = 401 # pyright: ignore[reportIncompatibleVariableOverride] + + +class PermissionDeniedError(APIStatusError): + status_code: Literal[403] = 403 # pyright: ignore[reportIncompatibleVariableOverride] + + +class NotFoundError(APIStatusError): + status_code: Literal[404] = 404 # pyright: ignore[reportIncompatibleVariableOverride] + + +class ConflictError(APIStatusError): + status_code: Literal[409] = 409 # pyright: ignore[reportIncompatibleVariableOverride] + + +class UnprocessableEntityError(APIStatusError): + status_code: Literal[422] = 422 # pyright: ignore[reportIncompatibleVariableOverride] + + +class RateLimitError(APIStatusError): + status_code: Literal[429] = 429 # pyright: ignore[reportIncompatibleVariableOverride] + + +class InternalServerError(APIStatusError): + pass diff --git a/src/runloop/_files.py b/src/runloop/_files.py new file mode 100644 index 000000000..0d2022ae7 --- /dev/null +++ b/src/runloop/_files.py @@ -0,0 +1,127 @@ +from __future__ import annotations + +import io +import os +import pathlib +from typing import overload +from typing_extensions import TypeGuard + +import anyio + +from ._types import ( + FileTypes, + FileContent, + RequestFiles, + HttpxFileTypes, + Base64FileInput, + HttpxFileContent, + HttpxRequestFiles, +) +from ._utils import is_tuple_t, is_mapping_t, is_sequence_t + + +def is_base64_file_input(obj: object) -> TypeGuard[Base64FileInput]: + return isinstance(obj, io.IOBase) or isinstance(obj, os.PathLike) + + +def is_file_content(obj: object) -> TypeGuard[FileContent]: + return ( + isinstance(obj, bytes) or isinstance(obj, tuple) or isinstance(obj, io.IOBase) or isinstance(obj, os.PathLike) + ) + + +def assert_is_file_content(obj: object, *, key: str | None = None) -> None: + if not is_file_content(obj): + prefix = f"Expected entry at `{key}`" if key is not None else f"Expected file input `{obj!r}`" + raise RuntimeError( + f"{prefix} to be bytes, an io.IOBase instance, PathLike or a tuple but received {type(obj)} instead." + ) from None + + +@overload +def to_httpx_files(files: None) -> None: + ... + + +@overload +def to_httpx_files(files: RequestFiles) -> HttpxRequestFiles: + ... + + +def to_httpx_files(files: RequestFiles | None) -> HttpxRequestFiles | None: + if files is None: + return None + + if is_mapping_t(files): + files = {key: _transform_file(file) for key, file in files.items()} + elif is_sequence_t(files): + files = [(key, _transform_file(file)) for key, file in files] + else: + raise TypeError(f"Unexpected file type input {type(files)}, expected mapping or sequence") + + return files + + +def _transform_file(file: FileTypes) -> HttpxFileTypes: + if is_file_content(file): + if isinstance(file, os.PathLike): + path = pathlib.Path(file) + return (path.name, path.read_bytes()) + + return file + + if is_tuple_t(file): + return (file[0], _read_file_content(file[1]), *file[2:]) + + raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") + + +def _read_file_content(file: FileContent) -> HttpxFileContent: + if isinstance(file, os.PathLike): + return pathlib.Path(file).read_bytes() + return file + + +@overload +async def async_to_httpx_files(files: None) -> None: + ... + + +@overload +async def async_to_httpx_files(files: RequestFiles) -> HttpxRequestFiles: + ... + + +async def async_to_httpx_files(files: RequestFiles | None) -> HttpxRequestFiles | None: + if files is None: + return None + + if is_mapping_t(files): + files = {key: await _async_transform_file(file) for key, file in files.items()} + elif is_sequence_t(files): + files = [(key, await _async_transform_file(file)) for key, file in files] + else: + raise TypeError("Unexpected file type input {type(files)}, expected mapping or sequence") + + return files + + +async def _async_transform_file(file: FileTypes) -> HttpxFileTypes: + if is_file_content(file): + if isinstance(file, os.PathLike): + path = anyio.Path(file) + return (path.name, await path.read_bytes()) + + return file + + if is_tuple_t(file): + return (file[0], await _async_read_file_content(file[1]), *file[2:]) + + raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") + + +async def _async_read_file_content(file: FileContent) -> HttpxFileContent: + if isinstance(file, os.PathLike): + return await anyio.Path(file).read_bytes() + + return file diff --git a/src/runloop/_models.py b/src/runloop/_models.py new file mode 100644 index 000000000..75c68cc73 --- /dev/null +++ b/src/runloop/_models.py @@ -0,0 +1,739 @@ +from __future__ import annotations + +import os +import inspect +from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, cast +from datetime import date, datetime +from typing_extensions import ( + Unpack, + Literal, + ClassVar, + Protocol, + Required, + TypedDict, + TypeGuard, + final, + override, + runtime_checkable, +) + +import pydantic +import pydantic.generics +from pydantic.fields import FieldInfo + +from ._types import ( + Body, + IncEx, + Query, + ModelT, + Headers, + Timeout, + NotGiven, + AnyMapping, + HttpxRequestFiles, +) +from ._utils import ( + PropertyInfo, + is_list, + is_given, + lru_cache, + is_mapping, + parse_date, + coerce_boolean, + parse_datetime, + strip_not_given, + extract_type_arg, + is_annotated_type, + strip_annotated_type, +) +from ._compat import ( + PYDANTIC_V2, + ConfigDict, + GenericModel as BaseGenericModel, + get_args, + is_union, + parse_obj, + get_origin, + is_literal_type, + get_model_config, + get_model_fields, + field_get_default, +) +from ._constants import RAW_RESPONSE_HEADER + +if TYPE_CHECKING: + from pydantic_core.core_schema import ModelField, LiteralSchema, ModelFieldsSchema + +__all__ = ["BaseModel", "GenericModel"] + +_T = TypeVar("_T") + + +@runtime_checkable +class _ConfigProtocol(Protocol): + allow_population_by_field_name: bool + + +class BaseModel(pydantic.BaseModel): + if PYDANTIC_V2: + model_config: ClassVar[ConfigDict] = ConfigDict( + extra="allow", defer_build=coerce_boolean(os.environ.get("DEFER_PYDANTIC_BUILD", "true")) + ) + else: + + @property + @override + def model_fields_set(self) -> set[str]: + # a forwards-compat shim for pydantic v2 + return self.__fields_set__ # type: ignore + + class Config(pydantic.BaseConfig): # pyright: ignore[reportDeprecated] + extra: Any = pydantic.Extra.allow # type: ignore + + def to_dict( + self, + *, + mode: Literal["json", "python"] = "python", + use_api_names: bool = True, + exclude_unset: bool = True, + exclude_defaults: bool = False, + exclude_none: bool = False, + warnings: bool = True, + ) -> dict[str, object]: + """Recursively generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + + By default, fields that were not set by the API will not be included, + and keys will match the API response, *not* the property names from the model. + + For example, if the API responds with `"fooBar": true` but we've defined a `foo_bar: bool` property, + the output will use the `"fooBar"` key (unless `use_api_names=False` is passed). + + Args: + mode: + If mode is 'json', the dictionary will only contain JSON serializable types. e.g. `datetime` will be turned into a string, `"2024-3-22T18:11:19.117000Z"`. + If mode is 'python', the dictionary may contain any Python objects. e.g. `datetime(2024, 3, 22)` + + use_api_names: Whether to use the key that the API responded with or the property name. Defaults to `True`. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value from the output. + exclude_none: Whether to exclude fields that have a value of `None` from the output. + warnings: Whether to log warnings when invalid fields are encountered. This is only supported in Pydantic v2. + """ + return self.model_dump( + mode=mode, + by_alias=use_api_names, + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + exclude_none=exclude_none, + warnings=warnings, + ) + + def to_json( + self, + *, + indent: int | None = 2, + use_api_names: bool = True, + exclude_unset: bool = True, + exclude_defaults: bool = False, + exclude_none: bool = False, + warnings: bool = True, + ) -> str: + """Generates a JSON string representing this model as it would be received from or sent to the API (but with indentation). + + By default, fields that were not set by the API will not be included, + and keys will match the API response, *not* the property names from the model. + + For example, if the API responds with `"fooBar": true` but we've defined a `foo_bar: bool` property, + the output will use the `"fooBar"` key (unless `use_api_names=False` is passed). + + Args: + indent: Indentation to use in the JSON output. If `None` is passed, the output will be compact. Defaults to `2` + use_api_names: Whether to use the key that the API responded with or the property name. Defaults to `True`. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that have the default value. + exclude_none: Whether to exclude fields that have a value of `None`. + warnings: Whether to show any warnings that occurred during serialization. This is only supported in Pydantic v2. + """ + return self.model_dump_json( + indent=indent, + by_alias=use_api_names, + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + exclude_none=exclude_none, + warnings=warnings, + ) + + @override + def __str__(self) -> str: + # mypy complains about an invalid self arg + return f'{self.__repr_name__()}({self.__repr_str__(", ")})' # type: ignore[misc] + + # Override the 'construct' method in a way that supports recursive parsing without validation. + # Based on https://github.com/samuelcolvin/pydantic/issues/1168#issuecomment-817742836. + @classmethod + @override + def construct( + cls: Type[ModelT], + _fields_set: set[str] | None = None, + **values: object, + ) -> ModelT: + m = cls.__new__(cls) + fields_values: dict[str, object] = {} + + config = get_model_config(cls) + populate_by_name = ( + config.allow_population_by_field_name + if isinstance(config, _ConfigProtocol) + else config.get("populate_by_name") + ) + + if _fields_set is None: + _fields_set = set() + + model_fields = get_model_fields(cls) + for name, field in model_fields.items(): + key = field.alias + if key is None or (key not in values and populate_by_name): + key = name + + if key in values: + fields_values[name] = _construct_field(value=values[key], field=field, key=key) + _fields_set.add(name) + else: + fields_values[name] = field_get_default(field) + + _extra = {} + for key, value in values.items(): + if key not in model_fields: + if PYDANTIC_V2: + _extra[key] = value + else: + _fields_set.add(key) + fields_values[key] = value + + object.__setattr__(m, "__dict__", fields_values) + + if PYDANTIC_V2: + # these properties are copied from Pydantic's `model_construct()` method + object.__setattr__(m, "__pydantic_private__", None) + object.__setattr__(m, "__pydantic_extra__", _extra) + object.__setattr__(m, "__pydantic_fields_set__", _fields_set) + else: + # init_private_attributes() does not exist in v2 + m._init_private_attributes() # type: ignore + + # copied from Pydantic v1's `construct()` method + object.__setattr__(m, "__fields_set__", _fields_set) + + return m + + if not TYPE_CHECKING: + # type checkers incorrectly complain about this assignment + # because the type signatures are technically different + # although not in practice + model_construct = construct + + if not PYDANTIC_V2: + # we define aliases for some of the new pydantic v2 methods so + # that we can just document these methods without having to specify + # a specific pydantic version as some users may not know which + # pydantic version they are currently using + + @override + def model_dump( + self, + *, + mode: Literal["json", "python"] | str = "python", + include: IncEx = None, + exclude: IncEx = None, + by_alias: bool = False, + exclude_unset: bool = False, + exclude_defaults: bool = False, + exclude_none: bool = False, + round_trip: bool = False, + warnings: bool | Literal["none", "warn", "error"] = True, + context: dict[str, Any] | None = None, + serialize_as_any: bool = False, + ) -> dict[str, Any]: + """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump + + Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. + + Args: + mode: The mode in which `to_python` should run. + If mode is 'json', the dictionary will only contain JSON serializable types. + If mode is 'python', the dictionary may contain any Python objects. + include: A list of fields to include in the output. + exclude: A list of fields to exclude from the output. + by_alias: Whether to use the field's alias in the dictionary key if defined. + exclude_unset: Whether to exclude fields that are unset or None from the output. + exclude_defaults: Whether to exclude fields that are set to their default value from the output. + exclude_none: Whether to exclude fields that have a value of `None` from the output. + round_trip: Whether to enable serialization and deserialization round-trip support. + warnings: Whether to log warnings when invalid fields are encountered. + + Returns: + A dictionary representation of the model. + """ + if mode != "python": + raise ValueError("mode is only supported in Pydantic v2") + if round_trip != False: + raise ValueError("round_trip is only supported in Pydantic v2") + if warnings != True: + raise ValueError("warnings is only supported in Pydantic v2") + if context is not None: + raise ValueError("context is only supported in Pydantic v2") + if serialize_as_any != False: + raise ValueError("serialize_as_any is only supported in Pydantic v2") + return super().dict( # pyright: ignore[reportDeprecated] + include=include, + exclude=exclude, + by_alias=by_alias, + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + exclude_none=exclude_none, + ) + + @override + def model_dump_json( + self, + *, + indent: int | None = None, + include: IncEx = None, + exclude: IncEx = None, + by_alias: bool = False, + exclude_unset: bool = False, + exclude_defaults: bool = False, + exclude_none: bool = False, + round_trip: bool = False, + warnings: bool | Literal["none", "warn", "error"] = True, + context: dict[str, Any] | None = None, + serialize_as_any: bool = False, + ) -> str: + """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json + + Generates a JSON representation of the model using Pydantic's `to_json` method. + + Args: + indent: Indentation to use in the JSON output. If None is passed, the output will be compact. + include: Field(s) to include in the JSON output. Can take either a string or set of strings. + exclude: Field(s) to exclude from the JSON output. Can take either a string or set of strings. + by_alias: Whether to serialize using field aliases. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that have the default value. + exclude_none: Whether to exclude fields that have a value of `None`. + round_trip: Whether to use serialization/deserialization between JSON and class instance. + warnings: Whether to show any warnings that occurred during serialization. + + Returns: + A JSON string representation of the model. + """ + if round_trip != False: + raise ValueError("round_trip is only supported in Pydantic v2") + if warnings != True: + raise ValueError("warnings is only supported in Pydantic v2") + if context is not None: + raise ValueError("context is only supported in Pydantic v2") + if serialize_as_any != False: + raise ValueError("serialize_as_any is only supported in Pydantic v2") + return super().json( # type: ignore[reportDeprecated] + indent=indent, + include=include, + exclude=exclude, + by_alias=by_alias, + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + exclude_none=exclude_none, + ) + + +def _construct_field(value: object, field: FieldInfo, key: str) -> object: + if value is None: + return field_get_default(field) + + if PYDANTIC_V2: + type_ = field.annotation + else: + type_ = cast(type, field.outer_type_) # type: ignore + + if type_ is None: + raise RuntimeError(f"Unexpected field type is None for {key}") + + return construct_type(value=value, type_=type_) + + +def is_basemodel(type_: type) -> bool: + """Returns whether or not the given type is either a `BaseModel` or a union of `BaseModel`""" + if is_union(type_): + for variant in get_args(type_): + if is_basemodel(variant): + return True + + return False + + return is_basemodel_type(type_) + + +def is_basemodel_type(type_: type) -> TypeGuard[type[BaseModel] | type[GenericModel]]: + origin = get_origin(type_) or type_ + return issubclass(origin, BaseModel) or issubclass(origin, GenericModel) + + +def construct_type(*, value: object, type_: object) -> object: + """Loose coercion to the expected type with construction of nested values. + + If the given value does not match the expected type then it is returned as-is. + """ + # we allow `object` as the input type because otherwise, passing things like + # `Literal['value']` will be reported as a type error by type checkers + type_ = cast("type[object]", type_) + + # unwrap `Annotated[T, ...]` -> `T` + if is_annotated_type(type_): + meta: tuple[Any, ...] = get_args(type_)[1:] + type_ = extract_type_arg(type_, 0) + else: + meta = tuple() + + # we need to use the origin class for any types that are subscripted generics + # e.g. Dict[str, object] + origin = get_origin(type_) or type_ + args = get_args(type_) + + if is_union(origin): + try: + return validate_type(type_=cast("type[object]", type_), value=value) + except Exception: + pass + + # if the type is a discriminated union then we want to construct the right variant + # in the union, even if the data doesn't match exactly, otherwise we'd break code + # that relies on the constructed class types, e.g. + # + # class FooType: + # kind: Literal['foo'] + # value: str + # + # class BarType: + # kind: Literal['bar'] + # value: int + # + # without this block, if the data we get is something like `{'kind': 'bar', 'value': 'foo'}` then + # we'd end up constructing `FooType` when it should be `BarType`. + discriminator = _build_discriminated_union_meta(union=type_, meta_annotations=meta) + if discriminator and is_mapping(value): + variant_value = value.get(discriminator.field_alias_from or discriminator.field_name) + if variant_value and isinstance(variant_value, str): + variant_type = discriminator.mapping.get(variant_value) + if variant_type: + return construct_type(type_=variant_type, value=value) + + # if the data is not valid, use the first variant that doesn't fail while deserializing + for variant in args: + try: + return construct_type(value=value, type_=variant) + except Exception: + continue + + raise RuntimeError(f"Could not convert data into a valid instance of {type_}") + + if origin == dict: + if not is_mapping(value): + return value + + _, items_type = get_args(type_) # Dict[_, items_type] + return {key: construct_type(value=item, type_=items_type) for key, item in value.items()} + + if not is_literal_type(type_) and (issubclass(origin, BaseModel) or issubclass(origin, GenericModel)): + if is_list(value): + return [cast(Any, type_).construct(**entry) if is_mapping(entry) else entry for entry in value] + + if is_mapping(value): + if issubclass(type_, BaseModel): + return type_.construct(**value) # type: ignore[arg-type] + + return cast(Any, type_).construct(**value) + + if origin == list: + if not is_list(value): + return value + + inner_type = args[0] # List[inner_type] + return [construct_type(value=entry, type_=inner_type) for entry in value] + + if origin == float: + if isinstance(value, int): + coerced = float(value) + if coerced != value: + return value + return coerced + + return value + + if type_ == datetime: + try: + return parse_datetime(value) # type: ignore + except Exception: + return value + + if type_ == date: + try: + return parse_date(value) # type: ignore + except Exception: + return value + + return value + + +@runtime_checkable +class CachedDiscriminatorType(Protocol): + __discriminator__: DiscriminatorDetails + + +class DiscriminatorDetails: + field_name: str + """The name of the discriminator field in the variant class, e.g. + + ```py + class Foo(BaseModel): + type: Literal['foo'] + ``` + + Will result in field_name='type' + """ + + field_alias_from: str | None + """The name of the discriminator field in the API response, e.g. + + ```py + class Foo(BaseModel): + type: Literal['foo'] = Field(alias='type_from_api') + ``` + + Will result in field_alias_from='type_from_api' + """ + + mapping: dict[str, type] + """Mapping of discriminator value to variant type, e.g. + + {'foo': FooVariant, 'bar': BarVariant} + """ + + def __init__( + self, + *, + mapping: dict[str, type], + discriminator_field: str, + discriminator_alias: str | None, + ) -> None: + self.mapping = mapping + self.field_name = discriminator_field + self.field_alias_from = discriminator_alias + + +def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, ...]) -> DiscriminatorDetails | None: + if isinstance(union, CachedDiscriminatorType): + return union.__discriminator__ + + discriminator_field_name: str | None = None + + for annotation in meta_annotations: + if isinstance(annotation, PropertyInfo) and annotation.discriminator is not None: + discriminator_field_name = annotation.discriminator + break + + if not discriminator_field_name: + return None + + mapping: dict[str, type] = {} + discriminator_alias: str | None = None + + for variant in get_args(union): + variant = strip_annotated_type(variant) + if is_basemodel_type(variant): + if PYDANTIC_V2: + field = _extract_field_schema_pv2(variant, discriminator_field_name) + if not field: + continue + + # Note: if one variant defines an alias then they all should + discriminator_alias = field.get("serialization_alias") + + field_schema = field["schema"] + + if field_schema["type"] == "literal": + for entry in cast("LiteralSchema", field_schema)["expected"]: + if isinstance(entry, str): + mapping[entry] = variant + else: + field_info = cast("dict[str, FieldInfo]", variant.__fields__).get(discriminator_field_name) # pyright: ignore[reportDeprecated, reportUnnecessaryCast] + if not field_info: + continue + + # Note: if one variant defines an alias then they all should + discriminator_alias = field_info.alias + + if field_info.annotation and is_literal_type(field_info.annotation): + for entry in get_args(field_info.annotation): + if isinstance(entry, str): + mapping[entry] = variant + + if not mapping: + return None + + details = DiscriminatorDetails( + mapping=mapping, + discriminator_field=discriminator_field_name, + discriminator_alias=discriminator_alias, + ) + cast(CachedDiscriminatorType, union).__discriminator__ = details + return details + + +def _extract_field_schema_pv2(model: type[BaseModel], field_name: str) -> ModelField | None: + schema = model.__pydantic_core_schema__ + if schema["type"] != "model": + return None + + fields_schema = schema["schema"] + if fields_schema["type"] != "model-fields": + return None + + fields_schema = cast("ModelFieldsSchema", fields_schema) + + field = fields_schema["fields"].get(field_name) + if not field: + return None + + return cast("ModelField", field) # pyright: ignore[reportUnnecessaryCast] + + +def validate_type(*, type_: type[_T], value: object) -> _T: + """Strict validation that the given value matches the expected type""" + if inspect.isclass(type_) and issubclass(type_, pydantic.BaseModel): + return cast(_T, parse_obj(type_, value)) + + return cast(_T, _validate_non_model_type(type_=type_, value=value)) + + +# our use of subclasssing here causes weirdness for type checkers, +# so we just pretend that we don't subclass +if TYPE_CHECKING: + GenericModel = BaseModel +else: + + class GenericModel(BaseGenericModel, BaseModel): + pass + + +if PYDANTIC_V2: + from pydantic import TypeAdapter as _TypeAdapter + + _CachedTypeAdapter = cast("TypeAdapter[object]", lru_cache(maxsize=None)(_TypeAdapter)) + + if TYPE_CHECKING: + from pydantic import TypeAdapter + else: + TypeAdapter = _CachedTypeAdapter + + def _validate_non_model_type(*, type_: type[_T], value: object) -> _T: + return TypeAdapter(type_).validate_python(value) + +elif not TYPE_CHECKING: # TODO: condition is weird + + class RootModel(GenericModel, Generic[_T]): + """Used as a placeholder to easily convert runtime types to a Pydantic format + to provide validation. + + For example: + ```py + validated = RootModel[int](__root__="5").__root__ + # validated: 5 + ``` + """ + + __root__: _T + + def _validate_non_model_type(*, type_: type[_T], value: object) -> _T: + model = _create_pydantic_model(type_).validate(value) + return cast(_T, model.__root__) + + def _create_pydantic_model(type_: _T) -> Type[RootModel[_T]]: + return RootModel[type_] # type: ignore + + +class FinalRequestOptionsInput(TypedDict, total=False): + method: Required[str] + url: Required[str] + params: Query + headers: Headers + max_retries: int + timeout: float | Timeout | None + files: HttpxRequestFiles | None + idempotency_key: str + json_data: Body + extra_json: AnyMapping + + +@final +class FinalRequestOptions(pydantic.BaseModel): + method: str + url: str + params: Query = {} + headers: Union[Headers, NotGiven] = NotGiven() + max_retries: Union[int, NotGiven] = NotGiven() + timeout: Union[float, Timeout, None, NotGiven] = NotGiven() + files: Union[HttpxRequestFiles, None] = None + idempotency_key: Union[str, None] = None + post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven() + + # It should be noted that we cannot use `json` here as that would override + # a BaseModel method in an incompatible fashion. + json_data: Union[Body, None] = None + extra_json: Union[AnyMapping, None] = None + + if PYDANTIC_V2: + model_config: ClassVar[ConfigDict] = ConfigDict(arbitrary_types_allowed=True) + else: + + class Config(pydantic.BaseConfig): # pyright: ignore[reportDeprecated] + arbitrary_types_allowed: bool = True + + def get_max_retries(self, max_retries: int) -> int: + if isinstance(self.max_retries, NotGiven): + return max_retries + return self.max_retries + + def _strip_raw_response_header(self) -> None: + if not is_given(self.headers): + return + + if self.headers.get(RAW_RESPONSE_HEADER): + self.headers = {**self.headers} + self.headers.pop(RAW_RESPONSE_HEADER) + + # override the `construct` method so that we can run custom transformations. + # this is necessary as we don't want to do any actual runtime type checking + # (which means we can't use validators) but we do want to ensure that `NotGiven` + # values are not present + # + # type ignore required because we're adding explicit types to `**values` + @classmethod + def construct( # type: ignore + cls, + _fields_set: set[str] | None = None, + **values: Unpack[FinalRequestOptionsInput], + ) -> FinalRequestOptions: + kwargs: dict[str, Any] = { + # we unconditionally call `strip_not_given` on any value + # as it will just ignore any non-mapping types + key: strip_not_given(value) + for key, value in values.items() + } + if PYDANTIC_V2: + return super().model_construct(_fields_set, **kwargs) + return cast(FinalRequestOptions, super().construct(_fields_set, **kwargs)) # pyright: ignore[reportDeprecated] + + if not TYPE_CHECKING: + # type checkers incorrectly complain about this assignment + model_construct = construct diff --git a/src/runloop/_qs.py b/src/runloop/_qs.py new file mode 100644 index 000000000..274320ca5 --- /dev/null +++ b/src/runloop/_qs.py @@ -0,0 +1,150 @@ +from __future__ import annotations + +from typing import Any, List, Tuple, Union, Mapping, TypeVar +from urllib.parse import parse_qs, urlencode +from typing_extensions import Literal, get_args + +from ._types import NOT_GIVEN, NotGiven, NotGivenOr +from ._utils import flatten + +_T = TypeVar("_T") + + +ArrayFormat = Literal["comma", "repeat", "indices", "brackets"] +NestedFormat = Literal["dots", "brackets"] + +PrimitiveData = Union[str, int, float, bool, None] +# this should be Data = Union[PrimitiveData, "List[Data]", "Tuple[Data]", "Mapping[str, Data]"] +# https://github.com/microsoft/pyright/issues/3555 +Data = Union[PrimitiveData, List[Any], Tuple[Any], "Mapping[str, Any]"] +Params = Mapping[str, Data] + + +class Querystring: + array_format: ArrayFormat + nested_format: NestedFormat + + def __init__( + self, + *, + array_format: ArrayFormat = "repeat", + nested_format: NestedFormat = "brackets", + ) -> None: + self.array_format = array_format + self.nested_format = nested_format + + def parse(self, query: str) -> Mapping[str, object]: + # Note: custom format syntax is not supported yet + return parse_qs(query) + + def stringify( + self, + params: Params, + *, + array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, + nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + ) -> str: + return urlencode( + self.stringify_items( + params, + array_format=array_format, + nested_format=nested_format, + ) + ) + + def stringify_items( + self, + params: Params, + *, + array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, + nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + ) -> list[tuple[str, str]]: + opts = Options( + qs=self, + array_format=array_format, + nested_format=nested_format, + ) + return flatten([self._stringify_item(key, value, opts) for key, value in params.items()]) + + def _stringify_item( + self, + key: str, + value: Data, + opts: Options, + ) -> list[tuple[str, str]]: + if isinstance(value, Mapping): + items: list[tuple[str, str]] = [] + nested_format = opts.nested_format + for subkey, subvalue in value.items(): + items.extend( + self._stringify_item( + # TODO: error if unknown format + f"{key}.{subkey}" if nested_format == "dots" else f"{key}[{subkey}]", + subvalue, + opts, + ) + ) + return items + + if isinstance(value, (list, tuple)): + array_format = opts.array_format + if array_format == "comma": + return [ + ( + key, + ",".join(self._primitive_value_to_str(item) for item in value if item is not None), + ), + ] + elif array_format == "repeat": + items = [] + for item in value: + items.extend(self._stringify_item(key, item, opts)) + return items + elif array_format == "indices": + raise NotImplementedError("The array indices format is not supported yet") + elif array_format == "brackets": + items = [] + key = key + "[]" + for item in value: + items.extend(self._stringify_item(key, item, opts)) + return items + else: + raise NotImplementedError( + f"Unknown array_format value: {array_format}, choose from {', '.join(get_args(ArrayFormat))}" + ) + + serialised = self._primitive_value_to_str(value) + if not serialised: + return [] + return [(key, serialised)] + + def _primitive_value_to_str(self, value: PrimitiveData) -> str: + # copied from httpx + if value is True: + return "true" + elif value is False: + return "false" + elif value is None: + return "" + return str(value) + + +_qs = Querystring() +parse = _qs.parse +stringify = _qs.stringify +stringify_items = _qs.stringify_items + + +class Options: + array_format: ArrayFormat + nested_format: NestedFormat + + def __init__( + self, + qs: Querystring = _qs, + *, + array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, + nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + ) -> None: + self.array_format = qs.array_format if isinstance(array_format, NotGiven) else array_format + self.nested_format = qs.nested_format if isinstance(nested_format, NotGiven) else nested_format diff --git a/src/runloop/_resource.py b/src/runloop/_resource.py new file mode 100644 index 000000000..bba835b09 --- /dev/null +++ b/src/runloop/_resource.py @@ -0,0 +1,43 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import time +from typing import TYPE_CHECKING + +import anyio + +if TYPE_CHECKING: + from ._client import Runloop, AsyncRunloop + + +class SyncAPIResource: + _client: Runloop + + def __init__(self, client: Runloop) -> None: + self._client = client + self._get = client.get + self._post = client.post + self._patch = client.patch + self._put = client.put + self._delete = client.delete + self._get_api_list = client.get_api_list + + def _sleep(self, seconds: float) -> None: + time.sleep(seconds) + + +class AsyncAPIResource: + _client: AsyncRunloop + + def __init__(self, client: AsyncRunloop) -> None: + self._client = client + self._get = client.get + self._post = client.post + self._patch = client.patch + self._put = client.put + self._delete = client.delete + self._get_api_list = client.get_api_list + + async def _sleep(self, seconds: float) -> None: + await anyio.sleep(seconds) diff --git a/src/runloop/_response.py b/src/runloop/_response.py new file mode 100644 index 000000000..47695a4a6 --- /dev/null +++ b/src/runloop/_response.py @@ -0,0 +1,820 @@ +from __future__ import annotations + +import os +import inspect +import logging +import datetime +import functools +from types import TracebackType +from typing import ( + TYPE_CHECKING, + Any, + Union, + Generic, + TypeVar, + Callable, + Iterator, + AsyncIterator, + cast, + overload, +) +from typing_extensions import Awaitable, ParamSpec, override, get_origin + +import anyio +import httpx +import pydantic + +from ._types import NoneType +from ._utils import is_given, extract_type_arg, is_annotated_type, extract_type_var_from_base +from ._models import BaseModel, is_basemodel +from ._constants import RAW_RESPONSE_HEADER, OVERRIDE_CAST_TO_HEADER +from ._streaming import Stream, AsyncStream, is_stream_class_type, extract_stream_chunk_type +from ._exceptions import RunloopError, APIResponseValidationError + +if TYPE_CHECKING: + from ._models import FinalRequestOptions + from ._base_client import BaseClient + + +P = ParamSpec("P") +R = TypeVar("R") +_T = TypeVar("_T") +_APIResponseT = TypeVar("_APIResponseT", bound="APIResponse[Any]") +_AsyncAPIResponseT = TypeVar("_AsyncAPIResponseT", bound="AsyncAPIResponse[Any]") + +log: logging.Logger = logging.getLogger(__name__) + + +class BaseAPIResponse(Generic[R]): + _cast_to: type[R] + _client: BaseClient[Any, Any] + _parsed_by_type: dict[type[Any], Any] + _is_sse_stream: bool + _stream_cls: type[Stream[Any]] | type[AsyncStream[Any]] | None + _options: FinalRequestOptions + + http_response: httpx.Response + + def __init__( + self, + *, + raw: httpx.Response, + cast_to: type[R], + client: BaseClient[Any, Any], + stream: bool, + stream_cls: type[Stream[Any]] | type[AsyncStream[Any]] | None, + options: FinalRequestOptions, + ) -> None: + self._cast_to = cast_to + self._client = client + self._parsed_by_type = {} + self._is_sse_stream = stream + self._stream_cls = stream_cls + self._options = options + self.http_response = raw + + @property + def headers(self) -> httpx.Headers: + return self.http_response.headers + + @property + def http_request(self) -> httpx.Request: + """Returns the httpx Request instance associated with the current response.""" + return self.http_response.request + + @property + def status_code(self) -> int: + return self.http_response.status_code + + @property + def url(self) -> httpx.URL: + """Returns the URL for which the request was made.""" + return self.http_response.url + + @property + def method(self) -> str: + return self.http_request.method + + @property + def http_version(self) -> str: + return self.http_response.http_version + + @property + def elapsed(self) -> datetime.timedelta: + """The time taken for the complete request/response cycle to complete.""" + return self.http_response.elapsed + + @property + def is_closed(self) -> bool: + """Whether or not the response body has been closed. + + If this is False then there is response data that has not been read yet. + You must either fully consume the response body or call `.close()` + before discarding the response to prevent resource leaks. + """ + return self.http_response.is_closed + + @override + def __repr__(self) -> str: + return ( + f"<{self.__class__.__name__} [{self.status_code} {self.http_response.reason_phrase}] type={self._cast_to}>" + ) + + def _parse(self, *, to: type[_T] | None = None) -> R | _T: + # unwrap `Annotated[T, ...]` -> `T` + if to and is_annotated_type(to): + to = extract_type_arg(to, 0) + + if self._is_sse_stream: + if to: + if not is_stream_class_type(to): + raise TypeError(f"Expected custom parse type to be a subclass of {Stream} or {AsyncStream}") + + return cast( + _T, + to( + cast_to=extract_stream_chunk_type( + to, + failure_message="Expected custom stream type to be passed with a type argument, e.g. Stream[ChunkType]", + ), + response=self.http_response, + client=cast(Any, self._client), + ), + ) + + if self._stream_cls: + return cast( + R, + self._stream_cls( + cast_to=extract_stream_chunk_type(self._stream_cls), + response=self.http_response, + client=cast(Any, self._client), + ), + ) + + stream_cls = cast("type[Stream[Any]] | type[AsyncStream[Any]] | None", self._client._default_stream_cls) + if stream_cls is None: + raise MissingStreamClassError() + + return cast( + R, + stream_cls( + cast_to=self._cast_to, + response=self.http_response, + client=cast(Any, self._client), + ), + ) + + cast_to = to if to is not None else self._cast_to + + # unwrap `Annotated[T, ...]` -> `T` + if is_annotated_type(cast_to): + cast_to = extract_type_arg(cast_to, 0) + + if cast_to is NoneType: + return cast(R, None) + + response = self.http_response + if cast_to == str: + return cast(R, response.text) + + if cast_to == bytes: + return cast(R, response.content) + + if cast_to == int: + return cast(R, int(response.text)) + + if cast_to == float: + return cast(R, float(response.text)) + + origin = get_origin(cast_to) or cast_to + + if origin == APIResponse: + raise RuntimeError("Unexpected state - cast_to is `APIResponse`") + + if inspect.isclass(origin) and issubclass(origin, httpx.Response): + # Because of the invariance of our ResponseT TypeVar, users can subclass httpx.Response + # and pass that class to our request functions. We cannot change the variance to be either + # covariant or contravariant as that makes our usage of ResponseT illegal. We could construct + # the response class ourselves but that is something that should be supported directly in httpx + # as it would be easy to incorrectly construct the Response object due to the multitude of arguments. + if cast_to != httpx.Response: + raise ValueError(f"Subclasses of httpx.Response cannot be passed to `cast_to`") + return cast(R, response) + + if inspect.isclass(origin) and not issubclass(origin, BaseModel) and issubclass(origin, pydantic.BaseModel): + raise TypeError("Pydantic models must subclass our base model type, e.g. `from runloop import BaseModel`") + + if ( + cast_to is not object + and not origin is list + and not origin is dict + and not origin is Union + and not issubclass(origin, BaseModel) + ): + raise RuntimeError( + f"Unsupported type, expected {cast_to} to be a subclass of {BaseModel}, {dict}, {list}, {Union}, {NoneType}, {str} or {httpx.Response}." + ) + + # split is required to handle cases where additional information is included + # in the response, e.g. application/json; charset=utf-8 + content_type, *_ = response.headers.get("content-type", "*").split(";") + if content_type != "application/json": + if is_basemodel(cast_to): + try: + data = response.json() + except Exception as exc: + log.debug("Could not read JSON from response data due to %s - %s", type(exc), exc) + else: + return self._client._process_response_data( + data=data, + cast_to=cast_to, # type: ignore + response=response, + ) + + if self._client._strict_response_validation: + raise APIResponseValidationError( + response=response, + message=f"Expected Content-Type response header to be `application/json` but received `{content_type}` instead.", + body=response.text, + ) + + # If the API responds with content that isn't JSON then we just return + # the (decoded) text without performing any parsing so that you can still + # handle the response however you need to. + return response.text # type: ignore + + data = response.json() + + return self._client._process_response_data( + data=data, + cast_to=cast_to, # type: ignore + response=response, + ) + + +class APIResponse(BaseAPIResponse[R]): + @overload + def parse(self, *, to: type[_T]) -> _T: + ... + + @overload + def parse(self) -> R: + ... + + def parse(self, *, to: type[_T] | None = None) -> R | _T: + """Returns the rich python representation of this response's data. + + For lower-level control, see `.read()`, `.json()`, `.iter_bytes()`. + + You can customise the type that the response is parsed into through + the `to` argument, e.g. + + ```py + from runloop import BaseModel + + + class MyModel(BaseModel): + foo: str + + + obj = response.parse(to=MyModel) + print(obj.foo) + ``` + + We support parsing: + - `BaseModel` + - `dict` + - `list` + - `Union` + - `str` + - `int` + - `float` + - `httpx.Response` + """ + cache_key = to if to is not None else self._cast_to + cached = self._parsed_by_type.get(cache_key) + if cached is not None: + return cached # type: ignore[no-any-return] + + if not self._is_sse_stream: + self.read() + + parsed = self._parse(to=to) + if is_given(self._options.post_parser): + parsed = self._options.post_parser(parsed) + + self._parsed_by_type[cache_key] = parsed + return parsed + + def read(self) -> bytes: + """Read and return the binary response content.""" + try: + return self.http_response.read() + except httpx.StreamConsumed as exc: + # The default error raised by httpx isn't very + # helpful in our case so we re-raise it with + # a different error message. + raise StreamAlreadyConsumed() from exc + + def text(self) -> str: + """Read and decode the response content into a string.""" + self.read() + return self.http_response.text + + def json(self) -> object: + """Read and decode the JSON response content.""" + self.read() + return self.http_response.json() + + def close(self) -> None: + """Close the response and release the connection. + + Automatically called if the response body is read to completion. + """ + self.http_response.close() + + def iter_bytes(self, chunk_size: int | None = None) -> Iterator[bytes]: + """ + A byte-iterator over the decoded response content. + + This automatically handles gzip, deflate and brotli encoded responses. + """ + for chunk in self.http_response.iter_bytes(chunk_size): + yield chunk + + def iter_text(self, chunk_size: int | None = None) -> Iterator[str]: + """A str-iterator over the decoded response content + that handles both gzip, deflate, etc but also detects the content's + string encoding. + """ + for chunk in self.http_response.iter_text(chunk_size): + yield chunk + + def iter_lines(self) -> Iterator[str]: + """Like `iter_text()` but will only yield chunks for each line""" + for chunk in self.http_response.iter_lines(): + yield chunk + + +class AsyncAPIResponse(BaseAPIResponse[R]): + @overload + async def parse(self, *, to: type[_T]) -> _T: + ... + + @overload + async def parse(self) -> R: + ... + + async def parse(self, *, to: type[_T] | None = None) -> R | _T: + """Returns the rich python representation of this response's data. + + For lower-level control, see `.read()`, `.json()`, `.iter_bytes()`. + + You can customise the type that the response is parsed into through + the `to` argument, e.g. + + ```py + from runloop import BaseModel + + + class MyModel(BaseModel): + foo: str + + + obj = response.parse(to=MyModel) + print(obj.foo) + ``` + + We support parsing: + - `BaseModel` + - `dict` + - `list` + - `Union` + - `str` + - `httpx.Response` + """ + cache_key = to if to is not None else self._cast_to + cached = self._parsed_by_type.get(cache_key) + if cached is not None: + return cached # type: ignore[no-any-return] + + if not self._is_sse_stream: + await self.read() + + parsed = self._parse(to=to) + if is_given(self._options.post_parser): + parsed = self._options.post_parser(parsed) + + self._parsed_by_type[cache_key] = parsed + return parsed + + async def read(self) -> bytes: + """Read and return the binary response content.""" + try: + return await self.http_response.aread() + except httpx.StreamConsumed as exc: + # the default error raised by httpx isn't very + # helpful in our case so we re-raise it with + # a different error message + raise StreamAlreadyConsumed() from exc + + async def text(self) -> str: + """Read and decode the response content into a string.""" + await self.read() + return self.http_response.text + + async def json(self) -> object: + """Read and decode the JSON response content.""" + await self.read() + return self.http_response.json() + + async def close(self) -> None: + """Close the response and release the connection. + + Automatically called if the response body is read to completion. + """ + await self.http_response.aclose() + + async def iter_bytes(self, chunk_size: int | None = None) -> AsyncIterator[bytes]: + """ + A byte-iterator over the decoded response content. + + This automatically handles gzip, deflate and brotli encoded responses. + """ + async for chunk in self.http_response.aiter_bytes(chunk_size): + yield chunk + + async def iter_text(self, chunk_size: int | None = None) -> AsyncIterator[str]: + """A str-iterator over the decoded response content + that handles both gzip, deflate, etc but also detects the content's + string encoding. + """ + async for chunk in self.http_response.aiter_text(chunk_size): + yield chunk + + async def iter_lines(self) -> AsyncIterator[str]: + """Like `iter_text()` but will only yield chunks for each line""" + async for chunk in self.http_response.aiter_lines(): + yield chunk + + +class BinaryAPIResponse(APIResponse[bytes]): + """Subclass of APIResponse providing helpers for dealing with binary data. + + Note: If you want to stream the response data instead of eagerly reading it + all at once then you should use `.with_streaming_response` when making + the API request, e.g. `.with_streaming_response.get_binary_response()` + """ + + def write_to_file( + self, + file: str | os.PathLike[str], + ) -> None: + """Write the output to the given file. + + Accepts a filename or any path-like object, e.g. pathlib.Path + + Note: if you want to stream the data to the file instead of writing + all at once then you should use `.with_streaming_response` when making + the API request, e.g. `.with_streaming_response.get_binary_response()` + """ + with open(file, mode="wb") as f: + for data in self.iter_bytes(): + f.write(data) + + +class AsyncBinaryAPIResponse(AsyncAPIResponse[bytes]): + """Subclass of APIResponse providing helpers for dealing with binary data. + + Note: If you want to stream the response data instead of eagerly reading it + all at once then you should use `.with_streaming_response` when making + the API request, e.g. `.with_streaming_response.get_binary_response()` + """ + + async def write_to_file( + self, + file: str | os.PathLike[str], + ) -> None: + """Write the output to the given file. + + Accepts a filename or any path-like object, e.g. pathlib.Path + + Note: if you want to stream the data to the file instead of writing + all at once then you should use `.with_streaming_response` when making + the API request, e.g. `.with_streaming_response.get_binary_response()` + """ + path = anyio.Path(file) + async with await path.open(mode="wb") as f: + async for data in self.iter_bytes(): + await f.write(data) + + +class StreamedBinaryAPIResponse(APIResponse[bytes]): + def stream_to_file( + self, + file: str | os.PathLike[str], + *, + chunk_size: int | None = None, + ) -> None: + """Streams the output to the given file. + + Accepts a filename or any path-like object, e.g. pathlib.Path + """ + with open(file, mode="wb") as f: + for data in self.iter_bytes(chunk_size): + f.write(data) + + +class AsyncStreamedBinaryAPIResponse(AsyncAPIResponse[bytes]): + async def stream_to_file( + self, + file: str | os.PathLike[str], + *, + chunk_size: int | None = None, + ) -> None: + """Streams the output to the given file. + + Accepts a filename or any path-like object, e.g. pathlib.Path + """ + path = anyio.Path(file) + async with await path.open(mode="wb") as f: + async for data in self.iter_bytes(chunk_size): + await f.write(data) + + +class MissingStreamClassError(TypeError): + def __init__(self) -> None: + super().__init__( + "The `stream` argument was set to `True` but the `stream_cls` argument was not given. See `runloop._streaming` for reference", + ) + + +class StreamAlreadyConsumed(RunloopError): + """ + Attempted to read or stream content, but the content has already + been streamed. + + This can happen if you use a method like `.iter_lines()` and then attempt + to read th entire response body afterwards, e.g. + + ```py + response = await client.post(...) + async for line in response.iter_lines(): + ... # do something with `line` + + content = await response.read() + # ^ error + ``` + + If you want this behaviour you'll need to either manually accumulate the response + content or call `await response.read()` before iterating over the stream. + """ + + def __init__(self) -> None: + message = ( + "Attempted to read or stream some content, but the content has " + "already been streamed. " + "This could be due to attempting to stream the response " + "content more than once." + "\n\n" + "You can fix this by manually accumulating the response content while streaming " + "or by calling `.read()` before starting to stream." + ) + super().__init__(message) + + +class ResponseContextManager(Generic[_APIResponseT]): + """Context manager for ensuring that a request is not made + until it is entered and that the response will always be closed + when the context manager exits + """ + + def __init__(self, request_func: Callable[[], _APIResponseT]) -> None: + self._request_func = request_func + self.__response: _APIResponseT | None = None + + def __enter__(self) -> _APIResponseT: + self.__response = self._request_func() + return self.__response + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + if self.__response is not None: + self.__response.close() + + +class AsyncResponseContextManager(Generic[_AsyncAPIResponseT]): + """Context manager for ensuring that a request is not made + until it is entered and that the response will always be closed + when the context manager exits + """ + + def __init__(self, api_request: Awaitable[_AsyncAPIResponseT]) -> None: + self._api_request = api_request + self.__response: _AsyncAPIResponseT | None = None + + async def __aenter__(self) -> _AsyncAPIResponseT: + self.__response = await self._api_request + return self.__response + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + if self.__response is not None: + await self.__response.close() + + +def to_streamed_response_wrapper(func: Callable[P, R]) -> Callable[P, ResponseContextManager[APIResponse[R]]]: + """Higher order function that takes one of our bound API methods and wraps it + to support streaming and returning the raw `APIResponse` object directly. + """ + + @functools.wraps(func) + def wrapped(*args: P.args, **kwargs: P.kwargs) -> ResponseContextManager[APIResponse[R]]: + extra_headers: dict[str, str] = {**(cast(Any, kwargs.get("extra_headers")) or {})} + extra_headers[RAW_RESPONSE_HEADER] = "stream" + + kwargs["extra_headers"] = extra_headers + + make_request = functools.partial(func, *args, **kwargs) + + return ResponseContextManager(cast(Callable[[], APIResponse[R]], make_request)) + + return wrapped + + +def async_to_streamed_response_wrapper( + func: Callable[P, Awaitable[R]], +) -> Callable[P, AsyncResponseContextManager[AsyncAPIResponse[R]]]: + """Higher order function that takes one of our bound API methods and wraps it + to support streaming and returning the raw `APIResponse` object directly. + """ + + @functools.wraps(func) + def wrapped(*args: P.args, **kwargs: P.kwargs) -> AsyncResponseContextManager[AsyncAPIResponse[R]]: + extra_headers: dict[str, str] = {**(cast(Any, kwargs.get("extra_headers")) or {})} + extra_headers[RAW_RESPONSE_HEADER] = "stream" + + kwargs["extra_headers"] = extra_headers + + make_request = func(*args, **kwargs) + + return AsyncResponseContextManager(cast(Awaitable[AsyncAPIResponse[R]], make_request)) + + return wrapped + + +def to_custom_streamed_response_wrapper( + func: Callable[P, object], + response_cls: type[_APIResponseT], +) -> Callable[P, ResponseContextManager[_APIResponseT]]: + """Higher order function that takes one of our bound API methods and an `APIResponse` class + and wraps the method to support streaming and returning the given response class directly. + + Note: the given `response_cls` *must* be concrete, e.g. `class BinaryAPIResponse(APIResponse[bytes])` + """ + + @functools.wraps(func) + def wrapped(*args: P.args, **kwargs: P.kwargs) -> ResponseContextManager[_APIResponseT]: + extra_headers: dict[str, Any] = {**(cast(Any, kwargs.get("extra_headers")) or {})} + extra_headers[RAW_RESPONSE_HEADER] = "stream" + extra_headers[OVERRIDE_CAST_TO_HEADER] = response_cls + + kwargs["extra_headers"] = extra_headers + + make_request = functools.partial(func, *args, **kwargs) + + return ResponseContextManager(cast(Callable[[], _APIResponseT], make_request)) + + return wrapped + + +def async_to_custom_streamed_response_wrapper( + func: Callable[P, Awaitable[object]], + response_cls: type[_AsyncAPIResponseT], +) -> Callable[P, AsyncResponseContextManager[_AsyncAPIResponseT]]: + """Higher order function that takes one of our bound API methods and an `APIResponse` class + and wraps the method to support streaming and returning the given response class directly. + + Note: the given `response_cls` *must* be concrete, e.g. `class BinaryAPIResponse(APIResponse[bytes])` + """ + + @functools.wraps(func) + def wrapped(*args: P.args, **kwargs: P.kwargs) -> AsyncResponseContextManager[_AsyncAPIResponseT]: + extra_headers: dict[str, Any] = {**(cast(Any, kwargs.get("extra_headers")) or {})} + extra_headers[RAW_RESPONSE_HEADER] = "stream" + extra_headers[OVERRIDE_CAST_TO_HEADER] = response_cls + + kwargs["extra_headers"] = extra_headers + + make_request = func(*args, **kwargs) + + return AsyncResponseContextManager(cast(Awaitable[_AsyncAPIResponseT], make_request)) + + return wrapped + + +def to_raw_response_wrapper(func: Callable[P, R]) -> Callable[P, APIResponse[R]]: + """Higher order function that takes one of our bound API methods and wraps it + to support returning the raw `APIResponse` object directly. + """ + + @functools.wraps(func) + def wrapped(*args: P.args, **kwargs: P.kwargs) -> APIResponse[R]: + extra_headers: dict[str, str] = {**(cast(Any, kwargs.get("extra_headers")) or {})} + extra_headers[RAW_RESPONSE_HEADER] = "raw" + + kwargs["extra_headers"] = extra_headers + + return cast(APIResponse[R], func(*args, **kwargs)) + + return wrapped + + +def async_to_raw_response_wrapper(func: Callable[P, Awaitable[R]]) -> Callable[P, Awaitable[AsyncAPIResponse[R]]]: + """Higher order function that takes one of our bound API methods and wraps it + to support returning the raw `APIResponse` object directly. + """ + + @functools.wraps(func) + async def wrapped(*args: P.args, **kwargs: P.kwargs) -> AsyncAPIResponse[R]: + extra_headers: dict[str, str] = {**(cast(Any, kwargs.get("extra_headers")) or {})} + extra_headers[RAW_RESPONSE_HEADER] = "raw" + + kwargs["extra_headers"] = extra_headers + + return cast(AsyncAPIResponse[R], await func(*args, **kwargs)) + + return wrapped + + +def to_custom_raw_response_wrapper( + func: Callable[P, object], + response_cls: type[_APIResponseT], +) -> Callable[P, _APIResponseT]: + """Higher order function that takes one of our bound API methods and an `APIResponse` class + and wraps the method to support returning the given response class directly. + + Note: the given `response_cls` *must* be concrete, e.g. `class BinaryAPIResponse(APIResponse[bytes])` + """ + + @functools.wraps(func) + def wrapped(*args: P.args, **kwargs: P.kwargs) -> _APIResponseT: + extra_headers: dict[str, Any] = {**(cast(Any, kwargs.get("extra_headers")) or {})} + extra_headers[RAW_RESPONSE_HEADER] = "raw" + extra_headers[OVERRIDE_CAST_TO_HEADER] = response_cls + + kwargs["extra_headers"] = extra_headers + + return cast(_APIResponseT, func(*args, **kwargs)) + + return wrapped + + +def async_to_custom_raw_response_wrapper( + func: Callable[P, Awaitable[object]], + response_cls: type[_AsyncAPIResponseT], +) -> Callable[P, Awaitable[_AsyncAPIResponseT]]: + """Higher order function that takes one of our bound API methods and an `APIResponse` class + and wraps the method to support returning the given response class directly. + + Note: the given `response_cls` *must* be concrete, e.g. `class BinaryAPIResponse(APIResponse[bytes])` + """ + + @functools.wraps(func) + def wrapped(*args: P.args, **kwargs: P.kwargs) -> Awaitable[_AsyncAPIResponseT]: + extra_headers: dict[str, Any] = {**(cast(Any, kwargs.get("extra_headers")) or {})} + extra_headers[RAW_RESPONSE_HEADER] = "raw" + extra_headers[OVERRIDE_CAST_TO_HEADER] = response_cls + + kwargs["extra_headers"] = extra_headers + + return cast(Awaitable[_AsyncAPIResponseT], func(*args, **kwargs)) + + return wrapped + + +def extract_response_type(typ: type[BaseAPIResponse[Any]]) -> type: + """Given a type like `APIResponse[T]`, returns the generic type variable `T`. + + This also handles the case where a concrete subclass is given, e.g. + ```py + class MyResponse(APIResponse[bytes]): + ... + + extract_response_type(MyResponse) -> bytes + ``` + """ + return extract_type_var_from_base( + typ, + generic_bases=cast("tuple[type, ...]", (BaseAPIResponse, APIResponse, AsyncAPIResponse)), + index=0, + ) diff --git a/src/runloop/_streaming.py b/src/runloop/_streaming.py new file mode 100644 index 000000000..ded05ee4b --- /dev/null +++ b/src/runloop/_streaming.py @@ -0,0 +1,333 @@ +# Note: initially copied from https://github.com/florimondmanca/httpx-sse/blob/master/src/httpx_sse/_decoders.py +from __future__ import annotations + +import json +import inspect +from types import TracebackType +from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, AsyncIterator, cast +from typing_extensions import Self, Protocol, TypeGuard, override, get_origin, runtime_checkable + +import httpx + +from ._utils import extract_type_var_from_base + +if TYPE_CHECKING: + from ._client import Runloop, AsyncRunloop + + +_T = TypeVar("_T") + + +class Stream(Generic[_T]): + """Provides the core interface to iterate over a synchronous stream response.""" + + response: httpx.Response + + _decoder: SSEBytesDecoder + + def __init__( + self, + *, + cast_to: type[_T], + response: httpx.Response, + client: Runloop, + ) -> None: + self.response = response + self._cast_to = cast_to + self._client = client + self._decoder = client._make_sse_decoder() + self._iterator = self.__stream__() + + def __next__(self) -> _T: + return self._iterator.__next__() + + def __iter__(self) -> Iterator[_T]: + for item in self._iterator: + yield item + + def _iter_events(self) -> Iterator[ServerSentEvent]: + yield from self._decoder.iter_bytes(self.response.iter_bytes()) + + def __stream__(self) -> Iterator[_T]: + cast_to = cast(Any, self._cast_to) + response = self.response + process_data = self._client._process_response_data + iterator = self._iter_events() + + for sse in iterator: + yield process_data(data=sse.json(), cast_to=cast_to, response=response) + + # Ensure the entire stream is consumed + for _sse in iterator: + ... + + def __enter__(self) -> Self: + return self + + def __exit__( + self, + exc_type: type[BaseException] | None, + exc: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + self.close() + + def close(self) -> None: + """ + Close the response and release the connection. + + Automatically called if the response body is read to completion. + """ + self.response.close() + + +class AsyncStream(Generic[_T]): + """Provides the core interface to iterate over an asynchronous stream response.""" + + response: httpx.Response + + _decoder: SSEDecoder | SSEBytesDecoder + + def __init__( + self, + *, + cast_to: type[_T], + response: httpx.Response, + client: AsyncRunloop, + ) -> None: + self.response = response + self._cast_to = cast_to + self._client = client + self._decoder = client._make_sse_decoder() + self._iterator = self.__stream__() + + async def __anext__(self) -> _T: + return await self._iterator.__anext__() + + async def __aiter__(self) -> AsyncIterator[_T]: + async for item in self._iterator: + yield item + + async def _iter_events(self) -> AsyncIterator[ServerSentEvent]: + async for sse in self._decoder.aiter_bytes(self.response.aiter_bytes()): + yield sse + + async def __stream__(self) -> AsyncIterator[_T]: + cast_to = cast(Any, self._cast_to) + response = self.response + process_data = self._client._process_response_data + iterator = self._iter_events() + + async for sse in iterator: + yield process_data(data=sse.json(), cast_to=cast_to, response=response) + + # Ensure the entire stream is consumed + async for _sse in iterator: + ... + + async def __aenter__(self) -> Self: + return self + + async def __aexit__( + self, + exc_type: type[BaseException] | None, + exc: BaseException | None, + exc_tb: TracebackType | None, + ) -> None: + await self.close() + + async def close(self) -> None: + """ + Close the response and release the connection. + + Automatically called if the response body is read to completion. + """ + await self.response.aclose() + + +class ServerSentEvent: + def __init__( + self, + *, + event: str | None = None, + data: str | None = None, + id: str | None = None, + retry: int | None = None, + ) -> None: + if data is None: + data = "" + + self._id = id + self._data = data + self._event = event or None + self._retry = retry + + @property + def event(self) -> str | None: + return self._event + + @property + def id(self) -> str | None: + return self._id + + @property + def retry(self) -> int | None: + return self._retry + + @property + def data(self) -> str: + return self._data + + def json(self) -> Any: + return json.loads(self.data) + + @override + def __repr__(self) -> str: + return f"ServerSentEvent(event={self.event}, data={self.data}, id={self.id}, retry={self.retry})" + + +class SSEDecoder: + _data: list[str] + _event: str | None + _retry: int | None + _last_event_id: str | None + + def __init__(self) -> None: + self._event = None + self._data = [] + self._last_event_id = None + self._retry = None + + def iter_bytes(self, iterator: Iterator[bytes]) -> Iterator[ServerSentEvent]: + """Given an iterator that yields raw binary data, iterate over it & yield every event encountered""" + for chunk in self._iter_chunks(iterator): + # Split before decoding so splitlines() only uses \r and \n + for raw_line in chunk.splitlines(): + line = raw_line.decode("utf-8") + sse = self.decode(line) + if sse: + yield sse + + def _iter_chunks(self, iterator: Iterator[bytes]) -> Iterator[bytes]: + """Given an iterator that yields raw binary data, iterate over it and yield individual SSE chunks""" + data = b"" + for chunk in iterator: + for line in chunk.splitlines(keepends=True): + data += line + if data.endswith((b"\r\r", b"\n\n", b"\r\n\r\n")): + yield data + data = b"" + if data: + yield data + + async def aiter_bytes(self, iterator: AsyncIterator[bytes]) -> AsyncIterator[ServerSentEvent]: + """Given an iterator that yields raw binary data, iterate over it & yield every event encountered""" + async for chunk in self._aiter_chunks(iterator): + # Split before decoding so splitlines() only uses \r and \n + for raw_line in chunk.splitlines(): + line = raw_line.decode("utf-8") + sse = self.decode(line) + if sse: + yield sse + + async def _aiter_chunks(self, iterator: AsyncIterator[bytes]) -> AsyncIterator[bytes]: + """Given an iterator that yields raw binary data, iterate over it and yield individual SSE chunks""" + data = b"" + async for chunk in iterator: + for line in chunk.splitlines(keepends=True): + data += line + if data.endswith((b"\r\r", b"\n\n", b"\r\n\r\n")): + yield data + data = b"" + if data: + yield data + + def decode(self, line: str) -> ServerSentEvent | None: + # See: https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation # noqa: E501 + + if not line: + if not self._event and not self._data and not self._last_event_id and self._retry is None: + return None + + sse = ServerSentEvent( + event=self._event, + data="\n".join(self._data), + id=self._last_event_id, + retry=self._retry, + ) + + # NOTE: as per the SSE spec, do not reset last_event_id. + self._event = None + self._data = [] + self._retry = None + + return sse + + if line.startswith(":"): + return None + + fieldname, _, value = line.partition(":") + + if value.startswith(" "): + value = value[1:] + + if fieldname == "event": + self._event = value + elif fieldname == "data": + self._data.append(value) + elif fieldname == "id": + if "\0" in value: + pass + else: + self._last_event_id = value + elif fieldname == "retry": + try: + self._retry = int(value) + except (TypeError, ValueError): + pass + else: + pass # Field is ignored. + + return None + + +@runtime_checkable +class SSEBytesDecoder(Protocol): + def iter_bytes(self, iterator: Iterator[bytes]) -> Iterator[ServerSentEvent]: + """Given an iterator that yields raw binary data, iterate over it & yield every event encountered""" + ... + + def aiter_bytes(self, iterator: AsyncIterator[bytes]) -> AsyncIterator[ServerSentEvent]: + """Given an async iterator that yields raw binary data, iterate over it & yield every event encountered""" + ... + + +def is_stream_class_type(typ: type) -> TypeGuard[type[Stream[object]] | type[AsyncStream[object]]]: + """TypeGuard for determining whether or not the given type is a subclass of `Stream` / `AsyncStream`""" + origin = get_origin(typ) or typ + return inspect.isclass(origin) and issubclass(origin, (Stream, AsyncStream)) + + +def extract_stream_chunk_type( + stream_cls: type, + *, + failure_message: str | None = None, +) -> type: + """Given a type like `Stream[T]`, returns the generic type variable `T`. + + This also handles the case where a concrete subclass is given, e.g. + ```py + class MyStream(Stream[bytes]): + ... + + extract_stream_chunk_type(MyStream) -> bytes + ``` + """ + from ._base_client import Stream, AsyncStream + + return extract_type_var_from_base( + stream_cls, + index=0, + generic_bases=cast("tuple[type, ...]", (Stream, AsyncStream)), + failure_message=failure_message, + ) diff --git a/src/runloop/_types.py b/src/runloop/_types.py new file mode 100644 index 000000000..49f9ba84d --- /dev/null +++ b/src/runloop/_types.py @@ -0,0 +1,220 @@ +from __future__ import annotations + +from os import PathLike +from typing import ( + IO, + TYPE_CHECKING, + Any, + Dict, + List, + Type, + Tuple, + Union, + Mapping, + TypeVar, + Callable, + Optional, + Sequence, +) +from typing_extensions import Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable + +import httpx +import pydantic +from httpx import URL, Proxy, Timeout, Response, BaseTransport, AsyncBaseTransport + +if TYPE_CHECKING: + from ._models import BaseModel + from ._response import APIResponse, AsyncAPIResponse + +Transport = BaseTransport +AsyncTransport = AsyncBaseTransport +Query = Mapping[str, object] +Body = object +AnyMapping = Mapping[str, object] +ModelT = TypeVar("ModelT", bound=pydantic.BaseModel) +_T = TypeVar("_T") + + +# Approximates httpx internal ProxiesTypes and RequestFiles types +# while adding support for `PathLike` instances +ProxiesDict = Dict["str | URL", Union[None, str, URL, Proxy]] +ProxiesTypes = Union[str, Proxy, ProxiesDict] +if TYPE_CHECKING: + Base64FileInput = Union[IO[bytes], PathLike[str]] + FileContent = Union[IO[bytes], bytes, PathLike[str]] +else: + Base64FileInput = Union[IO[bytes], PathLike] + FileContent = Union[IO[bytes], bytes, PathLike] # PathLike is not subscriptable in Python 3.8. +FileTypes = Union[ + # file (or bytes) + FileContent, + # (filename, file (or bytes)) + Tuple[Optional[str], FileContent], + # (filename, file (or bytes), content_type) + Tuple[Optional[str], FileContent, Optional[str]], + # (filename, file (or bytes), content_type, headers) + Tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]], +] +RequestFiles = Union[Mapping[str, FileTypes], Sequence[Tuple[str, FileTypes]]] + +# duplicate of the above but without our custom file support +HttpxFileContent = Union[IO[bytes], bytes] +HttpxFileTypes = Union[ + # file (or bytes) + HttpxFileContent, + # (filename, file (or bytes)) + Tuple[Optional[str], HttpxFileContent], + # (filename, file (or bytes), content_type) + Tuple[Optional[str], HttpxFileContent, Optional[str]], + # (filename, file (or bytes), content_type, headers) + Tuple[Optional[str], HttpxFileContent, Optional[str], Mapping[str, str]], +] +HttpxRequestFiles = Union[Mapping[str, HttpxFileTypes], Sequence[Tuple[str, HttpxFileTypes]]] + +# Workaround to support (cast_to: Type[ResponseT]) -> ResponseT +# where ResponseT includes `None`. In order to support directly +# passing `None`, overloads would have to be defined for every +# method that uses `ResponseT` which would lead to an unacceptable +# amount of code duplication and make it unreadable. See _base_client.py +# for example usage. +# +# This unfortunately means that you will either have +# to import this type and pass it explicitly: +# +# from runloop import NoneType +# client.get('/foo', cast_to=NoneType) +# +# or build it yourself: +# +# client.get('/foo', cast_to=type(None)) +if TYPE_CHECKING: + NoneType: Type[None] +else: + NoneType = type(None) + + +class RequestOptions(TypedDict, total=False): + headers: Headers + max_retries: int + timeout: float | Timeout | None + params: Query + extra_json: AnyMapping + idempotency_key: str + + +# Sentinel class used until PEP 0661 is accepted +class NotGiven: + """ + A sentinel singleton class used to distinguish omitted keyword arguments + from those passed in with the value None (which may have different behavior). + + For example: + + ```py + def get(timeout: Union[int, NotGiven, None] = NotGiven()) -> Response: + ... + + + get(timeout=1) # 1s timeout + get(timeout=None) # No timeout + get() # Default timeout behavior, which may not be statically known at the method definition. + ``` + """ + + def __bool__(self) -> Literal[False]: + return False + + @override + def __repr__(self) -> str: + return "NOT_GIVEN" + + +NotGivenOr = Union[_T, NotGiven] +NOT_GIVEN = NotGiven() + + +class Omit: + """In certain situations you need to be able to represent a case where a default value has + to be explicitly removed and `None` is not an appropriate substitute, for example: + + ```py + # as the default `Content-Type` header is `application/json` that will be sent + client.post("/upload/files", files={"file": b"my raw file content"}) + + # you can't explicitly override the header as it has to be dynamically generated + # to look something like: 'multipart/form-data; boundary=0d8382fcf5f8c3be01ca2e11002d2983' + client.post(..., headers={"Content-Type": "multipart/form-data"}) + + # instead you can remove the default `application/json` header by passing Omit + client.post(..., headers={"Content-Type": Omit()}) + ``` + """ + + def __bool__(self) -> Literal[False]: + return False + + +@runtime_checkable +class ModelBuilderProtocol(Protocol): + @classmethod + def build( + cls: type[_T], + *, + response: Response, + data: object, + ) -> _T: + ... + + +Headers = Mapping[str, Union[str, Omit]] + + +class HeadersLikeProtocol(Protocol): + def get(self, __key: str) -> str | None: + ... + + +HeadersLike = Union[Headers, HeadersLikeProtocol] + +ResponseT = TypeVar( + "ResponseT", + bound=Union[ + object, + str, + None, + "BaseModel", + List[Any], + Dict[str, Any], + Response, + ModelBuilderProtocol, + "APIResponse[Any]", + "AsyncAPIResponse[Any]", + ], +) + +StrBytesIntFloat = Union[str, bytes, int, float] + +# Note: copied from Pydantic +# https://github.com/pydantic/pydantic/blob/32ea570bf96e84234d2992e1ddf40ab8a565925a/pydantic/main.py#L49 +IncEx: TypeAlias = "set[int] | set[str] | dict[int, Any] | dict[str, Any] | None" + +PostParser = Callable[[Any], Any] + + +@runtime_checkable +class InheritsGeneric(Protocol): + """Represents a type that has inherited from `Generic` + + The `__orig_bases__` property can be used to determine the resolved + type variable for a given base class. + """ + + __orig_bases__: tuple[_GenericAlias] + + +class _GenericAlias(Protocol): + __origin__: type[object] + + +class HttpxSendArgs(TypedDict, total=False): + auth: httpx.Auth diff --git a/src/runloop/_utils/__init__.py b/src/runloop/_utils/__init__.py new file mode 100644 index 000000000..31b5b2279 --- /dev/null +++ b/src/runloop/_utils/__init__.py @@ -0,0 +1,51 @@ +from ._sync import asyncify as asyncify +from ._proxy import LazyProxy as LazyProxy +from ._utils import ( + flatten as flatten, + is_dict as is_dict, + is_list as is_list, + is_given as is_given, + is_tuple as is_tuple, + lru_cache as lru_cache, + is_mapping as is_mapping, + is_tuple_t as is_tuple_t, + parse_date as parse_date, + is_iterable as is_iterable, + is_sequence as is_sequence, + coerce_float as coerce_float, + is_mapping_t as is_mapping_t, + removeprefix as removeprefix, + removesuffix as removesuffix, + extract_files as extract_files, + is_sequence_t as is_sequence_t, + required_args as required_args, + coerce_boolean as coerce_boolean, + coerce_integer as coerce_integer, + file_from_path as file_from_path, + parse_datetime as parse_datetime, + strip_not_given as strip_not_given, + deepcopy_minimal as deepcopy_minimal, + get_async_library as get_async_library, + maybe_coerce_float as maybe_coerce_float, + get_required_header as get_required_header, + maybe_coerce_boolean as maybe_coerce_boolean, + maybe_coerce_integer as maybe_coerce_integer, +) +from ._typing import ( + is_list_type as is_list_type, + is_union_type as is_union_type, + extract_type_arg as extract_type_arg, + is_iterable_type as is_iterable_type, + is_required_type as is_required_type, + is_annotated_type as is_annotated_type, + strip_annotated_type as strip_annotated_type, + extract_type_var_from_base as extract_type_var_from_base, +) +from ._streams import consume_sync_iterator as consume_sync_iterator, consume_async_iterator as consume_async_iterator +from ._transform import ( + PropertyInfo as PropertyInfo, + transform as transform, + async_transform as async_transform, + maybe_transform as maybe_transform, + async_maybe_transform as async_maybe_transform, +) diff --git a/src/runloop/_utils/_logs.py b/src/runloop/_utils/_logs.py new file mode 100644 index 000000000..701fbfc6d --- /dev/null +++ b/src/runloop/_utils/_logs.py @@ -0,0 +1,25 @@ +import os +import logging + +logger: logging.Logger = logging.getLogger("runloop") +httpx_logger: logging.Logger = logging.getLogger("httpx") + + +def _basic_config() -> None: + # e.g. [2023-10-05 14:12:26 - runloop._base_client:818 - DEBUG] HTTP Request: POST http://127.0.0.1:4010/foo/bar "200 OK" + logging.basicConfig( + format="[%(asctime)s - %(name)s:%(lineno)d - %(levelname)s] %(message)s", + datefmt="%Y-%m-%d %H:%M:%S", + ) + + +def setup_logging() -> None: + env = os.environ.get("RUNLOOP_LOG") + if env == "debug": + _basic_config() + logger.setLevel(logging.DEBUG) + httpx_logger.setLevel(logging.DEBUG) + elif env == "info": + _basic_config() + logger.setLevel(logging.INFO) + httpx_logger.setLevel(logging.INFO) diff --git a/src/runloop/_utils/_proxy.py b/src/runloop/_utils/_proxy.py new file mode 100644 index 000000000..c46a62a69 --- /dev/null +++ b/src/runloop/_utils/_proxy.py @@ -0,0 +1,63 @@ +from __future__ import annotations + +from abc import ABC, abstractmethod +from typing import Generic, TypeVar, Iterable, cast +from typing_extensions import override + +T = TypeVar("T") + + +class LazyProxy(Generic[T], ABC): + """Implements data methods to pretend that an instance is another instance. + + This includes forwarding attribute access and other methods. + """ + + # Note: we have to special case proxies that themselves return proxies + # to support using a proxy as a catch-all for any random access, e.g. `proxy.foo.bar.baz` + + def __getattr__(self, attr: str) -> object: + proxied = self.__get_proxied__() + if isinstance(proxied, LazyProxy): + return proxied # pyright: ignore + return getattr(proxied, attr) + + @override + def __repr__(self) -> str: + proxied = self.__get_proxied__() + if isinstance(proxied, LazyProxy): + return proxied.__class__.__name__ + return repr(self.__get_proxied__()) + + @override + def __str__(self) -> str: + proxied = self.__get_proxied__() + if isinstance(proxied, LazyProxy): + return proxied.__class__.__name__ + return str(proxied) + + @override + def __dir__(self) -> Iterable[str]: + proxied = self.__get_proxied__() + if isinstance(proxied, LazyProxy): + return [] + return proxied.__dir__() + + @property # type: ignore + @override + def __class__(self) -> type: # pyright: ignore + proxied = self.__get_proxied__() + if issubclass(type(proxied), LazyProxy): + return type(proxied) + return proxied.__class__ + + def __get_proxied__(self) -> T: + return self.__load__() + + def __as_proxied__(self) -> T: + """Helper method that returns the current proxy, typed as the loaded object""" + return cast(T, self) + + @abstractmethod + def __load__(self) -> T: + ... diff --git a/src/runloop/_utils/_streams.py b/src/runloop/_utils/_streams.py new file mode 100644 index 000000000..f4a0208f0 --- /dev/null +++ b/src/runloop/_utils/_streams.py @@ -0,0 +1,12 @@ +from typing import Any +from typing_extensions import Iterator, AsyncIterator + + +def consume_sync_iterator(iterator: Iterator[Any]) -> None: + for _ in iterator: + ... + + +async def consume_async_iterator(iterator: AsyncIterator[Any]) -> None: + async for _ in iterator: + ... diff --git a/src/runloop/_utils/_sync.py b/src/runloop/_utils/_sync.py new file mode 100644 index 000000000..595924e5b --- /dev/null +++ b/src/runloop/_utils/_sync.py @@ -0,0 +1,64 @@ +from __future__ import annotations + +import functools +from typing import TypeVar, Callable, Awaitable +from typing_extensions import ParamSpec + +import anyio +import anyio.to_thread + +T_Retval = TypeVar("T_Retval") +T_ParamSpec = ParamSpec("T_ParamSpec") + + +# copied from `asyncer`, https://github.com/tiangolo/asyncer +def asyncify( + function: Callable[T_ParamSpec, T_Retval], + *, + cancellable: bool = False, + limiter: anyio.CapacityLimiter | None = None, +) -> Callable[T_ParamSpec, Awaitable[T_Retval]]: + """ + Take a blocking function and create an async one that receives the same + positional and keyword arguments, and that when called, calls the original function + in a worker thread using `anyio.to_thread.run_sync()`. Internally, + `asyncer.asyncify()` uses the same `anyio.to_thread.run_sync()`, but it supports + keyword arguments additional to positional arguments and it adds better support for + autocompletion and inline errors for the arguments of the function called and the + return value. + + If the `cancellable` option is enabled and the task waiting for its completion is + cancelled, the thread will still run its course but its return value (or any raised + exception) will be ignored. + + Use it like this: + + ```Python + def do_work(arg1, arg2, kwarg1="", kwarg2="") -> str: + # Do work + return "Some result" + + + result = await to_thread.asyncify(do_work)("spam", "ham", kwarg1="a", kwarg2="b") + print(result) + ``` + + ## Arguments + + `function`: a blocking regular callable (e.g. a function) + `cancellable`: `True` to allow cancellation of the operation + `limiter`: capacity limiter to use to limit the total amount of threads running + (if omitted, the default limiter is used) + + ## Return + + An async function that takes the same positional and keyword arguments as the + original one, that when called runs the same original function in a thread worker + and returns the result. + """ + + async def wrapper(*args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs) -> T_Retval: + partial_f = functools.partial(function, *args, **kwargs) + return await anyio.to_thread.run_sync(partial_f, cancellable=cancellable, limiter=limiter) + + return wrapper diff --git a/src/runloop/_utils/_transform.py b/src/runloop/_utils/_transform.py new file mode 100644 index 000000000..47e262a51 --- /dev/null +++ b/src/runloop/_utils/_transform.py @@ -0,0 +1,382 @@ +from __future__ import annotations + +import io +import base64 +import pathlib +from typing import Any, Mapping, TypeVar, cast +from datetime import date, datetime +from typing_extensions import Literal, get_args, override, get_type_hints + +import anyio +import pydantic + +from ._utils import ( + is_list, + is_mapping, + is_iterable, +) +from .._files import is_base64_file_input +from ._typing import ( + is_list_type, + is_union_type, + extract_type_arg, + is_iterable_type, + is_required_type, + is_annotated_type, + strip_annotated_type, +) +from .._compat import model_dump, is_typeddict + +_T = TypeVar("_T") + + +# TODO: support for drilling globals() and locals() +# TODO: ensure works correctly with forward references in all cases + + +PropertyFormat = Literal["iso8601", "base64", "custom"] + + +class PropertyInfo: + """Metadata class to be used in Annotated types to provide information about a given type. + + For example: + + class MyParams(TypedDict): + account_holder_name: Annotated[str, PropertyInfo(alias='accountHolderName')] + + This means that {'account_holder_name': 'Robert'} will be transformed to {'accountHolderName': 'Robert'} before being sent to the API. + """ + + alias: str | None + format: PropertyFormat | None + format_template: str | None + discriminator: str | None + + def __init__( + self, + *, + alias: str | None = None, + format: PropertyFormat | None = None, + format_template: str | None = None, + discriminator: str | None = None, + ) -> None: + self.alias = alias + self.format = format + self.format_template = format_template + self.discriminator = discriminator + + @override + def __repr__(self) -> str: + return f"{self.__class__.__name__}(alias='{self.alias}', format={self.format}, format_template='{self.format_template}', discriminator='{self.discriminator}')" + + +def maybe_transform( + data: object, + expected_type: object, +) -> Any | None: + """Wrapper over `transform()` that allows `None` to be passed. + + See `transform()` for more details. + """ + if data is None: + return None + return transform(data, expected_type) + + +# Wrapper over _transform_recursive providing fake types +def transform( + data: _T, + expected_type: object, +) -> _T: + """Transform dictionaries based off of type information from the given type, for example: + + ```py + class Params(TypedDict, total=False): + card_id: Required[Annotated[str, PropertyInfo(alias="cardID")]] + + + transformed = transform({"card_id": ""}, Params) + # {'cardID': ''} + ``` + + Any keys / data that does not have type information given will be included as is. + + It should be noted that the transformations that this function does are not represented in the type system. + """ + transformed = _transform_recursive(data, annotation=cast(type, expected_type)) + return cast(_T, transformed) + + +def _get_annotated_type(type_: type) -> type | None: + """If the given type is an `Annotated` type then it is returned, if not `None` is returned. + + This also unwraps the type when applicable, e.g. `Required[Annotated[T, ...]]` + """ + if is_required_type(type_): + # Unwrap `Required[Annotated[T, ...]]` to `Annotated[T, ...]` + type_ = get_args(type_)[0] + + if is_annotated_type(type_): + return type_ + + return None + + +def _maybe_transform_key(key: str, type_: type) -> str: + """Transform the given `data` based on the annotations provided in `type_`. + + Note: this function only looks at `Annotated` types that contain `PropertInfo` metadata. + """ + annotated_type = _get_annotated_type(type_) + if annotated_type is None: + # no `Annotated` definition for this type, no transformation needed + return key + + # ignore the first argument as it is the actual type + annotations = get_args(annotated_type)[1:] + for annotation in annotations: + if isinstance(annotation, PropertyInfo) and annotation.alias is not None: + return annotation.alias + + return key + + +def _transform_recursive( + data: object, + *, + annotation: type, + inner_type: type | None = None, +) -> object: + """Transform the given data against the expected type. + + Args: + annotation: The direct type annotation given to the particular piece of data. + This may or may not be wrapped in metadata types, e.g. `Required[T]`, `Annotated[T, ...]` etc + + inner_type: If applicable, this is the "inside" type. This is useful in certain cases where the outside type + is a container type such as `List[T]`. In that case `inner_type` should be set to `T` so that each entry in + the list can be transformed using the metadata from the container type. + + Defaults to the same value as the `annotation` argument. + """ + if inner_type is None: + inner_type = annotation + + stripped_type = strip_annotated_type(inner_type) + if is_typeddict(stripped_type) and is_mapping(data): + return _transform_typeddict(data, stripped_type) + + if ( + # List[T] + (is_list_type(stripped_type) and is_list(data)) + # Iterable[T] + or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str)) + ): + inner_type = extract_type_arg(stripped_type, 0) + return [_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data] + + if is_union_type(stripped_type): + # For union types we run the transformation against all subtypes to ensure that everything is transformed. + # + # TODO: there may be edge cases where the same normalized field name will transform to two different names + # in different subtypes. + for subtype in get_args(stripped_type): + data = _transform_recursive(data, annotation=annotation, inner_type=subtype) + return data + + if isinstance(data, pydantic.BaseModel): + return model_dump(data, exclude_unset=True) + + annotated_type = _get_annotated_type(annotation) + if annotated_type is None: + return data + + # ignore the first argument as it is the actual type + annotations = get_args(annotated_type)[1:] + for annotation in annotations: + if isinstance(annotation, PropertyInfo) and annotation.format is not None: + return _format_data(data, annotation.format, annotation.format_template) + + return data + + +def _format_data(data: object, format_: PropertyFormat, format_template: str | None) -> object: + if isinstance(data, (date, datetime)): + if format_ == "iso8601": + return data.isoformat() + + if format_ == "custom" and format_template is not None: + return data.strftime(format_template) + + if format_ == "base64" and is_base64_file_input(data): + binary: str | bytes | None = None + + if isinstance(data, pathlib.Path): + binary = data.read_bytes() + elif isinstance(data, io.IOBase): + binary = data.read() + + if isinstance(binary, str): # type: ignore[unreachable] + binary = binary.encode() + + if not isinstance(binary, bytes): + raise RuntimeError(f"Could not read bytes from {data}; Received {type(binary)}") + + return base64.b64encode(binary).decode("ascii") + + return data + + +def _transform_typeddict( + data: Mapping[str, object], + expected_type: type, +) -> Mapping[str, object]: + result: dict[str, object] = {} + annotations = get_type_hints(expected_type, include_extras=True) + for key, value in data.items(): + type_ = annotations.get(key) + if type_ is None: + # we do not have a type annotation for this field, leave it as is + result[key] = value + else: + result[_maybe_transform_key(key, type_)] = _transform_recursive(value, annotation=type_) + return result + + +async def async_maybe_transform( + data: object, + expected_type: object, +) -> Any | None: + """Wrapper over `async_transform()` that allows `None` to be passed. + + See `async_transform()` for more details. + """ + if data is None: + return None + return await async_transform(data, expected_type) + + +async def async_transform( + data: _T, + expected_type: object, +) -> _T: + """Transform dictionaries based off of type information from the given type, for example: + + ```py + class Params(TypedDict, total=False): + card_id: Required[Annotated[str, PropertyInfo(alias="cardID")]] + + + transformed = transform({"card_id": ""}, Params) + # {'cardID': ''} + ``` + + Any keys / data that does not have type information given will be included as is. + + It should be noted that the transformations that this function does are not represented in the type system. + """ + transformed = await _async_transform_recursive(data, annotation=cast(type, expected_type)) + return cast(_T, transformed) + + +async def _async_transform_recursive( + data: object, + *, + annotation: type, + inner_type: type | None = None, +) -> object: + """Transform the given data against the expected type. + + Args: + annotation: The direct type annotation given to the particular piece of data. + This may or may not be wrapped in metadata types, e.g. `Required[T]`, `Annotated[T, ...]` etc + + inner_type: If applicable, this is the "inside" type. This is useful in certain cases where the outside type + is a container type such as `List[T]`. In that case `inner_type` should be set to `T` so that each entry in + the list can be transformed using the metadata from the container type. + + Defaults to the same value as the `annotation` argument. + """ + if inner_type is None: + inner_type = annotation + + stripped_type = strip_annotated_type(inner_type) + if is_typeddict(stripped_type) and is_mapping(data): + return await _async_transform_typeddict(data, stripped_type) + + if ( + # List[T] + (is_list_type(stripped_type) and is_list(data)) + # Iterable[T] + or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str)) + ): + inner_type = extract_type_arg(stripped_type, 0) + return [await _async_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data] + + if is_union_type(stripped_type): + # For union types we run the transformation against all subtypes to ensure that everything is transformed. + # + # TODO: there may be edge cases where the same normalized field name will transform to two different names + # in different subtypes. + for subtype in get_args(stripped_type): + data = await _async_transform_recursive(data, annotation=annotation, inner_type=subtype) + return data + + if isinstance(data, pydantic.BaseModel): + return model_dump(data, exclude_unset=True) + + annotated_type = _get_annotated_type(annotation) + if annotated_type is None: + return data + + # ignore the first argument as it is the actual type + annotations = get_args(annotated_type)[1:] + for annotation in annotations: + if isinstance(annotation, PropertyInfo) and annotation.format is not None: + return await _async_format_data(data, annotation.format, annotation.format_template) + + return data + + +async def _async_format_data(data: object, format_: PropertyFormat, format_template: str | None) -> object: + if isinstance(data, (date, datetime)): + if format_ == "iso8601": + return data.isoformat() + + if format_ == "custom" and format_template is not None: + return data.strftime(format_template) + + if format_ == "base64" and is_base64_file_input(data): + binary: str | bytes | None = None + + if isinstance(data, pathlib.Path): + binary = await anyio.Path(data).read_bytes() + elif isinstance(data, io.IOBase): + binary = data.read() + + if isinstance(binary, str): # type: ignore[unreachable] + binary = binary.encode() + + if not isinstance(binary, bytes): + raise RuntimeError(f"Could not read bytes from {data}; Received {type(binary)}") + + return base64.b64encode(binary).decode("ascii") + + return data + + +async def _async_transform_typeddict( + data: Mapping[str, object], + expected_type: type, +) -> Mapping[str, object]: + result: dict[str, object] = {} + annotations = get_type_hints(expected_type, include_extras=True) + for key, value in data.items(): + type_ = annotations.get(key) + if type_ is None: + # we do not have a type annotation for this field, leave it as is + result[key] = value + else: + result[_maybe_transform_key(key, type_)] = await _async_transform_recursive(value, annotation=type_) + return result diff --git a/src/runloop/_utils/_typing.py b/src/runloop/_utils/_typing.py new file mode 100644 index 000000000..c036991f0 --- /dev/null +++ b/src/runloop/_utils/_typing.py @@ -0,0 +1,120 @@ +from __future__ import annotations + +from typing import Any, TypeVar, Iterable, cast +from collections import abc as _c_abc +from typing_extensions import Required, Annotated, get_args, get_origin + +from .._types import InheritsGeneric +from .._compat import is_union as _is_union + + +def is_annotated_type(typ: type) -> bool: + return get_origin(typ) == Annotated + + +def is_list_type(typ: type) -> bool: + return (get_origin(typ) or typ) == list + + +def is_iterable_type(typ: type) -> bool: + """If the given type is `typing.Iterable[T]`""" + origin = get_origin(typ) or typ + return origin == Iterable or origin == _c_abc.Iterable + + +def is_union_type(typ: type) -> bool: + return _is_union(get_origin(typ)) + + +def is_required_type(typ: type) -> bool: + return get_origin(typ) == Required + + +def is_typevar(typ: type) -> bool: + # type ignore is required because type checkers + # think this expression will always return False + return type(typ) == TypeVar # type: ignore + + +# Extracts T from Annotated[T, ...] or from Required[Annotated[T, ...]] +def strip_annotated_type(typ: type) -> type: + if is_required_type(typ) or is_annotated_type(typ): + return strip_annotated_type(cast(type, get_args(typ)[0])) + + return typ + + +def extract_type_arg(typ: type, index: int) -> type: + args = get_args(typ) + try: + return cast(type, args[index]) + except IndexError as err: + raise RuntimeError(f"Expected type {typ} to have a type argument at index {index} but it did not") from err + + +def extract_type_var_from_base( + typ: type, + *, + generic_bases: tuple[type, ...], + index: int, + failure_message: str | None = None, +) -> type: + """Given a type like `Foo[T]`, returns the generic type variable `T`. + + This also handles the case where a concrete subclass is given, e.g. + ```py + class MyResponse(Foo[bytes]): + ... + + extract_type_var(MyResponse, bases=(Foo,), index=0) -> bytes + ``` + + And where a generic subclass is given: + ```py + _T = TypeVar('_T') + class MyResponse(Foo[_T]): + ... + + extract_type_var(MyResponse[bytes], bases=(Foo,), index=0) -> bytes + ``` + """ + cls = cast(object, get_origin(typ) or typ) + if cls in generic_bases: + # we're given the class directly + return extract_type_arg(typ, index) + + # if a subclass is given + # --- + # this is needed as __orig_bases__ is not present in the typeshed stubs + # because it is intended to be for internal use only, however there does + # not seem to be a way to resolve generic TypeVars for inherited subclasses + # without using it. + if isinstance(cls, InheritsGeneric): + target_base_class: Any | None = None + for base in cls.__orig_bases__: + if base.__origin__ in generic_bases: + target_base_class = base + break + + if target_base_class is None: + raise RuntimeError( + "Could not find the generic base class;\n" + "This should never happen;\n" + f"Does {cls} inherit from one of {generic_bases} ?" + ) + + extracted = extract_type_arg(target_base_class, index) + if is_typevar(extracted): + # If the extracted type argument is itself a type variable + # then that means the subclass itself is generic, so we have + # to resolve the type argument from the class itself, not + # the base class. + # + # Note: if there is more than 1 type argument, the subclass could + # change the ordering of the type arguments, this is not currently + # supported. + return extract_type_arg(typ, index) + + return extracted + + raise RuntimeError(failure_message or f"Could not resolve inner type variable at index {index} for {typ}") diff --git a/src/runloop/_utils/_utils.py b/src/runloop/_utils/_utils.py new file mode 100644 index 000000000..34797c290 --- /dev/null +++ b/src/runloop/_utils/_utils.py @@ -0,0 +1,402 @@ +from __future__ import annotations + +import os +import re +import inspect +import functools +from typing import ( + Any, + Tuple, + Mapping, + TypeVar, + Callable, + Iterable, + Sequence, + cast, + overload, +) +from pathlib import Path +from typing_extensions import TypeGuard + +import sniffio + +from .._types import NotGiven, FileTypes, NotGivenOr, HeadersLike +from .._compat import parse_date as parse_date, parse_datetime as parse_datetime + +_T = TypeVar("_T") +_TupleT = TypeVar("_TupleT", bound=Tuple[object, ...]) +_MappingT = TypeVar("_MappingT", bound=Mapping[str, object]) +_SequenceT = TypeVar("_SequenceT", bound=Sequence[object]) +CallableT = TypeVar("CallableT", bound=Callable[..., Any]) + + +def flatten(t: Iterable[Iterable[_T]]) -> list[_T]: + return [item for sublist in t for item in sublist] + + +def extract_files( + # TODO: this needs to take Dict but variance issues..... + # create protocol type ? + query: Mapping[str, object], + *, + paths: Sequence[Sequence[str]], +) -> list[tuple[str, FileTypes]]: + """Recursively extract files from the given dictionary based on specified paths. + + A path may look like this ['foo', 'files', '', 'data']. + + Note: this mutates the given dictionary. + """ + files: list[tuple[str, FileTypes]] = [] + for path in paths: + files.extend(_extract_items(query, path, index=0, flattened_key=None)) + return files + + +def _extract_items( + obj: object, + path: Sequence[str], + *, + index: int, + flattened_key: str | None, +) -> list[tuple[str, FileTypes]]: + try: + key = path[index] + except IndexError: + if isinstance(obj, NotGiven): + # no value was provided - we can safely ignore + return [] + + # cyclical import + from .._files import assert_is_file_content + + # We have exhausted the path, return the entry we found. + assert_is_file_content(obj, key=flattened_key) + assert flattened_key is not None + return [(flattened_key, cast(FileTypes, obj))] + + index += 1 + if is_dict(obj): + try: + # We are at the last entry in the path so we must remove the field + if (len(path)) == index: + item = obj.pop(key) + else: + item = obj[key] + except KeyError: + # Key was not present in the dictionary, this is not indicative of an error + # as the given path may not point to a required field. We also do not want + # to enforce required fields as the API may differ from the spec in some cases. + return [] + if flattened_key is None: + flattened_key = key + else: + flattened_key += f"[{key}]" + return _extract_items( + item, + path, + index=index, + flattened_key=flattened_key, + ) + elif is_list(obj): + if key != "": + return [] + + return flatten( + [ + _extract_items( + item, + path, + index=index, + flattened_key=flattened_key + "[]" if flattened_key is not None else "[]", + ) + for item in obj + ] + ) + + # Something unexpected was passed, just ignore it. + return [] + + +def is_given(obj: NotGivenOr[_T]) -> TypeGuard[_T]: + return not isinstance(obj, NotGiven) + + +# Type safe methods for narrowing types with TypeVars. +# The default narrowing for isinstance(obj, dict) is dict[unknown, unknown], +# however this cause Pyright to rightfully report errors. As we know we don't +# care about the contained types we can safely use `object` in it's place. +# +# There are two separate functions defined, `is_*` and `is_*_t` for different use cases. +# `is_*` is for when you're dealing with an unknown input +# `is_*_t` is for when you're narrowing a known union type to a specific subset + + +def is_tuple(obj: object) -> TypeGuard[tuple[object, ...]]: + return isinstance(obj, tuple) + + +def is_tuple_t(obj: _TupleT | object) -> TypeGuard[_TupleT]: + return isinstance(obj, tuple) + + +def is_sequence(obj: object) -> TypeGuard[Sequence[object]]: + return isinstance(obj, Sequence) + + +def is_sequence_t(obj: _SequenceT | object) -> TypeGuard[_SequenceT]: + return isinstance(obj, Sequence) + + +def is_mapping(obj: object) -> TypeGuard[Mapping[str, object]]: + return isinstance(obj, Mapping) + + +def is_mapping_t(obj: _MappingT | object) -> TypeGuard[_MappingT]: + return isinstance(obj, Mapping) + + +def is_dict(obj: object) -> TypeGuard[dict[object, object]]: + return isinstance(obj, dict) + + +def is_list(obj: object) -> TypeGuard[list[object]]: + return isinstance(obj, list) + + +def is_iterable(obj: object) -> TypeGuard[Iterable[object]]: + return isinstance(obj, Iterable) + + +def deepcopy_minimal(item: _T) -> _T: + """Minimal reimplementation of copy.deepcopy() that will only copy certain object types: + + - mappings, e.g. `dict` + - list + + This is done for performance reasons. + """ + if is_mapping(item): + return cast(_T, {k: deepcopy_minimal(v) for k, v in item.items()}) + if is_list(item): + return cast(_T, [deepcopy_minimal(entry) for entry in item]) + return item + + +# copied from https://github.com/Rapptz/RoboDanny +def human_join(seq: Sequence[str], *, delim: str = ", ", final: str = "or") -> str: + size = len(seq) + if size == 0: + return "" + + if size == 1: + return seq[0] + + if size == 2: + return f"{seq[0]} {final} {seq[1]}" + + return delim.join(seq[:-1]) + f" {final} {seq[-1]}" + + +def quote(string: str) -> str: + """Add single quotation marks around the given string. Does *not* do any escaping.""" + return f"'{string}'" + + +def required_args(*variants: Sequence[str]) -> Callable[[CallableT], CallableT]: + """Decorator to enforce a given set of arguments or variants of arguments are passed to the decorated function. + + Useful for enforcing runtime validation of overloaded functions. + + Example usage: + ```py + @overload + def foo(*, a: str) -> str: + ... + + + @overload + def foo(*, b: bool) -> str: + ... + + + # This enforces the same constraints that a static type checker would + # i.e. that either a or b must be passed to the function + @required_args(["a"], ["b"]) + def foo(*, a: str | None = None, b: bool | None = None) -> str: + ... + ``` + """ + + def inner(func: CallableT) -> CallableT: + params = inspect.signature(func).parameters + positional = [ + name + for name, param in params.items() + if param.kind + in { + param.POSITIONAL_ONLY, + param.POSITIONAL_OR_KEYWORD, + } + ] + + @functools.wraps(func) + def wrapper(*args: object, **kwargs: object) -> object: + given_params: set[str] = set() + for i, _ in enumerate(args): + try: + given_params.add(positional[i]) + except IndexError: + raise TypeError( + f"{func.__name__}() takes {len(positional)} argument(s) but {len(args)} were given" + ) from None + + for key in kwargs.keys(): + given_params.add(key) + + for variant in variants: + matches = all((param in given_params for param in variant)) + if matches: + break + else: # no break + if len(variants) > 1: + variations = human_join( + ["(" + human_join([quote(arg) for arg in variant], final="and") + ")" for variant in variants] + ) + msg = f"Missing required arguments; Expected either {variations} arguments to be given" + else: + assert len(variants) > 0 + + # TODO: this error message is not deterministic + missing = list(set(variants[0]) - given_params) + if len(missing) > 1: + msg = f"Missing required arguments: {human_join([quote(arg) for arg in missing])}" + else: + msg = f"Missing required argument: {quote(missing[0])}" + raise TypeError(msg) + return func(*args, **kwargs) + + return wrapper # type: ignore + + return inner + + +_K = TypeVar("_K") +_V = TypeVar("_V") + + +@overload +def strip_not_given(obj: None) -> None: + ... + + +@overload +def strip_not_given(obj: Mapping[_K, _V | NotGiven]) -> dict[_K, _V]: + ... + + +@overload +def strip_not_given(obj: object) -> object: + ... + + +def strip_not_given(obj: object | None) -> object: + """Remove all top-level keys where their values are instances of `NotGiven`""" + if obj is None: + return None + + if not is_mapping(obj): + return obj + + return {key: value for key, value in obj.items() if not isinstance(value, NotGiven)} + + +def coerce_integer(val: str) -> int: + return int(val, base=10) + + +def coerce_float(val: str) -> float: + return float(val) + + +def coerce_boolean(val: str) -> bool: + return val == "true" or val == "1" or val == "on" + + +def maybe_coerce_integer(val: str | None) -> int | None: + if val is None: + return None + return coerce_integer(val) + + +def maybe_coerce_float(val: str | None) -> float | None: + if val is None: + return None + return coerce_float(val) + + +def maybe_coerce_boolean(val: str | None) -> bool | None: + if val is None: + return None + return coerce_boolean(val) + + +def removeprefix(string: str, prefix: str) -> str: + """Remove a prefix from a string. + + Backport of `str.removeprefix` for Python < 3.9 + """ + if string.startswith(prefix): + return string[len(prefix) :] + return string + + +def removesuffix(string: str, suffix: str) -> str: + """Remove a suffix from a string. + + Backport of `str.removesuffix` for Python < 3.9 + """ + if string.endswith(suffix): + return string[: -len(suffix)] + return string + + +def file_from_path(path: str) -> FileTypes: + contents = Path(path).read_bytes() + file_name = os.path.basename(path) + return (file_name, contents) + + +def get_required_header(headers: HeadersLike, header: str) -> str: + lower_header = header.lower() + if isinstance(headers, Mapping): + for k, v in headers.items(): + if k.lower() == lower_header and isinstance(v, str): + return v + + """ to deal with the case where the header looks like Stainless-Event-Id """ + intercaps_header = re.sub(r"([^\w])(\w)", lambda pat: pat.group(1) + pat.group(2).upper(), header.capitalize()) + + for normalized_header in [header, lower_header, header.upper(), intercaps_header]: + value = headers.get(normalized_header) + if value: + return value + + raise ValueError(f"Could not find {header} header") + + +def get_async_library() -> str: + try: + return sniffio.current_async_library() + except Exception: + return "false" + + +def lru_cache(*, maxsize: int | None = 128) -> Callable[[CallableT], CallableT]: + """A version of functools.lru_cache that retains the type signature + for the wrapped function arguments. + """ + wrapper = functools.lru_cache( # noqa: TID251 + maxsize=maxsize, + ) + return cast(Any, wrapper) # type: ignore[no-any-return] diff --git a/src/runloop/_version.py b/src/runloop/_version.py new file mode 100644 index 000000000..5c37f7fda --- /dev/null +++ b/src/runloop/_version.py @@ -0,0 +1,4 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +__title__ = "runloop" +__version__ = "0.0.1-alpha.0" diff --git a/src/runloop/lib/.keep b/src/runloop/lib/.keep new file mode 100644 index 000000000..5e2c99fdb --- /dev/null +++ b/src/runloop/lib/.keep @@ -0,0 +1,4 @@ +File generated from our OpenAPI spec by Stainless. + +This directory can be used to store custom files to expand the SDK. +It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. \ No newline at end of file diff --git a/src/runloop/py.typed b/src/runloop/py.typed new file mode 100644 index 000000000..e69de29bb diff --git a/src/runloop/resources/__init__.py b/src/runloop/resources/__init__.py new file mode 100644 index 000000000..d2c000638 --- /dev/null +++ b/src/runloop/resources/__init__.py @@ -0,0 +1,89 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .latches import ( + LatchesResource, + AsyncLatchesResource, + LatchesResourceWithRawResponse, + AsyncLatchesResourceWithRawResponse, + LatchesResourceWithStreamingResponse, + AsyncLatchesResourceWithStreamingResponse, +) +from .devboxes import ( + DevboxesResource, + AsyncDevboxesResource, + DevboxesResourceWithRawResponse, + AsyncDevboxesResourceWithRawResponse, + DevboxesResourceWithStreamingResponse, + AsyncDevboxesResourceWithStreamingResponse, +) +from .projects import ( + ProjectsResource, + AsyncProjectsResource, + ProjectsResourceWithRawResponse, + AsyncProjectsResourceWithRawResponse, + ProjectsResourceWithStreamingResponse, + AsyncProjectsResourceWithStreamingResponse, +) +from .sessions import ( + SessionsResource, + AsyncSessionsResource, + SessionsResourceWithRawResponse, + AsyncSessionsResourceWithRawResponse, + SessionsResourceWithStreamingResponse, + AsyncSessionsResourceWithStreamingResponse, +) +from .functions import ( + FunctionsResource, + AsyncFunctionsResource, + FunctionsResourceWithRawResponse, + AsyncFunctionsResourceWithRawResponse, + FunctionsResourceWithStreamingResponse, + AsyncFunctionsResourceWithStreamingResponse, +) +from .code_handles import ( + CodeHandlesResource, + AsyncCodeHandlesResource, + CodeHandlesResourceWithRawResponse, + AsyncCodeHandlesResourceWithRawResponse, + CodeHandlesResourceWithStreamingResponse, + AsyncCodeHandlesResourceWithStreamingResponse, +) + +__all__ = [ + "CodeHandlesResource", + "AsyncCodeHandlesResource", + "CodeHandlesResourceWithRawResponse", + "AsyncCodeHandlesResourceWithRawResponse", + "CodeHandlesResourceWithStreamingResponse", + "AsyncCodeHandlesResourceWithStreamingResponse", + "DevboxesResource", + "AsyncDevboxesResource", + "DevboxesResourceWithRawResponse", + "AsyncDevboxesResourceWithRawResponse", + "DevboxesResourceWithStreamingResponse", + "AsyncDevboxesResourceWithStreamingResponse", + "FunctionsResource", + "AsyncFunctionsResource", + "FunctionsResourceWithRawResponse", + "AsyncFunctionsResourceWithRawResponse", + "FunctionsResourceWithStreamingResponse", + "AsyncFunctionsResourceWithStreamingResponse", + "LatchesResource", + "AsyncLatchesResource", + "LatchesResourceWithRawResponse", + "AsyncLatchesResourceWithRawResponse", + "LatchesResourceWithStreamingResponse", + "AsyncLatchesResourceWithStreamingResponse", + "ProjectsResource", + "AsyncProjectsResource", + "ProjectsResourceWithRawResponse", + "AsyncProjectsResourceWithRawResponse", + "ProjectsResourceWithStreamingResponse", + "AsyncProjectsResourceWithStreamingResponse", + "SessionsResource", + "AsyncSessionsResource", + "SessionsResourceWithRawResponse", + "AsyncSessionsResourceWithRawResponse", + "SessionsResourceWithStreamingResponse", + "AsyncSessionsResourceWithStreamingResponse", +] diff --git a/src/runloop/resources/code_handles.py b/src/runloop/resources/code_handles.py new file mode 100644 index 000000000..ed68aecec --- /dev/null +++ b/src/runloop/resources/code_handles.py @@ -0,0 +1,293 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..types import code_handle_list_params, code_handle_create_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + maybe_transform, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import ( + make_request_options, +) +from ..types.code_handle import CodeHandle +from ..types.code_handle_list import CodeHandleList + +__all__ = ["CodeHandlesResource", "AsyncCodeHandlesResource"] + + +class CodeHandlesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> CodeHandlesResourceWithRawResponse: + return CodeHandlesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> CodeHandlesResourceWithStreamingResponse: + return CodeHandlesResourceWithStreamingResponse(self) + + def create( + self, + *, + auth_token: str | NotGiven = NOT_GIVEN, + branch: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + owner: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeHandle: + """Create a new code handle for a given repository. + + This can be referenced in other + parts of the system to refer to a specific version of a repository. + + Args: + auth_token: A short lived, scoped authentication token. + + branch: Branch or tag to checkout instead of main. + + name: The name of the code repository. + + owner: The account that owns the repository. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/v1/code_handles", + body=maybe_transform( + { + "auth_token": auth_token, + "branch": branch, + "name": name, + "owner": owner, + }, + code_handle_create_params.CodeHandleCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeHandle, + ) + + def list( + self, + *, + owner: str | NotGiven = NOT_GIVEN, + repo_name: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeHandleList: + """ + List the code handles that are available for use. + + Args: + owner: Repo owner name. + + repo_name: Repo name. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/v1/code_handles", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "owner": owner, + "repo_name": repo_name, + }, + code_handle_list_params.CodeHandleListParams, + ), + ), + cast_to=CodeHandleList, + ) + + +class AsyncCodeHandlesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncCodeHandlesResourceWithRawResponse: + return AsyncCodeHandlesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncCodeHandlesResourceWithStreamingResponse: + return AsyncCodeHandlesResourceWithStreamingResponse(self) + + async def create( + self, + *, + auth_token: str | NotGiven = NOT_GIVEN, + branch: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + owner: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeHandle: + """Create a new code handle for a given repository. + + This can be referenced in other + parts of the system to refer to a specific version of a repository. + + Args: + auth_token: A short lived, scoped authentication token. + + branch: Branch or tag to checkout instead of main. + + name: The name of the code repository. + + owner: The account that owns the repository. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/v1/code_handles", + body=await async_maybe_transform( + { + "auth_token": auth_token, + "branch": branch, + "name": name, + "owner": owner, + }, + code_handle_create_params.CodeHandleCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeHandle, + ) + + async def list( + self, + *, + owner: str | NotGiven = NOT_GIVEN, + repo_name: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeHandleList: + """ + List the code handles that are available for use. + + Args: + owner: Repo owner name. + + repo_name: Repo name. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/v1/code_handles", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "owner": owner, + "repo_name": repo_name, + }, + code_handle_list_params.CodeHandleListParams, + ), + ), + cast_to=CodeHandleList, + ) + + +class CodeHandlesResourceWithRawResponse: + def __init__(self, code_handles: CodeHandlesResource) -> None: + self._code_handles = code_handles + + self.create = to_raw_response_wrapper( + code_handles.create, + ) + self.list = to_raw_response_wrapper( + code_handles.list, + ) + + +class AsyncCodeHandlesResourceWithRawResponse: + def __init__(self, code_handles: AsyncCodeHandlesResource) -> None: + self._code_handles = code_handles + + self.create = async_to_raw_response_wrapper( + code_handles.create, + ) + self.list = async_to_raw_response_wrapper( + code_handles.list, + ) + + +class CodeHandlesResourceWithStreamingResponse: + def __init__(self, code_handles: CodeHandlesResource) -> None: + self._code_handles = code_handles + + self.create = to_streamed_response_wrapper( + code_handles.create, + ) + self.list = to_streamed_response_wrapper( + code_handles.list, + ) + + +class AsyncCodeHandlesResourceWithStreamingResponse: + def __init__(self, code_handles: AsyncCodeHandlesResource) -> None: + self._code_handles = code_handles + + self.create = async_to_streamed_response_wrapper( + code_handles.create, + ) + self.list = async_to_streamed_response_wrapper( + code_handles.list, + ) diff --git a/src/runloop/resources/devboxes/__init__.py b/src/runloop/resources/devboxes/__init__.py new file mode 100644 index 000000000..814a1ca00 --- /dev/null +++ b/src/runloop/resources/devboxes/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .logs import ( + LogsResource, + AsyncLogsResource, + LogsResourceWithRawResponse, + AsyncLogsResourceWithRawResponse, + LogsResourceWithStreamingResponse, + AsyncLogsResourceWithStreamingResponse, +) +from .devboxes import ( + DevboxesResource, + AsyncDevboxesResource, + DevboxesResourceWithRawResponse, + AsyncDevboxesResourceWithRawResponse, + DevboxesResourceWithStreamingResponse, + AsyncDevboxesResourceWithStreamingResponse, +) + +__all__ = [ + "LogsResource", + "AsyncLogsResource", + "LogsResourceWithRawResponse", + "AsyncLogsResourceWithRawResponse", + "LogsResourceWithStreamingResponse", + "AsyncLogsResourceWithStreamingResponse", + "DevboxesResource", + "AsyncDevboxesResource", + "DevboxesResourceWithRawResponse", + "AsyncDevboxesResourceWithRawResponse", + "DevboxesResourceWithStreamingResponse", + "AsyncDevboxesResourceWithStreamingResponse", +] diff --git a/src/runloop/resources/devboxes/devboxes.py b/src/runloop/resources/devboxes/devboxes.py new file mode 100644 index 000000000..cf3c6ce9b --- /dev/null +++ b/src/runloop/resources/devboxes/devboxes.py @@ -0,0 +1,481 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, List + +import httpx + +from .logs import ( + LogsResource, + AsyncLogsResource, + LogsResourceWithRawResponse, + AsyncLogsResourceWithRawResponse, + LogsResourceWithStreamingResponse, + AsyncLogsResourceWithStreamingResponse, +) +from ...types import devbox_list_params, devbox_create_params +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import ( + make_request_options, +) +from ...types.devbox import Devbox +from ...types.devbox_list import DevboxList + +__all__ = ["DevboxesResource", "AsyncDevboxesResource"] + + +class DevboxesResource(SyncAPIResource): + @cached_property + def logs(self) -> LogsResource: + return LogsResource(self._client) + + @cached_property + def with_raw_response(self) -> DevboxesResourceWithRawResponse: + return DevboxesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> DevboxesResourceWithStreamingResponse: + return DevboxesResourceWithStreamingResponse(self) + + def create( + self, + *, + code_handle: str | NotGiven = NOT_GIVEN, + entrypoint: str | NotGiven = NOT_GIVEN, + environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, + setup_commands: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Devbox: + """Create a Devbox with the specified configuration. + + The Devbox will be created in + the 'pending' state and will transition to 'running' once it is ready. + + Args: + code_handle: (Optional) Id of a code handle to mount to devbox. + + entrypoint: (Optional) When specified, the Devbox will run this script as its main + executable. The devbox lifecycle will be bound to entrypoint, shutting down when + the process is complete. + + environment_variables: (Optional) Environment variables used to configure your Devbox. + + setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include + fetching a tool or building your dependencies. Runloop will look optimize these + steps for you. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/v1/devboxes", + body=maybe_transform( + { + "code_handle": code_handle, + "entrypoint": entrypoint, + "environment_variables": environment_variables, + "setup_commands": setup_commands, + }, + devbox_create_params.DevboxCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=Devbox, + ) + + def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Devbox: + """Get a devbox by id. + + If the devbox does not exist, a 404 is returned. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=Devbox, + ) + + def list( + self, + *, + status: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxList: + """List all devboxes or filter by status. + + If no status is provided, all devboxes + are returned. + + Args: + status: Filter by status + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/v1/devboxes", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"status": status}, devbox_list_params.DevboxListParams), + ), + cast_to=DevboxList, + ) + + def shutdown( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Devbox: + """Shutdown a running devbox by id. + + This will take the devbox out of service. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/shutdown", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=Devbox, + ) + + +class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def logs(self) -> AsyncLogsResource: + return AsyncLogsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncDevboxesResourceWithRawResponse: + return AsyncDevboxesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncDevboxesResourceWithStreamingResponse: + return AsyncDevboxesResourceWithStreamingResponse(self) + + async def create( + self, + *, + code_handle: str | NotGiven = NOT_GIVEN, + entrypoint: str | NotGiven = NOT_GIVEN, + environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, + setup_commands: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Devbox: + """Create a Devbox with the specified configuration. + + The Devbox will be created in + the 'pending' state and will transition to 'running' once it is ready. + + Args: + code_handle: (Optional) Id of a code handle to mount to devbox. + + entrypoint: (Optional) When specified, the Devbox will run this script as its main + executable. The devbox lifecycle will be bound to entrypoint, shutting down when + the process is complete. + + environment_variables: (Optional) Environment variables used to configure your Devbox. + + setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include + fetching a tool or building your dependencies. Runloop will look optimize these + steps for you. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/v1/devboxes", + body=await async_maybe_transform( + { + "code_handle": code_handle, + "entrypoint": entrypoint, + "environment_variables": environment_variables, + "setup_commands": setup_commands, + }, + devbox_create_params.DevboxCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=Devbox, + ) + + async def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Devbox: + """Get a devbox by id. + + If the devbox does not exist, a 404 is returned. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=Devbox, + ) + + async def list( + self, + *, + status: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxList: + """List all devboxes or filter by status. + + If no status is provided, all devboxes + are returned. + + Args: + status: Filter by status + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/v1/devboxes", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"status": status}, devbox_list_params.DevboxListParams), + ), + cast_to=DevboxList, + ) + + async def shutdown( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Devbox: + """Shutdown a running devbox by id. + + This will take the devbox out of service. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/shutdown", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=Devbox, + ) + + +class DevboxesResourceWithRawResponse: + def __init__(self, devboxes: DevboxesResource) -> None: + self._devboxes = devboxes + + self.create = to_raw_response_wrapper( + devboxes.create, + ) + self.retrieve = to_raw_response_wrapper( + devboxes.retrieve, + ) + self.list = to_raw_response_wrapper( + devboxes.list, + ) + self.shutdown = to_raw_response_wrapper( + devboxes.shutdown, + ) + + @cached_property + def logs(self) -> LogsResourceWithRawResponse: + return LogsResourceWithRawResponse(self._devboxes.logs) + + +class AsyncDevboxesResourceWithRawResponse: + def __init__(self, devboxes: AsyncDevboxesResource) -> None: + self._devboxes = devboxes + + self.create = async_to_raw_response_wrapper( + devboxes.create, + ) + self.retrieve = async_to_raw_response_wrapper( + devboxes.retrieve, + ) + self.list = async_to_raw_response_wrapper( + devboxes.list, + ) + self.shutdown = async_to_raw_response_wrapper( + devboxes.shutdown, + ) + + @cached_property + def logs(self) -> AsyncLogsResourceWithRawResponse: + return AsyncLogsResourceWithRawResponse(self._devboxes.logs) + + +class DevboxesResourceWithStreamingResponse: + def __init__(self, devboxes: DevboxesResource) -> None: + self._devboxes = devboxes + + self.create = to_streamed_response_wrapper( + devboxes.create, + ) + self.retrieve = to_streamed_response_wrapper( + devboxes.retrieve, + ) + self.list = to_streamed_response_wrapper( + devboxes.list, + ) + self.shutdown = to_streamed_response_wrapper( + devboxes.shutdown, + ) + + @cached_property + def logs(self) -> LogsResourceWithStreamingResponse: + return LogsResourceWithStreamingResponse(self._devboxes.logs) + + +class AsyncDevboxesResourceWithStreamingResponse: + def __init__(self, devboxes: AsyncDevboxesResource) -> None: + self._devboxes = devboxes + + self.create = async_to_streamed_response_wrapper( + devboxes.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + devboxes.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + devboxes.list, + ) + self.shutdown = async_to_streamed_response_wrapper( + devboxes.shutdown, + ) + + @cached_property + def logs(self) -> AsyncLogsResourceWithStreamingResponse: + return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop/resources/devboxes/logs.py b/src/runloop/resources/devboxes/logs.py new file mode 100644 index 000000000..b89bbb642 --- /dev/null +++ b/src/runloop/resources/devboxes/logs.py @@ -0,0 +1,143 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import ( + make_request_options, +) +from ...types.devboxes.devbox_logs_list import DevboxLogsList + +__all__ = ["LogsResource", "AsyncLogsResource"] + + +class LogsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LogsResourceWithRawResponse: + return LogsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LogsResourceWithStreamingResponse: + return LogsResourceWithStreamingResponse(self) + + def list( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxLogsList: + """ + Get all logs from a Devbox by id. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/logs", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxLogsList, + ) + + +class AsyncLogsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLogsResourceWithRawResponse: + return AsyncLogsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLogsResourceWithStreamingResponse: + return AsyncLogsResourceWithStreamingResponse(self) + + async def list( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxLogsList: + """ + Get all logs from a Devbox by id. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/logs", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxLogsList, + ) + + +class LogsResourceWithRawResponse: + def __init__(self, logs: LogsResource) -> None: + self._logs = logs + + self.list = to_raw_response_wrapper( + logs.list, + ) + + +class AsyncLogsResourceWithRawResponse: + def __init__(self, logs: AsyncLogsResource) -> None: + self._logs = logs + + self.list = async_to_raw_response_wrapper( + logs.list, + ) + + +class LogsResourceWithStreamingResponse: + def __init__(self, logs: LogsResource) -> None: + self._logs = logs + + self.list = to_streamed_response_wrapper( + logs.list, + ) + + +class AsyncLogsResourceWithStreamingResponse: + def __init__(self, logs: AsyncLogsResource) -> None: + self._logs = logs + + self.list = async_to_streamed_response_wrapper( + logs.list, + ) diff --git a/src/runloop/resources/functions/__init__.py b/src/runloop/resources/functions/__init__.py new file mode 100644 index 000000000..45300c55f --- /dev/null +++ b/src/runloop/resources/functions/__init__.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .openapi import ( + OpenAPIResource, + AsyncOpenAPIResource, + OpenAPIResourceWithRawResponse, + AsyncOpenAPIResourceWithRawResponse, + OpenAPIResourceWithStreamingResponse, + AsyncOpenAPIResourceWithStreamingResponse, +) +from .functions import ( + FunctionsResource, + AsyncFunctionsResource, + FunctionsResourceWithRawResponse, + AsyncFunctionsResourceWithRawResponse, + FunctionsResourceWithStreamingResponse, + AsyncFunctionsResourceWithStreamingResponse, +) +from .invocations import ( + InvocationsResource, + AsyncInvocationsResource, + InvocationsResourceWithRawResponse, + AsyncInvocationsResourceWithRawResponse, + InvocationsResourceWithStreamingResponse, + AsyncInvocationsResourceWithStreamingResponse, +) + +__all__ = [ + "InvocationsResource", + "AsyncInvocationsResource", + "InvocationsResourceWithRawResponse", + "AsyncInvocationsResourceWithRawResponse", + "InvocationsResourceWithStreamingResponse", + "AsyncInvocationsResourceWithStreamingResponse", + "OpenAPIResource", + "AsyncOpenAPIResource", + "OpenAPIResourceWithRawResponse", + "AsyncOpenAPIResourceWithRawResponse", + "OpenAPIResourceWithStreamingResponse", + "AsyncOpenAPIResourceWithStreamingResponse", + "FunctionsResource", + "AsyncFunctionsResource", + "FunctionsResourceWithRawResponse", + "AsyncFunctionsResourceWithRawResponse", + "FunctionsResourceWithStreamingResponse", + "AsyncFunctionsResourceWithStreamingResponse", +] diff --git a/src/runloop/resources/functions/functions.py b/src/runloop/resources/functions/functions.py new file mode 100644 index 000000000..cde41d28c --- /dev/null +++ b/src/runloop/resources/functions/functions.py @@ -0,0 +1,408 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ...types import function_invoke_sync_params, function_invoke_async_params +from .openapi import ( + OpenAPIResource, + AsyncOpenAPIResource, + OpenAPIResourceWithRawResponse, + AsyncOpenAPIResourceWithRawResponse, + OpenAPIResourceWithStreamingResponse, + AsyncOpenAPIResourceWithStreamingResponse, +) +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .invocations import ( + InvocationsResource, + AsyncInvocationsResource, + InvocationsResourceWithRawResponse, + AsyncInvocationsResourceWithRawResponse, + InvocationsResourceWithStreamingResponse, + AsyncInvocationsResourceWithStreamingResponse, +) +from ..._base_client import ( + make_request_options, +) +from ...types.function_list import FunctionList +from .invocations.invocations import InvocationsResource, AsyncInvocationsResource +from ...types.shared.function_invocation_detail import FunctionInvocationDetail + +__all__ = ["FunctionsResource", "AsyncFunctionsResource"] + + +class FunctionsResource(SyncAPIResource): + @cached_property + def invocations(self) -> InvocationsResource: + return InvocationsResource(self._client) + + @cached_property + def openapi(self) -> OpenAPIResource: + return OpenAPIResource(self._client) + + @cached_property + def with_raw_response(self) -> FunctionsResourceWithRawResponse: + return FunctionsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> FunctionsResourceWithStreamingResponse: + return FunctionsResourceWithStreamingResponse(self) + + def list( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FunctionList: + """List the functions that are available for invocation.""" + return self._get( + "/v1/functions", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FunctionList, + ) + + def invoke_async( + self, + function_name: str, + *, + project_name: str, + request: object, + runloop_meta: function_invoke_async_params.RunloopMeta | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FunctionInvocationDetail: + """Invoke the remote function asynchronously. + + This will return a job id that can be + used to query the status of the function invocation. + + Args: + request: Json of the request + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not project_name: + raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}") + if not function_name: + raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}") + return self._post( + f"/v1/functions/{project_name}/{function_name}/invoke_async", + body=maybe_transform( + { + "request": request, + "runloop_meta": runloop_meta, + }, + function_invoke_async_params.FunctionInvokeAsyncParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FunctionInvocationDetail, + ) + + def invoke_sync( + self, + function_name: str, + *, + project_name: str, + request: object, + runloop_meta: function_invoke_sync_params.RunloopMeta | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FunctionInvocationDetail: + """Invoke the remote function synchronously. + + This will block until the function + completes and return the result. If the function call takes too long, the + request will timeout. + + Args: + request: Json of the request + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not project_name: + raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}") + if not function_name: + raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}") + return self._post( + f"/v1/functions/{project_name}/{function_name}/invoke_sync", + body=maybe_transform( + { + "request": request, + "runloop_meta": runloop_meta, + }, + function_invoke_sync_params.FunctionInvokeSyncParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FunctionInvocationDetail, + ) + + +class AsyncFunctionsResource(AsyncAPIResource): + @cached_property + def invocations(self) -> AsyncInvocationsResource: + return AsyncInvocationsResource(self._client) + + @cached_property + def openapi(self) -> AsyncOpenAPIResource: + return AsyncOpenAPIResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncFunctionsResourceWithRawResponse: + return AsyncFunctionsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncFunctionsResourceWithStreamingResponse: + return AsyncFunctionsResourceWithStreamingResponse(self) + + async def list( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FunctionList: + """List the functions that are available for invocation.""" + return await self._get( + "/v1/functions", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FunctionList, + ) + + async def invoke_async( + self, + function_name: str, + *, + project_name: str, + request: object, + runloop_meta: function_invoke_async_params.RunloopMeta | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FunctionInvocationDetail: + """Invoke the remote function asynchronously. + + This will return a job id that can be + used to query the status of the function invocation. + + Args: + request: Json of the request + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not project_name: + raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}") + if not function_name: + raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}") + return await self._post( + f"/v1/functions/{project_name}/{function_name}/invoke_async", + body=await async_maybe_transform( + { + "request": request, + "runloop_meta": runloop_meta, + }, + function_invoke_async_params.FunctionInvokeAsyncParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FunctionInvocationDetail, + ) + + async def invoke_sync( + self, + function_name: str, + *, + project_name: str, + request: object, + runloop_meta: function_invoke_sync_params.RunloopMeta | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FunctionInvocationDetail: + """Invoke the remote function synchronously. + + This will block until the function + completes and return the result. If the function call takes too long, the + request will timeout. + + Args: + request: Json of the request + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not project_name: + raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}") + if not function_name: + raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}") + return await self._post( + f"/v1/functions/{project_name}/{function_name}/invoke_sync", + body=await async_maybe_transform( + { + "request": request, + "runloop_meta": runloop_meta, + }, + function_invoke_sync_params.FunctionInvokeSyncParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FunctionInvocationDetail, + ) + + +class FunctionsResourceWithRawResponse: + def __init__(self, functions: FunctionsResource) -> None: + self._functions = functions + + self.list = to_raw_response_wrapper( + functions.list, + ) + self.invoke_async = to_raw_response_wrapper( + functions.invoke_async, + ) + self.invoke_sync = to_raw_response_wrapper( + functions.invoke_sync, + ) + + @cached_property + def invocations(self) -> InvocationsResourceWithRawResponse: + return InvocationsResourceWithRawResponse(self._functions.invocations) + + @cached_property + def openapi(self) -> OpenAPIResourceWithRawResponse: + return OpenAPIResourceWithRawResponse(self._functions.openapi) + + +class AsyncFunctionsResourceWithRawResponse: + def __init__(self, functions: AsyncFunctionsResource) -> None: + self._functions = functions + + self.list = async_to_raw_response_wrapper( + functions.list, + ) + self.invoke_async = async_to_raw_response_wrapper( + functions.invoke_async, + ) + self.invoke_sync = async_to_raw_response_wrapper( + functions.invoke_sync, + ) + + @cached_property + def invocations(self) -> AsyncInvocationsResourceWithRawResponse: + return AsyncInvocationsResourceWithRawResponse(self._functions.invocations) + + @cached_property + def openapi(self) -> AsyncOpenAPIResourceWithRawResponse: + return AsyncOpenAPIResourceWithRawResponse(self._functions.openapi) + + +class FunctionsResourceWithStreamingResponse: + def __init__(self, functions: FunctionsResource) -> None: + self._functions = functions + + self.list = to_streamed_response_wrapper( + functions.list, + ) + self.invoke_async = to_streamed_response_wrapper( + functions.invoke_async, + ) + self.invoke_sync = to_streamed_response_wrapper( + functions.invoke_sync, + ) + + @cached_property + def invocations(self) -> InvocationsResourceWithStreamingResponse: + return InvocationsResourceWithStreamingResponse(self._functions.invocations) + + @cached_property + def openapi(self) -> OpenAPIResourceWithStreamingResponse: + return OpenAPIResourceWithStreamingResponse(self._functions.openapi) + + +class AsyncFunctionsResourceWithStreamingResponse: + def __init__(self, functions: AsyncFunctionsResource) -> None: + self._functions = functions + + self.list = async_to_streamed_response_wrapper( + functions.list, + ) + self.invoke_async = async_to_streamed_response_wrapper( + functions.invoke_async, + ) + self.invoke_sync = async_to_streamed_response_wrapper( + functions.invoke_sync, + ) + + @cached_property + def invocations(self) -> AsyncInvocationsResourceWithStreamingResponse: + return AsyncInvocationsResourceWithStreamingResponse(self._functions.invocations) + + @cached_property + def openapi(self) -> AsyncOpenAPIResourceWithStreamingResponse: + return AsyncOpenAPIResourceWithStreamingResponse(self._functions.openapi) diff --git a/src/runloop/resources/functions/invocations/__init__.py b/src/runloop/resources/functions/invocations/__init__.py new file mode 100644 index 000000000..dafa50446 --- /dev/null +++ b/src/runloop/resources/functions/invocations/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .spans import ( + SpansResource, + AsyncSpansResource, + SpansResourceWithRawResponse, + AsyncSpansResourceWithRawResponse, + SpansResourceWithStreamingResponse, + AsyncSpansResourceWithStreamingResponse, +) +from .invocations import ( + InvocationsResource, + AsyncInvocationsResource, + InvocationsResourceWithRawResponse, + AsyncInvocationsResourceWithRawResponse, + InvocationsResourceWithStreamingResponse, + AsyncInvocationsResourceWithStreamingResponse, +) + +__all__ = [ + "SpansResource", + "AsyncSpansResource", + "SpansResourceWithRawResponse", + "AsyncSpansResourceWithRawResponse", + "SpansResourceWithStreamingResponse", + "AsyncSpansResourceWithStreamingResponse", + "InvocationsResource", + "AsyncInvocationsResource", + "InvocationsResourceWithRawResponse", + "AsyncInvocationsResourceWithRawResponse", + "InvocationsResourceWithStreamingResponse", + "AsyncInvocationsResourceWithStreamingResponse", +] diff --git a/src/runloop/resources/functions/invocations/invocations.py b/src/runloop/resources/functions/invocations/invocations.py new file mode 100644 index 000000000..3ef5afba5 --- /dev/null +++ b/src/runloop/resources/functions/invocations/invocations.py @@ -0,0 +1,310 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from .spans import ( + SpansResource, + AsyncSpansResource, + SpansResourceWithRawResponse, + AsyncSpansResourceWithRawResponse, + SpansResourceWithStreamingResponse, + AsyncSpansResourceWithStreamingResponse, +) +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._base_client import ( + make_request_options, +) +from ....types.shared.function_invocation_detail import FunctionInvocationDetail +from ....types.functions.function_invocation_list import FunctionInvocationList + +__all__ = ["InvocationsResource", "AsyncInvocationsResource"] + + +class InvocationsResource(SyncAPIResource): + @cached_property + def spans(self) -> SpansResource: + return SpansResource(self._client) + + @cached_property + def with_raw_response(self) -> InvocationsResourceWithRawResponse: + return InvocationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> InvocationsResourceWithStreamingResponse: + return InvocationsResourceWithStreamingResponse(self) + + def retrieve( + self, + invocation_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FunctionInvocationDetail: + """Get the details of a function invocation. + + This includes the status, response, + and error message. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not invocation_id: + raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}") + return self._get( + f"/v1/functions/invocations/{invocation_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FunctionInvocationDetail, + ) + + def list( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FunctionInvocationList: + """List the functions invocations that are available for invocation.""" + return self._get( + "/v1/functions/invocations", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FunctionInvocationList, + ) + + def kill( + self, + invocation_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Kill the invocation with the given ID. + + This will stop the function execution. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not invocation_id: + raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}") + return self._post( + f"/v1/functions/invocations/{invocation_id}/kill", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncInvocationsResource(AsyncAPIResource): + @cached_property + def spans(self) -> AsyncSpansResource: + return AsyncSpansResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncInvocationsResourceWithRawResponse: + return AsyncInvocationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncInvocationsResourceWithStreamingResponse: + return AsyncInvocationsResourceWithStreamingResponse(self) + + async def retrieve( + self, + invocation_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FunctionInvocationDetail: + """Get the details of a function invocation. + + This includes the status, response, + and error message. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not invocation_id: + raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}") + return await self._get( + f"/v1/functions/invocations/{invocation_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FunctionInvocationDetail, + ) + + async def list( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FunctionInvocationList: + """List the functions invocations that are available for invocation.""" + return await self._get( + "/v1/functions/invocations", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FunctionInvocationList, + ) + + async def kill( + self, + invocation_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Kill the invocation with the given ID. + + This will stop the function execution. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not invocation_id: + raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}") + return await self._post( + f"/v1/functions/invocations/{invocation_id}/kill", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class InvocationsResourceWithRawResponse: + def __init__(self, invocations: InvocationsResource) -> None: + self._invocations = invocations + + self.retrieve = to_raw_response_wrapper( + invocations.retrieve, + ) + self.list = to_raw_response_wrapper( + invocations.list, + ) + self.kill = to_raw_response_wrapper( + invocations.kill, + ) + + @cached_property + def spans(self) -> SpansResourceWithRawResponse: + return SpansResourceWithRawResponse(self._invocations.spans) + + +class AsyncInvocationsResourceWithRawResponse: + def __init__(self, invocations: AsyncInvocationsResource) -> None: + self._invocations = invocations + + self.retrieve = async_to_raw_response_wrapper( + invocations.retrieve, + ) + self.list = async_to_raw_response_wrapper( + invocations.list, + ) + self.kill = async_to_raw_response_wrapper( + invocations.kill, + ) + + @cached_property + def spans(self) -> AsyncSpansResourceWithRawResponse: + return AsyncSpansResourceWithRawResponse(self._invocations.spans) + + +class InvocationsResourceWithStreamingResponse: + def __init__(self, invocations: InvocationsResource) -> None: + self._invocations = invocations + + self.retrieve = to_streamed_response_wrapper( + invocations.retrieve, + ) + self.list = to_streamed_response_wrapper( + invocations.list, + ) + self.kill = to_streamed_response_wrapper( + invocations.kill, + ) + + @cached_property + def spans(self) -> SpansResourceWithStreamingResponse: + return SpansResourceWithStreamingResponse(self._invocations.spans) + + +class AsyncInvocationsResourceWithStreamingResponse: + def __init__(self, invocations: AsyncInvocationsResource) -> None: + self._invocations = invocations + + self.retrieve = async_to_streamed_response_wrapper( + invocations.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + invocations.list, + ) + self.kill = async_to_streamed_response_wrapper( + invocations.kill, + ) + + @cached_property + def spans(self) -> AsyncSpansResourceWithStreamingResponse: + return AsyncSpansResourceWithStreamingResponse(self._invocations.spans) diff --git a/src/runloop/resources/functions/invocations/spans.py b/src/runloop/resources/functions/invocations/spans.py new file mode 100644 index 000000000..607849958 --- /dev/null +++ b/src/runloop/resources/functions/invocations/spans.py @@ -0,0 +1,147 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._base_client import ( + make_request_options, +) +from ....types.functions.invocations.invocation_span_list import InvocationSpanList + +__all__ = ["SpansResource", "AsyncSpansResource"] + + +class SpansResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> SpansResourceWithRawResponse: + return SpansResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> SpansResourceWithStreamingResponse: + return SpansResourceWithStreamingResponse(self) + + def list( + self, + invocation_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InvocationSpanList: + """Get the span points for the given invocation. + + This will return the span points + for the invocation. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not invocation_id: + raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}") + return self._get( + f"/v1/functions/invocations/{invocation_id}/spans", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=InvocationSpanList, + ) + + +class AsyncSpansResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncSpansResourceWithRawResponse: + return AsyncSpansResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncSpansResourceWithStreamingResponse: + return AsyncSpansResourceWithStreamingResponse(self) + + async def list( + self, + invocation_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InvocationSpanList: + """Get the span points for the given invocation. + + This will return the span points + for the invocation. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not invocation_id: + raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}") + return await self._get( + f"/v1/functions/invocations/{invocation_id}/spans", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=InvocationSpanList, + ) + + +class SpansResourceWithRawResponse: + def __init__(self, spans: SpansResource) -> None: + self._spans = spans + + self.list = to_raw_response_wrapper( + spans.list, + ) + + +class AsyncSpansResourceWithRawResponse: + def __init__(self, spans: AsyncSpansResource) -> None: + self._spans = spans + + self.list = async_to_raw_response_wrapper( + spans.list, + ) + + +class SpansResourceWithStreamingResponse: + def __init__(self, spans: SpansResource) -> None: + self._spans = spans + + self.list = to_streamed_response_wrapper( + spans.list, + ) + + +class AsyncSpansResourceWithStreamingResponse: + def __init__(self, spans: AsyncSpansResource) -> None: + self._spans = spans + + self.list = async_to_streamed_response_wrapper( + spans.list, + ) diff --git a/src/runloop/resources/functions/openapi.py b/src/runloop/resources/functions/openapi.py new file mode 100644 index 000000000..993e7d317 --- /dev/null +++ b/src/runloop/resources/functions/openapi.py @@ -0,0 +1,114 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import ( + make_request_options, +) + +__all__ = ["OpenAPIResource", "AsyncOpenAPIResource"] + + +class OpenAPIResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> OpenAPIResourceWithRawResponse: + return OpenAPIResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> OpenAPIResourceWithStreamingResponse: + return OpenAPIResourceWithStreamingResponse(self) + + def retrieve( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get the OpenAPI Spec for this project.""" + return self._get( + "/v1/functions/openapi", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncOpenAPIResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncOpenAPIResourceWithRawResponse: + return AsyncOpenAPIResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncOpenAPIResourceWithStreamingResponse: + return AsyncOpenAPIResourceWithStreamingResponse(self) + + async def retrieve( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get the OpenAPI Spec for this project.""" + return await self._get( + "/v1/functions/openapi", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class OpenAPIResourceWithRawResponse: + def __init__(self, openapi: OpenAPIResource) -> None: + self._openapi = openapi + + self.retrieve = to_raw_response_wrapper( + openapi.retrieve, + ) + + +class AsyncOpenAPIResourceWithRawResponse: + def __init__(self, openapi: AsyncOpenAPIResource) -> None: + self._openapi = openapi + + self.retrieve = async_to_raw_response_wrapper( + openapi.retrieve, + ) + + +class OpenAPIResourceWithStreamingResponse: + def __init__(self, openapi: OpenAPIResource) -> None: + self._openapi = openapi + + self.retrieve = to_streamed_response_wrapper( + openapi.retrieve, + ) + + +class AsyncOpenAPIResourceWithStreamingResponse: + def __init__(self, openapi: AsyncOpenAPIResource) -> None: + self._openapi = openapi + + self.retrieve = async_to_streamed_response_wrapper( + openapi.retrieve, + ) diff --git a/src/runloop/resources/latches.py b/src/runloop/resources/latches.py new file mode 100644 index 000000000..1cbc3c0d2 --- /dev/null +++ b/src/runloop/resources/latches.py @@ -0,0 +1,159 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..types import latch_fulfill_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + maybe_transform, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import ( + make_request_options, +) + +__all__ = ["LatchesResource", "AsyncLatchesResource"] + + +class LatchesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LatchesResourceWithRawResponse: + return LatchesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LatchesResourceWithStreamingResponse: + return LatchesResourceWithStreamingResponse(self) + + def fulfill( + self, + latch_id: str, + *, + result: object, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Fulfill the latch by passing the waited for event. + + This will unblock any waiting + functions. + + Args: + result: Json of the event to complete the latch with + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not latch_id: + raise ValueError(f"Expected a non-empty value for `latch_id` but received {latch_id!r}") + return self._post( + f"/v1/latches/{latch_id}", + body=maybe_transform({"result": result}, latch_fulfill_params.LatchFulfillParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class AsyncLatchesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLatchesResourceWithRawResponse: + return AsyncLatchesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLatchesResourceWithStreamingResponse: + return AsyncLatchesResourceWithStreamingResponse(self) + + async def fulfill( + self, + latch_id: str, + *, + result: object, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Fulfill the latch by passing the waited for event. + + This will unblock any waiting + functions. + + Args: + result: Json of the event to complete the latch with + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not latch_id: + raise ValueError(f"Expected a non-empty value for `latch_id` but received {latch_id!r}") + return await self._post( + f"/v1/latches/{latch_id}", + body=await async_maybe_transform({"result": result}, latch_fulfill_params.LatchFulfillParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + +class LatchesResourceWithRawResponse: + def __init__(self, latches: LatchesResource) -> None: + self._latches = latches + + self.fulfill = to_raw_response_wrapper( + latches.fulfill, + ) + + +class AsyncLatchesResourceWithRawResponse: + def __init__(self, latches: AsyncLatchesResource) -> None: + self._latches = latches + + self.fulfill = async_to_raw_response_wrapper( + latches.fulfill, + ) + + +class LatchesResourceWithStreamingResponse: + def __init__(self, latches: LatchesResource) -> None: + self._latches = latches + + self.fulfill = to_streamed_response_wrapper( + latches.fulfill, + ) + + +class AsyncLatchesResourceWithStreamingResponse: + def __init__(self, latches: AsyncLatchesResource) -> None: + self._latches = latches + + self.fulfill = async_to_streamed_response_wrapper( + latches.fulfill, + ) diff --git a/src/runloop/resources/projects/__init__.py b/src/runloop/resources/projects/__init__.py new file mode 100644 index 000000000..a6513e74d --- /dev/null +++ b/src/runloop/resources/projects/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .logs import ( + LogsResource, + AsyncLogsResource, + LogsResourceWithRawResponse, + AsyncLogsResourceWithRawResponse, + LogsResourceWithStreamingResponse, + AsyncLogsResourceWithStreamingResponse, +) +from .projects import ( + ProjectsResource, + AsyncProjectsResource, + ProjectsResourceWithRawResponse, + AsyncProjectsResourceWithRawResponse, + ProjectsResourceWithStreamingResponse, + AsyncProjectsResourceWithStreamingResponse, +) + +__all__ = [ + "LogsResource", + "AsyncLogsResource", + "LogsResourceWithRawResponse", + "AsyncLogsResourceWithRawResponse", + "LogsResourceWithStreamingResponse", + "AsyncLogsResourceWithStreamingResponse", + "ProjectsResource", + "AsyncProjectsResource", + "ProjectsResourceWithRawResponse", + "AsyncProjectsResourceWithRawResponse", + "ProjectsResourceWithStreamingResponse", + "AsyncProjectsResourceWithStreamingResponse", +] diff --git a/src/runloop/resources/projects/logs.py b/src/runloop/resources/projects/logs.py new file mode 100644 index 000000000..a04b3733e --- /dev/null +++ b/src/runloop/resources/projects/logs.py @@ -0,0 +1,143 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import ( + make_request_options, +) +from ...types.projects.project_logs import ProjectLogs + +__all__ = ["LogsResource", "AsyncLogsResource"] + + +class LogsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LogsResourceWithRawResponse: + return LogsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LogsResourceWithStreamingResponse: + return LogsResourceWithStreamingResponse(self) + + def list( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectLogs: + """ + Get list of all logs from a project. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/projects/{id}/logs", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProjectLogs, + ) + + +class AsyncLogsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLogsResourceWithRawResponse: + return AsyncLogsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLogsResourceWithStreamingResponse: + return AsyncLogsResourceWithStreamingResponse(self) + + async def list( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectLogs: + """ + Get list of all logs from a project. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/projects/{id}/logs", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProjectLogs, + ) + + +class LogsResourceWithRawResponse: + def __init__(self, logs: LogsResource) -> None: + self._logs = logs + + self.list = to_raw_response_wrapper( + logs.list, + ) + + +class AsyncLogsResourceWithRawResponse: + def __init__(self, logs: AsyncLogsResource) -> None: + self._logs = logs + + self.list = async_to_raw_response_wrapper( + logs.list, + ) + + +class LogsResourceWithStreamingResponse: + def __init__(self, logs: LogsResource) -> None: + self._logs = logs + + self.list = to_streamed_response_wrapper( + logs.list, + ) + + +class AsyncLogsResourceWithStreamingResponse: + def __init__(self, logs: AsyncLogsResource) -> None: + self._logs = logs + + self.list = async_to_streamed_response_wrapper( + logs.list, + ) diff --git a/src/runloop/resources/projects/projects.py b/src/runloop/resources/projects/projects.py new file mode 100644 index 000000000..e27fc6fb6 --- /dev/null +++ b/src/runloop/resources/projects/projects.py @@ -0,0 +1,155 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from .logs import ( + LogsResource, + AsyncLogsResource, + LogsResourceWithRawResponse, + AsyncLogsResourceWithRawResponse, + LogsResourceWithStreamingResponse, + AsyncLogsResourceWithStreamingResponse, +) +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import ( + make_request_options, +) +from ...types.project_list import ProjectList + +__all__ = ["ProjectsResource", "AsyncProjectsResource"] + + +class ProjectsResource(SyncAPIResource): + @cached_property + def logs(self) -> LogsResource: + return LogsResource(self._client) + + @cached_property + def with_raw_response(self) -> ProjectsResourceWithRawResponse: + return ProjectsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ProjectsResourceWithStreamingResponse: + return ProjectsResourceWithStreamingResponse(self) + + def list( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectList: + """Get list of all projects for the authenticated user. + + This includes all projects + that the user has access to. + """ + return self._get( + "/v1/projects", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProjectList, + ) + + +class AsyncProjectsResource(AsyncAPIResource): + @cached_property + def logs(self) -> AsyncLogsResource: + return AsyncLogsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncProjectsResourceWithRawResponse: + return AsyncProjectsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncProjectsResourceWithStreamingResponse: + return AsyncProjectsResourceWithStreamingResponse(self) + + async def list( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ProjectList: + """Get list of all projects for the authenticated user. + + This includes all projects + that the user has access to. + """ + return await self._get( + "/v1/projects", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ProjectList, + ) + + +class ProjectsResourceWithRawResponse: + def __init__(self, projects: ProjectsResource) -> None: + self._projects = projects + + self.list = to_raw_response_wrapper( + projects.list, + ) + + @cached_property + def logs(self) -> LogsResourceWithRawResponse: + return LogsResourceWithRawResponse(self._projects.logs) + + +class AsyncProjectsResourceWithRawResponse: + def __init__(self, projects: AsyncProjectsResource) -> None: + self._projects = projects + + self.list = async_to_raw_response_wrapper( + projects.list, + ) + + @cached_property + def logs(self) -> AsyncLogsResourceWithRawResponse: + return AsyncLogsResourceWithRawResponse(self._projects.logs) + + +class ProjectsResourceWithStreamingResponse: + def __init__(self, projects: ProjectsResource) -> None: + self._projects = projects + + self.list = to_streamed_response_wrapper( + projects.list, + ) + + @cached_property + def logs(self) -> LogsResourceWithStreamingResponse: + return LogsResourceWithStreamingResponse(self._projects.logs) + + +class AsyncProjectsResourceWithStreamingResponse: + def __init__(self, projects: AsyncProjectsResource) -> None: + self._projects = projects + + self.list = async_to_streamed_response_wrapper( + projects.list, + ) + + @cached_property + def logs(self) -> AsyncLogsResourceWithStreamingResponse: + return AsyncLogsResourceWithStreamingResponse(self._projects.logs) diff --git a/src/runloop/resources/sessions/__init__.py b/src/runloop/resources/sessions/__init__.py new file mode 100644 index 000000000..cc3467b66 --- /dev/null +++ b/src/runloop/resources/sessions/__init__.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .sessions import ( + SessionsResource, + AsyncSessionsResource, + SessionsResourceWithRawResponse, + AsyncSessionsResourceWithRawResponse, + SessionsResourceWithStreamingResponse, + AsyncSessionsResourceWithStreamingResponse, +) + +__all__ = [ + "SessionsResource", + "AsyncSessionsResource", + "SessionsResourceWithRawResponse", + "AsyncSessionsResourceWithRawResponse", + "SessionsResourceWithStreamingResponse", + "AsyncSessionsResourceWithStreamingResponse", +] diff --git a/src/runloop/resources/sessions/sessions.py b/src/runloop/resources/sessions/sessions.py new file mode 100644 index 000000000..7499ccebe --- /dev/null +++ b/src/runloop/resources/sessions/sessions.py @@ -0,0 +1,81 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .sessions import ( + SessionsResource, + AsyncSessionsResource, + SessionsResourceWithRawResponse, + AsyncSessionsResourceWithRawResponse, + SessionsResourceWithStreamingResponse, + AsyncSessionsResourceWithStreamingResponse, + sessions, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource + +__all__ = ["SessionsResource", "AsyncSessionsResource"] + + +class SessionsResource(SyncAPIResource): + @cached_property + def sessions(self) -> sessions.SessionsResource: + return SessionsResource(self._client) + + @cached_property + def with_raw_response(self) -> SessionsResourceWithRawResponse: + return SessionsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> SessionsResourceWithStreamingResponse: + return SessionsResourceWithStreamingResponse(self) + + +class AsyncSessionsResource(AsyncAPIResource): + @cached_property + def sessions(self) -> sessions.AsyncSessionsResource: + return AsyncSessionsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncSessionsResourceWithRawResponse: + return AsyncSessionsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncSessionsResourceWithStreamingResponse: + return AsyncSessionsResourceWithStreamingResponse(self) + + +class SessionsResourceWithRawResponse: + def __init__(self, sessions: SessionsResource) -> None: + self._sessions = sessions + + @cached_property + def sessions(self) -> SessionsResourceWithRawResponse: + return SessionsResourceWithRawResponse(self._sessions.sessions) + + +class AsyncSessionsResourceWithRawResponse: + def __init__(self, sessions: AsyncSessionsResource) -> None: + self._sessions = sessions + + @cached_property + def sessions(self) -> AsyncSessionsResourceWithRawResponse: + return AsyncSessionsResourceWithRawResponse(self._sessions.sessions) + + +class SessionsResourceWithStreamingResponse: + def __init__(self, sessions: SessionsResource) -> None: + self._sessions = sessions + + @cached_property + def sessions(self) -> SessionsResourceWithStreamingResponse: + return SessionsResourceWithStreamingResponse(self._sessions.sessions) + + +class AsyncSessionsResourceWithStreamingResponse: + def __init__(self, sessions: AsyncSessionsResource) -> None: + self._sessions = sessions + + @cached_property + def sessions(self) -> AsyncSessionsResourceWithStreamingResponse: + return AsyncSessionsResourceWithStreamingResponse(self._sessions.sessions) diff --git a/src/runloop/resources/sessions/sessions/__init__.py b/src/runloop/resources/sessions/sessions/__init__.py new file mode 100644 index 000000000..b6be412e3 --- /dev/null +++ b/src/runloop/resources/sessions/sessions/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .kv import ( + KvResource, + AsyncKvResource, + KvResourceWithRawResponse, + AsyncKvResourceWithRawResponse, + KvResourceWithStreamingResponse, + AsyncKvResourceWithStreamingResponse, +) +from .sessions import ( + SessionsResource, + AsyncSessionsResource, + SessionsResourceWithRawResponse, + AsyncSessionsResourceWithRawResponse, + SessionsResourceWithStreamingResponse, + AsyncSessionsResourceWithStreamingResponse, +) + +__all__ = [ + "KvResource", + "AsyncKvResource", + "KvResourceWithRawResponse", + "AsyncKvResourceWithRawResponse", + "KvResourceWithStreamingResponse", + "AsyncKvResourceWithStreamingResponse", + "SessionsResource", + "AsyncSessionsResource", + "SessionsResourceWithRawResponse", + "AsyncSessionsResourceWithRawResponse", + "SessionsResourceWithStreamingResponse", + "AsyncSessionsResourceWithStreamingResponse", +] diff --git a/src/runloop/resources/sessions/sessions/kv.py b/src/runloop/resources/sessions/sessions/kv.py new file mode 100644 index 000000000..a5e6c3e19 --- /dev/null +++ b/src/runloop/resources/sessions/sessions/kv.py @@ -0,0 +1,162 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( + maybe_transform, + async_maybe_transform, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._base_client import ( + make_request_options, +) +from ....types.sessions.sessions import kv_list_params +from ....types.sessions.sessions.session_kv import SessionKv + +__all__ = ["KvResource", "AsyncKvResource"] + + +class KvResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> KvResourceWithRawResponse: + return KvResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> KvResourceWithStreamingResponse: + return KvResourceWithStreamingResponse(self) + + def list( + self, + session_id: str, + *, + keys: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SessionKv: + """ + List the sessions associated with your application. + + Args: + keys: Filter KV to specific keys. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not session_id: + raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}") + return self._get( + f"/v1/sessions/sessions/{session_id}/kv", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"keys": keys}, kv_list_params.KvListParams), + ), + cast_to=SessionKv, + ) + + +class AsyncKvResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncKvResourceWithRawResponse: + return AsyncKvResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncKvResourceWithStreamingResponse: + return AsyncKvResourceWithStreamingResponse(self) + + async def list( + self, + session_id: str, + *, + keys: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SessionKv: + """ + List the sessions associated with your application. + + Args: + keys: Filter KV to specific keys. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not session_id: + raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}") + return await self._get( + f"/v1/sessions/sessions/{session_id}/kv", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"keys": keys}, kv_list_params.KvListParams), + ), + cast_to=SessionKv, + ) + + +class KvResourceWithRawResponse: + def __init__(self, kv: KvResource) -> None: + self._kv = kv + + self.list = to_raw_response_wrapper( + kv.list, + ) + + +class AsyncKvResourceWithRawResponse: + def __init__(self, kv: AsyncKvResource) -> None: + self._kv = kv + + self.list = async_to_raw_response_wrapper( + kv.list, + ) + + +class KvResourceWithStreamingResponse: + def __init__(self, kv: KvResource) -> None: + self._kv = kv + + self.list = to_streamed_response_wrapper( + kv.list, + ) + + +class AsyncKvResourceWithStreamingResponse: + def __init__(self, kv: AsyncKvResource) -> None: + self._kv = kv + + self.list = async_to_streamed_response_wrapper( + kv.list, + ) diff --git a/src/runloop/resources/sessions/sessions/sessions.py b/src/runloop/resources/sessions/sessions/sessions.py new file mode 100644 index 000000000..ee454119a --- /dev/null +++ b/src/runloop/resources/sessions/sessions/sessions.py @@ -0,0 +1,206 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from .kv import ( + KvResource, + AsyncKvResource, + KvResourceWithRawResponse, + AsyncKvResourceWithRawResponse, + KvResourceWithStreamingResponse, + AsyncKvResourceWithStreamingResponse, +) +from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._base_client import ( + make_request_options, +) +from ....types.sessions.session import Session +from ....types.sessions.session_list import SessionList + +__all__ = ["SessionsResource", "AsyncSessionsResource"] + + +class SessionsResource(SyncAPIResource): + @cached_property + def kv(self) -> KvResource: + return KvResource(self._client) + + @cached_property + def with_raw_response(self) -> SessionsResourceWithRawResponse: + return SessionsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> SessionsResourceWithStreamingResponse: + return SessionsResourceWithStreamingResponse(self) + + def create( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Session: + """Create a new session for the application. + + Sessions are used to store metadata + and state for your application. + """ + return self._post( + "/v1/sessions/sessions", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=Session, + ) + + def list( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SessionList: + """List the sessions associated with your application.""" + return self._get( + "/v1/sessions/sessions", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SessionList, + ) + + +class AsyncSessionsResource(AsyncAPIResource): + @cached_property + def kv(self) -> AsyncKvResource: + return AsyncKvResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncSessionsResourceWithRawResponse: + return AsyncSessionsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncSessionsResourceWithStreamingResponse: + return AsyncSessionsResourceWithStreamingResponse(self) + + async def create( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Session: + """Create a new session for the application. + + Sessions are used to store metadata + and state for your application. + """ + return await self._post( + "/v1/sessions/sessions", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=Session, + ) + + async def list( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SessionList: + """List the sessions associated with your application.""" + return await self._get( + "/v1/sessions/sessions", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SessionList, + ) + + +class SessionsResourceWithRawResponse: + def __init__(self, sessions: SessionsResource) -> None: + self._sessions = sessions + + self.create = to_raw_response_wrapper( + sessions.create, + ) + self.list = to_raw_response_wrapper( + sessions.list, + ) + + @cached_property + def kv(self) -> KvResourceWithRawResponse: + return KvResourceWithRawResponse(self._sessions.kv) + + +class AsyncSessionsResourceWithRawResponse: + def __init__(self, sessions: AsyncSessionsResource) -> None: + self._sessions = sessions + + self.create = async_to_raw_response_wrapper( + sessions.create, + ) + self.list = async_to_raw_response_wrapper( + sessions.list, + ) + + @cached_property + def kv(self) -> AsyncKvResourceWithRawResponse: + return AsyncKvResourceWithRawResponse(self._sessions.kv) + + +class SessionsResourceWithStreamingResponse: + def __init__(self, sessions: SessionsResource) -> None: + self._sessions = sessions + + self.create = to_streamed_response_wrapper( + sessions.create, + ) + self.list = to_streamed_response_wrapper( + sessions.list, + ) + + @cached_property + def kv(self) -> KvResourceWithStreamingResponse: + return KvResourceWithStreamingResponse(self._sessions.kv) + + +class AsyncSessionsResourceWithStreamingResponse: + def __init__(self, sessions: AsyncSessionsResource) -> None: + self._sessions = sessions + + self.create = async_to_streamed_response_wrapper( + sessions.create, + ) + self.list = async_to_streamed_response_wrapper( + sessions.list, + ) + + @cached_property + def kv(self) -> AsyncKvResourceWithStreamingResponse: + return AsyncKvResourceWithStreamingResponse(self._sessions.kv) diff --git a/src/runloop/types/__init__.py b/src/runloop/types/__init__.py new file mode 100644 index 000000000..61884524c --- /dev/null +++ b/src/runloop/types/__init__.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .devbox import Devbox as Devbox +from .shared import FunctionInvocationDetail as FunctionInvocationDetail +from .code_handle import CodeHandle as CodeHandle +from .devbox_list import DevboxList as DevboxList +from .project_list import ProjectList as ProjectList +from .function_list import FunctionList as FunctionList +from .code_handle_list import CodeHandleList as CodeHandleList +from .devbox_list_params import DevboxListParams as DevboxListParams +from .devbox_create_params import DevboxCreateParams as DevboxCreateParams +from .latch_fulfill_params import LatchFulfillParams as LatchFulfillParams +from .code_handle_list_params import CodeHandleListParams as CodeHandleListParams +from .code_handle_create_params import CodeHandleCreateParams as CodeHandleCreateParams +from .function_invoke_sync_params import FunctionInvokeSyncParams as FunctionInvokeSyncParams +from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams diff --git a/src/runloop/types/code_handle.py b/src/runloop/types/code_handle.py new file mode 100644 index 000000000..de5bc0845 --- /dev/null +++ b/src/runloop/types/code_handle.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["CodeHandle"] + + +class CodeHandle(BaseModel): + id: Optional[str] = None + """The id of the CodeHandle.""" + + commit_hash: Optional[str] = None + """The git commit hash associated with the code.""" + + owner: Optional[str] = None + """The owner of the repository.""" + + repo_name: Optional[str] = None + """The name of the source repository.""" diff --git a/src/runloop/types/code_handle_create_params.py b/src/runloop/types/code_handle_create_params.py new file mode 100644 index 000000000..20409700f --- /dev/null +++ b/src/runloop/types/code_handle_create_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["CodeHandleCreateParams"] + + +class CodeHandleCreateParams(TypedDict, total=False): + auth_token: str + """A short lived, scoped authentication token.""" + + branch: str + """Branch or tag to checkout instead of main.""" + + name: str + """The name of the code repository.""" + + owner: str + """The account that owns the repository.""" diff --git a/src/runloop/types/code_handle_list.py b/src/runloop/types/code_handle_list.py new file mode 100644 index 000000000..91c014b5e --- /dev/null +++ b/src/runloop/types/code_handle_list.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from .._models import BaseModel +from .code_handle import CodeHandle + +__all__ = ["CodeHandleList"] + + +class CodeHandleList(BaseModel): + code_handles: Optional[List[CodeHandle]] = None + """List of code handles matching given query.""" diff --git a/src/runloop/types/code_handle_list_params.py b/src/runloop/types/code_handle_list_params.py new file mode 100644 index 000000000..f1e074974 --- /dev/null +++ b/src/runloop/types/code_handle_list_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["CodeHandleListParams"] + + +class CodeHandleListParams(TypedDict, total=False): + owner: str + """Repo owner name.""" + + repo_name: str + """Repo name.""" diff --git a/src/runloop/types/devbox.py b/src/runloop/types/devbox.py new file mode 100644 index 000000000..ea7a67e86 --- /dev/null +++ b/src/runloop/types/devbox.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["Devbox"] + + +class Devbox(BaseModel): + id: Optional[str] = None + """The id of the Devbox.""" + + create_time_ms: Optional[int] = None + """Creation time of the Devbox (Unix timestamp milliseconds).""" + + status: Optional[str] = None + """ + The current status of the Devbox (provisioning, initializing, running, failure, + shutdown). + """ diff --git a/src/runloop/types/devbox_create_params.py b/src/runloop/types/devbox_create_params.py new file mode 100644 index 000000000..588469cf4 --- /dev/null +++ b/src/runloop/types/devbox_create_params.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, List +from typing_extensions import TypedDict + +__all__ = ["DevboxCreateParams"] + + +class DevboxCreateParams(TypedDict, total=False): + code_handle: str + """(Optional) Id of a code handle to mount to devbox.""" + + entrypoint: str + """ + (Optional) When specified, the Devbox will run this script as its main + executable. The devbox lifecycle will be bound to entrypoint, shutting down when + the process is complete. + """ + + environment_variables: Dict[str, str] + """(Optional) Environment variables used to configure your Devbox.""" + + setup_commands: List[str] + """(Optional) List of commands needed to set up your Devbox. + + Examples might include fetching a tool or building your dependencies. Runloop + will look optimize these steps for you. + """ diff --git a/src/runloop/types/devbox_list.py b/src/runloop/types/devbox_list.py new file mode 100644 index 000000000..f02281a92 --- /dev/null +++ b/src/runloop/types/devbox_list.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from .devbox import Devbox +from .._models import BaseModel + +__all__ = ["DevboxList"] + + +class DevboxList(BaseModel): + devboxes: Optional[List[Devbox]] = None + """List of devboxes matching filter.""" diff --git a/src/runloop/types/devbox_list_params.py b/src/runloop/types/devbox_list_params.py new file mode 100644 index 000000000..b7e3e4bce --- /dev/null +++ b/src/runloop/types/devbox_list_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["DevboxListParams"] + + +class DevboxListParams(TypedDict, total=False): + status: str + """Filter by status""" diff --git a/src/runloop/types/devboxes/__init__.py b/src/runloop/types/devboxes/__init__.py new file mode 100644 index 000000000..e21da2fc5 --- /dev/null +++ b/src/runloop/types/devboxes/__init__.py @@ -0,0 +1,5 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .devbox_logs_list import DevboxLogsList as DevboxLogsList diff --git a/src/runloop/types/devboxes/devbox_logs_list.py b/src/runloop/types/devboxes/devbox_logs_list.py new file mode 100644 index 000000000..0421ab82d --- /dev/null +++ b/src/runloop/types/devboxes/devbox_logs_list.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["DevboxLogsList", "Log"] + + +class Log(BaseModel): + level: Optional[str] = None + """Log line severity level.""" + + message: Optional[str] = None + """Log line message.""" + + timestamp_ms: Optional[int] = None + """Time of log (Unix timestamp milliseconds).""" + + +class DevboxLogsList(BaseModel): + logs: Optional[List[Log]] = None + """List of logs for the given devbox.""" diff --git a/src/runloop/types/function_invoke_async_params.py b/src/runloop/types/function_invoke_async_params.py new file mode 100644 index 000000000..a20bdf7a9 --- /dev/null +++ b/src/runloop/types/function_invoke_async_params.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["FunctionInvokeAsyncParams", "RunloopMeta"] + + +class FunctionInvokeAsyncParams(TypedDict, total=False): + project_name: Required[Annotated[str, PropertyInfo(alias="projectName")]] + + request: Required[object] + """Json of the request""" + + runloop_meta: Annotated[RunloopMeta, PropertyInfo(alias="runloopMeta")] + + +class RunloopMeta(TypedDict, total=False): + session_id: Annotated[str, PropertyInfo(alias="sessionId")] + """Json of the request""" diff --git a/src/runloop/types/function_invoke_sync_params.py b/src/runloop/types/function_invoke_sync_params.py new file mode 100644 index 000000000..e8673db05 --- /dev/null +++ b/src/runloop/types/function_invoke_sync_params.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["FunctionInvokeSyncParams", "RunloopMeta"] + + +class FunctionInvokeSyncParams(TypedDict, total=False): + project_name: Required[Annotated[str, PropertyInfo(alias="projectName")]] + + request: Required[object] + """Json of the request""" + + runloop_meta: Annotated[RunloopMeta, PropertyInfo(alias="runloopMeta")] + + +class RunloopMeta(TypedDict, total=False): + session_id: Annotated[str, PropertyInfo(alias="sessionId")] + """Json of the request""" diff --git a/src/runloop/types/function_list.py b/src/runloop/types/function_list.py new file mode 100644 index 000000000..3c896443a --- /dev/null +++ b/src/runloop/types/function_list.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["FunctionList", "Function"] + + +class Function(BaseModel): + name: Optional[str] = None + """Unique name of the function.""" + + project_name: Optional[str] = FieldInfo(alias="projectName", default=None) + """Unique name of the project.""" + + +class FunctionList(BaseModel): + functions: Optional[List[Function]] = None + """List of functions matching given query.""" diff --git a/src/runloop/types/functions/__init__.py b/src/runloop/types/functions/__init__.py new file mode 100644 index 000000000..2f26a065d --- /dev/null +++ b/src/runloop/types/functions/__init__.py @@ -0,0 +1,5 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .function_invocation_list import FunctionInvocationList as FunctionInvocationList diff --git a/src/runloop/types/functions/function_invocation_list.py b/src/runloop/types/functions/function_invocation_list.py new file mode 100644 index 000000000..58f9a48ba --- /dev/null +++ b/src/runloop/types/functions/function_invocation_list.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["FunctionInvocationList", "Invocation"] + + +class Invocation(BaseModel): + id: Optional[str] = None + """Unique ID of the invocations.""" + + name: Optional[str] = None + """Name of the invoked function.""" + + project_name: Optional[str] = FieldInfo(alias="projectName", default=None) + """Project name associated with invoked function.""" + + status: Optional[Literal["created", "running", "success", "failure", "canceled", "suspended"]] = None + + +class FunctionInvocationList(BaseModel): + invocations: Optional[List[Invocation]] = None + """List of functions matching given query.""" diff --git a/src/runloop/types/functions/invocations/__init__.py b/src/runloop/types/functions/invocations/__init__.py new file mode 100644 index 000000000..b07bce5b8 --- /dev/null +++ b/src/runloop/types/functions/invocations/__init__.py @@ -0,0 +1,5 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .invocation_span_list import InvocationSpanList as InvocationSpanList diff --git a/src/runloop/types/functions/invocations/invocation_span_list.py b/src/runloop/types/functions/invocations/invocation_span_list.py new file mode 100644 index 000000000..99c6714a5 --- /dev/null +++ b/src/runloop/types/functions/invocations/invocation_span_list.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["InvocationSpanList"] + + +class InvocationSpanList(BaseModel): + invocation_id: Optional[str] = FieldInfo(alias="invocationId", default=None) + + spans: Optional[object] = None + """List of spans matching given query.""" diff --git a/src/runloop/types/latch_fulfill_params.py b/src/runloop/types/latch_fulfill_params.py new file mode 100644 index 000000000..788cca340 --- /dev/null +++ b/src/runloop/types/latch_fulfill_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LatchFulfillParams"] + + +class LatchFulfillParams(TypedDict, total=False): + result: Required[object] + """Json of the event to complete the latch with""" diff --git a/src/runloop/types/project_list.py b/src/runloop/types/project_list.py new file mode 100644 index 000000000..7ec67b8b3 --- /dev/null +++ b/src/runloop/types/project_list.py @@ -0,0 +1,131 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from .._models import BaseModel + +__all__ = [ + "ProjectList", + "Installation", + "Project", + "ProjectActiveDeploy", + "ProjectInProgressDeploy", + "ProjectRecentDeployment", +] + + +class Installation(BaseModel): + status: Optional[str] = None + """Status of the installation (installed | uninstalled | never_installed).""" + + +class ProjectActiveDeploy(BaseModel): + deploy_start_time_ms: int + """Time the Deploy was started (Unix timestamp milliseconds).""" + + id: Optional[str] = None + """ID of the deployment.""" + + deploy_end_time_ms: Optional[int] = None + """Time the Deploy completed (Unix timestamp milliseconds).""" + + deployed_functions: Optional[List[str]] = None + """The list of deployed functions.""" + + failure_code: Optional[str] = None + """ + Failure code (generic_failure | git_clone_failure | not_runloop_repo | + secrets_failure | provision_failure | runtime_failure). Only set on + deploy_failed. + """ + + failure_message: Optional[str] = None + """Failure message""" + + status: Optional[str] = None + """ + Status of the deploy (deploy_in_progress | deployed | deploy_failed | + not_started). + """ + + +class ProjectInProgressDeploy(BaseModel): + deploy_start_time_ms: int + """Time the Deploy was started (Unix timestamp milliseconds).""" + + id: Optional[str] = None + """ID of the deployment.""" + + deploy_end_time_ms: Optional[int] = None + """Time the Deploy completed (Unix timestamp milliseconds).""" + + deployed_functions: Optional[List[str]] = None + """The list of deployed functions.""" + + failure_code: Optional[str] = None + """ + Failure code (generic_failure | git_clone_failure | not_runloop_repo | + secrets_failure | provision_failure | runtime_failure). Only set on + deploy_failed. + """ + + failure_message: Optional[str] = None + """Failure message""" + + status: Optional[str] = None + """ + Status of the deploy (deploy_in_progress | deployed | deploy_failed | + not_started). + """ + + +class ProjectRecentDeployment(BaseModel): + deploy_start_time_ms: int + """Time the Deploy was started (Unix timestamp milliseconds).""" + + id: Optional[str] = None + """ID of the deployment.""" + + deploy_end_time_ms: Optional[int] = None + """Time the Deploy completed (Unix timestamp milliseconds).""" + + deployed_functions: Optional[List[str]] = None + """The list of deployed functions.""" + + failure_code: Optional[str] = None + """ + Failure code (generic_failure | git_clone_failure | not_runloop_repo | + secrets_failure | provision_failure | runtime_failure). Only set on + deploy_failed. + """ + + failure_message: Optional[str] = None + """Failure message""" + + status: Optional[str] = None + """ + Status of the deploy (deploy_in_progress | deployed | deploy_failed | + not_started). + """ + + +class Project(BaseModel): + id: Optional[str] = None + """Unique id of Project.""" + + active_deploy: Optional[ProjectActiveDeploy] = None + + in_progress_deploy: Optional[ProjectInProgressDeploy] = None + + name: Optional[str] = None + """Project display name.""" + + recent_deployments: Optional[List[ProjectRecentDeployment]] = None + """Last deployment attempts (up to 10)""" + + +class ProjectList(BaseModel): + installation: Optional[Installation] = None + + projects: Optional[List[Project]] = None + """List of projects matching given query.""" diff --git a/src/runloop/types/projects/__init__.py b/src/runloop/types/projects/__init__.py new file mode 100644 index 000000000..46ab60d45 --- /dev/null +++ b/src/runloop/types/projects/__init__.py @@ -0,0 +1,5 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .project_logs import ProjectLogs as ProjectLogs diff --git a/src/runloop/types/projects/project_logs.py b/src/runloop/types/projects/project_logs.py new file mode 100644 index 000000000..b3aa893d3 --- /dev/null +++ b/src/runloop/types/projects/project_logs.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["ProjectLogs", "Log"] + + +class Log(BaseModel): + level: Optional[str] = None + + message: Optional[str] = None + + timestamp: Optional[str] = None + + +class ProjectLogs(BaseModel): + logs: Optional[List[Log]] = None + """List of logs for the given project.""" diff --git a/src/runloop/types/sessions/__init__.py b/src/runloop/types/sessions/__init__.py new file mode 100644 index 000000000..a0505871d --- /dev/null +++ b/src/runloop/types/sessions/__init__.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .session import Session as Session +from .session_list import SessionList as SessionList diff --git a/src/runloop/types/sessions/session.py b/src/runloop/types/sessions/session.py new file mode 100644 index 000000000..dbcd088a5 --- /dev/null +++ b/src/runloop/types/sessions/session.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["Session"] + + +class Session(BaseModel): + id: Optional[str] = None + """The ID of the session.""" diff --git a/src/runloop/types/sessions/session_list.py b/src/runloop/types/sessions/session_list.py new file mode 100644 index 000000000..12242094d --- /dev/null +++ b/src/runloop/types/sessions/session_list.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from .session import Session +from ..._models import BaseModel + +__all__ = ["SessionList"] + + +class SessionList(BaseModel): + sessions: Optional[List[Session]] = None + """List of sessions matching given query.""" diff --git a/src/runloop/types/sessions/sessions/__init__.py b/src/runloop/types/sessions/sessions/__init__.py new file mode 100644 index 000000000..8a4429d53 --- /dev/null +++ b/src/runloop/types/sessions/sessions/__init__.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .session_kv import SessionKv as SessionKv +from .kv_list_params import KvListParams as KvListParams diff --git a/src/runloop/types/sessions/sessions/kv_list_params.py b/src/runloop/types/sessions/sessions/kv_list_params.py new file mode 100644 index 000000000..8e60228f6 --- /dev/null +++ b/src/runloop/types/sessions/sessions/kv_list_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["KvListParams"] + + +class KvListParams(TypedDict, total=False): + keys: str + """Filter KV to specific keys.""" diff --git a/src/runloop/types/sessions/sessions/session_kv.py b/src/runloop/types/sessions/sessions/session_kv.py new file mode 100644 index 000000000..d1e90041f --- /dev/null +++ b/src/runloop/types/sessions/sessions/session_kv.py @@ -0,0 +1,66 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["SessionKv", "Kv"] + + +class Kv(BaseModel): + array: bool + + big_decimal: bool = FieldInfo(alias="bigDecimal") + + big_integer: bool = FieldInfo(alias="bigInteger") + + binary: bool + + boolean: bool + + container_node: bool = FieldInfo(alias="containerNode") + + double: bool + + empty: bool + + float: bool + + floating_point_number: bool = FieldInfo(alias="floatingPointNumber") + + int: bool + + integral_number: bool = FieldInfo(alias="integralNumber") + + long: bool + + missing_node: bool = FieldInfo(alias="missingNode") + + null: bool + + number: bool + + object: bool + + pojo: bool + + short: bool + + textual: bool + + value_node: bool = FieldInfo(alias="valueNode") + + node_type: Optional[ + Literal["ARRAY", "BINARY", "BOOLEAN", "MISSING", "NULL", "NUMBER", "OBJECT", "POJO", "STRING"] + ] = FieldInfo(alias="nodeType", default=None) + + +class SessionKv(BaseModel): + id: Optional[str] = None + """The ID of the session.""" + + kv: Optional[Dict[str, Kv]] = None + """The session key value storage.""" diff --git a/src/runloop/types/shared/__init__.py b/src/runloop/types/shared/__init__.py new file mode 100644 index 000000000..bf987c3b2 --- /dev/null +++ b/src/runloop/types/shared/__init__.py @@ -0,0 +1,3 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .function_invocation_detail import FunctionInvocationDetail as FunctionInvocationDetail diff --git a/src/runloop/types/shared/function_invocation_detail.py b/src/runloop/types/shared/function_invocation_detail.py new file mode 100644 index 000000000..03982e19e --- /dev/null +++ b/src/runloop/types/shared/function_invocation_detail.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["FunctionInvocationDetail"] + + +class FunctionInvocationDetail(BaseModel): + id: Optional[str] = None + """Unique ID of the invocation.""" + + error: Optional[str] = None + + function_name: Optional[str] = FieldInfo(alias="functionName", default=None) + """Unique name of the function.""" + + project_name: Optional[str] = FieldInfo(alias="projectName", default=None) + """Unique name of the project associated with function.""" + + result: Optional[object] = None + + status: Optional[Literal["created", "running", "success", "failure", "canceled", "suspended"]] = None diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 000000000..fd8019a9a --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/__init__.py b/tests/api_resources/__init__.py new file mode 100644 index 000000000..fd8019a9a --- /dev/null +++ b/tests/api_resources/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/devboxes/__init__.py b/tests/api_resources/devboxes/__init__.py new file mode 100644 index 000000000..fd8019a9a --- /dev/null +++ b/tests/api_resources/devboxes/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/devboxes/test_logs.py b/tests/api_resources/devboxes/test_logs.py new file mode 100644 index 000000000..572e8996e --- /dev/null +++ b/tests/api_resources/devboxes/test_logs.py @@ -0,0 +1,98 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from runloop import Runloop, AsyncRunloop +from tests.utils import assert_matches_type +from runloop.types.devboxes import DevboxLogsList + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLogs: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + log = client.devboxes.logs.list( + "string", + ) + assert_matches_type(DevboxLogsList, log, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.devboxes.logs.with_raw_response.list( + "string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + log = response.parse() + assert_matches_type(DevboxLogsList, log, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.devboxes.logs.with_streaming_response.list( + "string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + log = response.parse() + assert_matches_type(DevboxLogsList, log, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.logs.with_raw_response.list( + "", + ) + + +class TestAsyncLogs: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + log = await async_client.devboxes.logs.list( + "string", + ) + assert_matches_type(DevboxLogsList, log, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.logs.with_raw_response.list( + "string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + log = await response.parse() + assert_matches_type(DevboxLogsList, log, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.logs.with_streaming_response.list( + "string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + log = await response.parse() + assert_matches_type(DevboxLogsList, log, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.logs.with_raw_response.list( + "", + ) diff --git a/tests/api_resources/functions/__init__.py b/tests/api_resources/functions/__init__.py new file mode 100644 index 000000000..fd8019a9a --- /dev/null +++ b/tests/api_resources/functions/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/functions/invocations/__init__.py b/tests/api_resources/functions/invocations/__init__.py new file mode 100644 index 000000000..fd8019a9a --- /dev/null +++ b/tests/api_resources/functions/invocations/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/functions/invocations/test_spans.py b/tests/api_resources/functions/invocations/test_spans.py new file mode 100644 index 000000000..46616c8ee --- /dev/null +++ b/tests/api_resources/functions/invocations/test_spans.py @@ -0,0 +1,98 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from runloop import Runloop, AsyncRunloop +from tests.utils import assert_matches_type +from runloop.types.functions.invocations import InvocationSpanList + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestSpans: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + span = client.functions.invocations.spans.list( + "string", + ) + assert_matches_type(InvocationSpanList, span, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.functions.invocations.spans.with_raw_response.list( + "string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + span = response.parse() + assert_matches_type(InvocationSpanList, span, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.functions.invocations.spans.with_streaming_response.list( + "string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + span = response.parse() + assert_matches_type(InvocationSpanList, span, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `invocation_id` but received ''"): + client.functions.invocations.spans.with_raw_response.list( + "", + ) + + +class TestAsyncSpans: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + span = await async_client.functions.invocations.spans.list( + "string", + ) + assert_matches_type(InvocationSpanList, span, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.functions.invocations.spans.with_raw_response.list( + "string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + span = await response.parse() + assert_matches_type(InvocationSpanList, span, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.functions.invocations.spans.with_streaming_response.list( + "string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + span = await response.parse() + assert_matches_type(InvocationSpanList, span, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `invocation_id` but received ''"): + await async_client.functions.invocations.spans.with_raw_response.list( + "", + ) diff --git a/tests/api_resources/functions/test_invocations.py b/tests/api_resources/functions/test_invocations.py new file mode 100644 index 000000000..15816e959 --- /dev/null +++ b/tests/api_resources/functions/test_invocations.py @@ -0,0 +1,225 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from runloop import Runloop, AsyncRunloop +from tests.utils import assert_matches_type +from runloop.types.shared import FunctionInvocationDetail +from runloop.types.functions import FunctionInvocationList + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestInvocations: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + invocation = client.functions.invocations.retrieve( + "string", + ) + assert_matches_type(FunctionInvocationDetail, invocation, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.functions.invocations.with_raw_response.retrieve( + "string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + invocation = response.parse() + assert_matches_type(FunctionInvocationDetail, invocation, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.functions.invocations.with_streaming_response.retrieve( + "string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + invocation = response.parse() + assert_matches_type(FunctionInvocationDetail, invocation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `invocation_id` but received ''"): + client.functions.invocations.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + invocation = client.functions.invocations.list() + assert_matches_type(FunctionInvocationList, invocation, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.functions.invocations.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + invocation = response.parse() + assert_matches_type(FunctionInvocationList, invocation, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.functions.invocations.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + invocation = response.parse() + assert_matches_type(FunctionInvocationList, invocation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_kill(self, client: Runloop) -> None: + invocation = client.functions.invocations.kill( + "string", + ) + assert_matches_type(object, invocation, path=["response"]) + + @parametrize + def test_raw_response_kill(self, client: Runloop) -> None: + response = client.functions.invocations.with_raw_response.kill( + "string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + invocation = response.parse() + assert_matches_type(object, invocation, path=["response"]) + + @parametrize + def test_streaming_response_kill(self, client: Runloop) -> None: + with client.functions.invocations.with_streaming_response.kill( + "string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + invocation = response.parse() + assert_matches_type(object, invocation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_kill(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `invocation_id` but received ''"): + client.functions.invocations.with_raw_response.kill( + "", + ) + + +class TestAsyncInvocations: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + invocation = await async_client.functions.invocations.retrieve( + "string", + ) + assert_matches_type(FunctionInvocationDetail, invocation, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.functions.invocations.with_raw_response.retrieve( + "string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + invocation = await response.parse() + assert_matches_type(FunctionInvocationDetail, invocation, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.functions.invocations.with_streaming_response.retrieve( + "string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + invocation = await response.parse() + assert_matches_type(FunctionInvocationDetail, invocation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `invocation_id` but received ''"): + await async_client.functions.invocations.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + invocation = await async_client.functions.invocations.list() + assert_matches_type(FunctionInvocationList, invocation, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.functions.invocations.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + invocation = await response.parse() + assert_matches_type(FunctionInvocationList, invocation, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.functions.invocations.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + invocation = await response.parse() + assert_matches_type(FunctionInvocationList, invocation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_kill(self, async_client: AsyncRunloop) -> None: + invocation = await async_client.functions.invocations.kill( + "string", + ) + assert_matches_type(object, invocation, path=["response"]) + + @parametrize + async def test_raw_response_kill(self, async_client: AsyncRunloop) -> None: + response = await async_client.functions.invocations.with_raw_response.kill( + "string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + invocation = await response.parse() + assert_matches_type(object, invocation, path=["response"]) + + @parametrize + async def test_streaming_response_kill(self, async_client: AsyncRunloop) -> None: + async with async_client.functions.invocations.with_streaming_response.kill( + "string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + invocation = await response.parse() + assert_matches_type(object, invocation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_kill(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `invocation_id` but received ''"): + await async_client.functions.invocations.with_raw_response.kill( + "", + ) diff --git a/tests/api_resources/functions/test_openapi.py b/tests/api_resources/functions/test_openapi.py new file mode 100644 index 000000000..6ecf67427 --- /dev/null +++ b/tests/api_resources/functions/test_openapi.py @@ -0,0 +1,71 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from runloop import Runloop, AsyncRunloop +from tests.utils import assert_matches_type + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestOpenAPI: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + openapi = client.functions.openapi.retrieve() + assert_matches_type(object, openapi, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.functions.openapi.with_raw_response.retrieve() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + openapi = response.parse() + assert_matches_type(object, openapi, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.functions.openapi.with_streaming_response.retrieve() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + openapi = response.parse() + assert_matches_type(object, openapi, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncOpenAPI: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + openapi = await async_client.functions.openapi.retrieve() + assert_matches_type(object, openapi, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.functions.openapi.with_raw_response.retrieve() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + openapi = await response.parse() + assert_matches_type(object, openapi, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.functions.openapi.with_streaming_response.retrieve() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + openapi = await response.parse() + assert_matches_type(object, openapi, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/projects/__init__.py b/tests/api_resources/projects/__init__.py new file mode 100644 index 000000000..fd8019a9a --- /dev/null +++ b/tests/api_resources/projects/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/projects/test_logs.py b/tests/api_resources/projects/test_logs.py new file mode 100644 index 000000000..69f00cbd4 --- /dev/null +++ b/tests/api_resources/projects/test_logs.py @@ -0,0 +1,98 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from runloop import Runloop, AsyncRunloop +from tests.utils import assert_matches_type +from runloop.types.projects import ProjectLogs + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLogs: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + log = client.projects.logs.list( + "string", + ) + assert_matches_type(ProjectLogs, log, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.projects.logs.with_raw_response.list( + "string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + log = response.parse() + assert_matches_type(ProjectLogs, log, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.projects.logs.with_streaming_response.list( + "string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + log = response.parse() + assert_matches_type(ProjectLogs, log, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.projects.logs.with_raw_response.list( + "", + ) + + +class TestAsyncLogs: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + log = await async_client.projects.logs.list( + "string", + ) + assert_matches_type(ProjectLogs, log, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.projects.logs.with_raw_response.list( + "string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + log = await response.parse() + assert_matches_type(ProjectLogs, log, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.projects.logs.with_streaming_response.list( + "string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + log = await response.parse() + assert_matches_type(ProjectLogs, log, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.projects.logs.with_raw_response.list( + "", + ) diff --git a/tests/api_resources/sessions/__init__.py b/tests/api_resources/sessions/__init__.py new file mode 100644 index 000000000..fd8019a9a --- /dev/null +++ b/tests/api_resources/sessions/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/sessions/sessions/__init__.py b/tests/api_resources/sessions/sessions/__init__.py new file mode 100644 index 000000000..fd8019a9a --- /dev/null +++ b/tests/api_resources/sessions/sessions/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/sessions/sessions/test_kv.py b/tests/api_resources/sessions/sessions/test_kv.py new file mode 100644 index 000000000..13a721cb8 --- /dev/null +++ b/tests/api_resources/sessions/sessions/test_kv.py @@ -0,0 +1,114 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from runloop import Runloop, AsyncRunloop +from tests.utils import assert_matches_type +from runloop.types.sessions.sessions import SessionKv + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestKv: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + kv = client.sessions.sessions.kv.list( + "string", + ) + assert_matches_type(SessionKv, kv, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + kv = client.sessions.sessions.kv.list( + "string", + keys="string", + ) + assert_matches_type(SessionKv, kv, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.sessions.sessions.kv.with_raw_response.list( + "string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + kv = response.parse() + assert_matches_type(SessionKv, kv, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.sessions.sessions.kv.with_streaming_response.list( + "string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + kv = response.parse() + assert_matches_type(SessionKv, kv, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `session_id` but received ''"): + client.sessions.sessions.kv.with_raw_response.list( + "", + ) + + +class TestAsyncKv: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + kv = await async_client.sessions.sessions.kv.list( + "string", + ) + assert_matches_type(SessionKv, kv, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + kv = await async_client.sessions.sessions.kv.list( + "string", + keys="string", + ) + assert_matches_type(SessionKv, kv, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.sessions.sessions.kv.with_raw_response.list( + "string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + kv = await response.parse() + assert_matches_type(SessionKv, kv, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.sessions.sessions.kv.with_streaming_response.list( + "string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + kv = await response.parse() + assert_matches_type(SessionKv, kv, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `session_id` but received ''"): + await async_client.sessions.sessions.kv.with_raw_response.list( + "", + ) diff --git a/tests/api_resources/sessions/test_sessions.py b/tests/api_resources/sessions/test_sessions.py new file mode 100644 index 000000000..97cba7463 --- /dev/null +++ b/tests/api_resources/sessions/test_sessions.py @@ -0,0 +1,122 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from runloop import Runloop, AsyncRunloop +from tests.utils import assert_matches_type +from runloop.types.sessions import Session, SessionList + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestSessions: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Runloop) -> None: + session = client.sessions.sessions.create() + assert_matches_type(Session, session, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Runloop) -> None: + response = client.sessions.sessions.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + session = response.parse() + assert_matches_type(Session, session, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Runloop) -> None: + with client.sessions.sessions.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + session = response.parse() + assert_matches_type(Session, session, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list(self, client: Runloop) -> None: + session = client.sessions.sessions.list() + assert_matches_type(SessionList, session, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.sessions.sessions.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + session = response.parse() + assert_matches_type(SessionList, session, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.sessions.sessions.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + session = response.parse() + assert_matches_type(SessionList, session, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncSessions: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncRunloop) -> None: + session = await async_client.sessions.sessions.create() + assert_matches_type(Session, session, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: + response = await async_client.sessions.sessions.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + session = await response.parse() + assert_matches_type(Session, session, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: + async with async_client.sessions.sessions.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + session = await response.parse() + assert_matches_type(Session, session, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + session = await async_client.sessions.sessions.list() + assert_matches_type(SessionList, session, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.sessions.sessions.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + session = await response.parse() + assert_matches_type(SessionList, session, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.sessions.sessions.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + session = await response.parse() + assert_matches_type(SessionList, session, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_code_handles.py b/tests/api_resources/test_code_handles.py new file mode 100644 index 000000000..60a09f28c --- /dev/null +++ b/tests/api_resources/test_code_handles.py @@ -0,0 +1,158 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from runloop import Runloop, AsyncRunloop +from tests.utils import assert_matches_type +from runloop.types import CodeHandle, CodeHandleList + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestCodeHandles: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Runloop) -> None: + code_handle = client.code_handles.create() + assert_matches_type(CodeHandle, code_handle, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Runloop) -> None: + code_handle = client.code_handles.create( + auth_token="string", + branch="string", + name="string", + owner="string", + ) + assert_matches_type(CodeHandle, code_handle, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Runloop) -> None: + response = client.code_handles.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + code_handle = response.parse() + assert_matches_type(CodeHandle, code_handle, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Runloop) -> None: + with client.code_handles.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + code_handle = response.parse() + assert_matches_type(CodeHandle, code_handle, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_list(self, client: Runloop) -> None: + code_handle = client.code_handles.list() + assert_matches_type(CodeHandleList, code_handle, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + code_handle = client.code_handles.list( + owner="string", + repo_name="string", + ) + assert_matches_type(CodeHandleList, code_handle, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.code_handles.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + code_handle = response.parse() + assert_matches_type(CodeHandleList, code_handle, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.code_handles.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + code_handle = response.parse() + assert_matches_type(CodeHandleList, code_handle, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncCodeHandles: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncRunloop) -> None: + code_handle = await async_client.code_handles.create() + assert_matches_type(CodeHandle, code_handle, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: + code_handle = await async_client.code_handles.create( + auth_token="string", + branch="string", + name="string", + owner="string", + ) + assert_matches_type(CodeHandle, code_handle, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: + response = await async_client.code_handles.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + code_handle = await response.parse() + assert_matches_type(CodeHandle, code_handle, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: + async with async_client.code_handles.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + code_handle = await response.parse() + assert_matches_type(CodeHandle, code_handle, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + code_handle = await async_client.code_handles.list() + assert_matches_type(CodeHandleList, code_handle, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + code_handle = await async_client.code_handles.list( + owner="string", + repo_name="string", + ) + assert_matches_type(CodeHandleList, code_handle, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.code_handles.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + code_handle = await response.parse() + assert_matches_type(CodeHandleList, code_handle, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.code_handles.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + code_handle = await response.parse() + assert_matches_type(CodeHandleList, code_handle, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py new file mode 100644 index 000000000..1b5ec2b5b --- /dev/null +++ b/tests/api_resources/test_devboxes.py @@ -0,0 +1,308 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from runloop import Runloop, AsyncRunloop +from tests.utils import assert_matches_type +from runloop.types import Devbox, DevboxList + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestDevboxes: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Runloop) -> None: + devbox = client.devboxes.create() + assert_matches_type(Devbox, devbox, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Runloop) -> None: + devbox = client.devboxes.create( + code_handle="string", + entrypoint="string", + environment_variables={"foo": "string"}, + setup_commands=["string", "string", "string"], + ) + assert_matches_type(Devbox, devbox, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(Devbox, devbox, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(Devbox, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + devbox = client.devboxes.retrieve( + "string", + ) + assert_matches_type(Devbox, devbox, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.retrieve( + "string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(Devbox, devbox, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.retrieve( + "string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(Devbox, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + devbox = client.devboxes.list() + assert_matches_type(DevboxList, devbox, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + devbox = client.devboxes.list( + status="string", + ) + assert_matches_type(DevboxList, devbox, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(DevboxList, devbox, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(DevboxList, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_shutdown(self, client: Runloop) -> None: + devbox = client.devboxes.shutdown( + "string", + ) + assert_matches_type(Devbox, devbox, path=["response"]) + + @parametrize + def test_raw_response_shutdown(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.shutdown( + "string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(Devbox, devbox, path=["response"]) + + @parametrize + def test_streaming_response_shutdown(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.shutdown( + "string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(Devbox, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_shutdown(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.shutdown( + "", + ) + + +class TestAsyncDevboxes: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.create() + assert_matches_type(Devbox, devbox, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.create( + code_handle="string", + entrypoint="string", + environment_variables={"foo": "string"}, + setup_commands=["string", "string", "string"], + ) + assert_matches_type(Devbox, devbox, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(Devbox, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(Devbox, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.retrieve( + "string", + ) + assert_matches_type(Devbox, devbox, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.retrieve( + "string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(Devbox, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.retrieve( + "string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(Devbox, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.list() + assert_matches_type(DevboxList, devbox, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.list( + status="string", + ) + assert_matches_type(DevboxList, devbox, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(DevboxList, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(DevboxList, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_shutdown(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.shutdown( + "string", + ) + assert_matches_type(Devbox, devbox, path=["response"]) + + @parametrize + async def test_raw_response_shutdown(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.shutdown( + "string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(Devbox, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_shutdown(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.shutdown( + "string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(Devbox, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_shutdown(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.shutdown( + "", + ) diff --git a/tests/api_resources/test_functions.py b/tests/api_resources/test_functions.py new file mode 100644 index 000000000..5ba11633a --- /dev/null +++ b/tests/api_resources/test_functions.py @@ -0,0 +1,325 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from runloop import Runloop, AsyncRunloop +from tests.utils import assert_matches_type +from runloop.types import FunctionList +from runloop.types.shared import FunctionInvocationDetail + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestFunctions: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + function = client.functions.list() + assert_matches_type(FunctionList, function, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.functions.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + function = response.parse() + assert_matches_type(FunctionList, function, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.functions.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + function = response.parse() + assert_matches_type(FunctionList, function, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_invoke_async(self, client: Runloop) -> None: + function = client.functions.invoke_async( + "string", + project_name="string", + request={}, + ) + assert_matches_type(FunctionInvocationDetail, function, path=["response"]) + + @parametrize + def test_method_invoke_async_with_all_params(self, client: Runloop) -> None: + function = client.functions.invoke_async( + "string", + project_name="string", + request={}, + runloop_meta={"session_id": "string"}, + ) + assert_matches_type(FunctionInvocationDetail, function, path=["response"]) + + @parametrize + def test_raw_response_invoke_async(self, client: Runloop) -> None: + response = client.functions.with_raw_response.invoke_async( + "string", + project_name="string", + request={}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + function = response.parse() + assert_matches_type(FunctionInvocationDetail, function, path=["response"]) + + @parametrize + def test_streaming_response_invoke_async(self, client: Runloop) -> None: + with client.functions.with_streaming_response.invoke_async( + "string", + project_name="string", + request={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + function = response.parse() + assert_matches_type(FunctionInvocationDetail, function, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_invoke_async(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): + client.functions.with_raw_response.invoke_async( + "string", + project_name="", + request={}, + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): + client.functions.with_raw_response.invoke_async( + "", + project_name="string", + request={}, + ) + + @parametrize + def test_method_invoke_sync(self, client: Runloop) -> None: + function = client.functions.invoke_sync( + "string", + project_name="string", + request={}, + ) + assert_matches_type(FunctionInvocationDetail, function, path=["response"]) + + @parametrize + def test_method_invoke_sync_with_all_params(self, client: Runloop) -> None: + function = client.functions.invoke_sync( + "string", + project_name="string", + request={}, + runloop_meta={"session_id": "string"}, + ) + assert_matches_type(FunctionInvocationDetail, function, path=["response"]) + + @parametrize + def test_raw_response_invoke_sync(self, client: Runloop) -> None: + response = client.functions.with_raw_response.invoke_sync( + "string", + project_name="string", + request={}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + function = response.parse() + assert_matches_type(FunctionInvocationDetail, function, path=["response"]) + + @parametrize + def test_streaming_response_invoke_sync(self, client: Runloop) -> None: + with client.functions.with_streaming_response.invoke_sync( + "string", + project_name="string", + request={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + function = response.parse() + assert_matches_type(FunctionInvocationDetail, function, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_invoke_sync(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): + client.functions.with_raw_response.invoke_sync( + "string", + project_name="", + request={}, + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): + client.functions.with_raw_response.invoke_sync( + "", + project_name="string", + request={}, + ) + + +class TestAsyncFunctions: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + function = await async_client.functions.list() + assert_matches_type(FunctionList, function, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.functions.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + function = await response.parse() + assert_matches_type(FunctionList, function, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.functions.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + function = await response.parse() + assert_matches_type(FunctionList, function, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_invoke_async(self, async_client: AsyncRunloop) -> None: + function = await async_client.functions.invoke_async( + "string", + project_name="string", + request={}, + ) + assert_matches_type(FunctionInvocationDetail, function, path=["response"]) + + @parametrize + async def test_method_invoke_async_with_all_params(self, async_client: AsyncRunloop) -> None: + function = await async_client.functions.invoke_async( + "string", + project_name="string", + request={}, + runloop_meta={"session_id": "string"}, + ) + assert_matches_type(FunctionInvocationDetail, function, path=["response"]) + + @parametrize + async def test_raw_response_invoke_async(self, async_client: AsyncRunloop) -> None: + response = await async_client.functions.with_raw_response.invoke_async( + "string", + project_name="string", + request={}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + function = await response.parse() + assert_matches_type(FunctionInvocationDetail, function, path=["response"]) + + @parametrize + async def test_streaming_response_invoke_async(self, async_client: AsyncRunloop) -> None: + async with async_client.functions.with_streaming_response.invoke_async( + "string", + project_name="string", + request={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + function = await response.parse() + assert_matches_type(FunctionInvocationDetail, function, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_invoke_async(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): + await async_client.functions.with_raw_response.invoke_async( + "string", + project_name="", + request={}, + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): + await async_client.functions.with_raw_response.invoke_async( + "", + project_name="string", + request={}, + ) + + @parametrize + async def test_method_invoke_sync(self, async_client: AsyncRunloop) -> None: + function = await async_client.functions.invoke_sync( + "string", + project_name="string", + request={}, + ) + assert_matches_type(FunctionInvocationDetail, function, path=["response"]) + + @parametrize + async def test_method_invoke_sync_with_all_params(self, async_client: AsyncRunloop) -> None: + function = await async_client.functions.invoke_sync( + "string", + project_name="string", + request={}, + runloop_meta={"session_id": "string"}, + ) + assert_matches_type(FunctionInvocationDetail, function, path=["response"]) + + @parametrize + async def test_raw_response_invoke_sync(self, async_client: AsyncRunloop) -> None: + response = await async_client.functions.with_raw_response.invoke_sync( + "string", + project_name="string", + request={}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + function = await response.parse() + assert_matches_type(FunctionInvocationDetail, function, path=["response"]) + + @parametrize + async def test_streaming_response_invoke_sync(self, async_client: AsyncRunloop) -> None: + async with async_client.functions.with_streaming_response.invoke_sync( + "string", + project_name="string", + request={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + function = await response.parse() + assert_matches_type(FunctionInvocationDetail, function, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_invoke_sync(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): + await async_client.functions.with_raw_response.invoke_sync( + "string", + project_name="", + request={}, + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): + await async_client.functions.with_raw_response.invoke_sync( + "", + project_name="string", + request={}, + ) diff --git a/tests/api_resources/test_latches.py b/tests/api_resources/test_latches.py new file mode 100644 index 000000000..5ffb8e448 --- /dev/null +++ b/tests/api_resources/test_latches.py @@ -0,0 +1,105 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from runloop import Runloop, AsyncRunloop +from tests.utils import assert_matches_type + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLatches: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_fulfill(self, client: Runloop) -> None: + latch = client.latches.fulfill( + "string", + result={}, + ) + assert_matches_type(object, latch, path=["response"]) + + @parametrize + def test_raw_response_fulfill(self, client: Runloop) -> None: + response = client.latches.with_raw_response.fulfill( + "string", + result={}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + latch = response.parse() + assert_matches_type(object, latch, path=["response"]) + + @parametrize + def test_streaming_response_fulfill(self, client: Runloop) -> None: + with client.latches.with_streaming_response.fulfill( + "string", + result={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + latch = response.parse() + assert_matches_type(object, latch, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_fulfill(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `latch_id` but received ''"): + client.latches.with_raw_response.fulfill( + "", + result={}, + ) + + +class TestAsyncLatches: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_fulfill(self, async_client: AsyncRunloop) -> None: + latch = await async_client.latches.fulfill( + "string", + result={}, + ) + assert_matches_type(object, latch, path=["response"]) + + @parametrize + async def test_raw_response_fulfill(self, async_client: AsyncRunloop) -> None: + response = await async_client.latches.with_raw_response.fulfill( + "string", + result={}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + latch = await response.parse() + assert_matches_type(object, latch, path=["response"]) + + @parametrize + async def test_streaming_response_fulfill(self, async_client: AsyncRunloop) -> None: + async with async_client.latches.with_streaming_response.fulfill( + "string", + result={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + latch = await response.parse() + assert_matches_type(object, latch, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_fulfill(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `latch_id` but received ''"): + await async_client.latches.with_raw_response.fulfill( + "", + result={}, + ) diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py new file mode 100644 index 000000000..56b1b8207 --- /dev/null +++ b/tests/api_resources/test_projects.py @@ -0,0 +1,72 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from runloop import Runloop, AsyncRunloop +from tests.utils import assert_matches_type +from runloop.types import ProjectList + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestProjects: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + project = client.projects.list() + assert_matches_type(ProjectList, project, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.projects.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = response.parse() + assert_matches_type(ProjectList, project, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.projects.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = response.parse() + assert_matches_type(ProjectList, project, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncProjects: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + project = await async_client.projects.list() + assert_matches_type(ProjectList, project, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.projects.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + project = await response.parse() + assert_matches_type(ProjectList, project, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.projects.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + project = await response.parse() + assert_matches_type(ProjectList, project, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 000000000..01056a2f5 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,49 @@ +from __future__ import annotations + +import os +import asyncio +import logging +from typing import TYPE_CHECKING, Iterator, AsyncIterator + +import pytest + +from runloop import Runloop, AsyncRunloop + +if TYPE_CHECKING: + from _pytest.fixtures import FixtureRequest + +pytest.register_assert_rewrite("tests.utils") + +logging.getLogger("runloop").setLevel(logging.DEBUG) + + +@pytest.fixture(scope="session") +def event_loop() -> Iterator[asyncio.AbstractEventLoop]: + loop = asyncio.new_event_loop() + yield loop + loop.close() + + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + +bearer_token = "My Bearer Token" + + +@pytest.fixture(scope="session") +def client(request: FixtureRequest) -> Iterator[Runloop]: + strict = getattr(request, "param", True) + if not isinstance(strict, bool): + raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") + + with Runloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=strict) as client: + yield client + + +@pytest.fixture(scope="session") +async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncRunloop]: + strict = getattr(request, "param", True) + if not isinstance(strict, bool): + raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") + + async with AsyncRunloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=strict) as client: + yield client diff --git a/tests/sample_file.txt b/tests/sample_file.txt new file mode 100644 index 000000000..af5626b4a --- /dev/null +++ b/tests/sample_file.txt @@ -0,0 +1 @@ +Hello, world! diff --git a/tests/test_client.py b/tests/test_client.py new file mode 100644 index 000000000..acdfcab02 --- /dev/null +++ b/tests/test_client.py @@ -0,0 +1,1475 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import gc +import os +import json +import asyncio +import inspect +import tracemalloc +from typing import Any, Union, cast +from unittest import mock + +import httpx +import pytest +from respx import MockRouter +from pydantic import ValidationError + +from runloop import Runloop, AsyncRunloop, APIResponseValidationError +from runloop._models import BaseModel, FinalRequestOptions +from runloop._constants import RAW_RESPONSE_HEADER +from runloop._exceptions import RunloopError, APIStatusError, APITimeoutError, APIResponseValidationError +from runloop._base_client import ( + DEFAULT_TIMEOUT, + HTTPX_DEFAULT_TIMEOUT, + BaseClient, + make_request_options, +) + +from .utils import update_env + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") +bearer_token = "My Bearer Token" + + +def _get_params(client: BaseClient[Any, Any]) -> dict[str, str]: + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + url = httpx.URL(request.url) + return dict(url.params) + + +def _low_retry_timeout(*_args: Any, **_kwargs: Any) -> float: + return 0.1 + + +def _get_open_connections(client: Runloop | AsyncRunloop) -> int: + transport = client._client._transport + assert isinstance(transport, httpx.HTTPTransport) or isinstance(transport, httpx.AsyncHTTPTransport) + + pool = transport._pool + return len(pool._requests) + + +class TestRunloop: + client = Runloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + + @pytest.mark.respx(base_url=base_url) + def test_raw_response(self, respx_mock: MockRouter) -> None: + respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + + response = self.client.post("/foo", cast_to=httpx.Response) + assert response.status_code == 200 + assert isinstance(response, httpx.Response) + assert response.json() == {"foo": "bar"} + + @pytest.mark.respx(base_url=base_url) + def test_raw_response_for_binary(self, respx_mock: MockRouter) -> None: + respx_mock.post("/foo").mock( + return_value=httpx.Response(200, headers={"Content-Type": "application/binary"}, content='{"foo": "bar"}') + ) + + response = self.client.post("/foo", cast_to=httpx.Response) + assert response.status_code == 200 + assert isinstance(response, httpx.Response) + assert response.json() == {"foo": "bar"} + + def test_copy(self) -> None: + copied = self.client.copy() + assert id(copied) != id(self.client) + + copied = self.client.copy(bearer_token="another My Bearer Token") + assert copied.bearer_token == "another My Bearer Token" + assert self.client.bearer_token == "My Bearer Token" + + def test_copy_default_options(self) -> None: + # options that have a default are overridden correctly + copied = self.client.copy(max_retries=7) + assert copied.max_retries == 7 + assert self.client.max_retries == 2 + + copied2 = copied.copy(max_retries=6) + assert copied2.max_retries == 6 + assert copied.max_retries == 7 + + # timeout + assert isinstance(self.client.timeout, httpx.Timeout) + copied = self.client.copy(timeout=None) + assert copied.timeout is None + assert isinstance(self.client.timeout, httpx.Timeout) + + def test_copy_default_headers(self) -> None: + client = Runloop( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + default_headers={"X-Foo": "bar"}, + ) + assert client.default_headers["X-Foo"] == "bar" + + # does not override the already given value when not specified + copied = client.copy() + assert copied.default_headers["X-Foo"] == "bar" + + # merges already given headers + copied = client.copy(default_headers={"X-Bar": "stainless"}) + assert copied.default_headers["X-Foo"] == "bar" + assert copied.default_headers["X-Bar"] == "stainless" + + # uses new values for any already given headers + copied = client.copy(default_headers={"X-Foo": "stainless"}) + assert copied.default_headers["X-Foo"] == "stainless" + + # set_default_headers + + # completely overrides already set values + copied = client.copy(set_default_headers={}) + assert copied.default_headers.get("X-Foo") is None + + copied = client.copy(set_default_headers={"X-Bar": "Robert"}) + assert copied.default_headers["X-Bar"] == "Robert" + + with pytest.raises( + ValueError, + match="`default_headers` and `set_default_headers` arguments are mutually exclusive", + ): + client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"}) + + def test_copy_default_query(self) -> None: + client = Runloop( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, default_query={"foo": "bar"} + ) + assert _get_params(client)["foo"] == "bar" + + # does not override the already given value when not specified + copied = client.copy() + assert _get_params(copied)["foo"] == "bar" + + # merges already given params + copied = client.copy(default_query={"bar": "stainless"}) + params = _get_params(copied) + assert params["foo"] == "bar" + assert params["bar"] == "stainless" + + # uses new values for any already given headers + copied = client.copy(default_query={"foo": "stainless"}) + assert _get_params(copied)["foo"] == "stainless" + + # set_default_query + + # completely overrides already set values + copied = client.copy(set_default_query={}) + assert _get_params(copied) == {} + + copied = client.copy(set_default_query={"bar": "Robert"}) + assert _get_params(copied)["bar"] == "Robert" + + with pytest.raises( + ValueError, + # TODO: update + match="`default_query` and `set_default_query` arguments are mutually exclusive", + ): + client.copy(set_default_query={}, default_query={"foo": "Bar"}) + + def test_copy_signature(self) -> None: + # ensure the same parameters that can be passed to the client are defined in the `.copy()` method + init_signature = inspect.signature( + # mypy doesn't like that we access the `__init__` property. + self.client.__init__, # type: ignore[misc] + ) + copy_signature = inspect.signature(self.client.copy) + exclude_params = {"transport", "proxies", "_strict_response_validation"} + + for name in init_signature.parameters.keys(): + if name in exclude_params: + continue + + copy_param = copy_signature.parameters.get(name) + assert copy_param is not None, f"copy() signature is missing the {name} param" + + def test_copy_build_request(self) -> None: + options = FinalRequestOptions(method="get", url="/foo") + + def build_request(options: FinalRequestOptions) -> None: + client = self.client.copy() + client._build_request(options) + + # ensure that the machinery is warmed up before tracing starts. + build_request(options) + gc.collect() + + tracemalloc.start(1000) + + snapshot_before = tracemalloc.take_snapshot() + + ITERATIONS = 10 + for _ in range(ITERATIONS): + build_request(options) + + gc.collect() + snapshot_after = tracemalloc.take_snapshot() + + tracemalloc.stop() + + def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.StatisticDiff) -> None: + if diff.count == 0: + # Avoid false positives by considering only leaks (i.e. allocations that persist). + return + + if diff.count % ITERATIONS != 0: + # Avoid false positives by considering only leaks that appear per iteration. + return + + for frame in diff.traceback: + if any( + frame.filename.endswith(fragment) + for fragment in [ + # to_raw_response_wrapper leaks through the @functools.wraps() decorator. + # + # removing the decorator fixes the leak for reasons we don't understand. + "runloop/_legacy_response.py", + "runloop/_response.py", + # pydantic.BaseModel.model_dump || pydantic.BaseModel.dict leak memory for some reason. + "runloop/_compat.py", + # Standard library leaks we don't care about. + "/logging/__init__.py", + ] + ): + return + + leaks.append(diff) + + leaks: list[tracemalloc.StatisticDiff] = [] + for diff in snapshot_after.compare_to(snapshot_before, "traceback"): + add_leak(leaks, diff) + if leaks: + for leak in leaks: + print("MEMORY LEAK:", leak) + for frame in leak.traceback: + print(frame) + raise AssertionError() + + def test_request_timeout(self) -> None: + request = self.client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == DEFAULT_TIMEOUT + + request = self.client._build_request( + FinalRequestOptions(method="get", url="/foo", timeout=httpx.Timeout(100.0)) + ) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == httpx.Timeout(100.0) + + def test_client_timeout_option(self) -> None: + client = Runloop( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, timeout=httpx.Timeout(0) + ) + + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == httpx.Timeout(0) + + def test_http_client_timeout_option(self) -> None: + # custom timeout given to the httpx client should be used + with httpx.Client(timeout=None) as http_client: + client = Runloop( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client + ) + + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == httpx.Timeout(None) + + # no timeout given to the httpx client should not use the httpx default + with httpx.Client() as http_client: + client = Runloop( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client + ) + + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == DEFAULT_TIMEOUT + + # explicitly passing the default timeout currently results in it being ignored + with httpx.Client(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: + client = Runloop( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client + ) + + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == DEFAULT_TIMEOUT # our default + + async def test_invalid_http_client(self) -> None: + with pytest.raises(TypeError, match="Invalid `http_client` arg"): + async with httpx.AsyncClient() as http_client: + Runloop( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + http_client=cast(Any, http_client), + ) + + def test_default_headers_option(self) -> None: + client = Runloop( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + default_headers={"X-Foo": "bar"}, + ) + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + assert request.headers.get("x-foo") == "bar" + assert request.headers.get("x-stainless-lang") == "python" + + client2 = Runloop( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + default_headers={ + "X-Foo": "stainless", + "X-Stainless-Lang": "my-overriding-header", + }, + ) + request = client2._build_request(FinalRequestOptions(method="get", url="/foo")) + assert request.headers.get("x-foo") == "stainless" + assert request.headers.get("x-stainless-lang") == "my-overriding-header" + + def test_validate_headers(self) -> None: + client = Runloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + assert request.headers.get("Authorization") == f"Bearer {bearer_token}" + + with pytest.raises(RunloopError): + client2 = Runloop(base_url=base_url, bearer_token=None, _strict_response_validation=True) + _ = client2 + + def test_default_query_option(self) -> None: + client = Runloop( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + default_query={"query_param": "bar"}, + ) + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + url = httpx.URL(request.url) + assert dict(url.params) == {"query_param": "bar"} + + request = client._build_request( + FinalRequestOptions( + method="get", + url="/foo", + params={"foo": "baz", "query_param": "overriden"}, + ) + ) + url = httpx.URL(request.url) + assert dict(url.params) == {"foo": "baz", "query_param": "overriden"} + + def test_request_extra_json(self) -> None: + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + json_data={"foo": "bar"}, + extra_json={"baz": False}, + ), + ) + data = json.loads(request.content.decode("utf-8")) + assert data == {"foo": "bar", "baz": False} + + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + extra_json={"baz": False}, + ), + ) + data = json.loads(request.content.decode("utf-8")) + assert data == {"baz": False} + + # `extra_json` takes priority over `json_data` when keys clash + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + json_data={"foo": "bar", "baz": True}, + extra_json={"baz": None}, + ), + ) + data = json.loads(request.content.decode("utf-8")) + assert data == {"foo": "bar", "baz": None} + + def test_request_extra_headers(self) -> None: + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + **make_request_options(extra_headers={"X-Foo": "Foo"}), + ), + ) + assert request.headers.get("X-Foo") == "Foo" + + # `extra_headers` takes priority over `default_headers` when keys clash + request = self.client.with_options(default_headers={"X-Bar": "true"})._build_request( + FinalRequestOptions( + method="post", + url="/foo", + **make_request_options( + extra_headers={"X-Bar": "false"}, + ), + ), + ) + assert request.headers.get("X-Bar") == "false" + + def test_request_extra_query(self) -> None: + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + **make_request_options( + extra_query={"my_query_param": "Foo"}, + ), + ), + ) + params = dict(request.url.params) + assert params == {"my_query_param": "Foo"} + + # if both `query` and `extra_query` are given, they are merged + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + **make_request_options( + query={"bar": "1"}, + extra_query={"foo": "2"}, + ), + ), + ) + params = dict(request.url.params) + assert params == {"bar": "1", "foo": "2"} + + # `extra_query` takes priority over `query` when keys clash + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + **make_request_options( + query={"foo": "1"}, + extra_query={"foo": "2"}, + ), + ), + ) + params = dict(request.url.params) + assert params == {"foo": "2"} + + def test_multipart_repeating_array(self, client: Runloop) -> None: + request = client._build_request( + FinalRequestOptions.construct( + method="get", + url="/foo", + headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"}, + json_data={"array": ["foo", "bar"]}, + files=[("foo.txt", b"hello world")], + ) + ) + + assert request.read().split(b"\r\n") == [ + b"--6b7ba517decee4a450543ea6ae821c82", + b'Content-Disposition: form-data; name="array[]"', + b"", + b"foo", + b"--6b7ba517decee4a450543ea6ae821c82", + b'Content-Disposition: form-data; name="array[]"', + b"", + b"bar", + b"--6b7ba517decee4a450543ea6ae821c82", + b'Content-Disposition: form-data; name="foo.txt"; filename="upload"', + b"Content-Type: application/octet-stream", + b"", + b"hello world", + b"--6b7ba517decee4a450543ea6ae821c82--", + b"", + ] + + @pytest.mark.respx(base_url=base_url) + def test_basic_union_response(self, respx_mock: MockRouter) -> None: + class Model1(BaseModel): + name: str + + class Model2(BaseModel): + foo: str + + respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + + response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + assert isinstance(response, Model2) + assert response.foo == "bar" + + @pytest.mark.respx(base_url=base_url) + def test_union_response_different_types(self, respx_mock: MockRouter) -> None: + """Union of objects with the same field name using a different type""" + + class Model1(BaseModel): + foo: int + + class Model2(BaseModel): + foo: str + + respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + + response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + assert isinstance(response, Model2) + assert response.foo == "bar" + + respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": 1})) + + response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + assert isinstance(response, Model1) + assert response.foo == 1 + + @pytest.mark.respx(base_url=base_url) + def test_non_application_json_content_type_for_json_data(self, respx_mock: MockRouter) -> None: + """ + Response that sets Content-Type to something other than application/json but returns json data + """ + + class Model(BaseModel): + foo: int + + respx_mock.get("/foo").mock( + return_value=httpx.Response( + 200, + content=json.dumps({"foo": 2}), + headers={"Content-Type": "application/text"}, + ) + ) + + response = self.client.get("/foo", cast_to=Model) + assert isinstance(response, Model) + assert response.foo == 2 + + def test_base_url_setter(self) -> None: + client = Runloop( + base_url="https://example.com/from_init", bearer_token=bearer_token, _strict_response_validation=True + ) + assert client.base_url == "https://example.com/from_init/" + + client.base_url = "https://example.com/from_setter" # type: ignore[assignment] + + assert client.base_url == "https://example.com/from_setter/" + + def test_base_url_env(self) -> None: + with update_env(RUNLOOP_BASE_URL="http://localhost:5000/from/env"): + client = Runloop(bearer_token=bearer_token, _strict_response_validation=True) + assert client.base_url == "http://localhost:5000/from/env/" + + @pytest.mark.parametrize( + "client", + [ + Runloop( + base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, + _strict_response_validation=True, + ), + Runloop( + base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, + _strict_response_validation=True, + http_client=httpx.Client(), + ), + ], + ids=["standard", "custom http client"], + ) + def test_base_url_trailing_slash(self, client: Runloop) -> None: + request = client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + json_data={"foo": "bar"}, + ), + ) + assert request.url == "http://localhost:5000/custom/path/foo" + + @pytest.mark.parametrize( + "client", + [ + Runloop( + base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, + _strict_response_validation=True, + ), + Runloop( + base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, + _strict_response_validation=True, + http_client=httpx.Client(), + ), + ], + ids=["standard", "custom http client"], + ) + def test_base_url_no_trailing_slash(self, client: Runloop) -> None: + request = client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + json_data={"foo": "bar"}, + ), + ) + assert request.url == "http://localhost:5000/custom/path/foo" + + @pytest.mark.parametrize( + "client", + [ + Runloop( + base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, + _strict_response_validation=True, + ), + Runloop( + base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, + _strict_response_validation=True, + http_client=httpx.Client(), + ), + ], + ids=["standard", "custom http client"], + ) + def test_absolute_request_url(self, client: Runloop) -> None: + request = client._build_request( + FinalRequestOptions( + method="post", + url="https://myapi.com/foo", + json_data={"foo": "bar"}, + ), + ) + assert request.url == "https://myapi.com/foo" + + def test_copied_client_does_not_close_http(self) -> None: + client = Runloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + assert not client.is_closed() + + copied = client.copy() + assert copied is not client + + del copied + + assert not client.is_closed() + + def test_client_context_manager(self) -> None: + client = Runloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + with client as c2: + assert c2 is client + assert not c2.is_closed() + assert not client.is_closed() + assert client.is_closed() + + @pytest.mark.respx(base_url=base_url) + def test_client_response_validation_error(self, respx_mock: MockRouter) -> None: + class Model(BaseModel): + foo: str + + respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": {"invalid": True}})) + + with pytest.raises(APIResponseValidationError) as exc: + self.client.get("/foo", cast_to=Model) + + assert isinstance(exc.value.__cause__, ValidationError) + + def test_client_max_retries_validation(self) -> None: + with pytest.raises(TypeError, match=r"max_retries cannot be None"): + Runloop( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + max_retries=cast(Any, None), + ) + + @pytest.mark.respx(base_url=base_url) + def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None: + class Model(BaseModel): + name: str + + respx_mock.get("/foo").mock(return_value=httpx.Response(200, text="my-custom-format")) + + strict_client = Runloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + + with pytest.raises(APIResponseValidationError): + strict_client.get("/foo", cast_to=Model) + + client = Runloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=False) + + response = client.get("/foo", cast_to=Model) + assert isinstance(response, str) # type: ignore[unreachable] + + @pytest.mark.parametrize( + "remaining_retries,retry_after,timeout", + [ + [3, "20", 20], + [3, "0", 0.5], + [3, "-10", 0.5], + [3, "60", 60], + [3, "61", 0.5], + [3, "Fri, 29 Sep 2023 16:26:57 GMT", 20], + [3, "Fri, 29 Sep 2023 16:26:37 GMT", 0.5], + [3, "Fri, 29 Sep 2023 16:26:27 GMT", 0.5], + [3, "Fri, 29 Sep 2023 16:27:37 GMT", 60], + [3, "Fri, 29 Sep 2023 16:27:38 GMT", 0.5], + [3, "99999999999999999999999999999999999", 0.5], + [3, "Zun, 29 Sep 2023 16:26:27 GMT", 0.5], + [3, "", 0.5], + [2, "", 0.5 * 2.0], + [1, "", 0.5 * 4.0], + ], + ) + @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) + def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: + client = Runloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + + headers = httpx.Headers({"retry-after": retry_after}) + options = FinalRequestOptions(method="get", url="/foo", max_retries=3) + calculated = client._calculate_retry_timeout(remaining_retries, options, headers) + assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] + + @mock.patch("runloop._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @pytest.mark.respx(base_url=base_url) + def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + respx_mock.post("/v1/code_handles").mock(side_effect=httpx.TimeoutException("Test timeout error")) + + with pytest.raises(APITimeoutError): + self.client.post( + "/v1/code_handles", + body=cast(object, dict()), + cast_to=httpx.Response, + options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, + ) + + assert _get_open_connections(self.client) == 0 + + @mock.patch("runloop._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @pytest.mark.respx(base_url=base_url) + def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + respx_mock.post("/v1/code_handles").mock(return_value=httpx.Response(500)) + + with pytest.raises(APIStatusError): + self.client.post( + "/v1/code_handles", + body=cast(object, dict()), + cast_to=httpx.Response, + options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, + ) + + assert _get_open_connections(self.client) == 0 + + +class TestAsyncRunloop: + client = AsyncRunloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + + @pytest.mark.respx(base_url=base_url) + @pytest.mark.asyncio + async def test_raw_response(self, respx_mock: MockRouter) -> None: + respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + + response = await self.client.post("/foo", cast_to=httpx.Response) + assert response.status_code == 200 + assert isinstance(response, httpx.Response) + assert response.json() == {"foo": "bar"} + + @pytest.mark.respx(base_url=base_url) + @pytest.mark.asyncio + async def test_raw_response_for_binary(self, respx_mock: MockRouter) -> None: + respx_mock.post("/foo").mock( + return_value=httpx.Response(200, headers={"Content-Type": "application/binary"}, content='{"foo": "bar"}') + ) + + response = await self.client.post("/foo", cast_to=httpx.Response) + assert response.status_code == 200 + assert isinstance(response, httpx.Response) + assert response.json() == {"foo": "bar"} + + def test_copy(self) -> None: + copied = self.client.copy() + assert id(copied) != id(self.client) + + copied = self.client.copy(bearer_token="another My Bearer Token") + assert copied.bearer_token == "another My Bearer Token" + assert self.client.bearer_token == "My Bearer Token" + + def test_copy_default_options(self) -> None: + # options that have a default are overridden correctly + copied = self.client.copy(max_retries=7) + assert copied.max_retries == 7 + assert self.client.max_retries == 2 + + copied2 = copied.copy(max_retries=6) + assert copied2.max_retries == 6 + assert copied.max_retries == 7 + + # timeout + assert isinstance(self.client.timeout, httpx.Timeout) + copied = self.client.copy(timeout=None) + assert copied.timeout is None + assert isinstance(self.client.timeout, httpx.Timeout) + + def test_copy_default_headers(self) -> None: + client = AsyncRunloop( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + default_headers={"X-Foo": "bar"}, + ) + assert client.default_headers["X-Foo"] == "bar" + + # does not override the already given value when not specified + copied = client.copy() + assert copied.default_headers["X-Foo"] == "bar" + + # merges already given headers + copied = client.copy(default_headers={"X-Bar": "stainless"}) + assert copied.default_headers["X-Foo"] == "bar" + assert copied.default_headers["X-Bar"] == "stainless" + + # uses new values for any already given headers + copied = client.copy(default_headers={"X-Foo": "stainless"}) + assert copied.default_headers["X-Foo"] == "stainless" + + # set_default_headers + + # completely overrides already set values + copied = client.copy(set_default_headers={}) + assert copied.default_headers.get("X-Foo") is None + + copied = client.copy(set_default_headers={"X-Bar": "Robert"}) + assert copied.default_headers["X-Bar"] == "Robert" + + with pytest.raises( + ValueError, + match="`default_headers` and `set_default_headers` arguments are mutually exclusive", + ): + client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"}) + + def test_copy_default_query(self) -> None: + client = AsyncRunloop( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, default_query={"foo": "bar"} + ) + assert _get_params(client)["foo"] == "bar" + + # does not override the already given value when not specified + copied = client.copy() + assert _get_params(copied)["foo"] == "bar" + + # merges already given params + copied = client.copy(default_query={"bar": "stainless"}) + params = _get_params(copied) + assert params["foo"] == "bar" + assert params["bar"] == "stainless" + + # uses new values for any already given headers + copied = client.copy(default_query={"foo": "stainless"}) + assert _get_params(copied)["foo"] == "stainless" + + # set_default_query + + # completely overrides already set values + copied = client.copy(set_default_query={}) + assert _get_params(copied) == {} + + copied = client.copy(set_default_query={"bar": "Robert"}) + assert _get_params(copied)["bar"] == "Robert" + + with pytest.raises( + ValueError, + # TODO: update + match="`default_query` and `set_default_query` arguments are mutually exclusive", + ): + client.copy(set_default_query={}, default_query={"foo": "Bar"}) + + def test_copy_signature(self) -> None: + # ensure the same parameters that can be passed to the client are defined in the `.copy()` method + init_signature = inspect.signature( + # mypy doesn't like that we access the `__init__` property. + self.client.__init__, # type: ignore[misc] + ) + copy_signature = inspect.signature(self.client.copy) + exclude_params = {"transport", "proxies", "_strict_response_validation"} + + for name in init_signature.parameters.keys(): + if name in exclude_params: + continue + + copy_param = copy_signature.parameters.get(name) + assert copy_param is not None, f"copy() signature is missing the {name} param" + + def test_copy_build_request(self) -> None: + options = FinalRequestOptions(method="get", url="/foo") + + def build_request(options: FinalRequestOptions) -> None: + client = self.client.copy() + client._build_request(options) + + # ensure that the machinery is warmed up before tracing starts. + build_request(options) + gc.collect() + + tracemalloc.start(1000) + + snapshot_before = tracemalloc.take_snapshot() + + ITERATIONS = 10 + for _ in range(ITERATIONS): + build_request(options) + + gc.collect() + snapshot_after = tracemalloc.take_snapshot() + + tracemalloc.stop() + + def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.StatisticDiff) -> None: + if diff.count == 0: + # Avoid false positives by considering only leaks (i.e. allocations that persist). + return + + if diff.count % ITERATIONS != 0: + # Avoid false positives by considering only leaks that appear per iteration. + return + + for frame in diff.traceback: + if any( + frame.filename.endswith(fragment) + for fragment in [ + # to_raw_response_wrapper leaks through the @functools.wraps() decorator. + # + # removing the decorator fixes the leak for reasons we don't understand. + "runloop/_legacy_response.py", + "runloop/_response.py", + # pydantic.BaseModel.model_dump || pydantic.BaseModel.dict leak memory for some reason. + "runloop/_compat.py", + # Standard library leaks we don't care about. + "/logging/__init__.py", + ] + ): + return + + leaks.append(diff) + + leaks: list[tracemalloc.StatisticDiff] = [] + for diff in snapshot_after.compare_to(snapshot_before, "traceback"): + add_leak(leaks, diff) + if leaks: + for leak in leaks: + print("MEMORY LEAK:", leak) + for frame in leak.traceback: + print(frame) + raise AssertionError() + + async def test_request_timeout(self) -> None: + request = self.client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == DEFAULT_TIMEOUT + + request = self.client._build_request( + FinalRequestOptions(method="get", url="/foo", timeout=httpx.Timeout(100.0)) + ) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == httpx.Timeout(100.0) + + async def test_client_timeout_option(self) -> None: + client = AsyncRunloop( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, timeout=httpx.Timeout(0) + ) + + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == httpx.Timeout(0) + + async def test_http_client_timeout_option(self) -> None: + # custom timeout given to the httpx client should be used + async with httpx.AsyncClient(timeout=None) as http_client: + client = AsyncRunloop( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client + ) + + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == httpx.Timeout(None) + + # no timeout given to the httpx client should not use the httpx default + async with httpx.AsyncClient() as http_client: + client = AsyncRunloop( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client + ) + + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == DEFAULT_TIMEOUT + + # explicitly passing the default timeout currently results in it being ignored + async with httpx.AsyncClient(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: + client = AsyncRunloop( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, http_client=http_client + ) + + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore + assert timeout == DEFAULT_TIMEOUT # our default + + def test_invalid_http_client(self) -> None: + with pytest.raises(TypeError, match="Invalid `http_client` arg"): + with httpx.Client() as http_client: + AsyncRunloop( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + http_client=cast(Any, http_client), + ) + + def test_default_headers_option(self) -> None: + client = AsyncRunloop( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + default_headers={"X-Foo": "bar"}, + ) + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + assert request.headers.get("x-foo") == "bar" + assert request.headers.get("x-stainless-lang") == "python" + + client2 = AsyncRunloop( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + default_headers={ + "X-Foo": "stainless", + "X-Stainless-Lang": "my-overriding-header", + }, + ) + request = client2._build_request(FinalRequestOptions(method="get", url="/foo")) + assert request.headers.get("x-foo") == "stainless" + assert request.headers.get("x-stainless-lang") == "my-overriding-header" + + def test_validate_headers(self) -> None: + client = AsyncRunloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + assert request.headers.get("Authorization") == f"Bearer {bearer_token}" + + with pytest.raises(RunloopError): + client2 = AsyncRunloop(base_url=base_url, bearer_token=None, _strict_response_validation=True) + _ = client2 + + def test_default_query_option(self) -> None: + client = AsyncRunloop( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + default_query={"query_param": "bar"}, + ) + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + url = httpx.URL(request.url) + assert dict(url.params) == {"query_param": "bar"} + + request = client._build_request( + FinalRequestOptions( + method="get", + url="/foo", + params={"foo": "baz", "query_param": "overriden"}, + ) + ) + url = httpx.URL(request.url) + assert dict(url.params) == {"foo": "baz", "query_param": "overriden"} + + def test_request_extra_json(self) -> None: + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + json_data={"foo": "bar"}, + extra_json={"baz": False}, + ), + ) + data = json.loads(request.content.decode("utf-8")) + assert data == {"foo": "bar", "baz": False} + + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + extra_json={"baz": False}, + ), + ) + data = json.loads(request.content.decode("utf-8")) + assert data == {"baz": False} + + # `extra_json` takes priority over `json_data` when keys clash + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + json_data={"foo": "bar", "baz": True}, + extra_json={"baz": None}, + ), + ) + data = json.loads(request.content.decode("utf-8")) + assert data == {"foo": "bar", "baz": None} + + def test_request_extra_headers(self) -> None: + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + **make_request_options(extra_headers={"X-Foo": "Foo"}), + ), + ) + assert request.headers.get("X-Foo") == "Foo" + + # `extra_headers` takes priority over `default_headers` when keys clash + request = self.client.with_options(default_headers={"X-Bar": "true"})._build_request( + FinalRequestOptions( + method="post", + url="/foo", + **make_request_options( + extra_headers={"X-Bar": "false"}, + ), + ), + ) + assert request.headers.get("X-Bar") == "false" + + def test_request_extra_query(self) -> None: + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + **make_request_options( + extra_query={"my_query_param": "Foo"}, + ), + ), + ) + params = dict(request.url.params) + assert params == {"my_query_param": "Foo"} + + # if both `query` and `extra_query` are given, they are merged + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + **make_request_options( + query={"bar": "1"}, + extra_query={"foo": "2"}, + ), + ), + ) + params = dict(request.url.params) + assert params == {"bar": "1", "foo": "2"} + + # `extra_query` takes priority over `query` when keys clash + request = self.client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + **make_request_options( + query={"foo": "1"}, + extra_query={"foo": "2"}, + ), + ), + ) + params = dict(request.url.params) + assert params == {"foo": "2"} + + def test_multipart_repeating_array(self, async_client: AsyncRunloop) -> None: + request = async_client._build_request( + FinalRequestOptions.construct( + method="get", + url="/foo", + headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"}, + json_data={"array": ["foo", "bar"]}, + files=[("foo.txt", b"hello world")], + ) + ) + + assert request.read().split(b"\r\n") == [ + b"--6b7ba517decee4a450543ea6ae821c82", + b'Content-Disposition: form-data; name="array[]"', + b"", + b"foo", + b"--6b7ba517decee4a450543ea6ae821c82", + b'Content-Disposition: form-data; name="array[]"', + b"", + b"bar", + b"--6b7ba517decee4a450543ea6ae821c82", + b'Content-Disposition: form-data; name="foo.txt"; filename="upload"', + b"Content-Type: application/octet-stream", + b"", + b"hello world", + b"--6b7ba517decee4a450543ea6ae821c82--", + b"", + ] + + @pytest.mark.respx(base_url=base_url) + async def test_basic_union_response(self, respx_mock: MockRouter) -> None: + class Model1(BaseModel): + name: str + + class Model2(BaseModel): + foo: str + + respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + + response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + assert isinstance(response, Model2) + assert response.foo == "bar" + + @pytest.mark.respx(base_url=base_url) + async def test_union_response_different_types(self, respx_mock: MockRouter) -> None: + """Union of objects with the same field name using a different type""" + + class Model1(BaseModel): + foo: int + + class Model2(BaseModel): + foo: str + + respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + + response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + assert isinstance(response, Model2) + assert response.foo == "bar" + + respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": 1})) + + response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + assert isinstance(response, Model1) + assert response.foo == 1 + + @pytest.mark.respx(base_url=base_url) + async def test_non_application_json_content_type_for_json_data(self, respx_mock: MockRouter) -> None: + """ + Response that sets Content-Type to something other than application/json but returns json data + """ + + class Model(BaseModel): + foo: int + + respx_mock.get("/foo").mock( + return_value=httpx.Response( + 200, + content=json.dumps({"foo": 2}), + headers={"Content-Type": "application/text"}, + ) + ) + + response = await self.client.get("/foo", cast_to=Model) + assert isinstance(response, Model) + assert response.foo == 2 + + def test_base_url_setter(self) -> None: + client = AsyncRunloop( + base_url="https://example.com/from_init", bearer_token=bearer_token, _strict_response_validation=True + ) + assert client.base_url == "https://example.com/from_init/" + + client.base_url = "https://example.com/from_setter" # type: ignore[assignment] + + assert client.base_url == "https://example.com/from_setter/" + + def test_base_url_env(self) -> None: + with update_env(RUNLOOP_BASE_URL="http://localhost:5000/from/env"): + client = AsyncRunloop(bearer_token=bearer_token, _strict_response_validation=True) + assert client.base_url == "http://localhost:5000/from/env/" + + @pytest.mark.parametrize( + "client", + [ + AsyncRunloop( + base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, + _strict_response_validation=True, + ), + AsyncRunloop( + base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, + _strict_response_validation=True, + http_client=httpx.AsyncClient(), + ), + ], + ids=["standard", "custom http client"], + ) + def test_base_url_trailing_slash(self, client: AsyncRunloop) -> None: + request = client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + json_data={"foo": "bar"}, + ), + ) + assert request.url == "http://localhost:5000/custom/path/foo" + + @pytest.mark.parametrize( + "client", + [ + AsyncRunloop( + base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, + _strict_response_validation=True, + ), + AsyncRunloop( + base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, + _strict_response_validation=True, + http_client=httpx.AsyncClient(), + ), + ], + ids=["standard", "custom http client"], + ) + def test_base_url_no_trailing_slash(self, client: AsyncRunloop) -> None: + request = client._build_request( + FinalRequestOptions( + method="post", + url="/foo", + json_data={"foo": "bar"}, + ), + ) + assert request.url == "http://localhost:5000/custom/path/foo" + + @pytest.mark.parametrize( + "client", + [ + AsyncRunloop( + base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, + _strict_response_validation=True, + ), + AsyncRunloop( + base_url="http://localhost:5000/custom/path/", + bearer_token=bearer_token, + _strict_response_validation=True, + http_client=httpx.AsyncClient(), + ), + ], + ids=["standard", "custom http client"], + ) + def test_absolute_request_url(self, client: AsyncRunloop) -> None: + request = client._build_request( + FinalRequestOptions( + method="post", + url="https://myapi.com/foo", + json_data={"foo": "bar"}, + ), + ) + assert request.url == "https://myapi.com/foo" + + async def test_copied_client_does_not_close_http(self) -> None: + client = AsyncRunloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + assert not client.is_closed() + + copied = client.copy() + assert copied is not client + + del copied + + await asyncio.sleep(0.2) + assert not client.is_closed() + + async def test_client_context_manager(self) -> None: + client = AsyncRunloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + async with client as c2: + assert c2 is client + assert not c2.is_closed() + assert not client.is_closed() + assert client.is_closed() + + @pytest.mark.respx(base_url=base_url) + @pytest.mark.asyncio + async def test_client_response_validation_error(self, respx_mock: MockRouter) -> None: + class Model(BaseModel): + foo: str + + respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": {"invalid": True}})) + + with pytest.raises(APIResponseValidationError) as exc: + await self.client.get("/foo", cast_to=Model) + + assert isinstance(exc.value.__cause__, ValidationError) + + async def test_client_max_retries_validation(self) -> None: + with pytest.raises(TypeError, match=r"max_retries cannot be None"): + AsyncRunloop( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + max_retries=cast(Any, None), + ) + + @pytest.mark.respx(base_url=base_url) + @pytest.mark.asyncio + async def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None: + class Model(BaseModel): + name: str + + respx_mock.get("/foo").mock(return_value=httpx.Response(200, text="my-custom-format")) + + strict_client = AsyncRunloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + + with pytest.raises(APIResponseValidationError): + await strict_client.get("/foo", cast_to=Model) + + client = AsyncRunloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=False) + + response = await client.get("/foo", cast_to=Model) + assert isinstance(response, str) # type: ignore[unreachable] + + @pytest.mark.parametrize( + "remaining_retries,retry_after,timeout", + [ + [3, "20", 20], + [3, "0", 0.5], + [3, "-10", 0.5], + [3, "60", 60], + [3, "61", 0.5], + [3, "Fri, 29 Sep 2023 16:26:57 GMT", 20], + [3, "Fri, 29 Sep 2023 16:26:37 GMT", 0.5], + [3, "Fri, 29 Sep 2023 16:26:27 GMT", 0.5], + [3, "Fri, 29 Sep 2023 16:27:37 GMT", 60], + [3, "Fri, 29 Sep 2023 16:27:38 GMT", 0.5], + [3, "99999999999999999999999999999999999", 0.5], + [3, "Zun, 29 Sep 2023 16:26:27 GMT", 0.5], + [3, "", 0.5], + [2, "", 0.5 * 2.0], + [1, "", 0.5 * 4.0], + ], + ) + @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) + @pytest.mark.asyncio + async def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: + client = AsyncRunloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + + headers = httpx.Headers({"retry-after": retry_after}) + options = FinalRequestOptions(method="get", url="/foo", max_retries=3) + calculated = client._calculate_retry_timeout(remaining_retries, options, headers) + assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] + + @mock.patch("runloop._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @pytest.mark.respx(base_url=base_url) + async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + respx_mock.post("/v1/code_handles").mock(side_effect=httpx.TimeoutException("Test timeout error")) + + with pytest.raises(APITimeoutError): + await self.client.post( + "/v1/code_handles", + body=cast(object, dict()), + cast_to=httpx.Response, + options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, + ) + + assert _get_open_connections(self.client) == 0 + + @mock.patch("runloop._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @pytest.mark.respx(base_url=base_url) + async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + respx_mock.post("/v1/code_handles").mock(return_value=httpx.Response(500)) + + with pytest.raises(APIStatusError): + await self.client.post( + "/v1/code_handles", + body=cast(object, dict()), + cast_to=httpx.Response, + options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, + ) + + assert _get_open_connections(self.client) == 0 diff --git a/tests/test_deepcopy.py b/tests/test_deepcopy.py new file mode 100644 index 000000000..146c66b16 --- /dev/null +++ b/tests/test_deepcopy.py @@ -0,0 +1,59 @@ +from runloop._utils import deepcopy_minimal + + +def assert_different_identities(obj1: object, obj2: object) -> None: + assert obj1 == obj2 + assert id(obj1) != id(obj2) + + +def test_simple_dict() -> None: + obj1 = {"foo": "bar"} + obj2 = deepcopy_minimal(obj1) + assert_different_identities(obj1, obj2) + + +def test_nested_dict() -> None: + obj1 = {"foo": {"bar": True}} + obj2 = deepcopy_minimal(obj1) + assert_different_identities(obj1, obj2) + assert_different_identities(obj1["foo"], obj2["foo"]) + + +def test_complex_nested_dict() -> None: + obj1 = {"foo": {"bar": [{"hello": "world"}]}} + obj2 = deepcopy_minimal(obj1) + assert_different_identities(obj1, obj2) + assert_different_identities(obj1["foo"], obj2["foo"]) + assert_different_identities(obj1["foo"]["bar"], obj2["foo"]["bar"]) + assert_different_identities(obj1["foo"]["bar"][0], obj2["foo"]["bar"][0]) + + +def test_simple_list() -> None: + obj1 = ["a", "b", "c"] + obj2 = deepcopy_minimal(obj1) + assert_different_identities(obj1, obj2) + + +def test_nested_list() -> None: + obj1 = ["a", [1, 2, 3]] + obj2 = deepcopy_minimal(obj1) + assert_different_identities(obj1, obj2) + assert_different_identities(obj1[1], obj2[1]) + + +class MyObject: + ... + + +def test_ignores_other_types() -> None: + # custom classes + my_obj = MyObject() + obj1 = {"foo": my_obj} + obj2 = deepcopy_minimal(obj1) + assert_different_identities(obj1, obj2) + assert obj1["foo"] is my_obj + + # tuples + obj3 = ("a", "b") + obj4 = deepcopy_minimal(obj3) + assert obj3 is obj4 diff --git a/tests/test_extract_files.py b/tests/test_extract_files.py new file mode 100644 index 000000000..05b269f35 --- /dev/null +++ b/tests/test_extract_files.py @@ -0,0 +1,64 @@ +from __future__ import annotations + +from typing import Sequence + +import pytest + +from runloop._types import FileTypes +from runloop._utils import extract_files + + +def test_removes_files_from_input() -> None: + query = {"foo": "bar"} + assert extract_files(query, paths=[]) == [] + assert query == {"foo": "bar"} + + query2 = {"foo": b"Bar", "hello": "world"} + assert extract_files(query2, paths=[["foo"]]) == [("foo", b"Bar")] + assert query2 == {"hello": "world"} + + query3 = {"foo": {"foo": {"bar": b"Bar"}}, "hello": "world"} + assert extract_files(query3, paths=[["foo", "foo", "bar"]]) == [("foo[foo][bar]", b"Bar")] + assert query3 == {"foo": {"foo": {}}, "hello": "world"} + + query4 = {"foo": {"bar": b"Bar", "baz": "foo"}, "hello": "world"} + assert extract_files(query4, paths=[["foo", "bar"]]) == [("foo[bar]", b"Bar")] + assert query4 == {"hello": "world", "foo": {"baz": "foo"}} + + +def test_multiple_files() -> None: + query = {"documents": [{"file": b"My first file"}, {"file": b"My second file"}]} + assert extract_files(query, paths=[["documents", "", "file"]]) == [ + ("documents[][file]", b"My first file"), + ("documents[][file]", b"My second file"), + ] + assert query == {"documents": [{}, {}]} + + +@pytest.mark.parametrize( + "query,paths,expected", + [ + [ + {"foo": {"bar": "baz"}}, + [["foo", "", "bar"]], + [], + ], + [ + {"foo": ["bar", "baz"]}, + [["foo", "bar"]], + [], + ], + [ + {"foo": {"bar": "baz"}}, + [["foo", "foo"]], + [], + ], + ], + ids=["dict expecting array", "array expecting dict", "unknown keys"], +) +def test_ignores_incorrect_paths( + query: dict[str, object], + paths: Sequence[Sequence[str]], + expected: list[tuple[str, FileTypes]], +) -> None: + assert extract_files(query, paths=paths) == expected diff --git a/tests/test_files.py b/tests/test_files.py new file mode 100644 index 000000000..17996af04 --- /dev/null +++ b/tests/test_files.py @@ -0,0 +1,51 @@ +from pathlib import Path + +import anyio +import pytest +from dirty_equals import IsDict, IsList, IsBytes, IsTuple + +from runloop._files import to_httpx_files, async_to_httpx_files + +readme_path = Path(__file__).parent.parent.joinpath("README.md") + + +def test_pathlib_includes_file_name() -> None: + result = to_httpx_files({"file": readme_path}) + print(result) + assert result == IsDict({"file": IsTuple("README.md", IsBytes())}) + + +def test_tuple_input() -> None: + result = to_httpx_files([("file", readme_path)]) + print(result) + assert result == IsList(IsTuple("file", IsTuple("README.md", IsBytes()))) + + +@pytest.mark.asyncio +async def test_async_pathlib_includes_file_name() -> None: + result = await async_to_httpx_files({"file": readme_path}) + print(result) + assert result == IsDict({"file": IsTuple("README.md", IsBytes())}) + + +@pytest.mark.asyncio +async def test_async_supports_anyio_path() -> None: + result = await async_to_httpx_files({"file": anyio.Path(readme_path)}) + print(result) + assert result == IsDict({"file": IsTuple("README.md", IsBytes())}) + + +@pytest.mark.asyncio +async def test_async_tuple_input() -> None: + result = await async_to_httpx_files([("file", readme_path)]) + print(result) + assert result == IsList(IsTuple("file", IsTuple("README.md", IsBytes()))) + + +def test_string_not_allowed() -> None: + with pytest.raises(TypeError, match="Expected file types input to be a FileContent type or to be a tuple"): + to_httpx_files( + { + "file": "foo", # type: ignore + } + ) diff --git a/tests/test_models.py b/tests/test_models.py new file mode 100644 index 000000000..5440d06de --- /dev/null +++ b/tests/test_models.py @@ -0,0 +1,829 @@ +import json +from typing import Any, Dict, List, Union, Optional, cast +from datetime import datetime, timezone +from typing_extensions import Literal, Annotated + +import pytest +import pydantic +from pydantic import Field + +from runloop._utils import PropertyInfo +from runloop._compat import PYDANTIC_V2, parse_obj, model_dump, model_json +from runloop._models import BaseModel, construct_type + + +class BasicModel(BaseModel): + foo: str + + +@pytest.mark.parametrize("value", ["hello", 1], ids=["correct type", "mismatched"]) +def test_basic(value: object) -> None: + m = BasicModel.construct(foo=value) + assert m.foo == value + + +def test_directly_nested_model() -> None: + class NestedModel(BaseModel): + nested: BasicModel + + m = NestedModel.construct(nested={"foo": "Foo!"}) + assert m.nested.foo == "Foo!" + + # mismatched types + m = NestedModel.construct(nested="hello!") + assert cast(Any, m.nested) == "hello!" + + +def test_optional_nested_model() -> None: + class NestedModel(BaseModel): + nested: Optional[BasicModel] + + m1 = NestedModel.construct(nested=None) + assert m1.nested is None + + m2 = NestedModel.construct(nested={"foo": "bar"}) + assert m2.nested is not None + assert m2.nested.foo == "bar" + + # mismatched types + m3 = NestedModel.construct(nested={"foo"}) + assert isinstance(cast(Any, m3.nested), set) + assert cast(Any, m3.nested) == {"foo"} + + +def test_list_nested_model() -> None: + class NestedModel(BaseModel): + nested: List[BasicModel] + + m = NestedModel.construct(nested=[{"foo": "bar"}, {"foo": "2"}]) + assert m.nested is not None + assert isinstance(m.nested, list) + assert len(m.nested) == 2 + assert m.nested[0].foo == "bar" + assert m.nested[1].foo == "2" + + # mismatched types + m = NestedModel.construct(nested=True) + assert cast(Any, m.nested) is True + + m = NestedModel.construct(nested=[False]) + assert cast(Any, m.nested) == [False] + + +def test_optional_list_nested_model() -> None: + class NestedModel(BaseModel): + nested: Optional[List[BasicModel]] + + m1 = NestedModel.construct(nested=[{"foo": "bar"}, {"foo": "2"}]) + assert m1.nested is not None + assert isinstance(m1.nested, list) + assert len(m1.nested) == 2 + assert m1.nested[0].foo == "bar" + assert m1.nested[1].foo == "2" + + m2 = NestedModel.construct(nested=None) + assert m2.nested is None + + # mismatched types + m3 = NestedModel.construct(nested={1}) + assert cast(Any, m3.nested) == {1} + + m4 = NestedModel.construct(nested=[False]) + assert cast(Any, m4.nested) == [False] + + +def test_list_optional_items_nested_model() -> None: + class NestedModel(BaseModel): + nested: List[Optional[BasicModel]] + + m = NestedModel.construct(nested=[None, {"foo": "bar"}]) + assert m.nested is not None + assert isinstance(m.nested, list) + assert len(m.nested) == 2 + assert m.nested[0] is None + assert m.nested[1] is not None + assert m.nested[1].foo == "bar" + + # mismatched types + m3 = NestedModel.construct(nested="foo") + assert cast(Any, m3.nested) == "foo" + + m4 = NestedModel.construct(nested=[False]) + assert cast(Any, m4.nested) == [False] + + +def test_list_mismatched_type() -> None: + class NestedModel(BaseModel): + nested: List[str] + + m = NestedModel.construct(nested=False) + assert cast(Any, m.nested) is False + + +def test_raw_dictionary() -> None: + class NestedModel(BaseModel): + nested: Dict[str, str] + + m = NestedModel.construct(nested={"hello": "world"}) + assert m.nested == {"hello": "world"} + + # mismatched types + m = NestedModel.construct(nested=False) + assert cast(Any, m.nested) is False + + +def test_nested_dictionary_model() -> None: + class NestedModel(BaseModel): + nested: Dict[str, BasicModel] + + m = NestedModel.construct(nested={"hello": {"foo": "bar"}}) + assert isinstance(m.nested, dict) + assert m.nested["hello"].foo == "bar" + + # mismatched types + m = NestedModel.construct(nested={"hello": False}) + assert cast(Any, m.nested["hello"]) is False + + +def test_unknown_fields() -> None: + m1 = BasicModel.construct(foo="foo", unknown=1) + assert m1.foo == "foo" + assert cast(Any, m1).unknown == 1 + + m2 = BasicModel.construct(foo="foo", unknown={"foo_bar": True}) + assert m2.foo == "foo" + assert cast(Any, m2).unknown == {"foo_bar": True} + + assert model_dump(m2) == {"foo": "foo", "unknown": {"foo_bar": True}} + + +def test_strict_validation_unknown_fields() -> None: + class Model(BaseModel): + foo: str + + model = parse_obj(Model, dict(foo="hello!", user="Robert")) + assert model.foo == "hello!" + assert cast(Any, model).user == "Robert" + + assert model_dump(model) == {"foo": "hello!", "user": "Robert"} + + +def test_aliases() -> None: + class Model(BaseModel): + my_field: int = Field(alias="myField") + + m = Model.construct(myField=1) + assert m.my_field == 1 + + # mismatched types + m = Model.construct(myField={"hello": False}) + assert cast(Any, m.my_field) == {"hello": False} + + +def test_repr() -> None: + model = BasicModel(foo="bar") + assert str(model) == "BasicModel(foo='bar')" + assert repr(model) == "BasicModel(foo='bar')" + + +def test_repr_nested_model() -> None: + class Child(BaseModel): + name: str + age: int + + class Parent(BaseModel): + name: str + child: Child + + model = Parent(name="Robert", child=Child(name="Foo", age=5)) + assert str(model) == "Parent(name='Robert', child=Child(name='Foo', age=5))" + assert repr(model) == "Parent(name='Robert', child=Child(name='Foo', age=5))" + + +def test_optional_list() -> None: + class Submodel(BaseModel): + name: str + + class Model(BaseModel): + items: Optional[List[Submodel]] + + m = Model.construct(items=None) + assert m.items is None + + m = Model.construct(items=[]) + assert m.items == [] + + m = Model.construct(items=[{"name": "Robert"}]) + assert m.items is not None + assert len(m.items) == 1 + assert m.items[0].name == "Robert" + + +def test_nested_union_of_models() -> None: + class Submodel1(BaseModel): + bar: bool + + class Submodel2(BaseModel): + thing: str + + class Model(BaseModel): + foo: Union[Submodel1, Submodel2] + + m = Model.construct(foo={"thing": "hello"}) + assert isinstance(m.foo, Submodel2) + assert m.foo.thing == "hello" + + +def test_nested_union_of_mixed_types() -> None: + class Submodel1(BaseModel): + bar: bool + + class Model(BaseModel): + foo: Union[Submodel1, Literal[True], Literal["CARD_HOLDER"]] + + m = Model.construct(foo=True) + assert m.foo is True + + m = Model.construct(foo="CARD_HOLDER") + assert m.foo is "CARD_HOLDER" + + m = Model.construct(foo={"bar": False}) + assert isinstance(m.foo, Submodel1) + assert m.foo.bar is False + + +def test_nested_union_multiple_variants() -> None: + class Submodel1(BaseModel): + bar: bool + + class Submodel2(BaseModel): + thing: str + + class Submodel3(BaseModel): + foo: int + + class Model(BaseModel): + foo: Union[Submodel1, Submodel2, None, Submodel3] + + m = Model.construct(foo={"thing": "hello"}) + assert isinstance(m.foo, Submodel2) + assert m.foo.thing == "hello" + + m = Model.construct(foo=None) + assert m.foo is None + + m = Model.construct() + assert m.foo is None + + m = Model.construct(foo={"foo": "1"}) + assert isinstance(m.foo, Submodel3) + assert m.foo.foo == 1 + + +def test_nested_union_invalid_data() -> None: + class Submodel1(BaseModel): + level: int + + class Submodel2(BaseModel): + name: str + + class Model(BaseModel): + foo: Union[Submodel1, Submodel2] + + m = Model.construct(foo=True) + assert cast(bool, m.foo) is True + + m = Model.construct(foo={"name": 3}) + if PYDANTIC_V2: + assert isinstance(m.foo, Submodel1) + assert m.foo.name == 3 # type: ignore + else: + assert isinstance(m.foo, Submodel2) + assert m.foo.name == "3" + + +def test_list_of_unions() -> None: + class Submodel1(BaseModel): + level: int + + class Submodel2(BaseModel): + name: str + + class Model(BaseModel): + items: List[Union[Submodel1, Submodel2]] + + m = Model.construct(items=[{"level": 1}, {"name": "Robert"}]) + assert len(m.items) == 2 + assert isinstance(m.items[0], Submodel1) + assert m.items[0].level == 1 + assert isinstance(m.items[1], Submodel2) + assert m.items[1].name == "Robert" + + m = Model.construct(items=[{"level": -1}, 156]) + assert len(m.items) == 2 + assert isinstance(m.items[0], Submodel1) + assert m.items[0].level == -1 + assert cast(Any, m.items[1]) == 156 + + +def test_union_of_lists() -> None: + class SubModel1(BaseModel): + level: int + + class SubModel2(BaseModel): + name: str + + class Model(BaseModel): + items: Union[List[SubModel1], List[SubModel2]] + + # with one valid entry + m = Model.construct(items=[{"name": "Robert"}]) + assert len(m.items) == 1 + assert isinstance(m.items[0], SubModel2) + assert m.items[0].name == "Robert" + + # with two entries pointing to different types + m = Model.construct(items=[{"level": 1}, {"name": "Robert"}]) + assert len(m.items) == 2 + assert isinstance(m.items[0], SubModel1) + assert m.items[0].level == 1 + assert isinstance(m.items[1], SubModel1) + assert cast(Any, m.items[1]).name == "Robert" + + # with two entries pointing to *completely* different types + m = Model.construct(items=[{"level": -1}, 156]) + assert len(m.items) == 2 + assert isinstance(m.items[0], SubModel1) + assert m.items[0].level == -1 + assert cast(Any, m.items[1]) == 156 + + +def test_dict_of_union() -> None: + class SubModel1(BaseModel): + name: str + + class SubModel2(BaseModel): + foo: str + + class Model(BaseModel): + data: Dict[str, Union[SubModel1, SubModel2]] + + m = Model.construct(data={"hello": {"name": "there"}, "foo": {"foo": "bar"}}) + assert len(list(m.data.keys())) == 2 + assert isinstance(m.data["hello"], SubModel1) + assert m.data["hello"].name == "there" + assert isinstance(m.data["foo"], SubModel2) + assert m.data["foo"].foo == "bar" + + # TODO: test mismatched type + + +def test_double_nested_union() -> None: + class SubModel1(BaseModel): + name: str + + class SubModel2(BaseModel): + bar: str + + class Model(BaseModel): + data: Dict[str, List[Union[SubModel1, SubModel2]]] + + m = Model.construct(data={"foo": [{"bar": "baz"}, {"name": "Robert"}]}) + assert len(m.data["foo"]) == 2 + + entry1 = m.data["foo"][0] + assert isinstance(entry1, SubModel2) + assert entry1.bar == "baz" + + entry2 = m.data["foo"][1] + assert isinstance(entry2, SubModel1) + assert entry2.name == "Robert" + + # TODO: test mismatched type + + +def test_union_of_dict() -> None: + class SubModel1(BaseModel): + name: str + + class SubModel2(BaseModel): + foo: str + + class Model(BaseModel): + data: Union[Dict[str, SubModel1], Dict[str, SubModel2]] + + m = Model.construct(data={"hello": {"name": "there"}, "foo": {"foo": "bar"}}) + assert len(list(m.data.keys())) == 2 + assert isinstance(m.data["hello"], SubModel1) + assert m.data["hello"].name == "there" + assert isinstance(m.data["foo"], SubModel1) + assert cast(Any, m.data["foo"]).foo == "bar" + + +def test_iso8601_datetime() -> None: + class Model(BaseModel): + created_at: datetime + + expected = datetime(2019, 12, 27, 18, 11, 19, 117000, tzinfo=timezone.utc) + + if PYDANTIC_V2: + expected_json = '{"created_at":"2019-12-27T18:11:19.117000Z"}' + else: + expected_json = '{"created_at": "2019-12-27T18:11:19.117000+00:00"}' + + model = Model.construct(created_at="2019-12-27T18:11:19.117Z") + assert model.created_at == expected + assert model_json(model) == expected_json + + model = parse_obj(Model, dict(created_at="2019-12-27T18:11:19.117Z")) + assert model.created_at == expected + assert model_json(model) == expected_json + + +def test_does_not_coerce_int() -> None: + class Model(BaseModel): + bar: int + + assert Model.construct(bar=1).bar == 1 + assert Model.construct(bar=10.9).bar == 10.9 + assert Model.construct(bar="19").bar == "19" # type: ignore[comparison-overlap] + assert Model.construct(bar=False).bar is False + + +def test_int_to_float_safe_conversion() -> None: + class Model(BaseModel): + float_field: float + + m = Model.construct(float_field=10) + assert m.float_field == 10.0 + assert isinstance(m.float_field, float) + + m = Model.construct(float_field=10.12) + assert m.float_field == 10.12 + assert isinstance(m.float_field, float) + + # number too big + m = Model.construct(float_field=2**53 + 1) + assert m.float_field == 2**53 + 1 + assert isinstance(m.float_field, int) + + +def test_deprecated_alias() -> None: + class Model(BaseModel): + resource_id: str = Field(alias="model_id") + + @property + def model_id(self) -> str: + return self.resource_id + + m = Model.construct(model_id="id") + assert m.model_id == "id" + assert m.resource_id == "id" + assert m.resource_id is m.model_id + + m = parse_obj(Model, {"model_id": "id"}) + assert m.model_id == "id" + assert m.resource_id == "id" + assert m.resource_id is m.model_id + + +def test_omitted_fields() -> None: + class Model(BaseModel): + resource_id: Optional[str] = None + + m = Model.construct() + assert "resource_id" not in m.model_fields_set + + m = Model.construct(resource_id=None) + assert "resource_id" in m.model_fields_set + + m = Model.construct(resource_id="foo") + assert "resource_id" in m.model_fields_set + + +def test_to_dict() -> None: + class Model(BaseModel): + foo: Optional[str] = Field(alias="FOO", default=None) + + m = Model(FOO="hello") + assert m.to_dict() == {"FOO": "hello"} + assert m.to_dict(use_api_names=False) == {"foo": "hello"} + + m2 = Model() + assert m2.to_dict() == {} + assert m2.to_dict(exclude_unset=False) == {"FOO": None} + assert m2.to_dict(exclude_unset=False, exclude_none=True) == {} + assert m2.to_dict(exclude_unset=False, exclude_defaults=True) == {} + + m3 = Model(FOO=None) + assert m3.to_dict() == {"FOO": None} + assert m3.to_dict(exclude_none=True) == {} + assert m3.to_dict(exclude_defaults=True) == {} + + if PYDANTIC_V2: + + class Model2(BaseModel): + created_at: datetime + + time_str = "2024-03-21T11:39:01.275859" + m4 = Model2.construct(created_at=time_str) + assert m4.to_dict(mode="python") == {"created_at": datetime.fromisoformat(time_str)} + assert m4.to_dict(mode="json") == {"created_at": time_str} + else: + with pytest.raises(ValueError, match="mode is only supported in Pydantic v2"): + m.to_dict(mode="json") + + with pytest.raises(ValueError, match="warnings is only supported in Pydantic v2"): + m.to_dict(warnings=False) + + +def test_forwards_compat_model_dump_method() -> None: + class Model(BaseModel): + foo: Optional[str] = Field(alias="FOO", default=None) + + m = Model(FOO="hello") + assert m.model_dump() == {"foo": "hello"} + assert m.model_dump(include={"bar"}) == {} + assert m.model_dump(exclude={"foo"}) == {} + assert m.model_dump(by_alias=True) == {"FOO": "hello"} + + m2 = Model() + assert m2.model_dump() == {"foo": None} + assert m2.model_dump(exclude_unset=True) == {} + assert m2.model_dump(exclude_none=True) == {} + assert m2.model_dump(exclude_defaults=True) == {} + + m3 = Model(FOO=None) + assert m3.model_dump() == {"foo": None} + assert m3.model_dump(exclude_none=True) == {} + + if not PYDANTIC_V2: + with pytest.raises(ValueError, match="mode is only supported in Pydantic v2"): + m.model_dump(mode="json") + + with pytest.raises(ValueError, match="round_trip is only supported in Pydantic v2"): + m.model_dump(round_trip=True) + + with pytest.raises(ValueError, match="warnings is only supported in Pydantic v2"): + m.model_dump(warnings=False) + + +def test_to_json() -> None: + class Model(BaseModel): + foo: Optional[str] = Field(alias="FOO", default=None) + + m = Model(FOO="hello") + assert json.loads(m.to_json()) == {"FOO": "hello"} + assert json.loads(m.to_json(use_api_names=False)) == {"foo": "hello"} + + if PYDANTIC_V2: + assert m.to_json(indent=None) == '{"FOO":"hello"}' + else: + assert m.to_json(indent=None) == '{"FOO": "hello"}' + + m2 = Model() + assert json.loads(m2.to_json()) == {} + assert json.loads(m2.to_json(exclude_unset=False)) == {"FOO": None} + assert json.loads(m2.to_json(exclude_unset=False, exclude_none=True)) == {} + assert json.loads(m2.to_json(exclude_unset=False, exclude_defaults=True)) == {} + + m3 = Model(FOO=None) + assert json.loads(m3.to_json()) == {"FOO": None} + assert json.loads(m3.to_json(exclude_none=True)) == {} + + if not PYDANTIC_V2: + with pytest.raises(ValueError, match="warnings is only supported in Pydantic v2"): + m.to_json(warnings=False) + + +def test_forwards_compat_model_dump_json_method() -> None: + class Model(BaseModel): + foo: Optional[str] = Field(alias="FOO", default=None) + + m = Model(FOO="hello") + assert json.loads(m.model_dump_json()) == {"foo": "hello"} + assert json.loads(m.model_dump_json(include={"bar"})) == {} + assert json.loads(m.model_dump_json(include={"foo"})) == {"foo": "hello"} + assert json.loads(m.model_dump_json(by_alias=True)) == {"FOO": "hello"} + + assert m.model_dump_json(indent=2) == '{\n "foo": "hello"\n}' + + m2 = Model() + assert json.loads(m2.model_dump_json()) == {"foo": None} + assert json.loads(m2.model_dump_json(exclude_unset=True)) == {} + assert json.loads(m2.model_dump_json(exclude_none=True)) == {} + assert json.loads(m2.model_dump_json(exclude_defaults=True)) == {} + + m3 = Model(FOO=None) + assert json.loads(m3.model_dump_json()) == {"foo": None} + assert json.loads(m3.model_dump_json(exclude_none=True)) == {} + + if not PYDANTIC_V2: + with pytest.raises(ValueError, match="round_trip is only supported in Pydantic v2"): + m.model_dump_json(round_trip=True) + + with pytest.raises(ValueError, match="warnings is only supported in Pydantic v2"): + m.model_dump_json(warnings=False) + + +def test_type_compat() -> None: + # our model type can be assigned to Pydantic's model type + + def takes_pydantic(model: pydantic.BaseModel) -> None: # noqa: ARG001 + ... + + class OurModel(BaseModel): + foo: Optional[str] = None + + takes_pydantic(OurModel()) + + +def test_annotated_types() -> None: + class Model(BaseModel): + value: str + + m = construct_type( + value={"value": "foo"}, + type_=cast(Any, Annotated[Model, "random metadata"]), + ) + assert isinstance(m, Model) + assert m.value == "foo" + + +def test_discriminated_unions_invalid_data() -> None: + class A(BaseModel): + type: Literal["a"] + + data: str + + class B(BaseModel): + type: Literal["b"] + + data: int + + m = construct_type( + value={"type": "b", "data": "foo"}, + type_=cast(Any, Annotated[Union[A, B], PropertyInfo(discriminator="type")]), + ) + assert isinstance(m, B) + assert m.type == "b" + assert m.data == "foo" # type: ignore[comparison-overlap] + + m = construct_type( + value={"type": "a", "data": 100}, + type_=cast(Any, Annotated[Union[A, B], PropertyInfo(discriminator="type")]), + ) + assert isinstance(m, A) + assert m.type == "a" + if PYDANTIC_V2: + assert m.data == 100 # type: ignore[comparison-overlap] + else: + # pydantic v1 automatically converts inputs to strings + # if the expected type is a str + assert m.data == "100" + + +def test_discriminated_unions_unknown_variant() -> None: + class A(BaseModel): + type: Literal["a"] + + data: str + + class B(BaseModel): + type: Literal["b"] + + data: int + + m = construct_type( + value={"type": "c", "data": None, "new_thing": "bar"}, + type_=cast(Any, Annotated[Union[A, B], PropertyInfo(discriminator="type")]), + ) + + # just chooses the first variant + assert isinstance(m, A) + assert m.type == "c" # type: ignore[comparison-overlap] + assert m.data == None # type: ignore[unreachable] + assert m.new_thing == "bar" + + +def test_discriminated_unions_invalid_data_nested_unions() -> None: + class A(BaseModel): + type: Literal["a"] + + data: str + + class B(BaseModel): + type: Literal["b"] + + data: int + + class C(BaseModel): + type: Literal["c"] + + data: bool + + m = construct_type( + value={"type": "b", "data": "foo"}, + type_=cast(Any, Annotated[Union[Union[A, B], C], PropertyInfo(discriminator="type")]), + ) + assert isinstance(m, B) + assert m.type == "b" + assert m.data == "foo" # type: ignore[comparison-overlap] + + m = construct_type( + value={"type": "c", "data": "foo"}, + type_=cast(Any, Annotated[Union[Union[A, B], C], PropertyInfo(discriminator="type")]), + ) + assert isinstance(m, C) + assert m.type == "c" + assert m.data == "foo" # type: ignore[comparison-overlap] + + +def test_discriminated_unions_with_aliases_invalid_data() -> None: + class A(BaseModel): + foo_type: Literal["a"] = Field(alias="type") + + data: str + + class B(BaseModel): + foo_type: Literal["b"] = Field(alias="type") + + data: int + + m = construct_type( + value={"type": "b", "data": "foo"}, + type_=cast(Any, Annotated[Union[A, B], PropertyInfo(discriminator="foo_type")]), + ) + assert isinstance(m, B) + assert m.foo_type == "b" + assert m.data == "foo" # type: ignore[comparison-overlap] + + m = construct_type( + value={"type": "a", "data": 100}, + type_=cast(Any, Annotated[Union[A, B], PropertyInfo(discriminator="foo_type")]), + ) + assert isinstance(m, A) + assert m.foo_type == "a" + if PYDANTIC_V2: + assert m.data == 100 # type: ignore[comparison-overlap] + else: + # pydantic v1 automatically converts inputs to strings + # if the expected type is a str + assert m.data == "100" + + +def test_discriminated_unions_overlapping_discriminators_invalid_data() -> None: + class A(BaseModel): + type: Literal["a"] + + data: bool + + class B(BaseModel): + type: Literal["a"] + + data: int + + m = construct_type( + value={"type": "a", "data": "foo"}, + type_=cast(Any, Annotated[Union[A, B], PropertyInfo(discriminator="type")]), + ) + assert isinstance(m, B) + assert m.type == "a" + assert m.data == "foo" # type: ignore[comparison-overlap] + + +def test_discriminated_unions_invalid_data_uses_cache() -> None: + class A(BaseModel): + type: Literal["a"] + + data: str + + class B(BaseModel): + type: Literal["b"] + + data: int + + UnionType = cast(Any, Union[A, B]) + + assert not hasattr(UnionType, "__discriminator__") + + m = construct_type( + value={"type": "b", "data": "foo"}, type_=cast(Any, Annotated[UnionType, PropertyInfo(discriminator="type")]) + ) + assert isinstance(m, B) + assert m.type == "b" + assert m.data == "foo" # type: ignore[comparison-overlap] + + discriminator = UnionType.__discriminator__ + assert discriminator is not None + + m = construct_type( + value={"type": "b", "data": "foo"}, type_=cast(Any, Annotated[UnionType, PropertyInfo(discriminator="type")]) + ) + assert isinstance(m, B) + assert m.type == "b" + assert m.data == "foo" # type: ignore[comparison-overlap] + + # if the discriminator details object stays the same between invocations then + # we hit the cache + assert UnionType.__discriminator__ is discriminator diff --git a/tests/test_qs.py b/tests/test_qs.py new file mode 100644 index 000000000..29abc6502 --- /dev/null +++ b/tests/test_qs.py @@ -0,0 +1,78 @@ +from typing import Any, cast +from functools import partial +from urllib.parse import unquote + +import pytest + +from runloop._qs import Querystring, stringify + + +def test_empty() -> None: + assert stringify({}) == "" + assert stringify({"a": {}}) == "" + assert stringify({"a": {"b": {"c": {}}}}) == "" + + +def test_basic() -> None: + assert stringify({"a": 1}) == "a=1" + assert stringify({"a": "b"}) == "a=b" + assert stringify({"a": True}) == "a=true" + assert stringify({"a": False}) == "a=false" + assert stringify({"a": 1.23456}) == "a=1.23456" + assert stringify({"a": None}) == "" + + +@pytest.mark.parametrize("method", ["class", "function"]) +def test_nested_dotted(method: str) -> None: + if method == "class": + serialise = Querystring(nested_format="dots").stringify + else: + serialise = partial(stringify, nested_format="dots") + + assert unquote(serialise({"a": {"b": "c"}})) == "a.b=c" + assert unquote(serialise({"a": {"b": "c", "d": "e", "f": "g"}})) == "a.b=c&a.d=e&a.f=g" + assert unquote(serialise({"a": {"b": {"c": {"d": "e"}}}})) == "a.b.c.d=e" + assert unquote(serialise({"a": {"b": True}})) == "a.b=true" + + +def test_nested_brackets() -> None: + assert unquote(stringify({"a": {"b": "c"}})) == "a[b]=c" + assert unquote(stringify({"a": {"b": "c", "d": "e", "f": "g"}})) == "a[b]=c&a[d]=e&a[f]=g" + assert unquote(stringify({"a": {"b": {"c": {"d": "e"}}}})) == "a[b][c][d]=e" + assert unquote(stringify({"a": {"b": True}})) == "a[b]=true" + + +@pytest.mark.parametrize("method", ["class", "function"]) +def test_array_comma(method: str) -> None: + if method == "class": + serialise = Querystring(array_format="comma").stringify + else: + serialise = partial(stringify, array_format="comma") + + assert unquote(serialise({"in": ["foo", "bar"]})) == "in=foo,bar" + assert unquote(serialise({"a": {"b": [True, False]}})) == "a[b]=true,false" + assert unquote(serialise({"a": {"b": [True, False, None, True]}})) == "a[b]=true,false,true" + + +def test_array_repeat() -> None: + assert unquote(stringify({"in": ["foo", "bar"]})) == "in=foo&in=bar" + assert unquote(stringify({"a": {"b": [True, False]}})) == "a[b]=true&a[b]=false" + assert unquote(stringify({"a": {"b": [True, False, None, True]}})) == "a[b]=true&a[b]=false&a[b]=true" + assert unquote(stringify({"in": ["foo", {"b": {"c": ["d", "e"]}}]})) == "in=foo&in[b][c]=d&in[b][c]=e" + + +@pytest.mark.parametrize("method", ["class", "function"]) +def test_array_brackets(method: str) -> None: + if method == "class": + serialise = Querystring(array_format="brackets").stringify + else: + serialise = partial(stringify, array_format="brackets") + + assert unquote(serialise({"in": ["foo", "bar"]})) == "in[]=foo&in[]=bar" + assert unquote(serialise({"a": {"b": [True, False]}})) == "a[b][]=true&a[b][]=false" + assert unquote(serialise({"a": {"b": [True, False, None, True]}})) == "a[b][]=true&a[b][]=false&a[b][]=true" + + +def test_unknown_array_format() -> None: + with pytest.raises(NotImplementedError, match="Unknown array_format value: foo, choose from comma, repeat"): + stringify({"a": ["foo", "bar"]}, array_format=cast(Any, "foo")) diff --git a/tests/test_required_args.py b/tests/test_required_args.py new file mode 100644 index 000000000..fed9f93f4 --- /dev/null +++ b/tests/test_required_args.py @@ -0,0 +1,111 @@ +from __future__ import annotations + +import pytest + +from runloop._utils import required_args + + +def test_too_many_positional_params() -> None: + @required_args(["a"]) + def foo(a: str | None = None) -> str | None: + return a + + with pytest.raises(TypeError, match=r"foo\(\) takes 1 argument\(s\) but 2 were given"): + foo("a", "b") # type: ignore + + +def test_positional_param() -> None: + @required_args(["a"]) + def foo(a: str | None = None) -> str | None: + return a + + assert foo("a") == "a" + assert foo(None) is None + assert foo(a="b") == "b" + + with pytest.raises(TypeError, match="Missing required argument: 'a'"): + foo() + + +def test_keyword_only_param() -> None: + @required_args(["a"]) + def foo(*, a: str | None = None) -> str | None: + return a + + assert foo(a="a") == "a" + assert foo(a=None) is None + assert foo(a="b") == "b" + + with pytest.raises(TypeError, match="Missing required argument: 'a'"): + foo() + + +def test_multiple_params() -> None: + @required_args(["a", "b", "c"]) + def foo(a: str = "", *, b: str = "", c: str = "") -> str | None: + return f"{a} {b} {c}" + + assert foo(a="a", b="b", c="c") == "a b c" + + error_message = r"Missing required arguments.*" + + with pytest.raises(TypeError, match=error_message): + foo() + + with pytest.raises(TypeError, match=error_message): + foo(a="a") + + with pytest.raises(TypeError, match=error_message): + foo(b="b") + + with pytest.raises(TypeError, match=error_message): + foo(c="c") + + with pytest.raises(TypeError, match=r"Missing required argument: 'a'"): + foo(b="a", c="c") + + with pytest.raises(TypeError, match=r"Missing required argument: 'b'"): + foo("a", c="c") + + +def test_multiple_variants() -> None: + @required_args(["a"], ["b"]) + def foo(*, a: str | None = None, b: str | None = None) -> str | None: + return a if a is not None else b + + assert foo(a="foo") == "foo" + assert foo(b="bar") == "bar" + assert foo(a=None) is None + assert foo(b=None) is None + + # TODO: this error message could probably be improved + with pytest.raises( + TypeError, + match=r"Missing required arguments; Expected either \('a'\) or \('b'\) arguments to be given", + ): + foo() + + +def test_multiple_params_multiple_variants() -> None: + @required_args(["a", "b"], ["c"]) + def foo(*, a: str | None = None, b: str | None = None, c: str | None = None) -> str | None: + if a is not None: + return a + if b is not None: + return b + return c + + error_message = r"Missing required arguments; Expected either \('a' and 'b'\) or \('c'\) arguments to be given" + + with pytest.raises(TypeError, match=error_message): + foo(a="foo") + + with pytest.raises(TypeError, match=error_message): + foo(b="bar") + + with pytest.raises(TypeError, match=error_message): + foo() + + assert foo(a=None, b="bar") == "bar" + assert foo(c=None) is None + assert foo(c="foo") == "foo" diff --git a/tests/test_response.py b/tests/test_response.py new file mode 100644 index 000000000..3b8149876 --- /dev/null +++ b/tests/test_response.py @@ -0,0 +1,194 @@ +import json +from typing import List, cast +from typing_extensions import Annotated + +import httpx +import pytest +import pydantic + +from runloop import Runloop, BaseModel, AsyncRunloop +from runloop._response import ( + APIResponse, + BaseAPIResponse, + AsyncAPIResponse, + BinaryAPIResponse, + AsyncBinaryAPIResponse, + extract_response_type, +) +from runloop._streaming import Stream +from runloop._base_client import FinalRequestOptions + + +class ConcreteBaseAPIResponse(APIResponse[bytes]): + ... + + +class ConcreteAPIResponse(APIResponse[List[str]]): + ... + + +class ConcreteAsyncAPIResponse(APIResponse[httpx.Response]): + ... + + +def test_extract_response_type_direct_classes() -> None: + assert extract_response_type(BaseAPIResponse[str]) == str + assert extract_response_type(APIResponse[str]) == str + assert extract_response_type(AsyncAPIResponse[str]) == str + + +def test_extract_response_type_direct_class_missing_type_arg() -> None: + with pytest.raises( + RuntimeError, + match="Expected type to have a type argument at index 0 but it did not", + ): + extract_response_type(AsyncAPIResponse) + + +def test_extract_response_type_concrete_subclasses() -> None: + assert extract_response_type(ConcreteBaseAPIResponse) == bytes + assert extract_response_type(ConcreteAPIResponse) == List[str] + assert extract_response_type(ConcreteAsyncAPIResponse) == httpx.Response + + +def test_extract_response_type_binary_response() -> None: + assert extract_response_type(BinaryAPIResponse) == bytes + assert extract_response_type(AsyncBinaryAPIResponse) == bytes + + +class PydanticModel(pydantic.BaseModel): + ... + + +def test_response_parse_mismatched_basemodel(client: Runloop) -> None: + response = APIResponse( + raw=httpx.Response(200, content=b"foo"), + client=client, + stream=False, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + with pytest.raises( + TypeError, + match="Pydantic models must subclass our base model type, e.g. `from runloop import BaseModel`", + ): + response.parse(to=PydanticModel) + + +@pytest.mark.asyncio +async def test_async_response_parse_mismatched_basemodel(async_client: AsyncRunloop) -> None: + response = AsyncAPIResponse( + raw=httpx.Response(200, content=b"foo"), + client=async_client, + stream=False, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + with pytest.raises( + TypeError, + match="Pydantic models must subclass our base model type, e.g. `from runloop import BaseModel`", + ): + await response.parse(to=PydanticModel) + + +def test_response_parse_custom_stream(client: Runloop) -> None: + response = APIResponse( + raw=httpx.Response(200, content=b"foo"), + client=client, + stream=True, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + stream = response.parse(to=Stream[int]) + assert stream._cast_to == int + + +@pytest.mark.asyncio +async def test_async_response_parse_custom_stream(async_client: AsyncRunloop) -> None: + response = AsyncAPIResponse( + raw=httpx.Response(200, content=b"foo"), + client=async_client, + stream=True, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + stream = await response.parse(to=Stream[int]) + assert stream._cast_to == int + + +class CustomModel(BaseModel): + foo: str + bar: int + + +def test_response_parse_custom_model(client: Runloop) -> None: + response = APIResponse( + raw=httpx.Response(200, content=json.dumps({"foo": "hello!", "bar": 2})), + client=client, + stream=False, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + obj = response.parse(to=CustomModel) + assert obj.foo == "hello!" + assert obj.bar == 2 + + +@pytest.mark.asyncio +async def test_async_response_parse_custom_model(async_client: AsyncRunloop) -> None: + response = AsyncAPIResponse( + raw=httpx.Response(200, content=json.dumps({"foo": "hello!", "bar": 2})), + client=async_client, + stream=False, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + obj = await response.parse(to=CustomModel) + assert obj.foo == "hello!" + assert obj.bar == 2 + + +def test_response_parse_annotated_type(client: Runloop) -> None: + response = APIResponse( + raw=httpx.Response(200, content=json.dumps({"foo": "hello!", "bar": 2})), + client=client, + stream=False, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + obj = response.parse( + to=cast("type[CustomModel]", Annotated[CustomModel, "random metadata"]), + ) + assert obj.foo == "hello!" + assert obj.bar == 2 + + +async def test_async_response_parse_annotated_type(async_client: AsyncRunloop) -> None: + response = AsyncAPIResponse( + raw=httpx.Response(200, content=json.dumps({"foo": "hello!", "bar": 2})), + client=async_client, + stream=False, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + obj = await response.parse( + to=cast("type[CustomModel]", Annotated[CustomModel, "random metadata"]), + ) + assert obj.foo == "hello!" + assert obj.bar == 2 diff --git a/tests/test_streaming.py b/tests/test_streaming.py new file mode 100644 index 000000000..2feefb892 --- /dev/null +++ b/tests/test_streaming.py @@ -0,0 +1,248 @@ +from __future__ import annotations + +from typing import Iterator, AsyncIterator + +import httpx +import pytest + +from runloop import Runloop, AsyncRunloop +from runloop._streaming import Stream, AsyncStream, ServerSentEvent + + +@pytest.mark.asyncio +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_basic(sync: bool, client: Runloop, async_client: AsyncRunloop) -> None: + def body() -> Iterator[bytes]: + yield b"event: completion\n" + yield b'data: {"foo":true}\n' + yield b"\n" + + iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) + + sse = await iter_next(iterator) + assert sse.event == "completion" + assert sse.json() == {"foo": True} + + await assert_empty_iter(iterator) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_data_missing_event(sync: bool, client: Runloop, async_client: AsyncRunloop) -> None: + def body() -> Iterator[bytes]: + yield b'data: {"foo":true}\n' + yield b"\n" + + iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) + + sse = await iter_next(iterator) + assert sse.event is None + assert sse.json() == {"foo": True} + + await assert_empty_iter(iterator) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_event_missing_data(sync: bool, client: Runloop, async_client: AsyncRunloop) -> None: + def body() -> Iterator[bytes]: + yield b"event: ping\n" + yield b"\n" + + iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) + + sse = await iter_next(iterator) + assert sse.event == "ping" + assert sse.data == "" + + await assert_empty_iter(iterator) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_multiple_events(sync: bool, client: Runloop, async_client: AsyncRunloop) -> None: + def body() -> Iterator[bytes]: + yield b"event: ping\n" + yield b"\n" + yield b"event: completion\n" + yield b"\n" + + iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) + + sse = await iter_next(iterator) + assert sse.event == "ping" + assert sse.data == "" + + sse = await iter_next(iterator) + assert sse.event == "completion" + assert sse.data == "" + + await assert_empty_iter(iterator) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_multiple_events_with_data(sync: bool, client: Runloop, async_client: AsyncRunloop) -> None: + def body() -> Iterator[bytes]: + yield b"event: ping\n" + yield b'data: {"foo":true}\n' + yield b"\n" + yield b"event: completion\n" + yield b'data: {"bar":false}\n' + yield b"\n" + + iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) + + sse = await iter_next(iterator) + assert sse.event == "ping" + assert sse.json() == {"foo": True} + + sse = await iter_next(iterator) + assert sse.event == "completion" + assert sse.json() == {"bar": False} + + await assert_empty_iter(iterator) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_multiple_data_lines_with_empty_line(sync: bool, client: Runloop, async_client: AsyncRunloop) -> None: + def body() -> Iterator[bytes]: + yield b"event: ping\n" + yield b"data: {\n" + yield b'data: "foo":\n' + yield b"data: \n" + yield b"data:\n" + yield b"data: true}\n" + yield b"\n\n" + + iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) + + sse = await iter_next(iterator) + assert sse.event == "ping" + assert sse.json() == {"foo": True} + assert sse.data == '{\n"foo":\n\n\ntrue}' + + await assert_empty_iter(iterator) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_data_json_escaped_double_new_line(sync: bool, client: Runloop, async_client: AsyncRunloop) -> None: + def body() -> Iterator[bytes]: + yield b"event: ping\n" + yield b'data: {"foo": "my long\\n\\ncontent"}' + yield b"\n\n" + + iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) + + sse = await iter_next(iterator) + assert sse.event == "ping" + assert sse.json() == {"foo": "my long\n\ncontent"} + + await assert_empty_iter(iterator) + + +@pytest.mark.asyncio +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_multiple_data_lines(sync: bool, client: Runloop, async_client: AsyncRunloop) -> None: + def body() -> Iterator[bytes]: + yield b"event: ping\n" + yield b"data: {\n" + yield b'data: "foo":\n' + yield b"data: true}\n" + yield b"\n\n" + + iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) + + sse = await iter_next(iterator) + assert sse.event == "ping" + assert sse.json() == {"foo": True} + + await assert_empty_iter(iterator) + + +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_special_new_line_character( + sync: bool, + client: Runloop, + async_client: AsyncRunloop, +) -> None: + def body() -> Iterator[bytes]: + yield b'data: {"content":" culpa"}\n' + yield b"\n" + yield b'data: {"content":" \xe2\x80\xa8"}\n' + yield b"\n" + yield b'data: {"content":"foo"}\n' + yield b"\n" + + iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) + + sse = await iter_next(iterator) + assert sse.event is None + assert sse.json() == {"content": " culpa"} + + sse = await iter_next(iterator) + assert sse.event is None + assert sse.json() == {"content": " 
"} + + sse = await iter_next(iterator) + assert sse.event is None + assert sse.json() == {"content": "foo"} + + await assert_empty_iter(iterator) + + +@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"]) +async def test_multi_byte_character_multiple_chunks( + sync: bool, + client: Runloop, + async_client: AsyncRunloop, +) -> None: + def body() -> Iterator[bytes]: + yield b'data: {"content":"' + # bytes taken from the string 'известни' and arbitrarily split + # so that some multi-byte characters span multiple chunks + yield b"\xd0" + yield b"\xb8\xd0\xb7\xd0" + yield b"\xb2\xd0\xb5\xd1\x81\xd1\x82\xd0\xbd\xd0\xb8" + yield b'"}\n' + yield b"\n" + + iterator = make_event_iterator(content=body(), sync=sync, client=client, async_client=async_client) + + sse = await iter_next(iterator) + assert sse.event is None + assert sse.json() == {"content": "известни"} + + +async def to_aiter(iter: Iterator[bytes]) -> AsyncIterator[bytes]: + for chunk in iter: + yield chunk + + +async def iter_next(iter: Iterator[ServerSentEvent] | AsyncIterator[ServerSentEvent]) -> ServerSentEvent: + if isinstance(iter, AsyncIterator): + return await iter.__anext__() + + return next(iter) + + +async def assert_empty_iter(iter: Iterator[ServerSentEvent] | AsyncIterator[ServerSentEvent]) -> None: + with pytest.raises((StopAsyncIteration, RuntimeError)): + await iter_next(iter) + + +def make_event_iterator( + content: Iterator[bytes], + *, + sync: bool, + client: Runloop, + async_client: AsyncRunloop, +) -> Iterator[ServerSentEvent] | AsyncIterator[ServerSentEvent]: + if sync: + return Stream(cast_to=object, client=client, response=httpx.Response(200, content=content))._iter_events() + + return AsyncStream( + cast_to=object, client=async_client, response=httpx.Response(200, content=to_aiter(content)) + )._iter_events() diff --git a/tests/test_transform.py b/tests/test_transform.py new file mode 100644 index 000000000..89057f3ec --- /dev/null +++ b/tests/test_transform.py @@ -0,0 +1,410 @@ +from __future__ import annotations + +import io +import pathlib +from typing import Any, List, Union, TypeVar, Iterable, Optional, cast +from datetime import date, datetime +from typing_extensions import Required, Annotated, TypedDict + +import pytest + +from runloop._types import Base64FileInput +from runloop._utils import ( + PropertyInfo, + transform as _transform, + parse_datetime, + async_transform as _async_transform, +) +from runloop._compat import PYDANTIC_V2 +from runloop._models import BaseModel + +_T = TypeVar("_T") + +SAMPLE_FILE_PATH = pathlib.Path(__file__).parent.joinpath("sample_file.txt") + + +async def transform( + data: _T, + expected_type: object, + use_async: bool, +) -> _T: + if use_async: + return await _async_transform(data, expected_type=expected_type) + + return _transform(data, expected_type=expected_type) + + +parametrize = pytest.mark.parametrize("use_async", [False, True], ids=["sync", "async"]) + + +class Foo1(TypedDict): + foo_bar: Annotated[str, PropertyInfo(alias="fooBar")] + + +@parametrize +@pytest.mark.asyncio +async def test_top_level_alias(use_async: bool) -> None: + assert await transform({"foo_bar": "hello"}, expected_type=Foo1, use_async=use_async) == {"fooBar": "hello"} + + +class Foo2(TypedDict): + bar: Bar2 + + +class Bar2(TypedDict): + this_thing: Annotated[int, PropertyInfo(alias="this__thing")] + baz: Annotated[Baz2, PropertyInfo(alias="Baz")] + + +class Baz2(TypedDict): + my_baz: Annotated[str, PropertyInfo(alias="myBaz")] + + +@parametrize +@pytest.mark.asyncio +async def test_recursive_typeddict(use_async: bool) -> None: + assert await transform({"bar": {"this_thing": 1}}, Foo2, use_async) == {"bar": {"this__thing": 1}} + assert await transform({"bar": {"baz": {"my_baz": "foo"}}}, Foo2, use_async) == {"bar": {"Baz": {"myBaz": "foo"}}} + + +class Foo3(TypedDict): + things: List[Bar3] + + +class Bar3(TypedDict): + my_field: Annotated[str, PropertyInfo(alias="myField")] + + +@parametrize +@pytest.mark.asyncio +async def test_list_of_typeddict(use_async: bool) -> None: + result = await transform({"things": [{"my_field": "foo"}, {"my_field": "foo2"}]}, Foo3, use_async) + assert result == {"things": [{"myField": "foo"}, {"myField": "foo2"}]} + + +class Foo4(TypedDict): + foo: Union[Bar4, Baz4] + + +class Bar4(TypedDict): + foo_bar: Annotated[str, PropertyInfo(alias="fooBar")] + + +class Baz4(TypedDict): + foo_baz: Annotated[str, PropertyInfo(alias="fooBaz")] + + +@parametrize +@pytest.mark.asyncio +async def test_union_of_typeddict(use_async: bool) -> None: + assert await transform({"foo": {"foo_bar": "bar"}}, Foo4, use_async) == {"foo": {"fooBar": "bar"}} + assert await transform({"foo": {"foo_baz": "baz"}}, Foo4, use_async) == {"foo": {"fooBaz": "baz"}} + assert await transform({"foo": {"foo_baz": "baz", "foo_bar": "bar"}}, Foo4, use_async) == { + "foo": {"fooBaz": "baz", "fooBar": "bar"} + } + + +class Foo5(TypedDict): + foo: Annotated[Union[Bar4, List[Baz4]], PropertyInfo(alias="FOO")] + + +class Bar5(TypedDict): + foo_bar: Annotated[str, PropertyInfo(alias="fooBar")] + + +class Baz5(TypedDict): + foo_baz: Annotated[str, PropertyInfo(alias="fooBaz")] + + +@parametrize +@pytest.mark.asyncio +async def test_union_of_list(use_async: bool) -> None: + assert await transform({"foo": {"foo_bar": "bar"}}, Foo5, use_async) == {"FOO": {"fooBar": "bar"}} + assert await transform( + { + "foo": [ + {"foo_baz": "baz"}, + {"foo_baz": "baz"}, + ] + }, + Foo5, + use_async, + ) == {"FOO": [{"fooBaz": "baz"}, {"fooBaz": "baz"}]} + + +class Foo6(TypedDict): + bar: Annotated[str, PropertyInfo(alias="Bar")] + + +@parametrize +@pytest.mark.asyncio +async def test_includes_unknown_keys(use_async: bool) -> None: + assert await transform({"bar": "bar", "baz_": {"FOO": 1}}, Foo6, use_async) == { + "Bar": "bar", + "baz_": {"FOO": 1}, + } + + +class Foo7(TypedDict): + bar: Annotated[List[Bar7], PropertyInfo(alias="bAr")] + foo: Bar7 + + +class Bar7(TypedDict): + foo: str + + +@parametrize +@pytest.mark.asyncio +async def test_ignores_invalid_input(use_async: bool) -> None: + assert await transform({"bar": ""}, Foo7, use_async) == {"bAr": ""} + assert await transform({"foo": ""}, Foo7, use_async) == {"foo": ""} + + +class DatetimeDict(TypedDict, total=False): + foo: Annotated[datetime, PropertyInfo(format="iso8601")] + + bar: Annotated[Optional[datetime], PropertyInfo(format="iso8601")] + + required: Required[Annotated[Optional[datetime], PropertyInfo(format="iso8601")]] + + list_: Required[Annotated[Optional[List[datetime]], PropertyInfo(format="iso8601")]] + + union: Annotated[Union[int, datetime], PropertyInfo(format="iso8601")] + + +class DateDict(TypedDict, total=False): + foo: Annotated[date, PropertyInfo(format="iso8601")] + + +@parametrize +@pytest.mark.asyncio +async def test_iso8601_format(use_async: bool) -> None: + dt = datetime.fromisoformat("2023-02-23T14:16:36.337692+00:00") + assert await transform({"foo": dt}, DatetimeDict, use_async) == {"foo": "2023-02-23T14:16:36.337692+00:00"} # type: ignore[comparison-overlap] + + dt = dt.replace(tzinfo=None) + assert await transform({"foo": dt}, DatetimeDict, use_async) == {"foo": "2023-02-23T14:16:36.337692"} # type: ignore[comparison-overlap] + + assert await transform({"foo": None}, DateDict, use_async) == {"foo": None} # type: ignore[comparison-overlap] + assert await transform({"foo": date.fromisoformat("2023-02-23")}, DateDict, use_async) == {"foo": "2023-02-23"} # type: ignore[comparison-overlap] + + +@parametrize +@pytest.mark.asyncio +async def test_optional_iso8601_format(use_async: bool) -> None: + dt = datetime.fromisoformat("2023-02-23T14:16:36.337692+00:00") + assert await transform({"bar": dt}, DatetimeDict, use_async) == {"bar": "2023-02-23T14:16:36.337692+00:00"} # type: ignore[comparison-overlap] + + assert await transform({"bar": None}, DatetimeDict, use_async) == {"bar": None} + + +@parametrize +@pytest.mark.asyncio +async def test_required_iso8601_format(use_async: bool) -> None: + dt = datetime.fromisoformat("2023-02-23T14:16:36.337692+00:00") + assert await transform({"required": dt}, DatetimeDict, use_async) == { + "required": "2023-02-23T14:16:36.337692+00:00" + } # type: ignore[comparison-overlap] + + assert await transform({"required": None}, DatetimeDict, use_async) == {"required": None} + + +@parametrize +@pytest.mark.asyncio +async def test_union_datetime(use_async: bool) -> None: + dt = datetime.fromisoformat("2023-02-23T14:16:36.337692+00:00") + assert await transform({"union": dt}, DatetimeDict, use_async) == { # type: ignore[comparison-overlap] + "union": "2023-02-23T14:16:36.337692+00:00" + } + + assert await transform({"union": "foo"}, DatetimeDict, use_async) == {"union": "foo"} + + +@parametrize +@pytest.mark.asyncio +async def test_nested_list_iso6801_format(use_async: bool) -> None: + dt1 = datetime.fromisoformat("2023-02-23T14:16:36.337692+00:00") + dt2 = parse_datetime("2022-01-15T06:34:23Z") + assert await transform({"list_": [dt1, dt2]}, DatetimeDict, use_async) == { # type: ignore[comparison-overlap] + "list_": ["2023-02-23T14:16:36.337692+00:00", "2022-01-15T06:34:23+00:00"] + } + + +@parametrize +@pytest.mark.asyncio +async def test_datetime_custom_format(use_async: bool) -> None: + dt = parse_datetime("2022-01-15T06:34:23Z") + + result = await transform(dt, Annotated[datetime, PropertyInfo(format="custom", format_template="%H")], use_async) + assert result == "06" # type: ignore[comparison-overlap] + + +class DateDictWithRequiredAlias(TypedDict, total=False): + required_prop: Required[Annotated[date, PropertyInfo(format="iso8601", alias="prop")]] + + +@parametrize +@pytest.mark.asyncio +async def test_datetime_with_alias(use_async: bool) -> None: + assert await transform({"required_prop": None}, DateDictWithRequiredAlias, use_async) == {"prop": None} # type: ignore[comparison-overlap] + assert await transform( + {"required_prop": date.fromisoformat("2023-02-23")}, DateDictWithRequiredAlias, use_async + ) == {"prop": "2023-02-23"} # type: ignore[comparison-overlap] + + +class MyModel(BaseModel): + foo: str + + +@parametrize +@pytest.mark.asyncio +async def test_pydantic_model_to_dictionary(use_async: bool) -> None: + assert cast(Any, await transform(MyModel(foo="hi!"), Any, use_async)) == {"foo": "hi!"} + assert cast(Any, await transform(MyModel.construct(foo="hi!"), Any, use_async)) == {"foo": "hi!"} + + +@parametrize +@pytest.mark.asyncio +async def test_pydantic_empty_model(use_async: bool) -> None: + assert cast(Any, await transform(MyModel.construct(), Any, use_async)) == {} + + +@parametrize +@pytest.mark.asyncio +async def test_pydantic_unknown_field(use_async: bool) -> None: + assert cast(Any, await transform(MyModel.construct(my_untyped_field=True), Any, use_async)) == { + "my_untyped_field": True + } + + +@parametrize +@pytest.mark.asyncio +async def test_pydantic_mismatched_types(use_async: bool) -> None: + model = MyModel.construct(foo=True) + if PYDANTIC_V2: + with pytest.warns(UserWarning): + params = await transform(model, Any, use_async) + else: + params = await transform(model, Any, use_async) + assert cast(Any, params) == {"foo": True} + + +@parametrize +@pytest.mark.asyncio +async def test_pydantic_mismatched_object_type(use_async: bool) -> None: + model = MyModel.construct(foo=MyModel.construct(hello="world")) + if PYDANTIC_V2: + with pytest.warns(UserWarning): + params = await transform(model, Any, use_async) + else: + params = await transform(model, Any, use_async) + assert cast(Any, params) == {"foo": {"hello": "world"}} + + +class ModelNestedObjects(BaseModel): + nested: MyModel + + +@parametrize +@pytest.mark.asyncio +async def test_pydantic_nested_objects(use_async: bool) -> None: + model = ModelNestedObjects.construct(nested={"foo": "stainless"}) + assert isinstance(model.nested, MyModel) + assert cast(Any, await transform(model, Any, use_async)) == {"nested": {"foo": "stainless"}} + + +class ModelWithDefaultField(BaseModel): + foo: str + with_none_default: Union[str, None] = None + with_str_default: str = "foo" + + +@parametrize +@pytest.mark.asyncio +async def test_pydantic_default_field(use_async: bool) -> None: + # should be excluded when defaults are used + model = ModelWithDefaultField.construct() + assert model.with_none_default is None + assert model.with_str_default == "foo" + assert cast(Any, await transform(model, Any, use_async)) == {} + + # should be included when the default value is explicitly given + model = ModelWithDefaultField.construct(with_none_default=None, with_str_default="foo") + assert model.with_none_default is None + assert model.with_str_default == "foo" + assert cast(Any, await transform(model, Any, use_async)) == {"with_none_default": None, "with_str_default": "foo"} + + # should be included when a non-default value is explicitly given + model = ModelWithDefaultField.construct(with_none_default="bar", with_str_default="baz") + assert model.with_none_default == "bar" + assert model.with_str_default == "baz" + assert cast(Any, await transform(model, Any, use_async)) == {"with_none_default": "bar", "with_str_default": "baz"} + + +class TypedDictIterableUnion(TypedDict): + foo: Annotated[Union[Bar8, Iterable[Baz8]], PropertyInfo(alias="FOO")] + + +class Bar8(TypedDict): + foo_bar: Annotated[str, PropertyInfo(alias="fooBar")] + + +class Baz8(TypedDict): + foo_baz: Annotated[str, PropertyInfo(alias="fooBaz")] + + +@parametrize +@pytest.mark.asyncio +async def test_iterable_of_dictionaries(use_async: bool) -> None: + assert await transform({"foo": [{"foo_baz": "bar"}]}, TypedDictIterableUnion, use_async) == { + "FOO": [{"fooBaz": "bar"}] + } + assert cast(Any, await transform({"foo": ({"foo_baz": "bar"},)}, TypedDictIterableUnion, use_async)) == { + "FOO": [{"fooBaz": "bar"}] + } + + def my_iter() -> Iterable[Baz8]: + yield {"foo_baz": "hello"} + yield {"foo_baz": "world"} + + assert await transform({"foo": my_iter()}, TypedDictIterableUnion, use_async) == { + "FOO": [{"fooBaz": "hello"}, {"fooBaz": "world"}] + } + + +class TypedDictIterableUnionStr(TypedDict): + foo: Annotated[Union[str, Iterable[Baz8]], PropertyInfo(alias="FOO")] + + +@parametrize +@pytest.mark.asyncio +async def test_iterable_union_str(use_async: bool) -> None: + assert await transform({"foo": "bar"}, TypedDictIterableUnionStr, use_async) == {"FOO": "bar"} + assert cast(Any, await transform(iter([{"foo_baz": "bar"}]), Union[str, Iterable[Baz8]], use_async)) == [ + {"fooBaz": "bar"} + ] + + +class TypedDictBase64Input(TypedDict): + foo: Annotated[Union[str, Base64FileInput], PropertyInfo(format="base64")] + + +@parametrize +@pytest.mark.asyncio +async def test_base64_file_input(use_async: bool) -> None: + # strings are left as-is + assert await transform({"foo": "bar"}, TypedDictBase64Input, use_async) == {"foo": "bar"} + + # pathlib.Path is automatically converted to base64 + assert await transform({"foo": SAMPLE_FILE_PATH}, TypedDictBase64Input, use_async) == { + "foo": "SGVsbG8sIHdvcmxkIQo=" + } # type: ignore[comparison-overlap] + + # io instances are automatically converted to base64 + assert await transform({"foo": io.StringIO("Hello, world!")}, TypedDictBase64Input, use_async) == { + "foo": "SGVsbG8sIHdvcmxkIQ==" + } # type: ignore[comparison-overlap] + assert await transform({"foo": io.BytesIO(b"Hello, world!")}, TypedDictBase64Input, use_async) == { + "foo": "SGVsbG8sIHdvcmxkIQ==" + } # type: ignore[comparison-overlap] diff --git a/tests/test_utils/test_proxy.py b/tests/test_utils/test_proxy.py new file mode 100644 index 000000000..43354df6a --- /dev/null +++ b/tests/test_utils/test_proxy.py @@ -0,0 +1,23 @@ +import operator +from typing import Any +from typing_extensions import override + +from runloop._utils import LazyProxy + + +class RecursiveLazyProxy(LazyProxy[Any]): + @override + def __load__(self) -> Any: + return self + + def __call__(self, *_args: Any, **_kwds: Any) -> Any: + raise RuntimeError("This should never be called!") + + +def test_recursive_proxy() -> None: + proxy = RecursiveLazyProxy() + assert repr(proxy) == "RecursiveLazyProxy" + assert str(proxy) == "RecursiveLazyProxy" + assert dir(proxy) == [] + assert type(proxy).__name__ == "RecursiveLazyProxy" + assert type(operator.attrgetter("name.foo.bar.baz")(proxy)).__name__ == "RecursiveLazyProxy" diff --git a/tests/test_utils/test_typing.py b/tests/test_utils/test_typing.py new file mode 100644 index 000000000..bd85c7898 --- /dev/null +++ b/tests/test_utils/test_typing.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from typing import Generic, TypeVar, cast + +from runloop._utils import extract_type_var_from_base + +_T = TypeVar("_T") +_T2 = TypeVar("_T2") +_T3 = TypeVar("_T3") + + +class BaseGeneric(Generic[_T]): + ... + + +class SubclassGeneric(BaseGeneric[_T]): + ... + + +class BaseGenericMultipleTypeArgs(Generic[_T, _T2, _T3]): + ... + + +class SubclassGenericMultipleTypeArgs(BaseGenericMultipleTypeArgs[_T, _T2, _T3]): + ... + + +class SubclassDifferentOrderGenericMultipleTypeArgs(BaseGenericMultipleTypeArgs[_T2, _T, _T3]): + ... + + +def test_extract_type_var() -> None: + assert ( + extract_type_var_from_base( + BaseGeneric[int], + index=0, + generic_bases=cast("tuple[type, ...]", (BaseGeneric,)), + ) + == int + ) + + +def test_extract_type_var_generic_subclass() -> None: + assert ( + extract_type_var_from_base( + SubclassGeneric[int], + index=0, + generic_bases=cast("tuple[type, ...]", (BaseGeneric,)), + ) + == int + ) + + +def test_extract_type_var_multiple() -> None: + typ = BaseGenericMultipleTypeArgs[int, str, None] + + generic_bases = cast("tuple[type, ...]", (BaseGenericMultipleTypeArgs,)) + assert extract_type_var_from_base(typ, index=0, generic_bases=generic_bases) == int + assert extract_type_var_from_base(typ, index=1, generic_bases=generic_bases) == str + assert extract_type_var_from_base(typ, index=2, generic_bases=generic_bases) == type(None) + + +def test_extract_type_var_generic_subclass_multiple() -> None: + typ = SubclassGenericMultipleTypeArgs[int, str, None] + + generic_bases = cast("tuple[type, ...]", (BaseGenericMultipleTypeArgs,)) + assert extract_type_var_from_base(typ, index=0, generic_bases=generic_bases) == int + assert extract_type_var_from_base(typ, index=1, generic_bases=generic_bases) == str + assert extract_type_var_from_base(typ, index=2, generic_bases=generic_bases) == type(None) + + +def test_extract_type_var_generic_subclass_different_ordering_multiple() -> None: + typ = SubclassDifferentOrderGenericMultipleTypeArgs[int, str, None] + + generic_bases = cast("tuple[type, ...]", (BaseGenericMultipleTypeArgs,)) + assert extract_type_var_from_base(typ, index=0, generic_bases=generic_bases) == int + assert extract_type_var_from_base(typ, index=1, generic_bases=generic_bases) == str + assert extract_type_var_from_base(typ, index=2, generic_bases=generic_bases) == type(None) diff --git a/tests/utils.py b/tests/utils.py new file mode 100644 index 000000000..c26d7cc0c --- /dev/null +++ b/tests/utils.py @@ -0,0 +1,151 @@ +from __future__ import annotations + +import os +import inspect +import traceback +import contextlib +from typing import Any, TypeVar, Iterator, cast +from datetime import date, datetime +from typing_extensions import Literal, get_args, get_origin, assert_type + +from runloop._types import NoneType +from runloop._utils import ( + is_dict, + is_list, + is_list_type, + is_union_type, + extract_type_arg, + is_annotated_type, +) +from runloop._compat import PYDANTIC_V2, field_outer_type, get_model_fields +from runloop._models import BaseModel + +BaseModelT = TypeVar("BaseModelT", bound=BaseModel) + + +def assert_matches_model(model: type[BaseModelT], value: BaseModelT, *, path: list[str]) -> bool: + for name, field in get_model_fields(model).items(): + field_value = getattr(value, name) + if PYDANTIC_V2: + allow_none = False + else: + # in v1 nullability was structured differently + # https://docs.pydantic.dev/2.0/migration/#required-optional-and-nullable-fields + allow_none = getattr(field, "allow_none", False) + + assert_matches_type( + field_outer_type(field), + field_value, + path=[*path, name], + allow_none=allow_none, + ) + + return True + + +# Note: the `path` argument is only used to improve error messages when `--showlocals` is used +def assert_matches_type( + type_: Any, + value: object, + *, + path: list[str], + allow_none: bool = False, +) -> None: + # unwrap `Annotated[T, ...]` -> `T` + if is_annotated_type(type_): + type_ = extract_type_arg(type_, 0) + + if allow_none and value is None: + return + + if type_ is None or type_ is NoneType: + assert value is None + return + + origin = get_origin(type_) or type_ + + if is_list_type(type_): + return _assert_list_type(type_, value) + + if origin == str: + assert isinstance(value, str) + elif origin == int: + assert isinstance(value, int) + elif origin == bool: + assert isinstance(value, bool) + elif origin == float: + assert isinstance(value, float) + elif origin == bytes: + assert isinstance(value, bytes) + elif origin == datetime: + assert isinstance(value, datetime) + elif origin == date: + assert isinstance(value, date) + elif origin == object: + # nothing to do here, the expected type is unknown + pass + elif origin == Literal: + assert value in get_args(type_) + elif origin == dict: + assert is_dict(value) + + args = get_args(type_) + key_type = args[0] + items_type = args[1] + + for key, item in value.items(): + assert_matches_type(key_type, key, path=[*path, ""]) + assert_matches_type(items_type, item, path=[*path, ""]) + elif is_union_type(type_): + variants = get_args(type_) + + try: + none_index = variants.index(type(None)) + except ValueError: + pass + else: + # special case Optional[T] for better error messages + if len(variants) == 2: + if value is None: + # valid + return + + return assert_matches_type(type_=variants[not none_index], value=value, path=path) + + for i, variant in enumerate(variants): + try: + assert_matches_type(variant, value, path=[*path, f"variant {i}"]) + return + except AssertionError: + traceback.print_exc() + continue + + raise AssertionError("Did not match any variants") + elif issubclass(origin, BaseModel): + assert isinstance(value, type_) + assert assert_matches_model(type_, cast(Any, value), path=path) + elif inspect.isclass(origin) and origin.__name__ == "HttpxBinaryResponseContent": + assert value.__class__.__name__ == "HttpxBinaryResponseContent" + else: + assert None, f"Unhandled field type: {type_}" + + +def _assert_list_type(type_: type[object], value: object) -> None: + assert is_list(value) + + inner_type = get_args(type_)[0] + for entry in value: + assert_type(inner_type, entry) # type: ignore + + +@contextlib.contextmanager +def update_env(**new_env: str) -> Iterator[None]: + old = os.environ.copy() + + try: + os.environ.update(new_env) + + yield None + finally: + os.environ.clear() + os.environ.update(old) From 347bca9b1cf6155a8fbc201231dc57a97ffdeaaa Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 19 Jun 2024 17:55:24 +0000 Subject: [PATCH 002/993] feat(api): update via SDK Studio --- src/runloop/_base_client.py | 17 +++++++++++++---- src/runloop/_utils/__init__.py | 1 + src/runloop/_utils/_reflection.py | 8 ++++++++ src/runloop/_utils/_sync.py | 19 ++++++++++++++++++- 4 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 src/runloop/_utils/_reflection.py diff --git a/src/runloop/_base_client.py b/src/runloop/_base_client.py index c3136ad16..9e1f25f1f 100644 --- a/src/runloop/_base_client.py +++ b/src/runloop/_base_client.py @@ -60,7 +60,7 @@ RequestOptions, ModelBuilderProtocol, ) -from ._utils import is_dict, is_list, is_given, lru_cache, is_mapping +from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping from ._compat import model_copy, model_dump from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type from ._response import ( @@ -358,6 +358,7 @@ def __init__( self._custom_query = custom_query or {} self._strict_response_validation = _strict_response_validation self._idempotency_header = None + self._platform: Platform | None = None if max_retries is None: # pyright: ignore[reportUnnecessaryComparison] raise TypeError( @@ -622,7 +623,10 @@ def base_url(self, url: URL | str) -> None: self._base_url = self._enforce_trailing_slash(url if isinstance(url, URL) else URL(url)) def platform_headers(self) -> Dict[str, str]: - return platform_headers(self._version) + # the actual implementation is in a separate `lru_cache` decorated + # function because adding `lru_cache` to methods will leak memory + # https://github.com/python/cpython/issues/88476 + return platform_headers(self._version, platform=self._platform) def _parse_retry_after_header(self, response_headers: Optional[httpx.Headers] = None) -> float | None: """Returns a float of the number of seconds (not milliseconds) to wait after retrying, or None if unspecified. @@ -1498,6 +1502,11 @@ async def _request( stream_cls: type[_AsyncStreamT] | None, remaining_retries: int | None, ) -> ResponseT | _AsyncStreamT: + if self._platform is None: + # `get_platform` can make blocking IO calls so we + # execute it earlier while we are in an async context + self._platform = await asyncify(get_platform)() + cast_to = self._maybe_override_cast_to(cast_to, options) await self._prepare_options(options) @@ -1921,11 +1930,11 @@ def get_platform() -> Platform: @lru_cache(maxsize=None) -def platform_headers(version: str) -> Dict[str, str]: +def platform_headers(version: str, *, platform: Platform | None) -> Dict[str, str]: return { "X-Stainless-Lang": "python", "X-Stainless-Package-Version": version, - "X-Stainless-OS": str(get_platform()), + "X-Stainless-OS": str(platform or get_platform()), "X-Stainless-Arch": str(get_architecture()), "X-Stainless-Runtime": get_python_runtime(), "X-Stainless-Runtime-Version": get_python_version(), diff --git a/src/runloop/_utils/__init__.py b/src/runloop/_utils/__init__.py index 31b5b2279..667e2473f 100644 --- a/src/runloop/_utils/__init__.py +++ b/src/runloop/_utils/__init__.py @@ -49,3 +49,4 @@ maybe_transform as maybe_transform, async_maybe_transform as async_maybe_transform, ) +from ._reflection import function_has_argument as function_has_argument diff --git a/src/runloop/_utils/_reflection.py b/src/runloop/_utils/_reflection.py new file mode 100644 index 000000000..e134f58e0 --- /dev/null +++ b/src/runloop/_utils/_reflection.py @@ -0,0 +1,8 @@ +import inspect +from typing import Any, Callable + + +def function_has_argument(func: Callable[..., Any], arg_name: str) -> bool: + """Returns whether or not the given function has a specific parameter""" + sig = inspect.signature(func) + return arg_name in sig.parameters diff --git a/src/runloop/_utils/_sync.py b/src/runloop/_utils/_sync.py index 595924e5b..d0d810337 100644 --- a/src/runloop/_utils/_sync.py +++ b/src/runloop/_utils/_sync.py @@ -7,6 +7,8 @@ import anyio import anyio.to_thread +from ._reflection import function_has_argument + T_Retval = TypeVar("T_Retval") T_ParamSpec = ParamSpec("T_ParamSpec") @@ -59,6 +61,21 @@ def do_work(arg1, arg2, kwarg1="", kwarg2="") -> str: async def wrapper(*args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs) -> T_Retval: partial_f = functools.partial(function, *args, **kwargs) - return await anyio.to_thread.run_sync(partial_f, cancellable=cancellable, limiter=limiter) + + # In `v4.1.0` anyio added the `abandon_on_cancel` argument and deprecated the old + # `cancellable` argument, so we need to use the new `abandon_on_cancel` to avoid + # surfacing deprecation warnings. + if function_has_argument(anyio.to_thread.run_sync, "abandon_on_cancel"): + return await anyio.to_thread.run_sync( + partial_f, + abandon_on_cancel=cancellable, + limiter=limiter, + ) + + return await anyio.to_thread.run_sync( + partial_f, + cancellable=cancellable, + limiter=limiter, + ) return wrapper From 809296fa4f2d71f2c8405007eff957496848b201 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 20 Jun 2024 18:22:03 +0000 Subject: [PATCH 003/993] chore: update SDK settings --- .github/workflows/create-releases.yml | 38 +++++++++++ .../handle-release-pr-title-edit.yml | 25 +++++++ .github/workflows/publish-pypi.yml | 27 ++++++++ .github/workflows/release-doctor.yml | 20 ++++++ .release-please-manifest.json | 3 + CONTRIBUTING.md | 4 +- README.md | 10 +-- bin/check-release-environment | 36 ++++++++++ pyproject.toml | 6 +- release-please-config.json | 66 +++++++++++++++++++ src/runloop/_version.py | 2 +- 11 files changed, 226 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/create-releases.yml create mode 100644 .github/workflows/handle-release-pr-title-edit.yml create mode 100644 .github/workflows/publish-pypi.yml create mode 100644 .github/workflows/release-doctor.yml create mode 100644 .release-please-manifest.json create mode 100644 bin/check-release-environment create mode 100644 release-please-config.json diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml new file mode 100644 index 000000000..95d27cbf1 --- /dev/null +++ b/.github/workflows/create-releases.yml @@ -0,0 +1,38 @@ +name: Create releases +on: + schedule: + - cron: '0 5 * * *' # every day at 5am UTC + push: + branches: + - main + +jobs: + release: + name: release + if: github.ref == 'refs/heads/main' && github.repository == 'undefined/api-client-python' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: stainless-api/trigger-release-please@v1 + id: release + with: + repo: ${{ github.event.repository.full_name }} + stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} + + - name: Install Rye + if: ${{ steps.release.outputs.releases_created }} + run: | + curl -sSf https://rye.astral.sh/get | bash + echo "$HOME/.rye/shims" >> $GITHUB_PATH + env: + RYE_VERSION: 0.24.0 + RYE_INSTALL_OPTION: "--yes" + + - name: Publish to PyPI + if: ${{ steps.release.outputs.releases_created }} + run: | + bash ./bin/publish-pypi + env: + PYPI_TOKEN: ${{ secrets.RUNLOOP_PYPI_TOKEN || secrets.PYPI_TOKEN }} diff --git a/.github/workflows/handle-release-pr-title-edit.yml b/.github/workflows/handle-release-pr-title-edit.yml new file mode 100644 index 000000000..85333d417 --- /dev/null +++ b/.github/workflows/handle-release-pr-title-edit.yml @@ -0,0 +1,25 @@ +name: Handle release PR title edits +on: + pull_request: + types: + - edited + - unlabeled + +jobs: + update_pr_content: + name: Update pull request content + if: | + ((github.event.action == 'edited' && github.event.changes.title.from != github.event.pull_request.title) || + (github.event.action == 'unlabeled' && github.event.label.name == 'autorelease: custom version')) && + startsWith(github.event.pull_request.head.ref, 'release-please--') && + github.event.pull_request.state == 'open' && + github.event.sender.login != 'stainless-bot' && + github.event.sender.login != 'stainless-app' && + github.repository == 'undefined/api-client-python' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: stainless-api/trigger-release-please@v1 + with: + repo: ${{ github.event.repository.full_name }} + stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml new file mode 100644 index 000000000..482a72a73 --- /dev/null +++ b/.github/workflows/publish-pypi.yml @@ -0,0 +1,27 @@ +# workflow for re-running publishing to PyPI in case it fails for some reason +# you can run this workflow by navigating to https://www.github.com/undefined/api-client-python/actions/workflows/publish-pypi.yml +name: Publish PyPI +on: + workflow_dispatch: + +jobs: + publish: + name: publish + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install Rye + run: | + curl -sSf https://rye.astral.sh/get | bash + echo "$HOME/.rye/shims" >> $GITHUB_PATH + env: + RYE_VERSION: 0.24.0 + RYE_INSTALL_OPTION: "--yes" + + - name: Publish to PyPI + run: | + bash ./bin/publish-pypi + env: + PYPI_TOKEN: ${{ secrets.RUNLOOP_PYPI_TOKEN || secrets.PYPI_TOKEN }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml new file mode 100644 index 000000000..3134ede3f --- /dev/null +++ b/.github/workflows/release-doctor.yml @@ -0,0 +1,20 @@ +name: Release Doctor +on: + pull_request: + workflow_dispatch: + +jobs: + release_doctor: + name: release doctor + runs-on: ubuntu-latest + if: github.repository == 'undefined/api-client-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + + steps: + - uses: actions/checkout@v4 + + - name: Check release environment + run: | + bash ./bin/check-release-environment + env: + STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }} + PYPI_TOKEN: ${{ secrets.RUNLOOP_PYPI_TOKEN || secrets.PYPI_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 000000000..c4762802e --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.0.1-alpha.0" +} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 87045143c..592cea0af 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,7 +59,7 @@ If you’d like to use the repository from source, you can either install from g To install via git: ```bash -pip install git+ssh://git@github.com/stainless-sdks/runloop-python.git +pip install git+ssh://git@github.com/undefined/api-client-python.git ``` Alternatively, you can build from source and install the wheel file: @@ -117,7 +117,7 @@ the changes aren't made through the automated pipeline, you may want to make rel ### Publish with a GitHub workflow -You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/stainless-sdks/runloop-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. +You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/undefined/api-client-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. ### Publish manually diff --git a/README.md b/README.md index 44d93d31a..3085729f3 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ The REST API documentation can be found [on runloop.ai](https://runloop.ai). The ## Installation ```sh -# install from this staging repo -pip install git+ssh://git@github.com/stainless-sdks/runloop-python.git +# install from the production repo +pip install git+ssh://git@github.com/undefined/api-client-python.git ``` > [!NOTE] @@ -206,9 +206,9 @@ code_handle = response.parse() # get the object that `code_handles.create()` wo print(code_handle.id) ``` -These methods return an [`APIResponse`](https://github.com/stainless-sdks/runloop-python/tree/main/src/runloop/_response.py) object. +These methods return an [`APIResponse`](https://github.com/undefined/api-client-python/tree/main/src/runloop/_response.py) object. -The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/runloop-python/tree/main/src/runloop/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. +The async client returns an [`AsyncAPIResponse`](https://github.com/undefined/api-client-python/tree/main/src/runloop/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. #### `.with_streaming_response` @@ -296,7 +296,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. -We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/runloop-python/issues) with questions, bugs, or suggestions. +We are keen for your feedback; please open an [issue](https://www.github.com/undefined/api-client-python/issues) with questions, bugs, or suggestions. ## Requirements diff --git a/bin/check-release-environment b/bin/check-release-environment new file mode 100644 index 000000000..2039f2d0e --- /dev/null +++ b/bin/check-release-environment @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +warnings=() +errors=() + +if [ -z "${STAINLESS_API_KEY}" ]; then + errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.") +fi + +if [ -z "${PYPI_TOKEN}" ]; then + warnings+=("The RUNLOOP_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") +fi + +lenWarnings=${#warnings[@]} + +if [[ lenWarnings -gt 0 ]]; then + echo -e "Found the following warnings in the release environment:\n" + + for warning in "${warnings[@]}"; do + echo -e "- $warning\n" + done +fi + +lenErrors=${#errors[@]} + +if [[ lenErrors -gt 0 ]]; then + echo -e "Found the following errors in the release environment:\n" + + for error in "${errors[@]}"; do + echo -e "- $error\n" + done + + exit 1 +fi + +echo "The environment is ready to push releases!" diff --git a/pyproject.toml b/pyproject.toml index 24a36fd0a..2a865d3fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,8 +39,8 @@ classifiers = [ [project.urls] -Homepage = "https://github.com/stainless-sdks/runloop-python" -Repository = "https://github.com/stainless-sdks/runloop-python" +Homepage = "https://github.com/undefined/api-client-python" +Repository = "https://github.com/undefined/api-client-python" @@ -108,7 +108,7 @@ path = "README.md" [[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] # replace relative links with absolute links pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)' -replacement = '[\1](https://github.com/stainless-sdks/runloop-python/tree/main/\g<2>)' +replacement = '[\1](https://github.com/undefined/api-client-python/tree/main/\g<2>)' [tool.black] line-length = 120 diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 000000000..3bde9481f --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,66 @@ +{ + "packages": { + ".": {} + }, + "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", + "include-v-in-tag": true, + "include-component-in-tag": false, + "versioning": "prerelease", + "prerelease": true, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false, + "pull-request-header": "Automated Release PR", + "pull-request-title-pattern": "release: ${version}", + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "revert", + "section": "Reverts" + }, + { + "type": "chore", + "section": "Chores" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "style", + "section": "Styles" + }, + { + "type": "refactor", + "section": "Refactors" + }, + { + "type": "test", + "section": "Tests", + "hidden": true + }, + { + "type": "build", + "section": "Build System" + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + } + ], + "release-type": "python", + "extra-files": [ + "src/runloop/_version.py" + ] +} \ No newline at end of file diff --git a/src/runloop/_version.py b/src/runloop/_version.py index 5c37f7fda..d24c5a445 100644 --- a/src/runloop/_version.py +++ b/src/runloop/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop" -__version__ = "0.0.1-alpha.0" +__version__ = "0.0.1-alpha.0" # x-release-please-version From 0e2e87f2f56208d8870f53c160165d5e59c15259 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Jun 2024 18:33:20 +0000 Subject: [PATCH 004/993] chore: go live (#2) --- .github/workflows/create-releases.yml | 38 ------------------- .../handle-release-pr-title-edit.yml | 25 ------------ .github/workflows/publish-pypi.yml | 8 +++- .github/workflows/release-doctor.yml | 3 +- CONTRIBUTING.md | 4 +- README.md | 8 ++-- bin/check-release-environment | 4 -- pyproject.toml | 6 +-- 8 files changed, 16 insertions(+), 80 deletions(-) delete mode 100644 .github/workflows/create-releases.yml delete mode 100644 .github/workflows/handle-release-pr-title-edit.yml diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml deleted file mode 100644 index 95d27cbf1..000000000 --- a/.github/workflows/create-releases.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Create releases -on: - schedule: - - cron: '0 5 * * *' # every day at 5am UTC - push: - branches: - - main - -jobs: - release: - name: release - if: github.ref == 'refs/heads/main' && github.repository == 'undefined/api-client-python' - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - uses: stainless-api/trigger-release-please@v1 - id: release - with: - repo: ${{ github.event.repository.full_name }} - stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} - - - name: Install Rye - if: ${{ steps.release.outputs.releases_created }} - run: | - curl -sSf https://rye.astral.sh/get | bash - echo "$HOME/.rye/shims" >> $GITHUB_PATH - env: - RYE_VERSION: 0.24.0 - RYE_INSTALL_OPTION: "--yes" - - - name: Publish to PyPI - if: ${{ steps.release.outputs.releases_created }} - run: | - bash ./bin/publish-pypi - env: - PYPI_TOKEN: ${{ secrets.RUNLOOP_PYPI_TOKEN || secrets.PYPI_TOKEN }} diff --git a/.github/workflows/handle-release-pr-title-edit.yml b/.github/workflows/handle-release-pr-title-edit.yml deleted file mode 100644 index 85333d417..000000000 --- a/.github/workflows/handle-release-pr-title-edit.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Handle release PR title edits -on: - pull_request: - types: - - edited - - unlabeled - -jobs: - update_pr_content: - name: Update pull request content - if: | - ((github.event.action == 'edited' && github.event.changes.title.from != github.event.pull_request.title) || - (github.event.action == 'unlabeled' && github.event.label.name == 'autorelease: custom version')) && - startsWith(github.event.pull_request.head.ref, 'release-please--') && - github.event.pull_request.state == 'open' && - github.event.sender.login != 'stainless-bot' && - github.event.sender.login != 'stainless-app' && - github.repository == 'undefined/api-client-python' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: stainless-api/trigger-release-please@v1 - with: - repo: ${{ github.event.repository.full_name }} - stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 482a72a73..065780d52 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -1,9 +1,13 @@ -# workflow for re-running publishing to PyPI in case it fails for some reason -# you can run this workflow by navigating to https://www.github.com/undefined/api-client-python/actions/workflows/publish-pypi.yml +# This workflow is triggered when a GitHub release is created. +# It can also be run manually to re-publish to PyPI in case it failed for some reason. +# You can run this workflow by navigating to https://www.github.com/runloopai/api-client-python/actions/workflows/publish-pypi.yml name: Publish PyPI on: workflow_dispatch: + release: + types: [published] + jobs: publish: name: publish diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 3134ede3f..58c1c1917 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -7,7 +7,7 @@ jobs: release_doctor: name: release doctor runs-on: ubuntu-latest - if: github.repository == 'undefined/api-client-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + if: github.repository == 'runloopai/api-client-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - uses: actions/checkout@v4 @@ -16,5 +16,4 @@ jobs: run: | bash ./bin/check-release-environment env: - STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }} PYPI_TOKEN: ${{ secrets.RUNLOOP_PYPI_TOKEN || secrets.PYPI_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 592cea0af..1f39c2742 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,7 +59,7 @@ If you’d like to use the repository from source, you can either install from g To install via git: ```bash -pip install git+ssh://git@github.com/undefined/api-client-python.git +pip install git+ssh://git@github.com/runloopai/api-client-python.git ``` Alternatively, you can build from source and install the wheel file: @@ -117,7 +117,7 @@ the changes aren't made through the automated pipeline, you may want to make rel ### Publish with a GitHub workflow -You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/undefined/api-client-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. +You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/runloopai/api-client-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. ### Publish manually diff --git a/README.md b/README.md index 3085729f3..9e3baa13f 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The REST API documentation can be found [on runloop.ai](https://runloop.ai). The ```sh # install from the production repo -pip install git+ssh://git@github.com/undefined/api-client-python.git +pip install git+ssh://git@github.com/runloopai/api-client-python.git ``` > [!NOTE] @@ -206,9 +206,9 @@ code_handle = response.parse() # get the object that `code_handles.create()` wo print(code_handle.id) ``` -These methods return an [`APIResponse`](https://github.com/undefined/api-client-python/tree/main/src/runloop/_response.py) object. +These methods return an [`APIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop/_response.py) object. -The async client returns an [`AsyncAPIResponse`](https://github.com/undefined/api-client-python/tree/main/src/runloop/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. +The async client returns an [`AsyncAPIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. #### `.with_streaming_response` @@ -296,7 +296,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. -We are keen for your feedback; please open an [issue](https://www.github.com/undefined/api-client-python/issues) with questions, bugs, or suggestions. +We are keen for your feedback; please open an [issue](https://www.github.com/runloopai/api-client-python/issues) with questions, bugs, or suggestions. ## Requirements diff --git a/bin/check-release-environment b/bin/check-release-environment index 2039f2d0e..bbcc4181f 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -3,10 +3,6 @@ warnings=() errors=() -if [ -z "${STAINLESS_API_KEY}" ]; then - errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.") -fi - if [ -z "${PYPI_TOKEN}" ]; then warnings+=("The RUNLOOP_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") fi diff --git a/pyproject.toml b/pyproject.toml index 2a865d3fc..172cdab8e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,8 +39,8 @@ classifiers = [ [project.urls] -Homepage = "https://github.com/undefined/api-client-python" -Repository = "https://github.com/undefined/api-client-python" +Homepage = "https://github.com/runloopai/api-client-python" +Repository = "https://github.com/runloopai/api-client-python" @@ -108,7 +108,7 @@ path = "README.md" [[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] # replace relative links with absolute links pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)' -replacement = '[\1](https://github.com/undefined/api-client-python/tree/main/\g<2>)' +replacement = '[\1](https://github.com/runloopai/api-client-python/tree/main/\g<2>)' [tool.black] line-length = 120 From 0d090f2ef714beca24fd0283aef257606eef4099 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 17:35:10 +0000 Subject: [PATCH 005/993] chore: update SDK settings (#3) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9e3baa13f..d1e7ef90e 100644 --- a/README.md +++ b/README.md @@ -267,7 +267,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c - Support for proxies - Custom transports -- Additional [advanced](https://www.python-httpx.org/advanced/#client-instances) functionality +- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality ```python from runloop import Runloop, DefaultHttpxClient From 5f4770d09075d36cb76603a5254ce7b1933db18a Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 25 Jun 2024 18:08:42 +0000 Subject: [PATCH 006/993] feat(api): OpenAPI spec update via Stainless API --- .stats.yml | 4 +- api.md | 6 - src/runloop/resources/functions/functions.py | 228 ---------------- .../resources/sessions/sessions/__init__.py | 14 - src/runloop/resources/sessions/sessions/kv.py | 162 ----------- .../resources/sessions/sessions/sessions.py | 32 --- src/runloop/types/__init__.py | 2 - .../types/function_invoke_async_params.py | 23 -- .../types/function_invoke_sync_params.py | 23 -- src/runloop/types/function_list.py | 4 +- .../functions/function_invocation_list.py | 4 +- src/runloop/types/project_list.py | 18 ++ src/runloop/types/projects/project_logs.py | 2 + .../types/sessions/sessions/__init__.py | 3 - .../types/sessions/sessions/kv_list_params.py | 12 - .../types/sessions/sessions/session_kv.py | 66 ----- .../shared/function_invocation_detail.py | 6 +- .../sessions/sessions/test_kv.py | 114 -------- tests/api_resources/test_functions.py | 253 ------------------ 19 files changed, 26 insertions(+), 950 deletions(-) delete mode 100644 src/runloop/resources/sessions/sessions/kv.py delete mode 100644 src/runloop/types/function_invoke_async_params.py delete mode 100644 src/runloop/types/function_invoke_sync_params.py delete mode 100644 src/runloop/types/sessions/sessions/kv_list_params.py delete mode 100644 src/runloop/types/sessions/sessions/session_kv.py delete mode 100644 tests/api_resources/sessions/sessions/test_kv.py diff --git a/.stats.yml b/.stats.yml index b7a5bc0e5..256219cc3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-778b6e08d43e3ffe57654335fe785cace2a54b805a2c2b31421d40beabc44386.yml +configured_endpoints: 18 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ab9f1a3f003af273e162d93a86042a8c482a935bc904259aac18bd459ab687e.yml diff --git a/api.md b/api.md index e8481caca..f9f3180d4 100644 --- a/api.md +++ b/api.md @@ -55,8 +55,6 @@ from runloop.types import FunctionList Methods: - client.functions.list() -> FunctionList -- client.functions.invoke_async(function_name, \*, project_name, \*\*params) -> FunctionInvocationDetail -- client.functions.invoke_sync(function_name, \*, project_name, \*\*params) -> FunctionInvocationDetail ## Invocations @@ -154,7 +152,3 @@ Types: ```python from runloop.types.sessions.sessions import SessionKv ``` - -Methods: - -- client.sessions.sessions.kv.list(session_id, \*\*params) -> SessionKv diff --git a/src/runloop/resources/functions/functions.py b/src/runloop/resources/functions/functions.py index cde41d28c..862a02546 100644 --- a/src/runloop/resources/functions/functions.py +++ b/src/runloop/resources/functions/functions.py @@ -4,7 +4,6 @@ import httpx -from ...types import function_invoke_sync_params, function_invoke_async_params from .openapi import ( OpenAPIResource, AsyncOpenAPIResource, @@ -14,10 +13,6 @@ AsyncOpenAPIResourceWithStreamingResponse, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -39,7 +34,6 @@ ) from ...types.function_list import FunctionList from .invocations.invocations import InvocationsResource, AsyncInvocationsResource -from ...types.shared.function_invocation_detail import FunctionInvocationDetail __all__ = ["FunctionsResource", "AsyncFunctionsResource"] @@ -80,105 +74,6 @@ def list( cast_to=FunctionList, ) - def invoke_async( - self, - function_name: str, - *, - project_name: str, - request: object, - runloop_meta: function_invoke_async_params.RunloopMeta | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvocationDetail: - """Invoke the remote function asynchronously. - - This will return a job id that can be - used to query the status of the function invocation. - - Args: - request: Json of the request - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not project_name: - raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}") - if not function_name: - raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}") - return self._post( - f"/v1/functions/{project_name}/{function_name}/invoke_async", - body=maybe_transform( - { - "request": request, - "runloop_meta": runloop_meta, - }, - function_invoke_async_params.FunctionInvokeAsyncParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FunctionInvocationDetail, - ) - - def invoke_sync( - self, - function_name: str, - *, - project_name: str, - request: object, - runloop_meta: function_invoke_sync_params.RunloopMeta | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvocationDetail: - """Invoke the remote function synchronously. - - This will block until the function - completes and return the result. If the function call takes too long, the - request will timeout. - - Args: - request: Json of the request - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not project_name: - raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}") - if not function_name: - raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}") - return self._post( - f"/v1/functions/{project_name}/{function_name}/invoke_sync", - body=maybe_transform( - { - "request": request, - "runloop_meta": runloop_meta, - }, - function_invoke_sync_params.FunctionInvokeSyncParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FunctionInvocationDetail, - ) - class AsyncFunctionsResource(AsyncAPIResource): @cached_property @@ -216,105 +111,6 @@ async def list( cast_to=FunctionList, ) - async def invoke_async( - self, - function_name: str, - *, - project_name: str, - request: object, - runloop_meta: function_invoke_async_params.RunloopMeta | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvocationDetail: - """Invoke the remote function asynchronously. - - This will return a job id that can be - used to query the status of the function invocation. - - Args: - request: Json of the request - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not project_name: - raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}") - if not function_name: - raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}") - return await self._post( - f"/v1/functions/{project_name}/{function_name}/invoke_async", - body=await async_maybe_transform( - { - "request": request, - "runloop_meta": runloop_meta, - }, - function_invoke_async_params.FunctionInvokeAsyncParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FunctionInvocationDetail, - ) - - async def invoke_sync( - self, - function_name: str, - *, - project_name: str, - request: object, - runloop_meta: function_invoke_sync_params.RunloopMeta | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvocationDetail: - """Invoke the remote function synchronously. - - This will block until the function - completes and return the result. If the function call takes too long, the - request will timeout. - - Args: - request: Json of the request - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not project_name: - raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}") - if not function_name: - raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}") - return await self._post( - f"/v1/functions/{project_name}/{function_name}/invoke_sync", - body=await async_maybe_transform( - { - "request": request, - "runloop_meta": runloop_meta, - }, - function_invoke_sync_params.FunctionInvokeSyncParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FunctionInvocationDetail, - ) - class FunctionsResourceWithRawResponse: def __init__(self, functions: FunctionsResource) -> None: @@ -323,12 +119,6 @@ def __init__(self, functions: FunctionsResource) -> None: self.list = to_raw_response_wrapper( functions.list, ) - self.invoke_async = to_raw_response_wrapper( - functions.invoke_async, - ) - self.invoke_sync = to_raw_response_wrapper( - functions.invoke_sync, - ) @cached_property def invocations(self) -> InvocationsResourceWithRawResponse: @@ -346,12 +136,6 @@ def __init__(self, functions: AsyncFunctionsResource) -> None: self.list = async_to_raw_response_wrapper( functions.list, ) - self.invoke_async = async_to_raw_response_wrapper( - functions.invoke_async, - ) - self.invoke_sync = async_to_raw_response_wrapper( - functions.invoke_sync, - ) @cached_property def invocations(self) -> AsyncInvocationsResourceWithRawResponse: @@ -369,12 +153,6 @@ def __init__(self, functions: FunctionsResource) -> None: self.list = to_streamed_response_wrapper( functions.list, ) - self.invoke_async = to_streamed_response_wrapper( - functions.invoke_async, - ) - self.invoke_sync = to_streamed_response_wrapper( - functions.invoke_sync, - ) @cached_property def invocations(self) -> InvocationsResourceWithStreamingResponse: @@ -392,12 +170,6 @@ def __init__(self, functions: AsyncFunctionsResource) -> None: self.list = async_to_streamed_response_wrapper( functions.list, ) - self.invoke_async = async_to_streamed_response_wrapper( - functions.invoke_async, - ) - self.invoke_sync = async_to_streamed_response_wrapper( - functions.invoke_sync, - ) @cached_property def invocations(self) -> AsyncInvocationsResourceWithStreamingResponse: diff --git a/src/runloop/resources/sessions/sessions/__init__.py b/src/runloop/resources/sessions/sessions/__init__.py index b6be412e3..cc3467b66 100644 --- a/src/runloop/resources/sessions/sessions/__init__.py +++ b/src/runloop/resources/sessions/sessions/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .kv import ( - KvResource, - AsyncKvResource, - KvResourceWithRawResponse, - AsyncKvResourceWithRawResponse, - KvResourceWithStreamingResponse, - AsyncKvResourceWithStreamingResponse, -) from .sessions import ( SessionsResource, AsyncSessionsResource, @@ -18,12 +10,6 @@ ) __all__ = [ - "KvResource", - "AsyncKvResource", - "KvResourceWithRawResponse", - "AsyncKvResourceWithRawResponse", - "KvResourceWithStreamingResponse", - "AsyncKvResourceWithStreamingResponse", "SessionsResource", "AsyncSessionsResource", "SessionsResourceWithRawResponse", diff --git a/src/runloop/resources/sessions/sessions/kv.py b/src/runloop/resources/sessions/sessions/kv.py deleted file mode 100644 index a5e6c3e19..000000000 --- a/src/runloop/resources/sessions/sessions/kv.py +++ /dev/null @@ -1,162 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( - maybe_transform, - async_maybe_transform, -) -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...._base_client import ( - make_request_options, -) -from ....types.sessions.sessions import kv_list_params -from ....types.sessions.sessions.session_kv import SessionKv - -__all__ = ["KvResource", "AsyncKvResource"] - - -class KvResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> KvResourceWithRawResponse: - return KvResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> KvResourceWithStreamingResponse: - return KvResourceWithStreamingResponse(self) - - def list( - self, - session_id: str, - *, - keys: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SessionKv: - """ - List the sessions associated with your application. - - Args: - keys: Filter KV to specific keys. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not session_id: - raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}") - return self._get( - f"/v1/sessions/sessions/{session_id}/kv", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform({"keys": keys}, kv_list_params.KvListParams), - ), - cast_to=SessionKv, - ) - - -class AsyncKvResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncKvResourceWithRawResponse: - return AsyncKvResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncKvResourceWithStreamingResponse: - return AsyncKvResourceWithStreamingResponse(self) - - async def list( - self, - session_id: str, - *, - keys: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SessionKv: - """ - List the sessions associated with your application. - - Args: - keys: Filter KV to specific keys. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not session_id: - raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}") - return await self._get( - f"/v1/sessions/sessions/{session_id}/kv", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform({"keys": keys}, kv_list_params.KvListParams), - ), - cast_to=SessionKv, - ) - - -class KvResourceWithRawResponse: - def __init__(self, kv: KvResource) -> None: - self._kv = kv - - self.list = to_raw_response_wrapper( - kv.list, - ) - - -class AsyncKvResourceWithRawResponse: - def __init__(self, kv: AsyncKvResource) -> None: - self._kv = kv - - self.list = async_to_raw_response_wrapper( - kv.list, - ) - - -class KvResourceWithStreamingResponse: - def __init__(self, kv: KvResource) -> None: - self._kv = kv - - self.list = to_streamed_response_wrapper( - kv.list, - ) - - -class AsyncKvResourceWithStreamingResponse: - def __init__(self, kv: AsyncKvResource) -> None: - self._kv = kv - - self.list = async_to_streamed_response_wrapper( - kv.list, - ) diff --git a/src/runloop/resources/sessions/sessions/sessions.py b/src/runloop/resources/sessions/sessions/sessions.py index ee454119a..bc88d75b3 100644 --- a/src/runloop/resources/sessions/sessions/sessions.py +++ b/src/runloop/resources/sessions/sessions/sessions.py @@ -4,14 +4,6 @@ import httpx -from .kv import ( - KvResource, - AsyncKvResource, - KvResourceWithRawResponse, - AsyncKvResourceWithRawResponse, - KvResourceWithStreamingResponse, - AsyncKvResourceWithStreamingResponse, -) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -31,10 +23,6 @@ class SessionsResource(SyncAPIResource): - @cached_property - def kv(self) -> KvResource: - return KvResource(self._client) - @cached_property def with_raw_response(self) -> SessionsResourceWithRawResponse: return SessionsResourceWithRawResponse(self) @@ -87,10 +75,6 @@ def list( class AsyncSessionsResource(AsyncAPIResource): - @cached_property - def kv(self) -> AsyncKvResource: - return AsyncKvResource(self._client) - @cached_property def with_raw_response(self) -> AsyncSessionsResourceWithRawResponse: return AsyncSessionsResourceWithRawResponse(self) @@ -153,10 +137,6 @@ def __init__(self, sessions: SessionsResource) -> None: sessions.list, ) - @cached_property - def kv(self) -> KvResourceWithRawResponse: - return KvResourceWithRawResponse(self._sessions.kv) - class AsyncSessionsResourceWithRawResponse: def __init__(self, sessions: AsyncSessionsResource) -> None: @@ -169,10 +149,6 @@ def __init__(self, sessions: AsyncSessionsResource) -> None: sessions.list, ) - @cached_property - def kv(self) -> AsyncKvResourceWithRawResponse: - return AsyncKvResourceWithRawResponse(self._sessions.kv) - class SessionsResourceWithStreamingResponse: def __init__(self, sessions: SessionsResource) -> None: @@ -185,10 +161,6 @@ def __init__(self, sessions: SessionsResource) -> None: sessions.list, ) - @cached_property - def kv(self) -> KvResourceWithStreamingResponse: - return KvResourceWithStreamingResponse(self._sessions.kv) - class AsyncSessionsResourceWithStreamingResponse: def __init__(self, sessions: AsyncSessionsResource) -> None: @@ -200,7 +172,3 @@ def __init__(self, sessions: AsyncSessionsResource) -> None: self.list = async_to_streamed_response_wrapper( sessions.list, ) - - @cached_property - def kv(self) -> AsyncKvResourceWithStreamingResponse: - return AsyncKvResourceWithStreamingResponse(self._sessions.kv) diff --git a/src/runloop/types/__init__.py b/src/runloop/types/__init__.py index 61884524c..6a44d4dcf 100644 --- a/src/runloop/types/__init__.py +++ b/src/runloop/types/__init__.py @@ -14,5 +14,3 @@ from .latch_fulfill_params import LatchFulfillParams as LatchFulfillParams from .code_handle_list_params import CodeHandleListParams as CodeHandleListParams from .code_handle_create_params import CodeHandleCreateParams as CodeHandleCreateParams -from .function_invoke_sync_params import FunctionInvokeSyncParams as FunctionInvokeSyncParams -from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams diff --git a/src/runloop/types/function_invoke_async_params.py b/src/runloop/types/function_invoke_async_params.py deleted file mode 100644 index a20bdf7a9..000000000 --- a/src/runloop/types/function_invoke_async_params.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["FunctionInvokeAsyncParams", "RunloopMeta"] - - -class FunctionInvokeAsyncParams(TypedDict, total=False): - project_name: Required[Annotated[str, PropertyInfo(alias="projectName")]] - - request: Required[object] - """Json of the request""" - - runloop_meta: Annotated[RunloopMeta, PropertyInfo(alias="runloopMeta")] - - -class RunloopMeta(TypedDict, total=False): - session_id: Annotated[str, PropertyInfo(alias="sessionId")] - """Json of the request""" diff --git a/src/runloop/types/function_invoke_sync_params.py b/src/runloop/types/function_invoke_sync_params.py deleted file mode 100644 index e8673db05..000000000 --- a/src/runloop/types/function_invoke_sync_params.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["FunctionInvokeSyncParams", "RunloopMeta"] - - -class FunctionInvokeSyncParams(TypedDict, total=False): - project_name: Required[Annotated[str, PropertyInfo(alias="projectName")]] - - request: Required[object] - """Json of the request""" - - runloop_meta: Annotated[RunloopMeta, PropertyInfo(alias="runloopMeta")] - - -class RunloopMeta(TypedDict, total=False): - session_id: Annotated[str, PropertyInfo(alias="sessionId")] - """Json of the request""" diff --git a/src/runloop/types/function_list.py b/src/runloop/types/function_list.py index 3c896443a..e21c2f693 100644 --- a/src/runloop/types/function_list.py +++ b/src/runloop/types/function_list.py @@ -2,8 +2,6 @@ from typing import List, Optional -from pydantic import Field as FieldInfo - from .._models import BaseModel __all__ = ["FunctionList", "Function"] @@ -13,7 +11,7 @@ class Function(BaseModel): name: Optional[str] = None """Unique name of the function.""" - project_name: Optional[str] = FieldInfo(alias="projectName", default=None) + project_name: Optional[str] = None """Unique name of the project.""" diff --git a/src/runloop/types/functions/function_invocation_list.py b/src/runloop/types/functions/function_invocation_list.py index 58f9a48ba..cc5063520 100644 --- a/src/runloop/types/functions/function_invocation_list.py +++ b/src/runloop/types/functions/function_invocation_list.py @@ -3,8 +3,6 @@ from typing import List, Optional from typing_extensions import Literal -from pydantic import Field as FieldInfo - from ..._models import BaseModel __all__ = ["FunctionInvocationList", "Invocation"] @@ -17,7 +15,7 @@ class Invocation(BaseModel): name: Optional[str] = None """Name of the invoked function.""" - project_name: Optional[str] = FieldInfo(alias="projectName", default=None) + project_name: Optional[str] = None """Project name associated with invoked function.""" status: Optional[Literal["created", "running", "success", "failure", "canceled", "suspended"]] = None diff --git a/src/runloop/types/project_list.py b/src/runloop/types/project_list.py index 7ec67b8b3..d9c977f2d 100644 --- a/src/runloop/types/project_list.py +++ b/src/runloop/types/project_list.py @@ -26,6 +26,12 @@ class ProjectActiveDeploy(BaseModel): id: Optional[str] = None """ID of the deployment.""" + deploy_commit_sha: Optional[str] = None + """Associated Commit Sha""" + + deploy_commit_time_ms: Optional[int] = None + """Associated Commit Time""" + deploy_end_time_ms: Optional[int] = None """Time the Deploy completed (Unix timestamp milliseconds).""" @@ -56,6 +62,12 @@ class ProjectInProgressDeploy(BaseModel): id: Optional[str] = None """ID of the deployment.""" + deploy_commit_sha: Optional[str] = None + """Associated Commit Sha""" + + deploy_commit_time_ms: Optional[int] = None + """Associated Commit Time""" + deploy_end_time_ms: Optional[int] = None """Time the Deploy completed (Unix timestamp milliseconds).""" @@ -86,6 +98,12 @@ class ProjectRecentDeployment(BaseModel): id: Optional[str] = None """ID of the deployment.""" + deploy_commit_sha: Optional[str] = None + """Associated Commit Sha""" + + deploy_commit_time_ms: Optional[int] = None + """Associated Commit Time""" + deploy_end_time_ms: Optional[int] = None """Time the Deploy completed (Unix timestamp milliseconds).""" diff --git a/src/runloop/types/projects/project_logs.py b/src/runloop/types/projects/project_logs.py index b3aa893d3..6b10e46c9 100644 --- a/src/runloop/types/projects/project_logs.py +++ b/src/runloop/types/projects/project_logs.py @@ -12,6 +12,8 @@ class Log(BaseModel): message: Optional[str] = None + source: Optional[str] = None + timestamp: Optional[str] = None diff --git a/src/runloop/types/sessions/sessions/__init__.py b/src/runloop/types/sessions/sessions/__init__.py index 8a4429d53..f8ee8b14b 100644 --- a/src/runloop/types/sessions/sessions/__init__.py +++ b/src/runloop/types/sessions/sessions/__init__.py @@ -1,6 +1,3 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations - -from .session_kv import SessionKv as SessionKv -from .kv_list_params import KvListParams as KvListParams diff --git a/src/runloop/types/sessions/sessions/kv_list_params.py b/src/runloop/types/sessions/sessions/kv_list_params.py deleted file mode 100644 index 8e60228f6..000000000 --- a/src/runloop/types/sessions/sessions/kv_list_params.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["KvListParams"] - - -class KvListParams(TypedDict, total=False): - keys: str - """Filter KV to specific keys.""" diff --git a/src/runloop/types/sessions/sessions/session_kv.py b/src/runloop/types/sessions/sessions/session_kv.py deleted file mode 100644 index d1e90041f..000000000 --- a/src/runloop/types/sessions/sessions/session_kv.py +++ /dev/null @@ -1,66 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, Optional -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from ...._models import BaseModel - -__all__ = ["SessionKv", "Kv"] - - -class Kv(BaseModel): - array: bool - - big_decimal: bool = FieldInfo(alias="bigDecimal") - - big_integer: bool = FieldInfo(alias="bigInteger") - - binary: bool - - boolean: bool - - container_node: bool = FieldInfo(alias="containerNode") - - double: bool - - empty: bool - - float: bool - - floating_point_number: bool = FieldInfo(alias="floatingPointNumber") - - int: bool - - integral_number: bool = FieldInfo(alias="integralNumber") - - long: bool - - missing_node: bool = FieldInfo(alias="missingNode") - - null: bool - - number: bool - - object: bool - - pojo: bool - - short: bool - - textual: bool - - value_node: bool = FieldInfo(alias="valueNode") - - node_type: Optional[ - Literal["ARRAY", "BINARY", "BOOLEAN", "MISSING", "NULL", "NUMBER", "OBJECT", "POJO", "STRING"] - ] = FieldInfo(alias="nodeType", default=None) - - -class SessionKv(BaseModel): - id: Optional[str] = None - """The ID of the session.""" - - kv: Optional[Dict[str, Kv]] = None - """The session key value storage.""" diff --git a/src/runloop/types/shared/function_invocation_detail.py b/src/runloop/types/shared/function_invocation_detail.py index 03982e19e..ef644462c 100644 --- a/src/runloop/types/shared/function_invocation_detail.py +++ b/src/runloop/types/shared/function_invocation_detail.py @@ -3,8 +3,6 @@ from typing import Optional from typing_extensions import Literal -from pydantic import Field as FieldInfo - from ..._models import BaseModel __all__ = ["FunctionInvocationDetail"] @@ -16,10 +14,10 @@ class FunctionInvocationDetail(BaseModel): error: Optional[str] = None - function_name: Optional[str] = FieldInfo(alias="functionName", default=None) + function_name: Optional[str] = None """Unique name of the function.""" - project_name: Optional[str] = FieldInfo(alias="projectName", default=None) + project_name: Optional[str] = None """Unique name of the project associated with function.""" result: Optional[object] = None diff --git a/tests/api_resources/sessions/sessions/test_kv.py b/tests/api_resources/sessions/sessions/test_kv.py deleted file mode 100644 index 13a721cb8..000000000 --- a/tests/api_resources/sessions/sessions/test_kv.py +++ /dev/null @@ -1,114 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from runloop import Runloop, AsyncRunloop -from tests.utils import assert_matches_type -from runloop.types.sessions.sessions import SessionKv - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestKv: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_list(self, client: Runloop) -> None: - kv = client.sessions.sessions.kv.list( - "string", - ) - assert_matches_type(SessionKv, kv, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Runloop) -> None: - kv = client.sessions.sessions.kv.list( - "string", - keys="string", - ) - assert_matches_type(SessionKv, kv, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Runloop) -> None: - response = client.sessions.sessions.kv.with_raw_response.list( - "string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - kv = response.parse() - assert_matches_type(SessionKv, kv, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Runloop) -> None: - with client.sessions.sessions.kv.with_streaming_response.list( - "string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - kv = response.parse() - assert_matches_type(SessionKv, kv, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `session_id` but received ''"): - client.sessions.sessions.kv.with_raw_response.list( - "", - ) - - -class TestAsyncKv: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_list(self, async_client: AsyncRunloop) -> None: - kv = await async_client.sessions.sessions.kv.list( - "string", - ) - assert_matches_type(SessionKv, kv, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: - kv = await async_client.sessions.sessions.kv.list( - "string", - keys="string", - ) - assert_matches_type(SessionKv, kv, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: - response = await async_client.sessions.sessions.kv.with_raw_response.list( - "string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - kv = await response.parse() - assert_matches_type(SessionKv, kv, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: - async with async_client.sessions.sessions.kv.with_streaming_response.list( - "string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - kv = await response.parse() - assert_matches_type(SessionKv, kv, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `session_id` but received ''"): - await async_client.sessions.sessions.kv.with_raw_response.list( - "", - ) diff --git a/tests/api_resources/test_functions.py b/tests/api_resources/test_functions.py index 5ba11633a..1b824e109 100644 --- a/tests/api_resources/test_functions.py +++ b/tests/api_resources/test_functions.py @@ -10,7 +10,6 @@ from runloop import Runloop, AsyncRunloop from tests.utils import assert_matches_type from runloop.types import FunctionList -from runloop.types.shared import FunctionInvocationDetail base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -43,132 +42,6 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert cast(Any, response.is_closed) is True - @parametrize - def test_method_invoke_async(self, client: Runloop) -> None: - function = client.functions.invoke_async( - "string", - project_name="string", - request={}, - ) - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - def test_method_invoke_async_with_all_params(self, client: Runloop) -> None: - function = client.functions.invoke_async( - "string", - project_name="string", - request={}, - runloop_meta={"session_id": "string"}, - ) - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - def test_raw_response_invoke_async(self, client: Runloop) -> None: - response = client.functions.with_raw_response.invoke_async( - "string", - project_name="string", - request={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - function = response.parse() - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - def test_streaming_response_invoke_async(self, client: Runloop) -> None: - with client.functions.with_streaming_response.invoke_async( - "string", - project_name="string", - request={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - function = response.parse() - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_invoke_async(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): - client.functions.with_raw_response.invoke_async( - "string", - project_name="", - request={}, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): - client.functions.with_raw_response.invoke_async( - "", - project_name="string", - request={}, - ) - - @parametrize - def test_method_invoke_sync(self, client: Runloop) -> None: - function = client.functions.invoke_sync( - "string", - project_name="string", - request={}, - ) - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - def test_method_invoke_sync_with_all_params(self, client: Runloop) -> None: - function = client.functions.invoke_sync( - "string", - project_name="string", - request={}, - runloop_meta={"session_id": "string"}, - ) - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - def test_raw_response_invoke_sync(self, client: Runloop) -> None: - response = client.functions.with_raw_response.invoke_sync( - "string", - project_name="string", - request={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - function = response.parse() - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - def test_streaming_response_invoke_sync(self, client: Runloop) -> None: - with client.functions.with_streaming_response.invoke_sync( - "string", - project_name="string", - request={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - function = response.parse() - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_invoke_sync(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): - client.functions.with_raw_response.invoke_sync( - "string", - project_name="", - request={}, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): - client.functions.with_raw_response.invoke_sync( - "", - project_name="string", - request={}, - ) - class TestAsyncFunctions: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -197,129 +70,3 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert_matches_type(FunctionList, function, path=["response"]) assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_invoke_async(self, async_client: AsyncRunloop) -> None: - function = await async_client.functions.invoke_async( - "string", - project_name="string", - request={}, - ) - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - async def test_method_invoke_async_with_all_params(self, async_client: AsyncRunloop) -> None: - function = await async_client.functions.invoke_async( - "string", - project_name="string", - request={}, - runloop_meta={"session_id": "string"}, - ) - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - async def test_raw_response_invoke_async(self, async_client: AsyncRunloop) -> None: - response = await async_client.functions.with_raw_response.invoke_async( - "string", - project_name="string", - request={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - function = await response.parse() - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - async def test_streaming_response_invoke_async(self, async_client: AsyncRunloop) -> None: - async with async_client.functions.with_streaming_response.invoke_async( - "string", - project_name="string", - request={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - function = await response.parse() - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_invoke_async(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): - await async_client.functions.with_raw_response.invoke_async( - "string", - project_name="", - request={}, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): - await async_client.functions.with_raw_response.invoke_async( - "", - project_name="string", - request={}, - ) - - @parametrize - async def test_method_invoke_sync(self, async_client: AsyncRunloop) -> None: - function = await async_client.functions.invoke_sync( - "string", - project_name="string", - request={}, - ) - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - async def test_method_invoke_sync_with_all_params(self, async_client: AsyncRunloop) -> None: - function = await async_client.functions.invoke_sync( - "string", - project_name="string", - request={}, - runloop_meta={"session_id": "string"}, - ) - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - async def test_raw_response_invoke_sync(self, async_client: AsyncRunloop) -> None: - response = await async_client.functions.with_raw_response.invoke_sync( - "string", - project_name="string", - request={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - function = await response.parse() - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - @parametrize - async def test_streaming_response_invoke_sync(self, async_client: AsyncRunloop) -> None: - async with async_client.functions.with_streaming_response.invoke_sync( - "string", - project_name="string", - request={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - function = await response.parse() - assert_matches_type(FunctionInvocationDetail, function, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_invoke_sync(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): - await async_client.functions.with_raw_response.invoke_sync( - "string", - project_name="", - request={}, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): - await async_client.functions.with_raw_response.invoke_sync( - "", - project_name="string", - request={}, - ) From 7aa92d9167666a1902d06cd3b2a7c5e433f60ec4 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 25 Jun 2024 18:54:06 +0000 Subject: [PATCH 007/993] feat(api): update via SDK Studio --- .github/workflows/publish-pypi.yml | 31 -- .github/workflows/release-doctor.yml | 19 -- .release-please-manifest.json | 3 - .stats.yml | 4 +- CONTRIBUTING.md | 4 +- README.md | 18 +- api.md | 98 ++----- bin/check-release-environment | 32 --- pyproject.toml | 6 +- release-please-config.json | 66 ----- src/runloop/_client.py | 16 -- src/runloop/_version.py | 2 +- src/runloop/resources/__init__.py | 28 -- src/runloop/resources/code_handles.py | 20 +- src/runloop/resources/devboxes/devboxes.py | 115 ++++++-- src/runloop/resources/devboxes/logs.py | 10 +- src/runloop/resources/functions/__init__.py | 14 - src/runloop/resources/functions/functions.py | 270 +++++++++++++++--- .../functions/invocations/invocations.py | 20 +- .../resources/functions/invocations/spans.py | 10 +- src/runloop/resources/functions/openapi.py | 114 -------- src/runloop/resources/latches.py | 159 ----------- src/runloop/resources/projects/logs.py | 10 +- src/runloop/resources/projects/projects.py | 10 +- src/runloop/resources/sessions/__init__.py | 19 -- src/runloop/resources/sessions/sessions.py | 81 ------ .../resources/sessions/sessions/__init__.py | 19 -- .../resources/sessions/sessions/sessions.py | 174 ----------- src/runloop/types/__init__.py | 22 +- ...andle_list.py => code_handle_list_view.py} | 8 +- .../{code_handle.py => code_handle_view.py} | 4 +- .../types/devbox_execution_detail_view.py | 21 ++ .../{devbox_list.py => devbox_list_view.py} | 8 +- .../types/{devbox.py => devbox_view.py} | 4 +- src/runloop/types/devboxes/__init__.py | 2 +- ..._logs_list.py => devbox_logs_list_view.py} | 4 +- .../types/function_invoke_async_params.py | 23 ++ .../types/function_invoke_sync_params.py | 23 ++ ...function_list.py => function_list_view.py} | 4 +- src/runloop/types/functions/__init__.py | 2 +- ...st.py => function_invocation_list_view.py} | 4 +- .../types/functions/invocations/__init__.py | 2 +- ...n_list.py => invocation_span_list_view.py} | 4 +- src/runloop/types/latch_fulfill_params.py | 12 - .../{project_list.py => project_list_view.py} | 4 +- src/runloop/types/projects/__init__.py | 2 - src/runloop/types/sessions/__init__.py | 6 - src/runloop/types/sessions/session.py | 12 - src/runloop/types/sessions/session_list.py | 13 - src/runloop/types/shared/__init__.py | 4 +- .../__init__.py => shared/empty_record.py} | 7 +- ....py => function_invocation_detail_view.py} | 4 +- .../project_logs_view.py} | 4 +- tests/api_resources/devboxes/test_logs.py | 14 +- .../functions/invocations/test_spans.py | 14 +- .../functions/test_invocations.py | 28 +- tests/api_resources/functions/test_openapi.py | 71 ----- tests/api_resources/projects/test_logs.py | 14 +- tests/api_resources/sessions/__init__.py | 1 - .../sessions/sessions/__init__.py | 1 - tests/api_resources/sessions/test_sessions.py | 122 -------- tests/api_resources/test_code_handles.py | 34 +-- tests/api_resources/test_devboxes.py | 138 +++++++-- tests/api_resources/test_functions.py | 267 ++++++++++++++++- tests/api_resources/test_latches.py | 105 ------- tests/api_resources/test_projects.py | 14 +- 66 files changed, 958 insertions(+), 1440 deletions(-) delete mode 100644 .github/workflows/publish-pypi.yml delete mode 100644 .github/workflows/release-doctor.yml delete mode 100644 .release-please-manifest.json delete mode 100644 bin/check-release-environment delete mode 100644 release-please-config.json delete mode 100644 src/runloop/resources/functions/openapi.py delete mode 100644 src/runloop/resources/latches.py delete mode 100644 src/runloop/resources/sessions/__init__.py delete mode 100644 src/runloop/resources/sessions/sessions.py delete mode 100644 src/runloop/resources/sessions/sessions/__init__.py delete mode 100644 src/runloop/resources/sessions/sessions/sessions.py rename src/runloop/types/{code_handle_list.py => code_handle_list_view.py} (55%) rename src/runloop/types/{code_handle.py => code_handle_view.py} (88%) create mode 100644 src/runloop/types/devbox_execution_detail_view.py rename src/runloop/types/{devbox_list.py => devbox_list_view.py} (57%) rename src/runloop/types/{devbox.py => devbox_view.py} (89%) rename src/runloop/types/devboxes/{devbox_logs_list.py => devbox_logs_list_view.py} (86%) create mode 100644 src/runloop/types/function_invoke_async_params.py create mode 100644 src/runloop/types/function_invoke_sync_params.py rename src/runloop/types/{function_list.py => function_list_view.py} (84%) rename src/runloop/types/functions/{function_invocation_list.py => function_invocation_list_view.py} (87%) rename src/runloop/types/functions/invocations/{invocation_span_list.py => invocation_span_list_view.py} (82%) delete mode 100644 src/runloop/types/latch_fulfill_params.py rename src/runloop/types/{project_list.py => project_list_view.py} (98%) delete mode 100644 src/runloop/types/sessions/__init__.py delete mode 100644 src/runloop/types/sessions/session.py delete mode 100644 src/runloop/types/sessions/session_list.py rename src/runloop/types/{sessions/sessions/__init__.py => shared/empty_record.py} (63%) rename src/runloop/types/shared/{function_invocation_detail.py => function_invocation_detail_view.py} (87%) rename src/runloop/types/{projects/project_logs.py => shared/project_logs_view.py} (85%) delete mode 100644 tests/api_resources/functions/test_openapi.py delete mode 100644 tests/api_resources/sessions/__init__.py delete mode 100644 tests/api_resources/sessions/sessions/__init__.py delete mode 100644 tests/api_resources/sessions/test_sessions.py delete mode 100644 tests/api_resources/test_latches.py diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml deleted file mode 100644 index 065780d52..000000000 --- a/.github/workflows/publish-pypi.yml +++ /dev/null @@ -1,31 +0,0 @@ -# This workflow is triggered when a GitHub release is created. -# It can also be run manually to re-publish to PyPI in case it failed for some reason. -# You can run this workflow by navigating to https://www.github.com/runloopai/api-client-python/actions/workflows/publish-pypi.yml -name: Publish PyPI -on: - workflow_dispatch: - - release: - types: [published] - -jobs: - publish: - name: publish - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Install Rye - run: | - curl -sSf https://rye.astral.sh/get | bash - echo "$HOME/.rye/shims" >> $GITHUB_PATH - env: - RYE_VERSION: 0.24.0 - RYE_INSTALL_OPTION: "--yes" - - - name: Publish to PyPI - run: | - bash ./bin/publish-pypi - env: - PYPI_TOKEN: ${{ secrets.RUNLOOP_PYPI_TOKEN || secrets.PYPI_TOKEN }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml deleted file mode 100644 index 58c1c1917..000000000 --- a/.github/workflows/release-doctor.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Release Doctor -on: - pull_request: - workflow_dispatch: - -jobs: - release_doctor: - name: release doctor - runs-on: ubuntu-latest - if: github.repository == 'runloopai/api-client-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') - - steps: - - uses: actions/checkout@v4 - - - name: Check release environment - run: | - bash ./bin/check-release-environment - env: - PYPI_TOKEN: ${{ secrets.RUNLOOP_PYPI_TOKEN || secrets.PYPI_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json deleted file mode 100644 index c4762802e..000000000 --- a/.release-please-manifest.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - ".": "0.0.1-alpha.0" -} \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 256219cc3..7fd519df4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 18 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ab9f1a3f003af273e162d93a86042a8c482a935bc904259aac18bd459ab687e.yml +configured_endpoints: 17 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d2f2163594415a1ffc47be29ef38f12e9702098cbfe2cc92b8b8d24bad1e938f.yml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1f39c2742..87045143c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,7 +59,7 @@ If you’d like to use the repository from source, you can either install from g To install via git: ```bash -pip install git+ssh://git@github.com/runloopai/api-client-python.git +pip install git+ssh://git@github.com/stainless-sdks/runloop-python.git ``` Alternatively, you can build from source and install the wheel file: @@ -117,7 +117,7 @@ the changes aren't made through the automated pipeline, you may want to make rel ### Publish with a GitHub workflow -You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/runloopai/api-client-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. +You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/stainless-sdks/runloop-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. ### Publish manually diff --git a/README.md b/README.md index d1e7ef90e..d3fcd9aeb 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ The REST API documentation can be found [on runloop.ai](https://runloop.ai). The ## Installation ```sh -# install from the production repo -pip install git+ssh://git@github.com/runloopai/api-client-python.git +# install from this staging repo +pip install git+ssh://git@github.com/stainless-sdks/runloop-python.git ``` > [!NOTE] @@ -35,8 +35,8 @@ client = Runloop( bearer_token=os.environ.get("RUNLOOP_BEARER_TOKEN"), ) -code_handle = client.code_handles.create() -print(code_handle.id) +code_handle_view = client.code_handles.create() +print(code_handle_view.id) ``` While you can provide a `bearer_token` keyword argument, @@ -60,8 +60,8 @@ client = AsyncRunloop( async def main() -> None: - code_handle = await client.code_handles.create() - print(code_handle.id) + code_handle_view = await client.code_handles.create() + print(code_handle_view.id) asyncio.run(main()) @@ -206,9 +206,9 @@ code_handle = response.parse() # get the object that `code_handles.create()` wo print(code_handle.id) ``` -These methods return an [`APIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop/_response.py) object. +These methods return an [`APIResponse`](https://github.com/stainless-sdks/runloop-python/tree/main/src/runloop/_response.py) object. -The async client returns an [`AsyncAPIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. +The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/runloop-python/tree/main/src/runloop/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. #### `.with_streaming_response` @@ -296,7 +296,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. -We are keen for your feedback; please open an [issue](https://www.github.com/runloopai/api-client-python/issues) with questions, bugs, or suggestions. +We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/runloop-python/issues) with questions, bugs, or suggestions. ## Requirements diff --git a/api.md b/api.md index f9f3180d4..abee7327e 100644 --- a/api.md +++ b/api.md @@ -1,7 +1,7 @@ # Shared Types ```python -from runloop.types import FunctionInvocationDetail +from runloop.types import EmptyRecord, FunctionInvocationDetailView, ProjectLogsView ``` # CodeHandles @@ -9,65 +9,68 @@ from runloop.types import FunctionInvocationDetail Types: ```python -from runloop.types import CodeHandle, CodeHandleList +from runloop.types import CodeHandleListView, CodeHandleView ``` Methods: -- client.code_handles.create(\*\*params) -> CodeHandle -- client.code_handles.list(\*\*params) -> CodeHandleList +- client.code_handles.create(\*\*params) -> CodeHandleView +- client.code_handles.list(\*\*params) -> CodeHandleListView # Devboxes Types: ```python -from runloop.types import Devbox, DevboxList +from runloop.types import DevboxExecutionDetailView, DevboxListView, DevboxView ``` Methods: -- client.devboxes.create(\*\*params) -> Devbox -- client.devboxes.retrieve(id) -> Devbox -- client.devboxes.list(\*\*params) -> DevboxList -- client.devboxes.shutdown(id) -> Devbox +- client.devboxes.create(\*\*params) -> DevboxView +- client.devboxes.retrieve(id) -> DevboxView +- client.devboxes.list(\*\*params) -> DevboxListView +- client.devboxes.execute_sync(id) -> DevboxExecutionDetailView +- client.devboxes.shutdown(id) -> DevboxView ## Logs Types: ```python -from runloop.types.devboxes import DevboxLogsList +from runloop.types.devboxes import DevboxLogsListView ``` Methods: -- client.devboxes.logs.list(id) -> DevboxLogsList +- client.devboxes.logs.list(id) -> DevboxLogsListView # Functions Types: ```python -from runloop.types import FunctionList +from runloop.types import FunctionListView ``` Methods: -- client.functions.list() -> FunctionList +- client.functions.list() -> FunctionListView +- client.functions.invoke_async(function_name, \*, project_name, \*\*params) -> FunctionInvocationDetailView +- client.functions.invoke_sync(function_name, \*, project_name, \*\*params) -> FunctionInvocationDetailView ## Invocations Types: ```python -from runloop.types.functions import FunctionInvocationList, KillOperationResponse +from runloop.types.functions import FunctionInvocationListView, KillOperationResponse ``` Methods: -- client.functions.invocations.retrieve(invocation_id) -> FunctionInvocationDetail -- client.functions.invocations.list() -> FunctionInvocationList +- client.functions.invocations.retrieve(invocation_id) -> FunctionInvocationDetailView +- client.functions.invocations.list() -> FunctionInvocationListView - client.functions.invocations.kill(invocation_id) -> object ### Spans @@ -75,80 +78,27 @@ Methods: Types: ```python -from runloop.types.functions.invocations import InvocationSpanList +from runloop.types.functions.invocations import InvocationSpanListView ``` Methods: -- client.functions.invocations.spans.list(invocation_id) -> InvocationSpanList - -## OpenAPI - -Types: - -```python -from runloop.types.functions import OpenAPIRetrieveResponse -``` - -Methods: - -- client.functions.openapi.retrieve() -> object - -# Latches - -Types: - -```python -from runloop.types import EmptyRecord -``` - -Methods: - -- client.latches.fulfill(latch_id, \*\*params) -> object +- client.functions.invocations.spans.list(invocation_id) -> InvocationSpanListView # Projects Types: ```python -from runloop.types import ProjectList +from runloop.types import ProjectListView ``` Methods: -- client.projects.list() -> ProjectList +- client.projects.list() -> ProjectListView ## Logs -Types: - -```python -from runloop.types.projects import ProjectLogs -``` - Methods: -- client.projects.logs.list(id) -> ProjectLogs - -# Sessions - -## Sessions - -Types: - -```python -from runloop.types.sessions import Session, SessionList -``` - -Methods: - -- client.sessions.sessions.create() -> Session -- client.sessions.sessions.list() -> SessionList - -### Kv - -Types: - -```python -from runloop.types.sessions.sessions import SessionKv -``` +- client.projects.logs.list(id) -> ProjectLogsView diff --git a/bin/check-release-environment b/bin/check-release-environment deleted file mode 100644 index bbcc4181f..000000000 --- a/bin/check-release-environment +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -warnings=() -errors=() - -if [ -z "${PYPI_TOKEN}" ]; then - warnings+=("The RUNLOOP_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") -fi - -lenWarnings=${#warnings[@]} - -if [[ lenWarnings -gt 0 ]]; then - echo -e "Found the following warnings in the release environment:\n" - - for warning in "${warnings[@]}"; do - echo -e "- $warning\n" - done -fi - -lenErrors=${#errors[@]} - -if [[ lenErrors -gt 0 ]]; then - echo -e "Found the following errors in the release environment:\n" - - for error in "${errors[@]}"; do - echo -e "- $error\n" - done - - exit 1 -fi - -echo "The environment is ready to push releases!" diff --git a/pyproject.toml b/pyproject.toml index 172cdab8e..24a36fd0a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,8 +39,8 @@ classifiers = [ [project.urls] -Homepage = "https://github.com/runloopai/api-client-python" -Repository = "https://github.com/runloopai/api-client-python" +Homepage = "https://github.com/stainless-sdks/runloop-python" +Repository = "https://github.com/stainless-sdks/runloop-python" @@ -108,7 +108,7 @@ path = "README.md" [[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] # replace relative links with absolute links pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)' -replacement = '[\1](https://github.com/runloopai/api-client-python/tree/main/\g<2>)' +replacement = '[\1](https://github.com/stainless-sdks/runloop-python/tree/main/\g<2>)' [tool.black] line-length = 120 diff --git a/release-please-config.json b/release-please-config.json deleted file mode 100644 index 3bde9481f..000000000 --- a/release-please-config.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "packages": { - ".": {} - }, - "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", - "include-v-in-tag": true, - "include-component-in-tag": false, - "versioning": "prerelease", - "prerelease": true, - "bump-minor-pre-major": true, - "bump-patch-for-minor-pre-major": false, - "pull-request-header": "Automated Release PR", - "pull-request-title-pattern": "release: ${version}", - "changelog-sections": [ - { - "type": "feat", - "section": "Features" - }, - { - "type": "fix", - "section": "Bug Fixes" - }, - { - "type": "perf", - "section": "Performance Improvements" - }, - { - "type": "revert", - "section": "Reverts" - }, - { - "type": "chore", - "section": "Chores" - }, - { - "type": "docs", - "section": "Documentation" - }, - { - "type": "style", - "section": "Styles" - }, - { - "type": "refactor", - "section": "Refactors" - }, - { - "type": "test", - "section": "Tests", - "hidden": true - }, - { - "type": "build", - "section": "Build System" - }, - { - "type": "ci", - "section": "Continuous Integration", - "hidden": true - } - ], - "release-type": "python", - "extra-files": [ - "src/runloop/_version.py" - ] -} \ No newline at end of file diff --git a/src/runloop/_client.py b/src/runloop/_client.py index 4f85779a6..d8aaf00eb 100644 --- a/src/runloop/_client.py +++ b/src/runloop/_client.py @@ -49,9 +49,7 @@ class Runloop(SyncAPIClient): code_handles: resources.CodeHandlesResource devboxes: resources.DevboxesResource functions: resources.FunctionsResource - latches: resources.LatchesResource projects: resources.ProjectsResource - sessions: resources.SessionsResource with_raw_response: RunloopWithRawResponse with_streaming_response: RunloopWithStreamedResponse @@ -112,9 +110,7 @@ def __init__( self.code_handles = resources.CodeHandlesResource(self) self.devboxes = resources.DevboxesResource(self) self.functions = resources.FunctionsResource(self) - self.latches = resources.LatchesResource(self) self.projects = resources.ProjectsResource(self) - self.sessions = resources.SessionsResource(self) self.with_raw_response = RunloopWithRawResponse(self) self.with_streaming_response = RunloopWithStreamedResponse(self) @@ -227,9 +223,7 @@ class AsyncRunloop(AsyncAPIClient): code_handles: resources.AsyncCodeHandlesResource devboxes: resources.AsyncDevboxesResource functions: resources.AsyncFunctionsResource - latches: resources.AsyncLatchesResource projects: resources.AsyncProjectsResource - sessions: resources.AsyncSessionsResource with_raw_response: AsyncRunloopWithRawResponse with_streaming_response: AsyncRunloopWithStreamedResponse @@ -290,9 +284,7 @@ def __init__( self.code_handles = resources.AsyncCodeHandlesResource(self) self.devboxes = resources.AsyncDevboxesResource(self) self.functions = resources.AsyncFunctionsResource(self) - self.latches = resources.AsyncLatchesResource(self) self.projects = resources.AsyncProjectsResource(self) - self.sessions = resources.AsyncSessionsResource(self) self.with_raw_response = AsyncRunloopWithRawResponse(self) self.with_streaming_response = AsyncRunloopWithStreamedResponse(self) @@ -406,9 +398,7 @@ def __init__(self, client: Runloop) -> None: self.code_handles = resources.CodeHandlesResourceWithRawResponse(client.code_handles) self.devboxes = resources.DevboxesResourceWithRawResponse(client.devboxes) self.functions = resources.FunctionsResourceWithRawResponse(client.functions) - self.latches = resources.LatchesResourceWithRawResponse(client.latches) self.projects = resources.ProjectsResourceWithRawResponse(client.projects) - self.sessions = resources.SessionsResourceWithRawResponse(client.sessions) class AsyncRunloopWithRawResponse: @@ -416,9 +406,7 @@ def __init__(self, client: AsyncRunloop) -> None: self.code_handles = resources.AsyncCodeHandlesResourceWithRawResponse(client.code_handles) self.devboxes = resources.AsyncDevboxesResourceWithRawResponse(client.devboxes) self.functions = resources.AsyncFunctionsResourceWithRawResponse(client.functions) - self.latches = resources.AsyncLatchesResourceWithRawResponse(client.latches) self.projects = resources.AsyncProjectsResourceWithRawResponse(client.projects) - self.sessions = resources.AsyncSessionsResourceWithRawResponse(client.sessions) class RunloopWithStreamedResponse: @@ -426,9 +414,7 @@ def __init__(self, client: Runloop) -> None: self.code_handles = resources.CodeHandlesResourceWithStreamingResponse(client.code_handles) self.devboxes = resources.DevboxesResourceWithStreamingResponse(client.devboxes) self.functions = resources.FunctionsResourceWithStreamingResponse(client.functions) - self.latches = resources.LatchesResourceWithStreamingResponse(client.latches) self.projects = resources.ProjectsResourceWithStreamingResponse(client.projects) - self.sessions = resources.SessionsResourceWithStreamingResponse(client.sessions) class AsyncRunloopWithStreamedResponse: @@ -436,9 +422,7 @@ def __init__(self, client: AsyncRunloop) -> None: self.code_handles = resources.AsyncCodeHandlesResourceWithStreamingResponse(client.code_handles) self.devboxes = resources.AsyncDevboxesResourceWithStreamingResponse(client.devboxes) self.functions = resources.AsyncFunctionsResourceWithStreamingResponse(client.functions) - self.latches = resources.AsyncLatchesResourceWithStreamingResponse(client.latches) self.projects = resources.AsyncProjectsResourceWithStreamingResponse(client.projects) - self.sessions = resources.AsyncSessionsResourceWithStreamingResponse(client.sessions) Client = Runloop diff --git a/src/runloop/_version.py b/src/runloop/_version.py index d24c5a445..5c37f7fda 100644 --- a/src/runloop/_version.py +++ b/src/runloop/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop" -__version__ = "0.0.1-alpha.0" # x-release-please-version +__version__ = "0.0.1-alpha.0" diff --git a/src/runloop/resources/__init__.py b/src/runloop/resources/__init__.py index d2c000638..f1d0ce4f4 100644 --- a/src/runloop/resources/__init__.py +++ b/src/runloop/resources/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .latches import ( - LatchesResource, - AsyncLatchesResource, - LatchesResourceWithRawResponse, - AsyncLatchesResourceWithRawResponse, - LatchesResourceWithStreamingResponse, - AsyncLatchesResourceWithStreamingResponse, -) from .devboxes import ( DevboxesResource, AsyncDevboxesResource, @@ -24,14 +16,6 @@ ProjectsResourceWithStreamingResponse, AsyncProjectsResourceWithStreamingResponse, ) -from .sessions import ( - SessionsResource, - AsyncSessionsResource, - SessionsResourceWithRawResponse, - AsyncSessionsResourceWithRawResponse, - SessionsResourceWithStreamingResponse, - AsyncSessionsResourceWithStreamingResponse, -) from .functions import ( FunctionsResource, AsyncFunctionsResource, @@ -68,22 +52,10 @@ "AsyncFunctionsResourceWithRawResponse", "FunctionsResourceWithStreamingResponse", "AsyncFunctionsResourceWithStreamingResponse", - "LatchesResource", - "AsyncLatchesResource", - "LatchesResourceWithRawResponse", - "AsyncLatchesResourceWithRawResponse", - "LatchesResourceWithStreamingResponse", - "AsyncLatchesResourceWithStreamingResponse", "ProjectsResource", "AsyncProjectsResource", "ProjectsResourceWithRawResponse", "AsyncProjectsResourceWithRawResponse", "ProjectsResourceWithStreamingResponse", "AsyncProjectsResourceWithStreamingResponse", - "SessionsResource", - "AsyncSessionsResource", - "SessionsResourceWithRawResponse", - "AsyncSessionsResourceWithRawResponse", - "SessionsResourceWithStreamingResponse", - "AsyncSessionsResourceWithStreamingResponse", ] diff --git a/src/runloop/resources/code_handles.py b/src/runloop/resources/code_handles.py index ed68aecec..1a61f7e14 100644 --- a/src/runloop/resources/code_handles.py +++ b/src/runloop/resources/code_handles.py @@ -21,8 +21,8 @@ from .._base_client import ( make_request_options, ) -from ..types.code_handle import CodeHandle -from ..types.code_handle_list import CodeHandleList +from ..types.code_handle_view import CodeHandleView +from ..types.code_handle_list_view import CodeHandleListView __all__ = ["CodeHandlesResource", "AsyncCodeHandlesResource"] @@ -49,7 +49,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeHandle: + ) -> CodeHandleView: """Create a new code handle for a given repository. This can be referenced in other @@ -86,7 +86,7 @@ def create( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=CodeHandle, + cast_to=CodeHandleView, ) def list( @@ -100,7 +100,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeHandleList: + ) -> CodeHandleListView: """ List the code handles that are available for use. @@ -132,7 +132,7 @@ def list( code_handle_list_params.CodeHandleListParams, ), ), - cast_to=CodeHandleList, + cast_to=CodeHandleListView, ) @@ -158,7 +158,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeHandle: + ) -> CodeHandleView: """Create a new code handle for a given repository. This can be referenced in other @@ -195,7 +195,7 @@ async def create( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=CodeHandle, + cast_to=CodeHandleView, ) async def list( @@ -209,7 +209,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeHandleList: + ) -> CodeHandleListView: """ List the code handles that are available for use. @@ -241,7 +241,7 @@ async def list( code_handle_list_params.CodeHandleListParams, ), ), - cast_to=CodeHandleList, + cast_to=CodeHandleListView, ) diff --git a/src/runloop/resources/devboxes/devboxes.py b/src/runloop/resources/devboxes/devboxes.py index cf3c6ce9b..2bba79483 100644 --- a/src/runloop/resources/devboxes/devboxes.py +++ b/src/runloop/resources/devboxes/devboxes.py @@ -31,8 +31,9 @@ from ..._base_client import ( make_request_options, ) -from ...types.devbox import Devbox -from ...types.devbox_list import DevboxList +from ...types.devbox_view import DevboxView +from ...types.devbox_list_view import DevboxListView +from ...types.devbox_execution_detail_view import DevboxExecutionDetailView __all__ = ["DevboxesResource", "AsyncDevboxesResource"] @@ -63,7 +64,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Devbox: + ) -> DevboxView: """Create a Devbox with the specified configuration. The Devbox will be created in @@ -104,7 +105,7 @@ def create( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Devbox, + cast_to=DevboxView, ) def retrieve( @@ -117,7 +118,7 @@ def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Devbox: + ) -> DevboxView: """Get a devbox by id. If the devbox does not exist, a 404 is returned. @@ -138,7 +139,7 @@ def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Devbox, + cast_to=DevboxView, ) def list( @@ -151,7 +152,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxList: + ) -> DevboxListView: """List all devboxes or filter by status. If no status is provided, all devboxes @@ -177,7 +178,40 @@ def list( timeout=timeout, query=maybe_transform({"status": status}, devbox_list_params.DevboxListParams), ), - cast_to=DevboxList, + cast_to=DevboxListView, + ) + + def execute_sync( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxExecutionDetailView: + """ + Synchronously execute a command on a devbox + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/execute_sync", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxExecutionDetailView, ) def shutdown( @@ -190,7 +224,7 @@ def shutdown( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Devbox: + ) -> DevboxView: """Shutdown a running devbox by id. This will take the devbox out of service. @@ -211,7 +245,7 @@ def shutdown( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Devbox, + cast_to=DevboxView, ) @@ -241,7 +275,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Devbox: + ) -> DevboxView: """Create a Devbox with the specified configuration. The Devbox will be created in @@ -282,7 +316,7 @@ async def create( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Devbox, + cast_to=DevboxView, ) async def retrieve( @@ -295,7 +329,7 @@ async def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Devbox: + ) -> DevboxView: """Get a devbox by id. If the devbox does not exist, a 404 is returned. @@ -316,7 +350,7 @@ async def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Devbox, + cast_to=DevboxView, ) async def list( @@ -329,7 +363,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxList: + ) -> DevboxListView: """List all devboxes or filter by status. If no status is provided, all devboxes @@ -355,7 +389,40 @@ async def list( timeout=timeout, query=await async_maybe_transform({"status": status}, devbox_list_params.DevboxListParams), ), - cast_to=DevboxList, + cast_to=DevboxListView, + ) + + async def execute_sync( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxExecutionDetailView: + """ + Synchronously execute a command on a devbox + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/execute_sync", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxExecutionDetailView, ) async def shutdown( @@ -368,7 +435,7 @@ async def shutdown( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Devbox: + ) -> DevboxView: """Shutdown a running devbox by id. This will take the devbox out of service. @@ -389,7 +456,7 @@ async def shutdown( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=Devbox, + cast_to=DevboxView, ) @@ -406,6 +473,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.list = to_raw_response_wrapper( devboxes.list, ) + self.execute_sync = to_raw_response_wrapper( + devboxes.execute_sync, + ) self.shutdown = to_raw_response_wrapper( devboxes.shutdown, ) @@ -428,6 +498,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.list = async_to_raw_response_wrapper( devboxes.list, ) + self.execute_sync = async_to_raw_response_wrapper( + devboxes.execute_sync, + ) self.shutdown = async_to_raw_response_wrapper( devboxes.shutdown, ) @@ -450,6 +523,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.list = to_streamed_response_wrapper( devboxes.list, ) + self.execute_sync = to_streamed_response_wrapper( + devboxes.execute_sync, + ) self.shutdown = to_streamed_response_wrapper( devboxes.shutdown, ) @@ -472,6 +548,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.list = async_to_streamed_response_wrapper( devboxes.list, ) + self.execute_sync = async_to_streamed_response_wrapper( + devboxes.execute_sync, + ) self.shutdown = async_to_streamed_response_wrapper( devboxes.shutdown, ) diff --git a/src/runloop/resources/devboxes/logs.py b/src/runloop/resources/devboxes/logs.py index b89bbb642..327001503 100644 --- a/src/runloop/resources/devboxes/logs.py +++ b/src/runloop/resources/devboxes/logs.py @@ -16,7 +16,7 @@ from ..._base_client import ( make_request_options, ) -from ...types.devboxes.devbox_logs_list import DevboxLogsList +from ...types.devboxes.devbox_logs_list_view import DevboxLogsListView __all__ = ["LogsResource", "AsyncLogsResource"] @@ -40,7 +40,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxLogsList: + ) -> DevboxLogsListView: """ Get all logs from a Devbox by id. @@ -60,7 +60,7 @@ def list( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=DevboxLogsList, + cast_to=DevboxLogsListView, ) @@ -83,7 +83,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxLogsList: + ) -> DevboxLogsListView: """ Get all logs from a Devbox by id. @@ -103,7 +103,7 @@ async def list( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=DevboxLogsList, + cast_to=DevboxLogsListView, ) diff --git a/src/runloop/resources/functions/__init__.py b/src/runloop/resources/functions/__init__.py index 45300c55f..b33636e15 100644 --- a/src/runloop/resources/functions/__init__.py +++ b/src/runloop/resources/functions/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .openapi import ( - OpenAPIResource, - AsyncOpenAPIResource, - OpenAPIResourceWithRawResponse, - AsyncOpenAPIResourceWithRawResponse, - OpenAPIResourceWithStreamingResponse, - AsyncOpenAPIResourceWithStreamingResponse, -) from .functions import ( FunctionsResource, AsyncFunctionsResource, @@ -32,12 +24,6 @@ "AsyncInvocationsResourceWithRawResponse", "InvocationsResourceWithStreamingResponse", "AsyncInvocationsResourceWithStreamingResponse", - "OpenAPIResource", - "AsyncOpenAPIResource", - "OpenAPIResourceWithRawResponse", - "AsyncOpenAPIResourceWithRawResponse", - "OpenAPIResourceWithStreamingResponse", - "AsyncOpenAPIResourceWithStreamingResponse", "FunctionsResource", "AsyncFunctionsResource", "FunctionsResourceWithRawResponse", diff --git a/src/runloop/resources/functions/functions.py b/src/runloop/resources/functions/functions.py index 862a02546..2596889f8 100644 --- a/src/runloop/resources/functions/functions.py +++ b/src/runloop/resources/functions/functions.py @@ -4,15 +4,12 @@ import httpx -from .openapi import ( - OpenAPIResource, - AsyncOpenAPIResource, - OpenAPIResourceWithRawResponse, - AsyncOpenAPIResourceWithRawResponse, - OpenAPIResourceWithStreamingResponse, - AsyncOpenAPIResourceWithStreamingResponse, -) +from ...types import function_invoke_sync_params, function_invoke_async_params from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -32,8 +29,9 @@ from ..._base_client import ( make_request_options, ) -from ...types.function_list import FunctionList from .invocations.invocations import InvocationsResource, AsyncInvocationsResource +from ...types.function_list_view import FunctionListView +from ...types.shared.function_invocation_detail_view import FunctionInvocationDetailView __all__ = ["FunctionsResource", "AsyncFunctionsResource"] @@ -43,10 +41,6 @@ class FunctionsResource(SyncAPIResource): def invocations(self) -> InvocationsResource: return InvocationsResource(self._client) - @cached_property - def openapi(self) -> OpenAPIResource: - return OpenAPIResource(self._client) - @cached_property def with_raw_response(self) -> FunctionsResourceWithRawResponse: return FunctionsResourceWithRawResponse(self) @@ -64,14 +58,113 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionList: + ) -> FunctionListView: """List the functions that are available for invocation.""" return self._get( "/v1/functions", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=FunctionList, + cast_to=FunctionListView, + ) + + def invoke_async( + self, + function_name: str, + *, + project_name: str, + request: object, + runloop_meta: function_invoke_async_params.RunloopMeta | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FunctionInvocationDetailView: + """Invoke the remote function asynchronously. + + This will return a job id that can be + used to query the status of the function invocation. + + Args: + request: Json of the request + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not project_name: + raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}") + if not function_name: + raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}") + return self._post( + f"/v1/functions/{project_name}/{function_name}/invoke_async", + body=maybe_transform( + { + "request": request, + "runloop_meta": runloop_meta, + }, + function_invoke_async_params.FunctionInvokeAsyncParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FunctionInvocationDetailView, + ) + + def invoke_sync( + self, + function_name: str, + *, + project_name: str, + request: object, + runloop_meta: function_invoke_sync_params.RunloopMeta | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FunctionInvocationDetailView: + """Invoke the remote function synchronously. + + This will block until the function + completes and return the result. If the function call takes too long, the + request will timeout. + + Args: + request: Json of the request + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not project_name: + raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}") + if not function_name: + raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}") + return self._post( + f"/v1/functions/{project_name}/{function_name}/invoke_sync", + body=maybe_transform( + { + "request": request, + "runloop_meta": runloop_meta, + }, + function_invoke_sync_params.FunctionInvokeSyncParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FunctionInvocationDetailView, ) @@ -80,10 +173,6 @@ class AsyncFunctionsResource(AsyncAPIResource): def invocations(self) -> AsyncInvocationsResource: return AsyncInvocationsResource(self._client) - @cached_property - def openapi(self) -> AsyncOpenAPIResource: - return AsyncOpenAPIResource(self._client) - @cached_property def with_raw_response(self) -> AsyncFunctionsResourceWithRawResponse: return AsyncFunctionsResourceWithRawResponse(self) @@ -101,14 +190,113 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionList: + ) -> FunctionListView: """List the functions that are available for invocation.""" return await self._get( "/v1/functions", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=FunctionList, + cast_to=FunctionListView, + ) + + async def invoke_async( + self, + function_name: str, + *, + project_name: str, + request: object, + runloop_meta: function_invoke_async_params.RunloopMeta | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FunctionInvocationDetailView: + """Invoke the remote function asynchronously. + + This will return a job id that can be + used to query the status of the function invocation. + + Args: + request: Json of the request + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not project_name: + raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}") + if not function_name: + raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}") + return await self._post( + f"/v1/functions/{project_name}/{function_name}/invoke_async", + body=await async_maybe_transform( + { + "request": request, + "runloop_meta": runloop_meta, + }, + function_invoke_async_params.FunctionInvokeAsyncParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FunctionInvocationDetailView, + ) + + async def invoke_sync( + self, + function_name: str, + *, + project_name: str, + request: object, + runloop_meta: function_invoke_sync_params.RunloopMeta | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FunctionInvocationDetailView: + """Invoke the remote function synchronously. + + This will block until the function + completes and return the result. If the function call takes too long, the + request will timeout. + + Args: + request: Json of the request + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not project_name: + raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}") + if not function_name: + raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}") + return await self._post( + f"/v1/functions/{project_name}/{function_name}/invoke_sync", + body=await async_maybe_transform( + { + "request": request, + "runloop_meta": runloop_meta, + }, + function_invoke_sync_params.FunctionInvokeSyncParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FunctionInvocationDetailView, ) @@ -119,15 +307,17 @@ def __init__(self, functions: FunctionsResource) -> None: self.list = to_raw_response_wrapper( functions.list, ) + self.invoke_async = to_raw_response_wrapper( + functions.invoke_async, + ) + self.invoke_sync = to_raw_response_wrapper( + functions.invoke_sync, + ) @cached_property def invocations(self) -> InvocationsResourceWithRawResponse: return InvocationsResourceWithRawResponse(self._functions.invocations) - @cached_property - def openapi(self) -> OpenAPIResourceWithRawResponse: - return OpenAPIResourceWithRawResponse(self._functions.openapi) - class AsyncFunctionsResourceWithRawResponse: def __init__(self, functions: AsyncFunctionsResource) -> None: @@ -136,15 +326,17 @@ def __init__(self, functions: AsyncFunctionsResource) -> None: self.list = async_to_raw_response_wrapper( functions.list, ) + self.invoke_async = async_to_raw_response_wrapper( + functions.invoke_async, + ) + self.invoke_sync = async_to_raw_response_wrapper( + functions.invoke_sync, + ) @cached_property def invocations(self) -> AsyncInvocationsResourceWithRawResponse: return AsyncInvocationsResourceWithRawResponse(self._functions.invocations) - @cached_property - def openapi(self) -> AsyncOpenAPIResourceWithRawResponse: - return AsyncOpenAPIResourceWithRawResponse(self._functions.openapi) - class FunctionsResourceWithStreamingResponse: def __init__(self, functions: FunctionsResource) -> None: @@ -153,15 +345,17 @@ def __init__(self, functions: FunctionsResource) -> None: self.list = to_streamed_response_wrapper( functions.list, ) + self.invoke_async = to_streamed_response_wrapper( + functions.invoke_async, + ) + self.invoke_sync = to_streamed_response_wrapper( + functions.invoke_sync, + ) @cached_property def invocations(self) -> InvocationsResourceWithStreamingResponse: return InvocationsResourceWithStreamingResponse(self._functions.invocations) - @cached_property - def openapi(self) -> OpenAPIResourceWithStreamingResponse: - return OpenAPIResourceWithStreamingResponse(self._functions.openapi) - class AsyncFunctionsResourceWithStreamingResponse: def __init__(self, functions: AsyncFunctionsResource) -> None: @@ -170,11 +364,13 @@ def __init__(self, functions: AsyncFunctionsResource) -> None: self.list = async_to_streamed_response_wrapper( functions.list, ) + self.invoke_async = async_to_streamed_response_wrapper( + functions.invoke_async, + ) + self.invoke_sync = async_to_streamed_response_wrapper( + functions.invoke_sync, + ) @cached_property def invocations(self) -> AsyncInvocationsResourceWithStreamingResponse: return AsyncInvocationsResourceWithStreamingResponse(self._functions.invocations) - - @cached_property - def openapi(self) -> AsyncOpenAPIResourceWithStreamingResponse: - return AsyncOpenAPIResourceWithStreamingResponse(self._functions.openapi) diff --git a/src/runloop/resources/functions/invocations/invocations.py b/src/runloop/resources/functions/invocations/invocations.py index 3ef5afba5..66cd346b2 100644 --- a/src/runloop/resources/functions/invocations/invocations.py +++ b/src/runloop/resources/functions/invocations/invocations.py @@ -24,8 +24,8 @@ from ...._base_client import ( make_request_options, ) -from ....types.shared.function_invocation_detail import FunctionInvocationDetail -from ....types.functions.function_invocation_list import FunctionInvocationList +from ....types.shared.function_invocation_detail_view import FunctionInvocationDetailView +from ....types.functions.function_invocation_list_view import FunctionInvocationListView __all__ = ["InvocationsResource", "AsyncInvocationsResource"] @@ -53,7 +53,7 @@ def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvocationDetail: + ) -> FunctionInvocationDetailView: """Get the details of a function invocation. This includes the status, response, @@ -75,7 +75,7 @@ def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=FunctionInvocationDetail, + cast_to=FunctionInvocationDetailView, ) def list( @@ -87,14 +87,14 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvocationList: + ) -> FunctionInvocationListView: """List the functions invocations that are available for invocation.""" return self._get( "/v1/functions/invocations", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=FunctionInvocationList, + cast_to=FunctionInvocationListView, ) def kill( @@ -155,7 +155,7 @@ async def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvocationDetail: + ) -> FunctionInvocationDetailView: """Get the details of a function invocation. This includes the status, response, @@ -177,7 +177,7 @@ async def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=FunctionInvocationDetail, + cast_to=FunctionInvocationDetailView, ) async def list( @@ -189,14 +189,14 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvocationList: + ) -> FunctionInvocationListView: """List the functions invocations that are available for invocation.""" return await self._get( "/v1/functions/invocations", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=FunctionInvocationList, + cast_to=FunctionInvocationListView, ) async def kill( diff --git a/src/runloop/resources/functions/invocations/spans.py b/src/runloop/resources/functions/invocations/spans.py index 607849958..3abe920d9 100644 --- a/src/runloop/resources/functions/invocations/spans.py +++ b/src/runloop/resources/functions/invocations/spans.py @@ -16,7 +16,7 @@ from ...._base_client import ( make_request_options, ) -from ....types.functions.invocations.invocation_span_list import InvocationSpanList +from ....types.functions.invocations.invocation_span_list_view import InvocationSpanListView __all__ = ["SpansResource", "AsyncSpansResource"] @@ -40,7 +40,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InvocationSpanList: + ) -> InvocationSpanListView: """Get the span points for the given invocation. This will return the span points @@ -62,7 +62,7 @@ def list( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=InvocationSpanList, + cast_to=InvocationSpanListView, ) @@ -85,7 +85,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InvocationSpanList: + ) -> InvocationSpanListView: """Get the span points for the given invocation. This will return the span points @@ -107,7 +107,7 @@ async def list( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=InvocationSpanList, + cast_to=InvocationSpanListView, ) diff --git a/src/runloop/resources/functions/openapi.py b/src/runloop/resources/functions/openapi.py deleted file mode 100644 index 993e7d317..000000000 --- a/src/runloop/resources/functions/openapi.py +++ /dev/null @@ -1,114 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import ( - make_request_options, -) - -__all__ = ["OpenAPIResource", "AsyncOpenAPIResource"] - - -class OpenAPIResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> OpenAPIResourceWithRawResponse: - return OpenAPIResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> OpenAPIResourceWithStreamingResponse: - return OpenAPIResourceWithStreamingResponse(self) - - def retrieve( - self, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get the OpenAPI Spec for this project.""" - return self._get( - "/v1/functions/openapi", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - -class AsyncOpenAPIResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncOpenAPIResourceWithRawResponse: - return AsyncOpenAPIResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncOpenAPIResourceWithStreamingResponse: - return AsyncOpenAPIResourceWithStreamingResponse(self) - - async def retrieve( - self, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get the OpenAPI Spec for this project.""" - return await self._get( - "/v1/functions/openapi", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - -class OpenAPIResourceWithRawResponse: - def __init__(self, openapi: OpenAPIResource) -> None: - self._openapi = openapi - - self.retrieve = to_raw_response_wrapper( - openapi.retrieve, - ) - - -class AsyncOpenAPIResourceWithRawResponse: - def __init__(self, openapi: AsyncOpenAPIResource) -> None: - self._openapi = openapi - - self.retrieve = async_to_raw_response_wrapper( - openapi.retrieve, - ) - - -class OpenAPIResourceWithStreamingResponse: - def __init__(self, openapi: OpenAPIResource) -> None: - self._openapi = openapi - - self.retrieve = to_streamed_response_wrapper( - openapi.retrieve, - ) - - -class AsyncOpenAPIResourceWithStreamingResponse: - def __init__(self, openapi: AsyncOpenAPIResource) -> None: - self._openapi = openapi - - self.retrieve = async_to_streamed_response_wrapper( - openapi.retrieve, - ) diff --git a/src/runloop/resources/latches.py b/src/runloop/resources/latches.py deleted file mode 100644 index 1cbc3c0d2..000000000 --- a/src/runloop/resources/latches.py +++ /dev/null @@ -1,159 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..types import latch_fulfill_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._base_client import ( - make_request_options, -) - -__all__ = ["LatchesResource", "AsyncLatchesResource"] - - -class LatchesResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LatchesResourceWithRawResponse: - return LatchesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LatchesResourceWithStreamingResponse: - return LatchesResourceWithStreamingResponse(self) - - def fulfill( - self, - latch_id: str, - *, - result: object, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Fulfill the latch by passing the waited for event. - - This will unblock any waiting - functions. - - Args: - result: Json of the event to complete the latch with - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not latch_id: - raise ValueError(f"Expected a non-empty value for `latch_id` but received {latch_id!r}") - return self._post( - f"/v1/latches/{latch_id}", - body=maybe_transform({"result": result}, latch_fulfill_params.LatchFulfillParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - -class AsyncLatchesResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLatchesResourceWithRawResponse: - return AsyncLatchesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLatchesResourceWithStreamingResponse: - return AsyncLatchesResourceWithStreamingResponse(self) - - async def fulfill( - self, - latch_id: str, - *, - result: object, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Fulfill the latch by passing the waited for event. - - This will unblock any waiting - functions. - - Args: - result: Json of the event to complete the latch with - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not latch_id: - raise ValueError(f"Expected a non-empty value for `latch_id` but received {latch_id!r}") - return await self._post( - f"/v1/latches/{latch_id}", - body=await async_maybe_transform({"result": result}, latch_fulfill_params.LatchFulfillParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - -class LatchesResourceWithRawResponse: - def __init__(self, latches: LatchesResource) -> None: - self._latches = latches - - self.fulfill = to_raw_response_wrapper( - latches.fulfill, - ) - - -class AsyncLatchesResourceWithRawResponse: - def __init__(self, latches: AsyncLatchesResource) -> None: - self._latches = latches - - self.fulfill = async_to_raw_response_wrapper( - latches.fulfill, - ) - - -class LatchesResourceWithStreamingResponse: - def __init__(self, latches: LatchesResource) -> None: - self._latches = latches - - self.fulfill = to_streamed_response_wrapper( - latches.fulfill, - ) - - -class AsyncLatchesResourceWithStreamingResponse: - def __init__(self, latches: AsyncLatchesResource) -> None: - self._latches = latches - - self.fulfill = async_to_streamed_response_wrapper( - latches.fulfill, - ) diff --git a/src/runloop/resources/projects/logs.py b/src/runloop/resources/projects/logs.py index a04b3733e..b6248ab52 100644 --- a/src/runloop/resources/projects/logs.py +++ b/src/runloop/resources/projects/logs.py @@ -16,7 +16,7 @@ from ..._base_client import ( make_request_options, ) -from ...types.projects.project_logs import ProjectLogs +from ...types.shared.project_logs_view import ProjectLogsView __all__ = ["LogsResource", "AsyncLogsResource"] @@ -40,7 +40,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectLogs: + ) -> ProjectLogsView: """ Get list of all logs from a project. @@ -60,7 +60,7 @@ def list( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ProjectLogs, + cast_to=ProjectLogsView, ) @@ -83,7 +83,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectLogs: + ) -> ProjectLogsView: """ Get list of all logs from a project. @@ -103,7 +103,7 @@ async def list( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ProjectLogs, + cast_to=ProjectLogsView, ) diff --git a/src/runloop/resources/projects/projects.py b/src/runloop/resources/projects/projects.py index e27fc6fb6..57d3ba365 100644 --- a/src/runloop/resources/projects/projects.py +++ b/src/runloop/resources/projects/projects.py @@ -24,7 +24,7 @@ from ..._base_client import ( make_request_options, ) -from ...types.project_list import ProjectList +from ...types.project_list_view import ProjectListView __all__ = ["ProjectsResource", "AsyncProjectsResource"] @@ -51,7 +51,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectList: + ) -> ProjectListView: """Get list of all projects for the authenticated user. This includes all projects @@ -62,7 +62,7 @@ def list( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ProjectList, + cast_to=ProjectListView, ) @@ -88,7 +88,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectList: + ) -> ProjectListView: """Get list of all projects for the authenticated user. This includes all projects @@ -99,7 +99,7 @@ async def list( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ProjectList, + cast_to=ProjectListView, ) diff --git a/src/runloop/resources/sessions/__init__.py b/src/runloop/resources/sessions/__init__.py deleted file mode 100644 index cc3467b66..000000000 --- a/src/runloop/resources/sessions/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .sessions import ( - SessionsResource, - AsyncSessionsResource, - SessionsResourceWithRawResponse, - AsyncSessionsResourceWithRawResponse, - SessionsResourceWithStreamingResponse, - AsyncSessionsResourceWithStreamingResponse, -) - -__all__ = [ - "SessionsResource", - "AsyncSessionsResource", - "SessionsResourceWithRawResponse", - "AsyncSessionsResourceWithRawResponse", - "SessionsResourceWithStreamingResponse", - "AsyncSessionsResourceWithStreamingResponse", -] diff --git a/src/runloop/resources/sessions/sessions.py b/src/runloop/resources/sessions/sessions.py deleted file mode 100644 index 7499ccebe..000000000 --- a/src/runloop/resources/sessions/sessions.py +++ /dev/null @@ -1,81 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .sessions import ( - SessionsResource, - AsyncSessionsResource, - SessionsResourceWithRawResponse, - AsyncSessionsResourceWithRawResponse, - SessionsResourceWithStreamingResponse, - AsyncSessionsResourceWithStreamingResponse, - sessions, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource - -__all__ = ["SessionsResource", "AsyncSessionsResource"] - - -class SessionsResource(SyncAPIResource): - @cached_property - def sessions(self) -> sessions.SessionsResource: - return SessionsResource(self._client) - - @cached_property - def with_raw_response(self) -> SessionsResourceWithRawResponse: - return SessionsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> SessionsResourceWithStreamingResponse: - return SessionsResourceWithStreamingResponse(self) - - -class AsyncSessionsResource(AsyncAPIResource): - @cached_property - def sessions(self) -> sessions.AsyncSessionsResource: - return AsyncSessionsResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncSessionsResourceWithRawResponse: - return AsyncSessionsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncSessionsResourceWithStreamingResponse: - return AsyncSessionsResourceWithStreamingResponse(self) - - -class SessionsResourceWithRawResponse: - def __init__(self, sessions: SessionsResource) -> None: - self._sessions = sessions - - @cached_property - def sessions(self) -> SessionsResourceWithRawResponse: - return SessionsResourceWithRawResponse(self._sessions.sessions) - - -class AsyncSessionsResourceWithRawResponse: - def __init__(self, sessions: AsyncSessionsResource) -> None: - self._sessions = sessions - - @cached_property - def sessions(self) -> AsyncSessionsResourceWithRawResponse: - return AsyncSessionsResourceWithRawResponse(self._sessions.sessions) - - -class SessionsResourceWithStreamingResponse: - def __init__(self, sessions: SessionsResource) -> None: - self._sessions = sessions - - @cached_property - def sessions(self) -> SessionsResourceWithStreamingResponse: - return SessionsResourceWithStreamingResponse(self._sessions.sessions) - - -class AsyncSessionsResourceWithStreamingResponse: - def __init__(self, sessions: AsyncSessionsResource) -> None: - self._sessions = sessions - - @cached_property - def sessions(self) -> AsyncSessionsResourceWithStreamingResponse: - return AsyncSessionsResourceWithStreamingResponse(self._sessions.sessions) diff --git a/src/runloop/resources/sessions/sessions/__init__.py b/src/runloop/resources/sessions/sessions/__init__.py deleted file mode 100644 index cc3467b66..000000000 --- a/src/runloop/resources/sessions/sessions/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .sessions import ( - SessionsResource, - AsyncSessionsResource, - SessionsResourceWithRawResponse, - AsyncSessionsResourceWithRawResponse, - SessionsResourceWithStreamingResponse, - AsyncSessionsResourceWithStreamingResponse, -) - -__all__ = [ - "SessionsResource", - "AsyncSessionsResource", - "SessionsResourceWithRawResponse", - "AsyncSessionsResourceWithRawResponse", - "SessionsResourceWithStreamingResponse", - "AsyncSessionsResourceWithStreamingResponse", -] diff --git a/src/runloop/resources/sessions/sessions/sessions.py b/src/runloop/resources/sessions/sessions/sessions.py deleted file mode 100644 index bc88d75b3..000000000 --- a/src/runloop/resources/sessions/sessions/sessions.py +++ /dev/null @@ -1,174 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...._base_client import ( - make_request_options, -) -from ....types.sessions.session import Session -from ....types.sessions.session_list import SessionList - -__all__ = ["SessionsResource", "AsyncSessionsResource"] - - -class SessionsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> SessionsResourceWithRawResponse: - return SessionsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> SessionsResourceWithStreamingResponse: - return SessionsResourceWithStreamingResponse(self) - - def create( - self, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Session: - """Create a new session for the application. - - Sessions are used to store metadata - and state for your application. - """ - return self._post( - "/v1/sessions/sessions", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=Session, - ) - - def list( - self, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SessionList: - """List the sessions associated with your application.""" - return self._get( - "/v1/sessions/sessions", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SessionList, - ) - - -class AsyncSessionsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncSessionsResourceWithRawResponse: - return AsyncSessionsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncSessionsResourceWithStreamingResponse: - return AsyncSessionsResourceWithStreamingResponse(self) - - async def create( - self, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Session: - """Create a new session for the application. - - Sessions are used to store metadata - and state for your application. - """ - return await self._post( - "/v1/sessions/sessions", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=Session, - ) - - async def list( - self, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SessionList: - """List the sessions associated with your application.""" - return await self._get( - "/v1/sessions/sessions", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SessionList, - ) - - -class SessionsResourceWithRawResponse: - def __init__(self, sessions: SessionsResource) -> None: - self._sessions = sessions - - self.create = to_raw_response_wrapper( - sessions.create, - ) - self.list = to_raw_response_wrapper( - sessions.list, - ) - - -class AsyncSessionsResourceWithRawResponse: - def __init__(self, sessions: AsyncSessionsResource) -> None: - self._sessions = sessions - - self.create = async_to_raw_response_wrapper( - sessions.create, - ) - self.list = async_to_raw_response_wrapper( - sessions.list, - ) - - -class SessionsResourceWithStreamingResponse: - def __init__(self, sessions: SessionsResource) -> None: - self._sessions = sessions - - self.create = to_streamed_response_wrapper( - sessions.create, - ) - self.list = to_streamed_response_wrapper( - sessions.list, - ) - - -class AsyncSessionsResourceWithStreamingResponse: - def __init__(self, sessions: AsyncSessionsResource) -> None: - self._sessions = sessions - - self.create = async_to_streamed_response_wrapper( - sessions.create, - ) - self.list = async_to_streamed_response_wrapper( - sessions.list, - ) diff --git a/src/runloop/types/__init__.py b/src/runloop/types/__init__.py index 6a44d4dcf..5b1d3b7f3 100644 --- a/src/runloop/types/__init__.py +++ b/src/runloop/types/__init__.py @@ -2,15 +2,21 @@ from __future__ import annotations -from .devbox import Devbox as Devbox -from .shared import FunctionInvocationDetail as FunctionInvocationDetail -from .code_handle import CodeHandle as CodeHandle -from .devbox_list import DevboxList as DevboxList -from .project_list import ProjectList as ProjectList -from .function_list import FunctionList as FunctionList -from .code_handle_list import CodeHandleList as CodeHandleList +from .shared import ( + EmptyRecord as EmptyRecord, + ProjectLogsView as ProjectLogsView, + FunctionInvocationDetailView as FunctionInvocationDetailView, +) +from .devbox_view import DevboxView as DevboxView +from .code_handle_view import CodeHandleView as CodeHandleView +from .devbox_list_view import DevboxListView as DevboxListView +from .project_list_view import ProjectListView as ProjectListView from .devbox_list_params import DevboxListParams as DevboxListParams +from .function_list_view import FunctionListView as FunctionListView from .devbox_create_params import DevboxCreateParams as DevboxCreateParams -from .latch_fulfill_params import LatchFulfillParams as LatchFulfillParams +from .code_handle_list_view import CodeHandleListView as CodeHandleListView from .code_handle_list_params import CodeHandleListParams as CodeHandleListParams from .code_handle_create_params import CodeHandleCreateParams as CodeHandleCreateParams +from .function_invoke_sync_params import FunctionInvokeSyncParams as FunctionInvokeSyncParams +from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView +from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams diff --git a/src/runloop/types/code_handle_list.py b/src/runloop/types/code_handle_list_view.py similarity index 55% rename from src/runloop/types/code_handle_list.py rename to src/runloop/types/code_handle_list_view.py index 91c014b5e..fccd6aa5f 100644 --- a/src/runloop/types/code_handle_list.py +++ b/src/runloop/types/code_handle_list_view.py @@ -3,11 +3,11 @@ from typing import List, Optional from .._models import BaseModel -from .code_handle import CodeHandle +from .code_handle_view import CodeHandleView -__all__ = ["CodeHandleList"] +__all__ = ["CodeHandleListView"] -class CodeHandleList(BaseModel): - code_handles: Optional[List[CodeHandle]] = None +class CodeHandleListView(BaseModel): + code_handles: Optional[List[CodeHandleView]] = None """List of code handles matching given query.""" diff --git a/src/runloop/types/code_handle.py b/src/runloop/types/code_handle_view.py similarity index 88% rename from src/runloop/types/code_handle.py rename to src/runloop/types/code_handle_view.py index de5bc0845..635484ce2 100644 --- a/src/runloop/types/code_handle.py +++ b/src/runloop/types/code_handle_view.py @@ -4,10 +4,10 @@ from .._models import BaseModel -__all__ = ["CodeHandle"] +__all__ = ["CodeHandleView"] -class CodeHandle(BaseModel): +class CodeHandleView(BaseModel): id: Optional[str] = None """The id of the CodeHandle.""" diff --git a/src/runloop/types/devbox_execution_detail_view.py b/src/runloop/types/devbox_execution_detail_view.py new file mode 100644 index 000000000..6ecde1050 --- /dev/null +++ b/src/runloop/types/devbox_execution_detail_view.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["DevboxExecutionDetailView"] + + +class DevboxExecutionDetailView(BaseModel): + devbox_id: Optional[str] = None + """Devbox id where command was executed.""" + + exit_status: Optional[int] = None + """Exit status of command execution.""" + + stderr: Optional[str] = None + """Standard error generated by command.""" + + stdout: Optional[str] = None + """Standard out generated by command.""" diff --git a/src/runloop/types/devbox_list.py b/src/runloop/types/devbox_list_view.py similarity index 57% rename from src/runloop/types/devbox_list.py rename to src/runloop/types/devbox_list_view.py index f02281a92..b370c75a5 100644 --- a/src/runloop/types/devbox_list.py +++ b/src/runloop/types/devbox_list_view.py @@ -2,12 +2,12 @@ from typing import List, Optional -from .devbox import Devbox from .._models import BaseModel +from .devbox_view import DevboxView -__all__ = ["DevboxList"] +__all__ = ["DevboxListView"] -class DevboxList(BaseModel): - devboxes: Optional[List[Devbox]] = None +class DevboxListView(BaseModel): + devboxes: Optional[List[DevboxView]] = None """List of devboxes matching filter.""" diff --git a/src/runloop/types/devbox.py b/src/runloop/types/devbox_view.py similarity index 89% rename from src/runloop/types/devbox.py rename to src/runloop/types/devbox_view.py index ea7a67e86..826b180e9 100644 --- a/src/runloop/types/devbox.py +++ b/src/runloop/types/devbox_view.py @@ -4,10 +4,10 @@ from .._models import BaseModel -__all__ = ["Devbox"] +__all__ = ["DevboxView"] -class Devbox(BaseModel): +class DevboxView(BaseModel): id: Optional[str] = None """The id of the Devbox.""" diff --git a/src/runloop/types/devboxes/__init__.py b/src/runloop/types/devboxes/__init__.py index e21da2fc5..7baebfdd7 100644 --- a/src/runloop/types/devboxes/__init__.py +++ b/src/runloop/types/devboxes/__init__.py @@ -2,4 +2,4 @@ from __future__ import annotations -from .devbox_logs_list import DevboxLogsList as DevboxLogsList +from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView diff --git a/src/runloop/types/devboxes/devbox_logs_list.py b/src/runloop/types/devboxes/devbox_logs_list_view.py similarity index 86% rename from src/runloop/types/devboxes/devbox_logs_list.py rename to src/runloop/types/devboxes/devbox_logs_list_view.py index 0421ab82d..94fafc41a 100644 --- a/src/runloop/types/devboxes/devbox_logs_list.py +++ b/src/runloop/types/devboxes/devbox_logs_list_view.py @@ -4,7 +4,7 @@ from ..._models import BaseModel -__all__ = ["DevboxLogsList", "Log"] +__all__ = ["DevboxLogsListView", "Log"] class Log(BaseModel): @@ -18,6 +18,6 @@ class Log(BaseModel): """Time of log (Unix timestamp milliseconds).""" -class DevboxLogsList(BaseModel): +class DevboxLogsListView(BaseModel): logs: Optional[List[Log]] = None """List of logs for the given devbox.""" diff --git a/src/runloop/types/function_invoke_async_params.py b/src/runloop/types/function_invoke_async_params.py new file mode 100644 index 000000000..ffd4821a0 --- /dev/null +++ b/src/runloop/types/function_invoke_async_params.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["FunctionInvokeAsyncParams", "RunloopMeta"] + + +class FunctionInvokeAsyncParams(TypedDict, total=False): + project_name: Required[str] + + request: Required[object] + """Json of the request""" + + runloop_meta: Annotated[RunloopMeta, PropertyInfo(alias="runloopMeta")] + + +class RunloopMeta(TypedDict, total=False): + session_id: str + """Json of the request""" diff --git a/src/runloop/types/function_invoke_sync_params.py b/src/runloop/types/function_invoke_sync_params.py new file mode 100644 index 000000000..616a7fe32 --- /dev/null +++ b/src/runloop/types/function_invoke_sync_params.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["FunctionInvokeSyncParams", "RunloopMeta"] + + +class FunctionInvokeSyncParams(TypedDict, total=False): + project_name: Required[str] + + request: Required[object] + """Json of the request""" + + runloop_meta: Annotated[RunloopMeta, PropertyInfo(alias="runloopMeta")] + + +class RunloopMeta(TypedDict, total=False): + session_id: str + """Json of the request""" diff --git a/src/runloop/types/function_list.py b/src/runloop/types/function_list_view.py similarity index 84% rename from src/runloop/types/function_list.py rename to src/runloop/types/function_list_view.py index e21c2f693..f31f58245 100644 --- a/src/runloop/types/function_list.py +++ b/src/runloop/types/function_list_view.py @@ -4,7 +4,7 @@ from .._models import BaseModel -__all__ = ["FunctionList", "Function"] +__all__ = ["FunctionListView", "Function"] class Function(BaseModel): @@ -15,6 +15,6 @@ class Function(BaseModel): """Unique name of the project.""" -class FunctionList(BaseModel): +class FunctionListView(BaseModel): functions: Optional[List[Function]] = None """List of functions matching given query.""" diff --git a/src/runloop/types/functions/__init__.py b/src/runloop/types/functions/__init__.py index 2f26a065d..63c00b50b 100644 --- a/src/runloop/types/functions/__init__.py +++ b/src/runloop/types/functions/__init__.py @@ -2,4 +2,4 @@ from __future__ import annotations -from .function_invocation_list import FunctionInvocationList as FunctionInvocationList +from .function_invocation_list_view import FunctionInvocationListView as FunctionInvocationListView diff --git a/src/runloop/types/functions/function_invocation_list.py b/src/runloop/types/functions/function_invocation_list_view.py similarity index 87% rename from src/runloop/types/functions/function_invocation_list.py rename to src/runloop/types/functions/function_invocation_list_view.py index cc5063520..0f70d8b2d 100644 --- a/src/runloop/types/functions/function_invocation_list.py +++ b/src/runloop/types/functions/function_invocation_list_view.py @@ -5,7 +5,7 @@ from ..._models import BaseModel -__all__ = ["FunctionInvocationList", "Invocation"] +__all__ = ["FunctionInvocationListView", "Invocation"] class Invocation(BaseModel): @@ -21,6 +21,6 @@ class Invocation(BaseModel): status: Optional[Literal["created", "running", "success", "failure", "canceled", "suspended"]] = None -class FunctionInvocationList(BaseModel): +class FunctionInvocationListView(BaseModel): invocations: Optional[List[Invocation]] = None """List of functions matching given query.""" diff --git a/src/runloop/types/functions/invocations/__init__.py b/src/runloop/types/functions/invocations/__init__.py index b07bce5b8..4caaf4299 100644 --- a/src/runloop/types/functions/invocations/__init__.py +++ b/src/runloop/types/functions/invocations/__init__.py @@ -2,4 +2,4 @@ from __future__ import annotations -from .invocation_span_list import InvocationSpanList as InvocationSpanList +from .invocation_span_list_view import InvocationSpanListView as InvocationSpanListView diff --git a/src/runloop/types/functions/invocations/invocation_span_list.py b/src/runloop/types/functions/invocations/invocation_span_list_view.py similarity index 82% rename from src/runloop/types/functions/invocations/invocation_span_list.py rename to src/runloop/types/functions/invocations/invocation_span_list_view.py index 99c6714a5..786307ae8 100644 --- a/src/runloop/types/functions/invocations/invocation_span_list.py +++ b/src/runloop/types/functions/invocations/invocation_span_list_view.py @@ -6,10 +6,10 @@ from ...._models import BaseModel -__all__ = ["InvocationSpanList"] +__all__ = ["InvocationSpanListView"] -class InvocationSpanList(BaseModel): +class InvocationSpanListView(BaseModel): invocation_id: Optional[str] = FieldInfo(alias="invocationId", default=None) spans: Optional[object] = None diff --git a/src/runloop/types/latch_fulfill_params.py b/src/runloop/types/latch_fulfill_params.py deleted file mode 100644 index 788cca340..000000000 --- a/src/runloop/types/latch_fulfill_params.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LatchFulfillParams"] - - -class LatchFulfillParams(TypedDict, total=False): - result: Required[object] - """Json of the event to complete the latch with""" diff --git a/src/runloop/types/project_list.py b/src/runloop/types/project_list_view.py similarity index 98% rename from src/runloop/types/project_list.py rename to src/runloop/types/project_list_view.py index d9c977f2d..c74a91a49 100644 --- a/src/runloop/types/project_list.py +++ b/src/runloop/types/project_list_view.py @@ -5,7 +5,7 @@ from .._models import BaseModel __all__ = [ - "ProjectList", + "ProjectListView", "Installation", "Project", "ProjectActiveDeploy", @@ -142,7 +142,7 @@ class Project(BaseModel): """Last deployment attempts (up to 10)""" -class ProjectList(BaseModel): +class ProjectListView(BaseModel): installation: Optional[Installation] = None projects: Optional[List[Project]] = None diff --git a/src/runloop/types/projects/__init__.py b/src/runloop/types/projects/__init__.py index 46ab60d45..f8ee8b14b 100644 --- a/src/runloop/types/projects/__init__.py +++ b/src/runloop/types/projects/__init__.py @@ -1,5 +1,3 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations - -from .project_logs import ProjectLogs as ProjectLogs diff --git a/src/runloop/types/sessions/__init__.py b/src/runloop/types/sessions/__init__.py deleted file mode 100644 index a0505871d..000000000 --- a/src/runloop/types/sessions/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .session import Session as Session -from .session_list import SessionList as SessionList diff --git a/src/runloop/types/sessions/session.py b/src/runloop/types/sessions/session.py deleted file mode 100644 index dbcd088a5..000000000 --- a/src/runloop/types/sessions/session.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["Session"] - - -class Session(BaseModel): - id: Optional[str] = None - """The ID of the session.""" diff --git a/src/runloop/types/sessions/session_list.py b/src/runloop/types/sessions/session_list.py deleted file mode 100644 index 12242094d..000000000 --- a/src/runloop/types/sessions/session_list.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from .session import Session -from ..._models import BaseModel - -__all__ = ["SessionList"] - - -class SessionList(BaseModel): - sessions: Optional[List[Session]] = None - """List of sessions matching given query.""" diff --git a/src/runloop/types/shared/__init__.py b/src/runloop/types/shared/__init__.py index bf987c3b2..582fde022 100644 --- a/src/runloop/types/shared/__init__.py +++ b/src/runloop/types/shared/__init__.py @@ -1,3 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .function_invocation_detail import FunctionInvocationDetail as FunctionInvocationDetail +from .empty_record import EmptyRecord as EmptyRecord +from .project_logs_view import ProjectLogsView as ProjectLogsView +from .function_invocation_detail_view import FunctionInvocationDetailView as FunctionInvocationDetailView diff --git a/src/runloop/types/sessions/sessions/__init__.py b/src/runloop/types/shared/empty_record.py similarity index 63% rename from src/runloop/types/sessions/sessions/__init__.py rename to src/runloop/types/shared/empty_record.py index f8ee8b14b..061bed2da 100644 --- a/src/runloop/types/sessions/sessions/__init__.py +++ b/src/runloop/types/shared/empty_record.py @@ -1,3 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from __future__ import annotations + + + +__all__ = ["EmptyRecord"] + +EmptyRecord = object diff --git a/src/runloop/types/shared/function_invocation_detail.py b/src/runloop/types/shared/function_invocation_detail_view.py similarity index 87% rename from src/runloop/types/shared/function_invocation_detail.py rename to src/runloop/types/shared/function_invocation_detail_view.py index ef644462c..96a10f561 100644 --- a/src/runloop/types/shared/function_invocation_detail.py +++ b/src/runloop/types/shared/function_invocation_detail_view.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["FunctionInvocationDetail"] +__all__ = ["FunctionInvocationDetailView"] -class FunctionInvocationDetail(BaseModel): +class FunctionInvocationDetailView(BaseModel): id: Optional[str] = None """Unique ID of the invocation.""" diff --git a/src/runloop/types/projects/project_logs.py b/src/runloop/types/shared/project_logs_view.py similarity index 85% rename from src/runloop/types/projects/project_logs.py rename to src/runloop/types/shared/project_logs_view.py index 6b10e46c9..9b082f49d 100644 --- a/src/runloop/types/projects/project_logs.py +++ b/src/runloop/types/shared/project_logs_view.py @@ -4,7 +4,7 @@ from ..._models import BaseModel -__all__ = ["ProjectLogs", "Log"] +__all__ = ["ProjectLogsView", "Log"] class Log(BaseModel): @@ -17,6 +17,6 @@ class Log(BaseModel): timestamp: Optional[str] = None -class ProjectLogs(BaseModel): +class ProjectLogsView(BaseModel): logs: Optional[List[Log]] = None """List of logs for the given project.""" diff --git a/tests/api_resources/devboxes/test_logs.py b/tests/api_resources/devboxes/test_logs.py index 572e8996e..f037e9729 100644 --- a/tests/api_resources/devboxes/test_logs.py +++ b/tests/api_resources/devboxes/test_logs.py @@ -9,7 +9,7 @@ from runloop import Runloop, AsyncRunloop from tests.utils import assert_matches_type -from runloop.types.devboxes import DevboxLogsList +from runloop.types.devboxes import DevboxLogsListView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,7 +22,7 @@ def test_method_list(self, client: Runloop) -> None: log = client.devboxes.logs.list( "string", ) - assert_matches_type(DevboxLogsList, log, path=["response"]) + assert_matches_type(DevboxLogsListView, log, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -33,7 +33,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" log = response.parse() - assert_matches_type(DevboxLogsList, log, path=["response"]) + assert_matches_type(DevboxLogsListView, log, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -44,7 +44,7 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" log = response.parse() - assert_matches_type(DevboxLogsList, log, path=["response"]) + assert_matches_type(DevboxLogsListView, log, path=["response"]) assert cast(Any, response.is_closed) is True @@ -64,7 +64,7 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: log = await async_client.devboxes.logs.list( "string", ) - assert_matches_type(DevboxLogsList, log, path=["response"]) + assert_matches_type(DevboxLogsListView, log, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -75,7 +75,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" log = await response.parse() - assert_matches_type(DevboxLogsList, log, path=["response"]) + assert_matches_type(DevboxLogsListView, log, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -86,7 +86,7 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" log = await response.parse() - assert_matches_type(DevboxLogsList, log, path=["response"]) + assert_matches_type(DevboxLogsListView, log, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/functions/invocations/test_spans.py b/tests/api_resources/functions/invocations/test_spans.py index 46616c8ee..b59778059 100644 --- a/tests/api_resources/functions/invocations/test_spans.py +++ b/tests/api_resources/functions/invocations/test_spans.py @@ -9,7 +9,7 @@ from runloop import Runloop, AsyncRunloop from tests.utils import assert_matches_type -from runloop.types.functions.invocations import InvocationSpanList +from runloop.types.functions.invocations import InvocationSpanListView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,7 +22,7 @@ def test_method_list(self, client: Runloop) -> None: span = client.functions.invocations.spans.list( "string", ) - assert_matches_type(InvocationSpanList, span, path=["response"]) + assert_matches_type(InvocationSpanListView, span, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -33,7 +33,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" span = response.parse() - assert_matches_type(InvocationSpanList, span, path=["response"]) + assert_matches_type(InvocationSpanListView, span, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -44,7 +44,7 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" span = response.parse() - assert_matches_type(InvocationSpanList, span, path=["response"]) + assert_matches_type(InvocationSpanListView, span, path=["response"]) assert cast(Any, response.is_closed) is True @@ -64,7 +64,7 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: span = await async_client.functions.invocations.spans.list( "string", ) - assert_matches_type(InvocationSpanList, span, path=["response"]) + assert_matches_type(InvocationSpanListView, span, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -75,7 +75,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" span = await response.parse() - assert_matches_type(InvocationSpanList, span, path=["response"]) + assert_matches_type(InvocationSpanListView, span, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -86,7 +86,7 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" span = await response.parse() - assert_matches_type(InvocationSpanList, span, path=["response"]) + assert_matches_type(InvocationSpanListView, span, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/functions/test_invocations.py b/tests/api_resources/functions/test_invocations.py index 15816e959..a971ff48a 100644 --- a/tests/api_resources/functions/test_invocations.py +++ b/tests/api_resources/functions/test_invocations.py @@ -9,8 +9,8 @@ from runloop import Runloop, AsyncRunloop from tests.utils import assert_matches_type -from runloop.types.shared import FunctionInvocationDetail -from runloop.types.functions import FunctionInvocationList +from runloop.types.shared import FunctionInvocationDetailView +from runloop.types.functions import FunctionInvocationListView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +23,7 @@ def test_method_retrieve(self, client: Runloop) -> None: invocation = client.functions.invocations.retrieve( "string", ) - assert_matches_type(FunctionInvocationDetail, invocation, path=["response"]) + assert_matches_type(FunctionInvocationDetailView, invocation, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Runloop) -> None: @@ -34,7 +34,7 @@ def test_raw_response_retrieve(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invocation = response.parse() - assert_matches_type(FunctionInvocationDetail, invocation, path=["response"]) + assert_matches_type(FunctionInvocationDetailView, invocation, path=["response"]) @parametrize def test_streaming_response_retrieve(self, client: Runloop) -> None: @@ -45,7 +45,7 @@ def test_streaming_response_retrieve(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invocation = response.parse() - assert_matches_type(FunctionInvocationDetail, invocation, path=["response"]) + assert_matches_type(FunctionInvocationDetailView, invocation, path=["response"]) assert cast(Any, response.is_closed) is True @@ -59,7 +59,7 @@ def test_path_params_retrieve(self, client: Runloop) -> None: @parametrize def test_method_list(self, client: Runloop) -> None: invocation = client.functions.invocations.list() - assert_matches_type(FunctionInvocationList, invocation, path=["response"]) + assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -68,7 +68,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invocation = response.parse() - assert_matches_type(FunctionInvocationList, invocation, path=["response"]) + assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -77,7 +77,7 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invocation = response.parse() - assert_matches_type(FunctionInvocationList, invocation, path=["response"]) + assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) assert cast(Any, response.is_closed) is True @@ -128,7 +128,7 @@ async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: invocation = await async_client.functions.invocations.retrieve( "string", ) - assert_matches_type(FunctionInvocationDetail, invocation, path=["response"]) + assert_matches_type(FunctionInvocationDetailView, invocation, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: @@ -139,7 +139,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invocation = await response.parse() - assert_matches_type(FunctionInvocationDetail, invocation, path=["response"]) + assert_matches_type(FunctionInvocationDetailView, invocation, path=["response"]) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: @@ -150,7 +150,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" invocation = await response.parse() - assert_matches_type(FunctionInvocationDetail, invocation, path=["response"]) + assert_matches_type(FunctionInvocationDetailView, invocation, path=["response"]) assert cast(Any, response.is_closed) is True @@ -164,7 +164,7 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: invocation = await async_client.functions.invocations.list() - assert_matches_type(FunctionInvocationList, invocation, path=["response"]) + assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -173,7 +173,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invocation = await response.parse() - assert_matches_type(FunctionInvocationList, invocation, path=["response"]) + assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -182,7 +182,7 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" invocation = await response.parse() - assert_matches_type(FunctionInvocationList, invocation, path=["response"]) + assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/functions/test_openapi.py b/tests/api_resources/functions/test_openapi.py deleted file mode 100644 index 6ecf67427..000000000 --- a/tests/api_resources/functions/test_openapi.py +++ /dev/null @@ -1,71 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from runloop import Runloop, AsyncRunloop -from tests.utils import assert_matches_type - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestOpenAPI: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_retrieve(self, client: Runloop) -> None: - openapi = client.functions.openapi.retrieve() - assert_matches_type(object, openapi, path=["response"]) - - @parametrize - def test_raw_response_retrieve(self, client: Runloop) -> None: - response = client.functions.openapi.with_raw_response.retrieve() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - openapi = response.parse() - assert_matches_type(object, openapi, path=["response"]) - - @parametrize - def test_streaming_response_retrieve(self, client: Runloop) -> None: - with client.functions.openapi.with_streaming_response.retrieve() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - openapi = response.parse() - assert_matches_type(object, openapi, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncOpenAPI: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: - openapi = await async_client.functions.openapi.retrieve() - assert_matches_type(object, openapi, path=["response"]) - - @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: - response = await async_client.functions.openapi.with_raw_response.retrieve() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - openapi = await response.parse() - assert_matches_type(object, openapi, path=["response"]) - - @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: - async with async_client.functions.openapi.with_streaming_response.retrieve() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - openapi = await response.parse() - assert_matches_type(object, openapi, path=["response"]) - - assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/projects/test_logs.py b/tests/api_resources/projects/test_logs.py index 69f00cbd4..c340da400 100644 --- a/tests/api_resources/projects/test_logs.py +++ b/tests/api_resources/projects/test_logs.py @@ -9,7 +9,7 @@ from runloop import Runloop, AsyncRunloop from tests.utils import assert_matches_type -from runloop.types.projects import ProjectLogs +from runloop.types.shared import ProjectLogsView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,7 +22,7 @@ def test_method_list(self, client: Runloop) -> None: log = client.projects.logs.list( "string", ) - assert_matches_type(ProjectLogs, log, path=["response"]) + assert_matches_type(ProjectLogsView, log, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -33,7 +33,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" log = response.parse() - assert_matches_type(ProjectLogs, log, path=["response"]) + assert_matches_type(ProjectLogsView, log, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -44,7 +44,7 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" log = response.parse() - assert_matches_type(ProjectLogs, log, path=["response"]) + assert_matches_type(ProjectLogsView, log, path=["response"]) assert cast(Any, response.is_closed) is True @@ -64,7 +64,7 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: log = await async_client.projects.logs.list( "string", ) - assert_matches_type(ProjectLogs, log, path=["response"]) + assert_matches_type(ProjectLogsView, log, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -75,7 +75,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" log = await response.parse() - assert_matches_type(ProjectLogs, log, path=["response"]) + assert_matches_type(ProjectLogsView, log, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -86,7 +86,7 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" log = await response.parse() - assert_matches_type(ProjectLogs, log, path=["response"]) + assert_matches_type(ProjectLogsView, log, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/sessions/__init__.py b/tests/api_resources/sessions/__init__.py deleted file mode 100644 index fd8019a9a..000000000 --- a/tests/api_resources/sessions/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/sessions/sessions/__init__.py b/tests/api_resources/sessions/sessions/__init__.py deleted file mode 100644 index fd8019a9a..000000000 --- a/tests/api_resources/sessions/sessions/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/sessions/test_sessions.py b/tests/api_resources/sessions/test_sessions.py deleted file mode 100644 index 97cba7463..000000000 --- a/tests/api_resources/sessions/test_sessions.py +++ /dev/null @@ -1,122 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from runloop import Runloop, AsyncRunloop -from tests.utils import assert_matches_type -from runloop.types.sessions import Session, SessionList - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestSessions: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_create(self, client: Runloop) -> None: - session = client.sessions.sessions.create() - assert_matches_type(Session, session, path=["response"]) - - @parametrize - def test_raw_response_create(self, client: Runloop) -> None: - response = client.sessions.sessions.with_raw_response.create() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - session = response.parse() - assert_matches_type(Session, session, path=["response"]) - - @parametrize - def test_streaming_response_create(self, client: Runloop) -> None: - with client.sessions.sessions.with_streaming_response.create() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - session = response.parse() - assert_matches_type(Session, session, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_list(self, client: Runloop) -> None: - session = client.sessions.sessions.list() - assert_matches_type(SessionList, session, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Runloop) -> None: - response = client.sessions.sessions.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - session = response.parse() - assert_matches_type(SessionList, session, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Runloop) -> None: - with client.sessions.sessions.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - session = response.parse() - assert_matches_type(SessionList, session, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncSessions: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_create(self, async_client: AsyncRunloop) -> None: - session = await async_client.sessions.sessions.create() - assert_matches_type(Session, session, path=["response"]) - - @parametrize - async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: - response = await async_client.sessions.sessions.with_raw_response.create() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - session = await response.parse() - assert_matches_type(Session, session, path=["response"]) - - @parametrize - async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: - async with async_client.sessions.sessions.with_streaming_response.create() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - session = await response.parse() - assert_matches_type(Session, session, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_list(self, async_client: AsyncRunloop) -> None: - session = await async_client.sessions.sessions.list() - assert_matches_type(SessionList, session, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: - response = await async_client.sessions.sessions.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - session = await response.parse() - assert_matches_type(SessionList, session, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: - async with async_client.sessions.sessions.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - session = await response.parse() - assert_matches_type(SessionList, session, path=["response"]) - - assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_code_handles.py b/tests/api_resources/test_code_handles.py index 60a09f28c..cafa0f977 100644 --- a/tests/api_resources/test_code_handles.py +++ b/tests/api_resources/test_code_handles.py @@ -9,7 +9,7 @@ from runloop import Runloop, AsyncRunloop from tests.utils import assert_matches_type -from runloop.types import CodeHandle, CodeHandleList +from runloop.types import CodeHandleView, CodeHandleListView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -20,7 +20,7 @@ class TestCodeHandles: @parametrize def test_method_create(self, client: Runloop) -> None: code_handle = client.code_handles.create() - assert_matches_type(CodeHandle, code_handle, path=["response"]) + assert_matches_type(CodeHandleView, code_handle, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: @@ -30,7 +30,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: name="string", owner="string", ) - assert_matches_type(CodeHandle, code_handle, path=["response"]) + assert_matches_type(CodeHandleView, code_handle, path=["response"]) @parametrize def test_raw_response_create(self, client: Runloop) -> None: @@ -39,7 +39,7 @@ def test_raw_response_create(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" code_handle = response.parse() - assert_matches_type(CodeHandle, code_handle, path=["response"]) + assert_matches_type(CodeHandleView, code_handle, path=["response"]) @parametrize def test_streaming_response_create(self, client: Runloop) -> None: @@ -48,14 +48,14 @@ def test_streaming_response_create(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" code_handle = response.parse() - assert_matches_type(CodeHandle, code_handle, path=["response"]) + assert_matches_type(CodeHandleView, code_handle, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_list(self, client: Runloop) -> None: code_handle = client.code_handles.list() - assert_matches_type(CodeHandleList, code_handle, path=["response"]) + assert_matches_type(CodeHandleListView, code_handle, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: @@ -63,7 +63,7 @@ def test_method_list_with_all_params(self, client: Runloop) -> None: owner="string", repo_name="string", ) - assert_matches_type(CodeHandleList, code_handle, path=["response"]) + assert_matches_type(CodeHandleListView, code_handle, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -72,7 +72,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" code_handle = response.parse() - assert_matches_type(CodeHandleList, code_handle, path=["response"]) + assert_matches_type(CodeHandleListView, code_handle, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -81,7 +81,7 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" code_handle = response.parse() - assert_matches_type(CodeHandleList, code_handle, path=["response"]) + assert_matches_type(CodeHandleListView, code_handle, path=["response"]) assert cast(Any, response.is_closed) is True @@ -92,7 +92,7 @@ class TestAsyncCodeHandles: @parametrize async def test_method_create(self, async_client: AsyncRunloop) -> None: code_handle = await async_client.code_handles.create() - assert_matches_type(CodeHandle, code_handle, path=["response"]) + assert_matches_type(CodeHandleView, code_handle, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -102,7 +102,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - name="string", owner="string", ) - assert_matches_type(CodeHandle, code_handle, path=["response"]) + assert_matches_type(CodeHandleView, code_handle, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: @@ -111,7 +111,7 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" code_handle = await response.parse() - assert_matches_type(CodeHandle, code_handle, path=["response"]) + assert_matches_type(CodeHandleView, code_handle, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: @@ -120,14 +120,14 @@ async def test_streaming_response_create(self, async_client: AsyncRunloop) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" code_handle = await response.parse() - assert_matches_type(CodeHandle, code_handle, path=["response"]) + assert_matches_type(CodeHandleView, code_handle, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: code_handle = await async_client.code_handles.list() - assert_matches_type(CodeHandleList, code_handle, path=["response"]) + assert_matches_type(CodeHandleListView, code_handle, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -135,7 +135,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> owner="string", repo_name="string", ) - assert_matches_type(CodeHandleList, code_handle, path=["response"]) + assert_matches_type(CodeHandleListView, code_handle, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -144,7 +144,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" code_handle = await response.parse() - assert_matches_type(CodeHandleList, code_handle, path=["response"]) + assert_matches_type(CodeHandleListView, code_handle, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -153,6 +153,6 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" code_handle = await response.parse() - assert_matches_type(CodeHandleList, code_handle, path=["response"]) + assert_matches_type(CodeHandleListView, code_handle, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 1b5ec2b5b..ae2d1f39f 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -9,7 +9,11 @@ from runloop import Runloop, AsyncRunloop from tests.utils import assert_matches_type -from runloop.types import Devbox, DevboxList +from runloop.types import ( + DevboxView, + DevboxListView, + DevboxExecutionDetailView, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -20,7 +24,7 @@ class TestDevboxes: @parametrize def test_method_create(self, client: Runloop) -> None: devbox = client.devboxes.create() - assert_matches_type(Devbox, devbox, path=["response"]) + assert_matches_type(DevboxView, devbox, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: @@ -30,7 +34,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: environment_variables={"foo": "string"}, setup_commands=["string", "string", "string"], ) - assert_matches_type(Devbox, devbox, path=["response"]) + assert_matches_type(DevboxView, devbox, path=["response"]) @parametrize def test_raw_response_create(self, client: Runloop) -> None: @@ -39,7 +43,7 @@ def test_raw_response_create(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert_matches_type(Devbox, devbox, path=["response"]) + assert_matches_type(DevboxView, devbox, path=["response"]) @parametrize def test_streaming_response_create(self, client: Runloop) -> None: @@ -48,7 +52,7 @@ def test_streaming_response_create(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert_matches_type(Devbox, devbox, path=["response"]) + assert_matches_type(DevboxView, devbox, path=["response"]) assert cast(Any, response.is_closed) is True @@ -57,7 +61,7 @@ def test_method_retrieve(self, client: Runloop) -> None: devbox = client.devboxes.retrieve( "string", ) - assert_matches_type(Devbox, devbox, path=["response"]) + assert_matches_type(DevboxView, devbox, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Runloop) -> None: @@ -68,7 +72,7 @@ def test_raw_response_retrieve(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert_matches_type(Devbox, devbox, path=["response"]) + assert_matches_type(DevboxView, devbox, path=["response"]) @parametrize def test_streaming_response_retrieve(self, client: Runloop) -> None: @@ -79,7 +83,7 @@ def test_streaming_response_retrieve(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert_matches_type(Devbox, devbox, path=["response"]) + assert_matches_type(DevboxView, devbox, path=["response"]) assert cast(Any, response.is_closed) is True @@ -93,14 +97,14 @@ def test_path_params_retrieve(self, client: Runloop) -> None: @parametrize def test_method_list(self, client: Runloop) -> None: devbox = client.devboxes.list() - assert_matches_type(DevboxList, devbox, path=["response"]) + assert_matches_type(DevboxListView, devbox, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.list( status="string", ) - assert_matches_type(DevboxList, devbox, path=["response"]) + assert_matches_type(DevboxListView, devbox, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -109,7 +113,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert_matches_type(DevboxList, devbox, path=["response"]) + assert_matches_type(DevboxListView, devbox, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -118,16 +122,54 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert_matches_type(DevboxList, devbox, path=["response"]) + assert_matches_type(DevboxListView, devbox, path=["response"]) assert cast(Any, response.is_closed) is True + @parametrize + def test_method_execute_sync(self, client: Runloop) -> None: + devbox = client.devboxes.execute_sync( + "string", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_raw_response_execute_sync(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.execute_sync( + "string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_streaming_response_execute_sync(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.execute_sync( + "string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_execute_sync(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.execute_sync( + "", + ) + @parametrize def test_method_shutdown(self, client: Runloop) -> None: devbox = client.devboxes.shutdown( "string", ) - assert_matches_type(Devbox, devbox, path=["response"]) + assert_matches_type(DevboxView, devbox, path=["response"]) @parametrize def test_raw_response_shutdown(self, client: Runloop) -> None: @@ -138,7 +180,7 @@ def test_raw_response_shutdown(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert_matches_type(Devbox, devbox, path=["response"]) + assert_matches_type(DevboxView, devbox, path=["response"]) @parametrize def test_streaming_response_shutdown(self, client: Runloop) -> None: @@ -149,7 +191,7 @@ def test_streaming_response_shutdown(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert_matches_type(Devbox, devbox, path=["response"]) + assert_matches_type(DevboxView, devbox, path=["response"]) assert cast(Any, response.is_closed) is True @@ -167,7 +209,7 @@ class TestAsyncDevboxes: @parametrize async def test_method_create(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.create() - assert_matches_type(Devbox, devbox, path=["response"]) + assert_matches_type(DevboxView, devbox, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -177,7 +219,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - environment_variables={"foo": "string"}, setup_commands=["string", "string", "string"], ) - assert_matches_type(Devbox, devbox, path=["response"]) + assert_matches_type(DevboxView, devbox, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: @@ -186,7 +228,7 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert_matches_type(Devbox, devbox, path=["response"]) + assert_matches_type(DevboxView, devbox, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: @@ -195,7 +237,7 @@ async def test_streaming_response_create(self, async_client: AsyncRunloop) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert_matches_type(Devbox, devbox, path=["response"]) + assert_matches_type(DevboxView, devbox, path=["response"]) assert cast(Any, response.is_closed) is True @@ -204,7 +246,7 @@ async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.retrieve( "string", ) - assert_matches_type(Devbox, devbox, path=["response"]) + assert_matches_type(DevboxView, devbox, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: @@ -215,7 +257,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert_matches_type(Devbox, devbox, path=["response"]) + assert_matches_type(DevboxView, devbox, path=["response"]) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: @@ -226,7 +268,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert_matches_type(Devbox, devbox, path=["response"]) + assert_matches_type(DevboxView, devbox, path=["response"]) assert cast(Any, response.is_closed) is True @@ -240,14 +282,14 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.list() - assert_matches_type(DevboxList, devbox, path=["response"]) + assert_matches_type(DevboxListView, devbox, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.list( status="string", ) - assert_matches_type(DevboxList, devbox, path=["response"]) + assert_matches_type(DevboxListView, devbox, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -256,7 +298,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert_matches_type(DevboxList, devbox, path=["response"]) + assert_matches_type(DevboxListView, devbox, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -265,16 +307,54 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert_matches_type(DevboxList, devbox, path=["response"]) + assert_matches_type(DevboxListView, devbox, path=["response"]) assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_execute_sync(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.execute_sync( + "string", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.execute_sync( + "string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_execute_sync(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.execute_sync( + "string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.execute_sync( + "", + ) + @parametrize async def test_method_shutdown(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.shutdown( "string", ) - assert_matches_type(Devbox, devbox, path=["response"]) + assert_matches_type(DevboxView, devbox, path=["response"]) @parametrize async def test_raw_response_shutdown(self, async_client: AsyncRunloop) -> None: @@ -285,7 +365,7 @@ async def test_raw_response_shutdown(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert_matches_type(Devbox, devbox, path=["response"]) + assert_matches_type(DevboxView, devbox, path=["response"]) @parametrize async def test_streaming_response_shutdown(self, async_client: AsyncRunloop) -> None: @@ -296,7 +376,7 @@ async def test_streaming_response_shutdown(self, async_client: AsyncRunloop) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert_matches_type(Devbox, devbox, path=["response"]) + assert_matches_type(DevboxView, devbox, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_functions.py b/tests/api_resources/test_functions.py index 1b824e109..59e92efcd 100644 --- a/tests/api_resources/test_functions.py +++ b/tests/api_resources/test_functions.py @@ -9,7 +9,8 @@ from runloop import Runloop, AsyncRunloop from tests.utils import assert_matches_type -from runloop.types import FunctionList +from runloop.types import FunctionListView +from runloop.types.shared import FunctionInvocationDetailView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -20,7 +21,7 @@ class TestFunctions: @parametrize def test_method_list(self, client: Runloop) -> None: function = client.functions.list() - assert_matches_type(FunctionList, function, path=["response"]) + assert_matches_type(FunctionListView, function, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -29,7 +30,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" function = response.parse() - assert_matches_type(FunctionList, function, path=["response"]) + assert_matches_type(FunctionListView, function, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -38,10 +39,136 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" function = response.parse() - assert_matches_type(FunctionList, function, path=["response"]) + assert_matches_type(FunctionListView, function, path=["response"]) assert cast(Any, response.is_closed) is True + @parametrize + def test_method_invoke_async(self, client: Runloop) -> None: + function = client.functions.invoke_async( + "string", + project_name="string", + request={}, + ) + assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + + @parametrize + def test_method_invoke_async_with_all_params(self, client: Runloop) -> None: + function = client.functions.invoke_async( + "string", + project_name="string", + request={}, + runloop_meta={"session_id": "string"}, + ) + assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + + @parametrize + def test_raw_response_invoke_async(self, client: Runloop) -> None: + response = client.functions.with_raw_response.invoke_async( + "string", + project_name="string", + request={}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + function = response.parse() + assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + + @parametrize + def test_streaming_response_invoke_async(self, client: Runloop) -> None: + with client.functions.with_streaming_response.invoke_async( + "string", + project_name="string", + request={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + function = response.parse() + assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_invoke_async(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): + client.functions.with_raw_response.invoke_async( + "string", + project_name="", + request={}, + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): + client.functions.with_raw_response.invoke_async( + "", + project_name="string", + request={}, + ) + + @parametrize + def test_method_invoke_sync(self, client: Runloop) -> None: + function = client.functions.invoke_sync( + "string", + project_name="string", + request={}, + ) + assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + + @parametrize + def test_method_invoke_sync_with_all_params(self, client: Runloop) -> None: + function = client.functions.invoke_sync( + "string", + project_name="string", + request={}, + runloop_meta={"session_id": "string"}, + ) + assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + + @parametrize + def test_raw_response_invoke_sync(self, client: Runloop) -> None: + response = client.functions.with_raw_response.invoke_sync( + "string", + project_name="string", + request={}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + function = response.parse() + assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + + @parametrize + def test_streaming_response_invoke_sync(self, client: Runloop) -> None: + with client.functions.with_streaming_response.invoke_sync( + "string", + project_name="string", + request={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + function = response.parse() + assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_invoke_sync(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): + client.functions.with_raw_response.invoke_sync( + "string", + project_name="", + request={}, + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): + client.functions.with_raw_response.invoke_sync( + "", + project_name="string", + request={}, + ) + class TestAsyncFunctions: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -49,7 +176,7 @@ class TestAsyncFunctions: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: function = await async_client.functions.list() - assert_matches_type(FunctionList, function, path=["response"]) + assert_matches_type(FunctionListView, function, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -58,7 +185,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" function = await response.parse() - assert_matches_type(FunctionList, function, path=["response"]) + assert_matches_type(FunctionListView, function, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -67,6 +194,132 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" function = await response.parse() - assert_matches_type(FunctionList, function, path=["response"]) + assert_matches_type(FunctionListView, function, path=["response"]) assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_invoke_async(self, async_client: AsyncRunloop) -> None: + function = await async_client.functions.invoke_async( + "string", + project_name="string", + request={}, + ) + assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + + @parametrize + async def test_method_invoke_async_with_all_params(self, async_client: AsyncRunloop) -> None: + function = await async_client.functions.invoke_async( + "string", + project_name="string", + request={}, + runloop_meta={"session_id": "string"}, + ) + assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + + @parametrize + async def test_raw_response_invoke_async(self, async_client: AsyncRunloop) -> None: + response = await async_client.functions.with_raw_response.invoke_async( + "string", + project_name="string", + request={}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + function = await response.parse() + assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + + @parametrize + async def test_streaming_response_invoke_async(self, async_client: AsyncRunloop) -> None: + async with async_client.functions.with_streaming_response.invoke_async( + "string", + project_name="string", + request={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + function = await response.parse() + assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_invoke_async(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): + await async_client.functions.with_raw_response.invoke_async( + "string", + project_name="", + request={}, + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): + await async_client.functions.with_raw_response.invoke_async( + "", + project_name="string", + request={}, + ) + + @parametrize + async def test_method_invoke_sync(self, async_client: AsyncRunloop) -> None: + function = await async_client.functions.invoke_sync( + "string", + project_name="string", + request={}, + ) + assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + + @parametrize + async def test_method_invoke_sync_with_all_params(self, async_client: AsyncRunloop) -> None: + function = await async_client.functions.invoke_sync( + "string", + project_name="string", + request={}, + runloop_meta={"session_id": "string"}, + ) + assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + + @parametrize + async def test_raw_response_invoke_sync(self, async_client: AsyncRunloop) -> None: + response = await async_client.functions.with_raw_response.invoke_sync( + "string", + project_name="string", + request={}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + function = await response.parse() + assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + + @parametrize + async def test_streaming_response_invoke_sync(self, async_client: AsyncRunloop) -> None: + async with async_client.functions.with_streaming_response.invoke_sync( + "string", + project_name="string", + request={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + function = await response.parse() + assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_invoke_sync(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): + await async_client.functions.with_raw_response.invoke_sync( + "string", + project_name="", + request={}, + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): + await async_client.functions.with_raw_response.invoke_sync( + "", + project_name="string", + request={}, + ) diff --git a/tests/api_resources/test_latches.py b/tests/api_resources/test_latches.py deleted file mode 100644 index 5ffb8e448..000000000 --- a/tests/api_resources/test_latches.py +++ /dev/null @@ -1,105 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from runloop import Runloop, AsyncRunloop -from tests.utils import assert_matches_type - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLatches: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_fulfill(self, client: Runloop) -> None: - latch = client.latches.fulfill( - "string", - result={}, - ) - assert_matches_type(object, latch, path=["response"]) - - @parametrize - def test_raw_response_fulfill(self, client: Runloop) -> None: - response = client.latches.with_raw_response.fulfill( - "string", - result={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - latch = response.parse() - assert_matches_type(object, latch, path=["response"]) - - @parametrize - def test_streaming_response_fulfill(self, client: Runloop) -> None: - with client.latches.with_streaming_response.fulfill( - "string", - result={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - latch = response.parse() - assert_matches_type(object, latch, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_fulfill(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `latch_id` but received ''"): - client.latches.with_raw_response.fulfill( - "", - result={}, - ) - - -class TestAsyncLatches: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_fulfill(self, async_client: AsyncRunloop) -> None: - latch = await async_client.latches.fulfill( - "string", - result={}, - ) - assert_matches_type(object, latch, path=["response"]) - - @parametrize - async def test_raw_response_fulfill(self, async_client: AsyncRunloop) -> None: - response = await async_client.latches.with_raw_response.fulfill( - "string", - result={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - latch = await response.parse() - assert_matches_type(object, latch, path=["response"]) - - @parametrize - async def test_streaming_response_fulfill(self, async_client: AsyncRunloop) -> None: - async with async_client.latches.with_streaming_response.fulfill( - "string", - result={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - latch = await response.parse() - assert_matches_type(object, latch, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_fulfill(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `latch_id` but received ''"): - await async_client.latches.with_raw_response.fulfill( - "", - result={}, - ) diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 56b1b8207..57ef912cd 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -9,7 +9,7 @@ from runloop import Runloop, AsyncRunloop from tests.utils import assert_matches_type -from runloop.types import ProjectList +from runloop.types import ProjectListView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -20,7 +20,7 @@ class TestProjects: @parametrize def test_method_list(self, client: Runloop) -> None: project = client.projects.list() - assert_matches_type(ProjectList, project, path=["response"]) + assert_matches_type(ProjectListView, project, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -29,7 +29,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" project = response.parse() - assert_matches_type(ProjectList, project, path=["response"]) + assert_matches_type(ProjectListView, project, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -38,7 +38,7 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" project = response.parse() - assert_matches_type(ProjectList, project, path=["response"]) + assert_matches_type(ProjectListView, project, path=["response"]) assert cast(Any, response.is_closed) is True @@ -49,7 +49,7 @@ class TestAsyncProjects: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: project = await async_client.projects.list() - assert_matches_type(ProjectList, project, path=["response"]) + assert_matches_type(ProjectListView, project, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -58,7 +58,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" project = await response.parse() - assert_matches_type(ProjectList, project, path=["response"]) + assert_matches_type(ProjectListView, project, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -67,6 +67,6 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" project = await response.parse() - assert_matches_type(ProjectList, project, path=["response"]) + assert_matches_type(ProjectListView, project, path=["response"]) assert cast(Any, response.is_closed) is True From 5b8bcecd0b0fa402d5f69bb3676479cd3d99f865 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 25 Jun 2024 19:12:30 +0000 Subject: [PATCH 008/993] feat(api): OpenAPI spec update via Stainless API --- .stats.yml | 4 +- api.md | 3 +- src/runloop/resources/devboxes/devboxes.py | 79 ------------------ src/runloop/types/__init__.py | 1 - .../types/devbox_execution_detail_view.py | 21 ----- tests/api_resources/test_devboxes.py | 82 +------------------ 6 files changed, 4 insertions(+), 186 deletions(-) delete mode 100644 src/runloop/types/devbox_execution_detail_view.py diff --git a/.stats.yml b/.stats.yml index 7fd519df4..4fb08e82e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 17 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d2f2163594415a1ffc47be29ef38f12e9702098cbfe2cc92b8b8d24bad1e938f.yml +configured_endpoints: 16 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ab9f1a3f003af273e162d93a86042a8c482a935bc904259aac18bd459ab687e.yml diff --git a/api.md b/api.md index abee7327e..f98860872 100644 --- a/api.md +++ b/api.md @@ -22,7 +22,7 @@ Methods: Types: ```python -from runloop.types import DevboxExecutionDetailView, DevboxListView, DevboxView +from runloop.types import DevboxListView, DevboxView ``` Methods: @@ -30,7 +30,6 @@ Methods: - client.devboxes.create(\*\*params) -> DevboxView - client.devboxes.retrieve(id) -> DevboxView - client.devboxes.list(\*\*params) -> DevboxListView -- client.devboxes.execute_sync(id) -> DevboxExecutionDetailView - client.devboxes.shutdown(id) -> DevboxView ## Logs diff --git a/src/runloop/resources/devboxes/devboxes.py b/src/runloop/resources/devboxes/devboxes.py index 2bba79483..61eb739e0 100644 --- a/src/runloop/resources/devboxes/devboxes.py +++ b/src/runloop/resources/devboxes/devboxes.py @@ -33,7 +33,6 @@ ) from ...types.devbox_view import DevboxView from ...types.devbox_list_view import DevboxListView -from ...types.devbox_execution_detail_view import DevboxExecutionDetailView __all__ = ["DevboxesResource", "AsyncDevboxesResource"] @@ -181,39 +180,6 @@ def list( cast_to=DevboxListView, ) - def execute_sync( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxExecutionDetailView: - """ - Synchronously execute a command on a devbox - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/execute_sync", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DevboxExecutionDetailView, - ) - def shutdown( self, id: str, @@ -392,39 +358,6 @@ async def list( cast_to=DevboxListView, ) - async def execute_sync( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxExecutionDetailView: - """ - Synchronously execute a command on a devbox - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/execute_sync", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DevboxExecutionDetailView, - ) - async def shutdown( self, id: str, @@ -473,9 +406,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.list = to_raw_response_wrapper( devboxes.list, ) - self.execute_sync = to_raw_response_wrapper( - devboxes.execute_sync, - ) self.shutdown = to_raw_response_wrapper( devboxes.shutdown, ) @@ -498,9 +428,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.list = async_to_raw_response_wrapper( devboxes.list, ) - self.execute_sync = async_to_raw_response_wrapper( - devboxes.execute_sync, - ) self.shutdown = async_to_raw_response_wrapper( devboxes.shutdown, ) @@ -523,9 +450,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.list = to_streamed_response_wrapper( devboxes.list, ) - self.execute_sync = to_streamed_response_wrapper( - devboxes.execute_sync, - ) self.shutdown = to_streamed_response_wrapper( devboxes.shutdown, ) @@ -548,9 +472,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.list = async_to_streamed_response_wrapper( devboxes.list, ) - self.execute_sync = async_to_streamed_response_wrapper( - devboxes.execute_sync, - ) self.shutdown = async_to_streamed_response_wrapper( devboxes.shutdown, ) diff --git a/src/runloop/types/__init__.py b/src/runloop/types/__init__.py index 5b1d3b7f3..56da67a6a 100644 --- a/src/runloop/types/__init__.py +++ b/src/runloop/types/__init__.py @@ -18,5 +18,4 @@ from .code_handle_list_params import CodeHandleListParams as CodeHandleListParams from .code_handle_create_params import CodeHandleCreateParams as CodeHandleCreateParams from .function_invoke_sync_params import FunctionInvokeSyncParams as FunctionInvokeSyncParams -from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams diff --git a/src/runloop/types/devbox_execution_detail_view.py b/src/runloop/types/devbox_execution_detail_view.py deleted file mode 100644 index 6ecde1050..000000000 --- a/src/runloop/types/devbox_execution_detail_view.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from .._models import BaseModel - -__all__ = ["DevboxExecutionDetailView"] - - -class DevboxExecutionDetailView(BaseModel): - devbox_id: Optional[str] = None - """Devbox id where command was executed.""" - - exit_status: Optional[int] = None - """Exit status of command execution.""" - - stderr: Optional[str] = None - """Standard error generated by command.""" - - stdout: Optional[str] = None - """Standard out generated by command.""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index ae2d1f39f..bf0ef5a5a 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -9,11 +9,7 @@ from runloop import Runloop, AsyncRunloop from tests.utils import assert_matches_type -from runloop.types import ( - DevboxView, - DevboxListView, - DevboxExecutionDetailView, -) +from runloop.types import DevboxView, DevboxListView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -126,44 +122,6 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert cast(Any, response.is_closed) is True - @parametrize - def test_method_execute_sync(self, client: Runloop) -> None: - devbox = client.devboxes.execute_sync( - "string", - ) - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - - @parametrize - def test_raw_response_execute_sync(self, client: Runloop) -> None: - response = client.devboxes.with_raw_response.execute_sync( - "string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - devbox = response.parse() - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - - @parametrize - def test_streaming_response_execute_sync(self, client: Runloop) -> None: - with client.devboxes.with_streaming_response.execute_sync( - "string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - devbox = response.parse() - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_execute_sync(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.with_raw_response.execute_sync( - "", - ) - @parametrize def test_method_shutdown(self, client: Runloop) -> None: devbox = client.devboxes.shutdown( @@ -311,44 +269,6 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert cast(Any, response.is_closed) is True - @parametrize - async def test_method_execute_sync(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.execute_sync( - "string", - ) - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - - @parametrize - async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.with_raw_response.execute_sync( - "string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - devbox = await response.parse() - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - - @parametrize - async def test_streaming_response_execute_sync(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.with_streaming_response.execute_sync( - "string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - devbox = await response.parse() - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.with_raw_response.execute_sync( - "", - ) - @parametrize async def test_method_shutdown(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.shutdown( From ef87b9c9774945dba04eed9bfa08a9da6897ca2a Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 25 Jun 2024 20:44:25 +0000 Subject: [PATCH 009/993] feat(api): OpenAPI spec update via Stainless API --- .stats.yml | 4 +- README.md | 22 +- api.md | 18 +- src/runloop/_client.py | 8 - src/runloop/resources/__init__.py | 14 - src/runloop/resources/code_handles.py | 293 ------------------ src/runloop/resources/devboxes/devboxes.py | 79 +++++ src/runloop/types/__init__.py | 11 +- .../types/code_handle_create_params.py | 21 -- src/runloop/types/code_handle_list_params.py | 15 - src/runloop/types/code_handle_list_view.py | 13 - src/runloop/types/code_handle_view.py | 21 -- .../types/devbox_execution_detail_view.py | 21 ++ src/runloop/types/shared/__init__.py | 1 - src/runloop/types/shared/empty_record.py | 8 - tests/api_resources/test_code_handles.py | 158 ---------- tests/api_resources/test_devboxes.py | 82 ++++- tests/test_client.py | 16 +- 18 files changed, 207 insertions(+), 598 deletions(-) delete mode 100644 src/runloop/resources/code_handles.py delete mode 100644 src/runloop/types/code_handle_create_params.py delete mode 100644 src/runloop/types/code_handle_list_params.py delete mode 100644 src/runloop/types/code_handle_list_view.py delete mode 100644 src/runloop/types/code_handle_view.py create mode 100644 src/runloop/types/devbox_execution_detail_view.py delete mode 100644 src/runloop/types/shared/empty_record.py delete mode 100644 tests/api_resources/test_code_handles.py diff --git a/.stats.yml b/.stats.yml index 4fb08e82e..2049e5bd1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 16 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ab9f1a3f003af273e162d93a86042a8c482a935bc904259aac18bd459ab687e.yml +configured_endpoints: 15 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e741833ec80041045f2b16ea82c2bd4c7b2d4b4bf0ec0f5698b20ece98763d00.yml diff --git a/README.md b/README.md index d3fcd9aeb..17464e442 100644 --- a/README.md +++ b/README.md @@ -35,8 +35,8 @@ client = Runloop( bearer_token=os.environ.get("RUNLOOP_BEARER_TOKEN"), ) -code_handle_view = client.code_handles.create() -print(code_handle_view.id) +devbox_view = client.devboxes.create() +print(devbox_view.id) ``` While you can provide a `bearer_token` keyword argument, @@ -60,8 +60,8 @@ client = AsyncRunloop( async def main() -> None: - code_handle_view = await client.code_handles.create() - print(code_handle_view.id) + devbox_view = await client.devboxes.create() + print(devbox_view.id) asyncio.run(main()) @@ -94,7 +94,7 @@ from runloop import Runloop client = Runloop() try: - client.code_handles.create() + client.devboxes.create() except runloop.APIConnectionError as e: print("The server could not be reached") print(e.__cause__) # an underlying Exception, likely raised within httpx. @@ -137,7 +137,7 @@ client = Runloop( ) # Or, configure per-request: -client.with_options(max_retries=5).code_handles.create() +client.with_options(max_retries=5).devboxes.create() ``` ### Timeouts @@ -160,7 +160,7 @@ client = Runloop( ) # Override per-request: -client.with_options(timeout=5.0).code_handles.create() +client.with_options(timeout=5.0).devboxes.create() ``` On timeout, an `APITimeoutError` is thrown. @@ -199,11 +199,11 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to from runloop import Runloop client = Runloop() -response = client.code_handles.with_raw_response.create() +response = client.devboxes.with_raw_response.create() print(response.headers.get('X-My-Header')) -code_handle = response.parse() # get the object that `code_handles.create()` would have returned -print(code_handle.id) +devbox = response.parse() # get the object that `devboxes.create()` would have returned +print(devbox.id) ``` These methods return an [`APIResponse`](https://github.com/stainless-sdks/runloop-python/tree/main/src/runloop/_response.py) object. @@ -217,7 +217,7 @@ The above interface eagerly reads the full response body when you make the reque To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods. ```python -with client.code_handles.with_streaming_response.create() as response: +with client.devboxes.with_streaming_response.create() as response: print(response.headers.get("X-My-Header")) for line in response.iter_lines(): diff --git a/api.md b/api.md index f98860872..1f2494acb 100644 --- a/api.md +++ b/api.md @@ -1,28 +1,15 @@ # Shared Types ```python -from runloop.types import EmptyRecord, FunctionInvocationDetailView, ProjectLogsView +from runloop.types import FunctionInvocationDetailView, ProjectLogsView ``` -# CodeHandles - -Types: - -```python -from runloop.types import CodeHandleListView, CodeHandleView -``` - -Methods: - -- client.code_handles.create(\*\*params) -> CodeHandleView -- client.code_handles.list(\*\*params) -> CodeHandleListView - # Devboxes Types: ```python -from runloop.types import DevboxListView, DevboxView +from runloop.types import DevboxExecutionDetailView, DevboxListView, DevboxView ``` Methods: @@ -30,6 +17,7 @@ Methods: - client.devboxes.create(\*\*params) -> DevboxView - client.devboxes.retrieve(id) -> DevboxView - client.devboxes.list(\*\*params) -> DevboxListView +- client.devboxes.execute_sync(id) -> DevboxExecutionDetailView - client.devboxes.shutdown(id) -> DevboxView ## Logs diff --git a/src/runloop/_client.py b/src/runloop/_client.py index d8aaf00eb..42f5a0422 100644 --- a/src/runloop/_client.py +++ b/src/runloop/_client.py @@ -46,7 +46,6 @@ class Runloop(SyncAPIClient): - code_handles: resources.CodeHandlesResource devboxes: resources.DevboxesResource functions: resources.FunctionsResource projects: resources.ProjectsResource @@ -107,7 +106,6 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.code_handles = resources.CodeHandlesResource(self) self.devboxes = resources.DevboxesResource(self) self.functions = resources.FunctionsResource(self) self.projects = resources.ProjectsResource(self) @@ -220,7 +218,6 @@ def _make_status_error( class AsyncRunloop(AsyncAPIClient): - code_handles: resources.AsyncCodeHandlesResource devboxes: resources.AsyncDevboxesResource functions: resources.AsyncFunctionsResource projects: resources.AsyncProjectsResource @@ -281,7 +278,6 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.code_handles = resources.AsyncCodeHandlesResource(self) self.devboxes = resources.AsyncDevboxesResource(self) self.functions = resources.AsyncFunctionsResource(self) self.projects = resources.AsyncProjectsResource(self) @@ -395,7 +391,6 @@ def _make_status_error( class RunloopWithRawResponse: def __init__(self, client: Runloop) -> None: - self.code_handles = resources.CodeHandlesResourceWithRawResponse(client.code_handles) self.devboxes = resources.DevboxesResourceWithRawResponse(client.devboxes) self.functions = resources.FunctionsResourceWithRawResponse(client.functions) self.projects = resources.ProjectsResourceWithRawResponse(client.projects) @@ -403,7 +398,6 @@ def __init__(self, client: Runloop) -> None: class AsyncRunloopWithRawResponse: def __init__(self, client: AsyncRunloop) -> None: - self.code_handles = resources.AsyncCodeHandlesResourceWithRawResponse(client.code_handles) self.devboxes = resources.AsyncDevboxesResourceWithRawResponse(client.devboxes) self.functions = resources.AsyncFunctionsResourceWithRawResponse(client.functions) self.projects = resources.AsyncProjectsResourceWithRawResponse(client.projects) @@ -411,7 +405,6 @@ def __init__(self, client: AsyncRunloop) -> None: class RunloopWithStreamedResponse: def __init__(self, client: Runloop) -> None: - self.code_handles = resources.CodeHandlesResourceWithStreamingResponse(client.code_handles) self.devboxes = resources.DevboxesResourceWithStreamingResponse(client.devboxes) self.functions = resources.FunctionsResourceWithStreamingResponse(client.functions) self.projects = resources.ProjectsResourceWithStreamingResponse(client.projects) @@ -419,7 +412,6 @@ def __init__(self, client: Runloop) -> None: class AsyncRunloopWithStreamedResponse: def __init__(self, client: AsyncRunloop) -> None: - self.code_handles = resources.AsyncCodeHandlesResourceWithStreamingResponse(client.code_handles) self.devboxes = resources.AsyncDevboxesResourceWithStreamingResponse(client.devboxes) self.functions = resources.AsyncFunctionsResourceWithStreamingResponse(client.functions) self.projects = resources.AsyncProjectsResourceWithStreamingResponse(client.projects) diff --git a/src/runloop/resources/__init__.py b/src/runloop/resources/__init__.py index f1d0ce4f4..267ebf13d 100644 --- a/src/runloop/resources/__init__.py +++ b/src/runloop/resources/__init__.py @@ -24,22 +24,8 @@ FunctionsResourceWithStreamingResponse, AsyncFunctionsResourceWithStreamingResponse, ) -from .code_handles import ( - CodeHandlesResource, - AsyncCodeHandlesResource, - CodeHandlesResourceWithRawResponse, - AsyncCodeHandlesResourceWithRawResponse, - CodeHandlesResourceWithStreamingResponse, - AsyncCodeHandlesResourceWithStreamingResponse, -) __all__ = [ - "CodeHandlesResource", - "AsyncCodeHandlesResource", - "CodeHandlesResourceWithRawResponse", - "AsyncCodeHandlesResourceWithRawResponse", - "CodeHandlesResourceWithStreamingResponse", - "AsyncCodeHandlesResourceWithStreamingResponse", "DevboxesResource", "AsyncDevboxesResource", "DevboxesResourceWithRawResponse", diff --git a/src/runloop/resources/code_handles.py b/src/runloop/resources/code_handles.py deleted file mode 100644 index 1a61f7e14..000000000 --- a/src/runloop/resources/code_handles.py +++ /dev/null @@ -1,293 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..types import code_handle_list_params, code_handle_create_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._base_client import ( - make_request_options, -) -from ..types.code_handle_view import CodeHandleView -from ..types.code_handle_list_view import CodeHandleListView - -__all__ = ["CodeHandlesResource", "AsyncCodeHandlesResource"] - - -class CodeHandlesResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> CodeHandlesResourceWithRawResponse: - return CodeHandlesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> CodeHandlesResourceWithStreamingResponse: - return CodeHandlesResourceWithStreamingResponse(self) - - def create( - self, - *, - auth_token: str | NotGiven = NOT_GIVEN, - branch: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - owner: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeHandleView: - """Create a new code handle for a given repository. - - This can be referenced in other - parts of the system to refer to a specific version of a repository. - - Args: - auth_token: A short lived, scoped authentication token. - - branch: Branch or tag to checkout instead of main. - - name: The name of the code repository. - - owner: The account that owns the repository. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._post( - "/v1/code_handles", - body=maybe_transform( - { - "auth_token": auth_token, - "branch": branch, - "name": name, - "owner": owner, - }, - code_handle_create_params.CodeHandleCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeHandleView, - ) - - def list( - self, - *, - owner: str | NotGiven = NOT_GIVEN, - repo_name: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeHandleListView: - """ - List the code handles that are available for use. - - Args: - owner: Repo owner name. - - repo_name: Repo name. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get( - "/v1/code_handles", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "owner": owner, - "repo_name": repo_name, - }, - code_handle_list_params.CodeHandleListParams, - ), - ), - cast_to=CodeHandleListView, - ) - - -class AsyncCodeHandlesResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncCodeHandlesResourceWithRawResponse: - return AsyncCodeHandlesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncCodeHandlesResourceWithStreamingResponse: - return AsyncCodeHandlesResourceWithStreamingResponse(self) - - async def create( - self, - *, - auth_token: str | NotGiven = NOT_GIVEN, - branch: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - owner: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeHandleView: - """Create a new code handle for a given repository. - - This can be referenced in other - parts of the system to refer to a specific version of a repository. - - Args: - auth_token: A short lived, scoped authentication token. - - branch: Branch or tag to checkout instead of main. - - name: The name of the code repository. - - owner: The account that owns the repository. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return await self._post( - "/v1/code_handles", - body=await async_maybe_transform( - { - "auth_token": auth_token, - "branch": branch, - "name": name, - "owner": owner, - }, - code_handle_create_params.CodeHandleCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeHandleView, - ) - - async def list( - self, - *, - owner: str | NotGiven = NOT_GIVEN, - repo_name: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeHandleListView: - """ - List the code handles that are available for use. - - Args: - owner: Repo owner name. - - repo_name: Repo name. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return await self._get( - "/v1/code_handles", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "owner": owner, - "repo_name": repo_name, - }, - code_handle_list_params.CodeHandleListParams, - ), - ), - cast_to=CodeHandleListView, - ) - - -class CodeHandlesResourceWithRawResponse: - def __init__(self, code_handles: CodeHandlesResource) -> None: - self._code_handles = code_handles - - self.create = to_raw_response_wrapper( - code_handles.create, - ) - self.list = to_raw_response_wrapper( - code_handles.list, - ) - - -class AsyncCodeHandlesResourceWithRawResponse: - def __init__(self, code_handles: AsyncCodeHandlesResource) -> None: - self._code_handles = code_handles - - self.create = async_to_raw_response_wrapper( - code_handles.create, - ) - self.list = async_to_raw_response_wrapper( - code_handles.list, - ) - - -class CodeHandlesResourceWithStreamingResponse: - def __init__(self, code_handles: CodeHandlesResource) -> None: - self._code_handles = code_handles - - self.create = to_streamed_response_wrapper( - code_handles.create, - ) - self.list = to_streamed_response_wrapper( - code_handles.list, - ) - - -class AsyncCodeHandlesResourceWithStreamingResponse: - def __init__(self, code_handles: AsyncCodeHandlesResource) -> None: - self._code_handles = code_handles - - self.create = async_to_streamed_response_wrapper( - code_handles.create, - ) - self.list = async_to_streamed_response_wrapper( - code_handles.list, - ) diff --git a/src/runloop/resources/devboxes/devboxes.py b/src/runloop/resources/devboxes/devboxes.py index 61eb739e0..2bba79483 100644 --- a/src/runloop/resources/devboxes/devboxes.py +++ b/src/runloop/resources/devboxes/devboxes.py @@ -33,6 +33,7 @@ ) from ...types.devbox_view import DevboxView from ...types.devbox_list_view import DevboxListView +from ...types.devbox_execution_detail_view import DevboxExecutionDetailView __all__ = ["DevboxesResource", "AsyncDevboxesResource"] @@ -180,6 +181,39 @@ def list( cast_to=DevboxListView, ) + def execute_sync( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxExecutionDetailView: + """ + Synchronously execute a command on a devbox + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/execute_sync", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxExecutionDetailView, + ) + def shutdown( self, id: str, @@ -358,6 +392,39 @@ async def list( cast_to=DevboxListView, ) + async def execute_sync( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxExecutionDetailView: + """ + Synchronously execute a command on a devbox + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/execute_sync", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxExecutionDetailView, + ) + async def shutdown( self, id: str, @@ -406,6 +473,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.list = to_raw_response_wrapper( devboxes.list, ) + self.execute_sync = to_raw_response_wrapper( + devboxes.execute_sync, + ) self.shutdown = to_raw_response_wrapper( devboxes.shutdown, ) @@ -428,6 +498,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.list = async_to_raw_response_wrapper( devboxes.list, ) + self.execute_sync = async_to_raw_response_wrapper( + devboxes.execute_sync, + ) self.shutdown = async_to_raw_response_wrapper( devboxes.shutdown, ) @@ -450,6 +523,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.list = to_streamed_response_wrapper( devboxes.list, ) + self.execute_sync = to_streamed_response_wrapper( + devboxes.execute_sync, + ) self.shutdown = to_streamed_response_wrapper( devboxes.shutdown, ) @@ -472,6 +548,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.list = async_to_streamed_response_wrapper( devboxes.list, ) + self.execute_sync = async_to_streamed_response_wrapper( + devboxes.execute_sync, + ) self.shutdown = async_to_streamed_response_wrapper( devboxes.shutdown, ) diff --git a/src/runloop/types/__init__.py b/src/runloop/types/__init__.py index 56da67a6a..8cbd8f02b 100644 --- a/src/runloop/types/__init__.py +++ b/src/runloop/types/__init__.py @@ -2,20 +2,13 @@ from __future__ import annotations -from .shared import ( - EmptyRecord as EmptyRecord, - ProjectLogsView as ProjectLogsView, - FunctionInvocationDetailView as FunctionInvocationDetailView, -) +from .shared import ProjectLogsView as ProjectLogsView, FunctionInvocationDetailView as FunctionInvocationDetailView from .devbox_view import DevboxView as DevboxView -from .code_handle_view import CodeHandleView as CodeHandleView from .devbox_list_view import DevboxListView as DevboxListView from .project_list_view import ProjectListView as ProjectListView from .devbox_list_params import DevboxListParams as DevboxListParams from .function_list_view import FunctionListView as FunctionListView from .devbox_create_params import DevboxCreateParams as DevboxCreateParams -from .code_handle_list_view import CodeHandleListView as CodeHandleListView -from .code_handle_list_params import CodeHandleListParams as CodeHandleListParams -from .code_handle_create_params import CodeHandleCreateParams as CodeHandleCreateParams from .function_invoke_sync_params import FunctionInvokeSyncParams as FunctionInvokeSyncParams +from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams diff --git a/src/runloop/types/code_handle_create_params.py b/src/runloop/types/code_handle_create_params.py deleted file mode 100644 index 20409700f..000000000 --- a/src/runloop/types/code_handle_create_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["CodeHandleCreateParams"] - - -class CodeHandleCreateParams(TypedDict, total=False): - auth_token: str - """A short lived, scoped authentication token.""" - - branch: str - """Branch or tag to checkout instead of main.""" - - name: str - """The name of the code repository.""" - - owner: str - """The account that owns the repository.""" diff --git a/src/runloop/types/code_handle_list_params.py b/src/runloop/types/code_handle_list_params.py deleted file mode 100644 index f1e074974..000000000 --- a/src/runloop/types/code_handle_list_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["CodeHandleListParams"] - - -class CodeHandleListParams(TypedDict, total=False): - owner: str - """Repo owner name.""" - - repo_name: str - """Repo name.""" diff --git a/src/runloop/types/code_handle_list_view.py b/src/runloop/types/code_handle_list_view.py deleted file mode 100644 index fccd6aa5f..000000000 --- a/src/runloop/types/code_handle_list_view.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from .._models import BaseModel -from .code_handle_view import CodeHandleView - -__all__ = ["CodeHandleListView"] - - -class CodeHandleListView(BaseModel): - code_handles: Optional[List[CodeHandleView]] = None - """List of code handles matching given query.""" diff --git a/src/runloop/types/code_handle_view.py b/src/runloop/types/code_handle_view.py deleted file mode 100644 index 635484ce2..000000000 --- a/src/runloop/types/code_handle_view.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from .._models import BaseModel - -__all__ = ["CodeHandleView"] - - -class CodeHandleView(BaseModel): - id: Optional[str] = None - """The id of the CodeHandle.""" - - commit_hash: Optional[str] = None - """The git commit hash associated with the code.""" - - owner: Optional[str] = None - """The owner of the repository.""" - - repo_name: Optional[str] = None - """The name of the source repository.""" diff --git a/src/runloop/types/devbox_execution_detail_view.py b/src/runloop/types/devbox_execution_detail_view.py new file mode 100644 index 000000000..6ecde1050 --- /dev/null +++ b/src/runloop/types/devbox_execution_detail_view.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["DevboxExecutionDetailView"] + + +class DevboxExecutionDetailView(BaseModel): + devbox_id: Optional[str] = None + """Devbox id where command was executed.""" + + exit_status: Optional[int] = None + """Exit status of command execution.""" + + stderr: Optional[str] = None + """Standard error generated by command.""" + + stdout: Optional[str] = None + """Standard out generated by command.""" diff --git a/src/runloop/types/shared/__init__.py b/src/runloop/types/shared/__init__.py index 582fde022..24e01a444 100644 --- a/src/runloop/types/shared/__init__.py +++ b/src/runloop/types/shared/__init__.py @@ -1,5 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .empty_record import EmptyRecord as EmptyRecord from .project_logs_view import ProjectLogsView as ProjectLogsView from .function_invocation_detail_view import FunctionInvocationDetailView as FunctionInvocationDetailView diff --git a/src/runloop/types/shared/empty_record.py b/src/runloop/types/shared/empty_record.py deleted file mode 100644 index 061bed2da..000000000 --- a/src/runloop/types/shared/empty_record.py +++ /dev/null @@ -1,8 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - - - -__all__ = ["EmptyRecord"] - -EmptyRecord = object diff --git a/tests/api_resources/test_code_handles.py b/tests/api_resources/test_code_handles.py deleted file mode 100644 index cafa0f977..000000000 --- a/tests/api_resources/test_code_handles.py +++ /dev/null @@ -1,158 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from runloop import Runloop, AsyncRunloop -from tests.utils import assert_matches_type -from runloop.types import CodeHandleView, CodeHandleListView - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestCodeHandles: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_create(self, client: Runloop) -> None: - code_handle = client.code_handles.create() - assert_matches_type(CodeHandleView, code_handle, path=["response"]) - - @parametrize - def test_method_create_with_all_params(self, client: Runloop) -> None: - code_handle = client.code_handles.create( - auth_token="string", - branch="string", - name="string", - owner="string", - ) - assert_matches_type(CodeHandleView, code_handle, path=["response"]) - - @parametrize - def test_raw_response_create(self, client: Runloop) -> None: - response = client.code_handles.with_raw_response.create() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - code_handle = response.parse() - assert_matches_type(CodeHandleView, code_handle, path=["response"]) - - @parametrize - def test_streaming_response_create(self, client: Runloop) -> None: - with client.code_handles.with_streaming_response.create() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - code_handle = response.parse() - assert_matches_type(CodeHandleView, code_handle, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_list(self, client: Runloop) -> None: - code_handle = client.code_handles.list() - assert_matches_type(CodeHandleListView, code_handle, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Runloop) -> None: - code_handle = client.code_handles.list( - owner="string", - repo_name="string", - ) - assert_matches_type(CodeHandleListView, code_handle, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Runloop) -> None: - response = client.code_handles.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - code_handle = response.parse() - assert_matches_type(CodeHandleListView, code_handle, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Runloop) -> None: - with client.code_handles.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - code_handle = response.parse() - assert_matches_type(CodeHandleListView, code_handle, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncCodeHandles: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_create(self, async_client: AsyncRunloop) -> None: - code_handle = await async_client.code_handles.create() - assert_matches_type(CodeHandleView, code_handle, path=["response"]) - - @parametrize - async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: - code_handle = await async_client.code_handles.create( - auth_token="string", - branch="string", - name="string", - owner="string", - ) - assert_matches_type(CodeHandleView, code_handle, path=["response"]) - - @parametrize - async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: - response = await async_client.code_handles.with_raw_response.create() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - code_handle = await response.parse() - assert_matches_type(CodeHandleView, code_handle, path=["response"]) - - @parametrize - async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: - async with async_client.code_handles.with_streaming_response.create() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - code_handle = await response.parse() - assert_matches_type(CodeHandleView, code_handle, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_list(self, async_client: AsyncRunloop) -> None: - code_handle = await async_client.code_handles.list() - assert_matches_type(CodeHandleListView, code_handle, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: - code_handle = await async_client.code_handles.list( - owner="string", - repo_name="string", - ) - assert_matches_type(CodeHandleListView, code_handle, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: - response = await async_client.code_handles.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - code_handle = await response.parse() - assert_matches_type(CodeHandleListView, code_handle, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: - async with async_client.code_handles.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - code_handle = await response.parse() - assert_matches_type(CodeHandleListView, code_handle, path=["response"]) - - assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index bf0ef5a5a..ae2d1f39f 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -9,7 +9,11 @@ from runloop import Runloop, AsyncRunloop from tests.utils import assert_matches_type -from runloop.types import DevboxView, DevboxListView +from runloop.types import ( + DevboxView, + DevboxListView, + DevboxExecutionDetailView, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -122,6 +126,44 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_execute_sync(self, client: Runloop) -> None: + devbox = client.devboxes.execute_sync( + "string", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_raw_response_execute_sync(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.execute_sync( + "string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_streaming_response_execute_sync(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.execute_sync( + "string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_execute_sync(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.execute_sync( + "", + ) + @parametrize def test_method_shutdown(self, client: Runloop) -> None: devbox = client.devboxes.shutdown( @@ -269,6 +311,44 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_execute_sync(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.execute_sync( + "string", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.execute_sync( + "string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_execute_sync(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.execute_sync( + "string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.execute_sync( + "", + ) + @parametrize async def test_method_shutdown(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.shutdown( diff --git a/tests/test_client.py b/tests/test_client.py index acdfcab02..1c31aaac7 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -732,11 +732,11 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str @mock.patch("runloop._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: - respx_mock.post("/v1/code_handles").mock(side_effect=httpx.TimeoutException("Test timeout error")) + respx_mock.post("/v1/devboxes").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): self.client.post( - "/v1/code_handles", + "/v1/devboxes", body=cast(object, dict()), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, @@ -747,11 +747,11 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No @mock.patch("runloop._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: - respx_mock.post("/v1/code_handles").mock(return_value=httpx.Response(500)) + respx_mock.post("/v1/devboxes").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): self.client.post( - "/v1/code_handles", + "/v1/devboxes", body=cast(object, dict()), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, @@ -1447,11 +1447,11 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte @mock.patch("runloop._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: - respx_mock.post("/v1/code_handles").mock(side_effect=httpx.TimeoutException("Test timeout error")) + respx_mock.post("/v1/devboxes").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): await self.client.post( - "/v1/code_handles", + "/v1/devboxes", body=cast(object, dict()), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, @@ -1462,11 +1462,11 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) @mock.patch("runloop._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: - respx_mock.post("/v1/code_handles").mock(return_value=httpx.Response(500)) + respx_mock.post("/v1/devboxes").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): await self.client.post( - "/v1/code_handles", + "/v1/devboxes", body=cast(object, dict()), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, From edba93274c89aa922c95a6b9828a0521896ca680 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 20:50:09 +0000 Subject: [PATCH 010/993] chore: go live (#5) --- .github/workflows/publish-pypi.yml | 31 +++++++++++++ .github/workflows/release-doctor.yml | 19 ++++++++ .release-please-manifest.json | 3 ++ CONTRIBUTING.md | 4 +- README.md | 10 ++--- bin/check-release-environment | 32 ++++++++++++++ pyproject.toml | 6 +-- release-please-config.json | 66 ++++++++++++++++++++++++++++ src/runloop/_version.py | 2 +- 9 files changed, 162 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/publish-pypi.yml create mode 100644 .github/workflows/release-doctor.yml create mode 100644 .release-please-manifest.json create mode 100644 bin/check-release-environment create mode 100644 release-please-config.json diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml new file mode 100644 index 000000000..065780d52 --- /dev/null +++ b/.github/workflows/publish-pypi.yml @@ -0,0 +1,31 @@ +# This workflow is triggered when a GitHub release is created. +# It can also be run manually to re-publish to PyPI in case it failed for some reason. +# You can run this workflow by navigating to https://www.github.com/runloopai/api-client-python/actions/workflows/publish-pypi.yml +name: Publish PyPI +on: + workflow_dispatch: + + release: + types: [published] + +jobs: + publish: + name: publish + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install Rye + run: | + curl -sSf https://rye.astral.sh/get | bash + echo "$HOME/.rye/shims" >> $GITHUB_PATH + env: + RYE_VERSION: 0.24.0 + RYE_INSTALL_OPTION: "--yes" + + - name: Publish to PyPI + run: | + bash ./bin/publish-pypi + env: + PYPI_TOKEN: ${{ secrets.RUNLOOP_PYPI_TOKEN || secrets.PYPI_TOKEN }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml new file mode 100644 index 000000000..58c1c1917 --- /dev/null +++ b/.github/workflows/release-doctor.yml @@ -0,0 +1,19 @@ +name: Release Doctor +on: + pull_request: + workflow_dispatch: + +jobs: + release_doctor: + name: release doctor + runs-on: ubuntu-latest + if: github.repository == 'runloopai/api-client-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + + steps: + - uses: actions/checkout@v4 + + - name: Check release environment + run: | + bash ./bin/check-release-environment + env: + PYPI_TOKEN: ${{ secrets.RUNLOOP_PYPI_TOKEN || secrets.PYPI_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 000000000..c4762802e --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.0.1-alpha.0" +} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 87045143c..1f39c2742 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,7 +59,7 @@ If you’d like to use the repository from source, you can either install from g To install via git: ```bash -pip install git+ssh://git@github.com/stainless-sdks/runloop-python.git +pip install git+ssh://git@github.com/runloopai/api-client-python.git ``` Alternatively, you can build from source and install the wheel file: @@ -117,7 +117,7 @@ the changes aren't made through the automated pipeline, you may want to make rel ### Publish with a GitHub workflow -You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/stainless-sdks/runloop-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. +You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/runloopai/api-client-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up. ### Publish manually diff --git a/README.md b/README.md index 17464e442..07dd7af4f 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ The REST API documentation can be found [on runloop.ai](https://runloop.ai). The ## Installation ```sh -# install from this staging repo -pip install git+ssh://git@github.com/stainless-sdks/runloop-python.git +# install from the production repo +pip install git+ssh://git@github.com/runloopai/api-client-python.git ``` > [!NOTE] @@ -206,9 +206,9 @@ devbox = response.parse() # get the object that `devboxes.create()` would have print(devbox.id) ``` -These methods return an [`APIResponse`](https://github.com/stainless-sdks/runloop-python/tree/main/src/runloop/_response.py) object. +These methods return an [`APIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop/_response.py) object. -The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/runloop-python/tree/main/src/runloop/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. +The async client returns an [`AsyncAPIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. #### `.with_streaming_response` @@ -296,7 +296,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. -We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/runloop-python/issues) with questions, bugs, or suggestions. +We are keen for your feedback; please open an [issue](https://www.github.com/runloopai/api-client-python/issues) with questions, bugs, or suggestions. ## Requirements diff --git a/bin/check-release-environment b/bin/check-release-environment new file mode 100644 index 000000000..bbcc4181f --- /dev/null +++ b/bin/check-release-environment @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +warnings=() +errors=() + +if [ -z "${PYPI_TOKEN}" ]; then + warnings+=("The RUNLOOP_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") +fi + +lenWarnings=${#warnings[@]} + +if [[ lenWarnings -gt 0 ]]; then + echo -e "Found the following warnings in the release environment:\n" + + for warning in "${warnings[@]}"; do + echo -e "- $warning\n" + done +fi + +lenErrors=${#errors[@]} + +if [[ lenErrors -gt 0 ]]; then + echo -e "Found the following errors in the release environment:\n" + + for error in "${errors[@]}"; do + echo -e "- $error\n" + done + + exit 1 +fi + +echo "The environment is ready to push releases!" diff --git a/pyproject.toml b/pyproject.toml index 24a36fd0a..172cdab8e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,8 +39,8 @@ classifiers = [ [project.urls] -Homepage = "https://github.com/stainless-sdks/runloop-python" -Repository = "https://github.com/stainless-sdks/runloop-python" +Homepage = "https://github.com/runloopai/api-client-python" +Repository = "https://github.com/runloopai/api-client-python" @@ -108,7 +108,7 @@ path = "README.md" [[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]] # replace relative links with absolute links pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)' -replacement = '[\1](https://github.com/stainless-sdks/runloop-python/tree/main/\g<2>)' +replacement = '[\1](https://github.com/runloopai/api-client-python/tree/main/\g<2>)' [tool.black] line-length = 120 diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 000000000..3bde9481f --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,66 @@ +{ + "packages": { + ".": {} + }, + "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", + "include-v-in-tag": true, + "include-component-in-tag": false, + "versioning": "prerelease", + "prerelease": true, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false, + "pull-request-header": "Automated Release PR", + "pull-request-title-pattern": "release: ${version}", + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "revert", + "section": "Reverts" + }, + { + "type": "chore", + "section": "Chores" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "style", + "section": "Styles" + }, + { + "type": "refactor", + "section": "Refactors" + }, + { + "type": "test", + "section": "Tests", + "hidden": true + }, + { + "type": "build", + "section": "Build System" + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + } + ], + "release-type": "python", + "extra-files": [ + "src/runloop/_version.py" + ] +} \ No newline at end of file diff --git a/src/runloop/_version.py b/src/runloop/_version.py index 5c37f7fda..d24c5a445 100644 --- a/src/runloop/_version.py +++ b/src/runloop/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop" -__version__ = "0.0.1-alpha.0" +__version__ = "0.0.1-alpha.0" # x-release-please-version From ea4d8c61ccd78167c1084a34bb8f43493aa11878 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 22:00:18 +0000 Subject: [PATCH 011/993] chore: update SDK settings (#6) --- README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 07dd7af4f..a615b57d6 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,10 @@ The REST API documentation can be found [on runloop.ai](https://runloop.ai). The ## Installation ```sh -# install from the production repo -pip install git+ssh://git@github.com/runloopai/api-client-python.git +# install from PyPI +pip install --pre runloop ``` -> [!NOTE] -> Once this package is [published to PyPI](https://app.stainlessapi.com/docs/guides/publish), this will become: `pip install --pre runloop` - ## Usage The full API of this library can be found in [api.md](api.md). From 5189e64dcc6ec0d1d7d6313eff6b73fd2fd601d0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 22:02:29 +0000 Subject: [PATCH 012/993] chore: update SDK settings (#7) --- CONTRIBUTING.md | 2 +- README.md | 36 ++++++------- api.md | 51 +++++++++++-------- mypy.ini | 2 +- pyproject.toml | 8 +-- release-please-config.json | 2 +- requirements-dev.lock | 12 ++--- requirements.lock | 12 ++--- scripts/lint | 2 +- .../__init__.py | 4 +- .../_base_client.py | 2 +- .../_client.py | 0 .../_compat.py | 0 .../_constants.py | 0 .../_exceptions.py | 0 .../_files.py | 0 .../_models.py | 0 .../_qs.py | 0 .../_resource.py | 0 .../_response.py | 10 ++-- .../_streaming.py | 0 .../_types.py | 2 +- .../_utils/__init__.py | 0 .../_utils/_logs.py | 4 +- .../_utils/_proxy.py | 0 .../_utils/_reflection.py | 0 .../_utils/_streams.py | 0 .../_utils/_sync.py | 0 .../_utils/_transform.py | 0 .../_utils/_typing.py | 0 .../_utils/_utils.py | 0 .../_version.py | 2 +- src/runloop_minus_api_minus_client/lib/.keep | 4 ++ .../py.typed | 0 .../resources/__init__.py | 0 .../resources/devboxes/__init__.py | 0 .../resources/devboxes/devboxes.py | 0 .../resources/devboxes/logs.py | 0 .../resources/functions/__init__.py | 0 .../resources/functions/functions.py | 0 .../functions/invocations/__init__.py | 0 .../functions/invocations/invocations.py | 0 .../resources/functions/invocations/spans.py | 0 .../resources/projects/__init__.py | 0 .../resources/projects/logs.py | 0 .../resources/projects/projects.py | 0 .../types/__init__.py | 0 .../types/devbox_create_params.py | 0 .../types/devbox_execution_detail_view.py | 0 .../types/devbox_list_params.py | 0 .../types/devbox_list_view.py | 0 .../types/devbox_view.py | 0 .../types/devboxes/__init__.py | 0 .../types/devboxes/devbox_logs_list_view.py | 0 .../types/function_invoke_async_params.py | 0 .../types/function_invoke_sync_params.py | 0 .../types/function_list_view.py | 0 .../types/functions/__init__.py | 0 .../function_invocation_list_view.py | 0 .../types/functions/invocations/__init__.py | 0 .../invocations/invocation_span_list_view.py | 0 .../types/project_list_view.py | 0 .../types/projects/__init__.py | 0 .../types/shared/__init__.py | 0 .../shared/function_invocation_detail_view.py | 0 .../types/shared/project_logs_view.py | 0 tests/api_resources/devboxes/test_logs.py | 4 +- .../functions/invocations/test_spans.py | 4 +- .../functions/test_invocations.py | 6 +-- tests/api_resources/projects/test_logs.py | 4 +- tests/api_resources/test_devboxes.py | 4 +- tests/api_resources/test_functions.py | 8 +-- tests/api_resources/test_projects.py | 4 +- tests/conftest.py | 4 +- tests/test_client.py | 35 +++++++------ tests/test_deepcopy.py | 2 +- tests/test_extract_files.py | 4 +- tests/test_files.py | 2 +- tests/test_models.py | 6 +-- tests/test_qs.py | 2 +- tests/test_required_args.py | 2 +- tests/test_response.py | 14 ++--- tests/test_streaming.py | 4 +- tests/test_transform.py | 8 +-- tests/test_utils/test_proxy.py | 2 +- tests/test_utils/test_typing.py | 2 +- tests/utils.py | 8 +-- 87 files changed, 152 insertions(+), 132 deletions(-) rename src/{runloop => runloop_minus_api_minus_client}/__init__.py (92%) rename src/{runloop => runloop_minus_api_minus_client}/_base_client.py (99%) rename src/{runloop => runloop_minus_api_minus_client}/_client.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/_compat.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/_constants.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/_exceptions.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/_files.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/_models.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/_qs.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/_resource.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/_response.py (98%) rename src/{runloop => runloop_minus_api_minus_client}/_streaming.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/_types.py (99%) rename src/{runloop => runloop_minus_api_minus_client}/_utils/__init__.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/_utils/_logs.py (72%) rename src/{runloop => runloop_minus_api_minus_client}/_utils/_proxy.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/_utils/_reflection.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/_utils/_streams.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/_utils/_sync.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/_utils/_transform.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/_utils/_typing.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/_utils/_utils.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/_version.py (76%) create mode 100644 src/runloop_minus_api_minus_client/lib/.keep rename src/{runloop => runloop_minus_api_minus_client}/py.typed (100%) rename src/{runloop => runloop_minus_api_minus_client}/resources/__init__.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/resources/devboxes/__init__.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/resources/devboxes/devboxes.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/resources/devboxes/logs.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/resources/functions/__init__.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/resources/functions/functions.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/resources/functions/invocations/__init__.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/resources/functions/invocations/invocations.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/resources/functions/invocations/spans.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/resources/projects/__init__.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/resources/projects/logs.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/resources/projects/projects.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/types/__init__.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/types/devbox_create_params.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/types/devbox_execution_detail_view.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/types/devbox_list_params.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/types/devbox_list_view.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/types/devbox_view.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/types/devboxes/__init__.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/types/devboxes/devbox_logs_list_view.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/types/function_invoke_async_params.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/types/function_invoke_sync_params.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/types/function_list_view.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/types/functions/__init__.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/types/functions/function_invocation_list_view.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/types/functions/invocations/__init__.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/types/functions/invocations/invocation_span_list_view.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/types/project_list_view.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/types/projects/__init__.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/types/shared/__init__.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/types/shared/function_invocation_detail_view.py (100%) rename src/{runloop => runloop_minus_api_minus_client}/types/shared/project_logs_view.py (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1f39c2742..c79e54f82 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,7 +32,7 @@ $ pip install -r requirements-dev.lock ## Modifying/Adding code Most of the SDK is generated code, and any modified code will be overridden on the next generation. The -`src/runloop/lib/` and `examples/` directories are exceptions and will never be overridden. +`src/runloop_minus_api_minus_client/lib/` and `examples/` directories are exceptions and will never be overridden. ## Adding and running examples diff --git a/README.md b/README.md index a615b57d6..efb92b103 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Runloop Python API library -[![PyPI version](https://img.shields.io/pypi/v/runloop.svg)](https://pypi.org/project/runloop/) +[![PyPI version](https://img.shields.io/pypi/v/runloop-api-client.svg)](https://pypi.org/project/runloop-api-client/) The Runloop Python library provides convenient access to the Runloop REST API from any Python 3.7+ application. The library includes type definitions for all request params and response fields, @@ -16,7 +16,7 @@ The REST API documentation can be found [on runloop.ai](https://runloop.ai). The ```sh # install from PyPI -pip install --pre runloop +pip install --pre runloop-api-client ``` ## Usage @@ -25,7 +25,7 @@ The full API of this library can be found in [api.md](api.md). ```python import os -from runloop import Runloop +from runloop_minus_api_minus_client import Runloop client = Runloop( # This is the default and can be omitted @@ -48,7 +48,7 @@ Simply import `AsyncRunloop` instead of `Runloop` and use `await` with each API ```python import os import asyncio -from runloop import AsyncRunloop +from runloop_minus_api_minus_client import AsyncRunloop client = AsyncRunloop( # This is the default and can be omitted @@ -77,27 +77,27 @@ Typed requests and responses provide autocomplete and documentation within your ## Handling errors -When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `runloop.APIConnectionError` is raised. +When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `runloop_minus_api_minus_client.APIConnectionError` is raised. When the API returns a non-success status code (that is, 4xx or 5xx -response), a subclass of `runloop.APIStatusError` is raised, containing `status_code` and `response` properties. +response), a subclass of `runloop_minus_api_minus_client.APIStatusError` is raised, containing `status_code` and `response` properties. -All errors inherit from `runloop.APIError`. +All errors inherit from `runloop_minus_api_minus_client.APIError`. ```python -import runloop -from runloop import Runloop +import runloop_minus_api_minus_client +from runloop_minus_api_minus_client import Runloop client = Runloop() try: client.devboxes.create() -except runloop.APIConnectionError as e: +except runloop_minus_api_minus_client.APIConnectionError as e: print("The server could not be reached") print(e.__cause__) # an underlying Exception, likely raised within httpx. -except runloop.RateLimitError as e: +except runloop_minus_api_minus_client.RateLimitError as e: print("A 429 status code was received; we should back off a bit.") -except runloop.APIStatusError as e: +except runloop_minus_api_minus_client.APIStatusError as e: print("Another non-200-range status code was received") print(e.status_code) print(e.response) @@ -125,7 +125,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ You can use the `max_retries` option to configure or disable retry settings: ```python -from runloop import Runloop +from runloop_minus_api_minus_client import Runloop # Configure the default for all requests: client = Runloop( @@ -143,7 +143,7 @@ By default requests time out after 1 minute. You can configure this with a `time which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object: ```python -from runloop import Runloop +from runloop_minus_api_minus_client import Runloop # Configure the default for all requests: client = Runloop( @@ -193,7 +193,7 @@ if response.my_field is None: The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g., ```py -from runloop import Runloop +from runloop_minus_api_minus_client import Runloop client = Runloop() response = client.devboxes.with_raw_response.create() @@ -203,9 +203,9 @@ devbox = response.parse() # get the object that `devboxes.create()` would have print(devbox.id) ``` -These methods return an [`APIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop/_response.py) object. +These methods return an [`APIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_minus_api_minus_client/_response.py) object. -The async client returns an [`AsyncAPIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. +The async client returns an [`AsyncAPIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_minus_api_minus_client/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. #### `.with_streaming_response` @@ -267,7 +267,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c - Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality ```python -from runloop import Runloop, DefaultHttpxClient +from runloop_minus_api_minus_client import Runloop, DefaultHttpxClient client = Runloop( # Or use the `RUNLOOP_BASE_URL` env var diff --git a/api.md b/api.md index 1f2494acb..04368db98 100644 --- a/api.md +++ b/api.md @@ -1,7 +1,7 @@ # Shared Types ```python -from runloop.types import FunctionInvocationDetailView, ProjectLogsView +from runloop_minus_api_minus_client.types import FunctionInvocationDetailView, ProjectLogsView ``` # Devboxes @@ -9,83 +9,90 @@ from runloop.types import FunctionInvocationDetailView, ProjectLogsView Types: ```python -from runloop.types import DevboxExecutionDetailView, DevboxListView, DevboxView +from runloop_minus_api_minus_client.types import ( + DevboxExecutionDetailView, + DevboxListView, + DevboxView, +) ``` Methods: -- client.devboxes.create(\*\*params) -> DevboxView -- client.devboxes.retrieve(id) -> DevboxView -- client.devboxes.list(\*\*params) -> DevboxListView -- client.devboxes.execute_sync(id) -> DevboxExecutionDetailView -- client.devboxes.shutdown(id) -> DevboxView +- client.devboxes.create(\*\*params) -> DevboxView +- client.devboxes.retrieve(id) -> DevboxView +- client.devboxes.list(\*\*params) -> DevboxListView +- client.devboxes.execute_sync(id) -> DevboxExecutionDetailView +- client.devboxes.shutdown(id) -> DevboxView ## Logs Types: ```python -from runloop.types.devboxes import DevboxLogsListView +from runloop_minus_api_minus_client.types.devboxes import DevboxLogsListView ``` Methods: -- client.devboxes.logs.list(id) -> DevboxLogsListView +- client.devboxes.logs.list(id) -> DevboxLogsListView # Functions Types: ```python -from runloop.types import FunctionListView +from runloop_minus_api_minus_client.types import FunctionListView ``` Methods: -- client.functions.list() -> FunctionListView -- client.functions.invoke_async(function_name, \*, project_name, \*\*params) -> FunctionInvocationDetailView -- client.functions.invoke_sync(function_name, \*, project_name, \*\*params) -> FunctionInvocationDetailView +- client.functions.list() -> FunctionListView +- client.functions.invoke_async(function_name, \*, project_name, \*\*params) -> FunctionInvocationDetailView +- client.functions.invoke_sync(function_name, \*, project_name, \*\*params) -> FunctionInvocationDetailView ## Invocations Types: ```python -from runloop.types.functions import FunctionInvocationListView, KillOperationResponse +from runloop_minus_api_minus_client.types.functions import ( + FunctionInvocationListView, + KillOperationResponse, +) ``` Methods: -- client.functions.invocations.retrieve(invocation_id) -> FunctionInvocationDetailView -- client.functions.invocations.list() -> FunctionInvocationListView -- client.functions.invocations.kill(invocation_id) -> object +- client.functions.invocations.retrieve(invocation_id) -> FunctionInvocationDetailView +- client.functions.invocations.list() -> FunctionInvocationListView +- client.functions.invocations.kill(invocation_id) -> object ### Spans Types: ```python -from runloop.types.functions.invocations import InvocationSpanListView +from runloop_minus_api_minus_client.types.functions.invocations import InvocationSpanListView ``` Methods: -- client.functions.invocations.spans.list(invocation_id) -> InvocationSpanListView +- client.functions.invocations.spans.list(invocation_id) -> InvocationSpanListView # Projects Types: ```python -from runloop.types import ProjectListView +from runloop_minus_api_minus_client.types import ProjectListView ``` Methods: -- client.projects.list() -> ProjectListView +- client.projects.list() -> ProjectListView ## Logs Methods: -- client.projects.logs.list(id) -> ProjectLogsView +- client.projects.logs.list(id) -> ProjectLogsView diff --git a/mypy.ini b/mypy.ini index 1ee85e698..edf001443 100644 --- a/mypy.ini +++ b/mypy.ini @@ -5,7 +5,7 @@ show_error_codes = True # Exclude _files.py because mypy isn't smart enough to apply # the correct type narrowing and as this is an internal module # it's fine to just use Pyright. -exclude = ^(src/runloop/_files\.py|_dev/.*\.py)$ +exclude = ^(src/runloop_minus_api_minus_client/_files\.py|_dev/.*\.py)$ strict_equality = True implicit_reexport = True diff --git a/pyproject.toml b/pyproject.toml index 172cdab8e..d6407a4a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [project] -name = "runloop" +name = "runloop-api-client" version = "0.0.1-alpha.0" description = "The official Python library for the runloop API" dynamic = ["readme"] @@ -84,7 +84,7 @@ typecheck = { chain = [ "typecheck:mypy" ]} "typecheck:pyright" = "pyright" -"typecheck:verify-types" = "pyright --verifytypes runloop --ignoreexternal" +"typecheck:verify-types" = "pyright --verifytypes runloop_minus_api_minus_client --ignoreexternal" "typecheck:mypy" = "mypy ." [build-system] @@ -97,7 +97,7 @@ include = [ ] [tool.hatch.build.targets.wheel] -packages = ["src/runloop"] +packages = ["src/runloop_minus_api_minus_client"] [tool.hatch.metadata.hooks.fancy-pypi-readme] content-type = "text/markdown" @@ -187,7 +187,7 @@ length-sort = true length-sort-straight = true combine-as-imports = true extra-standard-library = ["typing_extensions"] -known-first-party = ["runloop", "tests"] +known-first-party = ["runloop_minus_api_minus_client", "tests"] [tool.ruff.per-file-ignores] "bin/**.py" = ["T201", "T203"] diff --git a/release-please-config.json b/release-please-config.json index 3bde9481f..ab92ea3f7 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -61,6 +61,6 @@ ], "release-type": "python", "extra-files": [ - "src/runloop/_version.py" + "src/runloop_minus_api_minus_client/_version.py" ] } \ No newline at end of file diff --git a/requirements-dev.lock b/requirements-dev.lock index a29b399e0..0852c56d1 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -12,7 +12,7 @@ annotated-types==0.6.0 # via pydantic anyio==4.1.0 # via httpx - # via runloop + # via runloop-api-client argcomplete==3.1.2 # via nox attrs==23.1.0 @@ -26,7 +26,7 @@ dirty-equals==0.6.0 distlib==0.3.7 # via virtualenv distro==1.8.0 - # via runloop + # via runloop-api-client exceptiongroup==1.1.3 # via anyio filelock==3.12.4 @@ -37,7 +37,7 @@ httpcore==1.0.2 # via httpx httpx==0.25.2 # via respx - # via runloop + # via runloop-api-client idna==3.4 # via anyio # via httpx @@ -60,7 +60,7 @@ pluggy==1.3.0 py==1.11.0 # via pytest pydantic==2.7.1 - # via runloop + # via runloop-api-client pydantic-core==2.18.2 # via pydantic pyright==1.1.364 @@ -80,7 +80,7 @@ six==1.16.0 sniffio==1.3.0 # via anyio # via httpx - # via runloop + # via runloop-api-client time-machine==2.9.0 tomli==2.0.1 # via mypy @@ -89,7 +89,7 @@ typing-extensions==4.8.0 # via mypy # via pydantic # via pydantic-core - # via runloop + # via runloop-api-client virtualenv==20.24.5 # via nox zipp==3.17.0 diff --git a/requirements.lock b/requirements.lock index d9b4c33c7..70c5bb66c 100644 --- a/requirements.lock +++ b/requirements.lock @@ -12,12 +12,12 @@ annotated-types==0.6.0 # via pydantic anyio==4.1.0 # via httpx - # via runloop + # via runloop-api-client certifi==2023.7.22 # via httpcore # via httpx distro==1.8.0 - # via runloop + # via runloop-api-client exceptiongroup==1.1.3 # via anyio h11==0.14.0 @@ -25,19 +25,19 @@ h11==0.14.0 httpcore==1.0.2 # via httpx httpx==0.25.2 - # via runloop + # via runloop-api-client idna==3.4 # via anyio # via httpx pydantic==2.7.1 - # via runloop + # via runloop-api-client pydantic-core==2.18.2 # via pydantic sniffio==1.3.0 # via anyio # via httpx - # via runloop + # via runloop-api-client typing-extensions==4.8.0 # via pydantic # via pydantic-core - # via runloop + # via runloop-api-client diff --git a/scripts/lint b/scripts/lint index 18d34a469..c0e4922b5 100755 --- a/scripts/lint +++ b/scripts/lint @@ -8,5 +8,5 @@ echo "==> Running lints" rye run lint echo "==> Making sure it imports" -rye run python -c 'import runloop' +rye run python -c 'import runloop_minus_api_minus_client' diff --git a/src/runloop/__init__.py b/src/runloop_minus_api_minus_client/__init__.py similarity index 92% rename from src/runloop/__init__.py rename to src/runloop_minus_api_minus_client/__init__.py index e41010c25..c42946eea 100644 --- a/src/runloop/__init__.py +++ b/src/runloop_minus_api_minus_client/__init__.py @@ -72,12 +72,12 @@ # Update the __module__ attribute for exported symbols so that # error messages point to this module instead of the module # it was originally defined in, e.g. -# runloop._exceptions.NotFoundError -> runloop.NotFoundError +# runloop_minus_api_minus_client._exceptions.NotFoundError -> runloop_minus_api_minus_client.NotFoundError __locals = locals() for __name in __all__: if not __name.startswith("__"): try: - __locals[__name].__module__ = "runloop" + __locals[__name].__module__ = "runloop_minus_api_minus_client" except (TypeError, AttributeError): # Some of our exported symbols are builtins which we can't set attributes for. pass diff --git a/src/runloop/_base_client.py b/src/runloop_minus_api_minus_client/_base_client.py similarity index 99% rename from src/runloop/_base_client.py rename to src/runloop_minus_api_minus_client/_base_client.py index 9e1f25f1f..7ea3ae961 100644 --- a/src/runloop/_base_client.py +++ b/src/runloop_minus_api_minus_client/_base_client.py @@ -362,7 +362,7 @@ def __init__( if max_retries is None: # pyright: ignore[reportUnnecessaryComparison] raise TypeError( - "max_retries cannot be None. If you want to disable retries, pass `0`; if you want unlimited retries, pass `math.inf` or a very high number; if you want the default behavior, pass `runloop.DEFAULT_MAX_RETRIES`" + "max_retries cannot be None. If you want to disable retries, pass `0`; if you want unlimited retries, pass `math.inf` or a very high number; if you want the default behavior, pass `runloop-api-client.DEFAULT_MAX_RETRIES`" ) def _enforce_trailing_slash(self, url: URL) -> URL: diff --git a/src/runloop/_client.py b/src/runloop_minus_api_minus_client/_client.py similarity index 100% rename from src/runloop/_client.py rename to src/runloop_minus_api_minus_client/_client.py diff --git a/src/runloop/_compat.py b/src/runloop_minus_api_minus_client/_compat.py similarity index 100% rename from src/runloop/_compat.py rename to src/runloop_minus_api_minus_client/_compat.py diff --git a/src/runloop/_constants.py b/src/runloop_minus_api_minus_client/_constants.py similarity index 100% rename from src/runloop/_constants.py rename to src/runloop_minus_api_minus_client/_constants.py diff --git a/src/runloop/_exceptions.py b/src/runloop_minus_api_minus_client/_exceptions.py similarity index 100% rename from src/runloop/_exceptions.py rename to src/runloop_minus_api_minus_client/_exceptions.py diff --git a/src/runloop/_files.py b/src/runloop_minus_api_minus_client/_files.py similarity index 100% rename from src/runloop/_files.py rename to src/runloop_minus_api_minus_client/_files.py diff --git a/src/runloop/_models.py b/src/runloop_minus_api_minus_client/_models.py similarity index 100% rename from src/runloop/_models.py rename to src/runloop_minus_api_minus_client/_models.py diff --git a/src/runloop/_qs.py b/src/runloop_minus_api_minus_client/_qs.py similarity index 100% rename from src/runloop/_qs.py rename to src/runloop_minus_api_minus_client/_qs.py diff --git a/src/runloop/_resource.py b/src/runloop_minus_api_minus_client/_resource.py similarity index 100% rename from src/runloop/_resource.py rename to src/runloop_minus_api_minus_client/_resource.py diff --git a/src/runloop/_response.py b/src/runloop_minus_api_minus_client/_response.py similarity index 98% rename from src/runloop/_response.py rename to src/runloop_minus_api_minus_client/_response.py index 47695a4a6..566ba601a 100644 --- a/src/runloop/_response.py +++ b/src/runloop_minus_api_minus_client/_response.py @@ -203,7 +203,9 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: return cast(R, response) if inspect.isclass(origin) and not issubclass(origin, BaseModel) and issubclass(origin, pydantic.BaseModel): - raise TypeError("Pydantic models must subclass our base model type, e.g. `from runloop import BaseModel`") + raise TypeError( + "Pydantic models must subclass our base model type, e.g. `from runloop_minus_api_minus_client import BaseModel`" + ) if ( cast_to is not object @@ -271,7 +273,7 @@ def parse(self, *, to: type[_T] | None = None) -> R | _T: the `to` argument, e.g. ```py - from runloop import BaseModel + from runloop_minus_api_minus_client import BaseModel class MyModel(BaseModel): @@ -375,7 +377,7 @@ async def parse(self, *, to: type[_T] | None = None) -> R | _T: the `to` argument, e.g. ```py - from runloop import BaseModel + from runloop_minus_api_minus_client import BaseModel class MyModel(BaseModel): @@ -546,7 +548,7 @@ async def stream_to_file( class MissingStreamClassError(TypeError): def __init__(self) -> None: super().__init__( - "The `stream` argument was set to `True` but the `stream_cls` argument was not given. See `runloop._streaming` for reference", + "The `stream` argument was set to `True` but the `stream_cls` argument was not given. See `runloop_minus_api_minus_client._streaming` for reference", ) diff --git a/src/runloop/_streaming.py b/src/runloop_minus_api_minus_client/_streaming.py similarity index 100% rename from src/runloop/_streaming.py rename to src/runloop_minus_api_minus_client/_streaming.py diff --git a/src/runloop/_types.py b/src/runloop_minus_api_minus_client/_types.py similarity index 99% rename from src/runloop/_types.py rename to src/runloop_minus_api_minus_client/_types.py index 49f9ba84d..5f55824f3 100644 --- a/src/runloop/_types.py +++ b/src/runloop_minus_api_minus_client/_types.py @@ -81,7 +81,7 @@ # This unfortunately means that you will either have # to import this type and pass it explicitly: # -# from runloop import NoneType +# from runloop_minus_api_minus_client import NoneType # client.get('/foo', cast_to=NoneType) # # or build it yourself: diff --git a/src/runloop/_utils/__init__.py b/src/runloop_minus_api_minus_client/_utils/__init__.py similarity index 100% rename from src/runloop/_utils/__init__.py rename to src/runloop_minus_api_minus_client/_utils/__init__.py diff --git a/src/runloop/_utils/_logs.py b/src/runloop_minus_api_minus_client/_utils/_logs.py similarity index 72% rename from src/runloop/_utils/_logs.py rename to src/runloop_minus_api_minus_client/_utils/_logs.py index 701fbfc6d..576c5a864 100644 --- a/src/runloop/_utils/_logs.py +++ b/src/runloop_minus_api_minus_client/_utils/_logs.py @@ -1,12 +1,12 @@ import os import logging -logger: logging.Logger = logging.getLogger("runloop") +logger: logging.Logger = logging.getLogger("runloop_minus_api_minus_client") httpx_logger: logging.Logger = logging.getLogger("httpx") def _basic_config() -> None: - # e.g. [2023-10-05 14:12:26 - runloop._base_client:818 - DEBUG] HTTP Request: POST http://127.0.0.1:4010/foo/bar "200 OK" + # e.g. [2023-10-05 14:12:26 - runloop_minus_api_minus_client._base_client:818 - DEBUG] HTTP Request: POST http://127.0.0.1:4010/foo/bar "200 OK" logging.basicConfig( format="[%(asctime)s - %(name)s:%(lineno)d - %(levelname)s] %(message)s", datefmt="%Y-%m-%d %H:%M:%S", diff --git a/src/runloop/_utils/_proxy.py b/src/runloop_minus_api_minus_client/_utils/_proxy.py similarity index 100% rename from src/runloop/_utils/_proxy.py rename to src/runloop_minus_api_minus_client/_utils/_proxy.py diff --git a/src/runloop/_utils/_reflection.py b/src/runloop_minus_api_minus_client/_utils/_reflection.py similarity index 100% rename from src/runloop/_utils/_reflection.py rename to src/runloop_minus_api_minus_client/_utils/_reflection.py diff --git a/src/runloop/_utils/_streams.py b/src/runloop_minus_api_minus_client/_utils/_streams.py similarity index 100% rename from src/runloop/_utils/_streams.py rename to src/runloop_minus_api_minus_client/_utils/_streams.py diff --git a/src/runloop/_utils/_sync.py b/src/runloop_minus_api_minus_client/_utils/_sync.py similarity index 100% rename from src/runloop/_utils/_sync.py rename to src/runloop_minus_api_minus_client/_utils/_sync.py diff --git a/src/runloop/_utils/_transform.py b/src/runloop_minus_api_minus_client/_utils/_transform.py similarity index 100% rename from src/runloop/_utils/_transform.py rename to src/runloop_minus_api_minus_client/_utils/_transform.py diff --git a/src/runloop/_utils/_typing.py b/src/runloop_minus_api_minus_client/_utils/_typing.py similarity index 100% rename from src/runloop/_utils/_typing.py rename to src/runloop_minus_api_minus_client/_utils/_typing.py diff --git a/src/runloop/_utils/_utils.py b/src/runloop_minus_api_minus_client/_utils/_utils.py similarity index 100% rename from src/runloop/_utils/_utils.py rename to src/runloop_minus_api_minus_client/_utils/_utils.py diff --git a/src/runloop/_version.py b/src/runloop_minus_api_minus_client/_version.py similarity index 76% rename from src/runloop/_version.py rename to src/runloop_minus_api_minus_client/_version.py index d24c5a445..06685620f 100644 --- a/src/runloop/_version.py +++ b/src/runloop_minus_api_minus_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -__title__ = "runloop" +__title__ = "runloop_minus_api_minus_client" __version__ = "0.0.1-alpha.0" # x-release-please-version diff --git a/src/runloop_minus_api_minus_client/lib/.keep b/src/runloop_minus_api_minus_client/lib/.keep new file mode 100644 index 000000000..5e2c99fdb --- /dev/null +++ b/src/runloop_minus_api_minus_client/lib/.keep @@ -0,0 +1,4 @@ +File generated from our OpenAPI spec by Stainless. + +This directory can be used to store custom files to expand the SDK. +It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. \ No newline at end of file diff --git a/src/runloop/py.typed b/src/runloop_minus_api_minus_client/py.typed similarity index 100% rename from src/runloop/py.typed rename to src/runloop_minus_api_minus_client/py.typed diff --git a/src/runloop/resources/__init__.py b/src/runloop_minus_api_minus_client/resources/__init__.py similarity index 100% rename from src/runloop/resources/__init__.py rename to src/runloop_minus_api_minus_client/resources/__init__.py diff --git a/src/runloop/resources/devboxes/__init__.py b/src/runloop_minus_api_minus_client/resources/devboxes/__init__.py similarity index 100% rename from src/runloop/resources/devboxes/__init__.py rename to src/runloop_minus_api_minus_client/resources/devboxes/__init__.py diff --git a/src/runloop/resources/devboxes/devboxes.py b/src/runloop_minus_api_minus_client/resources/devboxes/devboxes.py similarity index 100% rename from src/runloop/resources/devboxes/devboxes.py rename to src/runloop_minus_api_minus_client/resources/devboxes/devboxes.py diff --git a/src/runloop/resources/devboxes/logs.py b/src/runloop_minus_api_minus_client/resources/devboxes/logs.py similarity index 100% rename from src/runloop/resources/devboxes/logs.py rename to src/runloop_minus_api_minus_client/resources/devboxes/logs.py diff --git a/src/runloop/resources/functions/__init__.py b/src/runloop_minus_api_minus_client/resources/functions/__init__.py similarity index 100% rename from src/runloop/resources/functions/__init__.py rename to src/runloop_minus_api_minus_client/resources/functions/__init__.py diff --git a/src/runloop/resources/functions/functions.py b/src/runloop_minus_api_minus_client/resources/functions/functions.py similarity index 100% rename from src/runloop/resources/functions/functions.py rename to src/runloop_minus_api_minus_client/resources/functions/functions.py diff --git a/src/runloop/resources/functions/invocations/__init__.py b/src/runloop_minus_api_minus_client/resources/functions/invocations/__init__.py similarity index 100% rename from src/runloop/resources/functions/invocations/__init__.py rename to src/runloop_minus_api_minus_client/resources/functions/invocations/__init__.py diff --git a/src/runloop/resources/functions/invocations/invocations.py b/src/runloop_minus_api_minus_client/resources/functions/invocations/invocations.py similarity index 100% rename from src/runloop/resources/functions/invocations/invocations.py rename to src/runloop_minus_api_minus_client/resources/functions/invocations/invocations.py diff --git a/src/runloop/resources/functions/invocations/spans.py b/src/runloop_minus_api_minus_client/resources/functions/invocations/spans.py similarity index 100% rename from src/runloop/resources/functions/invocations/spans.py rename to src/runloop_minus_api_minus_client/resources/functions/invocations/spans.py diff --git a/src/runloop/resources/projects/__init__.py b/src/runloop_minus_api_minus_client/resources/projects/__init__.py similarity index 100% rename from src/runloop/resources/projects/__init__.py rename to src/runloop_minus_api_minus_client/resources/projects/__init__.py diff --git a/src/runloop/resources/projects/logs.py b/src/runloop_minus_api_minus_client/resources/projects/logs.py similarity index 100% rename from src/runloop/resources/projects/logs.py rename to src/runloop_minus_api_minus_client/resources/projects/logs.py diff --git a/src/runloop/resources/projects/projects.py b/src/runloop_minus_api_minus_client/resources/projects/projects.py similarity index 100% rename from src/runloop/resources/projects/projects.py rename to src/runloop_minus_api_minus_client/resources/projects/projects.py diff --git a/src/runloop/types/__init__.py b/src/runloop_minus_api_minus_client/types/__init__.py similarity index 100% rename from src/runloop/types/__init__.py rename to src/runloop_minus_api_minus_client/types/__init__.py diff --git a/src/runloop/types/devbox_create_params.py b/src/runloop_minus_api_minus_client/types/devbox_create_params.py similarity index 100% rename from src/runloop/types/devbox_create_params.py rename to src/runloop_minus_api_minus_client/types/devbox_create_params.py diff --git a/src/runloop/types/devbox_execution_detail_view.py b/src/runloop_minus_api_minus_client/types/devbox_execution_detail_view.py similarity index 100% rename from src/runloop/types/devbox_execution_detail_view.py rename to src/runloop_minus_api_minus_client/types/devbox_execution_detail_view.py diff --git a/src/runloop/types/devbox_list_params.py b/src/runloop_minus_api_minus_client/types/devbox_list_params.py similarity index 100% rename from src/runloop/types/devbox_list_params.py rename to src/runloop_minus_api_minus_client/types/devbox_list_params.py diff --git a/src/runloop/types/devbox_list_view.py b/src/runloop_minus_api_minus_client/types/devbox_list_view.py similarity index 100% rename from src/runloop/types/devbox_list_view.py rename to src/runloop_minus_api_minus_client/types/devbox_list_view.py diff --git a/src/runloop/types/devbox_view.py b/src/runloop_minus_api_minus_client/types/devbox_view.py similarity index 100% rename from src/runloop/types/devbox_view.py rename to src/runloop_minus_api_minus_client/types/devbox_view.py diff --git a/src/runloop/types/devboxes/__init__.py b/src/runloop_minus_api_minus_client/types/devboxes/__init__.py similarity index 100% rename from src/runloop/types/devboxes/__init__.py rename to src/runloop_minus_api_minus_client/types/devboxes/__init__.py diff --git a/src/runloop/types/devboxes/devbox_logs_list_view.py b/src/runloop_minus_api_minus_client/types/devboxes/devbox_logs_list_view.py similarity index 100% rename from src/runloop/types/devboxes/devbox_logs_list_view.py rename to src/runloop_minus_api_minus_client/types/devboxes/devbox_logs_list_view.py diff --git a/src/runloop/types/function_invoke_async_params.py b/src/runloop_minus_api_minus_client/types/function_invoke_async_params.py similarity index 100% rename from src/runloop/types/function_invoke_async_params.py rename to src/runloop_minus_api_minus_client/types/function_invoke_async_params.py diff --git a/src/runloop/types/function_invoke_sync_params.py b/src/runloop_minus_api_minus_client/types/function_invoke_sync_params.py similarity index 100% rename from src/runloop/types/function_invoke_sync_params.py rename to src/runloop_minus_api_minus_client/types/function_invoke_sync_params.py diff --git a/src/runloop/types/function_list_view.py b/src/runloop_minus_api_minus_client/types/function_list_view.py similarity index 100% rename from src/runloop/types/function_list_view.py rename to src/runloop_minus_api_minus_client/types/function_list_view.py diff --git a/src/runloop/types/functions/__init__.py b/src/runloop_minus_api_minus_client/types/functions/__init__.py similarity index 100% rename from src/runloop/types/functions/__init__.py rename to src/runloop_minus_api_minus_client/types/functions/__init__.py diff --git a/src/runloop/types/functions/function_invocation_list_view.py b/src/runloop_minus_api_minus_client/types/functions/function_invocation_list_view.py similarity index 100% rename from src/runloop/types/functions/function_invocation_list_view.py rename to src/runloop_minus_api_minus_client/types/functions/function_invocation_list_view.py diff --git a/src/runloop/types/functions/invocations/__init__.py b/src/runloop_minus_api_minus_client/types/functions/invocations/__init__.py similarity index 100% rename from src/runloop/types/functions/invocations/__init__.py rename to src/runloop_minus_api_minus_client/types/functions/invocations/__init__.py diff --git a/src/runloop/types/functions/invocations/invocation_span_list_view.py b/src/runloop_minus_api_minus_client/types/functions/invocations/invocation_span_list_view.py similarity index 100% rename from src/runloop/types/functions/invocations/invocation_span_list_view.py rename to src/runloop_minus_api_minus_client/types/functions/invocations/invocation_span_list_view.py diff --git a/src/runloop/types/project_list_view.py b/src/runloop_minus_api_minus_client/types/project_list_view.py similarity index 100% rename from src/runloop/types/project_list_view.py rename to src/runloop_minus_api_minus_client/types/project_list_view.py diff --git a/src/runloop/types/projects/__init__.py b/src/runloop_minus_api_minus_client/types/projects/__init__.py similarity index 100% rename from src/runloop/types/projects/__init__.py rename to src/runloop_minus_api_minus_client/types/projects/__init__.py diff --git a/src/runloop/types/shared/__init__.py b/src/runloop_minus_api_minus_client/types/shared/__init__.py similarity index 100% rename from src/runloop/types/shared/__init__.py rename to src/runloop_minus_api_minus_client/types/shared/__init__.py diff --git a/src/runloop/types/shared/function_invocation_detail_view.py b/src/runloop_minus_api_minus_client/types/shared/function_invocation_detail_view.py similarity index 100% rename from src/runloop/types/shared/function_invocation_detail_view.py rename to src/runloop_minus_api_minus_client/types/shared/function_invocation_detail_view.py diff --git a/src/runloop/types/shared/project_logs_view.py b/src/runloop_minus_api_minus_client/types/shared/project_logs_view.py similarity index 100% rename from src/runloop/types/shared/project_logs_view.py rename to src/runloop_minus_api_minus_client/types/shared/project_logs_view.py diff --git a/tests/api_resources/devboxes/test_logs.py b/tests/api_resources/devboxes/test_logs.py index f037e9729..c98e52023 100644 --- a/tests/api_resources/devboxes/test_logs.py +++ b/tests/api_resources/devboxes/test_logs.py @@ -7,9 +7,9 @@ import pytest -from runloop import Runloop, AsyncRunloop from tests.utils import assert_matches_type -from runloop.types.devboxes import DevboxLogsListView +from runloop_minus_api_minus_client import Runloop, AsyncRunloop +from runloop_minus_api_minus_client.types.devboxes import DevboxLogsListView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/functions/invocations/test_spans.py b/tests/api_resources/functions/invocations/test_spans.py index b59778059..a4b701322 100644 --- a/tests/api_resources/functions/invocations/test_spans.py +++ b/tests/api_resources/functions/invocations/test_spans.py @@ -7,9 +7,9 @@ import pytest -from runloop import Runloop, AsyncRunloop from tests.utils import assert_matches_type -from runloop.types.functions.invocations import InvocationSpanListView +from runloop_minus_api_minus_client import Runloop, AsyncRunloop +from runloop_minus_api_minus_client.types.functions.invocations import InvocationSpanListView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/functions/test_invocations.py b/tests/api_resources/functions/test_invocations.py index a971ff48a..c7486c45d 100644 --- a/tests/api_resources/functions/test_invocations.py +++ b/tests/api_resources/functions/test_invocations.py @@ -7,10 +7,10 @@ import pytest -from runloop import Runloop, AsyncRunloop from tests.utils import assert_matches_type -from runloop.types.shared import FunctionInvocationDetailView -from runloop.types.functions import FunctionInvocationListView +from runloop_minus_api_minus_client import Runloop, AsyncRunloop +from runloop_minus_api_minus_client.types.shared import FunctionInvocationDetailView +from runloop_minus_api_minus_client.types.functions import FunctionInvocationListView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/projects/test_logs.py b/tests/api_resources/projects/test_logs.py index c340da400..b8a51dc52 100644 --- a/tests/api_resources/projects/test_logs.py +++ b/tests/api_resources/projects/test_logs.py @@ -7,9 +7,9 @@ import pytest -from runloop import Runloop, AsyncRunloop from tests.utils import assert_matches_type -from runloop.types.shared import ProjectLogsView +from runloop_minus_api_minus_client import Runloop, AsyncRunloop +from runloop_minus_api_minus_client.types.shared import ProjectLogsView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index ae2d1f39f..0fc02ad3b 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -7,9 +7,9 @@ import pytest -from runloop import Runloop, AsyncRunloop from tests.utils import assert_matches_type -from runloop.types import ( +from runloop_minus_api_minus_client import Runloop, AsyncRunloop +from runloop_minus_api_minus_client.types import ( DevboxView, DevboxListView, DevboxExecutionDetailView, diff --git a/tests/api_resources/test_functions.py b/tests/api_resources/test_functions.py index 59e92efcd..85016f1cf 100644 --- a/tests/api_resources/test_functions.py +++ b/tests/api_resources/test_functions.py @@ -7,10 +7,12 @@ import pytest -from runloop import Runloop, AsyncRunloop from tests.utils import assert_matches_type -from runloop.types import FunctionListView -from runloop.types.shared import FunctionInvocationDetailView +from runloop_minus_api_minus_client import Runloop, AsyncRunloop +from runloop_minus_api_minus_client.types import ( + FunctionListView, +) +from runloop_minus_api_minus_client.types.shared import FunctionInvocationDetailView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 57ef912cd..1a1a05a9f 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -7,9 +7,9 @@ import pytest -from runloop import Runloop, AsyncRunloop from tests.utils import assert_matches_type -from runloop.types import ProjectListView +from runloop_minus_api_minus_client import Runloop, AsyncRunloop +from runloop_minus_api_minus_client.types import ProjectListView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/conftest.py b/tests/conftest.py index 01056a2f5..8f5021cee 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7,14 +7,14 @@ import pytest -from runloop import Runloop, AsyncRunloop +from runloop_minus_api_minus_client import Runloop, AsyncRunloop if TYPE_CHECKING: from _pytest.fixtures import FixtureRequest pytest.register_assert_rewrite("tests.utils") -logging.getLogger("runloop").setLevel(logging.DEBUG) +logging.getLogger("runloop_minus_api_minus_client").setLevel(logging.DEBUG) @pytest.fixture(scope="session") diff --git a/tests/test_client.py b/tests/test_client.py index 1c31aaac7..a674b2623 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -16,11 +16,16 @@ from respx import MockRouter from pydantic import ValidationError -from runloop import Runloop, AsyncRunloop, APIResponseValidationError -from runloop._models import BaseModel, FinalRequestOptions -from runloop._constants import RAW_RESPONSE_HEADER -from runloop._exceptions import RunloopError, APIStatusError, APITimeoutError, APIResponseValidationError -from runloop._base_client import ( +from runloop_minus_api_minus_client import Runloop, AsyncRunloop, APIResponseValidationError +from runloop_minus_api_minus_client._models import BaseModel, FinalRequestOptions +from runloop_minus_api_minus_client._constants import RAW_RESPONSE_HEADER +from runloop_minus_api_minus_client._exceptions import ( + RunloopError, + APIStatusError, + APITimeoutError, + APIResponseValidationError, +) +from runloop_minus_api_minus_client._base_client import ( DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, @@ -227,10 +232,10 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic # to_raw_response_wrapper leaks through the @functools.wraps() decorator. # # removing the decorator fixes the leak for reasons we don't understand. - "runloop/_legacy_response.py", - "runloop/_response.py", + "runloop_minus_api_minus_client/_legacy_response.py", + "runloop_minus_api_minus_client/_response.py", # pydantic.BaseModel.model_dump || pydantic.BaseModel.dict leak memory for some reason. - "runloop/_compat.py", + "runloop_minus_api_minus_client/_compat.py", # Standard library leaks we don't care about. "/logging/__init__.py", ] @@ -729,7 +734,7 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str calculated = client._calculate_retry_timeout(remaining_retries, options, headers) assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] - @mock.patch("runloop._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch("runloop_minus_api_minus_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: respx_mock.post("/v1/devboxes").mock(side_effect=httpx.TimeoutException("Test timeout error")) @@ -744,7 +749,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No assert _get_open_connections(self.client) == 0 - @mock.patch("runloop._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch("runloop_minus_api_minus_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: respx_mock.post("/v1/devboxes").mock(return_value=httpx.Response(500)) @@ -938,10 +943,10 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic # to_raw_response_wrapper leaks through the @functools.wraps() decorator. # # removing the decorator fixes the leak for reasons we don't understand. - "runloop/_legacy_response.py", - "runloop/_response.py", + "runloop_minus_api_minus_client/_legacy_response.py", + "runloop_minus_api_minus_client/_response.py", # pydantic.BaseModel.model_dump || pydantic.BaseModel.dict leak memory for some reason. - "runloop/_compat.py", + "runloop_minus_api_minus_client/_compat.py", # Standard library leaks we don't care about. "/logging/__init__.py", ] @@ -1444,7 +1449,7 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte calculated = client._calculate_retry_timeout(remaining_retries, options, headers) assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] - @mock.patch("runloop._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch("runloop_minus_api_minus_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: respx_mock.post("/v1/devboxes").mock(side_effect=httpx.TimeoutException("Test timeout error")) @@ -1459,7 +1464,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) assert _get_open_connections(self.client) == 0 - @mock.patch("runloop._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch("runloop_minus_api_minus_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: respx_mock.post("/v1/devboxes").mock(return_value=httpx.Response(500)) diff --git a/tests/test_deepcopy.py b/tests/test_deepcopy.py index 146c66b16..4926690f5 100644 --- a/tests/test_deepcopy.py +++ b/tests/test_deepcopy.py @@ -1,4 +1,4 @@ -from runloop._utils import deepcopy_minimal +from runloop_minus_api_minus_client._utils import deepcopy_minimal def assert_different_identities(obj1: object, obj2: object) -> None: diff --git a/tests/test_extract_files.py b/tests/test_extract_files.py index 05b269f35..0156cc3e0 100644 --- a/tests/test_extract_files.py +++ b/tests/test_extract_files.py @@ -4,8 +4,8 @@ import pytest -from runloop._types import FileTypes -from runloop._utils import extract_files +from runloop_minus_api_minus_client._types import FileTypes +from runloop_minus_api_minus_client._utils import extract_files def test_removes_files_from_input() -> None: diff --git a/tests/test_files.py b/tests/test_files.py index 17996af04..1b42f4478 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -4,7 +4,7 @@ import pytest from dirty_equals import IsDict, IsList, IsBytes, IsTuple -from runloop._files import to_httpx_files, async_to_httpx_files +from runloop_minus_api_minus_client._files import to_httpx_files, async_to_httpx_files readme_path = Path(__file__).parent.parent.joinpath("README.md") diff --git a/tests/test_models.py b/tests/test_models.py index 5440d06de..57a3f7b70 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -7,9 +7,9 @@ import pydantic from pydantic import Field -from runloop._utils import PropertyInfo -from runloop._compat import PYDANTIC_V2, parse_obj, model_dump, model_json -from runloop._models import BaseModel, construct_type +from runloop_minus_api_minus_client._utils import PropertyInfo +from runloop_minus_api_minus_client._compat import PYDANTIC_V2, parse_obj, model_dump, model_json +from runloop_minus_api_minus_client._models import BaseModel, construct_type class BasicModel(BaseModel): diff --git a/tests/test_qs.py b/tests/test_qs.py index 29abc6502..8cd0451b1 100644 --- a/tests/test_qs.py +++ b/tests/test_qs.py @@ -4,7 +4,7 @@ import pytest -from runloop._qs import Querystring, stringify +from runloop_minus_api_minus_client._qs import Querystring, stringify def test_empty() -> None: diff --git a/tests/test_required_args.py b/tests/test_required_args.py index fed9f93f4..fa5638c47 100644 --- a/tests/test_required_args.py +++ b/tests/test_required_args.py @@ -2,7 +2,7 @@ import pytest -from runloop._utils import required_args +from runloop_minus_api_minus_client._utils import required_args def test_too_many_positional_params() -> None: diff --git a/tests/test_response.py b/tests/test_response.py index 3b8149876..7da4f33db 100644 --- a/tests/test_response.py +++ b/tests/test_response.py @@ -6,8 +6,8 @@ import pytest import pydantic -from runloop import Runloop, BaseModel, AsyncRunloop -from runloop._response import ( +from runloop_minus_api_minus_client import Runloop, BaseModel, AsyncRunloop +from runloop_minus_api_minus_client._response import ( APIResponse, BaseAPIResponse, AsyncAPIResponse, @@ -15,8 +15,8 @@ AsyncBinaryAPIResponse, extract_response_type, ) -from runloop._streaming import Stream -from runloop._base_client import FinalRequestOptions +from runloop_minus_api_minus_client._streaming import Stream +from runloop_minus_api_minus_client._base_client import FinalRequestOptions class ConcreteBaseAPIResponse(APIResponse[bytes]): @@ -40,7 +40,7 @@ def test_extract_response_type_direct_classes() -> None: def test_extract_response_type_direct_class_missing_type_arg() -> None: with pytest.raises( RuntimeError, - match="Expected type to have a type argument at index 0 but it did not", + match="Expected type to have a type argument at index 0 but it did not", ): extract_response_type(AsyncAPIResponse) @@ -72,7 +72,7 @@ def test_response_parse_mismatched_basemodel(client: Runloop) -> None: with pytest.raises( TypeError, - match="Pydantic models must subclass our base model type, e.g. `from runloop import BaseModel`", + match="Pydantic models must subclass our base model type, e.g. `from runloop_minus_api_minus_client import BaseModel`", ): response.parse(to=PydanticModel) @@ -90,7 +90,7 @@ async def test_async_response_parse_mismatched_basemodel(async_client: AsyncRunl with pytest.raises( TypeError, - match="Pydantic models must subclass our base model type, e.g. `from runloop import BaseModel`", + match="Pydantic models must subclass our base model type, e.g. `from runloop_minus_api_minus_client import BaseModel`", ): await response.parse(to=PydanticModel) diff --git a/tests/test_streaming.py b/tests/test_streaming.py index 2feefb892..0ef8906f6 100644 --- a/tests/test_streaming.py +++ b/tests/test_streaming.py @@ -5,8 +5,8 @@ import httpx import pytest -from runloop import Runloop, AsyncRunloop -from runloop._streaming import Stream, AsyncStream, ServerSentEvent +from runloop_minus_api_minus_client import Runloop, AsyncRunloop +from runloop_minus_api_minus_client._streaming import Stream, AsyncStream, ServerSentEvent @pytest.mark.asyncio diff --git a/tests/test_transform.py b/tests/test_transform.py index 89057f3ec..261ef04d9 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -8,15 +8,15 @@ import pytest -from runloop._types import Base64FileInput -from runloop._utils import ( +from runloop_minus_api_minus_client._types import Base64FileInput +from runloop_minus_api_minus_client._utils import ( PropertyInfo, transform as _transform, parse_datetime, async_transform as _async_transform, ) -from runloop._compat import PYDANTIC_V2 -from runloop._models import BaseModel +from runloop_minus_api_minus_client._compat import PYDANTIC_V2 +from runloop_minus_api_minus_client._models import BaseModel _T = TypeVar("_T") diff --git a/tests/test_utils/test_proxy.py b/tests/test_utils/test_proxy.py index 43354df6a..492853bd0 100644 --- a/tests/test_utils/test_proxy.py +++ b/tests/test_utils/test_proxy.py @@ -2,7 +2,7 @@ from typing import Any from typing_extensions import override -from runloop._utils import LazyProxy +from runloop_minus_api_minus_client._utils import LazyProxy class RecursiveLazyProxy(LazyProxy[Any]): diff --git a/tests/test_utils/test_typing.py b/tests/test_utils/test_typing.py index bd85c7898..fb3ec09fe 100644 --- a/tests/test_utils/test_typing.py +++ b/tests/test_utils/test_typing.py @@ -2,7 +2,7 @@ from typing import Generic, TypeVar, cast -from runloop._utils import extract_type_var_from_base +from runloop_minus_api_minus_client._utils import extract_type_var_from_base _T = TypeVar("_T") _T2 = TypeVar("_T2") diff --git a/tests/utils.py b/tests/utils.py index c26d7cc0c..b497fdc13 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -8,8 +8,8 @@ from datetime import date, datetime from typing_extensions import Literal, get_args, get_origin, assert_type -from runloop._types import NoneType -from runloop._utils import ( +from runloop_minus_api_minus_client._types import NoneType +from runloop_minus_api_minus_client._utils import ( is_dict, is_list, is_list_type, @@ -17,8 +17,8 @@ extract_type_arg, is_annotated_type, ) -from runloop._compat import PYDANTIC_V2, field_outer_type, get_model_fields -from runloop._models import BaseModel +from runloop_minus_api_minus_client._compat import PYDANTIC_V2, field_outer_type, get_model_fields +from runloop_minus_api_minus_client._models import BaseModel BaseModelT = TypeVar("BaseModelT", bound=BaseModel) From 8cb6a8f22e2d87dc40a809f513c2346521254bcb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 22:35:59 +0000 Subject: [PATCH 013/993] chore(internal): version bump (#8) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_minus_api_minus_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c4762802e..ba6c34836 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.1-alpha.0" + ".": "0.1.0-alpha.1" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index d6407a4a9..4a2cd0dd8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop-api-client" -version = "0.0.1-alpha.0" +version = "0.1.0-alpha.1" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/runloop_minus_api_minus_client/_version.py b/src/runloop_minus_api_minus_client/_version.py index 06685620f..52091da7e 100644 --- a/src/runloop_minus_api_minus_client/_version.py +++ b/src/runloop_minus_api_minus_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_minus_api_minus_client" -__version__ = "0.0.1-alpha.0" # x-release-please-version +__version__ = "0.1.0-alpha.1" # x-release-please-version From 9fc3ef4f6734b6489c0e260b29fca1797bbbff01 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 22:39:17 +0000 Subject: [PATCH 014/993] feat(api): update via SDK Studio (#9) --- LICENSE | 202 +------------------------------------------------ pyproject.toml | 4 +- 2 files changed, 6 insertions(+), 200 deletions(-) diff --git a/LICENSE b/LICENSE index b1e5b671d..8c410d1e9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,201 +1,7 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ +Copyright 2024 runloop - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - 1. Definitions. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2024 Runloop - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/pyproject.toml b/pyproject.toml index 4a2cd0dd8..20a60f0d2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "runloop-api-client" version = "0.1.0-alpha.1" description = "The official Python library for the runloop API" dynamic = ["readme"] -license = "Apache-2.0" +license = "MIT" authors = [ { name = "Runloop", email = "support@runloop.ai" }, ] @@ -33,7 +33,7 @@ classifiers = [ "Operating System :: POSIX :: Linux", "Operating System :: Microsoft :: Windows", "Topic :: Software Development :: Libraries :: Python Modules", - "License :: OSI Approved :: Apache Software License" + "License :: OSI Approved :: MIT License" ] From b0e8fed07acd1fadf9121e63c1b71059b492b8ec Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 22:43:08 +0000 Subject: [PATCH 015/993] chore(internal): version bump (#11) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_minus_api_minus_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ba6c34836..f14b480a9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.1" + ".": "0.1.0-alpha.2" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 20a60f0d2..6b3dc9d55 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop-api-client" -version = "0.1.0-alpha.1" +version = "0.1.0-alpha.2" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_minus_api_minus_client/_version.py b/src/runloop_minus_api_minus_client/_version.py index 52091da7e..b477efcea 100644 --- a/src/runloop_minus_api_minus_client/_version.py +++ b/src/runloop_minus_api_minus_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_minus_api_minus_client" -__version__ = "0.1.0-alpha.1" # x-release-please-version +__version__ = "0.1.0-alpha.2" # x-release-please-version From ac0fb779e06e346db3aa00ba115fb63b90f0220a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Jun 2024 01:53:01 +0000 Subject: [PATCH 016/993] feat(api): update via SDK Studio (#12) --- bin/publish-pypi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/publish-pypi b/bin/publish-pypi index 826054e92..05bfccbb7 100644 --- a/bin/publish-pypi +++ b/bin/publish-pypi @@ -3,4 +3,7 @@ set -eux mkdir -p dist rye build --clean +# Patching importlib-metadata version until upstream library version is updated +# https://github.com/pypa/twine/issues/977#issuecomment-2189800841 +"$HOME/.rye/self/bin/python3" -m pip install 'importlib-metadata==7.2.1' rye publish --yes --token=$PYPI_TOKEN From 626e757f77bbbf5247a8e510fe62c9380293ec6e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Jun 2024 02:45:46 +0000 Subject: [PATCH 017/993] chore(internal): version bump (#14) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_minus_api_minus_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f14b480a9..aaf968a12 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.2" + ".": "0.1.0-alpha.3" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 6b3dc9d55..5046c7b8c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop-api-client" -version = "0.1.0-alpha.2" +version = "0.1.0-alpha.3" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_minus_api_minus_client/_version.py b/src/runloop_minus_api_minus_client/_version.py index b477efcea..a5943ad8c 100644 --- a/src/runloop_minus_api_minus_client/_version.py +++ b/src/runloop_minus_api_minus_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_minus_api_minus_client" -__version__ = "0.1.0-alpha.2" # x-release-please-version +__version__ = "0.1.0-alpha.3" # x-release-please-version From 5ecd3b7f6abb74d783899276e5d386b7342f5251 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Jun 2024 15:57:07 +0000 Subject: [PATCH 018/993] feat(api): update via SDK Studio (#15) --- CONTRIBUTING.md | 2 +- README.md | 36 ++++++------- api.md | 51 ++++++++----------- mypy.ini | 2 +- pyproject.toml | 8 +-- release-please-config.json | 2 +- scripts/lint | 2 +- .../__init__.py | 4 +- .../_base_client.py | 2 +- .../_client.py | 0 .../_compat.py | 0 .../_constants.py | 0 .../_exceptions.py | 0 .../_files.py | 0 .../_models.py | 0 .../_qs.py | 0 .../_resource.py | 0 .../_response.py | 8 +-- .../_streaming.py | 0 .../_types.py | 2 +- .../_utils/__init__.py | 0 .../_utils/_logs.py | 4 +- .../_utils/_proxy.py | 0 .../_utils/_reflection.py | 0 .../_utils/_streams.py | 0 .../_utils/_sync.py | 0 .../_utils/_transform.py | 0 .../_utils/_typing.py | 0 .../_utils/_utils.py | 0 .../_version.py | 2 +- src/runloop_api_client/lib/.keep | 4 ++ .../py.typed | 0 .../resources/__init__.py | 0 .../resources/devboxes/__init__.py | 0 .../resources/devboxes/devboxes.py | 0 .../resources/devboxes/logs.py | 0 .../resources/functions/__init__.py | 0 .../resources/functions/functions.py | 0 .../functions/invocations/__init__.py | 0 .../functions/invocations/invocations.py | 0 .../resources/functions/invocations/spans.py | 0 .../resources/projects/__init__.py | 0 .../resources/projects/logs.py | 0 .../resources/projects/projects.py | 0 .../types/__init__.py | 0 .../types/devbox_create_params.py | 0 .../types/devbox_execution_detail_view.py | 0 .../types/devbox_list_params.py | 0 .../types/devbox_list_view.py | 0 .../types/devbox_view.py | 0 .../types/devboxes/__init__.py | 0 .../types/devboxes/devbox_logs_list_view.py | 0 .../types/function_invoke_async_params.py | 0 .../types/function_invoke_sync_params.py | 0 .../types/function_list_view.py | 0 .../types/functions/__init__.py | 0 .../function_invocation_list_view.py | 0 .../types/functions/invocations/__init__.py | 0 .../invocations/invocation_span_list_view.py | 0 .../types/project_list_view.py | 0 .../types/projects/__init__.py | 0 .../types/shared/__init__.py | 0 .../shared/function_invocation_detail_view.py | 0 .../types/shared/project_logs_view.py | 0 tests/api_resources/devboxes/test_logs.py | 4 +- .../functions/invocations/test_spans.py | 4 +- .../functions/test_invocations.py | 6 +-- tests/api_resources/projects/test_logs.py | 4 +- tests/api_resources/test_devboxes.py | 4 +- tests/api_resources/test_functions.py | 8 ++- tests/api_resources/test_projects.py | 4 +- tests/conftest.py | 4 +- tests/test_client.py | 35 ++++++------- tests/test_deepcopy.py | 2 +- tests/test_extract_files.py | 4 +- tests/test_files.py | 2 +- tests/test_models.py | 6 +-- tests/test_qs.py | 2 +- tests/test_required_args.py | 2 +- tests/test_response.py | 14 ++--- tests/test_streaming.py | 4 +- tests/test_transform.py | 8 +-- tests/test_utils/test_proxy.py | 2 +- tests/test_utils/test_typing.py | 2 +- tests/utils.py | 8 +-- 85 files changed, 124 insertions(+), 134 deletions(-) rename src/{runloop_minus_api_minus_client => runloop_api_client}/__init__.py (92%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/_base_client.py (99%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/_client.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/_compat.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/_constants.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/_exceptions.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/_files.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/_models.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/_qs.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/_resource.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/_response.py (99%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/_streaming.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/_types.py (99%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/_utils/__init__.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/_utils/_logs.py (72%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/_utils/_proxy.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/_utils/_reflection.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/_utils/_streams.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/_utils/_sync.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/_utils/_transform.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/_utils/_typing.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/_utils/_utils.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/_version.py (76%) create mode 100644 src/runloop_api_client/lib/.keep rename src/{runloop_minus_api_minus_client => runloop_api_client}/py.typed (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/resources/__init__.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/resources/devboxes/__init__.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/resources/devboxes/devboxes.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/resources/devboxes/logs.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/resources/functions/__init__.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/resources/functions/functions.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/resources/functions/invocations/__init__.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/resources/functions/invocations/invocations.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/resources/functions/invocations/spans.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/resources/projects/__init__.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/resources/projects/logs.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/resources/projects/projects.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/types/__init__.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/types/devbox_create_params.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/types/devbox_execution_detail_view.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/types/devbox_list_params.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/types/devbox_list_view.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/types/devbox_view.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/types/devboxes/__init__.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/types/devboxes/devbox_logs_list_view.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/types/function_invoke_async_params.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/types/function_invoke_sync_params.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/types/function_list_view.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/types/functions/__init__.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/types/functions/function_invocation_list_view.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/types/functions/invocations/__init__.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/types/functions/invocations/invocation_span_list_view.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/types/project_list_view.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/types/projects/__init__.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/types/shared/__init__.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/types/shared/function_invocation_detail_view.py (100%) rename src/{runloop_minus_api_minus_client => runloop_api_client}/types/shared/project_logs_view.py (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c79e54f82..c08e11c0e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,7 +32,7 @@ $ pip install -r requirements-dev.lock ## Modifying/Adding code Most of the SDK is generated code, and any modified code will be overridden on the next generation. The -`src/runloop_minus_api_minus_client/lib/` and `examples/` directories are exceptions and will never be overridden. +`src/runloop_api_client/lib/` and `examples/` directories are exceptions and will never be overridden. ## Adding and running examples diff --git a/README.md b/README.md index efb92b103..d56adbf50 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Runloop Python API library -[![PyPI version](https://img.shields.io/pypi/v/runloop-api-client.svg)](https://pypi.org/project/runloop-api-client/) +[![PyPI version](https://img.shields.io/pypi/v/runloop_api_client.svg)](https://pypi.org/project/runloop_api_client/) The Runloop Python library provides convenient access to the Runloop REST API from any Python 3.7+ application. The library includes type definitions for all request params and response fields, @@ -16,7 +16,7 @@ The REST API documentation can be found [on runloop.ai](https://runloop.ai). The ```sh # install from PyPI -pip install --pre runloop-api-client +pip install --pre runloop_api_client ``` ## Usage @@ -25,7 +25,7 @@ The full API of this library can be found in [api.md](api.md). ```python import os -from runloop_minus_api_minus_client import Runloop +from runloop_api_client import Runloop client = Runloop( # This is the default and can be omitted @@ -48,7 +48,7 @@ Simply import `AsyncRunloop` instead of `Runloop` and use `await` with each API ```python import os import asyncio -from runloop_minus_api_minus_client import AsyncRunloop +from runloop_api_client import AsyncRunloop client = AsyncRunloop( # This is the default and can be omitted @@ -77,27 +77,27 @@ Typed requests and responses provide autocomplete and documentation within your ## Handling errors -When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `runloop_minus_api_minus_client.APIConnectionError` is raised. +When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `runloop_api_client.APIConnectionError` is raised. When the API returns a non-success status code (that is, 4xx or 5xx -response), a subclass of `runloop_minus_api_minus_client.APIStatusError` is raised, containing `status_code` and `response` properties. +response), a subclass of `runloop_api_client.APIStatusError` is raised, containing `status_code` and `response` properties. -All errors inherit from `runloop_minus_api_minus_client.APIError`. +All errors inherit from `runloop_api_client.APIError`. ```python -import runloop_minus_api_minus_client -from runloop_minus_api_minus_client import Runloop +import runloop_api_client +from runloop_api_client import Runloop client = Runloop() try: client.devboxes.create() -except runloop_minus_api_minus_client.APIConnectionError as e: +except runloop_api_client.APIConnectionError as e: print("The server could not be reached") print(e.__cause__) # an underlying Exception, likely raised within httpx. -except runloop_minus_api_minus_client.RateLimitError as e: +except runloop_api_client.RateLimitError as e: print("A 429 status code was received; we should back off a bit.") -except runloop_minus_api_minus_client.APIStatusError as e: +except runloop_api_client.APIStatusError as e: print("Another non-200-range status code was received") print(e.status_code) print(e.response) @@ -125,7 +125,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ You can use the `max_retries` option to configure or disable retry settings: ```python -from runloop_minus_api_minus_client import Runloop +from runloop_api_client import Runloop # Configure the default for all requests: client = Runloop( @@ -143,7 +143,7 @@ By default requests time out after 1 minute. You can configure this with a `time which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object: ```python -from runloop_minus_api_minus_client import Runloop +from runloop_api_client import Runloop # Configure the default for all requests: client = Runloop( @@ -193,7 +193,7 @@ if response.my_field is None: The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g., ```py -from runloop_minus_api_minus_client import Runloop +from runloop_api_client import Runloop client = Runloop() response = client.devboxes.with_raw_response.create() @@ -203,9 +203,9 @@ devbox = response.parse() # get the object that `devboxes.create()` would have print(devbox.id) ``` -These methods return an [`APIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_minus_api_minus_client/_response.py) object. +These methods return an [`APIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_api_client/_response.py) object. -The async client returns an [`AsyncAPIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_minus_api_minus_client/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. +The async client returns an [`AsyncAPIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_api_client/_response.py) with the same structure, the only difference being `await`able methods for reading the response content. #### `.with_streaming_response` @@ -267,7 +267,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c - Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality ```python -from runloop_minus_api_minus_client import Runloop, DefaultHttpxClient +from runloop_api_client import Runloop, DefaultHttpxClient client = Runloop( # Or use the `RUNLOOP_BASE_URL` env var diff --git a/api.md b/api.md index 04368db98..25022156b 100644 --- a/api.md +++ b/api.md @@ -1,7 +1,7 @@ # Shared Types ```python -from runloop_minus_api_minus_client.types import FunctionInvocationDetailView, ProjectLogsView +from runloop_api_client.types import FunctionInvocationDetailView, ProjectLogsView ``` # Devboxes @@ -9,90 +9,83 @@ from runloop_minus_api_minus_client.types import FunctionInvocationDetailView, P Types: ```python -from runloop_minus_api_minus_client.types import ( - DevboxExecutionDetailView, - DevboxListView, - DevboxView, -) +from runloop_api_client.types import DevboxExecutionDetailView, DevboxListView, DevboxView ``` Methods: -- client.devboxes.create(\*\*params) -> DevboxView -- client.devboxes.retrieve(id) -> DevboxView -- client.devboxes.list(\*\*params) -> DevboxListView -- client.devboxes.execute_sync(id) -> DevboxExecutionDetailView -- client.devboxes.shutdown(id) -> DevboxView +- client.devboxes.create(\*\*params) -> DevboxView +- client.devboxes.retrieve(id) -> DevboxView +- client.devboxes.list(\*\*params) -> DevboxListView +- client.devboxes.execute_sync(id) -> DevboxExecutionDetailView +- client.devboxes.shutdown(id) -> DevboxView ## Logs Types: ```python -from runloop_minus_api_minus_client.types.devboxes import DevboxLogsListView +from runloop_api_client.types.devboxes import DevboxLogsListView ``` Methods: -- client.devboxes.logs.list(id) -> DevboxLogsListView +- client.devboxes.logs.list(id) -> DevboxLogsListView # Functions Types: ```python -from runloop_minus_api_minus_client.types import FunctionListView +from runloop_api_client.types import FunctionListView ``` Methods: -- client.functions.list() -> FunctionListView -- client.functions.invoke_async(function_name, \*, project_name, \*\*params) -> FunctionInvocationDetailView -- client.functions.invoke_sync(function_name, \*, project_name, \*\*params) -> FunctionInvocationDetailView +- client.functions.list() -> FunctionListView +- client.functions.invoke_async(function_name, \*, project_name, \*\*params) -> FunctionInvocationDetailView +- client.functions.invoke_sync(function_name, \*, project_name, \*\*params) -> FunctionInvocationDetailView ## Invocations Types: ```python -from runloop_minus_api_minus_client.types.functions import ( - FunctionInvocationListView, - KillOperationResponse, -) +from runloop_api_client.types.functions import FunctionInvocationListView, KillOperationResponse ``` Methods: -- client.functions.invocations.retrieve(invocation_id) -> FunctionInvocationDetailView -- client.functions.invocations.list() -> FunctionInvocationListView -- client.functions.invocations.kill(invocation_id) -> object +- client.functions.invocations.retrieve(invocation_id) -> FunctionInvocationDetailView +- client.functions.invocations.list() -> FunctionInvocationListView +- client.functions.invocations.kill(invocation_id) -> object ### Spans Types: ```python -from runloop_minus_api_minus_client.types.functions.invocations import InvocationSpanListView +from runloop_api_client.types.functions.invocations import InvocationSpanListView ``` Methods: -- client.functions.invocations.spans.list(invocation_id) -> InvocationSpanListView +- client.functions.invocations.spans.list(invocation_id) -> InvocationSpanListView # Projects Types: ```python -from runloop_minus_api_minus_client.types import ProjectListView +from runloop_api_client.types import ProjectListView ``` Methods: -- client.projects.list() -> ProjectListView +- client.projects.list() -> ProjectListView ## Logs Methods: -- client.projects.logs.list(id) -> ProjectLogsView +- client.projects.logs.list(id) -> ProjectLogsView diff --git a/mypy.ini b/mypy.ini index edf001443..0ecdd0f55 100644 --- a/mypy.ini +++ b/mypy.ini @@ -5,7 +5,7 @@ show_error_codes = True # Exclude _files.py because mypy isn't smart enough to apply # the correct type narrowing and as this is an internal module # it's fine to just use Pyright. -exclude = ^(src/runloop_minus_api_minus_client/_files\.py|_dev/.*\.py)$ +exclude = ^(src/runloop_api_client/_files\.py|_dev/.*\.py)$ strict_equality = True implicit_reexport = True diff --git a/pyproject.toml b/pyproject.toml index 5046c7b8c..8dfd58d4d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [project] -name = "runloop-api-client" +name = "runloop_api_client" version = "0.1.0-alpha.3" description = "The official Python library for the runloop API" dynamic = ["readme"] @@ -84,7 +84,7 @@ typecheck = { chain = [ "typecheck:mypy" ]} "typecheck:pyright" = "pyright" -"typecheck:verify-types" = "pyright --verifytypes runloop_minus_api_minus_client --ignoreexternal" +"typecheck:verify-types" = "pyright --verifytypes runloop_api_client --ignoreexternal" "typecheck:mypy" = "mypy ." [build-system] @@ -97,7 +97,7 @@ include = [ ] [tool.hatch.build.targets.wheel] -packages = ["src/runloop_minus_api_minus_client"] +packages = ["src/runloop_api_client"] [tool.hatch.metadata.hooks.fancy-pypi-readme] content-type = "text/markdown" @@ -187,7 +187,7 @@ length-sort = true length-sort-straight = true combine-as-imports = true extra-standard-library = ["typing_extensions"] -known-first-party = ["runloop_minus_api_minus_client", "tests"] +known-first-party = ["runloop_api_client", "tests"] [tool.ruff.per-file-ignores] "bin/**.py" = ["T201", "T203"] diff --git a/release-please-config.json b/release-please-config.json index ab92ea3f7..dffe9e51f 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -61,6 +61,6 @@ ], "release-type": "python", "extra-files": [ - "src/runloop_minus_api_minus_client/_version.py" + "src/runloop_api_client/_version.py" ] } \ No newline at end of file diff --git a/scripts/lint b/scripts/lint index c0e4922b5..e43753789 100755 --- a/scripts/lint +++ b/scripts/lint @@ -8,5 +8,5 @@ echo "==> Running lints" rye run lint echo "==> Making sure it imports" -rye run python -c 'import runloop_minus_api_minus_client' +rye run python -c 'import runloop_api_client' diff --git a/src/runloop_minus_api_minus_client/__init__.py b/src/runloop_api_client/__init__.py similarity index 92% rename from src/runloop_minus_api_minus_client/__init__.py rename to src/runloop_api_client/__init__.py index c42946eea..4e060bb42 100644 --- a/src/runloop_minus_api_minus_client/__init__.py +++ b/src/runloop_api_client/__init__.py @@ -72,12 +72,12 @@ # Update the __module__ attribute for exported symbols so that # error messages point to this module instead of the module # it was originally defined in, e.g. -# runloop_minus_api_minus_client._exceptions.NotFoundError -> runloop_minus_api_minus_client.NotFoundError +# runloop_api_client._exceptions.NotFoundError -> runloop_api_client.NotFoundError __locals = locals() for __name in __all__: if not __name.startswith("__"): try: - __locals[__name].__module__ = "runloop_minus_api_minus_client" + __locals[__name].__module__ = "runloop_api_client" except (TypeError, AttributeError): # Some of our exported symbols are builtins which we can't set attributes for. pass diff --git a/src/runloop_minus_api_minus_client/_base_client.py b/src/runloop_api_client/_base_client.py similarity index 99% rename from src/runloop_minus_api_minus_client/_base_client.py rename to src/runloop_api_client/_base_client.py index 7ea3ae961..7e585689b 100644 --- a/src/runloop_minus_api_minus_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -362,7 +362,7 @@ def __init__( if max_retries is None: # pyright: ignore[reportUnnecessaryComparison] raise TypeError( - "max_retries cannot be None. If you want to disable retries, pass `0`; if you want unlimited retries, pass `math.inf` or a very high number; if you want the default behavior, pass `runloop-api-client.DEFAULT_MAX_RETRIES`" + "max_retries cannot be None. If you want to disable retries, pass `0`; if you want unlimited retries, pass `math.inf` or a very high number; if you want the default behavior, pass `runloop_api_client.DEFAULT_MAX_RETRIES`" ) def _enforce_trailing_slash(self, url: URL) -> URL: diff --git a/src/runloop_minus_api_minus_client/_client.py b/src/runloop_api_client/_client.py similarity index 100% rename from src/runloop_minus_api_minus_client/_client.py rename to src/runloop_api_client/_client.py diff --git a/src/runloop_minus_api_minus_client/_compat.py b/src/runloop_api_client/_compat.py similarity index 100% rename from src/runloop_minus_api_minus_client/_compat.py rename to src/runloop_api_client/_compat.py diff --git a/src/runloop_minus_api_minus_client/_constants.py b/src/runloop_api_client/_constants.py similarity index 100% rename from src/runloop_minus_api_minus_client/_constants.py rename to src/runloop_api_client/_constants.py diff --git a/src/runloop_minus_api_minus_client/_exceptions.py b/src/runloop_api_client/_exceptions.py similarity index 100% rename from src/runloop_minus_api_minus_client/_exceptions.py rename to src/runloop_api_client/_exceptions.py diff --git a/src/runloop_minus_api_minus_client/_files.py b/src/runloop_api_client/_files.py similarity index 100% rename from src/runloop_minus_api_minus_client/_files.py rename to src/runloop_api_client/_files.py diff --git a/src/runloop_minus_api_minus_client/_models.py b/src/runloop_api_client/_models.py similarity index 100% rename from src/runloop_minus_api_minus_client/_models.py rename to src/runloop_api_client/_models.py diff --git a/src/runloop_minus_api_minus_client/_qs.py b/src/runloop_api_client/_qs.py similarity index 100% rename from src/runloop_minus_api_minus_client/_qs.py rename to src/runloop_api_client/_qs.py diff --git a/src/runloop_minus_api_minus_client/_resource.py b/src/runloop_api_client/_resource.py similarity index 100% rename from src/runloop_minus_api_minus_client/_resource.py rename to src/runloop_api_client/_resource.py diff --git a/src/runloop_minus_api_minus_client/_response.py b/src/runloop_api_client/_response.py similarity index 99% rename from src/runloop_minus_api_minus_client/_response.py rename to src/runloop_api_client/_response.py index 566ba601a..56f0c603e 100644 --- a/src/runloop_minus_api_minus_client/_response.py +++ b/src/runloop_api_client/_response.py @@ -204,7 +204,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: if inspect.isclass(origin) and not issubclass(origin, BaseModel) and issubclass(origin, pydantic.BaseModel): raise TypeError( - "Pydantic models must subclass our base model type, e.g. `from runloop_minus_api_minus_client import BaseModel`" + "Pydantic models must subclass our base model type, e.g. `from runloop_api_client import BaseModel`" ) if ( @@ -273,7 +273,7 @@ def parse(self, *, to: type[_T] | None = None) -> R | _T: the `to` argument, e.g. ```py - from runloop_minus_api_minus_client import BaseModel + from runloop_api_client import BaseModel class MyModel(BaseModel): @@ -377,7 +377,7 @@ async def parse(self, *, to: type[_T] | None = None) -> R | _T: the `to` argument, e.g. ```py - from runloop_minus_api_minus_client import BaseModel + from runloop_api_client import BaseModel class MyModel(BaseModel): @@ -548,7 +548,7 @@ async def stream_to_file( class MissingStreamClassError(TypeError): def __init__(self) -> None: super().__init__( - "The `stream` argument was set to `True` but the `stream_cls` argument was not given. See `runloop_minus_api_minus_client._streaming` for reference", + "The `stream` argument was set to `True` but the `stream_cls` argument was not given. See `runloop_api_client._streaming` for reference", ) diff --git a/src/runloop_minus_api_minus_client/_streaming.py b/src/runloop_api_client/_streaming.py similarity index 100% rename from src/runloop_minus_api_minus_client/_streaming.py rename to src/runloop_api_client/_streaming.py diff --git a/src/runloop_minus_api_minus_client/_types.py b/src/runloop_api_client/_types.py similarity index 99% rename from src/runloop_minus_api_minus_client/_types.py rename to src/runloop_api_client/_types.py index 5f55824f3..13f21d53e 100644 --- a/src/runloop_minus_api_minus_client/_types.py +++ b/src/runloop_api_client/_types.py @@ -81,7 +81,7 @@ # This unfortunately means that you will either have # to import this type and pass it explicitly: # -# from runloop_minus_api_minus_client import NoneType +# from runloop_api_client import NoneType # client.get('/foo', cast_to=NoneType) # # or build it yourself: diff --git a/src/runloop_minus_api_minus_client/_utils/__init__.py b/src/runloop_api_client/_utils/__init__.py similarity index 100% rename from src/runloop_minus_api_minus_client/_utils/__init__.py rename to src/runloop_api_client/_utils/__init__.py diff --git a/src/runloop_minus_api_minus_client/_utils/_logs.py b/src/runloop_api_client/_utils/_logs.py similarity index 72% rename from src/runloop_minus_api_minus_client/_utils/_logs.py rename to src/runloop_api_client/_utils/_logs.py index 576c5a864..b165781b6 100644 --- a/src/runloop_minus_api_minus_client/_utils/_logs.py +++ b/src/runloop_api_client/_utils/_logs.py @@ -1,12 +1,12 @@ import os import logging -logger: logging.Logger = logging.getLogger("runloop_minus_api_minus_client") +logger: logging.Logger = logging.getLogger("runloop_api_client") httpx_logger: logging.Logger = logging.getLogger("httpx") def _basic_config() -> None: - # e.g. [2023-10-05 14:12:26 - runloop_minus_api_minus_client._base_client:818 - DEBUG] HTTP Request: POST http://127.0.0.1:4010/foo/bar "200 OK" + # e.g. [2023-10-05 14:12:26 - runloop_api_client._base_client:818 - DEBUG] HTTP Request: POST http://127.0.0.1:4010/foo/bar "200 OK" logging.basicConfig( format="[%(asctime)s - %(name)s:%(lineno)d - %(levelname)s] %(message)s", datefmt="%Y-%m-%d %H:%M:%S", diff --git a/src/runloop_minus_api_minus_client/_utils/_proxy.py b/src/runloop_api_client/_utils/_proxy.py similarity index 100% rename from src/runloop_minus_api_minus_client/_utils/_proxy.py rename to src/runloop_api_client/_utils/_proxy.py diff --git a/src/runloop_minus_api_minus_client/_utils/_reflection.py b/src/runloop_api_client/_utils/_reflection.py similarity index 100% rename from src/runloop_minus_api_minus_client/_utils/_reflection.py rename to src/runloop_api_client/_utils/_reflection.py diff --git a/src/runloop_minus_api_minus_client/_utils/_streams.py b/src/runloop_api_client/_utils/_streams.py similarity index 100% rename from src/runloop_minus_api_minus_client/_utils/_streams.py rename to src/runloop_api_client/_utils/_streams.py diff --git a/src/runloop_minus_api_minus_client/_utils/_sync.py b/src/runloop_api_client/_utils/_sync.py similarity index 100% rename from src/runloop_minus_api_minus_client/_utils/_sync.py rename to src/runloop_api_client/_utils/_sync.py diff --git a/src/runloop_minus_api_minus_client/_utils/_transform.py b/src/runloop_api_client/_utils/_transform.py similarity index 100% rename from src/runloop_minus_api_minus_client/_utils/_transform.py rename to src/runloop_api_client/_utils/_transform.py diff --git a/src/runloop_minus_api_minus_client/_utils/_typing.py b/src/runloop_api_client/_utils/_typing.py similarity index 100% rename from src/runloop_minus_api_minus_client/_utils/_typing.py rename to src/runloop_api_client/_utils/_typing.py diff --git a/src/runloop_minus_api_minus_client/_utils/_utils.py b/src/runloop_api_client/_utils/_utils.py similarity index 100% rename from src/runloop_minus_api_minus_client/_utils/_utils.py rename to src/runloop_api_client/_utils/_utils.py diff --git a/src/runloop_minus_api_minus_client/_version.py b/src/runloop_api_client/_version.py similarity index 76% rename from src/runloop_minus_api_minus_client/_version.py rename to src/runloop_api_client/_version.py index a5943ad8c..fc3f75d6d 100644 --- a/src/runloop_minus_api_minus_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -__title__ = "runloop_minus_api_minus_client" +__title__ = "runloop_api_client" __version__ = "0.1.0-alpha.3" # x-release-please-version diff --git a/src/runloop_api_client/lib/.keep b/src/runloop_api_client/lib/.keep new file mode 100644 index 000000000..5e2c99fdb --- /dev/null +++ b/src/runloop_api_client/lib/.keep @@ -0,0 +1,4 @@ +File generated from our OpenAPI spec by Stainless. + +This directory can be used to store custom files to expand the SDK. +It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. \ No newline at end of file diff --git a/src/runloop_minus_api_minus_client/py.typed b/src/runloop_api_client/py.typed similarity index 100% rename from src/runloop_minus_api_minus_client/py.typed rename to src/runloop_api_client/py.typed diff --git a/src/runloop_minus_api_minus_client/resources/__init__.py b/src/runloop_api_client/resources/__init__.py similarity index 100% rename from src/runloop_minus_api_minus_client/resources/__init__.py rename to src/runloop_api_client/resources/__init__.py diff --git a/src/runloop_minus_api_minus_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py similarity index 100% rename from src/runloop_minus_api_minus_client/resources/devboxes/__init__.py rename to src/runloop_api_client/resources/devboxes/__init__.py diff --git a/src/runloop_minus_api_minus_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py similarity index 100% rename from src/runloop_minus_api_minus_client/resources/devboxes/devboxes.py rename to src/runloop_api_client/resources/devboxes/devboxes.py diff --git a/src/runloop_minus_api_minus_client/resources/devboxes/logs.py b/src/runloop_api_client/resources/devboxes/logs.py similarity index 100% rename from src/runloop_minus_api_minus_client/resources/devboxes/logs.py rename to src/runloop_api_client/resources/devboxes/logs.py diff --git a/src/runloop_minus_api_minus_client/resources/functions/__init__.py b/src/runloop_api_client/resources/functions/__init__.py similarity index 100% rename from src/runloop_minus_api_minus_client/resources/functions/__init__.py rename to src/runloop_api_client/resources/functions/__init__.py diff --git a/src/runloop_minus_api_minus_client/resources/functions/functions.py b/src/runloop_api_client/resources/functions/functions.py similarity index 100% rename from src/runloop_minus_api_minus_client/resources/functions/functions.py rename to src/runloop_api_client/resources/functions/functions.py diff --git a/src/runloop_minus_api_minus_client/resources/functions/invocations/__init__.py b/src/runloop_api_client/resources/functions/invocations/__init__.py similarity index 100% rename from src/runloop_minus_api_minus_client/resources/functions/invocations/__init__.py rename to src/runloop_api_client/resources/functions/invocations/__init__.py diff --git a/src/runloop_minus_api_minus_client/resources/functions/invocations/invocations.py b/src/runloop_api_client/resources/functions/invocations/invocations.py similarity index 100% rename from src/runloop_minus_api_minus_client/resources/functions/invocations/invocations.py rename to src/runloop_api_client/resources/functions/invocations/invocations.py diff --git a/src/runloop_minus_api_minus_client/resources/functions/invocations/spans.py b/src/runloop_api_client/resources/functions/invocations/spans.py similarity index 100% rename from src/runloop_minus_api_minus_client/resources/functions/invocations/spans.py rename to src/runloop_api_client/resources/functions/invocations/spans.py diff --git a/src/runloop_minus_api_minus_client/resources/projects/__init__.py b/src/runloop_api_client/resources/projects/__init__.py similarity index 100% rename from src/runloop_minus_api_minus_client/resources/projects/__init__.py rename to src/runloop_api_client/resources/projects/__init__.py diff --git a/src/runloop_minus_api_minus_client/resources/projects/logs.py b/src/runloop_api_client/resources/projects/logs.py similarity index 100% rename from src/runloop_minus_api_minus_client/resources/projects/logs.py rename to src/runloop_api_client/resources/projects/logs.py diff --git a/src/runloop_minus_api_minus_client/resources/projects/projects.py b/src/runloop_api_client/resources/projects/projects.py similarity index 100% rename from src/runloop_minus_api_minus_client/resources/projects/projects.py rename to src/runloop_api_client/resources/projects/projects.py diff --git a/src/runloop_minus_api_minus_client/types/__init__.py b/src/runloop_api_client/types/__init__.py similarity index 100% rename from src/runloop_minus_api_minus_client/types/__init__.py rename to src/runloop_api_client/types/__init__.py diff --git a/src/runloop_minus_api_minus_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py similarity index 100% rename from src/runloop_minus_api_minus_client/types/devbox_create_params.py rename to src/runloop_api_client/types/devbox_create_params.py diff --git a/src/runloop_minus_api_minus_client/types/devbox_execution_detail_view.py b/src/runloop_api_client/types/devbox_execution_detail_view.py similarity index 100% rename from src/runloop_minus_api_minus_client/types/devbox_execution_detail_view.py rename to src/runloop_api_client/types/devbox_execution_detail_view.py diff --git a/src/runloop_minus_api_minus_client/types/devbox_list_params.py b/src/runloop_api_client/types/devbox_list_params.py similarity index 100% rename from src/runloop_minus_api_minus_client/types/devbox_list_params.py rename to src/runloop_api_client/types/devbox_list_params.py diff --git a/src/runloop_minus_api_minus_client/types/devbox_list_view.py b/src/runloop_api_client/types/devbox_list_view.py similarity index 100% rename from src/runloop_minus_api_minus_client/types/devbox_list_view.py rename to src/runloop_api_client/types/devbox_list_view.py diff --git a/src/runloop_minus_api_minus_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py similarity index 100% rename from src/runloop_minus_api_minus_client/types/devbox_view.py rename to src/runloop_api_client/types/devbox_view.py diff --git a/src/runloop_minus_api_minus_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py similarity index 100% rename from src/runloop_minus_api_minus_client/types/devboxes/__init__.py rename to src/runloop_api_client/types/devboxes/__init__.py diff --git a/src/runloop_minus_api_minus_client/types/devboxes/devbox_logs_list_view.py b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py similarity index 100% rename from src/runloop_minus_api_minus_client/types/devboxes/devbox_logs_list_view.py rename to src/runloop_api_client/types/devboxes/devbox_logs_list_view.py diff --git a/src/runloop_minus_api_minus_client/types/function_invoke_async_params.py b/src/runloop_api_client/types/function_invoke_async_params.py similarity index 100% rename from src/runloop_minus_api_minus_client/types/function_invoke_async_params.py rename to src/runloop_api_client/types/function_invoke_async_params.py diff --git a/src/runloop_minus_api_minus_client/types/function_invoke_sync_params.py b/src/runloop_api_client/types/function_invoke_sync_params.py similarity index 100% rename from src/runloop_minus_api_minus_client/types/function_invoke_sync_params.py rename to src/runloop_api_client/types/function_invoke_sync_params.py diff --git a/src/runloop_minus_api_minus_client/types/function_list_view.py b/src/runloop_api_client/types/function_list_view.py similarity index 100% rename from src/runloop_minus_api_minus_client/types/function_list_view.py rename to src/runloop_api_client/types/function_list_view.py diff --git a/src/runloop_minus_api_minus_client/types/functions/__init__.py b/src/runloop_api_client/types/functions/__init__.py similarity index 100% rename from src/runloop_minus_api_minus_client/types/functions/__init__.py rename to src/runloop_api_client/types/functions/__init__.py diff --git a/src/runloop_minus_api_minus_client/types/functions/function_invocation_list_view.py b/src/runloop_api_client/types/functions/function_invocation_list_view.py similarity index 100% rename from src/runloop_minus_api_minus_client/types/functions/function_invocation_list_view.py rename to src/runloop_api_client/types/functions/function_invocation_list_view.py diff --git a/src/runloop_minus_api_minus_client/types/functions/invocations/__init__.py b/src/runloop_api_client/types/functions/invocations/__init__.py similarity index 100% rename from src/runloop_minus_api_minus_client/types/functions/invocations/__init__.py rename to src/runloop_api_client/types/functions/invocations/__init__.py diff --git a/src/runloop_minus_api_minus_client/types/functions/invocations/invocation_span_list_view.py b/src/runloop_api_client/types/functions/invocations/invocation_span_list_view.py similarity index 100% rename from src/runloop_minus_api_minus_client/types/functions/invocations/invocation_span_list_view.py rename to src/runloop_api_client/types/functions/invocations/invocation_span_list_view.py diff --git a/src/runloop_minus_api_minus_client/types/project_list_view.py b/src/runloop_api_client/types/project_list_view.py similarity index 100% rename from src/runloop_minus_api_minus_client/types/project_list_view.py rename to src/runloop_api_client/types/project_list_view.py diff --git a/src/runloop_minus_api_minus_client/types/projects/__init__.py b/src/runloop_api_client/types/projects/__init__.py similarity index 100% rename from src/runloop_minus_api_minus_client/types/projects/__init__.py rename to src/runloop_api_client/types/projects/__init__.py diff --git a/src/runloop_minus_api_minus_client/types/shared/__init__.py b/src/runloop_api_client/types/shared/__init__.py similarity index 100% rename from src/runloop_minus_api_minus_client/types/shared/__init__.py rename to src/runloop_api_client/types/shared/__init__.py diff --git a/src/runloop_minus_api_minus_client/types/shared/function_invocation_detail_view.py b/src/runloop_api_client/types/shared/function_invocation_detail_view.py similarity index 100% rename from src/runloop_minus_api_minus_client/types/shared/function_invocation_detail_view.py rename to src/runloop_api_client/types/shared/function_invocation_detail_view.py diff --git a/src/runloop_minus_api_minus_client/types/shared/project_logs_view.py b/src/runloop_api_client/types/shared/project_logs_view.py similarity index 100% rename from src/runloop_minus_api_minus_client/types/shared/project_logs_view.py rename to src/runloop_api_client/types/shared/project_logs_view.py diff --git a/tests/api_resources/devboxes/test_logs.py b/tests/api_resources/devboxes/test_logs.py index c98e52023..d7549b724 100644 --- a/tests/api_resources/devboxes/test_logs.py +++ b/tests/api_resources/devboxes/test_logs.py @@ -8,8 +8,8 @@ import pytest from tests.utils import assert_matches_type -from runloop_minus_api_minus_client import Runloop, AsyncRunloop -from runloop_minus_api_minus_client.types.devboxes import DevboxLogsListView +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import DevboxLogsListView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/functions/invocations/test_spans.py b/tests/api_resources/functions/invocations/test_spans.py index a4b701322..a906a79e7 100644 --- a/tests/api_resources/functions/invocations/test_spans.py +++ b/tests/api_resources/functions/invocations/test_spans.py @@ -8,8 +8,8 @@ import pytest from tests.utils import assert_matches_type -from runloop_minus_api_minus_client import Runloop, AsyncRunloop -from runloop_minus_api_minus_client.types.functions.invocations import InvocationSpanListView +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.functions.invocations import InvocationSpanListView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/functions/test_invocations.py b/tests/api_resources/functions/test_invocations.py index c7486c45d..f1592f045 100644 --- a/tests/api_resources/functions/test_invocations.py +++ b/tests/api_resources/functions/test_invocations.py @@ -8,9 +8,9 @@ import pytest from tests.utils import assert_matches_type -from runloop_minus_api_minus_client import Runloop, AsyncRunloop -from runloop_minus_api_minus_client.types.shared import FunctionInvocationDetailView -from runloop_minus_api_minus_client.types.functions import FunctionInvocationListView +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.shared import FunctionInvocationDetailView +from runloop_api_client.types.functions import FunctionInvocationListView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/projects/test_logs.py b/tests/api_resources/projects/test_logs.py index b8a51dc52..81d5ed8ea 100644 --- a/tests/api_resources/projects/test_logs.py +++ b/tests/api_resources/projects/test_logs.py @@ -8,8 +8,8 @@ import pytest from tests.utils import assert_matches_type -from runloop_minus_api_minus_client import Runloop, AsyncRunloop -from runloop_minus_api_minus_client.types.shared import ProjectLogsView +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.shared import ProjectLogsView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 0fc02ad3b..e1bea0100 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -8,8 +8,8 @@ import pytest from tests.utils import assert_matches_type -from runloop_minus_api_minus_client import Runloop, AsyncRunloop -from runloop_minus_api_minus_client.types import ( +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types import ( DevboxView, DevboxListView, DevboxExecutionDetailView, diff --git a/tests/api_resources/test_functions.py b/tests/api_resources/test_functions.py index 85016f1cf..800cb7b6d 100644 --- a/tests/api_resources/test_functions.py +++ b/tests/api_resources/test_functions.py @@ -8,11 +8,9 @@ import pytest from tests.utils import assert_matches_type -from runloop_minus_api_minus_client import Runloop, AsyncRunloop -from runloop_minus_api_minus_client.types import ( - FunctionListView, -) -from runloop_minus_api_minus_client.types.shared import FunctionInvocationDetailView +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types import FunctionListView +from runloop_api_client.types.shared import FunctionInvocationDetailView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py index 1a1a05a9f..7ba7ea501 100644 --- a/tests/api_resources/test_projects.py +++ b/tests/api_resources/test_projects.py @@ -8,8 +8,8 @@ import pytest from tests.utils import assert_matches_type -from runloop_minus_api_minus_client import Runloop, AsyncRunloop -from runloop_minus_api_minus_client.types import ProjectListView +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types import ProjectListView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") diff --git a/tests/conftest.py b/tests/conftest.py index 8f5021cee..405150e14 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7,14 +7,14 @@ import pytest -from runloop_minus_api_minus_client import Runloop, AsyncRunloop +from runloop_api_client import Runloop, AsyncRunloop if TYPE_CHECKING: from _pytest.fixtures import FixtureRequest pytest.register_assert_rewrite("tests.utils") -logging.getLogger("runloop_minus_api_minus_client").setLevel(logging.DEBUG) +logging.getLogger("runloop_api_client").setLevel(logging.DEBUG) @pytest.fixture(scope="session") diff --git a/tests/test_client.py b/tests/test_client.py index a674b2623..75431ad53 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -16,16 +16,11 @@ from respx import MockRouter from pydantic import ValidationError -from runloop_minus_api_minus_client import Runloop, AsyncRunloop, APIResponseValidationError -from runloop_minus_api_minus_client._models import BaseModel, FinalRequestOptions -from runloop_minus_api_minus_client._constants import RAW_RESPONSE_HEADER -from runloop_minus_api_minus_client._exceptions import ( - RunloopError, - APIStatusError, - APITimeoutError, - APIResponseValidationError, -) -from runloop_minus_api_minus_client._base_client import ( +from runloop_api_client import Runloop, AsyncRunloop, APIResponseValidationError +from runloop_api_client._models import BaseModel, FinalRequestOptions +from runloop_api_client._constants import RAW_RESPONSE_HEADER +from runloop_api_client._exceptions import RunloopError, APIStatusError, APITimeoutError, APIResponseValidationError +from runloop_api_client._base_client import ( DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, @@ -232,10 +227,10 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic # to_raw_response_wrapper leaks through the @functools.wraps() decorator. # # removing the decorator fixes the leak for reasons we don't understand. - "runloop_minus_api_minus_client/_legacy_response.py", - "runloop_minus_api_minus_client/_response.py", + "runloop_api_client/_legacy_response.py", + "runloop_api_client/_response.py", # pydantic.BaseModel.model_dump || pydantic.BaseModel.dict leak memory for some reason. - "runloop_minus_api_minus_client/_compat.py", + "runloop_api_client/_compat.py", # Standard library leaks we don't care about. "/logging/__init__.py", ] @@ -734,7 +729,7 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str calculated = client._calculate_retry_timeout(remaining_retries, options, headers) assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] - @mock.patch("runloop_minus_api_minus_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: respx_mock.post("/v1/devboxes").mock(side_effect=httpx.TimeoutException("Test timeout error")) @@ -749,7 +744,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No assert _get_open_connections(self.client) == 0 - @mock.patch("runloop_minus_api_minus_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: respx_mock.post("/v1/devboxes").mock(return_value=httpx.Response(500)) @@ -943,10 +938,10 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic # to_raw_response_wrapper leaks through the @functools.wraps() decorator. # # removing the decorator fixes the leak for reasons we don't understand. - "runloop_minus_api_minus_client/_legacy_response.py", - "runloop_minus_api_minus_client/_response.py", + "runloop_api_client/_legacy_response.py", + "runloop_api_client/_response.py", # pydantic.BaseModel.model_dump || pydantic.BaseModel.dict leak memory for some reason. - "runloop_minus_api_minus_client/_compat.py", + "runloop_api_client/_compat.py", # Standard library leaks we don't care about. "/logging/__init__.py", ] @@ -1449,7 +1444,7 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte calculated = client._calculate_retry_timeout(remaining_retries, options, headers) assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] - @mock.patch("runloop_minus_api_minus_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: respx_mock.post("/v1/devboxes").mock(side_effect=httpx.TimeoutException("Test timeout error")) @@ -1464,7 +1459,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) assert _get_open_connections(self.client) == 0 - @mock.patch("runloop_minus_api_minus_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: respx_mock.post("/v1/devboxes").mock(return_value=httpx.Response(500)) diff --git a/tests/test_deepcopy.py b/tests/test_deepcopy.py index 4926690f5..adf478aae 100644 --- a/tests/test_deepcopy.py +++ b/tests/test_deepcopy.py @@ -1,4 +1,4 @@ -from runloop_minus_api_minus_client._utils import deepcopy_minimal +from runloop_api_client._utils import deepcopy_minimal def assert_different_identities(obj1: object, obj2: object) -> None: diff --git a/tests/test_extract_files.py b/tests/test_extract_files.py index 0156cc3e0..41498b836 100644 --- a/tests/test_extract_files.py +++ b/tests/test_extract_files.py @@ -4,8 +4,8 @@ import pytest -from runloop_minus_api_minus_client._types import FileTypes -from runloop_minus_api_minus_client._utils import extract_files +from runloop_api_client._types import FileTypes +from runloop_api_client._utils import extract_files def test_removes_files_from_input() -> None: diff --git a/tests/test_files.py b/tests/test_files.py index 1b42f4478..6b19b3721 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -4,7 +4,7 @@ import pytest from dirty_equals import IsDict, IsList, IsBytes, IsTuple -from runloop_minus_api_minus_client._files import to_httpx_files, async_to_httpx_files +from runloop_api_client._files import to_httpx_files, async_to_httpx_files readme_path = Path(__file__).parent.parent.joinpath("README.md") diff --git a/tests/test_models.py b/tests/test_models.py index 57a3f7b70..7679a783a 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -7,9 +7,9 @@ import pydantic from pydantic import Field -from runloop_minus_api_minus_client._utils import PropertyInfo -from runloop_minus_api_minus_client._compat import PYDANTIC_V2, parse_obj, model_dump, model_json -from runloop_minus_api_minus_client._models import BaseModel, construct_type +from runloop_api_client._utils import PropertyInfo +from runloop_api_client._compat import PYDANTIC_V2, parse_obj, model_dump, model_json +from runloop_api_client._models import BaseModel, construct_type class BasicModel(BaseModel): diff --git a/tests/test_qs.py b/tests/test_qs.py index 8cd0451b1..34eb9226c 100644 --- a/tests/test_qs.py +++ b/tests/test_qs.py @@ -4,7 +4,7 @@ import pytest -from runloop_minus_api_minus_client._qs import Querystring, stringify +from runloop_api_client._qs import Querystring, stringify def test_empty() -> None: diff --git a/tests/test_required_args.py b/tests/test_required_args.py index fa5638c47..33159a496 100644 --- a/tests/test_required_args.py +++ b/tests/test_required_args.py @@ -2,7 +2,7 @@ import pytest -from runloop_minus_api_minus_client._utils import required_args +from runloop_api_client._utils import required_args def test_too_many_positional_params() -> None: diff --git a/tests/test_response.py b/tests/test_response.py index 7da4f33db..27811cfa2 100644 --- a/tests/test_response.py +++ b/tests/test_response.py @@ -6,8 +6,8 @@ import pytest import pydantic -from runloop_minus_api_minus_client import Runloop, BaseModel, AsyncRunloop -from runloop_minus_api_minus_client._response import ( +from runloop_api_client import Runloop, BaseModel, AsyncRunloop +from runloop_api_client._response import ( APIResponse, BaseAPIResponse, AsyncAPIResponse, @@ -15,8 +15,8 @@ AsyncBinaryAPIResponse, extract_response_type, ) -from runloop_minus_api_minus_client._streaming import Stream -from runloop_minus_api_minus_client._base_client import FinalRequestOptions +from runloop_api_client._streaming import Stream +from runloop_api_client._base_client import FinalRequestOptions class ConcreteBaseAPIResponse(APIResponse[bytes]): @@ -40,7 +40,7 @@ def test_extract_response_type_direct_classes() -> None: def test_extract_response_type_direct_class_missing_type_arg() -> None: with pytest.raises( RuntimeError, - match="Expected type to have a type argument at index 0 but it did not", + match="Expected type to have a type argument at index 0 but it did not", ): extract_response_type(AsyncAPIResponse) @@ -72,7 +72,7 @@ def test_response_parse_mismatched_basemodel(client: Runloop) -> None: with pytest.raises( TypeError, - match="Pydantic models must subclass our base model type, e.g. `from runloop_minus_api_minus_client import BaseModel`", + match="Pydantic models must subclass our base model type, e.g. `from runloop_api_client import BaseModel`", ): response.parse(to=PydanticModel) @@ -90,7 +90,7 @@ async def test_async_response_parse_mismatched_basemodel(async_client: AsyncRunl with pytest.raises( TypeError, - match="Pydantic models must subclass our base model type, e.g. `from runloop_minus_api_minus_client import BaseModel`", + match="Pydantic models must subclass our base model type, e.g. `from runloop_api_client import BaseModel`", ): await response.parse(to=PydanticModel) diff --git a/tests/test_streaming.py b/tests/test_streaming.py index 0ef8906f6..e8bf8f093 100644 --- a/tests/test_streaming.py +++ b/tests/test_streaming.py @@ -5,8 +5,8 @@ import httpx import pytest -from runloop_minus_api_minus_client import Runloop, AsyncRunloop -from runloop_minus_api_minus_client._streaming import Stream, AsyncStream, ServerSentEvent +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client._streaming import Stream, AsyncStream, ServerSentEvent @pytest.mark.asyncio diff --git a/tests/test_transform.py b/tests/test_transform.py index 261ef04d9..969ae7ecb 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -8,15 +8,15 @@ import pytest -from runloop_minus_api_minus_client._types import Base64FileInput -from runloop_minus_api_minus_client._utils import ( +from runloop_api_client._types import Base64FileInput +from runloop_api_client._utils import ( PropertyInfo, transform as _transform, parse_datetime, async_transform as _async_transform, ) -from runloop_minus_api_minus_client._compat import PYDANTIC_V2 -from runloop_minus_api_minus_client._models import BaseModel +from runloop_api_client._compat import PYDANTIC_V2 +from runloop_api_client._models import BaseModel _T = TypeVar("_T") diff --git a/tests/test_utils/test_proxy.py b/tests/test_utils/test_proxy.py index 492853bd0..af0c2a623 100644 --- a/tests/test_utils/test_proxy.py +++ b/tests/test_utils/test_proxy.py @@ -2,7 +2,7 @@ from typing import Any from typing_extensions import override -from runloop_minus_api_minus_client._utils import LazyProxy +from runloop_api_client._utils import LazyProxy class RecursiveLazyProxy(LazyProxy[Any]): diff --git a/tests/test_utils/test_typing.py b/tests/test_utils/test_typing.py index fb3ec09fe..cdf50acf1 100644 --- a/tests/test_utils/test_typing.py +++ b/tests/test_utils/test_typing.py @@ -2,7 +2,7 @@ from typing import Generic, TypeVar, cast -from runloop_minus_api_minus_client._utils import extract_type_var_from_base +from runloop_api_client._utils import extract_type_var_from_base _T = TypeVar("_T") _T2 = TypeVar("_T2") diff --git a/tests/utils.py b/tests/utils.py index b497fdc13..13aa5efd5 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -8,8 +8,8 @@ from datetime import date, datetime from typing_extensions import Literal, get_args, get_origin, assert_type -from runloop_minus_api_minus_client._types import NoneType -from runloop_minus_api_minus_client._utils import ( +from runloop_api_client._types import NoneType +from runloop_api_client._utils import ( is_dict, is_list, is_list_type, @@ -17,8 +17,8 @@ extract_type_arg, is_annotated_type, ) -from runloop_minus_api_minus_client._compat import PYDANTIC_V2, field_outer_type, get_model_fields -from runloop_minus_api_minus_client._models import BaseModel +from runloop_api_client._compat import PYDANTIC_V2, field_outer_type, get_model_fields +from runloop_api_client._models import BaseModel BaseModelT = TypeVar("BaseModelT", bound=BaseModel) From b1519b93f50a513996b4727ae4e27542756703d1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Jun 2024 16:00:22 +0000 Subject: [PATCH 019/993] chore(internal): version bump (#17) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index aaf968a12..b56c3d0b4 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.3" + ".": "0.1.0-alpha.4" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 8dfd58d4d..d77d92bc3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.1.0-alpha.3" +version = "0.1.0-alpha.4" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index fc3f75d6d..23a34c2b2 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.1.0-alpha.3" # x-release-please-version +__version__ = "0.1.0-alpha.4" # x-release-please-version From 3e3895d55304c0d30f55575a9c5f52c350b87afd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Jun 2024 19:12:17 +0000 Subject: [PATCH 020/993] feat(api): OpenAPI spec update via Stainless API (#19) --- .stats.yml | 4 +- api.md | 4 - .../functions/invocations/__init__.py | 14 -- .../functions/invocations/invocations.py | 32 ---- .../resources/functions/invocations/spans.py | 147 ------------------ .../types/devboxes/devbox_logs_list_view.py | 9 ++ .../types/functions/invocations/__init__.py | 2 - .../invocations/invocation_span_list_view.py | 16 -- .../functions/invocations/test_spans.py | 98 ------------ 9 files changed, 11 insertions(+), 315 deletions(-) delete mode 100644 src/runloop_api_client/resources/functions/invocations/spans.py delete mode 100644 src/runloop_api_client/types/functions/invocations/invocation_span_list_view.py delete mode 100644 tests/api_resources/functions/invocations/test_spans.py diff --git a/.stats.yml b/.stats.yml index 2049e5bd1..11f149d6a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 15 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e741833ec80041045f2b16ea82c2bd4c7b2d4b4bf0ec0f5698b20ece98763d00.yml +configured_endpoints: 14 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1fdc9bae4fba7d365eca69915191a06ab5b0faec74f80404339e92cba37036f7.yml diff --git a/api.md b/api.md index 25022156b..bb7ee2079 100644 --- a/api.md +++ b/api.md @@ -68,10 +68,6 @@ Types: from runloop_api_client.types.functions.invocations import InvocationSpanListView ``` -Methods: - -- client.functions.invocations.spans.list(invocation_id) -> InvocationSpanListView - # Projects Types: diff --git a/src/runloop_api_client/resources/functions/invocations/__init__.py b/src/runloop_api_client/resources/functions/invocations/__init__.py index dafa50446..338f27980 100644 --- a/src/runloop_api_client/resources/functions/invocations/__init__.py +++ b/src/runloop_api_client/resources/functions/invocations/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .spans import ( - SpansResource, - AsyncSpansResource, - SpansResourceWithRawResponse, - AsyncSpansResourceWithRawResponse, - SpansResourceWithStreamingResponse, - AsyncSpansResourceWithStreamingResponse, -) from .invocations import ( InvocationsResource, AsyncInvocationsResource, @@ -18,12 +10,6 @@ ) __all__ = [ - "SpansResource", - "AsyncSpansResource", - "SpansResourceWithRawResponse", - "AsyncSpansResourceWithRawResponse", - "SpansResourceWithStreamingResponse", - "AsyncSpansResourceWithStreamingResponse", "InvocationsResource", "AsyncInvocationsResource", "InvocationsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/functions/invocations/invocations.py b/src/runloop_api_client/resources/functions/invocations/invocations.py index 66cd346b2..3130b0976 100644 --- a/src/runloop_api_client/resources/functions/invocations/invocations.py +++ b/src/runloop_api_client/resources/functions/invocations/invocations.py @@ -4,14 +4,6 @@ import httpx -from .spans import ( - SpansResource, - AsyncSpansResource, - SpansResourceWithRawResponse, - AsyncSpansResourceWithRawResponse, - SpansResourceWithStreamingResponse, - AsyncSpansResourceWithStreamingResponse, -) from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -31,10 +23,6 @@ class InvocationsResource(SyncAPIResource): - @cached_property - def spans(self) -> SpansResource: - return SpansResource(self._client) - @cached_property def with_raw_response(self) -> InvocationsResourceWithRawResponse: return InvocationsResourceWithRawResponse(self) @@ -133,10 +121,6 @@ def kill( class AsyncInvocationsResource(AsyncAPIResource): - @cached_property - def spans(self) -> AsyncSpansResource: - return AsyncSpansResource(self._client) - @cached_property def with_raw_response(self) -> AsyncInvocationsResourceWithRawResponse: return AsyncInvocationsResourceWithRawResponse(self) @@ -248,10 +232,6 @@ def __init__(self, invocations: InvocationsResource) -> None: invocations.kill, ) - @cached_property - def spans(self) -> SpansResourceWithRawResponse: - return SpansResourceWithRawResponse(self._invocations.spans) - class AsyncInvocationsResourceWithRawResponse: def __init__(self, invocations: AsyncInvocationsResource) -> None: @@ -267,10 +247,6 @@ def __init__(self, invocations: AsyncInvocationsResource) -> None: invocations.kill, ) - @cached_property - def spans(self) -> AsyncSpansResourceWithRawResponse: - return AsyncSpansResourceWithRawResponse(self._invocations.spans) - class InvocationsResourceWithStreamingResponse: def __init__(self, invocations: InvocationsResource) -> None: @@ -286,10 +262,6 @@ def __init__(self, invocations: InvocationsResource) -> None: invocations.kill, ) - @cached_property - def spans(self) -> SpansResourceWithStreamingResponse: - return SpansResourceWithStreamingResponse(self._invocations.spans) - class AsyncInvocationsResourceWithStreamingResponse: def __init__(self, invocations: AsyncInvocationsResource) -> None: @@ -304,7 +276,3 @@ def __init__(self, invocations: AsyncInvocationsResource) -> None: self.kill = async_to_streamed_response_wrapper( invocations.kill, ) - - @cached_property - def spans(self) -> AsyncSpansResourceWithStreamingResponse: - return AsyncSpansResourceWithStreamingResponse(self._invocations.spans) diff --git a/src/runloop_api_client/resources/functions/invocations/spans.py b/src/runloop_api_client/resources/functions/invocations/spans.py deleted file mode 100644 index 3abe920d9..000000000 --- a/src/runloop_api_client/resources/functions/invocations/spans.py +++ /dev/null @@ -1,147 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...._base_client import ( - make_request_options, -) -from ....types.functions.invocations.invocation_span_list_view import InvocationSpanListView - -__all__ = ["SpansResource", "AsyncSpansResource"] - - -class SpansResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> SpansResourceWithRawResponse: - return SpansResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> SpansResourceWithStreamingResponse: - return SpansResourceWithStreamingResponse(self) - - def list( - self, - invocation_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InvocationSpanListView: - """Get the span points for the given invocation. - - This will return the span points - for the invocation. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not invocation_id: - raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}") - return self._get( - f"/v1/functions/invocations/{invocation_id}/spans", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=InvocationSpanListView, - ) - - -class AsyncSpansResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncSpansResourceWithRawResponse: - return AsyncSpansResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncSpansResourceWithStreamingResponse: - return AsyncSpansResourceWithStreamingResponse(self) - - async def list( - self, - invocation_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InvocationSpanListView: - """Get the span points for the given invocation. - - This will return the span points - for the invocation. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not invocation_id: - raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}") - return await self._get( - f"/v1/functions/invocations/{invocation_id}/spans", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=InvocationSpanListView, - ) - - -class SpansResourceWithRawResponse: - def __init__(self, spans: SpansResource) -> None: - self._spans = spans - - self.list = to_raw_response_wrapper( - spans.list, - ) - - -class AsyncSpansResourceWithRawResponse: - def __init__(self, spans: AsyncSpansResource) -> None: - self._spans = spans - - self.list = async_to_raw_response_wrapper( - spans.list, - ) - - -class SpansResourceWithStreamingResponse: - def __init__(self, spans: SpansResource) -> None: - self._spans = spans - - self.list = to_streamed_response_wrapper( - spans.list, - ) - - -class AsyncSpansResourceWithStreamingResponse: - def __init__(self, spans: AsyncSpansResource) -> None: - self._spans = spans - - self.list = async_to_streamed_response_wrapper( - spans.list, - ) diff --git a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py index 94fafc41a..7ecff42c9 100644 --- a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py +++ b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py @@ -8,6 +8,15 @@ class Log(BaseModel): + cmd: Optional[str] = None + """The Command Executed""" + + cmd_id: Optional[str] = None + """Identifier of the associated command the log is sourced from.""" + + exit_code: Optional[int] = None + """The Exit Code of the command""" + level: Optional[str] = None """Log line severity level.""" diff --git a/src/runloop_api_client/types/functions/invocations/__init__.py b/src/runloop_api_client/types/functions/invocations/__init__.py index 4caaf4299..f8ee8b14b 100644 --- a/src/runloop_api_client/types/functions/invocations/__init__.py +++ b/src/runloop_api_client/types/functions/invocations/__init__.py @@ -1,5 +1,3 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations - -from .invocation_span_list_view import InvocationSpanListView as InvocationSpanListView diff --git a/src/runloop_api_client/types/functions/invocations/invocation_span_list_view.py b/src/runloop_api_client/types/functions/invocations/invocation_span_list_view.py deleted file mode 100644 index 786307ae8..000000000 --- a/src/runloop_api_client/types/functions/invocations/invocation_span_list_view.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ...._models import BaseModel - -__all__ = ["InvocationSpanListView"] - - -class InvocationSpanListView(BaseModel): - invocation_id: Optional[str] = FieldInfo(alias="invocationId", default=None) - - spans: Optional[object] = None - """List of spans matching given query.""" diff --git a/tests/api_resources/functions/invocations/test_spans.py b/tests/api_resources/functions/invocations/test_spans.py deleted file mode 100644 index a906a79e7..000000000 --- a/tests/api_resources/functions/invocations/test_spans.py +++ /dev/null @@ -1,98 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.functions.invocations import InvocationSpanListView - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestSpans: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_list(self, client: Runloop) -> None: - span = client.functions.invocations.spans.list( - "string", - ) - assert_matches_type(InvocationSpanListView, span, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Runloop) -> None: - response = client.functions.invocations.spans.with_raw_response.list( - "string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - span = response.parse() - assert_matches_type(InvocationSpanListView, span, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Runloop) -> None: - with client.functions.invocations.spans.with_streaming_response.list( - "string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - span = response.parse() - assert_matches_type(InvocationSpanListView, span, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `invocation_id` but received ''"): - client.functions.invocations.spans.with_raw_response.list( - "", - ) - - -class TestAsyncSpans: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_list(self, async_client: AsyncRunloop) -> None: - span = await async_client.functions.invocations.spans.list( - "string", - ) - assert_matches_type(InvocationSpanListView, span, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: - response = await async_client.functions.invocations.spans.with_raw_response.list( - "string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - span = await response.parse() - assert_matches_type(InvocationSpanListView, span, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: - async with async_client.functions.invocations.spans.with_streaming_response.list( - "string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - span = await response.parse() - assert_matches_type(InvocationSpanListView, span, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `invocation_id` but received ''"): - await async_client.functions.invocations.spans.with_raw_response.list( - "", - ) From 0bf0a07a6fee90a6967da46c201c833de31e8b72 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Jun 2024 20:12:17 +0000 Subject: [PATCH 021/993] feat(api): OpenAPI spec update via Stainless API (#20) --- .stats.yml | 2 +- api.md | 10 +--------- .../resources/devboxes/devboxes.py | 10 +++++++++- src/runloop_api_client/types/__init__.py | 1 + .../types/devbox_execute_sync_params.py | 12 ++++++++++++ tests/api_resources/test_devboxes.py | 16 ++++++++++++++++ 6 files changed, 40 insertions(+), 11 deletions(-) create mode 100644 src/runloop_api_client/types/devbox_execute_sync_params.py diff --git a/.stats.yml b/.stats.yml index 11f149d6a..5484ced01 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1fdc9bae4fba7d365eca69915191a06ab5b0faec74f80404339e92cba37036f7.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ad7847a96db411953d1b7601aa60c0da482335255dd581c26b04d533cc99d930.yml diff --git a/api.md b/api.md index bb7ee2079..92527588e 100644 --- a/api.md +++ b/api.md @@ -17,7 +17,7 @@ Methods: - client.devboxes.create(\*\*params) -> DevboxView - client.devboxes.retrieve(id) -> DevboxView - client.devboxes.list(\*\*params) -> DevboxListView -- client.devboxes.execute_sync(id) -> DevboxExecutionDetailView +- client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.shutdown(id) -> DevboxView ## Logs @@ -60,14 +60,6 @@ Methods: - client.functions.invocations.list() -> FunctionInvocationListView - client.functions.invocations.kill(invocation_id) -> object -### Spans - -Types: - -```python -from runloop_api_client.types.functions.invocations import InvocationSpanListView -``` - # Projects Types: diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2bba79483..f88876d2f 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -14,7 +14,7 @@ LogsResourceWithStreamingResponse, AsyncLogsResourceWithStreamingResponse, ) -from ...types import devbox_list_params, devbox_create_params +from ...types import devbox_list_params, devbox_create_params, devbox_execute_sync_params from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( maybe_transform, @@ -185,6 +185,7 @@ def execute_sync( self, id: str, *, + command: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -196,6 +197,8 @@ def execute_sync( Synchronously execute a command on a devbox Args: + command: The command to execute on the Devbox. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -208,6 +211,7 @@ def execute_sync( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/execute_sync", + body=maybe_transform({"command": command}, devbox_execute_sync_params.DevboxExecuteSyncParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -396,6 +400,7 @@ async def execute_sync( self, id: str, *, + command: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -407,6 +412,8 @@ async def execute_sync( Synchronously execute a command on a devbox Args: + command: The command to execute on the Devbox. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -419,6 +426,7 @@ async def execute_sync( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( f"/v1/devboxes/{id}/execute_sync", + body=await async_maybe_transform({"command": command}, devbox_execute_sync_params.DevboxExecuteSyncParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 8cbd8f02b..f31475c02 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -9,6 +9,7 @@ from .devbox_list_params import DevboxListParams as DevboxListParams from .function_list_view import FunctionListView as FunctionListView from .devbox_create_params import DevboxCreateParams as DevboxCreateParams +from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams from .function_invoke_sync_params import FunctionInvokeSyncParams as FunctionInvokeSyncParams from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams diff --git a/src/runloop_api_client/types/devbox_execute_sync_params.py b/src/runloop_api_client/types/devbox_execute_sync_params.py new file mode 100644 index 000000000..12dbc2e0f --- /dev/null +++ b/src/runloop_api_client/types/devbox_execute_sync_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["DevboxExecuteSyncParams"] + + +class DevboxExecuteSyncParams(TypedDict, total=False): + command: str + """The command to execute on the Devbox.""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index e1bea0100..513112570 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -133,6 +133,14 @@ def test_method_execute_sync(self, client: Runloop) -> None: ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + @parametrize + def test_method_execute_sync_with_all_params(self, client: Runloop) -> None: + devbox = client.devboxes.execute_sync( + "string", + command="string", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + @parametrize def test_raw_response_execute_sync(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.execute_sync( @@ -318,6 +326,14 @@ async def test_method_execute_sync(self, async_client: AsyncRunloop) -> None: ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + @parametrize + async def test_method_execute_sync_with_all_params(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.execute_sync( + "string", + command="string", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + @parametrize async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.execute_sync( From 2c723b12a2c8760f63a59a0654987997b682ee51 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 3 Jul 2024 01:12:17 +0000 Subject: [PATCH 022/993] feat(api): OpenAPI spec update via Stainless API (#21) --- .gitignore | 1 + .stats.yml | 2 +- pyproject.toml | 16 +++++++++ requirements-dev.lock | 10 +++++- requirements.lock | 3 +- src/runloop_api_client/_base_client.py | 20 +++++++++-- src/runloop_api_client/_models.py | 27 +++++++++++++++ src/runloop_api_client/_utils/__init__.py | 5 ++- src/runloop_api_client/_utils/_reflection.py | 34 +++++++++++++++++++ .../resources/devboxes/devboxes.py | 8 +++++ .../types/devbox_create_params.py | 3 ++ src/runloop_api_client/types/devbox_view.py | 3 ++ .../types/devboxes/devbox_logs_list_view.py | 4 +++ tests/api_resources/test_devboxes.py | 2 ++ 14 files changed, 132 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 0f9a66a97..877974080 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.prism.log .vscode _dev diff --git a/.stats.yml b/.stats.yml index 5484ced01..abad5da29 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ad7847a96db411953d1b7601aa60c0da482335255dd581c26b04d533cc99d930.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ce4dc6d4d8a6587f304abdd5adf686e08612cab1c5f1cae3cdf8e20ff4a98d2b.yml diff --git a/pyproject.toml b/pyproject.toml index d77d92bc3..b4626fab8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,6 +58,7 @@ dev-dependencies = [ "nox", "dirty-equals>=0.6.0", "importlib-metadata>=6.7.0", + "rich>=13.7.1", ] @@ -99,6 +100,21 @@ include = [ [tool.hatch.build.targets.wheel] packages = ["src/runloop_api_client"] +[tool.hatch.build.targets.sdist] +# Basically everything except hidden files/directories (such as .github, .devcontainers, .python-version, etc) +include = [ + "/*.toml", + "/*.json", + "/*.lock", + "/*.md", + "/mypy.ini", + "/noxfile.py", + "bin/*", + "examples/*", + "src/*", + "tests/*", +] + [tool.hatch.metadata.hooks.fancy-pypi-readme] content-type = "text/markdown" diff --git a/requirements-dev.lock b/requirements-dev.lock index 0852c56d1..18a7b48a4 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -10,7 +10,7 @@ -e file:. annotated-types==0.6.0 # via pydantic -anyio==4.1.0 +anyio==4.4.0 # via httpx # via runloop-api-client argcomplete==3.1.2 @@ -44,6 +44,10 @@ idna==3.4 importlib-metadata==7.0.0 iniconfig==2.0.0 # via pytest +markdown-it-py==3.0.0 + # via rich +mdurl==0.1.2 + # via markdown-it-py mypy==1.7.1 mypy-extensions==1.0.0 # via mypy @@ -63,6 +67,8 @@ pydantic==2.7.1 # via runloop-api-client pydantic-core==2.18.2 # via pydantic +pygments==2.18.0 + # via rich pyright==1.1.364 pytest==7.1.1 # via pytest-asyncio @@ -72,6 +78,7 @@ python-dateutil==2.8.2 pytz==2023.3.post1 # via dirty-equals respx==0.20.2 +rich==13.7.1 ruff==0.1.9 setuptools==68.2.2 # via nodeenv @@ -86,6 +93,7 @@ tomli==2.0.1 # via mypy # via pytest typing-extensions==4.8.0 + # via anyio # via mypy # via pydantic # via pydantic-core diff --git a/requirements.lock b/requirements.lock index 70c5bb66c..4b4984989 100644 --- a/requirements.lock +++ b/requirements.lock @@ -10,7 +10,7 @@ -e file:. annotated-types==0.6.0 # via pydantic -anyio==4.1.0 +anyio==4.4.0 # via httpx # via runloop-api-client certifi==2023.7.22 @@ -38,6 +38,7 @@ sniffio==1.3.0 # via httpx # via runloop-api-client typing-extensions==4.8.0 + # via anyio # via pydantic # via pydantic-core # via runloop-api-client diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index 7e585689b..8537b9733 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -58,6 +58,7 @@ HttpxSendArgs, AsyncTransport, RequestOptions, + HttpxRequestFiles, ModelBuilderProtocol, ) from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping @@ -459,6 +460,7 @@ def _build_request( headers = self._build_headers(options) params = _merge_mappings(self.default_query, options.params) content_type = headers.get("Content-Type") + files = options.files # If the given Content-Type header is multipart/form-data then it # has to be removed so that httpx can generate the header with @@ -472,7 +474,7 @@ def _build_request( headers.pop("Content-Type") # As we are now sending multipart/form-data instead of application/json - # we need to tell httpx to use it, https://www.python-httpx.org/advanced/#multipart-file-encoding + # we need to tell httpx to use it, https://www.python-httpx.org/advanced/clients/#multipart-file-encoding if json_data: if not is_dict(json_data): raise TypeError( @@ -480,6 +482,15 @@ def _build_request( ) kwargs["data"] = self._serialize_multipartform(json_data) + # httpx determines whether or not to send a "multipart/form-data" + # request based on the truthiness of the "files" argument. + # This gets around that issue by generating a dict value that + # evaluates to true. + # + # https://github.com/encode/httpx/discussions/2399#discussioncomment-3814186 + if not files: + files = cast(HttpxRequestFiles, ForceMultipartDict()) + # TODO: report this error to httpx return self._client.build_request( # pyright: ignore[reportUnknownMemberType] headers=headers, @@ -492,7 +503,7 @@ def _build_request( # https://github.com/microsoft/pyright/issues/3526#event-6715453066 params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None, json=json_data, - files=options.files, + files=files, **kwargs, ) @@ -1863,6 +1874,11 @@ def make_request_options( return options +class ForceMultipartDict(Dict[str, None]): + def __bool__(self) -> bool: + return True + + class OtherPlatform: def __init__(self, name: str) -> None: self.name = name diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index 75c68cc73..5d95bb4b2 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -10,6 +10,7 @@ ClassVar, Protocol, Required, + ParamSpec, TypedDict, TypeGuard, final, @@ -67,6 +68,9 @@ __all__ = ["BaseModel", "GenericModel"] _T = TypeVar("_T") +_BaseModelT = TypeVar("_BaseModelT", bound="BaseModel") + +P = ParamSpec("P") @runtime_checkable @@ -379,6 +383,29 @@ def is_basemodel_type(type_: type) -> TypeGuard[type[BaseModel] | type[GenericMo return issubclass(origin, BaseModel) or issubclass(origin, GenericModel) +def build( + base_model_cls: Callable[P, _BaseModelT], + *args: P.args, + **kwargs: P.kwargs, +) -> _BaseModelT: + """Construct a BaseModel class without validation. + + This is useful for cases where you need to instantiate a `BaseModel` + from an API response as this provides type-safe params which isn't supported + by helpers like `construct_type()`. + + ```py + build(MyModel, my_field_a="foo", my_field_b=123) + ``` + """ + if args: + raise TypeError( + "Received positional arguments which are not supported; Keyword arguments must be used instead", + ) + + return cast(_BaseModelT, construct_type(type_=base_model_cls, value=kwargs)) + + def construct_type(*, value: object, type_: object) -> object: """Loose coercion to the expected type with construction of nested values. diff --git a/src/runloop_api_client/_utils/__init__.py b/src/runloop_api_client/_utils/__init__.py index 667e2473f..3efe66c8e 100644 --- a/src/runloop_api_client/_utils/__init__.py +++ b/src/runloop_api_client/_utils/__init__.py @@ -49,4 +49,7 @@ maybe_transform as maybe_transform, async_maybe_transform as async_maybe_transform, ) -from ._reflection import function_has_argument as function_has_argument +from ._reflection import ( + function_has_argument as function_has_argument, + assert_signatures_in_sync as assert_signatures_in_sync, +) diff --git a/src/runloop_api_client/_utils/_reflection.py b/src/runloop_api_client/_utils/_reflection.py index e134f58e0..9a53c7bd2 100644 --- a/src/runloop_api_client/_utils/_reflection.py +++ b/src/runloop_api_client/_utils/_reflection.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import inspect from typing import Any, Callable @@ -6,3 +8,35 @@ def function_has_argument(func: Callable[..., Any], arg_name: str) -> bool: """Returns whether or not the given function has a specific parameter""" sig = inspect.signature(func) return arg_name in sig.parameters + + +def assert_signatures_in_sync( + source_func: Callable[..., Any], + check_func: Callable[..., Any], + *, + exclude_params: set[str] = set(), +) -> None: + """Ensure that the signature of the second function matches the first.""" + + check_sig = inspect.signature(check_func) + source_sig = inspect.signature(source_func) + + errors: list[str] = [] + + for name, source_param in source_sig.parameters.items(): + if name in exclude_params: + continue + + custom_param = check_sig.parameters.get(name) + if not custom_param: + errors.append(f"the `{name}` param is missing") + continue + + if custom_param.annotation != source_param.annotation: + errors.append( + f"types for the `{name}` param are do not match; source={repr(source_param.annotation)} checking={repr(source_param.annotation)}" + ) + continue + + if errors: + raise AssertionError(f"{len(errors)} errors encountered when comparing signatures:\n\n" + "\n\n".join(errors)) diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index f88876d2f..7d03a0706 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -57,6 +57,7 @@ def create( code_handle: str | NotGiven = NOT_GIVEN, entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -79,6 +80,8 @@ def create( environment_variables: (Optional) Environment variables used to configure your Devbox. + name: (Optional) A user specified name to give the Devbox. + setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include fetching a tool or building your dependencies. Runloop will look optimize these steps for you. @@ -98,6 +101,7 @@ def create( "code_handle": code_handle, "entrypoint": entrypoint, "environment_variables": environment_variables, + "name": name, "setup_commands": setup_commands, }, devbox_create_params.DevboxCreateParams, @@ -272,6 +276,7 @@ async def create( code_handle: str | NotGiven = NOT_GIVEN, entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -294,6 +299,8 @@ async def create( environment_variables: (Optional) Environment variables used to configure your Devbox. + name: (Optional) A user specified name to give the Devbox. + setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include fetching a tool or building your dependencies. Runloop will look optimize these steps for you. @@ -313,6 +320,7 @@ async def create( "code_handle": code_handle, "entrypoint": entrypoint, "environment_variables": environment_variables, + "name": name, "setup_commands": setup_commands, }, devbox_create_params.DevboxCreateParams, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 588469cf4..49834e010 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -22,6 +22,9 @@ class DevboxCreateParams(TypedDict, total=False): environment_variables: Dict[str, str] """(Optional) Environment variables used to configure your Devbox.""" + name: str + """(Optional) A user specified name to give the Devbox.""" + setup_commands: List[str] """(Optional) List of commands needed to set up your Devbox. diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 826b180e9..5dec94295 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -14,6 +14,9 @@ class DevboxView(BaseModel): create_time_ms: Optional[int] = None """Creation time of the Devbox (Unix timestamp milliseconds).""" + name: Optional[str] = None + """The name of the Devbox.""" + status: Optional[str] = None """ The current status of the Devbox (provisioning, initializing, running, failure, diff --git a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py index 7ecff42c9..e73fec580 100644 --- a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py +++ b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional +from typing_extensions import Literal from ..._models import BaseModel @@ -23,6 +24,9 @@ class Log(BaseModel): message: Optional[str] = None """Log line message.""" + source: Optional[Literal["setup_commands", "entrypoint", "exec"]] = None + """The source of the log.""" + timestamp_ms: Optional[int] = None """Time of log (Unix timestamp milliseconds).""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 513112570..b6940e903 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -32,6 +32,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: code_handle="string", entrypoint="string", environment_variables={"foo": "string"}, + name="string", setup_commands=["string", "string", "string"], ) assert_matches_type(DevboxView, devbox, path=["response"]) @@ -225,6 +226,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - code_handle="string", entrypoint="string", environment_variables={"foo": "string"}, + name="string", setup_commands=["string", "string", "string"], ) assert_matches_type(DevboxView, devbox, path=["response"]) From 04735c2e9f734cc35c568ac37a3bfb4ec9d3a8db Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 3 Jul 2024 15:27:26 +0000 Subject: [PATCH 023/993] feat(api): OpenAPI spec update via Stainless API (#22) --- src/runloop_api_client/_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index 42f5a0422..11b16c4a1 100644 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -93,7 +93,7 @@ def __init__( if base_url is None: base_url = os.environ.get("RUNLOOP_BASE_URL") if base_url is None: - base_url = f"https://api.runloop.pro" + base_url = f"https://api.runloop.ai" super().__init__( version=__version__, @@ -265,7 +265,7 @@ def __init__( if base_url is None: base_url = os.environ.get("RUNLOOP_BASE_URL") if base_url is None: - base_url = f"https://api.runloop.pro" + base_url = f"https://api.runloop.ai" super().__init__( version=__version__, From 4a4e340da3c6e97116711fdd9ccc72beb51587a5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:28:40 +0000 Subject: [PATCH 024/993] chore(internal): version bump (#23) --- .devcontainer/Dockerfile | 2 +- .github/workflows/ci.yml | 5 +- .github/workflows/publish-pypi.yml | 4 +- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- requirements-dev.lock | 3 +- requirements.lock | 1 + src/runloop_api_client/_base_client.py | 22 +++-- src/runloop_api_client/_models.py | 8 ++ src/runloop_api_client/_version.py | 2 +- .../resources/devboxes/devboxes.py | 4 +- .../resources/devboxes/logs.py | 4 +- .../resources/functions/functions.py | 4 +- .../functions/invocations/invocations.py | 4 +- .../resources/projects/logs.py | 4 +- .../resources/projects/projects.py | 4 +- tests/api_resources/devboxes/test_logs.py | 12 +-- .../functions/test_invocations.py | 24 ++--- tests/api_resources/projects/test_logs.py | 12 +-- tests/api_resources/test_devboxes.py | 64 ++++++------- tests/api_resources/test_functions.py | 96 +++++++++---------- 21 files changed, 146 insertions(+), 137 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 83bca8f71..ac9a2e752 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -3,7 +3,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} USER vscode -RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.24.0" RYE_INSTALL_OPTION="--yes" bash +RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.35.0" RYE_INSTALL_OPTION="--yes" bash ENV PATH=/home/vscode/.rye/shims:$PATH RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c339440b..40293964f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,7 @@ on: pull_request: branches: - main + - next jobs: lint: @@ -21,7 +22,7 @@ jobs: curl -sSf https://rye.astral.sh/get | bash echo "$HOME/.rye/shims" >> $GITHUB_PATH env: - RYE_VERSION: 0.24.0 + RYE_VERSION: '0.35.0' RYE_INSTALL_OPTION: '--yes' - name: Install dependencies @@ -41,7 +42,7 @@ jobs: curl -sSf https://rye.astral.sh/get | bash echo "$HOME/.rye/shims" >> $GITHUB_PATH env: - RYE_VERSION: 0.24.0 + RYE_VERSION: '0.35.0' RYE_INSTALL_OPTION: '--yes' - name: Bootstrap diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 065780d52..a56e643fb 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -21,8 +21,8 @@ jobs: curl -sSf https://rye.astral.sh/get | bash echo "$HOME/.rye/shims" >> $GITHUB_PATH env: - RYE_VERSION: 0.24.0 - RYE_INSTALL_OPTION: "--yes" + RYE_VERSION: '0.35.0' + RYE_INSTALL_OPTION: '--yes' - name: Publish to PyPI run: | diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b56c3d0b4..e8285b710 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.4" + ".": "0.1.0-alpha.5" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index b4626fab8..6f0a42419 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.1.0-alpha.4" +version = "0.1.0-alpha.5" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/requirements-dev.lock b/requirements-dev.lock index 18a7b48a4..e5f8ae596 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -6,6 +6,7 @@ # features: [] # all-features: true # with-sources: false +# generate-hashes: false -e file:. annotated-types==0.6.0 @@ -48,7 +49,7 @@ markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py -mypy==1.7.1 +mypy==1.10.1 mypy-extensions==1.0.0 # via mypy nodeenv==1.8.0 diff --git a/requirements.lock b/requirements.lock index 4b4984989..40847b24e 100644 --- a/requirements.lock +++ b/requirements.lock @@ -6,6 +6,7 @@ # features: [] # all-features: true # with-sources: false +# generate-hashes: false -e file:. annotated-types==0.6.0 diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index 8537b9733..fddf6e7e8 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -955,6 +955,11 @@ def _request( stream: bool, stream_cls: type[_StreamT] | None, ) -> ResponseT | _StreamT: + # create a copy of the options we were given so that if the + # options are mutated later & we then retry, the retries are + # given the original options + input_options = model_copy(options) + cast_to = self._maybe_override_cast_to(cast_to, options) self._prepare_options(options) @@ -979,7 +984,7 @@ def _request( if retries > 0: return self._retry_request( - options, + input_options, cast_to, retries, stream=stream, @@ -994,7 +999,7 @@ def _request( if retries > 0: return self._retry_request( - options, + input_options, cast_to, retries, stream=stream, @@ -1022,7 +1027,7 @@ def _request( if retries > 0 and self._should_retry(err.response): err.response.close() return self._retry_request( - options, + input_options, cast_to, retries, err.response.headers, @@ -1518,6 +1523,11 @@ async def _request( # execute it earlier while we are in an async context self._platform = await asyncify(get_platform)() + # create a copy of the options we were given so that if the + # options are mutated later & we then retry, the retries are + # given the original options + input_options = model_copy(options) + cast_to = self._maybe_override_cast_to(cast_to, options) await self._prepare_options(options) @@ -1540,7 +1550,7 @@ async def _request( if retries > 0: return await self._retry_request( - options, + input_options, cast_to, retries, stream=stream, @@ -1555,7 +1565,7 @@ async def _request( if retries > 0: return await self._retry_request( - options, + input_options, cast_to, retries, stream=stream, @@ -1578,7 +1588,7 @@ async def _request( if retries > 0 and self._should_retry(err.response): await err.response.aclose() return await self._retry_request( - options, + input_options, cast_to, retries, err.response.headers, diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index 5d95bb4b2..eb7ce3bde 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -643,6 +643,14 @@ def validate_type(*, type_: type[_T], value: object) -> _T: return cast(_T, _validate_non_model_type(type_=type_, value=value)) +def set_pydantic_config(typ: Any, config: pydantic.ConfigDict) -> None: + """Add a pydantic config for the given type. + + Note: this is a no-op on Pydantic v1. + """ + setattr(typ, "__pydantic_config__", config) # noqa: B010 + + # our use of subclasssing here causes weirdness for type checkers, # so we just pretend that we don't subclass if TYPE_CHECKING: diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 23a34c2b2..8cdc8ca05 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.1.0-alpha.4" # x-release-please-version +__version__ = "0.1.0-alpha.5" # x-release-please-version diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 7d03a0706..24fbd2ed2 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -28,9 +28,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._base_client import ( - make_request_options, -) +from ..._base_client import make_request_options from ...types.devbox_view import DevboxView from ...types.devbox_list_view import DevboxListView from ...types.devbox_execution_detail_view import DevboxExecutionDetailView diff --git a/src/runloop_api_client/resources/devboxes/logs.py b/src/runloop_api_client/resources/devboxes/logs.py index 327001503..cabe8f329 100644 --- a/src/runloop_api_client/resources/devboxes/logs.py +++ b/src/runloop_api_client/resources/devboxes/logs.py @@ -13,9 +13,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._base_client import ( - make_request_options, -) +from ..._base_client import make_request_options from ...types.devboxes.devbox_logs_list_view import DevboxLogsListView __all__ = ["LogsResource", "AsyncLogsResource"] diff --git a/src/runloop_api_client/resources/functions/functions.py b/src/runloop_api_client/resources/functions/functions.py index 2596889f8..b906d0ad3 100644 --- a/src/runloop_api_client/resources/functions/functions.py +++ b/src/runloop_api_client/resources/functions/functions.py @@ -26,9 +26,7 @@ InvocationsResourceWithStreamingResponse, AsyncInvocationsResourceWithStreamingResponse, ) -from ..._base_client import ( - make_request_options, -) +from ..._base_client import make_request_options from .invocations.invocations import InvocationsResource, AsyncInvocationsResource from ...types.function_list_view import FunctionListView from ...types.shared.function_invocation_detail_view import FunctionInvocationDetailView diff --git a/src/runloop_api_client/resources/functions/invocations/invocations.py b/src/runloop_api_client/resources/functions/invocations/invocations.py index 3130b0976..8307e4f6d 100644 --- a/src/runloop_api_client/resources/functions/invocations/invocations.py +++ b/src/runloop_api_client/resources/functions/invocations/invocations.py @@ -13,9 +13,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._base_client import ( - make_request_options, -) +from ...._base_client import make_request_options from ....types.shared.function_invocation_detail_view import FunctionInvocationDetailView from ....types.functions.function_invocation_list_view import FunctionInvocationListView diff --git a/src/runloop_api_client/resources/projects/logs.py b/src/runloop_api_client/resources/projects/logs.py index b6248ab52..e7f7269f0 100644 --- a/src/runloop_api_client/resources/projects/logs.py +++ b/src/runloop_api_client/resources/projects/logs.py @@ -13,9 +13,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._base_client import ( - make_request_options, -) +from ..._base_client import make_request_options from ...types.shared.project_logs_view import ProjectLogsView __all__ = ["LogsResource", "AsyncLogsResource"] diff --git a/src/runloop_api_client/resources/projects/projects.py b/src/runloop_api_client/resources/projects/projects.py index 57d3ba365..5ec9208c0 100644 --- a/src/runloop_api_client/resources/projects/projects.py +++ b/src/runloop_api_client/resources/projects/projects.py @@ -21,9 +21,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._base_client import ( - make_request_options, -) +from ..._base_client import make_request_options from ...types.project_list_view import ProjectListView __all__ = ["ProjectsResource", "AsyncProjectsResource"] diff --git a/tests/api_resources/devboxes/test_logs.py b/tests/api_resources/devboxes/test_logs.py index d7549b724..85ea9be84 100644 --- a/tests/api_resources/devboxes/test_logs.py +++ b/tests/api_resources/devboxes/test_logs.py @@ -20,14 +20,14 @@ class TestLogs: @parametrize def test_method_list(self, client: Runloop) -> None: log = client.devboxes.logs.list( - "string", + "id", ) assert_matches_type(DevboxLogsListView, log, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: response = client.devboxes.logs.with_raw_response.list( - "string", + "id", ) assert response.is_closed is True @@ -38,7 +38,7 @@ def test_raw_response_list(self, client: Runloop) -> None: @parametrize def test_streaming_response_list(self, client: Runloop) -> None: with client.devboxes.logs.with_streaming_response.list( - "string", + "id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -62,14 +62,14 @@ class TestAsyncLogs: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: log = await async_client.devboxes.logs.list( - "string", + "id", ) assert_matches_type(DevboxLogsListView, log, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.logs.with_raw_response.list( - "string", + "id", ) assert response.is_closed is True @@ -80,7 +80,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.logs.with_streaming_response.list( - "string", + "id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/functions/test_invocations.py b/tests/api_resources/functions/test_invocations.py index f1592f045..69bb4a269 100644 --- a/tests/api_resources/functions/test_invocations.py +++ b/tests/api_resources/functions/test_invocations.py @@ -21,14 +21,14 @@ class TestInvocations: @parametrize def test_method_retrieve(self, client: Runloop) -> None: invocation = client.functions.invocations.retrieve( - "string", + "invocationId", ) assert_matches_type(FunctionInvocationDetailView, invocation, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Runloop) -> None: response = client.functions.invocations.with_raw_response.retrieve( - "string", + "invocationId", ) assert response.is_closed is True @@ -39,7 +39,7 @@ def test_raw_response_retrieve(self, client: Runloop) -> None: @parametrize def test_streaming_response_retrieve(self, client: Runloop) -> None: with client.functions.invocations.with_streaming_response.retrieve( - "string", + "invocationId", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -84,14 +84,14 @@ def test_streaming_response_list(self, client: Runloop) -> None: @parametrize def test_method_kill(self, client: Runloop) -> None: invocation = client.functions.invocations.kill( - "string", + "invocationId", ) assert_matches_type(object, invocation, path=["response"]) @parametrize def test_raw_response_kill(self, client: Runloop) -> None: response = client.functions.invocations.with_raw_response.kill( - "string", + "invocationId", ) assert response.is_closed is True @@ -102,7 +102,7 @@ def test_raw_response_kill(self, client: Runloop) -> None: @parametrize def test_streaming_response_kill(self, client: Runloop) -> None: with client.functions.invocations.with_streaming_response.kill( - "string", + "invocationId", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -126,14 +126,14 @@ class TestAsyncInvocations: @parametrize async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: invocation = await async_client.functions.invocations.retrieve( - "string", + "invocationId", ) assert_matches_type(FunctionInvocationDetailView, invocation, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: response = await async_client.functions.invocations.with_raw_response.retrieve( - "string", + "invocationId", ) assert response.is_closed is True @@ -144,7 +144,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: async with async_client.functions.invocations.with_streaming_response.retrieve( - "string", + "invocationId", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -189,14 +189,14 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None @parametrize async def test_method_kill(self, async_client: AsyncRunloop) -> None: invocation = await async_client.functions.invocations.kill( - "string", + "invocationId", ) assert_matches_type(object, invocation, path=["response"]) @parametrize async def test_raw_response_kill(self, async_client: AsyncRunloop) -> None: response = await async_client.functions.invocations.with_raw_response.kill( - "string", + "invocationId", ) assert response.is_closed is True @@ -207,7 +207,7 @@ async def test_raw_response_kill(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_kill(self, async_client: AsyncRunloop) -> None: async with async_client.functions.invocations.with_streaming_response.kill( - "string", + "invocationId", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/projects/test_logs.py b/tests/api_resources/projects/test_logs.py index 81d5ed8ea..d907ef5ad 100644 --- a/tests/api_resources/projects/test_logs.py +++ b/tests/api_resources/projects/test_logs.py @@ -20,14 +20,14 @@ class TestLogs: @parametrize def test_method_list(self, client: Runloop) -> None: log = client.projects.logs.list( - "string", + "id", ) assert_matches_type(ProjectLogsView, log, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: response = client.projects.logs.with_raw_response.list( - "string", + "id", ) assert response.is_closed is True @@ -38,7 +38,7 @@ def test_raw_response_list(self, client: Runloop) -> None: @parametrize def test_streaming_response_list(self, client: Runloop) -> None: with client.projects.logs.with_streaming_response.list( - "string", + "id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -62,14 +62,14 @@ class TestAsyncLogs: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: log = await async_client.projects.logs.list( - "string", + "id", ) assert_matches_type(ProjectLogsView, log, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: response = await async_client.projects.logs.with_raw_response.list( - "string", + "id", ) assert response.is_closed is True @@ -80,7 +80,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: async with async_client.projects.logs.with_streaming_response.list( - "string", + "id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index b6940e903..915f875a7 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -29,10 +29,10 @@ def test_method_create(self, client: Runloop) -> None: @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.create( - code_handle="string", - entrypoint="string", + code_handle="code_handle", + entrypoint="entrypoint", environment_variables={"foo": "string"}, - name="string", + name="name", setup_commands=["string", "string", "string"], ) assert_matches_type(DevboxView, devbox, path=["response"]) @@ -60,14 +60,14 @@ def test_streaming_response_create(self, client: Runloop) -> None: @parametrize def test_method_retrieve(self, client: Runloop) -> None: devbox = client.devboxes.retrieve( - "string", + "id", ) assert_matches_type(DevboxView, devbox, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.retrieve( - "string", + "id", ) assert response.is_closed is True @@ -78,7 +78,7 @@ def test_raw_response_retrieve(self, client: Runloop) -> None: @parametrize def test_streaming_response_retrieve(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.retrieve( - "string", + "id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -103,7 +103,7 @@ def test_method_list(self, client: Runloop) -> None: @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.list( - status="string", + status="status", ) assert_matches_type(DevboxListView, devbox, path=["response"]) @@ -130,22 +130,22 @@ def test_streaming_response_list(self, client: Runloop) -> None: @parametrize def test_method_execute_sync(self, client: Runloop) -> None: devbox = client.devboxes.execute_sync( - "string", + id="id", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize def test_method_execute_sync_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.execute_sync( - "string", - command="string", + id="id", + command="command", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize def test_raw_response_execute_sync(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.execute_sync( - "string", + id="id", ) assert response.is_closed is True @@ -156,7 +156,7 @@ def test_raw_response_execute_sync(self, client: Runloop) -> None: @parametrize def test_streaming_response_execute_sync(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.execute_sync( - "string", + id="id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -170,20 +170,20 @@ def test_streaming_response_execute_sync(self, client: Runloop) -> None: def test_path_params_execute_sync(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.with_raw_response.execute_sync( - "", + id="", ) @parametrize def test_method_shutdown(self, client: Runloop) -> None: devbox = client.devboxes.shutdown( - "string", + "id", ) assert_matches_type(DevboxView, devbox, path=["response"]) @parametrize def test_raw_response_shutdown(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.shutdown( - "string", + "id", ) assert response.is_closed is True @@ -194,7 +194,7 @@ def test_raw_response_shutdown(self, client: Runloop) -> None: @parametrize def test_streaming_response_shutdown(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.shutdown( - "string", + "id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -223,10 +223,10 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.create( - code_handle="string", - entrypoint="string", + code_handle="code_handle", + entrypoint="entrypoint", environment_variables={"foo": "string"}, - name="string", + name="name", setup_commands=["string", "string", "string"], ) assert_matches_type(DevboxView, devbox, path=["response"]) @@ -254,14 +254,14 @@ async def test_streaming_response_create(self, async_client: AsyncRunloop) -> No @parametrize async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.retrieve( - "string", + "id", ) assert_matches_type(DevboxView, devbox, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.retrieve( - "string", + "id", ) assert response.is_closed is True @@ -272,7 +272,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.retrieve( - "string", + "id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -297,7 +297,7 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.list( - status="string", + status="status", ) assert_matches_type(DevboxListView, devbox, path=["response"]) @@ -324,22 +324,22 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None @parametrize async def test_method_execute_sync(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.execute_sync( - "string", + id="id", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize async def test_method_execute_sync_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.execute_sync( - "string", - command="string", + id="id", + command="command", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.execute_sync( - "string", + id="id", ) assert response.is_closed is True @@ -350,7 +350,7 @@ async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> No @parametrize async def test_streaming_response_execute_sync(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.execute_sync( - "string", + id="id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -364,20 +364,20 @@ async def test_streaming_response_execute_sync(self, async_client: AsyncRunloop) async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.with_raw_response.execute_sync( - "", + id="", ) @parametrize async def test_method_shutdown(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.shutdown( - "string", + "id", ) assert_matches_type(DevboxView, devbox, path=["response"]) @parametrize async def test_raw_response_shutdown(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.shutdown( - "string", + "id", ) assert response.is_closed is True @@ -388,7 +388,7 @@ async def test_raw_response_shutdown(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_shutdown(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.shutdown( - "string", + "id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_functions.py b/tests/api_resources/test_functions.py index 800cb7b6d..0c8634c5f 100644 --- a/tests/api_resources/test_functions.py +++ b/tests/api_resources/test_functions.py @@ -46,8 +46,8 @@ def test_streaming_response_list(self, client: Runloop) -> None: @parametrize def test_method_invoke_async(self, client: Runloop) -> None: function = client.functions.invoke_async( - "string", - project_name="string", + function_name="function_name", + project_name="project_name", request={}, ) assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) @@ -55,18 +55,18 @@ def test_method_invoke_async(self, client: Runloop) -> None: @parametrize def test_method_invoke_async_with_all_params(self, client: Runloop) -> None: function = client.functions.invoke_async( - "string", - project_name="string", + function_name="function_name", + project_name="project_name", request={}, - runloop_meta={"session_id": "string"}, + runloop_meta={"session_id": "session_id"}, ) assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) @parametrize def test_raw_response_invoke_async(self, client: Runloop) -> None: response = client.functions.with_raw_response.invoke_async( - "string", - project_name="string", + function_name="function_name", + project_name="project_name", request={}, ) @@ -78,8 +78,8 @@ def test_raw_response_invoke_async(self, client: Runloop) -> None: @parametrize def test_streaming_response_invoke_async(self, client: Runloop) -> None: with client.functions.with_streaming_response.invoke_async( - "string", - project_name="string", + function_name="function_name", + project_name="project_name", request={}, ) as response: assert not response.is_closed @@ -94,23 +94,23 @@ def test_streaming_response_invoke_async(self, client: Runloop) -> None: def test_path_params_invoke_async(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): client.functions.with_raw_response.invoke_async( - "string", + function_name="function_name", project_name="", request={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): client.functions.with_raw_response.invoke_async( - "", - project_name="string", + function_name="", + project_name="project_name", request={}, ) @parametrize def test_method_invoke_sync(self, client: Runloop) -> None: function = client.functions.invoke_sync( - "string", - project_name="string", + function_name="function_name", + project_name="project_name", request={}, ) assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) @@ -118,18 +118,18 @@ def test_method_invoke_sync(self, client: Runloop) -> None: @parametrize def test_method_invoke_sync_with_all_params(self, client: Runloop) -> None: function = client.functions.invoke_sync( - "string", - project_name="string", + function_name="function_name", + project_name="project_name", request={}, - runloop_meta={"session_id": "string"}, + runloop_meta={"session_id": "session_id"}, ) assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) @parametrize def test_raw_response_invoke_sync(self, client: Runloop) -> None: response = client.functions.with_raw_response.invoke_sync( - "string", - project_name="string", + function_name="function_name", + project_name="project_name", request={}, ) @@ -141,8 +141,8 @@ def test_raw_response_invoke_sync(self, client: Runloop) -> None: @parametrize def test_streaming_response_invoke_sync(self, client: Runloop) -> None: with client.functions.with_streaming_response.invoke_sync( - "string", - project_name="string", + function_name="function_name", + project_name="project_name", request={}, ) as response: assert not response.is_closed @@ -157,15 +157,15 @@ def test_streaming_response_invoke_sync(self, client: Runloop) -> None: def test_path_params_invoke_sync(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): client.functions.with_raw_response.invoke_sync( - "string", + function_name="function_name", project_name="", request={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): client.functions.with_raw_response.invoke_sync( - "", - project_name="string", + function_name="", + project_name="project_name", request={}, ) @@ -201,8 +201,8 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None @parametrize async def test_method_invoke_async(self, async_client: AsyncRunloop) -> None: function = await async_client.functions.invoke_async( - "string", - project_name="string", + function_name="function_name", + project_name="project_name", request={}, ) assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) @@ -210,18 +210,18 @@ async def test_method_invoke_async(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_invoke_async_with_all_params(self, async_client: AsyncRunloop) -> None: function = await async_client.functions.invoke_async( - "string", - project_name="string", + function_name="function_name", + project_name="project_name", request={}, - runloop_meta={"session_id": "string"}, + runloop_meta={"session_id": "session_id"}, ) assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) @parametrize async def test_raw_response_invoke_async(self, async_client: AsyncRunloop) -> None: response = await async_client.functions.with_raw_response.invoke_async( - "string", - project_name="string", + function_name="function_name", + project_name="project_name", request={}, ) @@ -233,8 +233,8 @@ async def test_raw_response_invoke_async(self, async_client: AsyncRunloop) -> No @parametrize async def test_streaming_response_invoke_async(self, async_client: AsyncRunloop) -> None: async with async_client.functions.with_streaming_response.invoke_async( - "string", - project_name="string", + function_name="function_name", + project_name="project_name", request={}, ) as response: assert not response.is_closed @@ -249,23 +249,23 @@ async def test_streaming_response_invoke_async(self, async_client: AsyncRunloop) async def test_path_params_invoke_async(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): await async_client.functions.with_raw_response.invoke_async( - "string", + function_name="function_name", project_name="", request={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): await async_client.functions.with_raw_response.invoke_async( - "", - project_name="string", + function_name="", + project_name="project_name", request={}, ) @parametrize async def test_method_invoke_sync(self, async_client: AsyncRunloop) -> None: function = await async_client.functions.invoke_sync( - "string", - project_name="string", + function_name="function_name", + project_name="project_name", request={}, ) assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) @@ -273,18 +273,18 @@ async def test_method_invoke_sync(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_invoke_sync_with_all_params(self, async_client: AsyncRunloop) -> None: function = await async_client.functions.invoke_sync( - "string", - project_name="string", + function_name="function_name", + project_name="project_name", request={}, - runloop_meta={"session_id": "string"}, + runloop_meta={"session_id": "session_id"}, ) assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) @parametrize async def test_raw_response_invoke_sync(self, async_client: AsyncRunloop) -> None: response = await async_client.functions.with_raw_response.invoke_sync( - "string", - project_name="string", + function_name="function_name", + project_name="project_name", request={}, ) @@ -296,8 +296,8 @@ async def test_raw_response_invoke_sync(self, async_client: AsyncRunloop) -> Non @parametrize async def test_streaming_response_invoke_sync(self, async_client: AsyncRunloop) -> None: async with async_client.functions.with_streaming_response.invoke_sync( - "string", - project_name="string", + function_name="function_name", + project_name="project_name", request={}, ) as response: assert not response.is_closed @@ -312,14 +312,14 @@ async def test_streaming_response_invoke_sync(self, async_client: AsyncRunloop) async def test_path_params_invoke_sync(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): await async_client.functions.with_raw_response.invoke_sync( - "string", + function_name="function_name", project_name="", request={}, ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): await async_client.functions.with_raw_response.invoke_sync( - "", - project_name="string", + function_name="", + project_name="project_name", request={}, ) From c376ae3fa550ffce29922d304c67cf904eb0e4d5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 23:12:22 +0000 Subject: [PATCH 025/993] feat(api): OpenAPI spec update via Stainless API (#24) --- .stats.yml | 2 +- api.md | 20 +++++++--- .../resources/functions/functions.py | 19 ++++----- .../functions/invocations/invocations.py | 10 ++--- src/runloop_api_client/types/__init__.py | 4 +- .../types/function_invoke_async_response.py | 25 ++++++++++++ .../types/function_invoke_sync_response.py | 25 ++++++++++++ .../types/functions/__init__.py | 1 + .../function_invocation_list_view.py | 16 ++++++-- .../invocation_retrieve_response.py} | 4 +- .../types/project_list_view.py | 22 ++++------- .../types/shared/__init__.py | 1 - .../functions/test_invocations.py | 15 ++++--- tests/api_resources/test_functions.py | 39 ++++++++++--------- 14 files changed, 133 insertions(+), 70 deletions(-) create mode 100644 src/runloop_api_client/types/function_invoke_async_response.py create mode 100644 src/runloop_api_client/types/function_invoke_sync_response.py rename src/runloop_api_client/types/{shared/function_invocation_detail_view.py => functions/invocation_retrieve_response.py} (87%) diff --git a/.stats.yml b/.stats.yml index abad5da29..8b2a6410f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ce4dc6d4d8a6587f304abdd5adf686e08612cab1c5f1cae3cdf8e20ff4a98d2b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d78961245e7aed3ff541de9e0f89e915c59d9c8b65ba3e33734edf8eee3d45f1.yml diff --git a/api.md b/api.md index 92527588e..6dcf8d3b8 100644 --- a/api.md +++ b/api.md @@ -1,7 +1,7 @@ # Shared Types ```python -from runloop_api_client.types import FunctionInvocationDetailView, ProjectLogsView +from runloop_api_client.types import ProjectLogsView ``` # Devboxes @@ -37,26 +37,34 @@ Methods: Types: ```python -from runloop_api_client.types import FunctionListView +from runloop_api_client.types import ( + FunctionListView, + FunctionInvokeAsyncResponse, + FunctionInvokeSyncResponse, +) ``` Methods: - client.functions.list() -> FunctionListView -- client.functions.invoke_async(function_name, \*, project_name, \*\*params) -> FunctionInvocationDetailView -- client.functions.invoke_sync(function_name, \*, project_name, \*\*params) -> FunctionInvocationDetailView +- client.functions.invoke_async(function_name, \*, project_name, \*\*params) -> FunctionInvokeAsyncResponse +- client.functions.invoke_sync(function_name, \*, project_name, \*\*params) -> FunctionInvokeSyncResponse ## Invocations Types: ```python -from runloop_api_client.types.functions import FunctionInvocationListView, KillOperationResponse +from runloop_api_client.types.functions import ( + FunctionInvocationListView, + KillOperationResponse, + InvocationRetrieveResponse, +) ``` Methods: -- client.functions.invocations.retrieve(invocation_id) -> FunctionInvocationDetailView +- client.functions.invocations.retrieve(invocation_id) -> InvocationRetrieveResponse - client.functions.invocations.list() -> FunctionInvocationListView - client.functions.invocations.kill(invocation_id) -> object diff --git a/src/runloop_api_client/resources/functions/functions.py b/src/runloop_api_client/resources/functions/functions.py index b906d0ad3..fad009f20 100644 --- a/src/runloop_api_client/resources/functions/functions.py +++ b/src/runloop_api_client/resources/functions/functions.py @@ -29,7 +29,8 @@ from ..._base_client import make_request_options from .invocations.invocations import InvocationsResource, AsyncInvocationsResource from ...types.function_list_view import FunctionListView -from ...types.shared.function_invocation_detail_view import FunctionInvocationDetailView +from ...types.function_invoke_sync_response import FunctionInvokeSyncResponse +from ...types.function_invoke_async_response import FunctionInvokeAsyncResponse __all__ = ["FunctionsResource", "AsyncFunctionsResource"] @@ -79,7 +80,7 @@ def invoke_async( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvocationDetailView: + ) -> FunctionInvokeAsyncResponse: """Invoke the remote function asynchronously. This will return a job id that can be @@ -112,7 +113,7 @@ def invoke_async( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=FunctionInvocationDetailView, + cast_to=FunctionInvokeAsyncResponse, ) def invoke_sync( @@ -128,7 +129,7 @@ def invoke_sync( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvocationDetailView: + ) -> FunctionInvokeSyncResponse: """Invoke the remote function synchronously. This will block until the function @@ -162,7 +163,7 @@ def invoke_sync( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=FunctionInvocationDetailView, + cast_to=FunctionInvokeSyncResponse, ) @@ -211,7 +212,7 @@ async def invoke_async( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvocationDetailView: + ) -> FunctionInvokeAsyncResponse: """Invoke the remote function asynchronously. This will return a job id that can be @@ -244,7 +245,7 @@ async def invoke_async( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=FunctionInvocationDetailView, + cast_to=FunctionInvokeAsyncResponse, ) async def invoke_sync( @@ -260,7 +261,7 @@ async def invoke_sync( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvocationDetailView: + ) -> FunctionInvokeSyncResponse: """Invoke the remote function synchronously. This will block until the function @@ -294,7 +295,7 @@ async def invoke_sync( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=FunctionInvocationDetailView, + cast_to=FunctionInvokeSyncResponse, ) diff --git a/src/runloop_api_client/resources/functions/invocations/invocations.py b/src/runloop_api_client/resources/functions/invocations/invocations.py index 8307e4f6d..0ebfcc9d9 100644 --- a/src/runloop_api_client/resources/functions/invocations/invocations.py +++ b/src/runloop_api_client/resources/functions/invocations/invocations.py @@ -14,7 +14,7 @@ async_to_streamed_response_wrapper, ) from ...._base_client import make_request_options -from ....types.shared.function_invocation_detail_view import FunctionInvocationDetailView +from ....types.functions.invocation_retrieve_response import InvocationRetrieveResponse from ....types.functions.function_invocation_list_view import FunctionInvocationListView __all__ = ["InvocationsResource", "AsyncInvocationsResource"] @@ -39,7 +39,7 @@ def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvocationDetailView: + ) -> InvocationRetrieveResponse: """Get the details of a function invocation. This includes the status, response, @@ -61,7 +61,7 @@ def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=FunctionInvocationDetailView, + cast_to=InvocationRetrieveResponse, ) def list( @@ -137,7 +137,7 @@ async def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvocationDetailView: + ) -> InvocationRetrieveResponse: """Get the details of a function invocation. This includes the status, response, @@ -159,7 +159,7 @@ async def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=FunctionInvocationDetailView, + cast_to=InvocationRetrieveResponse, ) async def list( diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index f31475c02..6037aef82 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -2,7 +2,7 @@ from __future__ import annotations -from .shared import ProjectLogsView as ProjectLogsView, FunctionInvocationDetailView as FunctionInvocationDetailView +from .shared import ProjectLogsView as ProjectLogsView from .devbox_view import DevboxView as DevboxView from .devbox_list_view import DevboxListView as DevboxListView from .project_list_view import ProjectListView as ProjectListView @@ -13,3 +13,5 @@ from .function_invoke_sync_params import FunctionInvokeSyncParams as FunctionInvokeSyncParams from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams +from .function_invoke_sync_response import FunctionInvokeSyncResponse as FunctionInvokeSyncResponse +from .function_invoke_async_response import FunctionInvokeAsyncResponse as FunctionInvokeAsyncResponse diff --git a/src/runloop_api_client/types/function_invoke_async_response.py b/src/runloop_api_client/types/function_invoke_async_response.py new file mode 100644 index 000000000..b9f7fc907 --- /dev/null +++ b/src/runloop_api_client/types/function_invoke_async_response.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["FunctionInvokeAsyncResponse"] + + +class FunctionInvokeAsyncResponse(BaseModel): + id: Optional[str] = None + """Unique ID of the invocation.""" + + error: Optional[str] = None + + function_name: Optional[str] = None + """Unique name of the function.""" + + project_name: Optional[str] = None + """Unique name of the project associated with function.""" + + result: Optional[object] = None + + status: Optional[Literal["created", "running", "success", "failure", "canceled", "suspended"]] = None diff --git a/src/runloop_api_client/types/function_invoke_sync_response.py b/src/runloop_api_client/types/function_invoke_sync_response.py new file mode 100644 index 000000000..622a26fb4 --- /dev/null +++ b/src/runloop_api_client/types/function_invoke_sync_response.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["FunctionInvokeSyncResponse"] + + +class FunctionInvokeSyncResponse(BaseModel): + id: Optional[str] = None + """Unique ID of the invocation.""" + + error: Optional[str] = None + + function_name: Optional[str] = None + """Unique name of the function.""" + + project_name: Optional[str] = None + """Unique name of the project associated with function.""" + + result: Optional[object] = None + + status: Optional[Literal["created", "running", "success", "failure", "canceled", "suspended"]] = None diff --git a/src/runloop_api_client/types/functions/__init__.py b/src/runloop_api_client/types/functions/__init__.py index 63c00b50b..c331106ef 100644 --- a/src/runloop_api_client/types/functions/__init__.py +++ b/src/runloop_api_client/types/functions/__init__.py @@ -2,4 +2,5 @@ from __future__ import annotations +from .invocation_retrieve_response import InvocationRetrieveResponse as InvocationRetrieveResponse from .function_invocation_list_view import FunctionInvocationListView as FunctionInvocationListView diff --git a/src/runloop_api_client/types/functions/function_invocation_list_view.py b/src/runloop_api_client/types/functions/function_invocation_list_view.py index 0f70d8b2d..9956fc002 100644 --- a/src/runloop_api_client/types/functions/function_invocation_list_view.py +++ b/src/runloop_api_client/types/functions/function_invocation_list_view.py @@ -9,14 +9,22 @@ class Invocation(BaseModel): + end_time_ms: int + """End time of the invocation.""" + + start_time_ms: int + """Start time of the invocation.""" + id: Optional[str] = None - """Unique ID of the invocations.""" + """Unique ID of the invocation.""" + + error: Optional[str] = None - name: Optional[str] = None - """Name of the invoked function.""" + function_name: Optional[str] = None + """Unique name of the function.""" project_name: Optional[str] = None - """Project name associated with invoked function.""" + """Unique name of the project associated with function.""" status: Optional[Literal["created", "running", "success", "failure", "canceled", "suspended"]] = None diff --git a/src/runloop_api_client/types/shared/function_invocation_detail_view.py b/src/runloop_api_client/types/functions/invocation_retrieve_response.py similarity index 87% rename from src/runloop_api_client/types/shared/function_invocation_detail_view.py rename to src/runloop_api_client/types/functions/invocation_retrieve_response.py index 96a10f561..b21ceada8 100644 --- a/src/runloop_api_client/types/shared/function_invocation_detail_view.py +++ b/src/runloop_api_client/types/functions/invocation_retrieve_response.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["FunctionInvocationDetailView"] +__all__ = ["InvocationRetrieveResponse"] -class FunctionInvocationDetailView(BaseModel): +class InvocationRetrieveResponse(BaseModel): id: Optional[str] = None """Unique ID of the invocation.""" diff --git a/src/runloop_api_client/types/project_list_view.py b/src/runloop_api_client/types/project_list_view.py index c74a91a49..552d88438 100644 --- a/src/runloop_api_client/types/project_list_view.py +++ b/src/runloop_api_client/types/project_list_view.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional +from typing_extensions import Literal from .._models import BaseModel @@ -48,11 +49,8 @@ class ProjectActiveDeploy(BaseModel): failure_message: Optional[str] = None """Failure message""" - status: Optional[str] = None - """ - Status of the deploy (deploy_in_progress | deployed | deploy_failed | - not_started). - """ + status: Optional[Literal["scheduled", "skipped", "in_progress", "failed", "deployed"]] = None + """Status of the deploy.""" class ProjectInProgressDeploy(BaseModel): @@ -84,11 +82,8 @@ class ProjectInProgressDeploy(BaseModel): failure_message: Optional[str] = None """Failure message""" - status: Optional[str] = None - """ - Status of the deploy (deploy_in_progress | deployed | deploy_failed | - not_started). - """ + status: Optional[Literal["scheduled", "skipped", "in_progress", "failed", "deployed"]] = None + """Status of the deploy.""" class ProjectRecentDeployment(BaseModel): @@ -120,11 +115,8 @@ class ProjectRecentDeployment(BaseModel): failure_message: Optional[str] = None """Failure message""" - status: Optional[str] = None - """ - Status of the deploy (deploy_in_progress | deployed | deploy_failed | - not_started). - """ + status: Optional[Literal["scheduled", "skipped", "in_progress", "failed", "deployed"]] = None + """Status of the deploy.""" class Project(BaseModel): diff --git a/src/runloop_api_client/types/shared/__init__.py b/src/runloop_api_client/types/shared/__init__.py index 24e01a444..85cd870be 100644 --- a/src/runloop_api_client/types/shared/__init__.py +++ b/src/runloop_api_client/types/shared/__init__.py @@ -1,4 +1,3 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .project_logs_view import ProjectLogsView as ProjectLogsView -from .function_invocation_detail_view import FunctionInvocationDetailView as FunctionInvocationDetailView diff --git a/tests/api_resources/functions/test_invocations.py b/tests/api_resources/functions/test_invocations.py index 69bb4a269..4042ab610 100644 --- a/tests/api_resources/functions/test_invocations.py +++ b/tests/api_resources/functions/test_invocations.py @@ -9,8 +9,7 @@ from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.shared import FunctionInvocationDetailView -from runloop_api_client.types.functions import FunctionInvocationListView +from runloop_api_client.types.functions import FunctionInvocationListView, InvocationRetrieveResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +22,7 @@ def test_method_retrieve(self, client: Runloop) -> None: invocation = client.functions.invocations.retrieve( "invocationId", ) - assert_matches_type(FunctionInvocationDetailView, invocation, path=["response"]) + assert_matches_type(InvocationRetrieveResponse, invocation, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Runloop) -> None: @@ -34,7 +33,7 @@ def test_raw_response_retrieve(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invocation = response.parse() - assert_matches_type(FunctionInvocationDetailView, invocation, path=["response"]) + assert_matches_type(InvocationRetrieveResponse, invocation, path=["response"]) @parametrize def test_streaming_response_retrieve(self, client: Runloop) -> None: @@ -45,7 +44,7 @@ def test_streaming_response_retrieve(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invocation = response.parse() - assert_matches_type(FunctionInvocationDetailView, invocation, path=["response"]) + assert_matches_type(InvocationRetrieveResponse, invocation, path=["response"]) assert cast(Any, response.is_closed) is True @@ -128,7 +127,7 @@ async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: invocation = await async_client.functions.invocations.retrieve( "invocationId", ) - assert_matches_type(FunctionInvocationDetailView, invocation, path=["response"]) + assert_matches_type(InvocationRetrieveResponse, invocation, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: @@ -139,7 +138,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invocation = await response.parse() - assert_matches_type(FunctionInvocationDetailView, invocation, path=["response"]) + assert_matches_type(InvocationRetrieveResponse, invocation, path=["response"]) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: @@ -150,7 +149,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" invocation = await response.parse() - assert_matches_type(FunctionInvocationDetailView, invocation, path=["response"]) + assert_matches_type(InvocationRetrieveResponse, invocation, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_functions.py b/tests/api_resources/test_functions.py index 0c8634c5f..c05908ce6 100644 --- a/tests/api_resources/test_functions.py +++ b/tests/api_resources/test_functions.py @@ -9,8 +9,11 @@ from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types import FunctionListView -from runloop_api_client.types.shared import FunctionInvocationDetailView +from runloop_api_client.types import ( + FunctionListView, + FunctionInvokeSyncResponse, + FunctionInvokeAsyncResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -50,7 +53,7 @@ def test_method_invoke_async(self, client: Runloop) -> None: project_name="project_name", request={}, ) - assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + assert_matches_type(FunctionInvokeAsyncResponse, function, path=["response"]) @parametrize def test_method_invoke_async_with_all_params(self, client: Runloop) -> None: @@ -60,7 +63,7 @@ def test_method_invoke_async_with_all_params(self, client: Runloop) -> None: request={}, runloop_meta={"session_id": "session_id"}, ) - assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + assert_matches_type(FunctionInvokeAsyncResponse, function, path=["response"]) @parametrize def test_raw_response_invoke_async(self, client: Runloop) -> None: @@ -73,7 +76,7 @@ def test_raw_response_invoke_async(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" function = response.parse() - assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + assert_matches_type(FunctionInvokeAsyncResponse, function, path=["response"]) @parametrize def test_streaming_response_invoke_async(self, client: Runloop) -> None: @@ -86,7 +89,7 @@ def test_streaming_response_invoke_async(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" function = response.parse() - assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + assert_matches_type(FunctionInvokeAsyncResponse, function, path=["response"]) assert cast(Any, response.is_closed) is True @@ -113,7 +116,7 @@ def test_method_invoke_sync(self, client: Runloop) -> None: project_name="project_name", request={}, ) - assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + assert_matches_type(FunctionInvokeSyncResponse, function, path=["response"]) @parametrize def test_method_invoke_sync_with_all_params(self, client: Runloop) -> None: @@ -123,7 +126,7 @@ def test_method_invoke_sync_with_all_params(self, client: Runloop) -> None: request={}, runloop_meta={"session_id": "session_id"}, ) - assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + assert_matches_type(FunctionInvokeSyncResponse, function, path=["response"]) @parametrize def test_raw_response_invoke_sync(self, client: Runloop) -> None: @@ -136,7 +139,7 @@ def test_raw_response_invoke_sync(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" function = response.parse() - assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + assert_matches_type(FunctionInvokeSyncResponse, function, path=["response"]) @parametrize def test_streaming_response_invoke_sync(self, client: Runloop) -> None: @@ -149,7 +152,7 @@ def test_streaming_response_invoke_sync(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" function = response.parse() - assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + assert_matches_type(FunctionInvokeSyncResponse, function, path=["response"]) assert cast(Any, response.is_closed) is True @@ -205,7 +208,7 @@ async def test_method_invoke_async(self, async_client: AsyncRunloop) -> None: project_name="project_name", request={}, ) - assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + assert_matches_type(FunctionInvokeAsyncResponse, function, path=["response"]) @parametrize async def test_method_invoke_async_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -215,7 +218,7 @@ async def test_method_invoke_async_with_all_params(self, async_client: AsyncRunl request={}, runloop_meta={"session_id": "session_id"}, ) - assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + assert_matches_type(FunctionInvokeAsyncResponse, function, path=["response"]) @parametrize async def test_raw_response_invoke_async(self, async_client: AsyncRunloop) -> None: @@ -228,7 +231,7 @@ async def test_raw_response_invoke_async(self, async_client: AsyncRunloop) -> No assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" function = await response.parse() - assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + assert_matches_type(FunctionInvokeAsyncResponse, function, path=["response"]) @parametrize async def test_streaming_response_invoke_async(self, async_client: AsyncRunloop) -> None: @@ -241,7 +244,7 @@ async def test_streaming_response_invoke_async(self, async_client: AsyncRunloop) assert response.http_request.headers.get("X-Stainless-Lang") == "python" function = await response.parse() - assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + assert_matches_type(FunctionInvokeAsyncResponse, function, path=["response"]) assert cast(Any, response.is_closed) is True @@ -268,7 +271,7 @@ async def test_method_invoke_sync(self, async_client: AsyncRunloop) -> None: project_name="project_name", request={}, ) - assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + assert_matches_type(FunctionInvokeSyncResponse, function, path=["response"]) @parametrize async def test_method_invoke_sync_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -278,7 +281,7 @@ async def test_method_invoke_sync_with_all_params(self, async_client: AsyncRunlo request={}, runloop_meta={"session_id": "session_id"}, ) - assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + assert_matches_type(FunctionInvokeSyncResponse, function, path=["response"]) @parametrize async def test_raw_response_invoke_sync(self, async_client: AsyncRunloop) -> None: @@ -291,7 +294,7 @@ async def test_raw_response_invoke_sync(self, async_client: AsyncRunloop) -> Non assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" function = await response.parse() - assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + assert_matches_type(FunctionInvokeSyncResponse, function, path=["response"]) @parametrize async def test_streaming_response_invoke_sync(self, async_client: AsyncRunloop) -> None: @@ -304,7 +307,7 @@ async def test_streaming_response_invoke_sync(self, async_client: AsyncRunloop) assert response.http_request.headers.get("X-Stainless-Lang") == "python" function = await response.parse() - assert_matches_type(FunctionInvocationDetailView, function, path=["response"]) + assert_matches_type(FunctionInvokeSyncResponse, function, path=["response"]) assert cast(Any, response.is_closed) is True From ae22de8684ab3d3191798a87cb3f877226b66eee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2024 19:12:17 +0000 Subject: [PATCH 026/993] feat(api): OpenAPI spec update via Stainless API (#26) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8b2a6410f..02f607d38 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d78961245e7aed3ff541de9e0f89e915c59d9c8b65ba3e33734edf8eee3d45f1.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-fd43ad391cd1cc1a2ff6c78c772132a88101159cc823562af2ab5fc8c1e24ef7.yml From 560d43208663beba4abceef50dfc35f4632c3bde Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 22:12:21 +0000 Subject: [PATCH 027/993] feat(api): OpenAPI spec update via Stainless API (#28) --- .stats.yml | 2 +- README.md | 2 +- api.md | 2 +- src/runloop_api_client/_base_client.py | 12 ++++++------ src/runloop_api_client/_compat.py | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.stats.yml b/.stats.yml index 02f607d38..b983947c6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-fd43ad391cd1cc1a2ff6c78c772132a88101159cc823562af2ab5fc8c1e24ef7.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3b8fb40c9d18efcc8ddae387d3d76c6f36d2d9d9cabf1fb5a92845bed28b7357.yml diff --git a/README.md b/README.md index d56adbf50..9953374ac 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ It is generated with [Stainless](https://www.stainlessapi.com/). ## Documentation -The REST API documentation can be found [on runloop.ai](https://runloop.ai). The full API of this library can be found in [api.md](api.md). +The REST API documentation can be found on [runloop.ai](https://runloop.ai). The full API of this library can be found in [api.md](api.md). ## Installation diff --git a/api.md b/api.md index 6dcf8d3b8..8fa2c52fe 100644 --- a/api.md +++ b/api.md @@ -65,7 +65,7 @@ from runloop_api_client.types.functions import ( Methods: - client.functions.invocations.retrieve(invocation_id) -> InvocationRetrieveResponse -- client.functions.invocations.list() -> FunctionInvocationListView +- client.functions.invocations.list(\*\*params) -> FunctionInvocationListView - client.functions.invocations.kill(invocation_id) -> object # Projects diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index fddf6e7e8..30569c617 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -879,9 +879,9 @@ def __exit__( def _prepare_options( self, options: FinalRequestOptions, # noqa: ARG002 - ) -> None: + ) -> FinalRequestOptions: """Hook for mutating the given options""" - return None + return options def _prepare_request( self, @@ -961,7 +961,7 @@ def _request( input_options = model_copy(options) cast_to = self._maybe_override_cast_to(cast_to, options) - self._prepare_options(options) + options = self._prepare_options(options) retries = self._remaining_retries(remaining_retries, options) request = self._build_request(options) @@ -1442,9 +1442,9 @@ async def __aexit__( async def _prepare_options( self, options: FinalRequestOptions, # noqa: ARG002 - ) -> None: + ) -> FinalRequestOptions: """Hook for mutating the given options""" - return None + return options async def _prepare_request( self, @@ -1529,7 +1529,7 @@ async def _request( input_options = model_copy(options) cast_to = self._maybe_override_cast_to(cast_to, options) - await self._prepare_options(options) + options = await self._prepare_options(options) retries = self._remaining_retries(remaining_retries, options) request = self._build_request(options) diff --git a/src/runloop_api_client/_compat.py b/src/runloop_api_client/_compat.py index 74c7639b4..c919b5adb 100644 --- a/src/runloop_api_client/_compat.py +++ b/src/runloop_api_client/_compat.py @@ -118,10 +118,10 @@ def get_model_fields(model: type[pydantic.BaseModel]) -> dict[str, FieldInfo]: return model.__fields__ # type: ignore -def model_copy(model: _ModelT) -> _ModelT: +def model_copy(model: _ModelT, *, deep: bool = False) -> _ModelT: if PYDANTIC_V2: - return model.model_copy() - return model.copy() # type: ignore + return model.model_copy(deep=deep) + return model.copy(deep=deep) # type: ignore def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str: From 0f26ca12601a83fa50ac2d19d12d429ad605ba50 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Jul 2024 20:13:02 +0000 Subject: [PATCH 028/993] feat(api): OpenAPI spec update via Stainless API (#29) --- .stats.yml | 2 +- .../resources/devboxes/devboxes.py | 30 ++++- .../functions/invocations/invocations.py | 67 +++++++++- .../types/devbox_list_params.py | 6 + .../types/devbox_list_view.py | 2 + src/runloop_api_client/types/devbox_view.py | 10 ++ .../types/function_invoke_async_response.py | 13 +- .../types/function_invoke_sync_response.py | 13 +- .../types/functions/__init__.py | 1 + .../function_invocation_list_view.py | 23 +++- .../types/functions/invocation_list_params.py | 15 +++ .../functions/invocation_retrieve_response.py | 13 +- .../types/project_list_view.py | 117 +----------------- .../functions/test_invocations.py | 21 +++- tests/api_resources/test_devboxes.py | 4 + 15 files changed, 206 insertions(+), 131 deletions(-) create mode 100644 src/runloop_api_client/types/functions/invocation_list_params.py diff --git a/.stats.yml b/.stats.yml index b983947c6..d83db5a5e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3b8fb40c9d18efcc8ddae387d3d76c6f36d2d9d9cabf1fb5a92845bed28b7357.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8b0ed5bc221b57de3e0824f519813e79f53ade2cd29601822d62f8429e0066cd.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 24fbd2ed2..285e3f0b9 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -147,6 +147,8 @@ def retrieve( def list( self, *, + limit: str | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, status: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -161,6 +163,10 @@ def list( are returned. Args: + limit: Page Limit + + starting_after: Load the next page starting after the given token. + status: Filter by status extra_headers: Send extra headers @@ -178,7 +184,14 @@ def list( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform({"status": status}, devbox_list_params.DevboxListParams), + query=maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + "status": status, + }, + devbox_list_params.DevboxListParams, + ), ), cast_to=DevboxListView, ) @@ -366,6 +379,8 @@ async def retrieve( async def list( self, *, + limit: str | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, status: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -380,6 +395,10 @@ async def list( are returned. Args: + limit: Page Limit + + starting_after: Load the next page starting after the given token. + status: Filter by status extra_headers: Send extra headers @@ -397,7 +416,14 @@ async def list( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform({"status": status}, devbox_list_params.DevboxListParams), + query=await async_maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + "status": status, + }, + devbox_list_params.DevboxListParams, + ), ), cast_to=DevboxListView, ) diff --git a/src/runloop_api_client/resources/functions/invocations/invocations.py b/src/runloop_api_client/resources/functions/invocations/invocations.py index 0ebfcc9d9..3f186606e 100644 --- a/src/runloop_api_client/resources/functions/invocations/invocations.py +++ b/src/runloop_api_client/resources/functions/invocations/invocations.py @@ -5,6 +5,10 @@ import httpx from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ...._utils import ( + maybe_transform, + async_maybe_transform, +) from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( @@ -14,6 +18,7 @@ async_to_streamed_response_wrapper, ) from ...._base_client import make_request_options +from ....types.functions import invocation_list_params from ....types.functions.invocation_retrieve_response import InvocationRetrieveResponse from ....types.functions.function_invocation_list_view import FunctionInvocationListView @@ -67,6 +72,8 @@ def retrieve( def list( self, *, + limit: str | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -74,11 +81,36 @@ def list( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> FunctionInvocationListView: - """List the functions invocations that are available for invocation.""" + """ + List the functions invocations that are available for invocation. + + Args: + limit: Page Limit + + starting_after: Load the next page starting after the given token. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ return self._get( "/v1/functions/invocations", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + invocation_list_params.InvocationListParams, + ), ), cast_to=FunctionInvocationListView, ) @@ -165,6 +197,8 @@ async def retrieve( async def list( self, *, + limit: str | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -172,11 +206,36 @@ async def list( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> FunctionInvocationListView: - """List the functions invocations that are available for invocation.""" + """ + List the functions invocations that are available for invocation. + + Args: + limit: Page Limit + + starting_after: Load the next page starting after the given token. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ return await self._get( "/v1/functions/invocations", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + invocation_list_params.InvocationListParams, + ), ), cast_to=FunctionInvocationListView, ) diff --git a/src/runloop_api_client/types/devbox_list_params.py b/src/runloop_api_client/types/devbox_list_params.py index b7e3e4bce..4a3a37643 100644 --- a/src/runloop_api_client/types/devbox_list_params.py +++ b/src/runloop_api_client/types/devbox_list_params.py @@ -8,5 +8,11 @@ class DevboxListParams(TypedDict, total=False): + limit: str + """Page Limit""" + + starting_after: str + """Load the next page starting after the given token.""" + status: str """Filter by status""" diff --git a/src/runloop_api_client/types/devbox_list_view.py b/src/runloop_api_client/types/devbox_list_view.py index b370c75a5..dfd155b3d 100644 --- a/src/runloop_api_client/types/devbox_list_view.py +++ b/src/runloop_api_client/types/devbox_list_view.py @@ -11,3 +11,5 @@ class DevboxListView(BaseModel): devboxes: Optional[List[DevboxView]] = None """List of devboxes matching filter.""" + + has_more: Optional[bool] = None diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 5dec94295..d85fb68e0 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional +from typing_extensions import Literal from .._models import BaseModel @@ -14,6 +15,15 @@ class DevboxView(BaseModel): create_time_ms: Optional[int] = None """Creation time of the Devbox (Unix timestamp milliseconds).""" + end_time_ms: Optional[int] = None + """The time the Devbox finished execution (Unix timestamp milliseconds).""" + + initiator_id: Optional[str] = None + """The initiator ID of the devbox.""" + + initiator_type: Optional[Literal["unknown", "api", "invocation"]] = None + """The initiator of the devbox.""" + name: Optional[str] = None """The name of the Devbox.""" diff --git a/src/runloop_api_client/types/function_invoke_async_response.py b/src/runloop_api_client/types/function_invoke_async_response.py index b9f7fc907..4e1ad52b6 100644 --- a/src/runloop_api_client/types/function_invoke_async_response.py +++ b/src/runloop_api_client/types/function_invoke_async_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from typing_extensions import Literal from .._models import BaseModel @@ -17,9 +17,20 @@ class FunctionInvokeAsyncResponse(BaseModel): function_name: Optional[str] = None """Unique name of the function.""" + gh_commit_sha: Optional[str] = None + """The Git sha of the project this invocation used..""" + + gh_owner: Optional[str] = None + """The Github Owner of the Project.""" + + linked_devboxes: Optional[List[str]] = None + """The Devboxes created and used by this invocation.""" + project_name: Optional[str] = None """Unique name of the project associated with function.""" + request: Optional[object] = None + result: Optional[object] = None status: Optional[Literal["created", "running", "success", "failure", "canceled", "suspended"]] = None diff --git a/src/runloop_api_client/types/function_invoke_sync_response.py b/src/runloop_api_client/types/function_invoke_sync_response.py index 622a26fb4..7fcb08a26 100644 --- a/src/runloop_api_client/types/function_invoke_sync_response.py +++ b/src/runloop_api_client/types/function_invoke_sync_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from typing_extensions import Literal from .._models import BaseModel @@ -17,9 +17,20 @@ class FunctionInvokeSyncResponse(BaseModel): function_name: Optional[str] = None """Unique name of the function.""" + gh_commit_sha: Optional[str] = None + """The Git sha of the project this invocation used..""" + + gh_owner: Optional[str] = None + """The Github Owner of the Project.""" + + linked_devboxes: Optional[List[str]] = None + """The Devboxes created and used by this invocation.""" + project_name: Optional[str] = None """Unique name of the project associated with function.""" + request: Optional[object] = None + result: Optional[object] = None status: Optional[Literal["created", "running", "success", "failure", "canceled", "suspended"]] = None diff --git a/src/runloop_api_client/types/functions/__init__.py b/src/runloop_api_client/types/functions/__init__.py index c331106ef..053413c95 100644 --- a/src/runloop_api_client/types/functions/__init__.py +++ b/src/runloop_api_client/types/functions/__init__.py @@ -2,5 +2,6 @@ from __future__ import annotations +from .invocation_list_params import InvocationListParams as InvocationListParams from .invocation_retrieve_response import InvocationRetrieveResponse as InvocationRetrieveResponse from .function_invocation_list_view import FunctionInvocationListView as FunctionInvocationListView diff --git a/src/runloop_api_client/types/functions/function_invocation_list_view.py b/src/runloop_api_client/types/functions/function_invocation_list_view.py index 9956fc002..bb8e5910a 100644 --- a/src/runloop_api_client/types/functions/function_invocation_list_view.py +++ b/src/runloop_api_client/types/functions/function_invocation_list_view.py @@ -9,26 +9,37 @@ class Invocation(BaseModel): - end_time_ms: int - """End time of the invocation.""" - - start_time_ms: int - """Start time of the invocation.""" - id: Optional[str] = None """Unique ID of the invocation.""" + end_time_ms: Optional[int] = None + """End time of the invocation.""" + error: Optional[str] = None function_name: Optional[str] = None """Unique name of the function.""" + gh_commit_sha: Optional[str] = None + """The Git sha of the project this invocation used.""" + + gh_owner: Optional[str] = None + """The Github Owner of the Project.""" + + linked_devboxes: Optional[List[str]] = None + """The Devboxes created and used by this invocation.""" + project_name: Optional[str] = None """Unique name of the project associated with function.""" + start_time_ms: Optional[int] = None + """Start time of the invocation.""" + status: Optional[Literal["created", "running", "success", "failure", "canceled", "suspended"]] = None class FunctionInvocationListView(BaseModel): + has_more: Optional[bool] = None + invocations: Optional[List[Invocation]] = None """List of functions matching given query.""" diff --git a/src/runloop_api_client/types/functions/invocation_list_params.py b/src/runloop_api_client/types/functions/invocation_list_params.py new file mode 100644 index 000000000..dad6156bd --- /dev/null +++ b/src/runloop_api_client/types/functions/invocation_list_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["InvocationListParams"] + + +class InvocationListParams(TypedDict, total=False): + limit: str + """Page Limit""" + + starting_after: str + """Load the next page starting after the given token.""" diff --git a/src/runloop_api_client/types/functions/invocation_retrieve_response.py b/src/runloop_api_client/types/functions/invocation_retrieve_response.py index b21ceada8..bc3658908 100644 --- a/src/runloop_api_client/types/functions/invocation_retrieve_response.py +++ b/src/runloop_api_client/types/functions/invocation_retrieve_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from typing_extensions import Literal from ..._models import BaseModel @@ -17,9 +17,20 @@ class InvocationRetrieveResponse(BaseModel): function_name: Optional[str] = None """Unique name of the function.""" + gh_commit_sha: Optional[str] = None + """The Git sha of the project this invocation used..""" + + gh_owner: Optional[str] = None + """The Github Owner of the Project.""" + + linked_devboxes: Optional[List[str]] = None + """The Devboxes created and used by this invocation.""" + project_name: Optional[str] = None """Unique name of the project associated with function.""" + request: Optional[object] = None + result: Optional[object] = None status: Optional[Literal["created", "running", "success", "failure", "canceled", "suspended"]] = None diff --git a/src/runloop_api_client/types/project_list_view.py b/src/runloop_api_client/types/project_list_view.py index 552d88438..6f525006d 100644 --- a/src/runloop_api_client/types/project_list_view.py +++ b/src/runloop_api_client/types/project_list_view.py @@ -1,18 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional -from typing_extensions import Literal from .._models import BaseModel -__all__ = [ - "ProjectListView", - "Installation", - "Project", - "ProjectActiveDeploy", - "ProjectInProgressDeploy", - "ProjectRecentDeployment", -] +__all__ = ["ProjectListView", "Installation", "Project"] class Installation(BaseModel): @@ -20,119 +12,16 @@ class Installation(BaseModel): """Status of the installation (installed | uninstalled | never_installed).""" -class ProjectActiveDeploy(BaseModel): - deploy_start_time_ms: int - """Time the Deploy was started (Unix timestamp milliseconds).""" - - id: Optional[str] = None - """ID of the deployment.""" - - deploy_commit_sha: Optional[str] = None - """Associated Commit Sha""" - - deploy_commit_time_ms: Optional[int] = None - """Associated Commit Time""" - - deploy_end_time_ms: Optional[int] = None - """Time the Deploy completed (Unix timestamp milliseconds).""" - - deployed_functions: Optional[List[str]] = None - """The list of deployed functions.""" - - failure_code: Optional[str] = None - """ - Failure code (generic_failure | git_clone_failure | not_runloop_repo | - secrets_failure | provision_failure | runtime_failure). Only set on - deploy_failed. - """ - - failure_message: Optional[str] = None - """Failure message""" - - status: Optional[Literal["scheduled", "skipped", "in_progress", "failed", "deployed"]] = None - """Status of the deploy.""" - - -class ProjectInProgressDeploy(BaseModel): - deploy_start_time_ms: int - """Time the Deploy was started (Unix timestamp milliseconds).""" - - id: Optional[str] = None - """ID of the deployment.""" - - deploy_commit_sha: Optional[str] = None - """Associated Commit Sha""" - - deploy_commit_time_ms: Optional[int] = None - """Associated Commit Time""" - - deploy_end_time_ms: Optional[int] = None - """Time the Deploy completed (Unix timestamp milliseconds).""" - - deployed_functions: Optional[List[str]] = None - """The list of deployed functions.""" - - failure_code: Optional[str] = None - """ - Failure code (generic_failure | git_clone_failure | not_runloop_repo | - secrets_failure | provision_failure | runtime_failure). Only set on - deploy_failed. - """ - - failure_message: Optional[str] = None - """Failure message""" - - status: Optional[Literal["scheduled", "skipped", "in_progress", "failed", "deployed"]] = None - """Status of the deploy.""" - - -class ProjectRecentDeployment(BaseModel): - deploy_start_time_ms: int - """Time the Deploy was started (Unix timestamp milliseconds).""" - - id: Optional[str] = None - """ID of the deployment.""" - - deploy_commit_sha: Optional[str] = None - """Associated Commit Sha""" - - deploy_commit_time_ms: Optional[int] = None - """Associated Commit Time""" - - deploy_end_time_ms: Optional[int] = None - """Time the Deploy completed (Unix timestamp milliseconds).""" - - deployed_functions: Optional[List[str]] = None - """The list of deployed functions.""" - - failure_code: Optional[str] = None - """ - Failure code (generic_failure | git_clone_failure | not_runloop_repo | - secrets_failure | provision_failure | runtime_failure). Only set on - deploy_failed. - """ - - failure_message: Optional[str] = None - """Failure message""" - - status: Optional[Literal["scheduled", "skipped", "in_progress", "failed", "deployed"]] = None - """Status of the deploy.""" - - class Project(BaseModel): id: Optional[str] = None """Unique id of Project.""" - active_deploy: Optional[ProjectActiveDeploy] = None - - in_progress_deploy: Optional[ProjectInProgressDeploy] = None + gh_owner: Optional[str] = None + """Owner of the project in Github""" name: Optional[str] = None """Project display name.""" - recent_deployments: Optional[List[ProjectRecentDeployment]] = None - """Last deployment attempts (up to 10)""" - class ProjectListView(BaseModel): installation: Optional[Installation] = None diff --git a/tests/api_resources/functions/test_invocations.py b/tests/api_resources/functions/test_invocations.py index 4042ab610..019df2717 100644 --- a/tests/api_resources/functions/test_invocations.py +++ b/tests/api_resources/functions/test_invocations.py @@ -9,7 +9,10 @@ from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.functions import FunctionInvocationListView, InvocationRetrieveResponse +from runloop_api_client.types.functions import ( + FunctionInvocationListView, + InvocationRetrieveResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -60,6 +63,14 @@ def test_method_list(self, client: Runloop) -> None: invocation = client.functions.invocations.list() assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + invocation = client.functions.invocations.list( + limit="limit", + starting_after="starting_after", + ) + assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) + @parametrize def test_raw_response_list(self, client: Runloop) -> None: response = client.functions.invocations.with_raw_response.list() @@ -165,6 +176,14 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: invocation = await async_client.functions.invocations.list() assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + invocation = await async_client.functions.invocations.list( + limit="limit", + starting_after="starting_after", + ) + assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) + @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: response = await async_client.functions.invocations.with_raw_response.list() diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 915f875a7..e73805675 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -103,6 +103,8 @@ def test_method_list(self, client: Runloop) -> None: @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.list( + limit="limit", + starting_after="starting_after", status="status", ) assert_matches_type(DevboxListView, devbox, path=["response"]) @@ -297,6 +299,8 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.list( + limit="limit", + starting_after="starting_after", status="status", ) assert_matches_type(DevboxListView, devbox, path=["response"]) From 4b6722a21a5774652596d5cc46399e56cde20a42 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Jul 2024 00:12:19 +0000 Subject: [PATCH 029/993] feat(api): OpenAPI spec update via Stainless API (#30) --- .github/workflows/release-doctor.yml | 2 ++ .stats.yml | 2 +- README.md | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 58c1c1917..d80447e1d 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -1,6 +1,8 @@ name: Release Doctor on: pull_request: + branches: + - main workflow_dispatch: jobs: diff --git a/.stats.yml b/.stats.yml index d83db5a5e..3d77d1014 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8b0ed5bc221b57de3e0824f519813e79f53ade2cd29601822d62f8429e0066cd.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6c793b776e36e9ed358e623f7f4d42be44d7ee5cc43de3683b2ad86a0b23d61d.yml diff --git a/README.md b/README.md index 9953374ac..a0f0835fc 100644 --- a/README.md +++ b/README.md @@ -279,6 +279,12 @@ client = Runloop( ) ``` +You can also customize the client on a per-request basis by using `with_options()`: + +```python +client.with_options(http_client=DefaultHttpxClient(...)) +``` + ### Managing HTTP resources By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting. From 4a1adc8202b5db68c6fce846155dbb3c6fe85287 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Jul 2024 02:12:20 +0000 Subject: [PATCH 030/993] feat(api): OpenAPI spec update via Stainless API (#31) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 3d77d1014..d83db5a5e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6c793b776e36e9ed358e623f7f4d42be44d7ee5cc43de3683b2ad86a0b23d61d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8b0ed5bc221b57de3e0824f519813e79f53ade2cd29601822d62f8429e0066cd.yml From a507f63a162cfcae50a7b780dec78e51c6367dcb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Jul 2024 06:14:23 +0000 Subject: [PATCH 031/993] feat(api): OpenAPI spec update via Stainless API (#32) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 10 ++++++++++ src/runloop_api_client/types/devbox_create_params.py | 6 ++++++ tests/api_resources/test_devboxes.py | 2 ++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d83db5a5e..1eb86f041 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8b0ed5bc221b57de3e0824f519813e79f53ade2cd29601822d62f8429e0066cd.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4fffbbc4c7a1f1a25c36db33491e613f57d4f34ca2c4c8cbe634c3a09dec49a3.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 285e3f0b9..f83313a1f 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -55,6 +55,7 @@ def create( code_handle: str | NotGiven = NOT_GIVEN, entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, + image_id: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -78,6 +79,9 @@ def create( environment_variables: (Optional) Environment variables used to configure your Devbox. + image_id: (Optional) Image to use as the for the Devbox. If none set, the default Runloop + image will be used. + name: (Optional) A user specified name to give the Devbox. setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include @@ -99,6 +103,7 @@ def create( "code_handle": code_handle, "entrypoint": entrypoint, "environment_variables": environment_variables, + "image_id": image_id, "name": name, "setup_commands": setup_commands, }, @@ -287,6 +292,7 @@ async def create( code_handle: str | NotGiven = NOT_GIVEN, entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, + image_id: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -310,6 +316,9 @@ async def create( environment_variables: (Optional) Environment variables used to configure your Devbox. + image_id: (Optional) Image to use as the for the Devbox. If none set, the default Runloop + image will be used. + name: (Optional) A user specified name to give the Devbox. setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include @@ -331,6 +340,7 @@ async def create( "code_handle": code_handle, "entrypoint": entrypoint, "environment_variables": environment_variables, + "image_id": image_id, "name": name, "setup_commands": setup_commands, }, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 49834e010..7c6b6f340 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -22,6 +22,12 @@ class DevboxCreateParams(TypedDict, total=False): environment_variables: Dict[str, str] """(Optional) Environment variables used to configure your Devbox.""" + image_id: str + """(Optional) Image to use as the for the Devbox. + + If none set, the default Runloop image will be used. + """ + name: str """(Optional) A user specified name to give the Devbox.""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index e73805675..94e283126 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -32,6 +32,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: code_handle="code_handle", entrypoint="entrypoint", environment_variables={"foo": "string"}, + image_id="image_id", name="name", setup_commands=["string", "string", "string"], ) @@ -228,6 +229,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - code_handle="code_handle", entrypoint="entrypoint", environment_variables={"foo": "string"}, + image_id="image_id", name="name", setup_commands=["string", "string", "string"], ) From 4ed1b39391ccf8a3ecf2acdf6901c8e4d3bc69e7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 18:12:21 +0000 Subject: [PATCH 032/993] feat(api): OpenAPI spec update via Stainless API (#33) --- .stats.yml | 2 +- src/runloop_api_client/types/devbox_list_view.py | 2 ++ .../types/functions/function_invocation_list_view.py | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 1eb86f041..5c2e39024 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4fffbbc4c7a1f1a25c36db33491e613f57d4f34ca2c4c8cbe634c3a09dec49a3.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-030c40b338073427262dcafcd24ccbac2dd92595a5f12c522f541f7453a276e0.yml diff --git a/src/runloop_api_client/types/devbox_list_view.py b/src/runloop_api_client/types/devbox_list_view.py index dfd155b3d..97f1e91ce 100644 --- a/src/runloop_api_client/types/devbox_list_view.py +++ b/src/runloop_api_client/types/devbox_list_view.py @@ -13,3 +13,5 @@ class DevboxListView(BaseModel): """List of devboxes matching filter.""" has_more: Optional[bool] = None + + total_count: Optional[int] = None diff --git a/src/runloop_api_client/types/functions/function_invocation_list_view.py b/src/runloop_api_client/types/functions/function_invocation_list_view.py index bb8e5910a..98920ba7e 100644 --- a/src/runloop_api_client/types/functions/function_invocation_list_view.py +++ b/src/runloop_api_client/types/functions/function_invocation_list_view.py @@ -43,3 +43,5 @@ class FunctionInvocationListView(BaseModel): invocations: Optional[List[Invocation]] = None """List of functions matching given query.""" + + total_count: Optional[int] = None From 3937409d6b43761653d6054f28bb80e50e06bf35 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 22:12:21 +0000 Subject: [PATCH 033/993] feat(api): OpenAPI spec update via Stainless API (#34) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 5c2e39024..e7149f5c6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-030c40b338073427262dcafcd24ccbac2dd92595a5f12c522f541f7453a276e0.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a8e3ca8ffb3e6c4adcd701f49779930e4cd98d1755ebc68f31c7040df35b590e.yml From 6d3cb0bfb2507d447a0bbb12839f3ccb6006bc55 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 22:13:28 +0000 Subject: [PATCH 034/993] chore(internal): refactor release doctor script (#35) --- bin/check-release-environment | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/bin/check-release-environment b/bin/check-release-environment index bbcc4181f..2ba897b5f 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -1,20 +1,9 @@ #!/usr/bin/env bash -warnings=() errors=() if [ -z "${PYPI_TOKEN}" ]; then - warnings+=("The RUNLOOP_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") -fi - -lenWarnings=${#warnings[@]} - -if [[ lenWarnings -gt 0 ]]; then - echo -e "Found the following warnings in the release environment:\n" - - for warning in "${warnings[@]}"; do - echo -e "- $warning\n" - done + errors+=("The RUNLOOP_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") fi lenErrors=${#errors[@]} From d991ec26d3d2c919aa7a49d7e210d0ca1eb1b297 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 22:14:14 +0000 Subject: [PATCH 035/993] chore(tests): update prism version (#36) --- scripts/mock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mock b/scripts/mock index fe89a1d08..f58615769 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stoplight/prism-cli@~5.8 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stainless-api/prism-cli@5.8.4 -- prism mock "$URL" &> .prism.log & # Wait for server to come online echo -n "Waiting for server" @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stoplight/prism-cli@~5.8 -- prism mock "$URL" + npm exec --package=@stainless-api/prism-cli@5.8.4 -- prism mock "$URL" fi From a3e49b8db44aa24c792834656be5154a659cd7a5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 24 Jul 2024 21:12:23 +0000 Subject: [PATCH 036/993] feat(api): OpenAPI spec update via Stainless API (#37) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e7149f5c6..38d8f21e2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a8e3ca8ffb3e6c4adcd701f49779930e4cd98d1755ebc68f31c7040df35b590e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-53304481e67ff49693add75940abf39fd4a97a94bd8053cecabb940845bccbd2.yml From 2d78a369446601950829b9bd2c14bdbe74cb64fb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 24 Jul 2024 23:12:23 +0000 Subject: [PATCH 037/993] feat(api): OpenAPI spec update via Stainless API (#38) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 38d8f21e2..55ebcc41d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-53304481e67ff49693add75940abf39fd4a97a94bd8053cecabb940845bccbd2.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-58180fece8c2fb5fc0cbf9f8c1e700fb7472eba73a3e060f06e41f1873acbbb0.yml From 225349f00ea36713e184d7edd62c9f32a698761d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 25 Jul 2024 05:12:17 +0000 Subject: [PATCH 038/993] feat(api): OpenAPI spec update via Stainless API (#39) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 55ebcc41d..4d28659b4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-58180fece8c2fb5fc0cbf9f8c1e700fb7472eba73a3e060f06e41f1873acbbb0.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6ba331adfa030e48fb227c7205196d406eea68442ad01104d9b8c9ac9f089fa0.yml From 660deb40642bfd29200b74d9ecccceb478972880 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 25 Jul 2024 20:56:30 +0000 Subject: [PATCH 039/993] chore(internal): version bump (#40) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e8285b710..4f9005ea3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.5" + ".": "0.1.0-alpha.6" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 6f0a42419..60ab2c370 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.1.0-alpha.5" +version = "0.1.0-alpha.6" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 8cdc8ca05..3fb467889 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.1.0-alpha.5" # x-release-please-version +__version__ = "0.1.0-alpha.6" # x-release-please-version From db737d95e5fd11c541c26e995840c6c658460088 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 01:12:19 +0000 Subject: [PATCH 040/993] feat(api): OpenAPI spec update via Stainless API (#41) --- .stats.yml | 2 +- .../types/function_invoke_async_response.py | 6 ++++++ .../types/function_invoke_sync_response.py | 6 ++++++ .../types/functions/invocation_retrieve_response.py | 6 ++++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 4d28659b4..9ddcd6f35 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6ba331adfa030e48fb227c7205196d406eea68442ad01104d9b8c9ac9f089fa0.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-aee1608866afd5556819617774f429625e10140d9a18b7de15b9452e87aa89c1.yml diff --git a/src/runloop_api_client/types/function_invoke_async_response.py b/src/runloop_api_client/types/function_invoke_async_response.py index 4e1ad52b6..73426102c 100644 --- a/src/runloop_api_client/types/function_invoke_async_response.py +++ b/src/runloop_api_client/types/function_invoke_async_response.py @@ -12,6 +12,9 @@ class FunctionInvokeAsyncResponse(BaseModel): id: Optional[str] = None """Unique ID of the invocation.""" + end_time_ms: Optional[int] = None + """End time of the invocation.""" + error: Optional[str] = None function_name: Optional[str] = None @@ -33,4 +36,7 @@ class FunctionInvokeAsyncResponse(BaseModel): result: Optional[object] = None + start_time_ms: Optional[int] = None + """Start time of the invocation.""" + status: Optional[Literal["created", "running", "success", "failure", "canceled", "suspended"]] = None diff --git a/src/runloop_api_client/types/function_invoke_sync_response.py b/src/runloop_api_client/types/function_invoke_sync_response.py index 7fcb08a26..80078b149 100644 --- a/src/runloop_api_client/types/function_invoke_sync_response.py +++ b/src/runloop_api_client/types/function_invoke_sync_response.py @@ -12,6 +12,9 @@ class FunctionInvokeSyncResponse(BaseModel): id: Optional[str] = None """Unique ID of the invocation.""" + end_time_ms: Optional[int] = None + """End time of the invocation.""" + error: Optional[str] = None function_name: Optional[str] = None @@ -33,4 +36,7 @@ class FunctionInvokeSyncResponse(BaseModel): result: Optional[object] = None + start_time_ms: Optional[int] = None + """Start time of the invocation.""" + status: Optional[Literal["created", "running", "success", "failure", "canceled", "suspended"]] = None diff --git a/src/runloop_api_client/types/functions/invocation_retrieve_response.py b/src/runloop_api_client/types/functions/invocation_retrieve_response.py index bc3658908..ca2b8e063 100644 --- a/src/runloop_api_client/types/functions/invocation_retrieve_response.py +++ b/src/runloop_api_client/types/functions/invocation_retrieve_response.py @@ -12,6 +12,9 @@ class InvocationRetrieveResponse(BaseModel): id: Optional[str] = None """Unique ID of the invocation.""" + end_time_ms: Optional[int] = None + """End time of the invocation.""" + error: Optional[str] = None function_name: Optional[str] = None @@ -33,4 +36,7 @@ class InvocationRetrieveResponse(BaseModel): result: Optional[object] = None + start_time_ms: Optional[int] = None + """Start time of the invocation.""" + status: Optional[Literal["created", "running", "success", "failure", "canceled", "suspended"]] = None From c690aeef91a301571d38563ea38d52fe123deed5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 18:12:19 +0000 Subject: [PATCH 041/993] feat(api): OpenAPI spec update via Stainless API (#43) --- .stats.yml | 2 +- .../resources/devboxes/devboxes.py | 18 ++++++++++++++---- .../types/devbox_create_params.py | 9 ++++++++- tests/api_resources/test_devboxes.py | 2 ++ 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9ddcd6f35..d5120016e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-aee1608866afd5556819617774f429625e10140d9a18b7de15b9452e87aa89c1.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1646f4ecd9f09b355c961b29aa0ea105d50275bdd65c8bcb4a94e0ceeb6541a2.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index f83313a1f..612c4719b 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -56,6 +56,7 @@ def create( entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, image_id: str | NotGiven = NOT_GIVEN, + image_name: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -79,8 +80,11 @@ def create( environment_variables: (Optional) Environment variables used to configure your Devbox. - image_id: (Optional) Image to use as the for the Devbox. If none set, the default Runloop - image will be used. + image_id: (Optional) Image to use for the Devbox. If none set, the default Runloop image + will be used. + + image_name: (Optional) Name of image to use for the Devbox. When set, this will load the + latest successfully built image with the given name. name: (Optional) A user specified name to give the Devbox. @@ -104,6 +108,7 @@ def create( "entrypoint": entrypoint, "environment_variables": environment_variables, "image_id": image_id, + "image_name": image_name, "name": name, "setup_commands": setup_commands, }, @@ -293,6 +298,7 @@ async def create( entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, image_id: str | NotGiven = NOT_GIVEN, + image_name: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -316,8 +322,11 @@ async def create( environment_variables: (Optional) Environment variables used to configure your Devbox. - image_id: (Optional) Image to use as the for the Devbox. If none set, the default Runloop - image will be used. + image_id: (Optional) Image to use for the Devbox. If none set, the default Runloop image + will be used. + + image_name: (Optional) Name of image to use for the Devbox. When set, this will load the + latest successfully built image with the given name. name: (Optional) A user specified name to give the Devbox. @@ -341,6 +350,7 @@ async def create( "entrypoint": entrypoint, "environment_variables": environment_variables, "image_id": image_id, + "image_name": image_name, "name": name, "setup_commands": setup_commands, }, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 7c6b6f340..f9fe5f4e7 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -23,11 +23,18 @@ class DevboxCreateParams(TypedDict, total=False): """(Optional) Environment variables used to configure your Devbox.""" image_id: str - """(Optional) Image to use as the for the Devbox. + """(Optional) Image to use for the Devbox. If none set, the default Runloop image will be used. """ + image_name: str + """(Optional) Name of image to use for the Devbox. + + When set, this will load the latest successfully built image with the given + name. + """ + name: str """(Optional) A user specified name to give the Devbox.""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 94e283126..863b38e95 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -33,6 +33,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: entrypoint="entrypoint", environment_variables={"foo": "string"}, image_id="image_id", + image_name="image_name", name="name", setup_commands=["string", "string", "string"], ) @@ -230,6 +231,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - entrypoint="entrypoint", environment_variables={"foo": "string"}, image_id="image_id", + image_name="image_name", name="name", setup_commands=["string", "string", "string"], ) From b25cdf04dfb90cade2abb8a552f0ada0ff12cf63 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 00:12:16 +0000 Subject: [PATCH 042/993] feat(api): OpenAPI spec update via Stainless API (#44) --- .stats.yml | 2 +- .../resources/devboxes/devboxes.py | 40 +++++++++---------- .../types/devbox_create_params.py | 26 ++++++------ tests/api_resources/test_devboxes.py | 8 ++-- 4 files changed, 38 insertions(+), 38 deletions(-) diff --git a/.stats.yml b/.stats.yml index d5120016e..f549efbd0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1646f4ecd9f09b355c961b29aa0ea105d50275bdd65c8bcb4a94e0ceeb6541a2.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-aa6caa3595f38c8e665e0869e7424eb27a81cdf2a02ecbbcc162330d979abaeb.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 612c4719b..66b569082 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -52,11 +52,11 @@ def with_streaming_response(self) -> DevboxesResourceWithStreamingResponse: def create( self, *, + blueprint_id: str | NotGiven = NOT_GIVEN, + blueprint_name: str | NotGiven = NOT_GIVEN, code_handle: str | NotGiven = NOT_GIVEN, entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, - image_id: str | NotGiven = NOT_GIVEN, - image_name: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -72,6 +72,12 @@ def create( the 'pending' state and will transition to 'running' once it is ready. Args: + blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be + created with the default Runloop Devbox image. + + blueprint_name: (Optional) Name of Blueprint to use for the Devbox. When set, this will load the + latest successfully built Blueprint with the given name. + code_handle: (Optional) Id of a code handle to mount to devbox. entrypoint: (Optional) When specified, the Devbox will run this script as its main @@ -80,12 +86,6 @@ def create( environment_variables: (Optional) Environment variables used to configure your Devbox. - image_id: (Optional) Image to use for the Devbox. If none set, the default Runloop image - will be used. - - image_name: (Optional) Name of image to use for the Devbox. When set, this will load the - latest successfully built image with the given name. - name: (Optional) A user specified name to give the Devbox. setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include @@ -104,11 +104,11 @@ def create( "/v1/devboxes", body=maybe_transform( { + "blueprint_id": blueprint_id, + "blueprint_name": blueprint_name, "code_handle": code_handle, "entrypoint": entrypoint, "environment_variables": environment_variables, - "image_id": image_id, - "image_name": image_name, "name": name, "setup_commands": setup_commands, }, @@ -294,11 +294,11 @@ def with_streaming_response(self) -> AsyncDevboxesResourceWithStreamingResponse: async def create( self, *, + blueprint_id: str | NotGiven = NOT_GIVEN, + blueprint_name: str | NotGiven = NOT_GIVEN, code_handle: str | NotGiven = NOT_GIVEN, entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, - image_id: str | NotGiven = NOT_GIVEN, - image_name: str | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -314,6 +314,12 @@ async def create( the 'pending' state and will transition to 'running' once it is ready. Args: + blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be + created with the default Runloop Devbox image. + + blueprint_name: (Optional) Name of Blueprint to use for the Devbox. When set, this will load the + latest successfully built Blueprint with the given name. + code_handle: (Optional) Id of a code handle to mount to devbox. entrypoint: (Optional) When specified, the Devbox will run this script as its main @@ -322,12 +328,6 @@ async def create( environment_variables: (Optional) Environment variables used to configure your Devbox. - image_id: (Optional) Image to use for the Devbox. If none set, the default Runloop image - will be used. - - image_name: (Optional) Name of image to use for the Devbox. When set, this will load the - latest successfully built image with the given name. - name: (Optional) A user specified name to give the Devbox. setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include @@ -346,11 +346,11 @@ async def create( "/v1/devboxes", body=await async_maybe_transform( { + "blueprint_id": blueprint_id, + "blueprint_name": blueprint_name, "code_handle": code_handle, "entrypoint": entrypoint, "environment_variables": environment_variables, - "image_id": image_id, - "image_name": image_name, "name": name, "setup_commands": setup_commands, }, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index f9fe5f4e7..bedde6c80 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -9,6 +9,19 @@ class DevboxCreateParams(TypedDict, total=False): + blueprint_id: str + """(Optional) Blueprint to use for the Devbox. + + If none set, the Devbox will be created with the default Runloop Devbox image. + """ + + blueprint_name: str + """(Optional) Name of Blueprint to use for the Devbox. + + When set, this will load the latest successfully built Blueprint with the given + name. + """ + code_handle: str """(Optional) Id of a code handle to mount to devbox.""" @@ -22,19 +35,6 @@ class DevboxCreateParams(TypedDict, total=False): environment_variables: Dict[str, str] """(Optional) Environment variables used to configure your Devbox.""" - image_id: str - """(Optional) Image to use for the Devbox. - - If none set, the default Runloop image will be used. - """ - - image_name: str - """(Optional) Name of image to use for the Devbox. - - When set, this will load the latest successfully built image with the given - name. - """ - name: str """(Optional) A user specified name to give the Devbox.""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 863b38e95..ac2f14534 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -29,11 +29,11 @@ def test_method_create(self, client: Runloop) -> None: @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.create( + blueprint_id="blueprint_id", + blueprint_name="blueprint_name", code_handle="code_handle", entrypoint="entrypoint", environment_variables={"foo": "string"}, - image_id="image_id", - image_name="image_name", name="name", setup_commands=["string", "string", "string"], ) @@ -227,11 +227,11 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.create( + blueprint_id="blueprint_id", + blueprint_name="blueprint_name", code_handle="code_handle", entrypoint="entrypoint", environment_variables={"foo": "string"}, - image_id="image_id", - image_name="image_name", name="name", setup_commands=["string", "string", "string"], ) From 6559ee2437eb50e9e0ca9fca4236dadc6de67e84 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 00:13:09 +0000 Subject: [PATCH 043/993] chore(internal): add type construction helper (#45) --- src/runloop_api_client/_models.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index eb7ce3bde..5148d5a7b 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -406,6 +406,15 @@ def build( return cast(_BaseModelT, construct_type(type_=base_model_cls, value=kwargs)) +def construct_type_unchecked(*, value: object, type_: type[_T]) -> _T: + """Loose coercion to the expected type with construction of nested values. + + Note: the returned value from this function is not guaranteed to match the + given type. + """ + return cast(_T, construct_type(value=value, type_=type_)) + + def construct_type(*, value: object, type_: object) -> object: """Loose coercion to the expected type with construction of nested values. From 7b276be1b1d476ebb60e7347130091cde6baf00b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 06:12:23 +0000 Subject: [PATCH 044/993] feat(api): OpenAPI spec update via Stainless API (#46) --- .stats.yml | 2 +- src/runloop_api_client/types/devbox_view.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index f549efbd0..b2b4c13a7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-aa6caa3595f38c8e665e0869e7424eb27a81cdf2a02ecbbcc162330d979abaeb.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-86d074c66f5140455eedb277c3ad3de81ec91f5cbd6ade28ef00ea2546dcc95e.yml diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index d85fb68e0..36ca053cd 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -12,6 +12,9 @@ class DevboxView(BaseModel): id: Optional[str] = None """The id of the Devbox.""" + blueprint_id: Optional[str] = None + """The Blueprint ID used in creation of the Devbox, if any.""" + create_time_ms: Optional[int] = None """Creation time of the Devbox (Unix timestamp milliseconds).""" From 87e74a5021228b2e8173c6a840308094b0136a65 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 15:05:52 +0000 Subject: [PATCH 045/993] feat(api): OpenAPI spec update via Stainless API (#47) --- .stats.yml | 2 +- src/runloop_api_client/types/devbox_view.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index b2b4c13a7..f549efbd0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-86d074c66f5140455eedb277c3ad3de81ec91f5cbd6ade28ef00ea2546dcc95e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-aa6caa3595f38c8e665e0869e7424eb27a81cdf2a02ecbbcc162330d979abaeb.yml diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 36ca053cd..d85fb68e0 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -12,9 +12,6 @@ class DevboxView(BaseModel): id: Optional[str] = None """The id of the Devbox.""" - blueprint_id: Optional[str] = None - """The Blueprint ID used in creation of the Devbox, if any.""" - create_time_ms: Optional[int] = None """Creation time of the Devbox (Unix timestamp milliseconds).""" From 7829d9e83100bda66517f64713306b6c5f305795 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 15:12:17 +0000 Subject: [PATCH 046/993] feat(api): OpenAPI spec update via Stainless API (#48) --- .stats.yml | 2 +- src/runloop_api_client/types/devbox_view.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index f549efbd0..b2b4c13a7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 14 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-aa6caa3595f38c8e665e0869e7424eb27a81cdf2a02ecbbcc162330d979abaeb.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-86d074c66f5140455eedb277c3ad3de81ec91f5cbd6ade28ef00ea2546dcc95e.yml diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index d85fb68e0..36ca053cd 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -12,6 +12,9 @@ class DevboxView(BaseModel): id: Optional[str] = None """The id of the Devbox.""" + blueprint_id: Optional[str] = None + """The Blueprint ID used in creation of the Devbox, if any.""" + create_time_ms: Optional[int] = None """Creation time of the Devbox (Unix timestamp milliseconds).""" From d412c623433b1c4e0f30c63a08aa09d6cb912425 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 17:09:12 +0000 Subject: [PATCH 047/993] feat(api): OpenAPI spec update via Stainless API (#49) --- .stats.yml | 2 +- README.md | 22 +- api.md | 37 ++ src/runloop_api_client/_client.py | 8 + src/runloop_api_client/resources/__init__.py | 14 + .../resources/blueprints.py | 327 ++++++++++++++++++ src/runloop_api_client/types/__init__.py | 9 + .../types/blueprint_build_log.py | 18 + .../types/blueprint_build_logs_list_view.py | 16 + .../types/blueprint_build_parameters.py | 34 ++ .../types/blueprint_create_params.py | 36 ++ .../types/blueprint_preview_view.py | 12 + .../types/blueprint_view.py | 26 ++ .../types/code_mount_parameters.py | 24 ++ .../types/code_mount_parameters_param.py | 24 ++ src/runloop_api_client/types/resource_size.py | 7 + tests/api_resources/test_blueprints.py | 268 ++++++++++++++ tests/test_client.py | 16 +- 18 files changed, 880 insertions(+), 20 deletions(-) create mode 100644 src/runloop_api_client/resources/blueprints.py create mode 100644 src/runloop_api_client/types/blueprint_build_log.py create mode 100644 src/runloop_api_client/types/blueprint_build_logs_list_view.py create mode 100644 src/runloop_api_client/types/blueprint_build_parameters.py create mode 100644 src/runloop_api_client/types/blueprint_create_params.py create mode 100644 src/runloop_api_client/types/blueprint_preview_view.py create mode 100644 src/runloop_api_client/types/blueprint_view.py create mode 100644 src/runloop_api_client/types/code_mount_parameters.py create mode 100644 src/runloop_api_client/types/code_mount_parameters_param.py create mode 100644 src/runloop_api_client/types/resource_size.py create mode 100644 tests/api_resources/test_blueprints.py diff --git a/.stats.yml b/.stats.yml index b2b4c13a7..ac9d2e3e2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 14 +configured_endpoints: 17 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-86d074c66f5140455eedb277c3ad3de81ec91f5cbd6ade28ef00ea2546dcc95e.yml diff --git a/README.md b/README.md index a0f0835fc..2d8b20b38 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,8 @@ client = Runloop( bearer_token=os.environ.get("RUNLOOP_BEARER_TOKEN"), ) -devbox_view = client.devboxes.create() -print(devbox_view.id) +blueprint_preview_view = client.blueprints.create() +print(blueprint_preview_view.dockerfile) ``` While you can provide a `bearer_token` keyword argument, @@ -57,8 +57,8 @@ client = AsyncRunloop( async def main() -> None: - devbox_view = await client.devboxes.create() - print(devbox_view.id) + blueprint_preview_view = await client.blueprints.create() + print(blueprint_preview_view.dockerfile) asyncio.run(main()) @@ -91,7 +91,7 @@ from runloop_api_client import Runloop client = Runloop() try: - client.devboxes.create() + client.blueprints.create() except runloop_api_client.APIConnectionError as e: print("The server could not be reached") print(e.__cause__) # an underlying Exception, likely raised within httpx. @@ -134,7 +134,7 @@ client = Runloop( ) # Or, configure per-request: -client.with_options(max_retries=5).devboxes.create() +client.with_options(max_retries=5).blueprints.create() ``` ### Timeouts @@ -157,7 +157,7 @@ client = Runloop( ) # Override per-request: -client.with_options(timeout=5.0).devboxes.create() +client.with_options(timeout=5.0).blueprints.create() ``` On timeout, an `APITimeoutError` is thrown. @@ -196,11 +196,11 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to from runloop_api_client import Runloop client = Runloop() -response = client.devboxes.with_raw_response.create() +response = client.blueprints.with_raw_response.create() print(response.headers.get('X-My-Header')) -devbox = response.parse() # get the object that `devboxes.create()` would have returned -print(devbox.id) +blueprint = response.parse() # get the object that `blueprints.create()` would have returned +print(blueprint.dockerfile) ``` These methods return an [`APIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_api_client/_response.py) object. @@ -214,7 +214,7 @@ The above interface eagerly reads the full response body when you make the reque To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods. ```python -with client.devboxes.with_streaming_response.create() as response: +with client.blueprints.with_streaming_response.create() as response: print(response.headers.get("X-My-Header")) for line in response.iter_lines(): diff --git a/api.md b/api.md index 8fa2c52fe..78aa65514 100644 --- a/api.md +++ b/api.md @@ -4,6 +4,43 @@ from runloop_api_client.types import ProjectLogsView ``` +# Account + +Types: + +```python +from runloop_api_client.types import ResourceSize +``` + +# Blueprints + +Types: + +```python +from runloop_api_client.types import ( + BlueprintBuildLog, + BlueprintBuildLogsListView, + BlueprintBuildParameters, + BlueprintListView, + BlueprintPreviewView, + BlueprintView, +) +``` + +Methods: + +- client.blueprints.create(\*\*params) -> BlueprintPreviewView +- client.blueprints.retrieve(id) -> BlueprintView +- client.blueprints.list() -> BlueprintBuildLogsListView + +# Code + +Types: + +```python +from runloop_api_client.types import CodeMountParameters +``` + # Devboxes Types: diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index 11b16c4a1..299f27265 100644 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -46,6 +46,7 @@ class Runloop(SyncAPIClient): + blueprints: resources.BlueprintsResource devboxes: resources.DevboxesResource functions: resources.FunctionsResource projects: resources.ProjectsResource @@ -106,6 +107,7 @@ def __init__( _strict_response_validation=_strict_response_validation, ) + self.blueprints = resources.BlueprintsResource(self) self.devboxes = resources.DevboxesResource(self) self.functions = resources.FunctionsResource(self) self.projects = resources.ProjectsResource(self) @@ -218,6 +220,7 @@ def _make_status_error( class AsyncRunloop(AsyncAPIClient): + blueprints: resources.AsyncBlueprintsResource devboxes: resources.AsyncDevboxesResource functions: resources.AsyncFunctionsResource projects: resources.AsyncProjectsResource @@ -278,6 +281,7 @@ def __init__( _strict_response_validation=_strict_response_validation, ) + self.blueprints = resources.AsyncBlueprintsResource(self) self.devboxes = resources.AsyncDevboxesResource(self) self.functions = resources.AsyncFunctionsResource(self) self.projects = resources.AsyncProjectsResource(self) @@ -391,6 +395,7 @@ def _make_status_error( class RunloopWithRawResponse: def __init__(self, client: Runloop) -> None: + self.blueprints = resources.BlueprintsResourceWithRawResponse(client.blueprints) self.devboxes = resources.DevboxesResourceWithRawResponse(client.devboxes) self.functions = resources.FunctionsResourceWithRawResponse(client.functions) self.projects = resources.ProjectsResourceWithRawResponse(client.projects) @@ -398,6 +403,7 @@ def __init__(self, client: Runloop) -> None: class AsyncRunloopWithRawResponse: def __init__(self, client: AsyncRunloop) -> None: + self.blueprints = resources.AsyncBlueprintsResourceWithRawResponse(client.blueprints) self.devboxes = resources.AsyncDevboxesResourceWithRawResponse(client.devboxes) self.functions = resources.AsyncFunctionsResourceWithRawResponse(client.functions) self.projects = resources.AsyncProjectsResourceWithRawResponse(client.projects) @@ -405,6 +411,7 @@ def __init__(self, client: AsyncRunloop) -> None: class RunloopWithStreamedResponse: def __init__(self, client: Runloop) -> None: + self.blueprints = resources.BlueprintsResourceWithStreamingResponse(client.blueprints) self.devboxes = resources.DevboxesResourceWithStreamingResponse(client.devboxes) self.functions = resources.FunctionsResourceWithStreamingResponse(client.functions) self.projects = resources.ProjectsResourceWithStreamingResponse(client.projects) @@ -412,6 +419,7 @@ def __init__(self, client: Runloop) -> None: class AsyncRunloopWithStreamedResponse: def __init__(self, client: AsyncRunloop) -> None: + self.blueprints = resources.AsyncBlueprintsResourceWithStreamingResponse(client.blueprints) self.devboxes = resources.AsyncDevboxesResourceWithStreamingResponse(client.devboxes) self.functions = resources.AsyncFunctionsResourceWithStreamingResponse(client.functions) self.projects = resources.AsyncProjectsResourceWithStreamingResponse(client.projects) diff --git a/src/runloop_api_client/resources/__init__.py b/src/runloop_api_client/resources/__init__.py index 267ebf13d..f36499829 100644 --- a/src/runloop_api_client/resources/__init__.py +++ b/src/runloop_api_client/resources/__init__.py @@ -24,8 +24,22 @@ FunctionsResourceWithStreamingResponse, AsyncFunctionsResourceWithStreamingResponse, ) +from .blueprints import ( + BlueprintsResource, + AsyncBlueprintsResource, + BlueprintsResourceWithRawResponse, + AsyncBlueprintsResourceWithRawResponse, + BlueprintsResourceWithStreamingResponse, + AsyncBlueprintsResourceWithStreamingResponse, +) __all__ = [ + "BlueprintsResource", + "AsyncBlueprintsResource", + "BlueprintsResourceWithRawResponse", + "AsyncBlueprintsResourceWithRawResponse", + "BlueprintsResourceWithStreamingResponse", + "AsyncBlueprintsResourceWithStreamingResponse", "DevboxesResource", "AsyncDevboxesResource", "DevboxesResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py new file mode 100644 index 000000000..bbb16376d --- /dev/null +++ b/src/runloop_api_client/resources/blueprints.py @@ -0,0 +1,327 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable + +import httpx + +from ..types import blueprint_create_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + maybe_transform, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.blueprint_view import BlueprintView +from ..types.blueprint_preview_view import BlueprintPreviewView +from ..types.code_mount_parameters_param import CodeMountParametersParam +from ..types.blueprint_build_logs_list_view import BlueprintBuildLogsListView + +__all__ = ["BlueprintsResource", "AsyncBlueprintsResource"] + + +class BlueprintsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> BlueprintsResourceWithRawResponse: + return BlueprintsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> BlueprintsResourceWithStreamingResponse: + return BlueprintsResourceWithStreamingResponse(self) + + def create( + self, + *, + code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, + dockerfile: str | NotGiven = NOT_GIVEN, + launch_parameters: blueprint_create_params.LaunchParameters | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + system_setup_commands: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BlueprintPreviewView: + """Preview building an image with the specified configuration. + + You can take the + resulting Dockerfile and test out your build. + + Args: + code_mounts: A list of code mounts to be included in the Blueprint. + + dockerfile: Dockerfile contents to be used to build the Blueprint. + + launch_parameters: Parameters to configure your Devbox at launch time. + + name: Name of the Blueprint. + + system_setup_commands: A list of commands to run to set up your system. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/v1/blueprints", + body=maybe_transform( + { + "code_mounts": code_mounts, + "dockerfile": dockerfile, + "launch_parameters": launch_parameters, + "name": name, + "system_setup_commands": system_setup_commands, + }, + blueprint_create_params.BlueprintCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BlueprintPreviewView, + ) + + def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BlueprintView: + """ + Get a previously built Image. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/blueprints/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BlueprintView, + ) + + def list( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BlueprintBuildLogsListView: + """Get Image logs.""" + return self._get( + "/v1/blueprints", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BlueprintBuildLogsListView, + ) + + +class AsyncBlueprintsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncBlueprintsResourceWithRawResponse: + return AsyncBlueprintsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncBlueprintsResourceWithStreamingResponse: + return AsyncBlueprintsResourceWithStreamingResponse(self) + + async def create( + self, + *, + code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, + dockerfile: str | NotGiven = NOT_GIVEN, + launch_parameters: blueprint_create_params.LaunchParameters | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + system_setup_commands: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BlueprintPreviewView: + """Preview building an image with the specified configuration. + + You can take the + resulting Dockerfile and test out your build. + + Args: + code_mounts: A list of code mounts to be included in the Blueprint. + + dockerfile: Dockerfile contents to be used to build the Blueprint. + + launch_parameters: Parameters to configure your Devbox at launch time. + + name: Name of the Blueprint. + + system_setup_commands: A list of commands to run to set up your system. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/v1/blueprints", + body=await async_maybe_transform( + { + "code_mounts": code_mounts, + "dockerfile": dockerfile, + "launch_parameters": launch_parameters, + "name": name, + "system_setup_commands": system_setup_commands, + }, + blueprint_create_params.BlueprintCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BlueprintPreviewView, + ) + + async def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BlueprintView: + """ + Get a previously built Image. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/blueprints/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BlueprintView, + ) + + async def list( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BlueprintBuildLogsListView: + """Get Image logs.""" + return await self._get( + "/v1/blueprints", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BlueprintBuildLogsListView, + ) + + +class BlueprintsResourceWithRawResponse: + def __init__(self, blueprints: BlueprintsResource) -> None: + self._blueprints = blueprints + + self.create = to_raw_response_wrapper( + blueprints.create, + ) + self.retrieve = to_raw_response_wrapper( + blueprints.retrieve, + ) + self.list = to_raw_response_wrapper( + blueprints.list, + ) + + +class AsyncBlueprintsResourceWithRawResponse: + def __init__(self, blueprints: AsyncBlueprintsResource) -> None: + self._blueprints = blueprints + + self.create = async_to_raw_response_wrapper( + blueprints.create, + ) + self.retrieve = async_to_raw_response_wrapper( + blueprints.retrieve, + ) + self.list = async_to_raw_response_wrapper( + blueprints.list, + ) + + +class BlueprintsResourceWithStreamingResponse: + def __init__(self, blueprints: BlueprintsResource) -> None: + self._blueprints = blueprints + + self.create = to_streamed_response_wrapper( + blueprints.create, + ) + self.retrieve = to_streamed_response_wrapper( + blueprints.retrieve, + ) + self.list = to_streamed_response_wrapper( + blueprints.list, + ) + + +class AsyncBlueprintsResourceWithStreamingResponse: + def __init__(self, blueprints: AsyncBlueprintsResource) -> None: + self._blueprints = blueprints + + self.create = async_to_streamed_response_wrapper( + blueprints.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + blueprints.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + blueprints.list, + ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 6037aef82..4a1c760dd 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -4,14 +4,23 @@ from .shared import ProjectLogsView as ProjectLogsView from .devbox_view import DevboxView as DevboxView +from .resource_size import ResourceSize as ResourceSize +from .blueprint_view import BlueprintView as BlueprintView from .devbox_list_view import DevboxListView as DevboxListView from .project_list_view import ProjectListView as ProjectListView from .devbox_list_params import DevboxListParams as DevboxListParams from .function_list_view import FunctionListView as FunctionListView +from .blueprint_build_log import BlueprintBuildLog as BlueprintBuildLog from .devbox_create_params import DevboxCreateParams as DevboxCreateParams +from .code_mount_parameters import CodeMountParameters as CodeMountParameters +from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView +from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams +from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams +from .code_mount_parameters_param import CodeMountParametersParam as CodeMountParametersParam from .function_invoke_sync_params import FunctionInvokeSyncParams as FunctionInvokeSyncParams from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams from .function_invoke_sync_response import FunctionInvokeSyncResponse as FunctionInvokeSyncResponse +from .blueprint_build_logs_list_view import BlueprintBuildLogsListView as BlueprintBuildLogsListView from .function_invoke_async_response import FunctionInvokeAsyncResponse as FunctionInvokeAsyncResponse diff --git a/src/runloop_api_client/types/blueprint_build_log.py b/src/runloop_api_client/types/blueprint_build_log.py new file mode 100644 index 000000000..e77767c2a --- /dev/null +++ b/src/runloop_api_client/types/blueprint_build_log.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["BlueprintBuildLog"] + + +class BlueprintBuildLog(BaseModel): + level: Optional[str] = None + """Log line severity level.""" + + message: Optional[str] = None + """Log line message.""" + + timestamp_ms: Optional[int] = None + """Time of log (Unix timestamp milliseconds).""" diff --git a/src/runloop_api_client/types/blueprint_build_logs_list_view.py b/src/runloop_api_client/types/blueprint_build_logs_list_view.py new file mode 100644 index 000000000..0d2618847 --- /dev/null +++ b/src/runloop_api_client/types/blueprint_build_logs_list_view.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from .._models import BaseModel +from .blueprint_build_log import BlueprintBuildLog + +__all__ = ["BlueprintBuildLogsListView"] + + +class BlueprintBuildLogsListView(BaseModel): + blueprint_id: Optional[str] = None + """ID of the Blueprint.""" + + logs: Optional[List[BlueprintBuildLog]] = None + """List of logs generated during Blueprint build.""" diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py new file mode 100644 index 000000000..0474fcb02 --- /dev/null +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from .._models import BaseModel +from .resource_size import ResourceSize +from .code_mount_parameters import CodeMountParameters + +__all__ = ["BlueprintBuildParameters", "LaunchParameters"] + + +class LaunchParameters(BaseModel): + launch_commands: Optional[List[str]] = None + """Set of commands to be run at launch time, before the entrypoint process is run.""" + + resource_size_request: Optional[ResourceSize] = None + """Manual resource configuration for Devbox. If not set, defaults will be used.""" + + +class BlueprintBuildParameters(BaseModel): + code_mounts: Optional[List[CodeMountParameters]] = None + """A list of code mounts to be included in the Blueprint.""" + + dockerfile: Optional[str] = None + """Dockerfile contents to be used to build the Blueprint.""" + + launch_parameters: Optional[LaunchParameters] = None + """Parameters to configure your Devbox at launch time.""" + + name: Optional[str] = None + """Name of the Blueprint.""" + + system_setup_commands: Optional[List[str]] = None + """A list of commands to run to set up your system.""" diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py new file mode 100644 index 000000000..4cfc8c3e2 --- /dev/null +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import TypedDict + +from .resource_size import ResourceSize +from .code_mount_parameters_param import CodeMountParametersParam + +__all__ = ["BlueprintCreateParams", "LaunchParameters"] + + +class BlueprintCreateParams(TypedDict, total=False): + code_mounts: Iterable[CodeMountParametersParam] + """A list of code mounts to be included in the Blueprint.""" + + dockerfile: str + """Dockerfile contents to be used to build the Blueprint.""" + + launch_parameters: LaunchParameters + """Parameters to configure your Devbox at launch time.""" + + name: str + """Name of the Blueprint.""" + + system_setup_commands: List[str] + """A list of commands to run to set up your system.""" + + +class LaunchParameters(TypedDict, total=False): + launch_commands: List[str] + """Set of commands to be run at launch time, before the entrypoint process is run.""" + + resource_size_request: ResourceSize + """Manual resource configuration for Devbox. If not set, defaults will be used.""" diff --git a/src/runloop_api_client/types/blueprint_preview_view.py b/src/runloop_api_client/types/blueprint_preview_view.py new file mode 100644 index 000000000..0e42327c2 --- /dev/null +++ b/src/runloop_api_client/types/blueprint_preview_view.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["BlueprintPreviewView"] + + +class BlueprintPreviewView(BaseModel): + dockerfile: Optional[str] = None + """The Dockerfile contents that will built.""" diff --git a/src/runloop_api_client/types/blueprint_view.py b/src/runloop_api_client/types/blueprint_view.py new file mode 100644 index 000000000..72d55f399 --- /dev/null +++ b/src/runloop_api_client/types/blueprint_view.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from .._models import BaseModel +from .blueprint_build_parameters import BlueprintBuildParameters + +__all__ = ["BlueprintView"] + + +class BlueprintView(BaseModel): + id: Optional[str] = None + """The id of the Blueprint.""" + + create_time_ms: Optional[int] = None + """Creation time of the Blueprint (Unix timestamp milliseconds).""" + + name: Optional[str] = None + """The name of the Blueprint.""" + + parameters: Optional[BlueprintBuildParameters] = None + """The parameters used to create Blueprint.""" + + status: Optional[Literal["provisioning", "building", "failed", "build_complete"]] = None + """The status of the Blueprint build.""" diff --git a/src/runloop_api_client/types/code_mount_parameters.py b/src/runloop_api_client/types/code_mount_parameters.py new file mode 100644 index 000000000..1d4c1cac7 --- /dev/null +++ b/src/runloop_api_client/types/code_mount_parameters.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["CodeMountParameters"] + + +class CodeMountParameters(BaseModel): + token: Optional[str] = None + """The authentication token necessary to pull repo.""" + + install_command: Optional[str] = None + """Installation command to install and setup repository.""" + + repo_name: Optional[str] = None + """The name of the repo to mount. + + By default, code will be mounted at /home/user/{repo_name}s. + """ + + repo_owner: Optional[str] = None + """The owner of the repo.""" diff --git a/src/runloop_api_client/types/code_mount_parameters_param.py b/src/runloop_api_client/types/code_mount_parameters_param.py new file mode 100644 index 000000000..0fa99b5af --- /dev/null +++ b/src/runloop_api_client/types/code_mount_parameters_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["CodeMountParametersParam"] + + +class CodeMountParametersParam(TypedDict, total=False): + token: str + """The authentication token necessary to pull repo.""" + + install_command: str + """Installation command to install and setup repository.""" + + repo_name: str + """The name of the repo to mount. + + By default, code will be mounted at /home/user/{repo_name}s. + """ + + repo_owner: str + """The owner of the repo.""" diff --git a/src/runloop_api_client/types/resource_size.py b/src/runloop_api_client/types/resource_size.py new file mode 100644 index 000000000..7bd7db794 --- /dev/null +++ b/src/runloop_api_client/types/resource_size.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +__all__ = ["ResourceSize"] + +ResourceSize = Literal["MINI", "SMALL", "MEDIUM", "LARGE"] diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py new file mode 100644 index 000000000..177d75d9d --- /dev/null +++ b/tests/api_resources/test_blueprints.py @@ -0,0 +1,268 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types import ( + BlueprintView, + BlueprintPreviewView, + BlueprintBuildLogsListView, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestBlueprints: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Runloop) -> None: + blueprint = client.blueprints.create() + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Runloop) -> None: + blueprint = client.blueprints.create( + code_mounts=[ + { + "repo_name": "repo_name", + "repo_owner": "repo_owner", + "install_command": "install_command", + "token": "token", + }, + { + "repo_name": "repo_name", + "repo_owner": "repo_owner", + "install_command": "install_command", + "token": "token", + }, + { + "repo_name": "repo_name", + "repo_owner": "repo_owner", + "install_command": "install_command", + "token": "token", + }, + ], + dockerfile="dockerfile", + launch_parameters={ + "launch_commands": ["string", "string", "string"], + "resource_size_request": "MINI", + }, + name="name", + system_setup_commands=["string", "string", "string"], + ) + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Runloop) -> None: + response = client.blueprints.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = response.parse() + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Runloop) -> None: + with client.blueprints.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + blueprint = response.parse() + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + blueprint = client.blueprints.retrieve( + "id", + ) + assert_matches_type(BlueprintView, blueprint, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.blueprints.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = response.parse() + assert_matches_type(BlueprintView, blueprint, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.blueprints.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + blueprint = response.parse() + assert_matches_type(BlueprintView, blueprint, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.blueprints.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + blueprint = client.blueprints.list() + assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.blueprints.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = response.parse() + assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.blueprints.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + blueprint = response.parse() + assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncBlueprints: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncRunloop) -> None: + blueprint = await async_client.blueprints.create() + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: + blueprint = await async_client.blueprints.create( + code_mounts=[ + { + "repo_name": "repo_name", + "repo_owner": "repo_owner", + "install_command": "install_command", + "token": "token", + }, + { + "repo_name": "repo_name", + "repo_owner": "repo_owner", + "install_command": "install_command", + "token": "token", + }, + { + "repo_name": "repo_name", + "repo_owner": "repo_owner", + "install_command": "install_command", + "token": "token", + }, + ], + dockerfile="dockerfile", + launch_parameters={ + "launch_commands": ["string", "string", "string"], + "resource_size_request": "MINI", + }, + name="name", + system_setup_commands=["string", "string", "string"], + ) + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: + response = await async_client.blueprints.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = await response.parse() + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: + async with async_client.blueprints.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + blueprint = await response.parse() + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + blueprint = await async_client.blueprints.retrieve( + "id", + ) + assert_matches_type(BlueprintView, blueprint, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.blueprints.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = await response.parse() + assert_matches_type(BlueprintView, blueprint, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.blueprints.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + blueprint = await response.parse() + assert_matches_type(BlueprintView, blueprint, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.blueprints.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + blueprint = await async_client.blueprints.list() + assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.blueprints.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = await response.parse() + assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.blueprints.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + blueprint = await response.parse() + assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/test_client.py b/tests/test_client.py index 75431ad53..98e674233 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -732,11 +732,11 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: - respx_mock.post("/v1/devboxes").mock(side_effect=httpx.TimeoutException("Test timeout error")) + respx_mock.post("/v1/blueprints").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): self.client.post( - "/v1/devboxes", + "/v1/blueprints", body=cast(object, dict()), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, @@ -747,11 +747,11 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: - respx_mock.post("/v1/devboxes").mock(return_value=httpx.Response(500)) + respx_mock.post("/v1/blueprints").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): self.client.post( - "/v1/devboxes", + "/v1/blueprints", body=cast(object, dict()), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, @@ -1447,11 +1447,11 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: - respx_mock.post("/v1/devboxes").mock(side_effect=httpx.TimeoutException("Test timeout error")) + respx_mock.post("/v1/blueprints").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): await self.client.post( - "/v1/devboxes", + "/v1/blueprints", body=cast(object, dict()), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, @@ -1462,11 +1462,11 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: - respx_mock.post("/v1/devboxes").mock(return_value=httpx.Response(500)) + respx_mock.post("/v1/blueprints").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): await self.client.post( - "/v1/devboxes", + "/v1/blueprints", body=cast(object, dict()), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, From 01a24d4d553ad3ef604cfcb7f10fba25efce814f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 17:47:29 +0000 Subject: [PATCH 048/993] feat(api): OpenAPI spec update via Stainless API (#50) --- .stats.yml | 4 +- README.md | 16 +- api.md | 6 +- src/runloop_api_client/_client.py | 12 +- .../resources/blueprints.py | 307 +++++++++++++++++- src/runloop_api_client/types/__init__.py | 3 + .../types/blueprint_list_params.py | 18 + .../types/blueprint_list_view.py | 17 + .../types/blueprint_preview_params.py | 36 ++ tests/api_resources/test_blueprints.py | 235 +++++++++++++- 10 files changed, 607 insertions(+), 47 deletions(-) create mode 100644 src/runloop_api_client/types/blueprint_list_params.py create mode 100644 src/runloop_api_client/types/blueprint_list_view.py create mode 100644 src/runloop_api_client/types/blueprint_preview_params.py diff --git a/.stats.yml b/.stats.yml index ac9d2e3e2..16ba0936a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 17 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-86d074c66f5140455eedb277c3ad3de81ec91f5cbd6ade28ef00ea2546dcc95e.yml +configured_endpoints: 19 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c11fd761b5d15675ee672120e5600fd6dddd801d87c1fa6335c507184bdf60b5.yml diff --git a/README.md b/README.md index 2d8b20b38..b95c87a09 100644 --- a/README.md +++ b/README.md @@ -29,16 +29,16 @@ from runloop_api_client import Runloop client = Runloop( # This is the default and can be omitted - bearer_token=os.environ.get("RUNLOOP_BEARER_TOKEN"), + bearer_token=os.environ.get("RUNLOOP_API_KEY"), ) -blueprint_preview_view = client.blueprints.create() -print(blueprint_preview_view.dockerfile) +blueprint_view = client.blueprints.create() +print(blueprint_view.id) ``` While you can provide a `bearer_token` keyword argument, we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/) -to add `RUNLOOP_BEARER_TOKEN="My Bearer Token"` to your `.env` file +to add `RUNLOOP_API_KEY="My Bearer Token"` to your `.env` file so that your Bearer Token is not stored in source control. ## Async usage @@ -52,13 +52,13 @@ from runloop_api_client import AsyncRunloop client = AsyncRunloop( # This is the default and can be omitted - bearer_token=os.environ.get("RUNLOOP_BEARER_TOKEN"), + bearer_token=os.environ.get("RUNLOOP_API_KEY"), ) async def main() -> None: - blueprint_preview_view = await client.blueprints.create() - print(blueprint_preview_view.dockerfile) + blueprint_view = await client.blueprints.create() + print(blueprint_view.id) asyncio.run(main()) @@ -200,7 +200,7 @@ response = client.blueprints.with_raw_response.create() print(response.headers.get('X-My-Header')) blueprint = response.parse() # get the object that `blueprints.create()` would have returned -print(blueprint.dockerfile) +print(blueprint.id) ``` These methods return an [`APIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_api_client/_response.py) object. diff --git a/api.md b/api.md index 78aa65514..5904788a5 100644 --- a/api.md +++ b/api.md @@ -29,9 +29,11 @@ from runloop_api_client.types import ( Methods: -- client.blueprints.create(\*\*params) -> BlueprintPreviewView +- client.blueprints.create(\*\*params) -> BlueprintView - client.blueprints.retrieve(id) -> BlueprintView -- client.blueprints.list() -> BlueprintBuildLogsListView +- client.blueprints.list(\*\*params) -> BlueprintListView +- client.blueprints.logs(id) -> BlueprintBuildLogsListView +- client.blueprints.preview(\*\*params) -> BlueprintPreviewView # Code diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index 299f27265..1609aebcc 100644 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -81,13 +81,13 @@ def __init__( ) -> None: """Construct a new synchronous runloop client instance. - This automatically infers the `bearer_token` argument from the `RUNLOOP_BEARER_TOKEN` environment variable if it is not provided. + This automatically infers the `bearer_token` argument from the `RUNLOOP_API_KEY` environment variable if it is not provided. """ if bearer_token is None: - bearer_token = os.environ.get("RUNLOOP_BEARER_TOKEN") + bearer_token = os.environ.get("RUNLOOP_API_KEY") if bearer_token is None: raise RunloopError( - "The bearer_token client option must be set either by passing bearer_token to the client or by setting the RUNLOOP_BEARER_TOKEN environment variable" + "The bearer_token client option must be set either by passing bearer_token to the client or by setting the RUNLOOP_API_KEY environment variable" ) self.bearer_token = bearer_token @@ -255,13 +255,13 @@ def __init__( ) -> None: """Construct a new async runloop client instance. - This automatically infers the `bearer_token` argument from the `RUNLOOP_BEARER_TOKEN` environment variable if it is not provided. + This automatically infers the `bearer_token` argument from the `RUNLOOP_API_KEY` environment variable if it is not provided. """ if bearer_token is None: - bearer_token = os.environ.get("RUNLOOP_BEARER_TOKEN") + bearer_token = os.environ.get("RUNLOOP_API_KEY") if bearer_token is None: raise RunloopError( - "The bearer_token client option must be set either by passing bearer_token to the client or by setting the RUNLOOP_BEARER_TOKEN environment variable" + "The bearer_token client option must be set either by passing bearer_token to the client or by setting the RUNLOOP_API_KEY environment variable" ) self.bearer_token = bearer_token diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index bbb16376d..038394104 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -6,7 +6,7 @@ import httpx -from ..types import blueprint_create_params +from ..types import blueprint_list_params, blueprint_create_params, blueprint_preview_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( maybe_transform, @@ -22,6 +22,7 @@ ) from .._base_client import make_request_options from ..types.blueprint_view import BlueprintView +from ..types.blueprint_list_view import BlueprintListView from ..types.blueprint_preview_view import BlueprintPreviewView from ..types.code_mount_parameters_param import CodeMountParametersParam from ..types.blueprint_build_logs_list_view import BlueprintBuildLogsListView @@ -52,11 +53,12 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BlueprintPreviewView: - """Preview building an image with the specified configuration. + ) -> BlueprintView: + """Build a Blueprint with the specified configuration. - You can take the - resulting Dockerfile and test out your build. + The Blueprint will begin + building upon create, ' and will transition to 'building_complete' once it is + ready. Args: code_mounts: A list of code mounts to be included in the Blueprint. @@ -92,7 +94,7 @@ def create( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=BlueprintPreviewView, + cast_to=BlueprintView, ) def retrieve( @@ -107,7 +109,7 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> BlueprintView: """ - Get a previously built Image. + Get a previously built Blueprint. Args: extra_headers: Send extra headers @@ -131,22 +133,145 @@ def retrieve( def list( self, *, + limit: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BlueprintBuildLogsListView: - """Get Image logs.""" + ) -> BlueprintListView: + """List all blueprints or filter by name. + + If no status is provided, all blueprints + are returned. + + Args: + limit: Page Limit + + name: Filter by name + + starting_after: Load the next page starting after the given token. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ return self._get( "/v1/blueprints", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "name": name, + "starting_after": starting_after, + }, + blueprint_list_params.BlueprintListParams, + ), + ), + cast_to=BlueprintListView, + ) + + def logs( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BlueprintBuildLogsListView: + """ + Get Blueprint build logs. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/blueprints/{id}/logs", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=BlueprintBuildLogsListView, ) + def preview( + self, + *, + code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, + dockerfile: str | NotGiven = NOT_GIVEN, + launch_parameters: blueprint_preview_params.LaunchParameters | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + system_setup_commands: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BlueprintPreviewView: + """Preview building a Blueprint with the specified configuration. + + You can take the + resulting Dockerfile and test out your build. + + Args: + code_mounts: A list of code mounts to be included in the Blueprint. + + dockerfile: Dockerfile contents to be used to build the Blueprint. + + launch_parameters: Parameters to configure your Devbox at launch time. + + name: Name of the Blueprint. + + system_setup_commands: A list of commands to run to set up your system. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/v1/blueprints/preview", + body=maybe_transform( + { + "code_mounts": code_mounts, + "dockerfile": dockerfile, + "launch_parameters": launch_parameters, + "name": name, + "system_setup_commands": system_setup_commands, + }, + blueprint_preview_params.BlueprintPreviewParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BlueprintPreviewView, + ) + class AsyncBlueprintsResource(AsyncAPIResource): @cached_property @@ -171,11 +296,12 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BlueprintPreviewView: - """Preview building an image with the specified configuration. + ) -> BlueprintView: + """Build a Blueprint with the specified configuration. - You can take the - resulting Dockerfile and test out your build. + The Blueprint will begin + building upon create, ' and will transition to 'building_complete' once it is + ready. Args: code_mounts: A list of code mounts to be included in the Blueprint. @@ -211,7 +337,7 @@ async def create( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=BlueprintPreviewView, + cast_to=BlueprintView, ) async def retrieve( @@ -226,7 +352,7 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> BlueprintView: """ - Get a previously built Image. + Get a previously built Blueprint. Args: extra_headers: Send extra headers @@ -250,22 +376,145 @@ async def retrieve( async def list( self, *, + limit: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BlueprintBuildLogsListView: - """Get Image logs.""" + ) -> BlueprintListView: + """List all blueprints or filter by name. + + If no status is provided, all blueprints + are returned. + + Args: + limit: Page Limit + + name: Filter by name + + starting_after: Load the next page starting after the given token. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ return await self._get( "/v1/blueprints", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "limit": limit, + "name": name, + "starting_after": starting_after, + }, + blueprint_list_params.BlueprintListParams, + ), + ), + cast_to=BlueprintListView, + ) + + async def logs( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BlueprintBuildLogsListView: + """ + Get Blueprint build logs. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/blueprints/{id}/logs", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=BlueprintBuildLogsListView, ) + async def preview( + self, + *, + code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, + dockerfile: str | NotGiven = NOT_GIVEN, + launch_parameters: blueprint_preview_params.LaunchParameters | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + system_setup_commands: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BlueprintPreviewView: + """Preview building a Blueprint with the specified configuration. + + You can take the + resulting Dockerfile and test out your build. + + Args: + code_mounts: A list of code mounts to be included in the Blueprint. + + dockerfile: Dockerfile contents to be used to build the Blueprint. + + launch_parameters: Parameters to configure your Devbox at launch time. + + name: Name of the Blueprint. + + system_setup_commands: A list of commands to run to set up your system. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/v1/blueprints/preview", + body=await async_maybe_transform( + { + "code_mounts": code_mounts, + "dockerfile": dockerfile, + "launch_parameters": launch_parameters, + "name": name, + "system_setup_commands": system_setup_commands, + }, + blueprint_preview_params.BlueprintPreviewParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BlueprintPreviewView, + ) + class BlueprintsResourceWithRawResponse: def __init__(self, blueprints: BlueprintsResource) -> None: @@ -280,6 +529,12 @@ def __init__(self, blueprints: BlueprintsResource) -> None: self.list = to_raw_response_wrapper( blueprints.list, ) + self.logs = to_raw_response_wrapper( + blueprints.logs, + ) + self.preview = to_raw_response_wrapper( + blueprints.preview, + ) class AsyncBlueprintsResourceWithRawResponse: @@ -295,6 +550,12 @@ def __init__(self, blueprints: AsyncBlueprintsResource) -> None: self.list = async_to_raw_response_wrapper( blueprints.list, ) + self.logs = async_to_raw_response_wrapper( + blueprints.logs, + ) + self.preview = async_to_raw_response_wrapper( + blueprints.preview, + ) class BlueprintsResourceWithStreamingResponse: @@ -310,6 +571,12 @@ def __init__(self, blueprints: BlueprintsResource) -> None: self.list = to_streamed_response_wrapper( blueprints.list, ) + self.logs = to_streamed_response_wrapper( + blueprints.logs, + ) + self.preview = to_streamed_response_wrapper( + blueprints.preview, + ) class AsyncBlueprintsResourceWithStreamingResponse: @@ -325,3 +592,9 @@ def __init__(self, blueprints: AsyncBlueprintsResource) -> None: self.list = async_to_streamed_response_wrapper( blueprints.list, ) + self.logs = async_to_streamed_response_wrapper( + blueprints.logs, + ) + self.preview = async_to_streamed_response_wrapper( + blueprints.preview, + ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 4a1c760dd..c17ef2293 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -11,10 +11,13 @@ from .devbox_list_params import DevboxListParams as DevboxListParams from .function_list_view import FunctionListView as FunctionListView from .blueprint_build_log import BlueprintBuildLog as BlueprintBuildLog +from .blueprint_list_view import BlueprintListView as BlueprintListView from .devbox_create_params import DevboxCreateParams as DevboxCreateParams +from .blueprint_list_params import BlueprintListParams as BlueprintListParams from .code_mount_parameters import CodeMountParameters as CodeMountParameters from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams +from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams from .code_mount_parameters_param import CodeMountParametersParam as CodeMountParametersParam diff --git a/src/runloop_api_client/types/blueprint_list_params.py b/src/runloop_api_client/types/blueprint_list_params.py new file mode 100644 index 000000000..45f5f70ae --- /dev/null +++ b/src/runloop_api_client/types/blueprint_list_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["BlueprintListParams"] + + +class BlueprintListParams(TypedDict, total=False): + limit: str + """Page Limit""" + + name: str + """Filter by name""" + + starting_after: str + """Load the next page starting after the given token.""" diff --git a/src/runloop_api_client/types/blueprint_list_view.py b/src/runloop_api_client/types/blueprint_list_view.py new file mode 100644 index 000000000..001c66308 --- /dev/null +++ b/src/runloop_api_client/types/blueprint_list_view.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from .._models import BaseModel +from .blueprint_view import BlueprintView + +__all__ = ["BlueprintListView"] + + +class BlueprintListView(BaseModel): + blueprints: Optional[List[BlueprintView]] = None + """List of blueprints matching filter.""" + + has_more: Optional[bool] = None + + total_count: Optional[int] = None diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py new file mode 100644 index 000000000..c5b0e0fd9 --- /dev/null +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import TypedDict + +from .resource_size import ResourceSize +from .code_mount_parameters_param import CodeMountParametersParam + +__all__ = ["BlueprintPreviewParams", "LaunchParameters"] + + +class BlueprintPreviewParams(TypedDict, total=False): + code_mounts: Iterable[CodeMountParametersParam] + """A list of code mounts to be included in the Blueprint.""" + + dockerfile: str + """Dockerfile contents to be used to build the Blueprint.""" + + launch_parameters: LaunchParameters + """Parameters to configure your Devbox at launch time.""" + + name: str + """Name of the Blueprint.""" + + system_setup_commands: List[str] + """A list of commands to run to set up your system.""" + + +class LaunchParameters(TypedDict, total=False): + launch_commands: List[str] + """Set of commands to be run at launch time, before the entrypoint process is run.""" + + resource_size_request: ResourceSize + """Manual resource configuration for Devbox. If not set, defaults will be used.""" diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 177d75d9d..c0af38fce 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -11,6 +11,7 @@ from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types import ( BlueprintView, + BlueprintListView, BlueprintPreviewView, BlueprintBuildLogsListView, ) @@ -24,7 +25,7 @@ class TestBlueprints: @parametrize def test_method_create(self, client: Runloop) -> None: blueprint = client.blueprints.create() - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: @@ -57,7 +58,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: name="name", system_setup_commands=["string", "string", "string"], ) - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize def test_raw_response_create(self, client: Runloop) -> None: @@ -66,7 +67,7 @@ def test_raw_response_create(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" blueprint = response.parse() - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize def test_streaming_response_create(self, client: Runloop) -> None: @@ -75,7 +76,7 @@ def test_streaming_response_create(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" blueprint = response.parse() - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + assert_matches_type(BlueprintView, blueprint, path=["response"]) assert cast(Any, response.is_closed) is True @@ -120,7 +121,16 @@ def test_path_params_retrieve(self, client: Runloop) -> None: @parametrize def test_method_list(self, client: Runloop) -> None: blueprint = client.blueprints.list() - assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) + assert_matches_type(BlueprintListView, blueprint, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + blueprint = client.blueprints.list( + limit="limit", + name="name", + starting_after="starting_after", + ) + assert_matches_type(BlueprintListView, blueprint, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -129,7 +139,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" blueprint = response.parse() - assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) + assert_matches_type(BlueprintListView, blueprint, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -137,11 +147,107 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = response.parse() + assert_matches_type(BlueprintListView, blueprint, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_logs(self, client: Runloop) -> None: + blueprint = client.blueprints.logs( + "id", + ) + assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) + + @parametrize + def test_raw_response_logs(self, client: Runloop) -> None: + response = client.blueprints.with_raw_response.logs( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = response.parse() + assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) + + @parametrize + def test_streaming_response_logs(self, client: Runloop) -> None: + with client.blueprints.with_streaming_response.logs( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = response.parse() assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) assert cast(Any, response.is_closed) is True + @parametrize + def test_path_params_logs(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.blueprints.with_raw_response.logs( + "", + ) + + @parametrize + def test_method_preview(self, client: Runloop) -> None: + blueprint = client.blueprints.preview() + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + @parametrize + def test_method_preview_with_all_params(self, client: Runloop) -> None: + blueprint = client.blueprints.preview( + code_mounts=[ + { + "repo_name": "repo_name", + "repo_owner": "repo_owner", + "install_command": "install_command", + "token": "token", + }, + { + "repo_name": "repo_name", + "repo_owner": "repo_owner", + "install_command": "install_command", + "token": "token", + }, + { + "repo_name": "repo_name", + "repo_owner": "repo_owner", + "install_command": "install_command", + "token": "token", + }, + ], + dockerfile="dockerfile", + launch_parameters={ + "launch_commands": ["string", "string", "string"], + "resource_size_request": "MINI", + }, + name="name", + system_setup_commands=["string", "string", "string"], + ) + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + @parametrize + def test_raw_response_preview(self, client: Runloop) -> None: + response = client.blueprints.with_raw_response.preview() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = response.parse() + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + @parametrize + def test_streaming_response_preview(self, client: Runloop) -> None: + with client.blueprints.with_streaming_response.preview() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + blueprint = response.parse() + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncBlueprints: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -149,7 +255,7 @@ class TestAsyncBlueprints: @parametrize async def test_method_create(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.create() - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -182,7 +288,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - name="name", system_setup_commands=["string", "string", "string"], ) - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: @@ -191,7 +297,7 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" blueprint = await response.parse() - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: @@ -200,7 +306,7 @@ async def test_streaming_response_create(self, async_client: AsyncRunloop) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" blueprint = await response.parse() - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + assert_matches_type(BlueprintView, blueprint, path=["response"]) assert cast(Any, response.is_closed) is True @@ -245,7 +351,16 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.list() - assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) + assert_matches_type(BlueprintListView, blueprint, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + blueprint = await async_client.blueprints.list( + limit="limit", + name="name", + starting_after="starting_after", + ) + assert_matches_type(BlueprintListView, blueprint, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -254,7 +369,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" blueprint = await response.parse() - assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) + assert_matches_type(BlueprintListView, blueprint, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -262,7 +377,103 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = await response.parse() + assert_matches_type(BlueprintListView, blueprint, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_logs(self, async_client: AsyncRunloop) -> None: + blueprint = await async_client.blueprints.logs( + "id", + ) + assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) + + @parametrize + async def test_raw_response_logs(self, async_client: AsyncRunloop) -> None: + response = await async_client.blueprints.with_raw_response.logs( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = await response.parse() + assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) + + @parametrize + async def test_streaming_response_logs(self, async_client: AsyncRunloop) -> None: + async with async_client.blueprints.with_streaming_response.logs( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = await response.parse() assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_logs(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.blueprints.with_raw_response.logs( + "", + ) + + @parametrize + async def test_method_preview(self, async_client: AsyncRunloop) -> None: + blueprint = await async_client.blueprints.preview() + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + @parametrize + async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) -> None: + blueprint = await async_client.blueprints.preview( + code_mounts=[ + { + "repo_name": "repo_name", + "repo_owner": "repo_owner", + "install_command": "install_command", + "token": "token", + }, + { + "repo_name": "repo_name", + "repo_owner": "repo_owner", + "install_command": "install_command", + "token": "token", + }, + { + "repo_name": "repo_name", + "repo_owner": "repo_owner", + "install_command": "install_command", + "token": "token", + }, + ], + dockerfile="dockerfile", + launch_parameters={ + "launch_commands": ["string", "string", "string"], + "resource_size_request": "MINI", + }, + name="name", + system_setup_commands=["string", "string", "string"], + ) + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + @parametrize + async def test_raw_response_preview(self, async_client: AsyncRunloop) -> None: + response = await async_client.blueprints.with_raw_response.preview() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = await response.parse() + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + @parametrize + async def test_streaming_response_preview(self, async_client: AsyncRunloop) -> None: + async with async_client.blueprints.with_streaming_response.preview() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + blueprint = await response.parse() + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + assert cast(Any, response.is_closed) is True From 238dfa4d7f5a4fb356ae9fca46d08027b33abf47 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 17:50:38 +0000 Subject: [PATCH 049/993] chore(internal): version bump (#51) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4f9005ea3..b5db7ce11 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.6" + ".": "0.1.0-alpha.7" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 60ab2c370..ad02701e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.1.0-alpha.6" +version = "0.1.0-alpha.7" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 3fb467889..469611b3d 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.1.0-alpha.6" # x-release-please-version +__version__ = "0.1.0-alpha.7" # x-release-please-version From 92a98fef578179b423dfc12d49c074d5abbcdf39 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 18:12:24 +0000 Subject: [PATCH 050/993] feat(api): OpenAPI spec update via Stainless API (#52) --- .stats.yml | 4 +- README.md | 10 +- api.md | 6 +- .../resources/blueprints.py | 307 +----------------- src/runloop_api_client/types/__init__.py | 3 - .../types/blueprint_list_params.py | 18 - .../types/blueprint_list_view.py | 17 - .../types/blueprint_preview_params.py | 36 -- tests/api_resources/test_blueprints.py | 235 +------------- 9 files changed, 38 insertions(+), 598 deletions(-) delete mode 100644 src/runloop_api_client/types/blueprint_list_params.py delete mode 100644 src/runloop_api_client/types/blueprint_list_view.py delete mode 100644 src/runloop_api_client/types/blueprint_preview_params.py diff --git a/.stats.yml b/.stats.yml index 16ba0936a..ac9d2e3e2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 19 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c11fd761b5d15675ee672120e5600fd6dddd801d87c1fa6335c507184bdf60b5.yml +configured_endpoints: 17 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-86d074c66f5140455eedb277c3ad3de81ec91f5cbd6ade28ef00ea2546dcc95e.yml diff --git a/README.md b/README.md index b95c87a09..c9b5513cb 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,8 @@ client = Runloop( bearer_token=os.environ.get("RUNLOOP_API_KEY"), ) -blueprint_view = client.blueprints.create() -print(blueprint_view.id) +blueprint_preview_view = client.blueprints.create() +print(blueprint_preview_view.dockerfile) ``` While you can provide a `bearer_token` keyword argument, @@ -57,8 +57,8 @@ client = AsyncRunloop( async def main() -> None: - blueprint_view = await client.blueprints.create() - print(blueprint_view.id) + blueprint_preview_view = await client.blueprints.create() + print(blueprint_preview_view.dockerfile) asyncio.run(main()) @@ -200,7 +200,7 @@ response = client.blueprints.with_raw_response.create() print(response.headers.get('X-My-Header')) blueprint = response.parse() # get the object that `blueprints.create()` would have returned -print(blueprint.id) +print(blueprint.dockerfile) ``` These methods return an [`APIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_api_client/_response.py) object. diff --git a/api.md b/api.md index 5904788a5..78aa65514 100644 --- a/api.md +++ b/api.md @@ -29,11 +29,9 @@ from runloop_api_client.types import ( Methods: -- client.blueprints.create(\*\*params) -> BlueprintView +- client.blueprints.create(\*\*params) -> BlueprintPreviewView - client.blueprints.retrieve(id) -> BlueprintView -- client.blueprints.list(\*\*params) -> BlueprintListView -- client.blueprints.logs(id) -> BlueprintBuildLogsListView -- client.blueprints.preview(\*\*params) -> BlueprintPreviewView +- client.blueprints.list() -> BlueprintBuildLogsListView # Code diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index 038394104..bbb16376d 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -6,7 +6,7 @@ import httpx -from ..types import blueprint_list_params, blueprint_create_params, blueprint_preview_params +from ..types import blueprint_create_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( maybe_transform, @@ -22,7 +22,6 @@ ) from .._base_client import make_request_options from ..types.blueprint_view import BlueprintView -from ..types.blueprint_list_view import BlueprintListView from ..types.blueprint_preview_view import BlueprintPreviewView from ..types.code_mount_parameters_param import CodeMountParametersParam from ..types.blueprint_build_logs_list_view import BlueprintBuildLogsListView @@ -53,12 +52,11 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BlueprintView: - """Build a Blueprint with the specified configuration. + ) -> BlueprintPreviewView: + """Preview building an image with the specified configuration. - The Blueprint will begin - building upon create, ' and will transition to 'building_complete' once it is - ready. + You can take the + resulting Dockerfile and test out your build. Args: code_mounts: A list of code mounts to be included in the Blueprint. @@ -94,7 +92,7 @@ def create( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=BlueprintView, + cast_to=BlueprintPreviewView, ) def retrieve( @@ -109,7 +107,7 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> BlueprintView: """ - Get a previously built Blueprint. + Get a previously built Image. Args: extra_headers: Send extra headers @@ -133,59 +131,6 @@ def retrieve( def list( self, *, - limit: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BlueprintListView: - """List all blueprints or filter by name. - - If no status is provided, all blueprints - are returned. - - Args: - limit: Page Limit - - name: Filter by name - - starting_after: Load the next page starting after the given token. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get( - "/v1/blueprints", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "limit": limit, - "name": name, - "starting_after": starting_after, - }, - blueprint_list_params.BlueprintListParams, - ), - ), - cast_to=BlueprintListView, - ) - - def logs( - self, - id: str, - *, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -193,85 +138,15 @@ def logs( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> BlueprintBuildLogsListView: - """ - Get Blueprint build logs. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + """Get Image logs.""" return self._get( - f"/v1/blueprints/{id}/logs", + "/v1/blueprints", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=BlueprintBuildLogsListView, ) - def preview( - self, - *, - code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, - dockerfile: str | NotGiven = NOT_GIVEN, - launch_parameters: blueprint_preview_params.LaunchParameters | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - system_setup_commands: List[str] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BlueprintPreviewView: - """Preview building a Blueprint with the specified configuration. - - You can take the - resulting Dockerfile and test out your build. - - Args: - code_mounts: A list of code mounts to be included in the Blueprint. - - dockerfile: Dockerfile contents to be used to build the Blueprint. - - launch_parameters: Parameters to configure your Devbox at launch time. - - name: Name of the Blueprint. - - system_setup_commands: A list of commands to run to set up your system. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._post( - "/v1/blueprints/preview", - body=maybe_transform( - { - "code_mounts": code_mounts, - "dockerfile": dockerfile, - "launch_parameters": launch_parameters, - "name": name, - "system_setup_commands": system_setup_commands, - }, - blueprint_preview_params.BlueprintPreviewParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=BlueprintPreviewView, - ) - class AsyncBlueprintsResource(AsyncAPIResource): @cached_property @@ -296,12 +171,11 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BlueprintView: - """Build a Blueprint with the specified configuration. + ) -> BlueprintPreviewView: + """Preview building an image with the specified configuration. - The Blueprint will begin - building upon create, ' and will transition to 'building_complete' once it is - ready. + You can take the + resulting Dockerfile and test out your build. Args: code_mounts: A list of code mounts to be included in the Blueprint. @@ -337,7 +211,7 @@ async def create( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=BlueprintView, + cast_to=BlueprintPreviewView, ) async def retrieve( @@ -352,7 +226,7 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> BlueprintView: """ - Get a previously built Blueprint. + Get a previously built Image. Args: extra_headers: Send extra headers @@ -376,59 +250,6 @@ async def retrieve( async def list( self, *, - limit: str | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BlueprintListView: - """List all blueprints or filter by name. - - If no status is provided, all blueprints - are returned. - - Args: - limit: Page Limit - - name: Filter by name - - starting_after: Load the next page starting after the given token. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return await self._get( - "/v1/blueprints", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "limit": limit, - "name": name, - "starting_after": starting_after, - }, - blueprint_list_params.BlueprintListParams, - ), - ), - cast_to=BlueprintListView, - ) - - async def logs( - self, - id: str, - *, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -436,85 +257,15 @@ async def logs( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> BlueprintBuildLogsListView: - """ - Get Blueprint build logs. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + """Get Image logs.""" return await self._get( - f"/v1/blueprints/{id}/logs", + "/v1/blueprints", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=BlueprintBuildLogsListView, ) - async def preview( - self, - *, - code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, - dockerfile: str | NotGiven = NOT_GIVEN, - launch_parameters: blueprint_preview_params.LaunchParameters | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - system_setup_commands: List[str] | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BlueprintPreviewView: - """Preview building a Blueprint with the specified configuration. - - You can take the - resulting Dockerfile and test out your build. - - Args: - code_mounts: A list of code mounts to be included in the Blueprint. - - dockerfile: Dockerfile contents to be used to build the Blueprint. - - launch_parameters: Parameters to configure your Devbox at launch time. - - name: Name of the Blueprint. - - system_setup_commands: A list of commands to run to set up your system. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return await self._post( - "/v1/blueprints/preview", - body=await async_maybe_transform( - { - "code_mounts": code_mounts, - "dockerfile": dockerfile, - "launch_parameters": launch_parameters, - "name": name, - "system_setup_commands": system_setup_commands, - }, - blueprint_preview_params.BlueprintPreviewParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=BlueprintPreviewView, - ) - class BlueprintsResourceWithRawResponse: def __init__(self, blueprints: BlueprintsResource) -> None: @@ -529,12 +280,6 @@ def __init__(self, blueprints: BlueprintsResource) -> None: self.list = to_raw_response_wrapper( blueprints.list, ) - self.logs = to_raw_response_wrapper( - blueprints.logs, - ) - self.preview = to_raw_response_wrapper( - blueprints.preview, - ) class AsyncBlueprintsResourceWithRawResponse: @@ -550,12 +295,6 @@ def __init__(self, blueprints: AsyncBlueprintsResource) -> None: self.list = async_to_raw_response_wrapper( blueprints.list, ) - self.logs = async_to_raw_response_wrapper( - blueprints.logs, - ) - self.preview = async_to_raw_response_wrapper( - blueprints.preview, - ) class BlueprintsResourceWithStreamingResponse: @@ -571,12 +310,6 @@ def __init__(self, blueprints: BlueprintsResource) -> None: self.list = to_streamed_response_wrapper( blueprints.list, ) - self.logs = to_streamed_response_wrapper( - blueprints.logs, - ) - self.preview = to_streamed_response_wrapper( - blueprints.preview, - ) class AsyncBlueprintsResourceWithStreamingResponse: @@ -592,9 +325,3 @@ def __init__(self, blueprints: AsyncBlueprintsResource) -> None: self.list = async_to_streamed_response_wrapper( blueprints.list, ) - self.logs = async_to_streamed_response_wrapper( - blueprints.logs, - ) - self.preview = async_to_streamed_response_wrapper( - blueprints.preview, - ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index c17ef2293..4a1c760dd 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -11,13 +11,10 @@ from .devbox_list_params import DevboxListParams as DevboxListParams from .function_list_view import FunctionListView as FunctionListView from .blueprint_build_log import BlueprintBuildLog as BlueprintBuildLog -from .blueprint_list_view import BlueprintListView as BlueprintListView from .devbox_create_params import DevboxCreateParams as DevboxCreateParams -from .blueprint_list_params import BlueprintListParams as BlueprintListParams from .code_mount_parameters import CodeMountParameters as CodeMountParameters from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams -from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams from .code_mount_parameters_param import CodeMountParametersParam as CodeMountParametersParam diff --git a/src/runloop_api_client/types/blueprint_list_params.py b/src/runloop_api_client/types/blueprint_list_params.py deleted file mode 100644 index 45f5f70ae..000000000 --- a/src/runloop_api_client/types/blueprint_list_params.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["BlueprintListParams"] - - -class BlueprintListParams(TypedDict, total=False): - limit: str - """Page Limit""" - - name: str - """Filter by name""" - - starting_after: str - """Load the next page starting after the given token.""" diff --git a/src/runloop_api_client/types/blueprint_list_view.py b/src/runloop_api_client/types/blueprint_list_view.py deleted file mode 100644 index 001c66308..000000000 --- a/src/runloop_api_client/types/blueprint_list_view.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from .._models import BaseModel -from .blueprint_view import BlueprintView - -__all__ = ["BlueprintListView"] - - -class BlueprintListView(BaseModel): - blueprints: Optional[List[BlueprintView]] = None - """List of blueprints matching filter.""" - - has_more: Optional[bool] = None - - total_count: Optional[int] = None diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py deleted file mode 100644 index c5b0e0fd9..000000000 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ /dev/null @@ -1,36 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import TypedDict - -from .resource_size import ResourceSize -from .code_mount_parameters_param import CodeMountParametersParam - -__all__ = ["BlueprintPreviewParams", "LaunchParameters"] - - -class BlueprintPreviewParams(TypedDict, total=False): - code_mounts: Iterable[CodeMountParametersParam] - """A list of code mounts to be included in the Blueprint.""" - - dockerfile: str - """Dockerfile contents to be used to build the Blueprint.""" - - launch_parameters: LaunchParameters - """Parameters to configure your Devbox at launch time.""" - - name: str - """Name of the Blueprint.""" - - system_setup_commands: List[str] - """A list of commands to run to set up your system.""" - - -class LaunchParameters(TypedDict, total=False): - launch_commands: List[str] - """Set of commands to be run at launch time, before the entrypoint process is run.""" - - resource_size_request: ResourceSize - """Manual resource configuration for Devbox. If not set, defaults will be used.""" diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index c0af38fce..177d75d9d 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -11,7 +11,6 @@ from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types import ( BlueprintView, - BlueprintListView, BlueprintPreviewView, BlueprintBuildLogsListView, ) @@ -25,7 +24,7 @@ class TestBlueprints: @parametrize def test_method_create(self, client: Runloop) -> None: blueprint = client.blueprints.create() - assert_matches_type(BlueprintView, blueprint, path=["response"]) + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: @@ -58,7 +57,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: name="name", system_setup_commands=["string", "string", "string"], ) - assert_matches_type(BlueprintView, blueprint, path=["response"]) + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) @parametrize def test_raw_response_create(self, client: Runloop) -> None: @@ -67,7 +66,7 @@ def test_raw_response_create(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" blueprint = response.parse() - assert_matches_type(BlueprintView, blueprint, path=["response"]) + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) @parametrize def test_streaming_response_create(self, client: Runloop) -> None: @@ -76,7 +75,7 @@ def test_streaming_response_create(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" blueprint = response.parse() - assert_matches_type(BlueprintView, blueprint, path=["response"]) + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) assert cast(Any, response.is_closed) is True @@ -121,16 +120,7 @@ def test_path_params_retrieve(self, client: Runloop) -> None: @parametrize def test_method_list(self, client: Runloop) -> None: blueprint = client.blueprints.list() - assert_matches_type(BlueprintListView, blueprint, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Runloop) -> None: - blueprint = client.blueprints.list( - limit="limit", - name="name", - starting_after="starting_after", - ) - assert_matches_type(BlueprintListView, blueprint, path=["response"]) + assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -139,7 +129,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" blueprint = response.parse() - assert_matches_type(BlueprintListView, blueprint, path=["response"]) + assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -147,107 +137,11 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - blueprint = response.parse() - assert_matches_type(BlueprintListView, blueprint, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_logs(self, client: Runloop) -> None: - blueprint = client.blueprints.logs( - "id", - ) - assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) - - @parametrize - def test_raw_response_logs(self, client: Runloop) -> None: - response = client.blueprints.with_raw_response.logs( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - blueprint = response.parse() - assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) - - @parametrize - def test_streaming_response_logs(self, client: Runloop) -> None: - with client.blueprints.with_streaming_response.logs( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - blueprint = response.parse() assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) assert cast(Any, response.is_closed) is True - @parametrize - def test_path_params_logs(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.blueprints.with_raw_response.logs( - "", - ) - - @parametrize - def test_method_preview(self, client: Runloop) -> None: - blueprint = client.blueprints.preview() - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) - - @parametrize - def test_method_preview_with_all_params(self, client: Runloop) -> None: - blueprint = client.blueprints.preview( - code_mounts=[ - { - "repo_name": "repo_name", - "repo_owner": "repo_owner", - "install_command": "install_command", - "token": "token", - }, - { - "repo_name": "repo_name", - "repo_owner": "repo_owner", - "install_command": "install_command", - "token": "token", - }, - { - "repo_name": "repo_name", - "repo_owner": "repo_owner", - "install_command": "install_command", - "token": "token", - }, - ], - dockerfile="dockerfile", - launch_parameters={ - "launch_commands": ["string", "string", "string"], - "resource_size_request": "MINI", - }, - name="name", - system_setup_commands=["string", "string", "string"], - ) - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) - - @parametrize - def test_raw_response_preview(self, client: Runloop) -> None: - response = client.blueprints.with_raw_response.preview() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - blueprint = response.parse() - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) - - @parametrize - def test_streaming_response_preview(self, client: Runloop) -> None: - with client.blueprints.with_streaming_response.preview() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - blueprint = response.parse() - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) - - assert cast(Any, response.is_closed) is True - class TestAsyncBlueprints: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -255,7 +149,7 @@ class TestAsyncBlueprints: @parametrize async def test_method_create(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.create() - assert_matches_type(BlueprintView, blueprint, path=["response"]) + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -288,7 +182,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - name="name", system_setup_commands=["string", "string", "string"], ) - assert_matches_type(BlueprintView, blueprint, path=["response"]) + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: @@ -297,7 +191,7 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" blueprint = await response.parse() - assert_matches_type(BlueprintView, blueprint, path=["response"]) + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: @@ -306,7 +200,7 @@ async def test_streaming_response_create(self, async_client: AsyncRunloop) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" blueprint = await response.parse() - assert_matches_type(BlueprintView, blueprint, path=["response"]) + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) assert cast(Any, response.is_closed) is True @@ -351,16 +245,7 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.list() - assert_matches_type(BlueprintListView, blueprint, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: - blueprint = await async_client.blueprints.list( - limit="limit", - name="name", - starting_after="starting_after", - ) - assert_matches_type(BlueprintListView, blueprint, path=["response"]) + assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -369,7 +254,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" blueprint = await response.parse() - assert_matches_type(BlueprintListView, blueprint, path=["response"]) + assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -377,103 +262,7 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - blueprint = await response.parse() - assert_matches_type(BlueprintListView, blueprint, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_logs(self, async_client: AsyncRunloop) -> None: - blueprint = await async_client.blueprints.logs( - "id", - ) - assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) - - @parametrize - async def test_raw_response_logs(self, async_client: AsyncRunloop) -> None: - response = await async_client.blueprints.with_raw_response.logs( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - blueprint = await response.parse() - assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) - - @parametrize - async def test_streaming_response_logs(self, async_client: AsyncRunloop) -> None: - async with async_client.blueprints.with_streaming_response.logs( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - blueprint = await response.parse() assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_logs(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.blueprints.with_raw_response.logs( - "", - ) - - @parametrize - async def test_method_preview(self, async_client: AsyncRunloop) -> None: - blueprint = await async_client.blueprints.preview() - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) - - @parametrize - async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) -> None: - blueprint = await async_client.blueprints.preview( - code_mounts=[ - { - "repo_name": "repo_name", - "repo_owner": "repo_owner", - "install_command": "install_command", - "token": "token", - }, - { - "repo_name": "repo_name", - "repo_owner": "repo_owner", - "install_command": "install_command", - "token": "token", - }, - { - "repo_name": "repo_name", - "repo_owner": "repo_owner", - "install_command": "install_command", - "token": "token", - }, - ], - dockerfile="dockerfile", - launch_parameters={ - "launch_commands": ["string", "string", "string"], - "resource_size_request": "MINI", - }, - name="name", - system_setup_commands=["string", "string", "string"], - ) - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) - - @parametrize - async def test_raw_response_preview(self, async_client: AsyncRunloop) -> None: - response = await async_client.blueprints.with_raw_response.preview() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - blueprint = await response.parse() - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) - - @parametrize - async def test_streaming_response_preview(self, async_client: AsyncRunloop) -> None: - async with async_client.blueprints.with_streaming_response.preview() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - blueprint = await response.parse() - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) - - assert cast(Any, response.is_closed) is True From 52c2c1e370f6d3917fac2c9c8f5f2ce15df53553 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 19:12:23 +0000 Subject: [PATCH 051/993] feat(api): OpenAPI spec update via Stainless API (#54) --- .stats.yml | 4 +- README.md | 10 +- api.md | 6 +- .../resources/blueprints.py | 307 +++++++++++++++++- src/runloop_api_client/types/__init__.py | 3 + .../types/blueprint_list_params.py | 18 + .../types/blueprint_list_view.py | 17 + .../types/blueprint_preview_params.py | 36 ++ tests/api_resources/test_blueprints.py | 235 +++++++++++++- 9 files changed, 598 insertions(+), 38 deletions(-) create mode 100644 src/runloop_api_client/types/blueprint_list_params.py create mode 100644 src/runloop_api_client/types/blueprint_list_view.py create mode 100644 src/runloop_api_client/types/blueprint_preview_params.py diff --git a/.stats.yml b/.stats.yml index ac9d2e3e2..16ba0936a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 17 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-86d074c66f5140455eedb277c3ad3de81ec91f5cbd6ade28ef00ea2546dcc95e.yml +configured_endpoints: 19 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c11fd761b5d15675ee672120e5600fd6dddd801d87c1fa6335c507184bdf60b5.yml diff --git a/README.md b/README.md index c9b5513cb..b95c87a09 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,8 @@ client = Runloop( bearer_token=os.environ.get("RUNLOOP_API_KEY"), ) -blueprint_preview_view = client.blueprints.create() -print(blueprint_preview_view.dockerfile) +blueprint_view = client.blueprints.create() +print(blueprint_view.id) ``` While you can provide a `bearer_token` keyword argument, @@ -57,8 +57,8 @@ client = AsyncRunloop( async def main() -> None: - blueprint_preview_view = await client.blueprints.create() - print(blueprint_preview_view.dockerfile) + blueprint_view = await client.blueprints.create() + print(blueprint_view.id) asyncio.run(main()) @@ -200,7 +200,7 @@ response = client.blueprints.with_raw_response.create() print(response.headers.get('X-My-Header')) blueprint = response.parse() # get the object that `blueprints.create()` would have returned -print(blueprint.dockerfile) +print(blueprint.id) ``` These methods return an [`APIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_api_client/_response.py) object. diff --git a/api.md b/api.md index 78aa65514..5904788a5 100644 --- a/api.md +++ b/api.md @@ -29,9 +29,11 @@ from runloop_api_client.types import ( Methods: -- client.blueprints.create(\*\*params) -> BlueprintPreviewView +- client.blueprints.create(\*\*params) -> BlueprintView - client.blueprints.retrieve(id) -> BlueprintView -- client.blueprints.list() -> BlueprintBuildLogsListView +- client.blueprints.list(\*\*params) -> BlueprintListView +- client.blueprints.logs(id) -> BlueprintBuildLogsListView +- client.blueprints.preview(\*\*params) -> BlueprintPreviewView # Code diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index bbb16376d..038394104 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -6,7 +6,7 @@ import httpx -from ..types import blueprint_create_params +from ..types import blueprint_list_params, blueprint_create_params, blueprint_preview_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import ( maybe_transform, @@ -22,6 +22,7 @@ ) from .._base_client import make_request_options from ..types.blueprint_view import BlueprintView +from ..types.blueprint_list_view import BlueprintListView from ..types.blueprint_preview_view import BlueprintPreviewView from ..types.code_mount_parameters_param import CodeMountParametersParam from ..types.blueprint_build_logs_list_view import BlueprintBuildLogsListView @@ -52,11 +53,12 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BlueprintPreviewView: - """Preview building an image with the specified configuration. + ) -> BlueprintView: + """Build a Blueprint with the specified configuration. - You can take the - resulting Dockerfile and test out your build. + The Blueprint will begin + building upon create, ' and will transition to 'building_complete' once it is + ready. Args: code_mounts: A list of code mounts to be included in the Blueprint. @@ -92,7 +94,7 @@ def create( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=BlueprintPreviewView, + cast_to=BlueprintView, ) def retrieve( @@ -107,7 +109,7 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> BlueprintView: """ - Get a previously built Image. + Get a previously built Blueprint. Args: extra_headers: Send extra headers @@ -131,22 +133,145 @@ def retrieve( def list( self, *, + limit: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BlueprintBuildLogsListView: - """Get Image logs.""" + ) -> BlueprintListView: + """List all blueprints or filter by name. + + If no status is provided, all blueprints + are returned. + + Args: + limit: Page Limit + + name: Filter by name + + starting_after: Load the next page starting after the given token. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ return self._get( "/v1/blueprints", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "name": name, + "starting_after": starting_after, + }, + blueprint_list_params.BlueprintListParams, + ), + ), + cast_to=BlueprintListView, + ) + + def logs( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BlueprintBuildLogsListView: + """ + Get Blueprint build logs. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/blueprints/{id}/logs", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=BlueprintBuildLogsListView, ) + def preview( + self, + *, + code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, + dockerfile: str | NotGiven = NOT_GIVEN, + launch_parameters: blueprint_preview_params.LaunchParameters | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + system_setup_commands: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BlueprintPreviewView: + """Preview building a Blueprint with the specified configuration. + + You can take the + resulting Dockerfile and test out your build. + + Args: + code_mounts: A list of code mounts to be included in the Blueprint. + + dockerfile: Dockerfile contents to be used to build the Blueprint. + + launch_parameters: Parameters to configure your Devbox at launch time. + + name: Name of the Blueprint. + + system_setup_commands: A list of commands to run to set up your system. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/v1/blueprints/preview", + body=maybe_transform( + { + "code_mounts": code_mounts, + "dockerfile": dockerfile, + "launch_parameters": launch_parameters, + "name": name, + "system_setup_commands": system_setup_commands, + }, + blueprint_preview_params.BlueprintPreviewParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BlueprintPreviewView, + ) + class AsyncBlueprintsResource(AsyncAPIResource): @cached_property @@ -171,11 +296,12 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BlueprintPreviewView: - """Preview building an image with the specified configuration. + ) -> BlueprintView: + """Build a Blueprint with the specified configuration. - You can take the - resulting Dockerfile and test out your build. + The Blueprint will begin + building upon create, ' and will transition to 'building_complete' once it is + ready. Args: code_mounts: A list of code mounts to be included in the Blueprint. @@ -211,7 +337,7 @@ async def create( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=BlueprintPreviewView, + cast_to=BlueprintView, ) async def retrieve( @@ -226,7 +352,7 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> BlueprintView: """ - Get a previously built Image. + Get a previously built Blueprint. Args: extra_headers: Send extra headers @@ -250,22 +376,145 @@ async def retrieve( async def list( self, *, + limit: str | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BlueprintBuildLogsListView: - """Get Image logs.""" + ) -> BlueprintListView: + """List all blueprints or filter by name. + + If no status is provided, all blueprints + are returned. + + Args: + limit: Page Limit + + name: Filter by name + + starting_after: Load the next page starting after the given token. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ return await self._get( "/v1/blueprints", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "limit": limit, + "name": name, + "starting_after": starting_after, + }, + blueprint_list_params.BlueprintListParams, + ), + ), + cast_to=BlueprintListView, + ) + + async def logs( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BlueprintBuildLogsListView: + """ + Get Blueprint build logs. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/blueprints/{id}/logs", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=BlueprintBuildLogsListView, ) + async def preview( + self, + *, + code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, + dockerfile: str | NotGiven = NOT_GIVEN, + launch_parameters: blueprint_preview_params.LaunchParameters | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + system_setup_commands: List[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BlueprintPreviewView: + """Preview building a Blueprint with the specified configuration. + + You can take the + resulting Dockerfile and test out your build. + + Args: + code_mounts: A list of code mounts to be included in the Blueprint. + + dockerfile: Dockerfile contents to be used to build the Blueprint. + + launch_parameters: Parameters to configure your Devbox at launch time. + + name: Name of the Blueprint. + + system_setup_commands: A list of commands to run to set up your system. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/v1/blueprints/preview", + body=await async_maybe_transform( + { + "code_mounts": code_mounts, + "dockerfile": dockerfile, + "launch_parameters": launch_parameters, + "name": name, + "system_setup_commands": system_setup_commands, + }, + blueprint_preview_params.BlueprintPreviewParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BlueprintPreviewView, + ) + class BlueprintsResourceWithRawResponse: def __init__(self, blueprints: BlueprintsResource) -> None: @@ -280,6 +529,12 @@ def __init__(self, blueprints: BlueprintsResource) -> None: self.list = to_raw_response_wrapper( blueprints.list, ) + self.logs = to_raw_response_wrapper( + blueprints.logs, + ) + self.preview = to_raw_response_wrapper( + blueprints.preview, + ) class AsyncBlueprintsResourceWithRawResponse: @@ -295,6 +550,12 @@ def __init__(self, blueprints: AsyncBlueprintsResource) -> None: self.list = async_to_raw_response_wrapper( blueprints.list, ) + self.logs = async_to_raw_response_wrapper( + blueprints.logs, + ) + self.preview = async_to_raw_response_wrapper( + blueprints.preview, + ) class BlueprintsResourceWithStreamingResponse: @@ -310,6 +571,12 @@ def __init__(self, blueprints: BlueprintsResource) -> None: self.list = to_streamed_response_wrapper( blueprints.list, ) + self.logs = to_streamed_response_wrapper( + blueprints.logs, + ) + self.preview = to_streamed_response_wrapper( + blueprints.preview, + ) class AsyncBlueprintsResourceWithStreamingResponse: @@ -325,3 +592,9 @@ def __init__(self, blueprints: AsyncBlueprintsResource) -> None: self.list = async_to_streamed_response_wrapper( blueprints.list, ) + self.logs = async_to_streamed_response_wrapper( + blueprints.logs, + ) + self.preview = async_to_streamed_response_wrapper( + blueprints.preview, + ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 4a1c760dd..c17ef2293 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -11,10 +11,13 @@ from .devbox_list_params import DevboxListParams as DevboxListParams from .function_list_view import FunctionListView as FunctionListView from .blueprint_build_log import BlueprintBuildLog as BlueprintBuildLog +from .blueprint_list_view import BlueprintListView as BlueprintListView from .devbox_create_params import DevboxCreateParams as DevboxCreateParams +from .blueprint_list_params import BlueprintListParams as BlueprintListParams from .code_mount_parameters import CodeMountParameters as CodeMountParameters from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams +from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams from .code_mount_parameters_param import CodeMountParametersParam as CodeMountParametersParam diff --git a/src/runloop_api_client/types/blueprint_list_params.py b/src/runloop_api_client/types/blueprint_list_params.py new file mode 100644 index 000000000..45f5f70ae --- /dev/null +++ b/src/runloop_api_client/types/blueprint_list_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["BlueprintListParams"] + + +class BlueprintListParams(TypedDict, total=False): + limit: str + """Page Limit""" + + name: str + """Filter by name""" + + starting_after: str + """Load the next page starting after the given token.""" diff --git a/src/runloop_api_client/types/blueprint_list_view.py b/src/runloop_api_client/types/blueprint_list_view.py new file mode 100644 index 000000000..001c66308 --- /dev/null +++ b/src/runloop_api_client/types/blueprint_list_view.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from .._models import BaseModel +from .blueprint_view import BlueprintView + +__all__ = ["BlueprintListView"] + + +class BlueprintListView(BaseModel): + blueprints: Optional[List[BlueprintView]] = None + """List of blueprints matching filter.""" + + has_more: Optional[bool] = None + + total_count: Optional[int] = None diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py new file mode 100644 index 000000000..c5b0e0fd9 --- /dev/null +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import TypedDict + +from .resource_size import ResourceSize +from .code_mount_parameters_param import CodeMountParametersParam + +__all__ = ["BlueprintPreviewParams", "LaunchParameters"] + + +class BlueprintPreviewParams(TypedDict, total=False): + code_mounts: Iterable[CodeMountParametersParam] + """A list of code mounts to be included in the Blueprint.""" + + dockerfile: str + """Dockerfile contents to be used to build the Blueprint.""" + + launch_parameters: LaunchParameters + """Parameters to configure your Devbox at launch time.""" + + name: str + """Name of the Blueprint.""" + + system_setup_commands: List[str] + """A list of commands to run to set up your system.""" + + +class LaunchParameters(TypedDict, total=False): + launch_commands: List[str] + """Set of commands to be run at launch time, before the entrypoint process is run.""" + + resource_size_request: ResourceSize + """Manual resource configuration for Devbox. If not set, defaults will be used.""" diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 177d75d9d..c0af38fce 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -11,6 +11,7 @@ from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types import ( BlueprintView, + BlueprintListView, BlueprintPreviewView, BlueprintBuildLogsListView, ) @@ -24,7 +25,7 @@ class TestBlueprints: @parametrize def test_method_create(self, client: Runloop) -> None: blueprint = client.blueprints.create() - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: @@ -57,7 +58,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: name="name", system_setup_commands=["string", "string", "string"], ) - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize def test_raw_response_create(self, client: Runloop) -> None: @@ -66,7 +67,7 @@ def test_raw_response_create(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" blueprint = response.parse() - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize def test_streaming_response_create(self, client: Runloop) -> None: @@ -75,7 +76,7 @@ def test_streaming_response_create(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" blueprint = response.parse() - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + assert_matches_type(BlueprintView, blueprint, path=["response"]) assert cast(Any, response.is_closed) is True @@ -120,7 +121,16 @@ def test_path_params_retrieve(self, client: Runloop) -> None: @parametrize def test_method_list(self, client: Runloop) -> None: blueprint = client.blueprints.list() - assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) + assert_matches_type(BlueprintListView, blueprint, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + blueprint = client.blueprints.list( + limit="limit", + name="name", + starting_after="starting_after", + ) + assert_matches_type(BlueprintListView, blueprint, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -129,7 +139,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" blueprint = response.parse() - assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) + assert_matches_type(BlueprintListView, blueprint, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -137,11 +147,107 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = response.parse() + assert_matches_type(BlueprintListView, blueprint, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_logs(self, client: Runloop) -> None: + blueprint = client.blueprints.logs( + "id", + ) + assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) + + @parametrize + def test_raw_response_logs(self, client: Runloop) -> None: + response = client.blueprints.with_raw_response.logs( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = response.parse() + assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) + + @parametrize + def test_streaming_response_logs(self, client: Runloop) -> None: + with client.blueprints.with_streaming_response.logs( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = response.parse() assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) assert cast(Any, response.is_closed) is True + @parametrize + def test_path_params_logs(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.blueprints.with_raw_response.logs( + "", + ) + + @parametrize + def test_method_preview(self, client: Runloop) -> None: + blueprint = client.blueprints.preview() + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + @parametrize + def test_method_preview_with_all_params(self, client: Runloop) -> None: + blueprint = client.blueprints.preview( + code_mounts=[ + { + "repo_name": "repo_name", + "repo_owner": "repo_owner", + "install_command": "install_command", + "token": "token", + }, + { + "repo_name": "repo_name", + "repo_owner": "repo_owner", + "install_command": "install_command", + "token": "token", + }, + { + "repo_name": "repo_name", + "repo_owner": "repo_owner", + "install_command": "install_command", + "token": "token", + }, + ], + dockerfile="dockerfile", + launch_parameters={ + "launch_commands": ["string", "string", "string"], + "resource_size_request": "MINI", + }, + name="name", + system_setup_commands=["string", "string", "string"], + ) + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + @parametrize + def test_raw_response_preview(self, client: Runloop) -> None: + response = client.blueprints.with_raw_response.preview() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = response.parse() + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + @parametrize + def test_streaming_response_preview(self, client: Runloop) -> None: + with client.blueprints.with_streaming_response.preview() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + blueprint = response.parse() + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncBlueprints: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -149,7 +255,7 @@ class TestAsyncBlueprints: @parametrize async def test_method_create(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.create() - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -182,7 +288,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - name="name", system_setup_commands=["string", "string", "string"], ) - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: @@ -191,7 +297,7 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" blueprint = await response.parse() - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: @@ -200,7 +306,7 @@ async def test_streaming_response_create(self, async_client: AsyncRunloop) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" blueprint = await response.parse() - assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + assert_matches_type(BlueprintView, blueprint, path=["response"]) assert cast(Any, response.is_closed) is True @@ -245,7 +351,16 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.list() - assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) + assert_matches_type(BlueprintListView, blueprint, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + blueprint = await async_client.blueprints.list( + limit="limit", + name="name", + starting_after="starting_after", + ) + assert_matches_type(BlueprintListView, blueprint, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -254,7 +369,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" blueprint = await response.parse() - assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) + assert_matches_type(BlueprintListView, blueprint, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -262,7 +377,103 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = await response.parse() + assert_matches_type(BlueprintListView, blueprint, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_logs(self, async_client: AsyncRunloop) -> None: + blueprint = await async_client.blueprints.logs( + "id", + ) + assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) + + @parametrize + async def test_raw_response_logs(self, async_client: AsyncRunloop) -> None: + response = await async_client.blueprints.with_raw_response.logs( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = await response.parse() + assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) + + @parametrize + async def test_streaming_response_logs(self, async_client: AsyncRunloop) -> None: + async with async_client.blueprints.with_streaming_response.logs( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = await response.parse() assert_matches_type(BlueprintBuildLogsListView, blueprint, path=["response"]) assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_logs(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.blueprints.with_raw_response.logs( + "", + ) + + @parametrize + async def test_method_preview(self, async_client: AsyncRunloop) -> None: + blueprint = await async_client.blueprints.preview() + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + @parametrize + async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) -> None: + blueprint = await async_client.blueprints.preview( + code_mounts=[ + { + "repo_name": "repo_name", + "repo_owner": "repo_owner", + "install_command": "install_command", + "token": "token", + }, + { + "repo_name": "repo_name", + "repo_owner": "repo_owner", + "install_command": "install_command", + "token": "token", + }, + { + "repo_name": "repo_name", + "repo_owner": "repo_owner", + "install_command": "install_command", + "token": "token", + }, + ], + dockerfile="dockerfile", + launch_parameters={ + "launch_commands": ["string", "string", "string"], + "resource_size_request": "MINI", + }, + name="name", + system_setup_commands=["string", "string", "string"], + ) + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + @parametrize + async def test_raw_response_preview(self, async_client: AsyncRunloop) -> None: + response = await async_client.blueprints.with_raw_response.preview() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = await response.parse() + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + @parametrize + async def test_streaming_response_preview(self, async_client: AsyncRunloop) -> None: + async with async_client.blueprints.with_streaming_response.preview() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + blueprint = await response.parse() + assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) + + assert cast(Any, response.is_closed) is True From fe0b55bf54c02aa8bab868aab3e19e3f53959e96 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 19:12:26 +0000 Subject: [PATCH 052/993] feat(api): OpenAPI spec update via Stainless API (#55) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 16ba0936a..d5757aa4e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 19 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c11fd761b5d15675ee672120e5600fd6dddd801d87c1fa6335c507184bdf60b5.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-dc1c7bac960cf41d38c576ccb987b69ddc5658f49fa17d722e7cf3c449347595.yml From 9311263730c93dd6358702685524d38ce0520dcb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 20:12:20 +0000 Subject: [PATCH 053/993] feat(api): OpenAPI spec update via Stainless API (#56) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d5757aa4e..6c438db06 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 19 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-dc1c7bac960cf41d38c576ccb987b69ddc5658f49fa17d722e7cf3c449347595.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e751c0da04b49b6396f7d2479124f2ed2aaf4f69a74f4cb981bffcd0f310061c.yml From 6b4ebf7c572999bd759c6140e91f72ad61b8d52e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 22:12:31 +0000 Subject: [PATCH 054/993] feat(api): OpenAPI spec update via Stainless API (#57) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 8 ++++++++ src/runloop_api_client/types/devbox_create_params.py | 3 +++ tests/api_resources/test_devboxes.py | 2 ++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 6c438db06..82a38c421 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 19 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e751c0da04b49b6396f7d2479124f2ed2aaf4f69a74f4cb981bffcd0f310061c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1ee44166266d9e9a3ab416b9a232c5cc239e42d504eec799e67df4563b19916f.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 66b569082..dc8136594 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -57,6 +57,7 @@ def create( code_handle: str | NotGiven = NOT_GIVEN, entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, + file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -86,6 +87,8 @@ def create( environment_variables: (Optional) Environment variables used to configure your Devbox. + file_mounts: (Optional) Map of paths and file contents to write before setup.. + name: (Optional) A user specified name to give the Devbox. setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include @@ -109,6 +112,7 @@ def create( "code_handle": code_handle, "entrypoint": entrypoint, "environment_variables": environment_variables, + "file_mounts": file_mounts, "name": name, "setup_commands": setup_commands, }, @@ -299,6 +303,7 @@ async def create( code_handle: str | NotGiven = NOT_GIVEN, entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, + file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -328,6 +333,8 @@ async def create( environment_variables: (Optional) Environment variables used to configure your Devbox. + file_mounts: (Optional) Map of paths and file contents to write before setup.. + name: (Optional) A user specified name to give the Devbox. setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include @@ -351,6 +358,7 @@ async def create( "code_handle": code_handle, "entrypoint": entrypoint, "environment_variables": environment_variables, + "file_mounts": file_mounts, "name": name, "setup_commands": setup_commands, }, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index bedde6c80..118acd388 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -35,6 +35,9 @@ class DevboxCreateParams(TypedDict, total=False): environment_variables: Dict[str, str] """(Optional) Environment variables used to configure your Devbox.""" + file_mounts: Dict[str, str] + """(Optional) Map of paths and file contents to write before setup..""" + name: str """(Optional) A user specified name to give the Devbox.""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index ac2f14534..8f3837c52 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -34,6 +34,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: code_handle="code_handle", entrypoint="entrypoint", environment_variables={"foo": "string"}, + file_mounts={"foo": "string"}, name="name", setup_commands=["string", "string", "string"], ) @@ -232,6 +233,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - code_handle="code_handle", entrypoint="entrypoint", environment_variables={"foo": "string"}, + file_mounts={"foo": "string"}, name="name", setup_commands=["string", "string", "string"], ) From 82f5eb2dcd801a53d65c7da127ca2c277e73d2aa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 22:46:18 +0000 Subject: [PATCH 055/993] feat(api): update via SDK Studio (#58) --- .stats.yml | 2 +- src/runloop_api_client/resources/blueprints.py | 18 +++++++++++++++++- .../types/blueprint_build_parameters.py | 5 ++++- .../types/blueprint_create_params.py | 5 ++++- .../types/blueprint_preview_params.py | 5 ++++- tests/api_resources/test_blueprints.py | 4 ++++ 6 files changed, 34 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index 82a38c421..794174526 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 19 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1ee44166266d9e9a3ab416b9a232c5cc239e42d504eec799e67df4563b19916f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8ed7237714dcf00d5e186095c38ac8afb3300d4773e0d836042d89f3b53c7ffc.yml diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index 038394104..c3221a79d 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Iterable +from typing import Dict, List, Iterable import httpx @@ -44,6 +44,7 @@ def create( *, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, + file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, launch_parameters: blueprint_create_params.LaunchParameters | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, @@ -65,6 +66,8 @@ def create( dockerfile: Dockerfile contents to be used to build the Blueprint. + file_mounts: (Optional) Map of paths and file contents to write before setup.. + launch_parameters: Parameters to configure your Devbox at launch time. name: Name of the Blueprint. @@ -85,6 +88,7 @@ def create( { "code_mounts": code_mounts, "dockerfile": dockerfile, + "file_mounts": file_mounts, "launch_parameters": launch_parameters, "name": name, "system_setup_commands": system_setup_commands, @@ -220,6 +224,7 @@ def preview( *, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, + file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, launch_parameters: blueprint_preview_params.LaunchParameters | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, @@ -240,6 +245,8 @@ def preview( dockerfile: Dockerfile contents to be used to build the Blueprint. + file_mounts: (Optional) Map of paths and file contents to write before setup.. + launch_parameters: Parameters to configure your Devbox at launch time. name: Name of the Blueprint. @@ -260,6 +267,7 @@ def preview( { "code_mounts": code_mounts, "dockerfile": dockerfile, + "file_mounts": file_mounts, "launch_parameters": launch_parameters, "name": name, "system_setup_commands": system_setup_commands, @@ -287,6 +295,7 @@ async def create( *, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, + file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, launch_parameters: blueprint_create_params.LaunchParameters | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, @@ -308,6 +317,8 @@ async def create( dockerfile: Dockerfile contents to be used to build the Blueprint. + file_mounts: (Optional) Map of paths and file contents to write before setup.. + launch_parameters: Parameters to configure your Devbox at launch time. name: Name of the Blueprint. @@ -328,6 +339,7 @@ async def create( { "code_mounts": code_mounts, "dockerfile": dockerfile, + "file_mounts": file_mounts, "launch_parameters": launch_parameters, "name": name, "system_setup_commands": system_setup_commands, @@ -463,6 +475,7 @@ async def preview( *, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, + file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, launch_parameters: blueprint_preview_params.LaunchParameters | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, @@ -483,6 +496,8 @@ async def preview( dockerfile: Dockerfile contents to be used to build the Blueprint. + file_mounts: (Optional) Map of paths and file contents to write before setup.. + launch_parameters: Parameters to configure your Devbox at launch time. name: Name of the Blueprint. @@ -503,6 +518,7 @@ async def preview( { "code_mounts": code_mounts, "dockerfile": dockerfile, + "file_mounts": file_mounts, "launch_parameters": launch_parameters, "name": name, "system_setup_commands": system_setup_commands, diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index 0474fcb02..f052d5810 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Dict, List, Optional from .._models import BaseModel from .resource_size import ResourceSize @@ -24,6 +24,9 @@ class BlueprintBuildParameters(BaseModel): dockerfile: Optional[str] = None """Dockerfile contents to be used to build the Blueprint.""" + file_mounts: Optional[Dict[str, str]] = None + """(Optional) Map of paths and file contents to write before setup..""" + launch_parameters: Optional[LaunchParameters] = None """Parameters to configure your Devbox at launch time.""" diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index 4cfc8c3e2..5d797dd66 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Iterable +from typing import Dict, List, Iterable from typing_extensions import TypedDict from .resource_size import ResourceSize @@ -18,6 +18,9 @@ class BlueprintCreateParams(TypedDict, total=False): dockerfile: str """Dockerfile contents to be used to build the Blueprint.""" + file_mounts: Dict[str, str] + """(Optional) Map of paths and file contents to write before setup..""" + launch_parameters: LaunchParameters """Parameters to configure your Devbox at launch time.""" diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index c5b0e0fd9..1fd80859f 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Iterable +from typing import Dict, List, Iterable from typing_extensions import TypedDict from .resource_size import ResourceSize @@ -18,6 +18,9 @@ class BlueprintPreviewParams(TypedDict, total=False): dockerfile: str """Dockerfile contents to be used to build the Blueprint.""" + file_mounts: Dict[str, str] + """(Optional) Map of paths and file contents to write before setup..""" + launch_parameters: LaunchParameters """Parameters to configure your Devbox at launch time.""" diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index c0af38fce..0228af67d 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -51,6 +51,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: }, ], dockerfile="dockerfile", + file_mounts={"foo": "string"}, launch_parameters={ "launch_commands": ["string", "string", "string"], "resource_size_request": "MINI", @@ -219,6 +220,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: }, ], dockerfile="dockerfile", + file_mounts={"foo": "string"}, launch_parameters={ "launch_commands": ["string", "string", "string"], "resource_size_request": "MINI", @@ -281,6 +283,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - }, ], dockerfile="dockerfile", + file_mounts={"foo": "string"}, launch_parameters={ "launch_commands": ["string", "string", "string"], "resource_size_request": "MINI", @@ -449,6 +452,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) }, ], dockerfile="dockerfile", + file_mounts={"foo": "string"}, launch_parameters={ "launch_commands": ["string", "string", "string"], "resource_size_request": "MINI", From 5cea26d656b55abb81b20df4ec28aaaf96e8f5cf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 22:50:25 +0000 Subject: [PATCH 056/993] chore(internal): version bump (#59) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b5db7ce11..c373724dc 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.7" + ".": "0.1.0-alpha.8" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index ad02701e8..c9cddd13f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.1.0-alpha.7" +version = "0.1.0-alpha.8" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 469611b3d..d1c095c91 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.1.0-alpha.7" # x-release-please-version +__version__ = "0.1.0-alpha.8" # x-release-please-version From 58bba7b15e73023da2a48ad6ba7a39725a7b3dc4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 23:30:18 +0000 Subject: [PATCH 057/993] chore: update SDK settings (#60) --- .stats.yml | 2 +- api.md | 26 ++- .../resources/devboxes/devboxes.py | 156 ++++++++++++++++++ .../resources/functions/functions.py | 20 +-- .../{invocations => }/invocations.py | 26 +-- .../functions/invocations/__init__.py | 19 --- src/runloop_api_client/types/__init__.py | 7 +- .../types/function_invoke_async_response.py | 42 ----- .../types/function_invoke_sync_response.py | 42 ----- .../types/functions/__init__.py | 1 - .../types/functions/invocations/__init__.py | 3 - .../types/shared/__init__.py | 3 + ...ction_invocation_execution_detail_view.py} | 4 +- .../functions/invocations/__init__.py | 1 - .../functions/test_invocations.py | 18 +- tests/api_resources/test_devboxes.py | 152 +++++++++++++++++ tests/api_resources/test_functions.py | 39 ++--- 17 files changed, 376 insertions(+), 185 deletions(-) rename src/runloop_api_client/resources/functions/{invocations => }/invocations.py (94%) delete mode 100644 src/runloop_api_client/resources/functions/invocations/__init__.py delete mode 100644 src/runloop_api_client/types/function_invoke_async_response.py delete mode 100644 src/runloop_api_client/types/function_invoke_sync_response.py delete mode 100644 src/runloop_api_client/types/functions/invocations/__init__.py rename src/runloop_api_client/types/{functions/invocation_retrieve_response.py => shared/function_invocation_execution_detail_view.py} (91%) delete mode 100644 tests/api_resources/functions/invocations/__init__.py diff --git a/.stats.yml b/.stats.yml index 794174526..1d8bfbdbc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 19 +configured_endpoints: 21 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8ed7237714dcf00d5e186095c38ac8afb3300d4773e0d836042d89f3b53c7ffc.yml diff --git a/api.md b/api.md index 5904788a5..fd2f1657b 100644 --- a/api.md +++ b/api.md @@ -1,7 +1,7 @@ # Shared Types ```python -from runloop_api_client.types import ProjectLogsView +from runloop_api_client.types import FunctionInvocationExecutionDetailView, ProjectLogsView ``` # Account @@ -57,7 +57,9 @@ Methods: - client.devboxes.retrieve(id) -> DevboxView - client.devboxes.list(\*\*params) -> DevboxListView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView +- client.devboxes.read_file(id) -> DevboxExecutionDetailView - client.devboxes.shutdown(id) -> DevboxView +- client.devboxes.write_file(id) -> DevboxExecutionDetailView ## Logs @@ -76,36 +78,28 @@ Methods: Types: ```python -from runloop_api_client.types import ( - FunctionListView, - FunctionInvokeAsyncResponse, - FunctionInvokeSyncResponse, -) +from runloop_api_client.types import FunctionListView ``` Methods: - client.functions.list() -> FunctionListView -- client.functions.invoke_async(function_name, \*, project_name, \*\*params) -> FunctionInvokeAsyncResponse -- client.functions.invoke_sync(function_name, \*, project_name, \*\*params) -> FunctionInvokeSyncResponse +- client.functions.invoke_async(function_name, \*, project_name, \*\*params) -> FunctionInvocationExecutionDetailView +- client.functions.invoke_sync(function_name, \*, project_name, \*\*params) -> FunctionInvocationExecutionDetailView ## Invocations Types: ```python -from runloop_api_client.types.functions import ( - FunctionInvocationListView, - KillOperationResponse, - InvocationRetrieveResponse, -) +from runloop_api_client.types.functions import FunctionInvocationListView, KillOperationResponse ``` Methods: -- client.functions.invocations.retrieve(invocation_id) -> InvocationRetrieveResponse -- client.functions.invocations.list(\*\*params) -> FunctionInvocationListView -- client.functions.invocations.kill(invocation_id) -> object +- client.functions.invocations.retrieve(invocation_id) -> FunctionInvocationExecutionDetailView +- client.functions.invocations.list(\*\*params) -> FunctionInvocationListView +- client.functions.invocations.kill(invocation_id) -> object # Projects diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index dc8136594..a60134e74 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -247,6 +247,39 @@ def execute_sync( cast_to=DevboxExecutionDetailView, ) + def read_file( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxExecutionDetailView: + """ + Read file contents from a file on given Devbox. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/read_file", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxExecutionDetailView, + ) + def shutdown( self, id: str, @@ -281,6 +314,39 @@ def shutdown( cast_to=DevboxView, ) + def write_file( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxExecutionDetailView: + """ + Write contents to a file at path on the Devbox. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/write_file", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxExecutionDetailView, + ) + class AsyncDevboxesResource(AsyncAPIResource): @cached_property @@ -493,6 +559,39 @@ async def execute_sync( cast_to=DevboxExecutionDetailView, ) + async def read_file( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxExecutionDetailView: + """ + Read file contents from a file on given Devbox. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/read_file", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxExecutionDetailView, + ) + async def shutdown( self, id: str, @@ -527,6 +626,39 @@ async def shutdown( cast_to=DevboxView, ) + async def write_file( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxExecutionDetailView: + """ + Write contents to a file at path on the Devbox. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/write_file", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxExecutionDetailView, + ) + class DevboxesResourceWithRawResponse: def __init__(self, devboxes: DevboxesResource) -> None: @@ -544,9 +676,15 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.execute_sync = to_raw_response_wrapper( devboxes.execute_sync, ) + self.read_file = to_raw_response_wrapper( + devboxes.read_file, + ) self.shutdown = to_raw_response_wrapper( devboxes.shutdown, ) + self.write_file = to_raw_response_wrapper( + devboxes.write_file, + ) @cached_property def logs(self) -> LogsResourceWithRawResponse: @@ -569,9 +707,15 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.execute_sync = async_to_raw_response_wrapper( devboxes.execute_sync, ) + self.read_file = async_to_raw_response_wrapper( + devboxes.read_file, + ) self.shutdown = async_to_raw_response_wrapper( devboxes.shutdown, ) + self.write_file = async_to_raw_response_wrapper( + devboxes.write_file, + ) @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: @@ -594,9 +738,15 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.execute_sync = to_streamed_response_wrapper( devboxes.execute_sync, ) + self.read_file = to_streamed_response_wrapper( + devboxes.read_file, + ) self.shutdown = to_streamed_response_wrapper( devboxes.shutdown, ) + self.write_file = to_streamed_response_wrapper( + devboxes.write_file, + ) @cached_property def logs(self) -> LogsResourceWithStreamingResponse: @@ -619,9 +769,15 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.execute_sync = async_to_streamed_response_wrapper( devboxes.execute_sync, ) + self.read_file = async_to_streamed_response_wrapper( + devboxes.read_file, + ) self.shutdown = async_to_streamed_response_wrapper( devboxes.shutdown, ) + self.write_file = async_to_streamed_response_wrapper( + devboxes.write_file, + ) @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: diff --git a/src/runloop_api_client/resources/functions/functions.py b/src/runloop_api_client/resources/functions/functions.py index fad009f20..006a23817 100644 --- a/src/runloop_api_client/resources/functions/functions.py +++ b/src/runloop_api_client/resources/functions/functions.py @@ -27,10 +27,8 @@ AsyncInvocationsResourceWithStreamingResponse, ) from ..._base_client import make_request_options -from .invocations.invocations import InvocationsResource, AsyncInvocationsResource from ...types.function_list_view import FunctionListView -from ...types.function_invoke_sync_response import FunctionInvokeSyncResponse -from ...types.function_invoke_async_response import FunctionInvokeAsyncResponse +from ...types.shared.function_invocation_execution_detail_view import FunctionInvocationExecutionDetailView __all__ = ["FunctionsResource", "AsyncFunctionsResource"] @@ -80,7 +78,7 @@ def invoke_async( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvokeAsyncResponse: + ) -> FunctionInvocationExecutionDetailView: """Invoke the remote function asynchronously. This will return a job id that can be @@ -113,7 +111,7 @@ def invoke_async( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=FunctionInvokeAsyncResponse, + cast_to=FunctionInvocationExecutionDetailView, ) def invoke_sync( @@ -129,7 +127,7 @@ def invoke_sync( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvokeSyncResponse: + ) -> FunctionInvocationExecutionDetailView: """Invoke the remote function synchronously. This will block until the function @@ -163,7 +161,7 @@ def invoke_sync( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=FunctionInvokeSyncResponse, + cast_to=FunctionInvocationExecutionDetailView, ) @@ -212,7 +210,7 @@ async def invoke_async( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvokeAsyncResponse: + ) -> FunctionInvocationExecutionDetailView: """Invoke the remote function asynchronously. This will return a job id that can be @@ -245,7 +243,7 @@ async def invoke_async( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=FunctionInvokeAsyncResponse, + cast_to=FunctionInvocationExecutionDetailView, ) async def invoke_sync( @@ -261,7 +259,7 @@ async def invoke_sync( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvokeSyncResponse: + ) -> FunctionInvocationExecutionDetailView: """Invoke the remote function synchronously. This will block until the function @@ -295,7 +293,7 @@ async def invoke_sync( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=FunctionInvokeSyncResponse, + cast_to=FunctionInvocationExecutionDetailView, ) diff --git a/src/runloop_api_client/resources/functions/invocations/invocations.py b/src/runloop_api_client/resources/functions/invocations.py similarity index 94% rename from src/runloop_api_client/resources/functions/invocations/invocations.py rename to src/runloop_api_client/resources/functions/invocations.py index 3f186606e..b519df35a 100644 --- a/src/runloop_api_client/resources/functions/invocations/invocations.py +++ b/src/runloop_api_client/resources/functions/invocations.py @@ -4,23 +4,23 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ...._utils import ( +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( maybe_transform, async_maybe_transform, ) -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._base_client import make_request_options -from ....types.functions import invocation_list_params -from ....types.functions.invocation_retrieve_response import InvocationRetrieveResponse -from ....types.functions.function_invocation_list_view import FunctionInvocationListView +from ..._base_client import make_request_options +from ...types.functions import invocation_list_params +from ...types.functions.function_invocation_list_view import FunctionInvocationListView +from ...types.shared.function_invocation_execution_detail_view import FunctionInvocationExecutionDetailView __all__ = ["InvocationsResource", "AsyncInvocationsResource"] @@ -44,7 +44,7 @@ def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InvocationRetrieveResponse: + ) -> FunctionInvocationExecutionDetailView: """Get the details of a function invocation. This includes the status, response, @@ -66,7 +66,7 @@ def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=InvocationRetrieveResponse, + cast_to=FunctionInvocationExecutionDetailView, ) def list( @@ -169,7 +169,7 @@ async def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InvocationRetrieveResponse: + ) -> FunctionInvocationExecutionDetailView: """Get the details of a function invocation. This includes the status, response, @@ -191,7 +191,7 @@ async def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=InvocationRetrieveResponse, + cast_to=FunctionInvocationExecutionDetailView, ) async def list( diff --git a/src/runloop_api_client/resources/functions/invocations/__init__.py b/src/runloop_api_client/resources/functions/invocations/__init__.py deleted file mode 100644 index 338f27980..000000000 --- a/src/runloop_api_client/resources/functions/invocations/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .invocations import ( - InvocationsResource, - AsyncInvocationsResource, - InvocationsResourceWithRawResponse, - AsyncInvocationsResourceWithRawResponse, - InvocationsResourceWithStreamingResponse, - AsyncInvocationsResourceWithStreamingResponse, -) - -__all__ = [ - "InvocationsResource", - "AsyncInvocationsResource", - "InvocationsResourceWithRawResponse", - "AsyncInvocationsResourceWithRawResponse", - "InvocationsResourceWithStreamingResponse", - "AsyncInvocationsResourceWithStreamingResponse", -] diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index c17ef2293..ae55ff93a 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -2,7 +2,10 @@ from __future__ import annotations -from .shared import ProjectLogsView as ProjectLogsView +from .shared import ( + ProjectLogsView as ProjectLogsView, + FunctionInvocationExecutionDetailView as FunctionInvocationExecutionDetailView, +) from .devbox_view import DevboxView as DevboxView from .resource_size import ResourceSize as ResourceSize from .blueprint_view import BlueprintView as BlueprintView @@ -24,6 +27,4 @@ from .function_invoke_sync_params import FunctionInvokeSyncParams as FunctionInvokeSyncParams from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams -from .function_invoke_sync_response import FunctionInvokeSyncResponse as FunctionInvokeSyncResponse from .blueprint_build_logs_list_view import BlueprintBuildLogsListView as BlueprintBuildLogsListView -from .function_invoke_async_response import FunctionInvokeAsyncResponse as FunctionInvokeAsyncResponse diff --git a/src/runloop_api_client/types/function_invoke_async_response.py b/src/runloop_api_client/types/function_invoke_async_response.py deleted file mode 100644 index 73426102c..000000000 --- a/src/runloop_api_client/types/function_invoke_async_response.py +++ /dev/null @@ -1,42 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["FunctionInvokeAsyncResponse"] - - -class FunctionInvokeAsyncResponse(BaseModel): - id: Optional[str] = None - """Unique ID of the invocation.""" - - end_time_ms: Optional[int] = None - """End time of the invocation.""" - - error: Optional[str] = None - - function_name: Optional[str] = None - """Unique name of the function.""" - - gh_commit_sha: Optional[str] = None - """The Git sha of the project this invocation used..""" - - gh_owner: Optional[str] = None - """The Github Owner of the Project.""" - - linked_devboxes: Optional[List[str]] = None - """The Devboxes created and used by this invocation.""" - - project_name: Optional[str] = None - """Unique name of the project associated with function.""" - - request: Optional[object] = None - - result: Optional[object] = None - - start_time_ms: Optional[int] = None - """Start time of the invocation.""" - - status: Optional[Literal["created", "running", "success", "failure", "canceled", "suspended"]] = None diff --git a/src/runloop_api_client/types/function_invoke_sync_response.py b/src/runloop_api_client/types/function_invoke_sync_response.py deleted file mode 100644 index 80078b149..000000000 --- a/src/runloop_api_client/types/function_invoke_sync_response.py +++ /dev/null @@ -1,42 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["FunctionInvokeSyncResponse"] - - -class FunctionInvokeSyncResponse(BaseModel): - id: Optional[str] = None - """Unique ID of the invocation.""" - - end_time_ms: Optional[int] = None - """End time of the invocation.""" - - error: Optional[str] = None - - function_name: Optional[str] = None - """Unique name of the function.""" - - gh_commit_sha: Optional[str] = None - """The Git sha of the project this invocation used..""" - - gh_owner: Optional[str] = None - """The Github Owner of the Project.""" - - linked_devboxes: Optional[List[str]] = None - """The Devboxes created and used by this invocation.""" - - project_name: Optional[str] = None - """Unique name of the project associated with function.""" - - request: Optional[object] = None - - result: Optional[object] = None - - start_time_ms: Optional[int] = None - """Start time of the invocation.""" - - status: Optional[Literal["created", "running", "success", "failure", "canceled", "suspended"]] = None diff --git a/src/runloop_api_client/types/functions/__init__.py b/src/runloop_api_client/types/functions/__init__.py index 053413c95..65762ab89 100644 --- a/src/runloop_api_client/types/functions/__init__.py +++ b/src/runloop_api_client/types/functions/__init__.py @@ -3,5 +3,4 @@ from __future__ import annotations from .invocation_list_params import InvocationListParams as InvocationListParams -from .invocation_retrieve_response import InvocationRetrieveResponse as InvocationRetrieveResponse from .function_invocation_list_view import FunctionInvocationListView as FunctionInvocationListView diff --git a/src/runloop_api_client/types/functions/invocations/__init__.py b/src/runloop_api_client/types/functions/invocations/__init__.py deleted file mode 100644 index f8ee8b14b..000000000 --- a/src/runloop_api_client/types/functions/invocations/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations diff --git a/src/runloop_api_client/types/shared/__init__.py b/src/runloop_api_client/types/shared/__init__.py index 85cd870be..e7ddc6d87 100644 --- a/src/runloop_api_client/types/shared/__init__.py +++ b/src/runloop_api_client/types/shared/__init__.py @@ -1,3 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .project_logs_view import ProjectLogsView as ProjectLogsView +from .function_invocation_execution_detail_view import ( + FunctionInvocationExecutionDetailView as FunctionInvocationExecutionDetailView, +) diff --git a/src/runloop_api_client/types/functions/invocation_retrieve_response.py b/src/runloop_api_client/types/shared/function_invocation_execution_detail_view.py similarity index 91% rename from src/runloop_api_client/types/functions/invocation_retrieve_response.py rename to src/runloop_api_client/types/shared/function_invocation_execution_detail_view.py index ca2b8e063..f9b0b5d5f 100644 --- a/src/runloop_api_client/types/functions/invocation_retrieve_response.py +++ b/src/runloop_api_client/types/shared/function_invocation_execution_detail_view.py @@ -5,10 +5,10 @@ from ..._models import BaseModel -__all__ = ["InvocationRetrieveResponse"] +__all__ = ["FunctionInvocationExecutionDetailView"] -class InvocationRetrieveResponse(BaseModel): +class FunctionInvocationExecutionDetailView(BaseModel): id: Optional[str] = None """Unique ID of the invocation.""" diff --git a/tests/api_resources/functions/invocations/__init__.py b/tests/api_resources/functions/invocations/__init__.py deleted file mode 100644 index fd8019a9a..000000000 --- a/tests/api_resources/functions/invocations/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/functions/test_invocations.py b/tests/api_resources/functions/test_invocations.py index 019df2717..36db3aa52 100644 --- a/tests/api_resources/functions/test_invocations.py +++ b/tests/api_resources/functions/test_invocations.py @@ -9,10 +9,8 @@ from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.functions import ( - FunctionInvocationListView, - InvocationRetrieveResponse, -) +from runloop_api_client.types.shared import FunctionInvocationExecutionDetailView +from runloop_api_client.types.functions import FunctionInvocationListView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -25,7 +23,7 @@ def test_method_retrieve(self, client: Runloop) -> None: invocation = client.functions.invocations.retrieve( "invocationId", ) - assert_matches_type(InvocationRetrieveResponse, invocation, path=["response"]) + assert_matches_type(FunctionInvocationExecutionDetailView, invocation, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Runloop) -> None: @@ -36,7 +34,7 @@ def test_raw_response_retrieve(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invocation = response.parse() - assert_matches_type(InvocationRetrieveResponse, invocation, path=["response"]) + assert_matches_type(FunctionInvocationExecutionDetailView, invocation, path=["response"]) @parametrize def test_streaming_response_retrieve(self, client: Runloop) -> None: @@ -47,7 +45,7 @@ def test_streaming_response_retrieve(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" invocation = response.parse() - assert_matches_type(InvocationRetrieveResponse, invocation, path=["response"]) + assert_matches_type(FunctionInvocationExecutionDetailView, invocation, path=["response"]) assert cast(Any, response.is_closed) is True @@ -138,7 +136,7 @@ async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: invocation = await async_client.functions.invocations.retrieve( "invocationId", ) - assert_matches_type(InvocationRetrieveResponse, invocation, path=["response"]) + assert_matches_type(FunctionInvocationExecutionDetailView, invocation, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: @@ -149,7 +147,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" invocation = await response.parse() - assert_matches_type(InvocationRetrieveResponse, invocation, path=["response"]) + assert_matches_type(FunctionInvocationExecutionDetailView, invocation, path=["response"]) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: @@ -160,7 +158,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" invocation = await response.parse() - assert_matches_type(InvocationRetrieveResponse, invocation, path=["response"]) + assert_matches_type(FunctionInvocationExecutionDetailView, invocation, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 8f3837c52..ab14facea 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -178,6 +178,44 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: id="", ) + @parametrize + def test_method_read_file(self, client: Runloop) -> None: + devbox = client.devboxes.read_file( + "id", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_raw_response_read_file(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.read_file( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_streaming_response_read_file(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.read_file( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_read_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.read_file( + "", + ) + @parametrize def test_method_shutdown(self, client: Runloop) -> None: devbox = client.devboxes.shutdown( @@ -216,6 +254,44 @@ def test_path_params_shutdown(self, client: Runloop) -> None: "", ) + @parametrize + def test_method_write_file(self, client: Runloop) -> None: + devbox = client.devboxes.write_file( + "id", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_raw_response_write_file(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.write_file( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_streaming_response_write_file(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.write_file( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_write_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.write_file( + "", + ) + class TestAsyncDevboxes: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -377,6 +453,44 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non id="", ) + @parametrize + async def test_method_read_file(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.read_file( + "id", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_raw_response_read_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.read_file( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_read_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.read_file( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_read_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.read_file( + "", + ) + @parametrize async def test_method_shutdown(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.shutdown( @@ -414,3 +528,41 @@ async def test_path_params_shutdown(self, async_client: AsyncRunloop) -> None: await async_client.devboxes.with_raw_response.shutdown( "", ) + + @parametrize + async def test_method_write_file(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.write_file( + "id", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_raw_response_write_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.write_file( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_write_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.write_file( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_write_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.write_file( + "", + ) diff --git a/tests/api_resources/test_functions.py b/tests/api_resources/test_functions.py index c05908ce6..e168b5de1 100644 --- a/tests/api_resources/test_functions.py +++ b/tests/api_resources/test_functions.py @@ -9,11 +9,8 @@ from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types import ( - FunctionListView, - FunctionInvokeSyncResponse, - FunctionInvokeAsyncResponse, -) +from runloop_api_client.types import FunctionListView +from runloop_api_client.types.shared import FunctionInvocationExecutionDetailView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -53,7 +50,7 @@ def test_method_invoke_async(self, client: Runloop) -> None: project_name="project_name", request={}, ) - assert_matches_type(FunctionInvokeAsyncResponse, function, path=["response"]) + assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) @parametrize def test_method_invoke_async_with_all_params(self, client: Runloop) -> None: @@ -63,7 +60,7 @@ def test_method_invoke_async_with_all_params(self, client: Runloop) -> None: request={}, runloop_meta={"session_id": "session_id"}, ) - assert_matches_type(FunctionInvokeAsyncResponse, function, path=["response"]) + assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) @parametrize def test_raw_response_invoke_async(self, client: Runloop) -> None: @@ -76,7 +73,7 @@ def test_raw_response_invoke_async(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" function = response.parse() - assert_matches_type(FunctionInvokeAsyncResponse, function, path=["response"]) + assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) @parametrize def test_streaming_response_invoke_async(self, client: Runloop) -> None: @@ -89,7 +86,7 @@ def test_streaming_response_invoke_async(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" function = response.parse() - assert_matches_type(FunctionInvokeAsyncResponse, function, path=["response"]) + assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) assert cast(Any, response.is_closed) is True @@ -116,7 +113,7 @@ def test_method_invoke_sync(self, client: Runloop) -> None: project_name="project_name", request={}, ) - assert_matches_type(FunctionInvokeSyncResponse, function, path=["response"]) + assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) @parametrize def test_method_invoke_sync_with_all_params(self, client: Runloop) -> None: @@ -126,7 +123,7 @@ def test_method_invoke_sync_with_all_params(self, client: Runloop) -> None: request={}, runloop_meta={"session_id": "session_id"}, ) - assert_matches_type(FunctionInvokeSyncResponse, function, path=["response"]) + assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) @parametrize def test_raw_response_invoke_sync(self, client: Runloop) -> None: @@ -139,7 +136,7 @@ def test_raw_response_invoke_sync(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" function = response.parse() - assert_matches_type(FunctionInvokeSyncResponse, function, path=["response"]) + assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) @parametrize def test_streaming_response_invoke_sync(self, client: Runloop) -> None: @@ -152,7 +149,7 @@ def test_streaming_response_invoke_sync(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" function = response.parse() - assert_matches_type(FunctionInvokeSyncResponse, function, path=["response"]) + assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) assert cast(Any, response.is_closed) is True @@ -208,7 +205,7 @@ async def test_method_invoke_async(self, async_client: AsyncRunloop) -> None: project_name="project_name", request={}, ) - assert_matches_type(FunctionInvokeAsyncResponse, function, path=["response"]) + assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) @parametrize async def test_method_invoke_async_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -218,7 +215,7 @@ async def test_method_invoke_async_with_all_params(self, async_client: AsyncRunl request={}, runloop_meta={"session_id": "session_id"}, ) - assert_matches_type(FunctionInvokeAsyncResponse, function, path=["response"]) + assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) @parametrize async def test_raw_response_invoke_async(self, async_client: AsyncRunloop) -> None: @@ -231,7 +228,7 @@ async def test_raw_response_invoke_async(self, async_client: AsyncRunloop) -> No assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" function = await response.parse() - assert_matches_type(FunctionInvokeAsyncResponse, function, path=["response"]) + assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) @parametrize async def test_streaming_response_invoke_async(self, async_client: AsyncRunloop) -> None: @@ -244,7 +241,7 @@ async def test_streaming_response_invoke_async(self, async_client: AsyncRunloop) assert response.http_request.headers.get("X-Stainless-Lang") == "python" function = await response.parse() - assert_matches_type(FunctionInvokeAsyncResponse, function, path=["response"]) + assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) assert cast(Any, response.is_closed) is True @@ -271,7 +268,7 @@ async def test_method_invoke_sync(self, async_client: AsyncRunloop) -> None: project_name="project_name", request={}, ) - assert_matches_type(FunctionInvokeSyncResponse, function, path=["response"]) + assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) @parametrize async def test_method_invoke_sync_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -281,7 +278,7 @@ async def test_method_invoke_sync_with_all_params(self, async_client: AsyncRunlo request={}, runloop_meta={"session_id": "session_id"}, ) - assert_matches_type(FunctionInvokeSyncResponse, function, path=["response"]) + assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) @parametrize async def test_raw_response_invoke_sync(self, async_client: AsyncRunloop) -> None: @@ -294,7 +291,7 @@ async def test_raw_response_invoke_sync(self, async_client: AsyncRunloop) -> Non assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" function = await response.parse() - assert_matches_type(FunctionInvokeSyncResponse, function, path=["response"]) + assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) @parametrize async def test_streaming_response_invoke_sync(self, async_client: AsyncRunloop) -> None: @@ -307,7 +304,7 @@ async def test_streaming_response_invoke_sync(self, async_client: AsyncRunloop) assert response.http_request.headers.get("X-Stainless-Lang") == "python" function = await response.parse() - assert_matches_type(FunctionInvokeSyncResponse, function, path=["response"]) + assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) assert cast(Any, response.is_closed) is True From 7e5f680619b0624f5523246e85ff7a966f133ca8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 23:31:46 +0000 Subject: [PATCH 058/993] chore(internal): version bump (#62) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c373724dc..46b9b6b24 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.8" + ".": "0.1.0-alpha.9" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index c9cddd13f..42376c8a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.1.0-alpha.8" +version = "0.1.0-alpha.9" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index d1c095c91..8da55babb 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.1.0-alpha.8" # x-release-please-version +__version__ = "0.1.0-alpha.9" # x-release-please-version From 9508ee6312c26eb4354a9be2bdaddd328ceef6ca Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 00:01:06 +0000 Subject: [PATCH 059/993] feat(api): update via SDK Studio (#63) --- .stats.yml | 2 +- api.md | 4 +- .../resources/devboxes/devboxes.py | 42 +++++++++++- src/runloop_api_client/types/__init__.py | 2 + .../types/devbox_read_file_params.py | 12 ++++ .../types/devbox_write_file_params.py | 15 +++++ tests/api_resources/test_devboxes.py | 66 ++++++++++++++----- 7 files changed, 123 insertions(+), 20 deletions(-) create mode 100644 src/runloop_api_client/types/devbox_read_file_params.py create mode 100644 src/runloop_api_client/types/devbox_write_file_params.py diff --git a/.stats.yml b/.stats.yml index 1d8bfbdbc..7cedd3be7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8ed7237714dcf00d5e186095c38ac8afb3300d4773e0d836042d89f3b53c7ffc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d46e8a351f9ab9469594e4ac1b185033afe2e530e0dd6df2cae2a666d8fc8336.yml diff --git a/api.md b/api.md index fd2f1657b..9b175e4bc 100644 --- a/api.md +++ b/api.md @@ -57,9 +57,9 @@ Methods: - client.devboxes.retrieve(id) -> DevboxView - client.devboxes.list(\*\*params) -> DevboxListView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView -- client.devboxes.read_file(id) -> DevboxExecutionDetailView +- client.devboxes.read_file(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.shutdown(id) -> DevboxView -- client.devboxes.write_file(id) -> DevboxExecutionDetailView +- client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView ## Logs diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index a60134e74..db973f65d 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -14,7 +14,13 @@ LogsResourceWithStreamingResponse, AsyncLogsResourceWithStreamingResponse, ) -from ...types import devbox_list_params, devbox_create_params, devbox_execute_sync_params +from ...types import ( + devbox_list_params, + devbox_create_params, + devbox_read_file_params, + devbox_write_file_params, + devbox_execute_sync_params, +) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( maybe_transform, @@ -251,6 +257,7 @@ def read_file( self, id: str, *, + file_path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -262,6 +269,8 @@ def read_file( Read file contents from a file on given Devbox. Args: + file_path: The path of the file to read. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -274,6 +283,7 @@ def read_file( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/read_file", + body=maybe_transform({"file_path": file_path}, devbox_read_file_params.DevboxReadFileParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -318,6 +328,8 @@ def write_file( self, id: str, *, + contents: str | NotGiven = NOT_GIVEN, + file_path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -329,6 +341,10 @@ def write_file( Write contents to a file at path on the Devbox. Args: + contents: The contents to write to file. + + file_path: The path of the file to read. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -341,6 +357,13 @@ def write_file( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/write_file", + body=maybe_transform( + { + "contents": contents, + "file_path": file_path, + }, + devbox_write_file_params.DevboxWriteFileParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -563,6 +586,7 @@ async def read_file( self, id: str, *, + file_path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -574,6 +598,8 @@ async def read_file( Read file contents from a file on given Devbox. Args: + file_path: The path of the file to read. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -586,6 +612,7 @@ async def read_file( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( f"/v1/devboxes/{id}/read_file", + body=await async_maybe_transform({"file_path": file_path}, devbox_read_file_params.DevboxReadFileParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -630,6 +657,8 @@ async def write_file( self, id: str, *, + contents: str | NotGiven = NOT_GIVEN, + file_path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -641,6 +670,10 @@ async def write_file( Write contents to a file at path on the Devbox. Args: + contents: The contents to write to file. + + file_path: The path of the file to read. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -653,6 +686,13 @@ async def write_file( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( f"/v1/devboxes/{id}/write_file", + body=await async_maybe_transform( + { + "contents": contents, + "file_path": file_path, + }, + devbox_write_file_params.DevboxWriteFileParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index ae55ff93a..6a3168cd1 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -20,7 +20,9 @@ from .code_mount_parameters import CodeMountParameters as CodeMountParameters from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams +from .devbox_read_file_params import DevboxReadFileParams as DevboxReadFileParams from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams +from .devbox_write_file_params import DevboxWriteFileParams as DevboxWriteFileParams from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams from .code_mount_parameters_param import CodeMountParametersParam as CodeMountParametersParam diff --git a/src/runloop_api_client/types/devbox_read_file_params.py b/src/runloop_api_client/types/devbox_read_file_params.py new file mode 100644 index 000000000..ef69ed4f9 --- /dev/null +++ b/src/runloop_api_client/types/devbox_read_file_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["DevboxReadFileParams"] + + +class DevboxReadFileParams(TypedDict, total=False): + file_path: str + """The path of the file to read.""" diff --git a/src/runloop_api_client/types/devbox_write_file_params.py b/src/runloop_api_client/types/devbox_write_file_params.py new file mode 100644 index 000000000..4bf249426 --- /dev/null +++ b/src/runloop_api_client/types/devbox_write_file_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["DevboxWriteFileParams"] + + +class DevboxWriteFileParams(TypedDict, total=False): + contents: str + """The contents to write to file.""" + + file_path: str + """The path of the file to read.""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index ab14facea..ae2976653 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -181,14 +181,22 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: @parametrize def test_method_read_file(self, client: Runloop) -> None: devbox = client.devboxes.read_file( - "id", + id="id", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_method_read_file_with_all_params(self, client: Runloop) -> None: + devbox = client.devboxes.read_file( + id="id", + file_path="file_path", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize def test_raw_response_read_file(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.read_file( - "id", + id="id", ) assert response.is_closed is True @@ -199,7 +207,7 @@ def test_raw_response_read_file(self, client: Runloop) -> None: @parametrize def test_streaming_response_read_file(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.read_file( - "id", + id="id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -213,7 +221,7 @@ def test_streaming_response_read_file(self, client: Runloop) -> None: def test_path_params_read_file(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.with_raw_response.read_file( - "", + id="", ) @parametrize @@ -257,14 +265,23 @@ def test_path_params_shutdown(self, client: Runloop) -> None: @parametrize def test_method_write_file(self, client: Runloop) -> None: devbox = client.devboxes.write_file( - "id", + id="id", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_method_write_file_with_all_params(self, client: Runloop) -> None: + devbox = client.devboxes.write_file( + id="id", + contents="contents", + file_path="file_path", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize def test_raw_response_write_file(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.write_file( - "id", + id="id", ) assert response.is_closed is True @@ -275,7 +292,7 @@ def test_raw_response_write_file(self, client: Runloop) -> None: @parametrize def test_streaming_response_write_file(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.write_file( - "id", + id="id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -289,7 +306,7 @@ def test_streaming_response_write_file(self, client: Runloop) -> None: def test_path_params_write_file(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.with_raw_response.write_file( - "", + id="", ) @@ -456,14 +473,22 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non @parametrize async def test_method_read_file(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.read_file( - "id", + id="id", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_method_read_file_with_all_params(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.read_file( + id="id", + file_path="file_path", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize async def test_raw_response_read_file(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.read_file( - "id", + id="id", ) assert response.is_closed is True @@ -474,7 +499,7 @@ async def test_raw_response_read_file(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_read_file(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.read_file( - "id", + id="id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -488,7 +513,7 @@ async def test_streaming_response_read_file(self, async_client: AsyncRunloop) -> async def test_path_params_read_file(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.with_raw_response.read_file( - "", + id="", ) @parametrize @@ -532,14 +557,23 @@ async def test_path_params_shutdown(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_write_file(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.write_file( - "id", + id="id", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_method_write_file_with_all_params(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.write_file( + id="id", + contents="contents", + file_path="file_path", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize async def test_raw_response_write_file(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.write_file( - "id", + id="id", ) assert response.is_closed is True @@ -550,7 +584,7 @@ async def test_raw_response_write_file(self, async_client: AsyncRunloop) -> None @parametrize async def test_streaming_response_write_file(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.write_file( - "id", + id="id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -564,5 +598,5 @@ async def test_streaming_response_write_file(self, async_client: AsyncRunloop) - async def test_path_params_write_file(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.with_raw_response.write_file( - "", + id="", ) From b8c8503c403d46a38939409f83479331e21858be Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 00:05:10 +0000 Subject: [PATCH 060/993] chore(internal): version bump (#65) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 46b9b6b24..3b005e525 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.9" + ".": "0.1.0-alpha.10" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 42376c8a1..6638ef28d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.1.0-alpha.9" +version = "0.1.0-alpha.10" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 8da55babb..1b00567fb 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.1.0-alpha.9" # x-release-please-version +__version__ = "0.1.0-alpha.10" # x-release-please-version From c5eb78ddcdf7cbe6b8fbd70057584fbbf31d554c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 00:12:22 +0000 Subject: [PATCH 061/993] feat(api): OpenAPI spec update via Stainless API (#66) --- .stats.yml | 2 +- api.md | 4 +- .../resources/devboxes/devboxes.py | 42 +----------- src/runloop_api_client/types/__init__.py | 2 - .../types/devbox_read_file_params.py | 12 ---- .../types/devbox_write_file_params.py | 15 ----- tests/api_resources/test_devboxes.py | 66 +++++-------------- 7 files changed, 20 insertions(+), 123 deletions(-) delete mode 100644 src/runloop_api_client/types/devbox_read_file_params.py delete mode 100644 src/runloop_api_client/types/devbox_write_file_params.py diff --git a/.stats.yml b/.stats.yml index 7cedd3be7..1d8bfbdbc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d46e8a351f9ab9469594e4ac1b185033afe2e530e0dd6df2cae2a666d8fc8336.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8ed7237714dcf00d5e186095c38ac8afb3300d4773e0d836042d89f3b53c7ffc.yml diff --git a/api.md b/api.md index 9b175e4bc..fd2f1657b 100644 --- a/api.md +++ b/api.md @@ -57,9 +57,9 @@ Methods: - client.devboxes.retrieve(id) -> DevboxView - client.devboxes.list(\*\*params) -> DevboxListView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView -- client.devboxes.read_file(id, \*\*params) -> DevboxExecutionDetailView +- client.devboxes.read_file(id) -> DevboxExecutionDetailView - client.devboxes.shutdown(id) -> DevboxView -- client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +- client.devboxes.write_file(id) -> DevboxExecutionDetailView ## Logs diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index db973f65d..a60134e74 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -14,13 +14,7 @@ LogsResourceWithStreamingResponse, AsyncLogsResourceWithStreamingResponse, ) -from ...types import ( - devbox_list_params, - devbox_create_params, - devbox_read_file_params, - devbox_write_file_params, - devbox_execute_sync_params, -) +from ...types import devbox_list_params, devbox_create_params, devbox_execute_sync_params from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( maybe_transform, @@ -257,7 +251,6 @@ def read_file( self, id: str, *, - file_path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -269,8 +262,6 @@ def read_file( Read file contents from a file on given Devbox. Args: - file_path: The path of the file to read. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -283,7 +274,6 @@ def read_file( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/read_file", - body=maybe_transform({"file_path": file_path}, devbox_read_file_params.DevboxReadFileParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -328,8 +318,6 @@ def write_file( self, id: str, *, - contents: str | NotGiven = NOT_GIVEN, - file_path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -341,10 +329,6 @@ def write_file( Write contents to a file at path on the Devbox. Args: - contents: The contents to write to file. - - file_path: The path of the file to read. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -357,13 +341,6 @@ def write_file( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/write_file", - body=maybe_transform( - { - "contents": contents, - "file_path": file_path, - }, - devbox_write_file_params.DevboxWriteFileParams, - ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -586,7 +563,6 @@ async def read_file( self, id: str, *, - file_path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -598,8 +574,6 @@ async def read_file( Read file contents from a file on given Devbox. Args: - file_path: The path of the file to read. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -612,7 +586,6 @@ async def read_file( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( f"/v1/devboxes/{id}/read_file", - body=await async_maybe_transform({"file_path": file_path}, devbox_read_file_params.DevboxReadFileParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -657,8 +630,6 @@ async def write_file( self, id: str, *, - contents: str | NotGiven = NOT_GIVEN, - file_path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -670,10 +641,6 @@ async def write_file( Write contents to a file at path on the Devbox. Args: - contents: The contents to write to file. - - file_path: The path of the file to read. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -686,13 +653,6 @@ async def write_file( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( f"/v1/devboxes/{id}/write_file", - body=await async_maybe_transform( - { - "contents": contents, - "file_path": file_path, - }, - devbox_write_file_params.DevboxWriteFileParams, - ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 6a3168cd1..ae55ff93a 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -20,9 +20,7 @@ from .code_mount_parameters import CodeMountParameters as CodeMountParameters from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams -from .devbox_read_file_params import DevboxReadFileParams as DevboxReadFileParams from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams -from .devbox_write_file_params import DevboxWriteFileParams as DevboxWriteFileParams from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams from .code_mount_parameters_param import CodeMountParametersParam as CodeMountParametersParam diff --git a/src/runloop_api_client/types/devbox_read_file_params.py b/src/runloop_api_client/types/devbox_read_file_params.py deleted file mode 100644 index ef69ed4f9..000000000 --- a/src/runloop_api_client/types/devbox_read_file_params.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["DevboxReadFileParams"] - - -class DevboxReadFileParams(TypedDict, total=False): - file_path: str - """The path of the file to read.""" diff --git a/src/runloop_api_client/types/devbox_write_file_params.py b/src/runloop_api_client/types/devbox_write_file_params.py deleted file mode 100644 index 4bf249426..000000000 --- a/src/runloop_api_client/types/devbox_write_file_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["DevboxWriteFileParams"] - - -class DevboxWriteFileParams(TypedDict, total=False): - contents: str - """The contents to write to file.""" - - file_path: str - """The path of the file to read.""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index ae2976653..ab14facea 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -181,22 +181,14 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: @parametrize def test_method_read_file(self, client: Runloop) -> None: devbox = client.devboxes.read_file( - id="id", - ) - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - - @parametrize - def test_method_read_file_with_all_params(self, client: Runloop) -> None: - devbox = client.devboxes.read_file( - id="id", - file_path="file_path", + "id", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize def test_raw_response_read_file(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.read_file( - id="id", + "id", ) assert response.is_closed is True @@ -207,7 +199,7 @@ def test_raw_response_read_file(self, client: Runloop) -> None: @parametrize def test_streaming_response_read_file(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.read_file( - id="id", + "id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -221,7 +213,7 @@ def test_streaming_response_read_file(self, client: Runloop) -> None: def test_path_params_read_file(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.with_raw_response.read_file( - id="", + "", ) @parametrize @@ -265,23 +257,14 @@ def test_path_params_shutdown(self, client: Runloop) -> None: @parametrize def test_method_write_file(self, client: Runloop) -> None: devbox = client.devboxes.write_file( - id="id", - ) - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - - @parametrize - def test_method_write_file_with_all_params(self, client: Runloop) -> None: - devbox = client.devboxes.write_file( - id="id", - contents="contents", - file_path="file_path", + "id", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize def test_raw_response_write_file(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.write_file( - id="id", + "id", ) assert response.is_closed is True @@ -292,7 +275,7 @@ def test_raw_response_write_file(self, client: Runloop) -> None: @parametrize def test_streaming_response_write_file(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.write_file( - id="id", + "id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -306,7 +289,7 @@ def test_streaming_response_write_file(self, client: Runloop) -> None: def test_path_params_write_file(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.with_raw_response.write_file( - id="", + "", ) @@ -473,22 +456,14 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non @parametrize async def test_method_read_file(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.read_file( - id="id", - ) - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - - @parametrize - async def test_method_read_file_with_all_params(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.read_file( - id="id", - file_path="file_path", + "id", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize async def test_raw_response_read_file(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.read_file( - id="id", + "id", ) assert response.is_closed is True @@ -499,7 +474,7 @@ async def test_raw_response_read_file(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_read_file(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.read_file( - id="id", + "id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -513,7 +488,7 @@ async def test_streaming_response_read_file(self, async_client: AsyncRunloop) -> async def test_path_params_read_file(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.with_raw_response.read_file( - id="", + "", ) @parametrize @@ -557,23 +532,14 @@ async def test_path_params_shutdown(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_write_file(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.write_file( - id="id", - ) - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - - @parametrize - async def test_method_write_file_with_all_params(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.write_file( - id="id", - contents="contents", - file_path="file_path", + "id", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize async def test_raw_response_write_file(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.write_file( - id="id", + "id", ) assert response.is_closed is True @@ -584,7 +550,7 @@ async def test_raw_response_write_file(self, async_client: AsyncRunloop) -> None @parametrize async def test_streaming_response_write_file(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.write_file( - id="id", + "id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -598,5 +564,5 @@ async def test_streaming_response_write_file(self, async_client: AsyncRunloop) - async def test_path_params_write_file(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.with_raw_response.write_file( - id="", + "", ) From 131016fb765e3caa2294dd2bb30275ff6f2ff5f2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 17:12:40 +0000 Subject: [PATCH 062/993] feat(api): OpenAPI spec update via Stainless API (#68) --- .stats.yml | 2 +- api.md | 4 +- .../resources/devboxes/devboxes.py | 42 +++++++++++- src/runloop_api_client/types/__init__.py | 2 + .../types/devbox_read_file_params.py | 12 ++++ src/runloop_api_client/types/devbox_view.py | 7 +- .../types/devbox_write_file_params.py | 15 +++++ tests/api_resources/test_devboxes.py | 66 ++++++++++++++----- 8 files changed, 125 insertions(+), 25 deletions(-) create mode 100644 src/runloop_api_client/types/devbox_read_file_params.py create mode 100644 src/runloop_api_client/types/devbox_write_file_params.py diff --git a/.stats.yml b/.stats.yml index 1d8bfbdbc..4d9cc5d82 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8ed7237714dcf00d5e186095c38ac8afb3300d4773e0d836042d89f3b53c7ffc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-83cb6c06b862aafedf31b248292a86db82c2a9b494c83c688c86fe9db2115a55.yml diff --git a/api.md b/api.md index fd2f1657b..9b175e4bc 100644 --- a/api.md +++ b/api.md @@ -57,9 +57,9 @@ Methods: - client.devboxes.retrieve(id) -> DevboxView - client.devboxes.list(\*\*params) -> DevboxListView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView -- client.devboxes.read_file(id) -> DevboxExecutionDetailView +- client.devboxes.read_file(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.shutdown(id) -> DevboxView -- client.devboxes.write_file(id) -> DevboxExecutionDetailView +- client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView ## Logs diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index a60134e74..db973f65d 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -14,7 +14,13 @@ LogsResourceWithStreamingResponse, AsyncLogsResourceWithStreamingResponse, ) -from ...types import devbox_list_params, devbox_create_params, devbox_execute_sync_params +from ...types import ( + devbox_list_params, + devbox_create_params, + devbox_read_file_params, + devbox_write_file_params, + devbox_execute_sync_params, +) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( maybe_transform, @@ -251,6 +257,7 @@ def read_file( self, id: str, *, + file_path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -262,6 +269,8 @@ def read_file( Read file contents from a file on given Devbox. Args: + file_path: The path of the file to read. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -274,6 +283,7 @@ def read_file( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/read_file", + body=maybe_transform({"file_path": file_path}, devbox_read_file_params.DevboxReadFileParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -318,6 +328,8 @@ def write_file( self, id: str, *, + contents: str | NotGiven = NOT_GIVEN, + file_path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -329,6 +341,10 @@ def write_file( Write contents to a file at path on the Devbox. Args: + contents: The contents to write to file. + + file_path: The path of the file to read. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -341,6 +357,13 @@ def write_file( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/write_file", + body=maybe_transform( + { + "contents": contents, + "file_path": file_path, + }, + devbox_write_file_params.DevboxWriteFileParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -563,6 +586,7 @@ async def read_file( self, id: str, *, + file_path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -574,6 +598,8 @@ async def read_file( Read file contents from a file on given Devbox. Args: + file_path: The path of the file to read. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -586,6 +612,7 @@ async def read_file( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( f"/v1/devboxes/{id}/read_file", + body=await async_maybe_transform({"file_path": file_path}, devbox_read_file_params.DevboxReadFileParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -630,6 +657,8 @@ async def write_file( self, id: str, *, + contents: str | NotGiven = NOT_GIVEN, + file_path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -641,6 +670,10 @@ async def write_file( Write contents to a file at path on the Devbox. Args: + contents: The contents to write to file. + + file_path: The path of the file to read. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -653,6 +686,13 @@ async def write_file( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( f"/v1/devboxes/{id}/write_file", + body=await async_maybe_transform( + { + "contents": contents, + "file_path": file_path, + }, + devbox_write_file_params.DevboxWriteFileParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index ae55ff93a..6a3168cd1 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -20,7 +20,9 @@ from .code_mount_parameters import CodeMountParameters as CodeMountParameters from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams +from .devbox_read_file_params import DevboxReadFileParams as DevboxReadFileParams from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams +from .devbox_write_file_params import DevboxWriteFileParams as DevboxWriteFileParams from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams from .code_mount_parameters_param import CodeMountParametersParam as CodeMountParametersParam diff --git a/src/runloop_api_client/types/devbox_read_file_params.py b/src/runloop_api_client/types/devbox_read_file_params.py new file mode 100644 index 000000000..ef69ed4f9 --- /dev/null +++ b/src/runloop_api_client/types/devbox_read_file_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["DevboxReadFileParams"] + + +class DevboxReadFileParams(TypedDict, total=False): + file_path: str + """The path of the file to read.""" diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 36ca053cd..724ce3372 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -30,8 +30,5 @@ class DevboxView(BaseModel): name: Optional[str] = None """The name of the Devbox.""" - status: Optional[str] = None - """ - The current status of the Devbox (provisioning, initializing, running, failure, - shutdown). - """ + status: Optional[Literal["provisioning", "initializing", "running", "failure", "shutdown"]] = None + """The current status of the Devbox.""" diff --git a/src/runloop_api_client/types/devbox_write_file_params.py b/src/runloop_api_client/types/devbox_write_file_params.py new file mode 100644 index 000000000..4bf249426 --- /dev/null +++ b/src/runloop_api_client/types/devbox_write_file_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["DevboxWriteFileParams"] + + +class DevboxWriteFileParams(TypedDict, total=False): + contents: str + """The contents to write to file.""" + + file_path: str + """The path of the file to read.""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index ab14facea..ae2976653 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -181,14 +181,22 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: @parametrize def test_method_read_file(self, client: Runloop) -> None: devbox = client.devboxes.read_file( - "id", + id="id", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_method_read_file_with_all_params(self, client: Runloop) -> None: + devbox = client.devboxes.read_file( + id="id", + file_path="file_path", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize def test_raw_response_read_file(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.read_file( - "id", + id="id", ) assert response.is_closed is True @@ -199,7 +207,7 @@ def test_raw_response_read_file(self, client: Runloop) -> None: @parametrize def test_streaming_response_read_file(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.read_file( - "id", + id="id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -213,7 +221,7 @@ def test_streaming_response_read_file(self, client: Runloop) -> None: def test_path_params_read_file(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.with_raw_response.read_file( - "", + id="", ) @parametrize @@ -257,14 +265,23 @@ def test_path_params_shutdown(self, client: Runloop) -> None: @parametrize def test_method_write_file(self, client: Runloop) -> None: devbox = client.devboxes.write_file( - "id", + id="id", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_method_write_file_with_all_params(self, client: Runloop) -> None: + devbox = client.devboxes.write_file( + id="id", + contents="contents", + file_path="file_path", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize def test_raw_response_write_file(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.write_file( - "id", + id="id", ) assert response.is_closed is True @@ -275,7 +292,7 @@ def test_raw_response_write_file(self, client: Runloop) -> None: @parametrize def test_streaming_response_write_file(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.write_file( - "id", + id="id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -289,7 +306,7 @@ def test_streaming_response_write_file(self, client: Runloop) -> None: def test_path_params_write_file(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.with_raw_response.write_file( - "", + id="", ) @@ -456,14 +473,22 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non @parametrize async def test_method_read_file(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.read_file( - "id", + id="id", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_method_read_file_with_all_params(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.read_file( + id="id", + file_path="file_path", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize async def test_raw_response_read_file(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.read_file( - "id", + id="id", ) assert response.is_closed is True @@ -474,7 +499,7 @@ async def test_raw_response_read_file(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_read_file(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.read_file( - "id", + id="id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -488,7 +513,7 @@ async def test_streaming_response_read_file(self, async_client: AsyncRunloop) -> async def test_path_params_read_file(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.with_raw_response.read_file( - "", + id="", ) @parametrize @@ -532,14 +557,23 @@ async def test_path_params_shutdown(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_write_file(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.write_file( - "id", + id="id", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_method_write_file_with_all_params(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.write_file( + id="id", + contents="contents", + file_path="file_path", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize async def test_raw_response_write_file(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.write_file( - "id", + id="id", ) assert response.is_closed is True @@ -550,7 +584,7 @@ async def test_raw_response_write_file(self, async_client: AsyncRunloop) -> None @parametrize async def test_streaming_response_write_file(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.write_file( - "id", + id="id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -564,5 +598,5 @@ async def test_streaming_response_write_file(self, async_client: AsyncRunloop) - async def test_path_params_write_file(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.with_raw_response.write_file( - "", + id="", ) From 96c0ab9a672d68ff4851dc32169489a219debaef Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 3 Aug 2024 00:17:14 +0000 Subject: [PATCH 063/993] feat(api): OpenAPI spec update via Stainless API (#69) --- README.md | 22 +++++++++++----------- tests/test_client.py | 16 ++++++++-------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index b95c87a09..8dc4c7e51 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,8 @@ client = Runloop( bearer_token=os.environ.get("RUNLOOP_API_KEY"), ) -blueprint_view = client.blueprints.create() -print(blueprint_view.id) +devbox_view = client.devboxes.create() +print(devbox_view.id) ``` While you can provide a `bearer_token` keyword argument, @@ -57,8 +57,8 @@ client = AsyncRunloop( async def main() -> None: - blueprint_view = await client.blueprints.create() - print(blueprint_view.id) + devbox_view = await client.devboxes.create() + print(devbox_view.id) asyncio.run(main()) @@ -91,7 +91,7 @@ from runloop_api_client import Runloop client = Runloop() try: - client.blueprints.create() + client.devboxes.create() except runloop_api_client.APIConnectionError as e: print("The server could not be reached") print(e.__cause__) # an underlying Exception, likely raised within httpx. @@ -134,7 +134,7 @@ client = Runloop( ) # Or, configure per-request: -client.with_options(max_retries=5).blueprints.create() +client.with_options(max_retries=5).devboxes.create() ``` ### Timeouts @@ -157,7 +157,7 @@ client = Runloop( ) # Override per-request: -client.with_options(timeout=5.0).blueprints.create() +client.with_options(timeout=5.0).devboxes.create() ``` On timeout, an `APITimeoutError` is thrown. @@ -196,11 +196,11 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to from runloop_api_client import Runloop client = Runloop() -response = client.blueprints.with_raw_response.create() +response = client.devboxes.with_raw_response.create() print(response.headers.get('X-My-Header')) -blueprint = response.parse() # get the object that `blueprints.create()` would have returned -print(blueprint.id) +devbox = response.parse() # get the object that `devboxes.create()` would have returned +print(devbox.id) ``` These methods return an [`APIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_api_client/_response.py) object. @@ -214,7 +214,7 @@ The above interface eagerly reads the full response body when you make the reque To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods. ```python -with client.blueprints.with_streaming_response.create() as response: +with client.devboxes.with_streaming_response.create() as response: print(response.headers.get("X-My-Header")) for line in response.iter_lines(): diff --git a/tests/test_client.py b/tests/test_client.py index 98e674233..75431ad53 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -732,11 +732,11 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: - respx_mock.post("/v1/blueprints").mock(side_effect=httpx.TimeoutException("Test timeout error")) + respx_mock.post("/v1/devboxes").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): self.client.post( - "/v1/blueprints", + "/v1/devboxes", body=cast(object, dict()), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, @@ -747,11 +747,11 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: - respx_mock.post("/v1/blueprints").mock(return_value=httpx.Response(500)) + respx_mock.post("/v1/devboxes").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): self.client.post( - "/v1/blueprints", + "/v1/devboxes", body=cast(object, dict()), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, @@ -1447,11 +1447,11 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: - respx_mock.post("/v1/blueprints").mock(side_effect=httpx.TimeoutException("Test timeout error")) + respx_mock.post("/v1/devboxes").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): await self.client.post( - "/v1/blueprints", + "/v1/devboxes", body=cast(object, dict()), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, @@ -1462,11 +1462,11 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: - respx_mock.post("/v1/blueprints").mock(return_value=httpx.Response(500)) + respx_mock.post("/v1/devboxes").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): await self.client.post( - "/v1/blueprints", + "/v1/devboxes", body=cast(object, dict()), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, From aa7e4cb44c1bdff97125e5ae7c4ddf97f7978633 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 19:18:40 +0000 Subject: [PATCH 064/993] feat(api): OpenAPI spec update via Stainless API (#70) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 4d9cc5d82..04825c60f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-83cb6c06b862aafedf31b248292a86db82c2a9b494c83c688c86fe9db2115a55.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-850a16f2d01beda246aa00fbc0edef3df1c3018638f008ef24ef00727093a5cb.yml From f6c0f43436b3519665eb7d2c68c5ca40f43f0f28 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 19:19:46 +0000 Subject: [PATCH 065/993] chore(internal): use `TypeAlias` marker for type assignments (#71) --- src/runloop_api_client/types/resource_size.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runloop_api_client/types/resource_size.py b/src/runloop_api_client/types/resource_size.py index 7bd7db794..528198ab4 100644 --- a/src/runloop_api_client/types/resource_size.py +++ b/src/runloop_api_client/types/resource_size.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing_extensions import Literal +from typing_extensions import Literal, TypeAlias __all__ = ["ResourceSize"] -ResourceSize = Literal["MINI", "SMALL", "MEDIUM", "LARGE"] +ResourceSize: TypeAlias = Literal["MINI", "SMALL", "MEDIUM", "LARGE"] From b3a942870d8b06229f967e93b085103f535902ee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 19:20:09 +0000 Subject: [PATCH 066/993] chore(internal): bump pyright (#72) --- requirements-dev.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index e5f8ae596..8b87bde54 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -70,7 +70,7 @@ pydantic-core==2.18.2 # via pydantic pygments==2.18.0 # via rich -pyright==1.1.364 +pyright==1.1.374 pytest==7.1.1 # via pytest-asyncio pytest-asyncio==0.21.1 From 8734939b92a048d5f3a8c31ffe77a1cf06695b22 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 19:20:32 +0000 Subject: [PATCH 067/993] feat(client): add `retry_count` to raw response class (#73) --- src/runloop_api_client/_base_client.py | 8 +++++ src/runloop_api_client/_response.py | 5 +++ tests/test_client.py | 45 ++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index 30569c617..e1d9f984c 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -1049,6 +1049,7 @@ def _request( response=response, stream=stream, stream_cls=stream_cls, + retries_taken=options.get_max_retries(self.max_retries) - retries, ) def _retry_request( @@ -1090,6 +1091,7 @@ def _process_response( response: httpx.Response, stream: bool, stream_cls: type[Stream[Any]] | type[AsyncStream[Any]] | None, + retries_taken: int = 0, ) -> ResponseT: origin = get_origin(cast_to) or cast_to @@ -1107,6 +1109,7 @@ def _process_response( stream=stream, stream_cls=stream_cls, options=options, + retries_taken=retries_taken, ), ) @@ -1120,6 +1123,7 @@ def _process_response( stream=stream, stream_cls=stream_cls, options=options, + retries_taken=retries_taken, ) if bool(response.request.headers.get(RAW_RESPONSE_HEADER)): return cast(ResponseT, api_response) @@ -1610,6 +1614,7 @@ async def _request( response=response, stream=stream, stream_cls=stream_cls, + retries_taken=options.get_max_retries(self.max_retries) - retries, ) async def _retry_request( @@ -1649,6 +1654,7 @@ async def _process_response( response: httpx.Response, stream: bool, stream_cls: type[Stream[Any]] | type[AsyncStream[Any]] | None, + retries_taken: int = 0, ) -> ResponseT: origin = get_origin(cast_to) or cast_to @@ -1666,6 +1672,7 @@ async def _process_response( stream=stream, stream_cls=stream_cls, options=options, + retries_taken=retries_taken, ), ) @@ -1679,6 +1686,7 @@ async def _process_response( stream=stream, stream_cls=stream_cls, options=options, + retries_taken=retries_taken, ) if bool(response.request.headers.get(RAW_RESPONSE_HEADER)): return cast(ResponseT, api_response) diff --git a/src/runloop_api_client/_response.py b/src/runloop_api_client/_response.py index 56f0c603e..6cba530a2 100644 --- a/src/runloop_api_client/_response.py +++ b/src/runloop_api_client/_response.py @@ -55,6 +55,9 @@ class BaseAPIResponse(Generic[R]): http_response: httpx.Response + retries_taken: int + """The number of retries made. If no retries happened this will be `0`""" + def __init__( self, *, @@ -64,6 +67,7 @@ def __init__( stream: bool, stream_cls: type[Stream[Any]] | type[AsyncStream[Any]] | None, options: FinalRequestOptions, + retries_taken: int = 0, ) -> None: self._cast_to = cast_to self._client = client @@ -72,6 +76,7 @@ def __init__( self._stream_cls = stream_cls self._options = options self.http_response = raw + self.retries_taken = retries_taken @property def headers(self) -> httpx.Headers: diff --git a/tests/test_client.py b/tests/test_client.py index 75431ad53..1a3838e14 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -759,6 +759,27 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non assert _get_open_connections(self.client) == 0 + @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) + @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @pytest.mark.respx(base_url=base_url) + def test_retries_taken(self, client: Runloop, failures_before_success: int, respx_mock: MockRouter) -> None: + client = client.with_options(max_retries=4) + + nb_retries = 0 + + def retry_handler(_request: httpx.Request) -> httpx.Response: + nonlocal nb_retries + if nb_retries < failures_before_success: + nb_retries += 1 + return httpx.Response(500) + return httpx.Response(200) + + respx_mock.post("/v1/devboxes").mock(side_effect=retry_handler) + + response = client.devboxes.with_raw_response.create() + + assert response.retries_taken == failures_before_success + class TestAsyncRunloop: client = AsyncRunloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) @@ -1473,3 +1494,27 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) ) assert _get_open_connections(self.client) == 0 + + @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) + @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @pytest.mark.respx(base_url=base_url) + @pytest.mark.asyncio + async def test_retries_taken( + self, async_client: AsyncRunloop, failures_before_success: int, respx_mock: MockRouter + ) -> None: + client = async_client.with_options(max_retries=4) + + nb_retries = 0 + + def retry_handler(_request: httpx.Request) -> httpx.Response: + nonlocal nb_retries + if nb_retries < failures_before_success: + nb_retries += 1 + return httpx.Response(500) + return httpx.Response(200) + + respx_mock.post("/v1/devboxes").mock(side_effect=retry_handler) + + response = await client.devboxes.with_raw_response.create() + + assert response.retries_taken == failures_before_success From 6a834a84ace191d2c2d2860c6f4f8f669f7d2e6a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 19:21:23 +0000 Subject: [PATCH 068/993] chore(internal): test updates (#74) --- src/runloop_api_client/_utils/_reflection.py | 2 +- tests/test_client.py | 7 +++++-- tests/utils.py | 10 +++++++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/runloop_api_client/_utils/_reflection.py b/src/runloop_api_client/_utils/_reflection.py index 9a53c7bd2..89aa712ac 100644 --- a/src/runloop_api_client/_utils/_reflection.py +++ b/src/runloop_api_client/_utils/_reflection.py @@ -34,7 +34,7 @@ def assert_signatures_in_sync( if custom_param.annotation != source_param.annotation: errors.append( - f"types for the `{name}` param are do not match; source={repr(source_param.annotation)} checking={repr(source_param.annotation)}" + f"types for the `{name}` param are do not match; source={repr(source_param.annotation)} checking={repr(custom_param.annotation)}" ) continue diff --git a/tests/test_client.py b/tests/test_client.py index 1a3838e14..ab10be034 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -17,6 +17,7 @@ from pydantic import ValidationError from runloop_api_client import Runloop, AsyncRunloop, APIResponseValidationError +from runloop_api_client._types import Omit from runloop_api_client._models import BaseModel, FinalRequestOptions from runloop_api_client._constants import RAW_RESPONSE_HEADER from runloop_api_client._exceptions import RunloopError, APIStatusError, APITimeoutError, APIResponseValidationError @@ -340,7 +341,8 @@ def test_validate_headers(self) -> None: assert request.headers.get("Authorization") == f"Bearer {bearer_token}" with pytest.raises(RunloopError): - client2 = Runloop(base_url=base_url, bearer_token=None, _strict_response_validation=True) + with update_env(**{"RUNLOOP_API_KEY": Omit()}): + client2 = Runloop(base_url=base_url, bearer_token=None, _strict_response_validation=True) _ = client2 def test_default_query_option(self) -> None: @@ -1072,7 +1074,8 @@ def test_validate_headers(self) -> None: assert request.headers.get("Authorization") == f"Bearer {bearer_token}" with pytest.raises(RunloopError): - client2 = AsyncRunloop(base_url=base_url, bearer_token=None, _strict_response_validation=True) + with update_env(**{"RUNLOOP_API_KEY": Omit()}): + client2 = AsyncRunloop(base_url=base_url, bearer_token=None, _strict_response_validation=True) _ = client2 def test_default_query_option(self) -> None: diff --git a/tests/utils.py b/tests/utils.py index 13aa5efd5..3e87b5baa 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -8,7 +8,7 @@ from datetime import date, datetime from typing_extensions import Literal, get_args, get_origin, assert_type -from runloop_api_client._types import NoneType +from runloop_api_client._types import Omit, NoneType from runloop_api_client._utils import ( is_dict, is_list, @@ -139,11 +139,15 @@ def _assert_list_type(type_: type[object], value: object) -> None: @contextlib.contextmanager -def update_env(**new_env: str) -> Iterator[None]: +def update_env(**new_env: str | Omit) -> Iterator[None]: old = os.environ.copy() try: - os.environ.update(new_env) + for name, value in new_env.items(): + if isinstance(value, Omit): + os.environ.pop(name, None) + else: + os.environ[name] = value yield None finally: From 2b032db89cec91ac02a14d09be76dbc5ad075694 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 01:12:23 +0000 Subject: [PATCH 069/993] feat(api): OpenAPI spec update via Stainless API (#75) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 04825c60f..246dfcc17 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 21 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-850a16f2d01beda246aa00fbc0edef3df1c3018638f008ef24ef00727093a5cb.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8d8e0503acc9538a16d75214afccccbd96e178b8ca1ec56ceb9316a20b6daba6.yml From 6d3a0ecfec6a9c215cfc2629a04e4c7da5965a93 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:31:04 +0000 Subject: [PATCH 070/993] feat(api): OpenAPI spec update via Stainless API (#76) --- .stats.yml | 2 +- api.md | 8 +- .../resources/devboxes/devboxes.py | 93 +++++++++++++++++++ src/runloop_api_client/types/__init__.py | 2 + .../types/devbox_read_file_contents_params.py | 12 +++ .../devbox_read_file_contents_response.py | 7 ++ tests/api_resources/test_devboxes.py | 92 ++++++++++++++++++ 7 files changed, 214 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/types/devbox_read_file_contents_params.py create mode 100644 src/runloop_api_client/types/devbox_read_file_contents_response.py diff --git a/.stats.yml b/.stats.yml index 246dfcc17..b6cbb7c8f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 21 +configured_endpoints: 22 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8d8e0503acc9538a16d75214afccccbd96e178b8ca1ec56ceb9316a20b6daba6.yml diff --git a/api.md b/api.md index 9b175e4bc..5a5988a8d 100644 --- a/api.md +++ b/api.md @@ -48,7 +48,12 @@ from runloop_api_client.types import CodeMountParameters Types: ```python -from runloop_api_client.types import DevboxExecutionDetailView, DevboxListView, DevboxView +from runloop_api_client.types import ( + DevboxExecutionDetailView, + DevboxListView, + DevboxView, + DevboxReadFileContentsResponse, +) ``` Methods: @@ -58,6 +63,7 @@ Methods: - client.devboxes.list(\*\*params) -> DevboxListView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.read_file(id, \*\*params) -> DevboxExecutionDetailView +- client.devboxes.read_file_contents(id, \*\*params) -> str - client.devboxes.shutdown(id) -> DevboxView - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index db973f65d..f644278b4 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -20,6 +20,7 @@ devbox_read_file_params, devbox_write_file_params, devbox_execute_sync_params, + devbox_read_file_contents_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( @@ -290,6 +291,46 @@ def read_file( cast_to=DevboxExecutionDetailView, ) + def read_file_contents( + self, + id: str, + *, + file_path: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Read file contents from a file on given Devbox. + + Args: + file_path: The path of the file to read. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = {"Accept": "text/plain", **(extra_headers or {})} + return self._post( + f"/v1/devboxes/{id}/read_file_contents", + body=maybe_transform( + {"file_path": file_path}, devbox_read_file_contents_params.DevboxReadFileContentsParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + def shutdown( self, id: str, @@ -619,6 +660,46 @@ async def read_file( cast_to=DevboxExecutionDetailView, ) + async def read_file_contents( + self, + id: str, + *, + file_path: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Read file contents from a file on given Devbox. + + Args: + file_path: The path of the file to read. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = {"Accept": "text/plain", **(extra_headers or {})} + return await self._post( + f"/v1/devboxes/{id}/read_file_contents", + body=await async_maybe_transform( + {"file_path": file_path}, devbox_read_file_contents_params.DevboxReadFileContentsParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + async def shutdown( self, id: str, @@ -719,6 +800,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.read_file = to_raw_response_wrapper( devboxes.read_file, ) + self.read_file_contents = to_raw_response_wrapper( + devboxes.read_file_contents, + ) self.shutdown = to_raw_response_wrapper( devboxes.shutdown, ) @@ -750,6 +834,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.read_file = async_to_raw_response_wrapper( devboxes.read_file, ) + self.read_file_contents = async_to_raw_response_wrapper( + devboxes.read_file_contents, + ) self.shutdown = async_to_raw_response_wrapper( devboxes.shutdown, ) @@ -781,6 +868,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.read_file = to_streamed_response_wrapper( devboxes.read_file, ) + self.read_file_contents = to_streamed_response_wrapper( + devboxes.read_file_contents, + ) self.shutdown = to_streamed_response_wrapper( devboxes.shutdown, ) @@ -812,6 +902,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.read_file = async_to_streamed_response_wrapper( devboxes.read_file, ) + self.read_file_contents = async_to_streamed_response_wrapper( + devboxes.read_file_contents, + ) self.shutdown = async_to_streamed_response_wrapper( devboxes.shutdown, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 6a3168cd1..469d03aa8 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -30,3 +30,5 @@ from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams from .blueprint_build_logs_list_view import BlueprintBuildLogsListView as BlueprintBuildLogsListView +from .devbox_read_file_contents_params import DevboxReadFileContentsParams as DevboxReadFileContentsParams +from .devbox_read_file_contents_response import DevboxReadFileContentsResponse as DevboxReadFileContentsResponse diff --git a/src/runloop_api_client/types/devbox_read_file_contents_params.py b/src/runloop_api_client/types/devbox_read_file_contents_params.py new file mode 100644 index 000000000..9132d834d --- /dev/null +++ b/src/runloop_api_client/types/devbox_read_file_contents_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["DevboxReadFileContentsParams"] + + +class DevboxReadFileContentsParams(TypedDict, total=False): + file_path: str + """The path of the file to read.""" diff --git a/src/runloop_api_client/types/devbox_read_file_contents_response.py b/src/runloop_api_client/types/devbox_read_file_contents_response.py new file mode 100644 index 000000000..712d641c1 --- /dev/null +++ b/src/runloop_api_client/types/devbox_read_file_contents_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DevboxReadFileContentsResponse"] + +DevboxReadFileContentsResponse: TypeAlias = str diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index ae2976653..444dd95a6 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -224,6 +224,52 @@ def test_path_params_read_file(self, client: Runloop) -> None: id="", ) + @parametrize + def test_method_read_file_contents(self, client: Runloop) -> None: + devbox = client.devboxes.read_file_contents( + id="id", + ) + assert_matches_type(str, devbox, path=["response"]) + + @parametrize + def test_method_read_file_contents_with_all_params(self, client: Runloop) -> None: + devbox = client.devboxes.read_file_contents( + id="id", + file_path="file_path", + ) + assert_matches_type(str, devbox, path=["response"]) + + @parametrize + def test_raw_response_read_file_contents(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.read_file_contents( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(str, devbox, path=["response"]) + + @parametrize + def test_streaming_response_read_file_contents(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.read_file_contents( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(str, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_read_file_contents(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.read_file_contents( + id="", + ) + @parametrize def test_method_shutdown(self, client: Runloop) -> None: devbox = client.devboxes.shutdown( @@ -516,6 +562,52 @@ async def test_path_params_read_file(self, async_client: AsyncRunloop) -> None: id="", ) + @parametrize + async def test_method_read_file_contents(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.read_file_contents( + id="id", + ) + assert_matches_type(str, devbox, path=["response"]) + + @parametrize + async def test_method_read_file_contents_with_all_params(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.read_file_contents( + id="id", + file_path="file_path", + ) + assert_matches_type(str, devbox, path=["response"]) + + @parametrize + async def test_raw_response_read_file_contents(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.read_file_contents( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(str, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_read_file_contents(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.read_file_contents( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(str, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_read_file_contents(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.read_file_contents( + id="", + ) + @parametrize async def test_method_shutdown(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.shutdown( From 09626eeaf96cf7b35f344d91313da0b62fadb6e8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:31:25 +0000 Subject: [PATCH 071/993] chore(internal): bump ruff version (#77) --- pyproject.toml | 12 +++-- requirements-dev.lock | 2 +- src/runloop_api_client/_base_client.py | 63 +++++++++---------------- src/runloop_api_client/_compat.py | 24 ++++------ src/runloop_api_client/_files.py | 12 ++--- src/runloop_api_client/_response.py | 12 ++--- src/runloop_api_client/_types.py | 9 ++-- src/runloop_api_client/_utils/_proxy.py | 3 +- src/runloop_api_client/_utils/_utils.py | 18 +++---- tests/test_deepcopy.py | 3 +- tests/test_response.py | 12 ++--- tests/test_utils/test_typing.py | 15 ++---- 12 files changed, 65 insertions(+), 120 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6638ef28d..f90d70b62 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,8 +77,8 @@ format = { chain = [ "check:ruff", "typecheck", ]} -"check:ruff" = "ruff ." -"fix:ruff" = "ruff --fix ." +"check:ruff" = "ruff check ." +"fix:ruff" = "ruff check --fix ." typecheck = { chain = [ "typecheck:pyright", @@ -162,6 +162,11 @@ reportPrivateUsage = false line-length = 120 output-format = "grouped" target-version = "py37" + +[tool.ruff.format] +docstring-code-format = true + +[tool.ruff.lint] select = [ # isort "I", @@ -192,9 +197,6 @@ unfixable = [ ] ignore-init-module-imports = true -[tool.ruff.format] -docstring-code-format = true - [tool.ruff.lint.flake8-tidy-imports.banned-api] "functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead" diff --git a/requirements-dev.lock b/requirements-dev.lock index 8b87bde54..1a8bffd1f 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -80,7 +80,7 @@ pytz==2023.3.post1 # via dirty-equals respx==0.20.2 rich==13.7.1 -ruff==0.1.9 +ruff==0.5.6 setuptools==68.2.2 # via nodeenv six==1.16.0 diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index e1d9f984c..06455d98b 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -124,16 +124,14 @@ def __init__( self, *, url: URL, - ) -> None: - ... + ) -> None: ... @overload def __init__( self, *, params: Query, - ) -> None: - ... + ) -> None: ... def __init__( self, @@ -166,8 +164,7 @@ def has_next_page(self) -> bool: return False return self.next_page_info() is not None - def next_page_info(self) -> Optional[PageInfo]: - ... + def next_page_info(self) -> Optional[PageInfo]: ... def _get_page_items(self) -> Iterable[_T]: # type: ignore[empty-body] ... @@ -903,8 +900,7 @@ def request( *, stream: Literal[True], stream_cls: Type[_StreamT], - ) -> _StreamT: - ... + ) -> _StreamT: ... @overload def request( @@ -914,8 +910,7 @@ def request( remaining_retries: Optional[int] = None, *, stream: Literal[False] = False, - ) -> ResponseT: - ... + ) -> ResponseT: ... @overload def request( @@ -926,8 +921,7 @@ def request( *, stream: bool = False, stream_cls: Type[_StreamT] | None = None, - ) -> ResponseT | _StreamT: - ... + ) -> ResponseT | _StreamT: ... def request( self, @@ -1156,8 +1150,7 @@ def get( cast_to: Type[ResponseT], options: RequestOptions = {}, stream: Literal[False] = False, - ) -> ResponseT: - ... + ) -> ResponseT: ... @overload def get( @@ -1168,8 +1161,7 @@ def get( options: RequestOptions = {}, stream: Literal[True], stream_cls: type[_StreamT], - ) -> _StreamT: - ... + ) -> _StreamT: ... @overload def get( @@ -1180,8 +1172,7 @@ def get( options: RequestOptions = {}, stream: bool, stream_cls: type[_StreamT] | None = None, - ) -> ResponseT | _StreamT: - ... + ) -> ResponseT | _StreamT: ... def get( self, @@ -1207,8 +1198,7 @@ def post( options: RequestOptions = {}, files: RequestFiles | None = None, stream: Literal[False] = False, - ) -> ResponseT: - ... + ) -> ResponseT: ... @overload def post( @@ -1221,8 +1211,7 @@ def post( files: RequestFiles | None = None, stream: Literal[True], stream_cls: type[_StreamT], - ) -> _StreamT: - ... + ) -> _StreamT: ... @overload def post( @@ -1235,8 +1224,7 @@ def post( files: RequestFiles | None = None, stream: bool, stream_cls: type[_StreamT] | None = None, - ) -> ResponseT | _StreamT: - ... + ) -> ResponseT | _StreamT: ... def post( self, @@ -1469,8 +1457,7 @@ async def request( *, stream: Literal[False] = False, remaining_retries: Optional[int] = None, - ) -> ResponseT: - ... + ) -> ResponseT: ... @overload async def request( @@ -1481,8 +1468,7 @@ async def request( stream: Literal[True], stream_cls: type[_AsyncStreamT], remaining_retries: Optional[int] = None, - ) -> _AsyncStreamT: - ... + ) -> _AsyncStreamT: ... @overload async def request( @@ -1493,8 +1479,7 @@ async def request( stream: bool, stream_cls: type[_AsyncStreamT] | None = None, remaining_retries: Optional[int] = None, - ) -> ResponseT | _AsyncStreamT: - ... + ) -> ResponseT | _AsyncStreamT: ... async def request( self, @@ -1709,8 +1694,7 @@ async def get( cast_to: Type[ResponseT], options: RequestOptions = {}, stream: Literal[False] = False, - ) -> ResponseT: - ... + ) -> ResponseT: ... @overload async def get( @@ -1721,8 +1705,7 @@ async def get( options: RequestOptions = {}, stream: Literal[True], stream_cls: type[_AsyncStreamT], - ) -> _AsyncStreamT: - ... + ) -> _AsyncStreamT: ... @overload async def get( @@ -1733,8 +1716,7 @@ async def get( options: RequestOptions = {}, stream: bool, stream_cls: type[_AsyncStreamT] | None = None, - ) -> ResponseT | _AsyncStreamT: - ... + ) -> ResponseT | _AsyncStreamT: ... async def get( self, @@ -1758,8 +1740,7 @@ async def post( files: RequestFiles | None = None, options: RequestOptions = {}, stream: Literal[False] = False, - ) -> ResponseT: - ... + ) -> ResponseT: ... @overload async def post( @@ -1772,8 +1753,7 @@ async def post( options: RequestOptions = {}, stream: Literal[True], stream_cls: type[_AsyncStreamT], - ) -> _AsyncStreamT: - ... + ) -> _AsyncStreamT: ... @overload async def post( @@ -1786,8 +1766,7 @@ async def post( options: RequestOptions = {}, stream: bool, stream_cls: type[_AsyncStreamT] | None = None, - ) -> ResponseT | _AsyncStreamT: - ... + ) -> ResponseT | _AsyncStreamT: ... async def post( self, diff --git a/src/runloop_api_client/_compat.py b/src/runloop_api_client/_compat.py index c919b5adb..7c6f91a87 100644 --- a/src/runloop_api_client/_compat.py +++ b/src/runloop_api_client/_compat.py @@ -159,22 +159,19 @@ def model_parse(model: type[_ModelT], data: Any) -> _ModelT: # generic models if TYPE_CHECKING: - class GenericModel(pydantic.BaseModel): - ... + class GenericModel(pydantic.BaseModel): ... else: if PYDANTIC_V2: # there no longer needs to be a distinction in v2 but # we still have to create our own subclass to avoid # inconsistent MRO ordering errors - class GenericModel(pydantic.BaseModel): - ... + class GenericModel(pydantic.BaseModel): ... else: import pydantic.generics - class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel): - ... + class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel): ... # cached properties @@ -193,26 +190,21 @@ class typed_cached_property(Generic[_T]): func: Callable[[Any], _T] attrname: str | None - def __init__(self, func: Callable[[Any], _T]) -> None: - ... + def __init__(self, func: Callable[[Any], _T]) -> None: ... @overload - def __get__(self, instance: None, owner: type[Any] | None = None) -> Self: - ... + def __get__(self, instance: None, owner: type[Any] | None = None) -> Self: ... @overload - def __get__(self, instance: object, owner: type[Any] | None = None) -> _T: - ... + def __get__(self, instance: object, owner: type[Any] | None = None) -> _T: ... def __get__(self, instance: object, owner: type[Any] | None = None) -> _T | Self: raise NotImplementedError() - def __set_name__(self, owner: type[Any], name: str) -> None: - ... + def __set_name__(self, owner: type[Any], name: str) -> None: ... # __set__ is not defined at runtime, but @cached_property is designed to be settable - def __set__(self, instance: object, value: _T) -> None: - ... + def __set__(self, instance: object, value: _T) -> None: ... else: try: from functools import cached_property as cached_property diff --git a/src/runloop_api_client/_files.py b/src/runloop_api_client/_files.py index 0d2022ae7..715cc2078 100644 --- a/src/runloop_api_client/_files.py +++ b/src/runloop_api_client/_files.py @@ -39,13 +39,11 @@ def assert_is_file_content(obj: object, *, key: str | None = None) -> None: @overload -def to_httpx_files(files: None) -> None: - ... +def to_httpx_files(files: None) -> None: ... @overload -def to_httpx_files(files: RequestFiles) -> HttpxRequestFiles: - ... +def to_httpx_files(files: RequestFiles) -> HttpxRequestFiles: ... def to_httpx_files(files: RequestFiles | None) -> HttpxRequestFiles | None: @@ -83,13 +81,11 @@ def _read_file_content(file: FileContent) -> HttpxFileContent: @overload -async def async_to_httpx_files(files: None) -> None: - ... +async def async_to_httpx_files(files: None) -> None: ... @overload -async def async_to_httpx_files(files: RequestFiles) -> HttpxRequestFiles: - ... +async def async_to_httpx_files(files: RequestFiles) -> HttpxRequestFiles: ... async def async_to_httpx_files(files: RequestFiles | None) -> HttpxRequestFiles | None: diff --git a/src/runloop_api_client/_response.py b/src/runloop_api_client/_response.py index 6cba530a2..d891cc0b0 100644 --- a/src/runloop_api_client/_response.py +++ b/src/runloop_api_client/_response.py @@ -262,12 +262,10 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: class APIResponse(BaseAPIResponse[R]): @overload - def parse(self, *, to: type[_T]) -> _T: - ... + def parse(self, *, to: type[_T]) -> _T: ... @overload - def parse(self) -> R: - ... + def parse(self) -> R: ... def parse(self, *, to: type[_T] | None = None) -> R | _T: """Returns the rich python representation of this response's data. @@ -366,12 +364,10 @@ def iter_lines(self) -> Iterator[str]: class AsyncAPIResponse(BaseAPIResponse[R]): @overload - async def parse(self, *, to: type[_T]) -> _T: - ... + async def parse(self, *, to: type[_T]) -> _T: ... @overload - async def parse(self) -> R: - ... + async def parse(self) -> R: ... async def parse(self, *, to: type[_T] | None = None) -> R | _T: """Returns the rich python representation of this response's data. diff --git a/src/runloop_api_client/_types.py b/src/runloop_api_client/_types.py index 13f21d53e..d066b1aa0 100644 --- a/src/runloop_api_client/_types.py +++ b/src/runloop_api_client/_types.py @@ -111,8 +111,7 @@ class NotGiven: For example: ```py - def get(timeout: Union[int, NotGiven, None] = NotGiven()) -> Response: - ... + def get(timeout: Union[int, NotGiven, None] = NotGiven()) -> Response: ... get(timeout=1) # 1s timeout @@ -162,16 +161,14 @@ def build( *, response: Response, data: object, - ) -> _T: - ... + ) -> _T: ... Headers = Mapping[str, Union[str, Omit]] class HeadersLikeProtocol(Protocol): - def get(self, __key: str) -> str | None: - ... + def get(self, __key: str) -> str | None: ... HeadersLike = Union[Headers, HeadersLikeProtocol] diff --git a/src/runloop_api_client/_utils/_proxy.py b/src/runloop_api_client/_utils/_proxy.py index c46a62a69..ffd883e9d 100644 --- a/src/runloop_api_client/_utils/_proxy.py +++ b/src/runloop_api_client/_utils/_proxy.py @@ -59,5 +59,4 @@ def __as_proxied__(self) -> T: return cast(T, self) @abstractmethod - def __load__(self) -> T: - ... + def __load__(self) -> T: ... diff --git a/src/runloop_api_client/_utils/_utils.py b/src/runloop_api_client/_utils/_utils.py index 34797c290..2fc5a1c65 100644 --- a/src/runloop_api_client/_utils/_utils.py +++ b/src/runloop_api_client/_utils/_utils.py @@ -211,20 +211,17 @@ def required_args(*variants: Sequence[str]) -> Callable[[CallableT], CallableT]: Example usage: ```py @overload - def foo(*, a: str) -> str: - ... + def foo(*, a: str) -> str: ... @overload - def foo(*, b: bool) -> str: - ... + def foo(*, b: bool) -> str: ... # This enforces the same constraints that a static type checker would # i.e. that either a or b must be passed to the function @required_args(["a"], ["b"]) - def foo(*, a: str | None = None, b: bool | None = None) -> str: - ... + def foo(*, a: str | None = None, b: bool | None = None) -> str: ... ``` """ @@ -286,18 +283,15 @@ def wrapper(*args: object, **kwargs: object) -> object: @overload -def strip_not_given(obj: None) -> None: - ... +def strip_not_given(obj: None) -> None: ... @overload -def strip_not_given(obj: Mapping[_K, _V | NotGiven]) -> dict[_K, _V]: - ... +def strip_not_given(obj: Mapping[_K, _V | NotGiven]) -> dict[_K, _V]: ... @overload -def strip_not_given(obj: object) -> object: - ... +def strip_not_given(obj: object) -> object: ... def strip_not_given(obj: object | None) -> object: diff --git a/tests/test_deepcopy.py b/tests/test_deepcopy.py index adf478aae..89eb51864 100644 --- a/tests/test_deepcopy.py +++ b/tests/test_deepcopy.py @@ -41,8 +41,7 @@ def test_nested_list() -> None: assert_different_identities(obj1[1], obj2[1]) -class MyObject: - ... +class MyObject: ... def test_ignores_other_types() -> None: diff --git a/tests/test_response.py b/tests/test_response.py index 27811cfa2..d24372998 100644 --- a/tests/test_response.py +++ b/tests/test_response.py @@ -19,16 +19,13 @@ from runloop_api_client._base_client import FinalRequestOptions -class ConcreteBaseAPIResponse(APIResponse[bytes]): - ... +class ConcreteBaseAPIResponse(APIResponse[bytes]): ... -class ConcreteAPIResponse(APIResponse[List[str]]): - ... +class ConcreteAPIResponse(APIResponse[List[str]]): ... -class ConcreteAsyncAPIResponse(APIResponse[httpx.Response]): - ... +class ConcreteAsyncAPIResponse(APIResponse[httpx.Response]): ... def test_extract_response_type_direct_classes() -> None: @@ -56,8 +53,7 @@ def test_extract_response_type_binary_response() -> None: assert extract_response_type(AsyncBinaryAPIResponse) == bytes -class PydanticModel(pydantic.BaseModel): - ... +class PydanticModel(pydantic.BaseModel): ... def test_response_parse_mismatched_basemodel(client: Runloop) -> None: diff --git a/tests/test_utils/test_typing.py b/tests/test_utils/test_typing.py index cdf50acf1..1b58221e7 100644 --- a/tests/test_utils/test_typing.py +++ b/tests/test_utils/test_typing.py @@ -9,24 +9,19 @@ _T3 = TypeVar("_T3") -class BaseGeneric(Generic[_T]): - ... +class BaseGeneric(Generic[_T]): ... -class SubclassGeneric(BaseGeneric[_T]): - ... +class SubclassGeneric(BaseGeneric[_T]): ... -class BaseGenericMultipleTypeArgs(Generic[_T, _T2, _T3]): - ... +class BaseGenericMultipleTypeArgs(Generic[_T, _T2, _T3]): ... -class SubclassGenericMultipleTypeArgs(BaseGenericMultipleTypeArgs[_T, _T2, _T3]): - ... +class SubclassGenericMultipleTypeArgs(BaseGenericMultipleTypeArgs[_T, _T2, _T3]): ... -class SubclassDifferentOrderGenericMultipleTypeArgs(BaseGenericMultipleTypeArgs[_T2, _T, _T3]): - ... +class SubclassDifferentOrderGenericMultipleTypeArgs(BaseGenericMultipleTypeArgs[_T2, _T, _T3]): ... def test_extract_type_var() -> None: From fc512d31e662be14be83941b9046f9f54280e378 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:32:16 +0000 Subject: [PATCH 072/993] chore(internal): update pydantic compat helper function (#78) --- src/runloop_api_client/_compat.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/runloop_api_client/_compat.py b/src/runloop_api_client/_compat.py index 7c6f91a87..21fe6941c 100644 --- a/src/runloop_api_client/_compat.py +++ b/src/runloop_api_client/_compat.py @@ -7,7 +7,7 @@ import pydantic from pydantic.fields import FieldInfo -from ._types import StrBytesIntFloat +from ._types import IncEx, StrBytesIntFloat _T = TypeVar("_T") _ModelT = TypeVar("_ModelT", bound=pydantic.BaseModel) @@ -133,17 +133,20 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str: def model_dump( model: pydantic.BaseModel, *, + exclude: IncEx = None, exclude_unset: bool = False, exclude_defaults: bool = False, ) -> dict[str, Any]: if PYDANTIC_V2: return model.model_dump( + exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, ) return cast( "dict[str, Any]", model.dict( # pyright: ignore[reportDeprecated, reportUnnecessaryCast] + exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, ), From fd8bf53732170a1621fcfb8ad40167b71fa16b4e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 7 Aug 2024 22:04:45 +0000 Subject: [PATCH 073/993] feat(api): OpenAPI spec update via Stainless API (#79) --- .stats.yml | 2 +- .../resources/devboxes/devboxes.py | 16 ++++++------- .../types/blueprint_build_parameters.py | 6 +++++ .../types/blueprint_create_params.py | 6 +++++ .../types/blueprint_preview_params.py | 6 +++++ .../types/devbox_create_params.py | 24 +++++++++++++++---- src/runloop_api_client/types/resource_size.py | 2 +- tests/api_resources/test_blueprints.py | 4 ++++ tests/api_resources/test_devboxes.py | 12 ++++++++-- 9 files changed, 62 insertions(+), 16 deletions(-) diff --git a/.stats.yml b/.stats.yml index b6cbb7c8f..009870008 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8d8e0503acc9538a16d75214afccccbd96e178b8ca1ec56ceb9316a20b6daba6.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6d8fa9e3b0fd4b024c72d3bda8162e15c33295b9e98feabcc0289ecda9cf1db2.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index f644278b4..198110b5b 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -61,10 +61,10 @@ def create( *, blueprint_id: str | NotGiven = NOT_GIVEN, blueprint_name: str | NotGiven = NOT_GIVEN, - code_handle: str | NotGiven = NOT_GIVEN, entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, + launch_parameters: devbox_create_params.LaunchParameters | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -86,8 +86,6 @@ def create( blueprint_name: (Optional) Name of Blueprint to use for the Devbox. When set, this will load the latest successfully built Blueprint with the given name. - code_handle: (Optional) Id of a code handle to mount to devbox. - entrypoint: (Optional) When specified, the Devbox will run this script as its main executable. The devbox lifecycle will be bound to entrypoint, shutting down when the process is complete. @@ -96,6 +94,8 @@ def create( file_mounts: (Optional) Map of paths and file contents to write before setup.. + launch_parameters: Parameters to configure the resources and launch time behavior of the Devbox. + name: (Optional) A user specified name to give the Devbox. setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include @@ -116,10 +116,10 @@ def create( { "blueprint_id": blueprint_id, "blueprint_name": blueprint_name, - "code_handle": code_handle, "entrypoint": entrypoint, "environment_variables": environment_variables, "file_mounts": file_mounts, + "launch_parameters": launch_parameters, "name": name, "setup_commands": setup_commands, }, @@ -430,10 +430,10 @@ async def create( *, blueprint_id: str | NotGiven = NOT_GIVEN, blueprint_name: str | NotGiven = NOT_GIVEN, - code_handle: str | NotGiven = NOT_GIVEN, entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, + launch_parameters: devbox_create_params.LaunchParameters | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -455,8 +455,6 @@ async def create( blueprint_name: (Optional) Name of Blueprint to use for the Devbox. When set, this will load the latest successfully built Blueprint with the given name. - code_handle: (Optional) Id of a code handle to mount to devbox. - entrypoint: (Optional) When specified, the Devbox will run this script as its main executable. The devbox lifecycle will be bound to entrypoint, shutting down when the process is complete. @@ -465,6 +463,8 @@ async def create( file_mounts: (Optional) Map of paths and file contents to write before setup.. + launch_parameters: Parameters to configure the resources and launch time behavior of the Devbox. + name: (Optional) A user specified name to give the Devbox. setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include @@ -485,10 +485,10 @@ async def create( { "blueprint_id": blueprint_id, "blueprint_name": blueprint_name, - "code_handle": code_handle, "entrypoint": entrypoint, "environment_variables": environment_variables, "file_mounts": file_mounts, + "launch_parameters": launch_parameters, "name": name, "setup_commands": setup_commands, }, diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index f052d5810..885ca389e 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -10,6 +10,12 @@ class LaunchParameters(BaseModel): + keep_alive_time_seconds: Optional[int] = None + """Time in seconds after which Devbox will automatically shutdown. + + Default is 1 hour. + """ + launch_commands: Optional[List[str]] = None """Set of commands to be run at launch time, before the entrypoint process is run.""" diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index 5d797dd66..7a01d266b 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -32,6 +32,12 @@ class BlueprintCreateParams(TypedDict, total=False): class LaunchParameters(TypedDict, total=False): + keep_alive_time_seconds: int + """Time in seconds after which Devbox will automatically shutdown. + + Default is 1 hour. + """ + launch_commands: List[str] """Set of commands to be run at launch time, before the entrypoint process is run.""" diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index 1fd80859f..3b16ba655 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -32,6 +32,12 @@ class BlueprintPreviewParams(TypedDict, total=False): class LaunchParameters(TypedDict, total=False): + keep_alive_time_seconds: int + """Time in seconds after which Devbox will automatically shutdown. + + Default is 1 hour. + """ + launch_commands: List[str] """Set of commands to be run at launch time, before the entrypoint process is run.""" diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 118acd388..80cd31ef3 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -5,7 +5,9 @@ from typing import Dict, List from typing_extensions import TypedDict -__all__ = ["DevboxCreateParams"] +from .resource_size import ResourceSize + +__all__ = ["DevboxCreateParams", "LaunchParameters"] class DevboxCreateParams(TypedDict, total=False): @@ -22,9 +24,6 @@ class DevboxCreateParams(TypedDict, total=False): name. """ - code_handle: str - """(Optional) Id of a code handle to mount to devbox.""" - entrypoint: str """ (Optional) When specified, the Devbox will run this script as its main @@ -38,6 +37,9 @@ class DevboxCreateParams(TypedDict, total=False): file_mounts: Dict[str, str] """(Optional) Map of paths and file contents to write before setup..""" + launch_parameters: LaunchParameters + """Parameters to configure the resources and launch time behavior of the Devbox.""" + name: str """(Optional) A user specified name to give the Devbox.""" @@ -47,3 +49,17 @@ class DevboxCreateParams(TypedDict, total=False): Examples might include fetching a tool or building your dependencies. Runloop will look optimize these steps for you. """ + + +class LaunchParameters(TypedDict, total=False): + keep_alive_time_seconds: int + """Time in seconds after which Devbox will automatically shutdown. + + Default is 1 hour. + """ + + launch_commands: List[str] + """Set of commands to be run at launch time, before the entrypoint process is run.""" + + resource_size_request: ResourceSize + """Manual resource configuration for Devbox. If not set, defaults will be used.""" diff --git a/src/runloop_api_client/types/resource_size.py b/src/runloop_api_client/types/resource_size.py index 528198ab4..3ae6370c1 100644 --- a/src/runloop_api_client/types/resource_size.py +++ b/src/runloop_api_client/types/resource_size.py @@ -4,4 +4,4 @@ __all__ = ["ResourceSize"] -ResourceSize: TypeAlias = Literal["MINI", "SMALL", "MEDIUM", "LARGE"] +ResourceSize: TypeAlias = Literal["MINI", "SMALL", "MEDIUM", "LARGE", "X_LARGE"] diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 0228af67d..ba58be1fa 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -55,6 +55,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: launch_parameters={ "launch_commands": ["string", "string", "string"], "resource_size_request": "MINI", + "keep_alive_time_seconds": 0, }, name="name", system_setup_commands=["string", "string", "string"], @@ -224,6 +225,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: launch_parameters={ "launch_commands": ["string", "string", "string"], "resource_size_request": "MINI", + "keep_alive_time_seconds": 0, }, name="name", system_setup_commands=["string", "string", "string"], @@ -287,6 +289,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - launch_parameters={ "launch_commands": ["string", "string", "string"], "resource_size_request": "MINI", + "keep_alive_time_seconds": 0, }, name="name", system_setup_commands=["string", "string", "string"], @@ -456,6 +459,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) launch_parameters={ "launch_commands": ["string", "string", "string"], "resource_size_request": "MINI", + "keep_alive_time_seconds": 0, }, name="name", system_setup_commands=["string", "string", "string"], diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 444dd95a6..3847a4d1a 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -31,10 +31,14 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.create( blueprint_id="blueprint_id", blueprint_name="blueprint_name", - code_handle="code_handle", entrypoint="entrypoint", environment_variables={"foo": "string"}, file_mounts={"foo": "string"}, + launch_parameters={ + "launch_commands": ["string", "string", "string"], + "resource_size_request": "MINI", + "keep_alive_time_seconds": 0, + }, name="name", setup_commands=["string", "string", "string"], ) @@ -369,10 +373,14 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - devbox = await async_client.devboxes.create( blueprint_id="blueprint_id", blueprint_name="blueprint_name", - code_handle="code_handle", entrypoint="entrypoint", environment_variables={"foo": "string"}, file_mounts={"foo": "string"}, + launch_parameters={ + "launch_commands": ["string", "string", "string"], + "resource_size_request": "MINI", + "keep_alive_time_seconds": 0, + }, name="name", setup_commands=["string", "string", "string"], ) From f5b4664fbd8de3150e02b4691c2c7a657ef665ea Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 7 Aug 2024 22:11:49 +0000 Subject: [PATCH 074/993] chore(internal): version bump (#80) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3b005e525..ee49ac2dc 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.10" + ".": "0.1.0-alpha.11" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index f90d70b62..6731de050 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.1.0-alpha.10" +version = "0.1.0-alpha.11" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 1b00567fb..d98387ec7 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.1.0-alpha.10" # x-release-please-version +__version__ = "0.1.0-alpha.11" # x-release-please-version From c282b033176dc7af1b2608a537a5653a9b83b8dc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2024 16:00:10 +0000 Subject: [PATCH 075/993] chore(internal): remove deprecated ruff config (#81) --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6731de050..266279c6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -195,7 +195,6 @@ unfixable = [ "T201", "T203", ] -ignore-init-module-imports = true [tool.ruff.lint.flake8-tidy-imports.banned-api] "functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead" @@ -207,7 +206,7 @@ combine-as-imports = true extra-standard-library = ["typing_extensions"] known-first-party = ["runloop_api_client", "tests"] -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "bin/**.py" = ["T201", "T203"] "scripts/**.py" = ["T201", "T203"] "tests/**.py" = ["T201", "T203"] From 2b4feee71e1bb066e461d45b0c98130c39fa9254 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 13 Aug 2024 22:12:21 +0000 Subject: [PATCH 076/993] feat(api): OpenAPI spec update via Stainless API (#83) --- README.md | 2 +- src/runloop_api_client/_constants.py | 6 ++-- tests/test_client.py | 52 ++++++++++++++-------------- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 8dc4c7e51..c30cc313a 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ Error codes are as followed: ### Retries -Certain errors are automatically retried 2 times by default, with a short exponential backoff. +Certain errors are automatically retried 0 times by default, with a short exponential backoff. Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors are all retried by default. diff --git a/src/runloop_api_client/_constants.py b/src/runloop_api_client/_constants.py index a2ac3b6f3..8e36fea12 100644 --- a/src/runloop_api_client/_constants.py +++ b/src/runloop_api_client/_constants.py @@ -7,8 +7,8 @@ # default timeout is 1 minute DEFAULT_TIMEOUT = httpx.Timeout(timeout=60.0, connect=5.0) -DEFAULT_MAX_RETRIES = 2 +DEFAULT_MAX_RETRIES = 0 DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20) -INITIAL_RETRY_DELAY = 0.5 -MAX_RETRY_DELAY = 8.0 +INITIAL_RETRY_DELAY = 1.0 +MAX_RETRY_DELAY = 5.0 diff --git a/tests/test_client.py b/tests/test_client.py index ab10be034..a9738496a 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -87,7 +87,7 @@ def test_copy_default_options(self) -> None: # options that have a default are overridden correctly copied = self.client.copy(max_retries=7) assert copied.max_retries == 7 - assert self.client.max_retries == 2 + assert self.client.max_retries == 0 copied2 = copied.copy(max_retries=6) assert copied2.max_retries == 6 @@ -706,20 +706,20 @@ class Model(BaseModel): "remaining_retries,retry_after,timeout", [ [3, "20", 20], - [3, "0", 0.5], - [3, "-10", 0.5], + [3, "0", 1], + [3, "-10", 1], [3, "60", 60], - [3, "61", 0.5], + [3, "61", 1], [3, "Fri, 29 Sep 2023 16:26:57 GMT", 20], - [3, "Fri, 29 Sep 2023 16:26:37 GMT", 0.5], - [3, "Fri, 29 Sep 2023 16:26:27 GMT", 0.5], + [3, "Fri, 29 Sep 2023 16:26:37 GMT", 1], + [3, "Fri, 29 Sep 2023 16:26:27 GMT", 1], [3, "Fri, 29 Sep 2023 16:27:37 GMT", 60], - [3, "Fri, 29 Sep 2023 16:27:38 GMT", 0.5], - [3, "99999999999999999999999999999999999", 0.5], - [3, "Zun, 29 Sep 2023 16:26:27 GMT", 0.5], - [3, "", 0.5], - [2, "", 0.5 * 2.0], - [1, "", 0.5 * 4.0], + [3, "Fri, 29 Sep 2023 16:27:38 GMT", 1], + [3, "99999999999999999999999999999999999", 1], + [3, "Zun, 29 Sep 2023 16:26:27 GMT", 1], + [3, "", 1], + [2, "", 1 * 2.0], + [1, "", 1 * 4.0], ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) @@ -729,7 +729,7 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) calculated = client._calculate_retry_timeout(remaining_retries, options, headers) - assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] + assert calculated == pytest.approx(timeout, 1 * 0.875) # pyright: ignore[reportUnknownMemberType] @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) @@ -820,7 +820,7 @@ def test_copy_default_options(self) -> None: # options that have a default are overridden correctly copied = self.client.copy(max_retries=7) assert copied.max_retries == 7 - assert self.client.max_retries == 2 + assert self.client.max_retries == 0 copied2 = copied.copy(max_retries=6) assert copied2.max_retries == 6 @@ -1442,20 +1442,20 @@ class Model(BaseModel): "remaining_retries,retry_after,timeout", [ [3, "20", 20], - [3, "0", 0.5], - [3, "-10", 0.5], + [3, "0", 1], + [3, "-10", 1], [3, "60", 60], - [3, "61", 0.5], + [3, "61", 1], [3, "Fri, 29 Sep 2023 16:26:57 GMT", 20], - [3, "Fri, 29 Sep 2023 16:26:37 GMT", 0.5], - [3, "Fri, 29 Sep 2023 16:26:27 GMT", 0.5], + [3, "Fri, 29 Sep 2023 16:26:37 GMT", 1], + [3, "Fri, 29 Sep 2023 16:26:27 GMT", 1], [3, "Fri, 29 Sep 2023 16:27:37 GMT", 60], - [3, "Fri, 29 Sep 2023 16:27:38 GMT", 0.5], - [3, "99999999999999999999999999999999999", 0.5], - [3, "Zun, 29 Sep 2023 16:26:27 GMT", 0.5], - [3, "", 0.5], - [2, "", 0.5 * 2.0], - [1, "", 0.5 * 4.0], + [3, "Fri, 29 Sep 2023 16:27:38 GMT", 1], + [3, "99999999999999999999999999999999999", 1], + [3, "Zun, 29 Sep 2023 16:26:27 GMT", 1], + [3, "", 1], + [2, "", 1 * 2.0], + [1, "", 1 * 4.0], ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) @@ -1466,7 +1466,7 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) calculated = client._calculate_retry_timeout(remaining_retries, options, headers) - assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] + assert calculated == pytest.approx(timeout, 1 * 0.875) # pyright: ignore[reportUnknownMemberType] @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) From 85c9312aa34a4b68c3162587a7dc510528a26946 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 13 Aug 2024 22:13:09 +0000 Subject: [PATCH 077/993] chore(ci): minor changes (#84) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 009870008..d38ffc5b6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6d8fa9e3b0fd4b024c72d3bda8162e15c33295b9e98feabcc0289ecda9cf1db2.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-fc7e88fcbc5d6d4cdc0247bbef1bebb8de2bf610059f17ac727f9f282ba2db6e.yml From 221b70047bd42e9f907c20017db9e8b3f01b8db0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 13 Aug 2024 22:13:49 +0000 Subject: [PATCH 078/993] chore(ci): bump prism mock server version (#85) --- scripts/mock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mock b/scripts/mock index f58615769..d2814ae6a 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.8.4 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log & # Wait for server to come online echo -n "Waiting for server" @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stainless-api/prism-cli@5.8.4 -- prism mock "$URL" + npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" fi From 7e3bce2b2d22170165254d719e6732f4cfa6c738 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 13 Aug 2024 22:14:22 +0000 Subject: [PATCH 079/993] chore(internal): ensure package is importable in lint cmd (#86) --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 266279c6c..4b43f24bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,10 +76,13 @@ format = { chain = [ "lint" = { chain = [ "check:ruff", "typecheck", + "check:importable", ]} "check:ruff" = "ruff check ." "fix:ruff" = "ruff check --fix ." +"check:importable" = "python -c 'import runloop_api_client'" + typecheck = { chain = [ "typecheck:pyright", "typecheck:mypy" From 57219dbb29c5780c3354582656c3793504de1e70 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 13 Aug 2024 22:16:53 +0000 Subject: [PATCH 080/993] chore(examples): minor formatting changes (#87) --- tests/api_resources/test_blueprints.py | 56 +++++++++++++------------- tests/api_resources/test_devboxes.py | 4 +- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index ba58be1fa..84ccb1d9c 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -32,30 +32,30 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: blueprint = client.blueprints.create( code_mounts=[ { + "token": "token", + "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - "install_command": "install_command", - "token": "token", }, { + "token": "token", + "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - "install_command": "install_command", - "token": "token", }, { + "token": "token", + "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - "install_command": "install_command", - "token": "token", }, ], dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ + "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "MINI", - "keep_alive_time_seconds": 0, }, name="name", system_setup_commands=["string", "string", "string"], @@ -202,30 +202,30 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: blueprint = client.blueprints.preview( code_mounts=[ { + "token": "token", + "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - "install_command": "install_command", - "token": "token", }, { + "token": "token", + "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - "install_command": "install_command", - "token": "token", }, { + "token": "token", + "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - "install_command": "install_command", - "token": "token", }, ], dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ + "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "MINI", - "keep_alive_time_seconds": 0, }, name="name", system_setup_commands=["string", "string", "string"], @@ -266,30 +266,30 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - blueprint = await async_client.blueprints.create( code_mounts=[ { + "token": "token", + "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - "install_command": "install_command", - "token": "token", }, { + "token": "token", + "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - "install_command": "install_command", - "token": "token", }, { + "token": "token", + "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - "install_command": "install_command", - "token": "token", }, ], dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ + "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "MINI", - "keep_alive_time_seconds": 0, }, name="name", system_setup_commands=["string", "string", "string"], @@ -436,30 +436,30 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) blueprint = await async_client.blueprints.preview( code_mounts=[ { + "token": "token", + "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - "install_command": "install_command", - "token": "token", }, { + "token": "token", + "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - "install_command": "install_command", - "token": "token", }, { + "token": "token", + "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - "install_command": "install_command", - "token": "token", }, ], dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ + "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "MINI", - "keep_alive_time_seconds": 0, }, name="name", system_setup_commands=["string", "string", "string"], diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 3847a4d1a..3f21fbaa5 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -35,9 +35,9 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: environment_variables={"foo": "string"}, file_mounts={"foo": "string"}, launch_parameters={ + "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "MINI", - "keep_alive_time_seconds": 0, }, name="name", setup_commands=["string", "string", "string"], @@ -377,9 +377,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - environment_variables={"foo": "string"}, file_mounts={"foo": "string"}, launch_parameters={ + "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "MINI", - "keep_alive_time_seconds": 0, }, name="name", setup_commands=["string", "string", "string"], From 5e3cf4cb39c992784cc54faecbbd0d16c9004340 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 13 Aug 2024 22:56:18 +0000 Subject: [PATCH 081/993] feat(api): OpenAPI spec update via Stainless API (#88) --- .stats.yml | 2 +- src/runloop_api_client/resources/functions/invocations.py | 4 ++-- .../types/functions/invocation_list_params.py | 2 +- tests/api_resources/functions/test_invocations.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index d38ffc5b6..d7d6826d3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-fc7e88fcbc5d6d4cdc0247bbef1bebb8de2bf610059f17ac727f9f282ba2db6e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-657e9154dbe6a5f9388e5f0de7ee87432205e4a84af3de7e646eae54007f65f8.yml diff --git a/src/runloop_api_client/resources/functions/invocations.py b/src/runloop_api_client/resources/functions/invocations.py index b519df35a..59491d1e7 100644 --- a/src/runloop_api_client/resources/functions/invocations.py +++ b/src/runloop_api_client/resources/functions/invocations.py @@ -72,7 +72,7 @@ def retrieve( def list( self, *, - limit: str | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -197,7 +197,7 @@ async def retrieve( async def list( self, *, - limit: str | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/runloop_api_client/types/functions/invocation_list_params.py b/src/runloop_api_client/types/functions/invocation_list_params.py index dad6156bd..5ad136ee1 100644 --- a/src/runloop_api_client/types/functions/invocation_list_params.py +++ b/src/runloop_api_client/types/functions/invocation_list_params.py @@ -8,7 +8,7 @@ class InvocationListParams(TypedDict, total=False): - limit: str + limit: int """Page Limit""" starting_after: str diff --git a/tests/api_resources/functions/test_invocations.py b/tests/api_resources/functions/test_invocations.py index 36db3aa52..726e5843c 100644 --- a/tests/api_resources/functions/test_invocations.py +++ b/tests/api_resources/functions/test_invocations.py @@ -64,7 +64,7 @@ def test_method_list(self, client: Runloop) -> None: @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: invocation = client.functions.invocations.list( - limit="limit", + limit=0, starting_after="starting_after", ) assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) @@ -177,7 +177,7 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: invocation = await async_client.functions.invocations.list( - limit="limit", + limit=0, starting_after="starting_after", ) assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) From 8e7edd062c67ef928f8c8f6edfb2af00136e3761 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 13 Aug 2024 23:12:32 +0000 Subject: [PATCH 082/993] feat(api): OpenAPI spec update via Stainless API (#89) --- .stats.yml | 2 +- src/runloop_api_client/resources/functions/invocations.py | 4 ++-- .../types/functions/invocation_list_params.py | 2 +- tests/api_resources/functions/test_invocations.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index d7d6826d3..6dc704897 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-657e9154dbe6a5f9388e5f0de7ee87432205e4a84af3de7e646eae54007f65f8.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-dee1779e10f5321966423c3d22dc8864e5ace072c86065e2144e81d71d1ad528.yml diff --git a/src/runloop_api_client/resources/functions/invocations.py b/src/runloop_api_client/resources/functions/invocations.py index 59491d1e7..b519df35a 100644 --- a/src/runloop_api_client/resources/functions/invocations.py +++ b/src/runloop_api_client/resources/functions/invocations.py @@ -72,7 +72,7 @@ def retrieve( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, + limit: str | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -197,7 +197,7 @@ async def retrieve( async def list( self, *, - limit: int | NotGiven = NOT_GIVEN, + limit: str | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/runloop_api_client/types/functions/invocation_list_params.py b/src/runloop_api_client/types/functions/invocation_list_params.py index 5ad136ee1..dad6156bd 100644 --- a/src/runloop_api_client/types/functions/invocation_list_params.py +++ b/src/runloop_api_client/types/functions/invocation_list_params.py @@ -8,7 +8,7 @@ class InvocationListParams(TypedDict, total=False): - limit: int + limit: str """Page Limit""" starting_after: str diff --git a/tests/api_resources/functions/test_invocations.py b/tests/api_resources/functions/test_invocations.py index 726e5843c..36db3aa52 100644 --- a/tests/api_resources/functions/test_invocations.py +++ b/tests/api_resources/functions/test_invocations.py @@ -64,7 +64,7 @@ def test_method_list(self, client: Runloop) -> None: @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: invocation = client.functions.invocations.list( - limit=0, + limit="limit", starting_after="starting_after", ) assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) @@ -177,7 +177,7 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: invocation = await async_client.functions.invocations.list( - limit=0, + limit="limit", starting_after="starting_after", ) assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) From 611fddcff325b206eb45dce8aec80478563bda5c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 03:12:27 +0000 Subject: [PATCH 083/993] feat(api): OpenAPI spec update via Stainless API (#90) --- .stats.yml | 2 +- src/runloop_api_client/resources/functions/invocations.py | 4 ++-- .../types/functions/invocation_list_params.py | 2 +- tests/api_resources/functions/test_invocations.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6dc704897..9068a9902 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-dee1779e10f5321966423c3d22dc8864e5ace072c86065e2144e81d71d1ad528.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f8e5f5af651b36c2ceed0edd7ad24bc9227ebd55a782be369428c38bde32c3d2.yml diff --git a/src/runloop_api_client/resources/functions/invocations.py b/src/runloop_api_client/resources/functions/invocations.py index b519df35a..59491d1e7 100644 --- a/src/runloop_api_client/resources/functions/invocations.py +++ b/src/runloop_api_client/resources/functions/invocations.py @@ -72,7 +72,7 @@ def retrieve( def list( self, *, - limit: str | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -197,7 +197,7 @@ async def retrieve( async def list( self, *, - limit: str | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/runloop_api_client/types/functions/invocation_list_params.py b/src/runloop_api_client/types/functions/invocation_list_params.py index dad6156bd..5ad136ee1 100644 --- a/src/runloop_api_client/types/functions/invocation_list_params.py +++ b/src/runloop_api_client/types/functions/invocation_list_params.py @@ -8,7 +8,7 @@ class InvocationListParams(TypedDict, total=False): - limit: str + limit: int """Page Limit""" starting_after: str diff --git a/tests/api_resources/functions/test_invocations.py b/tests/api_resources/functions/test_invocations.py index 36db3aa52..726e5843c 100644 --- a/tests/api_resources/functions/test_invocations.py +++ b/tests/api_resources/functions/test_invocations.py @@ -64,7 +64,7 @@ def test_method_list(self, client: Runloop) -> None: @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: invocation = client.functions.invocations.list( - limit="limit", + limit=0, starting_after="starting_after", ) assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) @@ -177,7 +177,7 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: invocation = await async_client.functions.invocations.list( - limit="limit", + limit=0, starting_after="starting_after", ) assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) From 7dde411a20a6311797e0d6b3b15a3f1cb36ae9bf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 14:23:04 +0000 Subject: [PATCH 084/993] feat(api): update via SDK Studio (#91) --- src/runloop_api_client/_constants.py | 4 +-- tests/test_client.py | 48 ++++++++++++++-------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/runloop_api_client/_constants.py b/src/runloop_api_client/_constants.py index 8e36fea12..0371d467a 100644 --- a/src/runloop_api_client/_constants.py +++ b/src/runloop_api_client/_constants.py @@ -10,5 +10,5 @@ DEFAULT_MAX_RETRIES = 0 DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20) -INITIAL_RETRY_DELAY = 1.0 -MAX_RETRY_DELAY = 5.0 +INITIAL_RETRY_DELAY = 0.5 +MAX_RETRY_DELAY = 8.0 diff --git a/tests/test_client.py b/tests/test_client.py index a9738496a..b0626295d 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -706,20 +706,20 @@ class Model(BaseModel): "remaining_retries,retry_after,timeout", [ [3, "20", 20], - [3, "0", 1], - [3, "-10", 1], + [3, "0", 0.5], + [3, "-10", 0.5], [3, "60", 60], - [3, "61", 1], + [3, "61", 0.5], [3, "Fri, 29 Sep 2023 16:26:57 GMT", 20], - [3, "Fri, 29 Sep 2023 16:26:37 GMT", 1], - [3, "Fri, 29 Sep 2023 16:26:27 GMT", 1], + [3, "Fri, 29 Sep 2023 16:26:37 GMT", 0.5], + [3, "Fri, 29 Sep 2023 16:26:27 GMT", 0.5], [3, "Fri, 29 Sep 2023 16:27:37 GMT", 60], - [3, "Fri, 29 Sep 2023 16:27:38 GMT", 1], - [3, "99999999999999999999999999999999999", 1], - [3, "Zun, 29 Sep 2023 16:26:27 GMT", 1], - [3, "", 1], - [2, "", 1 * 2.0], - [1, "", 1 * 4.0], + [3, "Fri, 29 Sep 2023 16:27:38 GMT", 0.5], + [3, "99999999999999999999999999999999999", 0.5], + [3, "Zun, 29 Sep 2023 16:26:27 GMT", 0.5], + [3, "", 0.5], + [2, "", 0.5 * 2.0], + [1, "", 0.5 * 4.0], ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) @@ -729,7 +729,7 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) calculated = client._calculate_retry_timeout(remaining_retries, options, headers) - assert calculated == pytest.approx(timeout, 1 * 0.875) # pyright: ignore[reportUnknownMemberType] + assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) @@ -1442,20 +1442,20 @@ class Model(BaseModel): "remaining_retries,retry_after,timeout", [ [3, "20", 20], - [3, "0", 1], - [3, "-10", 1], + [3, "0", 0.5], + [3, "-10", 0.5], [3, "60", 60], - [3, "61", 1], + [3, "61", 0.5], [3, "Fri, 29 Sep 2023 16:26:57 GMT", 20], - [3, "Fri, 29 Sep 2023 16:26:37 GMT", 1], - [3, "Fri, 29 Sep 2023 16:26:27 GMT", 1], + [3, "Fri, 29 Sep 2023 16:26:37 GMT", 0.5], + [3, "Fri, 29 Sep 2023 16:26:27 GMT", 0.5], [3, "Fri, 29 Sep 2023 16:27:37 GMT", 60], - [3, "Fri, 29 Sep 2023 16:27:38 GMT", 1], - [3, "99999999999999999999999999999999999", 1], - [3, "Zun, 29 Sep 2023 16:26:27 GMT", 1], - [3, "", 1], - [2, "", 1 * 2.0], - [1, "", 1 * 4.0], + [3, "Fri, 29 Sep 2023 16:27:38 GMT", 0.5], + [3, "99999999999999999999999999999999999", 0.5], + [3, "Zun, 29 Sep 2023 16:26:27 GMT", 0.5], + [3, "", 0.5], + [2, "", 0.5 * 2.0], + [1, "", 0.5 * 4.0], ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) @@ -1466,7 +1466,7 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) calculated = client._calculate_retry_timeout(remaining_retries, options, headers) - assert calculated == pytest.approx(timeout, 1 * 0.875) # pyright: ignore[reportUnknownMemberType] + assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) From 2bce80dd1920ee835bdae59e169028507ebdaa4e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 14:23:24 +0000 Subject: [PATCH 085/993] chore(internal): codegen related update (#92) --- src/runloop_api_client/_constants.py | 4 +-- tests/test_client.py | 48 ++++++++++++++-------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/runloop_api_client/_constants.py b/src/runloop_api_client/_constants.py index 0371d467a..8e36fea12 100644 --- a/src/runloop_api_client/_constants.py +++ b/src/runloop_api_client/_constants.py @@ -10,5 +10,5 @@ DEFAULT_MAX_RETRIES = 0 DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20) -INITIAL_RETRY_DELAY = 0.5 -MAX_RETRY_DELAY = 8.0 +INITIAL_RETRY_DELAY = 1.0 +MAX_RETRY_DELAY = 5.0 diff --git a/tests/test_client.py b/tests/test_client.py index b0626295d..a9738496a 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -706,20 +706,20 @@ class Model(BaseModel): "remaining_retries,retry_after,timeout", [ [3, "20", 20], - [3, "0", 0.5], - [3, "-10", 0.5], + [3, "0", 1], + [3, "-10", 1], [3, "60", 60], - [3, "61", 0.5], + [3, "61", 1], [3, "Fri, 29 Sep 2023 16:26:57 GMT", 20], - [3, "Fri, 29 Sep 2023 16:26:37 GMT", 0.5], - [3, "Fri, 29 Sep 2023 16:26:27 GMT", 0.5], + [3, "Fri, 29 Sep 2023 16:26:37 GMT", 1], + [3, "Fri, 29 Sep 2023 16:26:27 GMT", 1], [3, "Fri, 29 Sep 2023 16:27:37 GMT", 60], - [3, "Fri, 29 Sep 2023 16:27:38 GMT", 0.5], - [3, "99999999999999999999999999999999999", 0.5], - [3, "Zun, 29 Sep 2023 16:26:27 GMT", 0.5], - [3, "", 0.5], - [2, "", 0.5 * 2.0], - [1, "", 0.5 * 4.0], + [3, "Fri, 29 Sep 2023 16:27:38 GMT", 1], + [3, "99999999999999999999999999999999999", 1], + [3, "Zun, 29 Sep 2023 16:26:27 GMT", 1], + [3, "", 1], + [2, "", 1 * 2.0], + [1, "", 1 * 4.0], ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) @@ -729,7 +729,7 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) calculated = client._calculate_retry_timeout(remaining_retries, options, headers) - assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] + assert calculated == pytest.approx(timeout, 1 * 0.875) # pyright: ignore[reportUnknownMemberType] @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) @@ -1442,20 +1442,20 @@ class Model(BaseModel): "remaining_retries,retry_after,timeout", [ [3, "20", 20], - [3, "0", 0.5], - [3, "-10", 0.5], + [3, "0", 1], + [3, "-10", 1], [3, "60", 60], - [3, "61", 0.5], + [3, "61", 1], [3, "Fri, 29 Sep 2023 16:26:57 GMT", 20], - [3, "Fri, 29 Sep 2023 16:26:37 GMT", 0.5], - [3, "Fri, 29 Sep 2023 16:26:27 GMT", 0.5], + [3, "Fri, 29 Sep 2023 16:26:37 GMT", 1], + [3, "Fri, 29 Sep 2023 16:26:27 GMT", 1], [3, "Fri, 29 Sep 2023 16:27:37 GMT", 60], - [3, "Fri, 29 Sep 2023 16:27:38 GMT", 0.5], - [3, "99999999999999999999999999999999999", 0.5], - [3, "Zun, 29 Sep 2023 16:26:27 GMT", 0.5], - [3, "", 0.5], - [2, "", 0.5 * 2.0], - [1, "", 0.5 * 4.0], + [3, "Fri, 29 Sep 2023 16:27:38 GMT", 1], + [3, "99999999999999999999999999999999999", 1], + [3, "Zun, 29 Sep 2023 16:26:27 GMT", 1], + [3, "", 1], + [2, "", 1 * 2.0], + [1, "", 1 * 4.0], ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) @@ -1466,7 +1466,7 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) calculated = client._calculate_retry_timeout(remaining_retries, options, headers) - assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] + assert calculated == pytest.approx(timeout, 1 * 0.875) # pyright: ignore[reportUnknownMemberType] @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) From cb32f4f2d537fb55c029657a31b58d899f8efed1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 Aug 2024 21:28:08 +0000 Subject: [PATCH 086/993] feat(api): OpenAPI spec update via Stainless API (#93) --- .stats.yml | 4 +- api.md | 2 + .../resources/devboxes/devboxes.py | 99 ++++++++++++++++++- src/runloop_api_client/types/__init__.py | 1 + .../types/devbox_upload_file_params.py | 16 +++ tests/api_resources/test_devboxes.py | 94 ++++++++++++++++++ 6 files changed, 213 insertions(+), 3 deletions(-) create mode 100644 src/runloop_api_client/types/devbox_upload_file_params.py diff --git a/.stats.yml b/.stats.yml index 9068a9902..fbcb876da 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f8e5f5af651b36c2ceed0edd7ad24bc9227ebd55a782be369428c38bde32c3d2.yml +configured_endpoints: 23 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b8fcc87544efea42048d01a4c7ba4c8abf1725337cfbb6bff607d5fea5cd1e1a.yml diff --git a/api.md b/api.md index 5a5988a8d..6f52516ae 100644 --- a/api.md +++ b/api.md @@ -53,6 +53,7 @@ from runloop_api_client.types import ( DevboxListView, DevboxView, DevboxReadFileContentsResponse, + DevboxUploadFileResponse, ) ``` @@ -65,6 +66,7 @@ Methods: - client.devboxes.read_file(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.read_file_contents(id, \*\*params) -> str - client.devboxes.shutdown(id) -> DevboxView +- client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView ## Logs diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 198110b5b..eed5f870b 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -19,10 +19,11 @@ devbox_create_params, devbox_read_file_params, devbox_write_file_params, + devbox_upload_file_params, devbox_execute_sync_params, devbox_read_file_contents_params, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes from ..._utils import ( maybe_transform, async_maybe_transform, @@ -365,6 +366,48 @@ def shutdown( cast_to=DevboxView, ) + def upload_file( + self, + id: str, + *, + file_input_stream: FileTypes | NotGiven = NOT_GIVEN, + path: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Upload file contents to a file at path on the Devbox. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/upload_file", + body=maybe_transform( + { + "file_input_stream": file_input_stream, + "path": path, + }, + devbox_upload_file_params.DevboxUploadFileParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + def write_file( self, id: str, @@ -734,6 +777,48 @@ async def shutdown( cast_to=DevboxView, ) + async def upload_file( + self, + id: str, + *, + file_input_stream: FileTypes | NotGiven = NOT_GIVEN, + path: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Upload file contents to a file at path on the Devbox. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/upload_file", + body=await async_maybe_transform( + { + "file_input_stream": file_input_stream, + "path": path, + }, + devbox_upload_file_params.DevboxUploadFileParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + async def write_file( self, id: str, @@ -806,6 +891,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.shutdown = to_raw_response_wrapper( devboxes.shutdown, ) + self.upload_file = to_raw_response_wrapper( + devboxes.upload_file, + ) self.write_file = to_raw_response_wrapper( devboxes.write_file, ) @@ -840,6 +928,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.shutdown = async_to_raw_response_wrapper( devboxes.shutdown, ) + self.upload_file = async_to_raw_response_wrapper( + devboxes.upload_file, + ) self.write_file = async_to_raw_response_wrapper( devboxes.write_file, ) @@ -874,6 +965,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.shutdown = to_streamed_response_wrapper( devboxes.shutdown, ) + self.upload_file = to_streamed_response_wrapper( + devboxes.upload_file, + ) self.write_file = to_streamed_response_wrapper( devboxes.write_file, ) @@ -908,6 +1002,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.shutdown = async_to_streamed_response_wrapper( devboxes.shutdown, ) + self.upload_file = async_to_streamed_response_wrapper( + devboxes.upload_file, + ) self.write_file = async_to_streamed_response_wrapper( devboxes.write_file, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 469d03aa8..616342b9e 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -23,6 +23,7 @@ from .devbox_read_file_params import DevboxReadFileParams as DevboxReadFileParams from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams from .devbox_write_file_params import DevboxWriteFileParams as DevboxWriteFileParams +from .devbox_upload_file_params import DevboxUploadFileParams as DevboxUploadFileParams from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams from .code_mount_parameters_param import CodeMountParametersParam as CodeMountParametersParam diff --git a/src/runloop_api_client/types/devbox_upload_file_params.py b/src/runloop_api_client/types/devbox_upload_file_params.py new file mode 100644 index 000000000..07529f129 --- /dev/null +++ b/src/runloop_api_client/types/devbox_upload_file_params.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Annotated, TypedDict + +from .._types import FileTypes +from .._utils import PropertyInfo + +__all__ = ["DevboxUploadFileParams"] + + +class DevboxUploadFileParams(TypedDict, total=False): + file_input_stream: Annotated[FileTypes, PropertyInfo(alias="fileInputStream")] + + path: str diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 3f21fbaa5..5cf7d275c 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -312,6 +312,53 @@ def test_path_params_shutdown(self, client: Runloop) -> None: "", ) + @parametrize + def test_method_upload_file(self, client: Runloop) -> None: + devbox = client.devboxes.upload_file( + id="id", + ) + assert_matches_type(object, devbox, path=["response"]) + + @parametrize + def test_method_upload_file_with_all_params(self, client: Runloop) -> None: + devbox = client.devboxes.upload_file( + id="id", + file_input_stream=b"raw file contents", + path="path", + ) + assert_matches_type(object, devbox, path=["response"]) + + @parametrize + def test_raw_response_upload_file(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.upload_file( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(object, devbox, path=["response"]) + + @parametrize + def test_streaming_response_upload_file(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.upload_file( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(object, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_upload_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.upload_file( + id="", + ) + @parametrize def test_method_write_file(self, client: Runloop) -> None: devbox = client.devboxes.write_file( @@ -654,6 +701,53 @@ async def test_path_params_shutdown(self, async_client: AsyncRunloop) -> None: "", ) + @parametrize + async def test_method_upload_file(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.upload_file( + id="id", + ) + assert_matches_type(object, devbox, path=["response"]) + + @parametrize + async def test_method_upload_file_with_all_params(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.upload_file( + id="id", + file_input_stream=b"raw file contents", + path="path", + ) + assert_matches_type(object, devbox, path=["response"]) + + @parametrize + async def test_raw_response_upload_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.upload_file( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(object, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_upload_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.upload_file( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(object, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_upload_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.upload_file( + id="", + ) + @parametrize async def test_method_write_file(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.write_file( From 914c5030b2b6f4adeb61f1056db12277024641bf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 Aug 2024 21:31:33 +0000 Subject: [PATCH 087/993] chore(internal): use different 32bit detection method (#94) --- src/runloop_api_client/_base_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index 06455d98b..dabdd0790 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -1,5 +1,6 @@ from __future__ import annotations +import sys import json import time import uuid @@ -1982,7 +1983,6 @@ def get_python_version() -> str: def get_architecture() -> Arch: try: - python_bitness, _ = platform.architecture() machine = platform.machine().lower() except Exception: return "unknown" @@ -1998,7 +1998,7 @@ def get_architecture() -> Arch: return "x64" # TODO: untested - if python_bitness == "32bit": + if sys.maxsize <= 2**32: return "x32" if machine: From 5f36613b29feebfcd0e05d23d1bb9b28caa29120 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 Aug 2024 21:45:20 +0000 Subject: [PATCH 088/993] chore(internal): version bump (#95) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ee49ac2dc..fd0ccba9b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.11" + ".": "0.1.0-alpha.12" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 4b43f24bc..5e077429f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.1.0-alpha.11" +version = "0.1.0-alpha.12" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index d98387ec7..dd2da7c2a 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.1.0-alpha.11" # x-release-please-version +__version__ = "0.1.0-alpha.12" # x-release-please-version From 24021dfd2bf8dcd34466879df212d91946c93a19 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 Aug 2024 22:07:41 +0000 Subject: [PATCH 089/993] feat(api): OpenAPI spec update via Stainless API (#96) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 8 ++++---- src/runloop_api_client/types/devbox_upload_file_params.py | 5 ++--- tests/api_resources/test_devboxes.py | 4 ++-- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index fbcb876da..566991053 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 23 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b8fcc87544efea42048d01a4c7ba4c8abf1725337cfbb6bff607d5fea5cd1e1a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a201c7831c11977b26e2aef7a85d862dba74fe528200b613ff67533876f3a8e8.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index eed5f870b..a4f2c337a 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -370,7 +370,7 @@ def upload_file( self, id: str, *, - file_input_stream: FileTypes | NotGiven = NOT_GIVEN, + file: FileTypes | NotGiven = NOT_GIVEN, path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -397,7 +397,7 @@ def upload_file( f"/v1/devboxes/{id}/upload_file", body=maybe_transform( { - "file_input_stream": file_input_stream, + "file": file, "path": path, }, devbox_upload_file_params.DevboxUploadFileParams, @@ -781,7 +781,7 @@ async def upload_file( self, id: str, *, - file_input_stream: FileTypes | NotGiven = NOT_GIVEN, + file: FileTypes | NotGiven = NOT_GIVEN, path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -808,7 +808,7 @@ async def upload_file( f"/v1/devboxes/{id}/upload_file", body=await async_maybe_transform( { - "file_input_stream": file_input_stream, + "file": file, "path": path, }, devbox_upload_file_params.DevboxUploadFileParams, diff --git a/src/runloop_api_client/types/devbox_upload_file_params.py b/src/runloop_api_client/types/devbox_upload_file_params.py index 07529f129..606a0b2b4 100644 --- a/src/runloop_api_client/types/devbox_upload_file_params.py +++ b/src/runloop_api_client/types/devbox_upload_file_params.py @@ -2,15 +2,14 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import TypedDict from .._types import FileTypes -from .._utils import PropertyInfo __all__ = ["DevboxUploadFileParams"] class DevboxUploadFileParams(TypedDict, total=False): - file_input_stream: Annotated[FileTypes, PropertyInfo(alias="fileInputStream")] + file: FileTypes path: str diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 5cf7d275c..5edb2c25e 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -323,7 +323,7 @@ def test_method_upload_file(self, client: Runloop) -> None: def test_method_upload_file_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.upload_file( id="id", - file_input_stream=b"raw file contents", + file=b"raw file contents", path="path", ) assert_matches_type(object, devbox, path=["response"]) @@ -712,7 +712,7 @@ async def test_method_upload_file(self, async_client: AsyncRunloop) -> None: async def test_method_upload_file_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.upload_file( id="id", - file_input_stream=b"raw file contents", + file=b"raw file contents", path="path", ) assert_matches_type(object, devbox, path=["response"]) From 391a13962faa72a1bf8f81db497b84cf9e7349e9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 Aug 2024 22:12:56 +0000 Subject: [PATCH 090/993] feat(api): OpenAPI spec update via Stainless API (#98) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 8 ++++---- src/runloop_api_client/types/devbox_upload_file_params.py | 5 +++-- tests/api_resources/test_devboxes.py | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.stats.yml b/.stats.yml index 566991053..27881a2a3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 23 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a201c7831c11977b26e2aef7a85d862dba74fe528200b613ff67533876f3a8e8.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-de7c7d103b78caae64b0f9363d2efdfb9a4313ed39dd1d10279b582388f2dc18.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index a4f2c337a..eed5f870b 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -370,7 +370,7 @@ def upload_file( self, id: str, *, - file: FileTypes | NotGiven = NOT_GIVEN, + file_input_stream: FileTypes | NotGiven = NOT_GIVEN, path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -397,7 +397,7 @@ def upload_file( f"/v1/devboxes/{id}/upload_file", body=maybe_transform( { - "file": file, + "file_input_stream": file_input_stream, "path": path, }, devbox_upload_file_params.DevboxUploadFileParams, @@ -781,7 +781,7 @@ async def upload_file( self, id: str, *, - file: FileTypes | NotGiven = NOT_GIVEN, + file_input_stream: FileTypes | NotGiven = NOT_GIVEN, path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -808,7 +808,7 @@ async def upload_file( f"/v1/devboxes/{id}/upload_file", body=await async_maybe_transform( { - "file": file, + "file_input_stream": file_input_stream, "path": path, }, devbox_upload_file_params.DevboxUploadFileParams, diff --git a/src/runloop_api_client/types/devbox_upload_file_params.py b/src/runloop_api_client/types/devbox_upload_file_params.py index 606a0b2b4..07529f129 100644 --- a/src/runloop_api_client/types/devbox_upload_file_params.py +++ b/src/runloop_api_client/types/devbox_upload_file_params.py @@ -2,14 +2,15 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Annotated, TypedDict from .._types import FileTypes +from .._utils import PropertyInfo __all__ = ["DevboxUploadFileParams"] class DevboxUploadFileParams(TypedDict, total=False): - file: FileTypes + file_input_stream: Annotated[FileTypes, PropertyInfo(alias="fileInputStream")] path: str diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 5edb2c25e..5cf7d275c 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -323,7 +323,7 @@ def test_method_upload_file(self, client: Runloop) -> None: def test_method_upload_file_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.upload_file( id="id", - file=b"raw file contents", + file_input_stream=b"raw file contents", path="path", ) assert_matches_type(object, devbox, path=["response"]) @@ -712,7 +712,7 @@ async def test_method_upload_file(self, async_client: AsyncRunloop) -> None: async def test_method_upload_file_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.upload_file( id="id", - file=b"raw file contents", + file_input_stream=b"raw file contents", path="path", ) assert_matches_type(object, devbox, path=["response"]) From 85bdbeca9f2749a81e39413e8d8fb4d61e5c819a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 Aug 2024 22:26:21 +0000 Subject: [PATCH 091/993] feat(api): OpenAPI spec update via Stainless API (#99) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 8 ++++---- src/runloop_api_client/types/devbox_upload_file_params.py | 5 ++--- tests/api_resources/test_devboxes.py | 4 ++-- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index 27881a2a3..566991053 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 23 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-de7c7d103b78caae64b0f9363d2efdfb9a4313ed39dd1d10279b582388f2dc18.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a201c7831c11977b26e2aef7a85d862dba74fe528200b613ff67533876f3a8e8.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index eed5f870b..a4f2c337a 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -370,7 +370,7 @@ def upload_file( self, id: str, *, - file_input_stream: FileTypes | NotGiven = NOT_GIVEN, + file: FileTypes | NotGiven = NOT_GIVEN, path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -397,7 +397,7 @@ def upload_file( f"/v1/devboxes/{id}/upload_file", body=maybe_transform( { - "file_input_stream": file_input_stream, + "file": file, "path": path, }, devbox_upload_file_params.DevboxUploadFileParams, @@ -781,7 +781,7 @@ async def upload_file( self, id: str, *, - file_input_stream: FileTypes | NotGiven = NOT_GIVEN, + file: FileTypes | NotGiven = NOT_GIVEN, path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -808,7 +808,7 @@ async def upload_file( f"/v1/devboxes/{id}/upload_file", body=await async_maybe_transform( { - "file_input_stream": file_input_stream, + "file": file, "path": path, }, devbox_upload_file_params.DevboxUploadFileParams, diff --git a/src/runloop_api_client/types/devbox_upload_file_params.py b/src/runloop_api_client/types/devbox_upload_file_params.py index 07529f129..606a0b2b4 100644 --- a/src/runloop_api_client/types/devbox_upload_file_params.py +++ b/src/runloop_api_client/types/devbox_upload_file_params.py @@ -2,15 +2,14 @@ from __future__ import annotations -from typing_extensions import Annotated, TypedDict +from typing_extensions import TypedDict from .._types import FileTypes -from .._utils import PropertyInfo __all__ = ["DevboxUploadFileParams"] class DevboxUploadFileParams(TypedDict, total=False): - file_input_stream: Annotated[FileTypes, PropertyInfo(alias="fileInputStream")] + file: FileTypes path: str diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 5cf7d275c..5edb2c25e 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -323,7 +323,7 @@ def test_method_upload_file(self, client: Runloop) -> None: def test_method_upload_file_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.upload_file( id="id", - file_input_stream=b"raw file contents", + file=b"raw file contents", path="path", ) assert_matches_type(object, devbox, path=["response"]) @@ -712,7 +712,7 @@ async def test_method_upload_file(self, async_client: AsyncRunloop) -> None: async def test_method_upload_file_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.upload_file( id="id", - file_input_stream=b"raw file contents", + file=b"raw file contents", path="path", ) assert_matches_type(object, devbox, path=["response"]) From 47eb96b2921d3e9dfb000521a848351704ab2e34 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 Aug 2024 23:12:20 +0000 Subject: [PATCH 092/993] feat(api): OpenAPI spec update via Stainless API (#100) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 566991053..e7fc4370c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 23 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a201c7831c11977b26e2aef7a85d862dba74fe528200b613ff67533876f3a8e8.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bf3950d5829c4fb7d7692900bd5f18ea4dcd0b14e8a417d66166c91fd747039f.yml From cacb3be9cd2d5e899a993c5e1cc64152b4be570b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 Aug 2024 23:23:13 +0000 Subject: [PATCH 093/993] feat(api): OpenAPI spec update via Stainless API (#101) --- .stats.yml | 2 +- .../resources/devboxes/devboxes.py | 44 ++++++++++++------- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/.stats.yml b/.stats.yml index e7fc4370c..8a07bb78a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 23 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bf3950d5829c4fb7d7692900bd5f18ea4dcd0b14e8a417d66166c91fd747039f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8dd1329492bd6c23ed374d72abfc2ab7928cd398f06f849865dc48cc2ecf6b8a.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index a4f2c337a..9bdd4b784 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List +from typing import Dict, List, Mapping, cast import httpx @@ -25,7 +25,9 @@ ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes from ..._utils import ( + extract_files, maybe_transform, + deepcopy_minimal, async_maybe_transform, ) from ..._compat import cached_property @@ -393,15 +395,21 @@ def upload_file( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + body = deepcopy_minimal( + { + "file": file, + "path": path, + } + ) + files = extract_files(cast(Mapping[str, object], body), paths=[["file"]]) + # It should be noted that the actual Content-Type header that will be + # sent to the server will contain a `boundary` parameter, e.g. + # multipart/form-data; boundary=---abc-- + extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return self._post( f"/v1/devboxes/{id}/upload_file", - body=maybe_transform( - { - "file": file, - "path": path, - }, - devbox_upload_file_params.DevboxUploadFileParams, - ), + body=maybe_transform(body, devbox_upload_file_params.DevboxUploadFileParams), + files=files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -804,15 +812,21 @@ async def upload_file( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + body = deepcopy_minimal( + { + "file": file, + "path": path, + } + ) + files = extract_files(cast(Mapping[str, object], body), paths=[["file"]]) + # It should be noted that the actual Content-Type header that will be + # sent to the server will contain a `boundary` parameter, e.g. + # multipart/form-data; boundary=---abc-- + extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})} return await self._post( f"/v1/devboxes/{id}/upload_file", - body=await async_maybe_transform( - { - "file": file, - "path": path, - }, - devbox_upload_file_params.DevboxUploadFileParams, - ), + body=await async_maybe_transform(body, devbox_upload_file_params.DevboxUploadFileParams), + files=files, options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), From 728a0ba09cd5a4a538affd5d625f76b3e436c82d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 Aug 2024 00:13:12 +0000 Subject: [PATCH 094/993] feat(api): OpenAPI spec update via Stainless API (#102) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8a07bb78a..d43ee9119 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 23 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8dd1329492bd6c23ed374d72abfc2ab7928cd398f06f849865dc48cc2ecf6b8a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-cbb5634053080aa5b590af54b434cfd5275d5a27e932fb91366f7f7f2b492ed8.yml From a2ed69ca172964672a51c974b419bb86cf305aa1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 Aug 2024 14:04:28 +0000 Subject: [PATCH 095/993] chore(internal): version bump (#103) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index fd0ccba9b..000572ece 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.12" + ".": "0.1.0-alpha.13" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 5e077429f..cdeb9d124 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.1.0-alpha.12" +version = "0.1.0-alpha.13" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index dd2da7c2a..afe22f572 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.1.0-alpha.12" # x-release-please-version +__version__ = "0.1.0-alpha.13" # x-release-please-version From 4c8d5e943f7abcfdf96bbba2cf8536a97a54d20b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 Aug 2024 17:12:21 +0000 Subject: [PATCH 096/993] feat(api): OpenAPI spec update via Stainless API (#104) --- .stats.yml | 2 +- src/runloop_api_client/types/blueprint_view.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d43ee9119..0169fbd25 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 23 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-cbb5634053080aa5b590af54b434cfd5275d5a27e932fb91366f7f7f2b492ed8.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ccdd2f1f86705a3cc4e40bc294ca94e0e761f22bc8487955fc2a663c046688b5.yml diff --git a/src/runloop_api_client/types/blueprint_view.py b/src/runloop_api_client/types/blueprint_view.py index 72d55f399..0d108badf 100644 --- a/src/runloop_api_client/types/blueprint_view.py +++ b/src/runloop_api_client/types/blueprint_view.py @@ -16,6 +16,9 @@ class BlueprintView(BaseModel): create_time_ms: Optional[int] = None """Creation time of the Blueprint (Unix timestamp milliseconds).""" + failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "build_failed"]] = None + """The failure reason if the Blueprint build failed, if any.""" + name: Optional[str] = None """The name of the Blueprint.""" From 8ce95cf8ee6216bb31ec75fe1685fa08850d56d7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 14:13:25 +0000 Subject: [PATCH 097/993] feat(api): OpenAPI spec update via Stainless API (#106) --- .devcontainer/Dockerfile | 0 .devcontainer/devcontainer.json | 0 .github/workflows/ci.yml | 0 .github/workflows/publish-pypi.yml | 0 .github/workflows/release-doctor.yml | 0 .gitignore | 0 .python-version | 0 .release-please-manifest.json | 0 .stats.yml | 2 +- Brewfile | 0 CONTRIBUTING.md | 0 LICENSE | 0 README.md | 0 SECURITY.md | 0 api.md | 0 bin/check-release-environment | 0 bin/publish-pypi | 0 examples/.keep | 0 mypy.ini | 0 noxfile.py | 0 pyproject.toml | 0 release-please-config.json | 0 requirements-dev.lock | 0 requirements.lock | 0 scripts/utils/ruffen-docs.py | 0 src/runloop/lib/.keep | 0 src/runloop_api_client/__init__.py | 0 src/runloop_api_client/_base_client.py | 0 src/runloop_api_client/_client.py | 0 src/runloop_api_client/_compat.py | 0 src/runloop_api_client/_constants.py | 0 src/runloop_api_client/_exceptions.py | 0 src/runloop_api_client/_files.py | 0 src/runloop_api_client/_models.py | 0 src/runloop_api_client/_qs.py | 0 src/runloop_api_client/_resource.py | 0 src/runloop_api_client/_response.py | 0 src/runloop_api_client/_streaming.py | 0 src/runloop_api_client/_types.py | 0 src/runloop_api_client/_utils/__init__.py | 0 src/runloop_api_client/_utils/_logs.py | 0 src/runloop_api_client/_utils/_proxy.py | 0 src/runloop_api_client/_utils/_reflection.py | 0 src/runloop_api_client/_utils/_streams.py | 0 src/runloop_api_client/_utils/_sync.py | 0 src/runloop_api_client/_utils/_transform.py | 0 src/runloop_api_client/_utils/_typing.py | 0 src/runloop_api_client/_utils/_utils.py | 0 src/runloop_api_client/_version.py | 0 src/runloop_api_client/lib/.keep | 0 src/runloop_api_client/py.typed | 0 src/runloop_api_client/resources/__init__.py | 0 src/runloop_api_client/resources/blueprints.py | 0 src/runloop_api_client/resources/devboxes/__init__.py | 0 src/runloop_api_client/resources/devboxes/devboxes.py | 0 src/runloop_api_client/resources/devboxes/logs.py | 0 src/runloop_api_client/resources/functions/__init__.py | 0 src/runloop_api_client/resources/functions/functions.py | 0 src/runloop_api_client/resources/functions/invocations.py | 0 src/runloop_api_client/resources/projects/__init__.py | 0 src/runloop_api_client/resources/projects/logs.py | 0 src/runloop_api_client/resources/projects/projects.py | 0 src/runloop_api_client/types/__init__.py | 0 src/runloop_api_client/types/blueprint_build_log.py | 0 .../types/blueprint_build_logs_list_view.py | 0 src/runloop_api_client/types/blueprint_build_parameters.py | 0 src/runloop_api_client/types/blueprint_create_params.py | 0 src/runloop_api_client/types/blueprint_list_params.py | 0 src/runloop_api_client/types/blueprint_list_view.py | 0 src/runloop_api_client/types/blueprint_preview_params.py | 0 src/runloop_api_client/types/blueprint_preview_view.py | 0 src/runloop_api_client/types/blueprint_view.py | 0 src/runloop_api_client/types/code_mount_parameters.py | 0 src/runloop_api_client/types/code_mount_parameters_param.py | 0 src/runloop_api_client/types/devbox_create_params.py | 0 src/runloop_api_client/types/devbox_execute_sync_params.py | 0 src/runloop_api_client/types/devbox_execution_detail_view.py | 0 src/runloop_api_client/types/devbox_list_params.py | 0 src/runloop_api_client/types/devbox_list_view.py | 0 .../types/devbox_read_file_contents_params.py | 0 .../types/devbox_read_file_contents_response.py | 0 src/runloop_api_client/types/devbox_read_file_params.py | 0 src/runloop_api_client/types/devbox_upload_file_params.py | 0 src/runloop_api_client/types/devbox_view.py | 4 ++++ src/runloop_api_client/types/devbox_write_file_params.py | 0 src/runloop_api_client/types/devboxes/__init__.py | 0 .../types/devboxes/devbox_logs_list_view.py | 0 src/runloop_api_client/types/function_invoke_async_params.py | 0 src/runloop_api_client/types/function_invoke_sync_params.py | 0 src/runloop_api_client/types/function_list_view.py | 0 src/runloop_api_client/types/functions/__init__.py | 0 .../types/functions/function_invocation_list_view.py | 0 .../types/functions/invocation_list_params.py | 0 src/runloop_api_client/types/project_list_view.py | 0 src/runloop_api_client/types/projects/__init__.py | 0 src/runloop_api_client/types/resource_size.py | 0 src/runloop_api_client/types/shared/__init__.py | 0 .../types/shared/function_invocation_execution_detail_view.py | 0 src/runloop_api_client/types/shared/project_logs_view.py | 0 src/runloop_minus_api_minus_client/lib/.keep | 0 tests/__init__.py | 0 tests/api_resources/__init__.py | 0 tests/api_resources/devboxes/__init__.py | 0 tests/api_resources/devboxes/test_logs.py | 0 tests/api_resources/functions/__init__.py | 0 tests/api_resources/functions/test_invocations.py | 0 tests/api_resources/projects/__init__.py | 0 tests/api_resources/projects/test_logs.py | 0 tests/api_resources/test_blueprints.py | 0 tests/api_resources/test_devboxes.py | 0 tests/api_resources/test_functions.py | 0 tests/api_resources/test_projects.py | 0 tests/conftest.py | 0 tests/sample_file.txt | 0 tests/test_client.py | 0 tests/test_deepcopy.py | 0 tests/test_extract_files.py | 0 tests/test_files.py | 0 tests/test_models.py | 0 tests/test_qs.py | 0 tests/test_required_args.py | 0 tests/test_response.py | 0 tests/test_streaming.py | 0 tests/test_transform.py | 0 tests/test_utils/test_proxy.py | 0 tests/test_utils/test_typing.py | 0 tests/utils.py | 0 127 files changed, 5 insertions(+), 1 deletion(-) mode change 100644 => 100755 .devcontainer/Dockerfile mode change 100644 => 100755 .devcontainer/devcontainer.json mode change 100644 => 100755 .github/workflows/ci.yml mode change 100644 => 100755 .github/workflows/publish-pypi.yml mode change 100644 => 100755 .github/workflows/release-doctor.yml mode change 100644 => 100755 .gitignore mode change 100644 => 100755 .python-version mode change 100644 => 100755 .release-please-manifest.json mode change 100644 => 100755 .stats.yml mode change 100644 => 100755 Brewfile mode change 100644 => 100755 CONTRIBUTING.md mode change 100644 => 100755 LICENSE mode change 100644 => 100755 README.md mode change 100644 => 100755 SECURITY.md mode change 100644 => 100755 api.md mode change 100644 => 100755 bin/check-release-environment mode change 100644 => 100755 bin/publish-pypi mode change 100644 => 100755 examples/.keep mode change 100644 => 100755 mypy.ini mode change 100644 => 100755 noxfile.py mode change 100644 => 100755 pyproject.toml mode change 100644 => 100755 release-please-config.json mode change 100644 => 100755 requirements-dev.lock mode change 100644 => 100755 requirements.lock mode change 100644 => 100755 scripts/utils/ruffen-docs.py mode change 100644 => 100755 src/runloop/lib/.keep mode change 100644 => 100755 src/runloop_api_client/__init__.py mode change 100644 => 100755 src/runloop_api_client/_base_client.py mode change 100644 => 100755 src/runloop_api_client/_client.py mode change 100644 => 100755 src/runloop_api_client/_compat.py mode change 100644 => 100755 src/runloop_api_client/_constants.py mode change 100644 => 100755 src/runloop_api_client/_exceptions.py mode change 100644 => 100755 src/runloop_api_client/_files.py mode change 100644 => 100755 src/runloop_api_client/_models.py mode change 100644 => 100755 src/runloop_api_client/_qs.py mode change 100644 => 100755 src/runloop_api_client/_resource.py mode change 100644 => 100755 src/runloop_api_client/_response.py mode change 100644 => 100755 src/runloop_api_client/_streaming.py mode change 100644 => 100755 src/runloop_api_client/_types.py mode change 100644 => 100755 src/runloop_api_client/_utils/__init__.py mode change 100644 => 100755 src/runloop_api_client/_utils/_logs.py mode change 100644 => 100755 src/runloop_api_client/_utils/_proxy.py mode change 100644 => 100755 src/runloop_api_client/_utils/_reflection.py mode change 100644 => 100755 src/runloop_api_client/_utils/_streams.py mode change 100644 => 100755 src/runloop_api_client/_utils/_sync.py mode change 100644 => 100755 src/runloop_api_client/_utils/_transform.py mode change 100644 => 100755 src/runloop_api_client/_utils/_typing.py mode change 100644 => 100755 src/runloop_api_client/_utils/_utils.py mode change 100644 => 100755 src/runloop_api_client/_version.py mode change 100644 => 100755 src/runloop_api_client/lib/.keep mode change 100644 => 100755 src/runloop_api_client/py.typed mode change 100644 => 100755 src/runloop_api_client/resources/__init__.py mode change 100644 => 100755 src/runloop_api_client/resources/blueprints.py mode change 100644 => 100755 src/runloop_api_client/resources/devboxes/__init__.py mode change 100644 => 100755 src/runloop_api_client/resources/devboxes/devboxes.py mode change 100644 => 100755 src/runloop_api_client/resources/devboxes/logs.py mode change 100644 => 100755 src/runloop_api_client/resources/functions/__init__.py mode change 100644 => 100755 src/runloop_api_client/resources/functions/functions.py mode change 100644 => 100755 src/runloop_api_client/resources/functions/invocations.py mode change 100644 => 100755 src/runloop_api_client/resources/projects/__init__.py mode change 100644 => 100755 src/runloop_api_client/resources/projects/logs.py mode change 100644 => 100755 src/runloop_api_client/resources/projects/projects.py mode change 100644 => 100755 src/runloop_api_client/types/__init__.py mode change 100644 => 100755 src/runloop_api_client/types/blueprint_build_log.py mode change 100644 => 100755 src/runloop_api_client/types/blueprint_build_logs_list_view.py mode change 100644 => 100755 src/runloop_api_client/types/blueprint_build_parameters.py mode change 100644 => 100755 src/runloop_api_client/types/blueprint_create_params.py mode change 100644 => 100755 src/runloop_api_client/types/blueprint_list_params.py mode change 100644 => 100755 src/runloop_api_client/types/blueprint_list_view.py mode change 100644 => 100755 src/runloop_api_client/types/blueprint_preview_params.py mode change 100644 => 100755 src/runloop_api_client/types/blueprint_preview_view.py mode change 100644 => 100755 src/runloop_api_client/types/blueprint_view.py mode change 100644 => 100755 src/runloop_api_client/types/code_mount_parameters.py mode change 100644 => 100755 src/runloop_api_client/types/code_mount_parameters_param.py mode change 100644 => 100755 src/runloop_api_client/types/devbox_create_params.py mode change 100644 => 100755 src/runloop_api_client/types/devbox_execute_sync_params.py mode change 100644 => 100755 src/runloop_api_client/types/devbox_execution_detail_view.py mode change 100644 => 100755 src/runloop_api_client/types/devbox_list_params.py mode change 100644 => 100755 src/runloop_api_client/types/devbox_list_view.py mode change 100644 => 100755 src/runloop_api_client/types/devbox_read_file_contents_params.py mode change 100644 => 100755 src/runloop_api_client/types/devbox_read_file_contents_response.py mode change 100644 => 100755 src/runloop_api_client/types/devbox_read_file_params.py mode change 100644 => 100755 src/runloop_api_client/types/devbox_upload_file_params.py mode change 100644 => 100755 src/runloop_api_client/types/devbox_view.py mode change 100644 => 100755 src/runloop_api_client/types/devbox_write_file_params.py mode change 100644 => 100755 src/runloop_api_client/types/devboxes/__init__.py mode change 100644 => 100755 src/runloop_api_client/types/devboxes/devbox_logs_list_view.py mode change 100644 => 100755 src/runloop_api_client/types/function_invoke_async_params.py mode change 100644 => 100755 src/runloop_api_client/types/function_invoke_sync_params.py mode change 100644 => 100755 src/runloop_api_client/types/function_list_view.py mode change 100644 => 100755 src/runloop_api_client/types/functions/__init__.py mode change 100644 => 100755 src/runloop_api_client/types/functions/function_invocation_list_view.py mode change 100644 => 100755 src/runloop_api_client/types/functions/invocation_list_params.py mode change 100644 => 100755 src/runloop_api_client/types/project_list_view.py mode change 100644 => 100755 src/runloop_api_client/types/projects/__init__.py mode change 100644 => 100755 src/runloop_api_client/types/resource_size.py mode change 100644 => 100755 src/runloop_api_client/types/shared/__init__.py mode change 100644 => 100755 src/runloop_api_client/types/shared/function_invocation_execution_detail_view.py mode change 100644 => 100755 src/runloop_api_client/types/shared/project_logs_view.py mode change 100644 => 100755 src/runloop_minus_api_minus_client/lib/.keep mode change 100644 => 100755 tests/__init__.py mode change 100644 => 100755 tests/api_resources/__init__.py mode change 100644 => 100755 tests/api_resources/devboxes/__init__.py mode change 100644 => 100755 tests/api_resources/devboxes/test_logs.py mode change 100644 => 100755 tests/api_resources/functions/__init__.py mode change 100644 => 100755 tests/api_resources/functions/test_invocations.py mode change 100644 => 100755 tests/api_resources/projects/__init__.py mode change 100644 => 100755 tests/api_resources/projects/test_logs.py mode change 100644 => 100755 tests/api_resources/test_blueprints.py mode change 100644 => 100755 tests/api_resources/test_devboxes.py mode change 100644 => 100755 tests/api_resources/test_functions.py mode change 100644 => 100755 tests/api_resources/test_projects.py mode change 100644 => 100755 tests/conftest.py mode change 100644 => 100755 tests/sample_file.txt mode change 100644 => 100755 tests/test_client.py mode change 100644 => 100755 tests/test_deepcopy.py mode change 100644 => 100755 tests/test_extract_files.py mode change 100644 => 100755 tests/test_files.py mode change 100644 => 100755 tests/test_models.py mode change 100644 => 100755 tests/test_qs.py mode change 100644 => 100755 tests/test_required_args.py mode change 100644 => 100755 tests/test_response.py mode change 100644 => 100755 tests/test_streaming.py mode change 100644 => 100755 tests/test_transform.py mode change 100644 => 100755 tests/test_utils/test_proxy.py mode change 100644 => 100755 tests/test_utils/test_typing.py mode change 100644 => 100755 tests/utils.py diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile old mode 100644 new mode 100755 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json old mode 100644 new mode 100755 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml old mode 100644 new mode 100755 diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml old mode 100644 new mode 100755 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml old mode 100644 new mode 100755 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.python-version b/.python-version old mode 100644 new mode 100755 diff --git a/.release-please-manifest.json b/.release-please-manifest.json old mode 100644 new mode 100755 diff --git a/.stats.yml b/.stats.yml old mode 100644 new mode 100755 index 0169fbd25..63c19c927 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 23 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ccdd2f1f86705a3cc4e40bc294ca94e0e761f22bc8487955fc2a663c046688b5.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3f659ccaa829c7a6faf6490c769ba6e36ccd3b82a85a05fc322860cc7226a3a1.yml diff --git a/Brewfile b/Brewfile old mode 100644 new mode 100755 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/SECURITY.md b/SECURITY.md old mode 100644 new mode 100755 diff --git a/api.md b/api.md old mode 100644 new mode 100755 diff --git a/bin/check-release-environment b/bin/check-release-environment old mode 100644 new mode 100755 diff --git a/bin/publish-pypi b/bin/publish-pypi old mode 100644 new mode 100755 diff --git a/examples/.keep b/examples/.keep old mode 100644 new mode 100755 diff --git a/mypy.ini b/mypy.ini old mode 100644 new mode 100755 diff --git a/noxfile.py b/noxfile.py old mode 100644 new mode 100755 diff --git a/pyproject.toml b/pyproject.toml old mode 100644 new mode 100755 diff --git a/release-please-config.json b/release-please-config.json old mode 100644 new mode 100755 diff --git a/requirements-dev.lock b/requirements-dev.lock old mode 100644 new mode 100755 diff --git a/requirements.lock b/requirements.lock old mode 100644 new mode 100755 diff --git a/scripts/utils/ruffen-docs.py b/scripts/utils/ruffen-docs.py old mode 100644 new mode 100755 diff --git a/src/runloop/lib/.keep b/src/runloop/lib/.keep old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/__init__.py b/src/runloop_api_client/__init__.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/_compat.py b/src/runloop_api_client/_compat.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/_constants.py b/src/runloop_api_client/_constants.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/_exceptions.py b/src/runloop_api_client/_exceptions.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/_files.py b/src/runloop_api_client/_files.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/_qs.py b/src/runloop_api_client/_qs.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/_resource.py b/src/runloop_api_client/_resource.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/_response.py b/src/runloop_api_client/_response.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/_streaming.py b/src/runloop_api_client/_streaming.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/_types.py b/src/runloop_api_client/_types.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/_utils/__init__.py b/src/runloop_api_client/_utils/__init__.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/_utils/_logs.py b/src/runloop_api_client/_utils/_logs.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/_utils/_proxy.py b/src/runloop_api_client/_utils/_proxy.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/_utils/_reflection.py b/src/runloop_api_client/_utils/_reflection.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/_utils/_streams.py b/src/runloop_api_client/_utils/_streams.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/_utils/_sync.py b/src/runloop_api_client/_utils/_sync.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/_utils/_transform.py b/src/runloop_api_client/_utils/_transform.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/_utils/_typing.py b/src/runloop_api_client/_utils/_typing.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/_utils/_utils.py b/src/runloop_api_client/_utils/_utils.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/lib/.keep b/src/runloop_api_client/lib/.keep old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/py.typed b/src/runloop_api_client/py.typed old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/resources/__init__.py b/src/runloop_api_client/resources/__init__.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/resources/devboxes/logs.py b/src/runloop_api_client/resources/devboxes/logs.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/resources/functions/__init__.py b/src/runloop_api_client/resources/functions/__init__.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/resources/functions/functions.py b/src/runloop_api_client/resources/functions/functions.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/resources/functions/invocations.py b/src/runloop_api_client/resources/functions/invocations.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/resources/projects/__init__.py b/src/runloop_api_client/resources/projects/__init__.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/resources/projects/logs.py b/src/runloop_api_client/resources/projects/logs.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/resources/projects/projects.py b/src/runloop_api_client/resources/projects/projects.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/blueprint_build_log.py b/src/runloop_api_client/types/blueprint_build_log.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/blueprint_build_logs_list_view.py b/src/runloop_api_client/types/blueprint_build_logs_list_view.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/blueprint_list_params.py b/src/runloop_api_client/types/blueprint_list_params.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/blueprint_list_view.py b/src/runloop_api_client/types/blueprint_list_view.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/blueprint_preview_view.py b/src/runloop_api_client/types/blueprint_preview_view.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/blueprint_view.py b/src/runloop_api_client/types/blueprint_view.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/code_mount_parameters.py b/src/runloop_api_client/types/code_mount_parameters.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/code_mount_parameters_param.py b/src/runloop_api_client/types/code_mount_parameters_param.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/devbox_execute_sync_params.py b/src/runloop_api_client/types/devbox_execute_sync_params.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/devbox_execution_detail_view.py b/src/runloop_api_client/types/devbox_execution_detail_view.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/devbox_list_params.py b/src/runloop_api_client/types/devbox_list_params.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/devbox_list_view.py b/src/runloop_api_client/types/devbox_list_view.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/devbox_read_file_contents_params.py b/src/runloop_api_client/types/devbox_read_file_contents_params.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/devbox_read_file_contents_response.py b/src/runloop_api_client/types/devbox_read_file_contents_response.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/devbox_read_file_params.py b/src/runloop_api_client/types/devbox_read_file_params.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/devbox_upload_file_params.py b/src/runloop_api_client/types/devbox_upload_file_params.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py old mode 100644 new mode 100755 index 724ce3372..e6799d3b6 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -21,6 +21,8 @@ class DevboxView(BaseModel): end_time_ms: Optional[int] = None """The time the Devbox finished execution (Unix timestamp milliseconds).""" + initializing_time_ms: Optional[int] = None + initiator_id: Optional[str] = None """The initiator ID of the devbox.""" @@ -30,5 +32,7 @@ class DevboxView(BaseModel): name: Optional[str] = None """The name of the Devbox.""" + running_time_ms: Optional[int] = None + status: Optional[Literal["provisioning", "initializing", "running", "failure", "shutdown"]] = None """The current status of the Devbox.""" diff --git a/src/runloop_api_client/types/devbox_write_file_params.py b/src/runloop_api_client/types/devbox_write_file_params.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/function_invoke_async_params.py b/src/runloop_api_client/types/function_invoke_async_params.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/function_invoke_sync_params.py b/src/runloop_api_client/types/function_invoke_sync_params.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/function_list_view.py b/src/runloop_api_client/types/function_list_view.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/functions/__init__.py b/src/runloop_api_client/types/functions/__init__.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/functions/function_invocation_list_view.py b/src/runloop_api_client/types/functions/function_invocation_list_view.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/functions/invocation_list_params.py b/src/runloop_api_client/types/functions/invocation_list_params.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/project_list_view.py b/src/runloop_api_client/types/project_list_view.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/projects/__init__.py b/src/runloop_api_client/types/projects/__init__.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/resource_size.py b/src/runloop_api_client/types/resource_size.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/shared/__init__.py b/src/runloop_api_client/types/shared/__init__.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/shared/function_invocation_execution_detail_view.py b/src/runloop_api_client/types/shared/function_invocation_execution_detail_view.py old mode 100644 new mode 100755 diff --git a/src/runloop_api_client/types/shared/project_logs_view.py b/src/runloop_api_client/types/shared/project_logs_view.py old mode 100644 new mode 100755 diff --git a/src/runloop_minus_api_minus_client/lib/.keep b/src/runloop_minus_api_minus_client/lib/.keep old mode 100644 new mode 100755 diff --git a/tests/__init__.py b/tests/__init__.py old mode 100644 new mode 100755 diff --git a/tests/api_resources/__init__.py b/tests/api_resources/__init__.py old mode 100644 new mode 100755 diff --git a/tests/api_resources/devboxes/__init__.py b/tests/api_resources/devboxes/__init__.py old mode 100644 new mode 100755 diff --git a/tests/api_resources/devboxes/test_logs.py b/tests/api_resources/devboxes/test_logs.py old mode 100644 new mode 100755 diff --git a/tests/api_resources/functions/__init__.py b/tests/api_resources/functions/__init__.py old mode 100644 new mode 100755 diff --git a/tests/api_resources/functions/test_invocations.py b/tests/api_resources/functions/test_invocations.py old mode 100644 new mode 100755 diff --git a/tests/api_resources/projects/__init__.py b/tests/api_resources/projects/__init__.py old mode 100644 new mode 100755 diff --git a/tests/api_resources/projects/test_logs.py b/tests/api_resources/projects/test_logs.py old mode 100644 new mode 100755 diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py old mode 100644 new mode 100755 diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py old mode 100644 new mode 100755 diff --git a/tests/api_resources/test_functions.py b/tests/api_resources/test_functions.py old mode 100644 new mode 100755 diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py old mode 100644 new mode 100755 diff --git a/tests/conftest.py b/tests/conftest.py old mode 100644 new mode 100755 diff --git a/tests/sample_file.txt b/tests/sample_file.txt old mode 100644 new mode 100755 diff --git a/tests/test_client.py b/tests/test_client.py old mode 100644 new mode 100755 diff --git a/tests/test_deepcopy.py b/tests/test_deepcopy.py old mode 100644 new mode 100755 diff --git a/tests/test_extract_files.py b/tests/test_extract_files.py old mode 100644 new mode 100755 diff --git a/tests/test_files.py b/tests/test_files.py old mode 100644 new mode 100755 diff --git a/tests/test_models.py b/tests/test_models.py old mode 100644 new mode 100755 diff --git a/tests/test_qs.py b/tests/test_qs.py old mode 100644 new mode 100755 diff --git a/tests/test_required_args.py b/tests/test_required_args.py old mode 100644 new mode 100755 diff --git a/tests/test_response.py b/tests/test_response.py old mode 100644 new mode 100755 diff --git a/tests/test_streaming.py b/tests/test_streaming.py old mode 100644 new mode 100755 diff --git a/tests/test_transform.py b/tests/test_transform.py old mode 100644 new mode 100755 diff --git a/tests/test_utils/test_proxy.py b/tests/test_utils/test_proxy.py old mode 100644 new mode 100755 diff --git a/tests/test_utils/test_typing.py b/tests/test_utils/test_typing.py old mode 100644 new mode 100755 diff --git a/tests/utils.py b/tests/utils.py old mode 100644 new mode 100755 From acb65fcee1ed8c7f704753c833a59e0ff2308085 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 14:21:52 +0000 Subject: [PATCH 098/993] chore(client): fix parsing union responses when non-json is returned (#108) --- src/runloop_api_client/_models.py | 2 ++ tests/test_response.py | 39 ++++++++++++++++++++++++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index 5148d5a7b..d386eaa3a 100755 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -380,6 +380,8 @@ def is_basemodel(type_: type) -> bool: def is_basemodel_type(type_: type) -> TypeGuard[type[BaseModel] | type[GenericModel]]: origin = get_origin(type_) or type_ + if not inspect.isclass(origin): + return False return issubclass(origin, BaseModel) or issubclass(origin, GenericModel) diff --git a/tests/test_response.py b/tests/test_response.py index d24372998..849a519e5 100755 --- a/tests/test_response.py +++ b/tests/test_response.py @@ -1,5 +1,5 @@ import json -from typing import List, cast +from typing import Any, List, Union, cast from typing_extensions import Annotated import httpx @@ -188,3 +188,40 @@ async def test_async_response_parse_annotated_type(async_client: AsyncRunloop) - ) assert obj.foo == "hello!" assert obj.bar == 2 + + +class OtherModel(BaseModel): + a: str + + +@pytest.mark.parametrize("client", [False], indirect=True) # loose validation +def test_response_parse_expect_model_union_non_json_content(client: Runloop) -> None: + response = APIResponse( + raw=httpx.Response(200, content=b"foo", headers={"Content-Type": "application/text"}), + client=client, + stream=False, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + obj = response.parse(to=cast(Any, Union[CustomModel, OtherModel])) + assert isinstance(obj, str) + assert obj == "foo" + + +@pytest.mark.asyncio +@pytest.mark.parametrize("async_client", [False], indirect=True) # loose validation +async def test_async_response_parse_expect_model_union_non_json_content(async_client: AsyncRunloop) -> None: + response = AsyncAPIResponse( + raw=httpx.Response(200, content=b"foo", headers={"Content-Type": "application/text"}), + client=async_client, + stream=False, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + obj = await response.parse(to=cast(Any, Union[CustomModel, OtherModel])) + assert isinstance(obj, str) + assert obj == "foo" From 37a8e6b1b2b7270f6286a8e24660076f01ce7896 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 14:24:23 +0000 Subject: [PATCH 099/993] chore(ci): also run pydantic v1 tests (#109) --- scripts/test | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/test b/scripts/test index b3ace9013..4fa5698b8 100755 --- a/scripts/test +++ b/scripts/test @@ -54,3 +54,6 @@ fi echo "==> Running tests" rye run pytest "$@" + +echo "==> Running Pydantic v1 tests" +rye run nox -s test-pydantic-v1 -- "$@" From c3ca805fc88c6da23646af863b171a51a9918c72 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 17:12:31 +0000 Subject: [PATCH 100/993] feat(api): OpenAPI spec update via Stainless API (#110) --- .stats.yml | 4 +- api.md | 1 - .../resources/devboxes/devboxes.py | 87 ------------------ src/runloop_api_client/types/__init__.py | 1 - tests/api_resources/test_devboxes.py | 92 ------------------- 5 files changed, 2 insertions(+), 183 deletions(-) diff --git a/.stats.yml b/.stats.yml index 63c19c927..460cc3629 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 23 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3f659ccaa829c7a6faf6490c769ba6e36ccd3b82a85a05fc322860cc7226a3a1.yml +configured_endpoints: 22 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-95846c0922aedc237ffe0f2bee0a67a93f64e4dc85b4028a50b835de3d5b6295.yml diff --git a/api.md b/api.md index 6f52516ae..292241006 100755 --- a/api.md +++ b/api.md @@ -63,7 +63,6 @@ Methods: - client.devboxes.retrieve(id) -> DevboxView - client.devboxes.list(\*\*params) -> DevboxListView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView -- client.devboxes.read_file(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.read_file_contents(id, \*\*params) -> str - client.devboxes.shutdown(id) -> DevboxView - client.devboxes.upload_file(id, \*\*params) -> object diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9bdd4b784..6d499f25c 100755 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -17,7 +17,6 @@ from ...types import ( devbox_list_params, devbox_create_params, - devbox_read_file_params, devbox_write_file_params, devbox_upload_file_params, devbox_execute_sync_params, @@ -257,43 +256,6 @@ def execute_sync( cast_to=DevboxExecutionDetailView, ) - def read_file( - self, - id: str, - *, - file_path: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxExecutionDetailView: - """ - Read file contents from a file on given Devbox. - - Args: - file_path: The path of the file to read. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/read_file", - body=maybe_transform({"file_path": file_path}, devbox_read_file_params.DevboxReadFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DevboxExecutionDetailView, - ) - def read_file_contents( self, id: str, @@ -674,43 +636,6 @@ async def execute_sync( cast_to=DevboxExecutionDetailView, ) - async def read_file( - self, - id: str, - *, - file_path: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxExecutionDetailView: - """ - Read file contents from a file on given Devbox. - - Args: - file_path: The path of the file to read. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/read_file", - body=await async_maybe_transform({"file_path": file_path}, devbox_read_file_params.DevboxReadFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DevboxExecutionDetailView, - ) - async def read_file_contents( self, id: str, @@ -896,9 +821,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.execute_sync = to_raw_response_wrapper( devboxes.execute_sync, ) - self.read_file = to_raw_response_wrapper( - devboxes.read_file, - ) self.read_file_contents = to_raw_response_wrapper( devboxes.read_file_contents, ) @@ -933,9 +855,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.execute_sync = async_to_raw_response_wrapper( devboxes.execute_sync, ) - self.read_file = async_to_raw_response_wrapper( - devboxes.read_file, - ) self.read_file_contents = async_to_raw_response_wrapper( devboxes.read_file_contents, ) @@ -970,9 +889,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.execute_sync = to_streamed_response_wrapper( devboxes.execute_sync, ) - self.read_file = to_streamed_response_wrapper( - devboxes.read_file, - ) self.read_file_contents = to_streamed_response_wrapper( devboxes.read_file_contents, ) @@ -1007,9 +923,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.execute_sync = async_to_streamed_response_wrapper( devboxes.execute_sync, ) - self.read_file = async_to_streamed_response_wrapper( - devboxes.read_file, - ) self.read_file_contents = async_to_streamed_response_wrapper( devboxes.read_file_contents, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 616342b9e..5817fab7d 100755 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -20,7 +20,6 @@ from .code_mount_parameters import CodeMountParameters as CodeMountParameters from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams -from .devbox_read_file_params import DevboxReadFileParams as DevboxReadFileParams from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams from .devbox_write_file_params import DevboxWriteFileParams as DevboxWriteFileParams from .devbox_upload_file_params import DevboxUploadFileParams as DevboxUploadFileParams diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 5edb2c25e..817ee36a9 100755 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -182,52 +182,6 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: id="", ) - @parametrize - def test_method_read_file(self, client: Runloop) -> None: - devbox = client.devboxes.read_file( - id="id", - ) - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - - @parametrize - def test_method_read_file_with_all_params(self, client: Runloop) -> None: - devbox = client.devboxes.read_file( - id="id", - file_path="file_path", - ) - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - - @parametrize - def test_raw_response_read_file(self, client: Runloop) -> None: - response = client.devboxes.with_raw_response.read_file( - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - devbox = response.parse() - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - - @parametrize - def test_streaming_response_read_file(self, client: Runloop) -> None: - with client.devboxes.with_streaming_response.read_file( - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - devbox = response.parse() - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_read_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.with_raw_response.read_file( - id="", - ) - @parametrize def test_method_read_file_contents(self, client: Runloop) -> None: devbox = client.devboxes.read_file_contents( @@ -571,52 +525,6 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non id="", ) - @parametrize - async def test_method_read_file(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.read_file( - id="id", - ) - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - - @parametrize - async def test_method_read_file_with_all_params(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.read_file( - id="id", - file_path="file_path", - ) - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - - @parametrize - async def test_raw_response_read_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.with_raw_response.read_file( - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - devbox = await response.parse() - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - - @parametrize - async def test_streaming_response_read_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.with_streaming_response.read_file( - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - devbox = await response.parse() - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_read_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.with_raw_response.read_file( - id="", - ) - @parametrize async def test_method_read_file_contents(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.read_file_contents( From 8037f20ac7c750ff971f3ebaf5d58d6bc6ca45e3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 20:16:21 +0000 Subject: [PATCH 101/993] feat(api): OpenAPI spec update via Stainless API (#111) --- .stats.yml | 2 +- src/runloop_api_client/types/devbox_view.py | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index 460cc3629..ab5cdaf23 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-95846c0922aedc237ffe0f2bee0a67a93f64e4dc85b4028a50b835de3d5b6295.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f290dcd103e3a6d5650256bea5942db1508e0dd85e76483242c5556aace4ae48.yml diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index e6799d3b6..724ce3372 100755 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -21,8 +21,6 @@ class DevboxView(BaseModel): end_time_ms: Optional[int] = None """The time the Devbox finished execution (Unix timestamp milliseconds).""" - initializing_time_ms: Optional[int] = None - initiator_id: Optional[str] = None """The initiator ID of the devbox.""" @@ -32,7 +30,5 @@ class DevboxView(BaseModel): name: Optional[str] = None """The name of the Devbox.""" - running_time_ms: Optional[int] = None - status: Optional[Literal["provisioning", "initializing", "running", "failure", "shutdown"]] = None """The current status of the Devbox.""" From ea77a8a9dbffc112ab9479bd1ba333770bbc0b82 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 21 Aug 2024 16:01:24 +0000 Subject: [PATCH 102/993] feat(api): OpenAPI spec update via Stainless API (#112) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 8 ++++++++ src/runloop_api_client/types/devbox_create_params.py | 3 +++ src/runloop_api_client/types/devbox_view.py | 5 ++++- tests/api_resources/test_devboxes.py | 2 ++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ab5cdaf23..b2ff6aad1 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f290dcd103e3a6d5650256bea5942db1508e0dd85e76483242c5556aace4ae48.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6577301ad49bd3086f3dd9cb0848407834eaf00a58446772426f7186b6ba582b.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 6d499f25c..7b1c0388d 100755 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -67,6 +67,7 @@ def create( environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, launch_parameters: devbox_create_params.LaunchParameters | NotGiven = NOT_GIVEN, + metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -98,6 +99,8 @@ def create( launch_parameters: Parameters to configure the resources and launch time behavior of the Devbox. + metadata: User defined metadata to attach to the devbox for organization. + name: (Optional) A user specified name to give the Devbox. setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include @@ -122,6 +125,7 @@ def create( "environment_variables": environment_variables, "file_mounts": file_mounts, "launch_parameters": launch_parameters, + "metadata": metadata, "name": name, "setup_commands": setup_commands, }, @@ -447,6 +451,7 @@ async def create( environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, launch_parameters: devbox_create_params.LaunchParameters | NotGiven = NOT_GIVEN, + metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -478,6 +483,8 @@ async def create( launch_parameters: Parameters to configure the resources and launch time behavior of the Devbox. + metadata: User defined metadata to attach to the devbox for organization. + name: (Optional) A user specified name to give the Devbox. setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include @@ -502,6 +509,7 @@ async def create( "environment_variables": environment_variables, "file_mounts": file_mounts, "launch_parameters": launch_parameters, + "metadata": metadata, "name": name, "setup_commands": setup_commands, }, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 80cd31ef3..61bb1453a 100755 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -40,6 +40,9 @@ class DevboxCreateParams(TypedDict, total=False): launch_parameters: LaunchParameters """Parameters to configure the resources and launch time behavior of the Devbox.""" + metadata: Dict[str, str] + """User defined metadata to attach to the devbox for organization.""" + name: str """(Optional) A user specified name to give the Devbox.""" diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 724ce3372..71eb25578 100755 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import Dict, Optional from typing_extensions import Literal from .._models import BaseModel @@ -27,6 +27,9 @@ class DevboxView(BaseModel): initiator_type: Optional[Literal["unknown", "api", "invocation"]] = None """The initiator of the devbox.""" + metadata: Optional[Dict[str, str]] = None + """The user defined Devbox metadata.""" + name: Optional[str] = None """The name of the Devbox.""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 817ee36a9..1024eb26f 100755 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -39,6 +39,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "launch_commands": ["string", "string", "string"], "resource_size_request": "MINI", }, + metadata={"foo": "string"}, name="name", setup_commands=["string", "string", "string"], ) @@ -382,6 +383,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "launch_commands": ["string", "string", "string"], "resource_size_request": "MINI", }, + metadata={"foo": "string"}, name="name", setup_commands=["string", "string", "string"], ) From 2874c8c0820a3854aaf6367b365e409206fa4ba3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 21 Aug 2024 16:16:06 +0000 Subject: [PATCH 103/993] feat(api): OpenAPI spec update via Stainless API (#113) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 8 -------- src/runloop_api_client/types/devbox_create_params.py | 3 --- src/runloop_api_client/types/devbox_view.py | 5 +---- tests/api_resources/test_devboxes.py | 2 -- 5 files changed, 2 insertions(+), 18 deletions(-) diff --git a/.stats.yml b/.stats.yml index b2ff6aad1..ab5cdaf23 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6577301ad49bd3086f3dd9cb0848407834eaf00a58446772426f7186b6ba582b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f290dcd103e3a6d5650256bea5942db1508e0dd85e76483242c5556aace4ae48.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 7b1c0388d..6d499f25c 100755 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -67,7 +67,6 @@ def create( environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, launch_parameters: devbox_create_params.LaunchParameters | NotGiven = NOT_GIVEN, - metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -99,8 +98,6 @@ def create( launch_parameters: Parameters to configure the resources and launch time behavior of the Devbox. - metadata: User defined metadata to attach to the devbox for organization. - name: (Optional) A user specified name to give the Devbox. setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include @@ -125,7 +122,6 @@ def create( "environment_variables": environment_variables, "file_mounts": file_mounts, "launch_parameters": launch_parameters, - "metadata": metadata, "name": name, "setup_commands": setup_commands, }, @@ -451,7 +447,6 @@ async def create( environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, launch_parameters: devbox_create_params.LaunchParameters | NotGiven = NOT_GIVEN, - metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -483,8 +478,6 @@ async def create( launch_parameters: Parameters to configure the resources and launch time behavior of the Devbox. - metadata: User defined metadata to attach to the devbox for organization. - name: (Optional) A user specified name to give the Devbox. setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include @@ -509,7 +502,6 @@ async def create( "environment_variables": environment_variables, "file_mounts": file_mounts, "launch_parameters": launch_parameters, - "metadata": metadata, "name": name, "setup_commands": setup_commands, }, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 61bb1453a..80cd31ef3 100755 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -40,9 +40,6 @@ class DevboxCreateParams(TypedDict, total=False): launch_parameters: LaunchParameters """Parameters to configure the resources and launch time behavior of the Devbox.""" - metadata: Dict[str, str] - """User defined metadata to attach to the devbox for organization.""" - name: str """(Optional) A user specified name to give the Devbox.""" diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 71eb25578..724ce3372 100755 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Optional +from typing import Optional from typing_extensions import Literal from .._models import BaseModel @@ -27,9 +27,6 @@ class DevboxView(BaseModel): initiator_type: Optional[Literal["unknown", "api", "invocation"]] = None """The initiator of the devbox.""" - metadata: Optional[Dict[str, str]] = None - """The user defined Devbox metadata.""" - name: Optional[str] = None """The name of the Devbox.""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 1024eb26f..817ee36a9 100755 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -39,7 +39,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "launch_commands": ["string", "string", "string"], "resource_size_request": "MINI", }, - metadata={"foo": "string"}, name="name", setup_commands=["string", "string", "string"], ) @@ -383,7 +382,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "launch_commands": ["string", "string", "string"], "resource_size_request": "MINI", }, - metadata={"foo": "string"}, name="name", setup_commands=["string", "string", "string"], ) From 1744c3ef812995feb69d340c0f35a0b3b455965f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 21 Aug 2024 17:16:07 +0000 Subject: [PATCH 104/993] feat(api): OpenAPI spec update via Stainless API (#114) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 8 ++++++++ src/runloop_api_client/types/devbox_create_params.py | 3 +++ src/runloop_api_client/types/devbox_view.py | 5 ++++- tests/api_resources/test_devboxes.py | 2 ++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ab5cdaf23..2348db72a 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f290dcd103e3a6d5650256bea5942db1508e0dd85e76483242c5556aace4ae48.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1c1bf5490aff934a873ef7096637f99ce5fa15518a41bb2bfa5cbf46317da3f1.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 6d499f25c..7b1c0388d 100755 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -67,6 +67,7 @@ def create( environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, launch_parameters: devbox_create_params.LaunchParameters | NotGiven = NOT_GIVEN, + metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -98,6 +99,8 @@ def create( launch_parameters: Parameters to configure the resources and launch time behavior of the Devbox. + metadata: User defined metadata to attach to the devbox for organization. + name: (Optional) A user specified name to give the Devbox. setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include @@ -122,6 +125,7 @@ def create( "environment_variables": environment_variables, "file_mounts": file_mounts, "launch_parameters": launch_parameters, + "metadata": metadata, "name": name, "setup_commands": setup_commands, }, @@ -447,6 +451,7 @@ async def create( environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, launch_parameters: devbox_create_params.LaunchParameters | NotGiven = NOT_GIVEN, + metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -478,6 +483,8 @@ async def create( launch_parameters: Parameters to configure the resources and launch time behavior of the Devbox. + metadata: User defined metadata to attach to the devbox for organization. + name: (Optional) A user specified name to give the Devbox. setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include @@ -502,6 +509,7 @@ async def create( "environment_variables": environment_variables, "file_mounts": file_mounts, "launch_parameters": launch_parameters, + "metadata": metadata, "name": name, "setup_commands": setup_commands, }, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 80cd31ef3..61bb1453a 100755 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -40,6 +40,9 @@ class DevboxCreateParams(TypedDict, total=False): launch_parameters: LaunchParameters """Parameters to configure the resources and launch time behavior of the Devbox.""" + metadata: Dict[str, str] + """User defined metadata to attach to the devbox for organization.""" + name: str """(Optional) A user specified name to give the Devbox.""" diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 724ce3372..71eb25578 100755 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import Dict, Optional from typing_extensions import Literal from .._models import BaseModel @@ -27,6 +27,9 @@ class DevboxView(BaseModel): initiator_type: Optional[Literal["unknown", "api", "invocation"]] = None """The initiator of the devbox.""" + metadata: Optional[Dict[str, str]] = None + """The user defined Devbox metadata.""" + name: Optional[str] = None """The name of the Devbox.""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 817ee36a9..1024eb26f 100755 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -39,6 +39,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "launch_commands": ["string", "string", "string"], "resource_size_request": "MINI", }, + metadata={"foo": "string"}, name="name", setup_commands=["string", "string", "string"], ) @@ -382,6 +383,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "launch_commands": ["string", "string", "string"], "resource_size_request": "MINI", }, + metadata={"foo": "string"}, name="name", setup_commands=["string", "string", "string"], ) From e9ae45fbbad5ad47bba6efa3d8dd62ce2e3a0747 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 22 Aug 2024 00:17:20 +0000 Subject: [PATCH 105/993] feat(api): OpenAPI spec update via Stainless API (#115) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2348db72a..cd6612ae1 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1c1bf5490aff934a873ef7096637f99ce5fa15518a41bb2bfa5cbf46317da3f1.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8c7e1b2377a7a76ebd891bda5df65c28f1574bae085e0460b8f614811bb193fe.yml From e5b9e65f64b21cdff9a965ecef443c37f02bfa76 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 23 Aug 2024 20:48:59 +0000 Subject: [PATCH 106/993] feat(api): manual updates (#117) --- .release-please-manifest.json | 2 +- .stats.yml | 4 +- README.md | 2 +- api.md | 64 +- pyproject.toml | 2 +- src/runloop_api_client/_client.py | 8 + src/runloop_api_client/_constants.py | 6 +- src/runloop_api_client/_version.py | 2 +- src/runloop_api_client/resources/__init__.py | 14 + .../resources/deployments.py | 488 ++++++++++++++ .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 213 +++++- .../resources/devboxes/executions.py | 598 +++++++++++++++++ .../resources/devboxes/logs.py | 88 ++- .../resources/functions/functions.py | 50 ++ .../resources/functions/invocations.py | 79 +++ src/runloop_api_client/types/__init__.py | 11 +- .../types/deployment_get_params.py | 15 + .../types/deployment_get_response.py | 59 ++ .../types/deployment_logs_response.py | 26 + .../types/deployment_redeploy_response.py | 50 ++ .../types/deployment_retrieve_response.py | 50 ++ .../types/deployment_tail_response.py | 26 + .../types/devbox_create_ssh_key_response.py | 18 + .../types/devbox_execute_async_params.py | 12 + .../types/devbox_list_response.py | 17 + src/runloop_api_client/types/devbox_view.py | 3 + .../types/devboxes/__init__.py | 5 + .../devbox_async_execution_detail_view.py | 37 ++ .../devboxes/devbox_execution_detail_view.py | 21 + .../execution_execute_async_params.py | 12 + .../devboxes/execution_execute_sync_params.py | 12 + .../devboxes/execution_retrieve_params.py | 14 + .../types/functions/__init__.py | 1 + .../functions/invocation_logs_response.py | 26 + .../api_resources/devboxes/test_executions.py | 612 ++++++++++++++++++ tests/api_resources/devboxes/test_logs.py | 76 +++ .../functions/test_invocations.py | 81 ++- tests/api_resources/test_deployments.py | 398 ++++++++++++ tests/api_resources/test_devboxes.py | 189 +++++- tests/api_resources/test_functions.py | 50 ++ tests/test_client.py | 52 +- 42 files changed, 3443 insertions(+), 64 deletions(-) create mode 100755 src/runloop_api_client/resources/deployments.py create mode 100755 src/runloop_api_client/resources/devboxes/executions.py create mode 100755 src/runloop_api_client/types/deployment_get_params.py create mode 100755 src/runloop_api_client/types/deployment_get_response.py create mode 100755 src/runloop_api_client/types/deployment_logs_response.py create mode 100755 src/runloop_api_client/types/deployment_redeploy_response.py create mode 100755 src/runloop_api_client/types/deployment_retrieve_response.py create mode 100755 src/runloop_api_client/types/deployment_tail_response.py create mode 100755 src/runloop_api_client/types/devbox_create_ssh_key_response.py create mode 100755 src/runloop_api_client/types/devbox_execute_async_params.py create mode 100755 src/runloop_api_client/types/devbox_list_response.py create mode 100755 src/runloop_api_client/types/devboxes/devbox_async_execution_detail_view.py create mode 100755 src/runloop_api_client/types/devboxes/devbox_execution_detail_view.py create mode 100755 src/runloop_api_client/types/devboxes/execution_execute_async_params.py create mode 100755 src/runloop_api_client/types/devboxes/execution_execute_sync_params.py create mode 100755 src/runloop_api_client/types/devboxes/execution_retrieve_params.py create mode 100755 src/runloop_api_client/types/functions/invocation_logs_response.py create mode 100755 tests/api_resources/devboxes/test_executions.py create mode 100755 tests/api_resources/test_deployments.py diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 000572ece..b0699969f 100755 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.13" + ".": "0.1.0-alpha.14" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index cd6612ae1..41b5ab409 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 22 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8c7e1b2377a7a76ebd891bda5df65c28f1574bae085e0460b8f614811bb193fe.yml +configured_endpoints: 36 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ea589851f2dbba35fea6c010ac4c577cad56aa44e1d5bd4e5b472c802b2f13c4.yml diff --git a/README.md b/README.md index c30cc313a..8dc4c7e51 100755 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ Error codes are as followed: ### Retries -Certain errors are automatically retried 0 times by default, with a short exponential backoff. +Certain errors are automatically retried 2 times by default, with a short exponential backoff. Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors are all retried by default. diff --git a/api.md b/api.md index 292241006..ba23ae8ae 100755 --- a/api.md +++ b/api.md @@ -43,15 +43,37 @@ Types: from runloop_api_client.types import CodeMountParameters ``` +# Deployments + +Types: + +```python +from runloop_api_client.types import ( + DeploymentRetrieveResponse, + DeploymentGetResponse, + DeploymentLogsResponse, + DeploymentRedeployResponse, + DeploymentTailResponse, +) +``` + +Methods: + +- client.deployments.retrieve(deployment_id) -> DeploymentRetrieveResponse +- client.deployments.get(\*\*params) -> DeploymentGetResponse +- client.deployments.logs(deployment_id) -> DeploymentLogsResponse +- client.deployments.redeploy(deployment_id) -> DeploymentRedeployResponse +- client.deployments.tail(deployment_id) -> DeploymentTailResponse + # Devboxes Types: ```python from runloop_api_client.types import ( - DevboxExecutionDetailView, - DevboxListView, DevboxView, + DevboxListResponse, + DevboxCreateSSHKeyResponse, DevboxReadFileContentsResponse, DevboxUploadFileResponse, ) @@ -61,31 +83,49 @@ Methods: - client.devboxes.create(\*\*params) -> DevboxView - client.devboxes.retrieve(id) -> DevboxView -- client.devboxes.list(\*\*params) -> DevboxListView -- client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView +- client.devboxes.list(\*\*params) -> DevboxListResponse +- client.devboxes.create_ssh_key(id) -> DevboxCreateSSHKeyResponse +- client.devboxes.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView +- client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.read_file_contents(id, \*\*params) -> str - client.devboxes.shutdown(id) -> DevboxView - client.devboxes.upload_file(id, \*\*params) -> object -- client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +- client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView ## Logs +Methods: + +- client.devboxes.logs.list(id) -> DevboxLogsListView +- client.devboxes.logs.tail(id) -> None + +## Executions + Types: ```python -from runloop_api_client.types.devboxes import DevboxLogsListView +from runloop_api_client.types.devboxes import ( + DevboxAsyncExecutionDetailView, + DevboxExecutionDetailView, + DevboxLogsListView, +) ``` Methods: -- client.devboxes.logs.list(id) -> DevboxLogsListView +- client.devboxes.executions.retrieve(exe_id, \*, id, \*\*params) -> DevboxAsyncExecutionDetailView +- client.devboxes.executions.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView +- client.devboxes.executions.execute_sync(id, \*\*params) -> DevboxExecutionDetailView +- client.devboxes.executions.kill(exe_id, \*, id) -> DevboxAsyncExecutionDetailView +- client.devboxes.executions.logs(execution_id, \*, id) -> DevboxLogsListView +- client.devboxes.executions.tail(execution_id, \*, id) -> None # Functions Types: ```python -from runloop_api_client.types import FunctionListView +from runloop_api_client.types import FunctionListView, FunctionListOpenAPIResponse ``` Methods: @@ -93,13 +133,18 @@ Methods: - client.functions.list() -> FunctionListView - client.functions.invoke_async(function_name, \*, project_name, \*\*params) -> FunctionInvocationExecutionDetailView - client.functions.invoke_sync(function_name, \*, project_name, \*\*params) -> FunctionInvocationExecutionDetailView +- client.functions.list_openapi() -> object ## Invocations Types: ```python -from runloop_api_client.types.functions import FunctionInvocationListView, KillOperationResponse +from runloop_api_client.types.functions import ( + FunctionInvocationListView, + KillOperationResponse, + InvocationLogsResponse, +) ``` Methods: @@ -107,6 +152,7 @@ Methods: - client.functions.invocations.retrieve(invocation_id) -> FunctionInvocationExecutionDetailView - client.functions.invocations.list(\*\*params) -> FunctionInvocationListView - client.functions.invocations.kill(invocation_id) -> object +- client.functions.invocations.logs(invocation_id) -> InvocationLogsResponse # Projects diff --git a/pyproject.toml b/pyproject.toml index cdeb9d124..22380a1af 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.1.0-alpha.13" +version = "0.1.0-alpha.14" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index 1609aebcc..f173ecd62 100755 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -47,6 +47,7 @@ class Runloop(SyncAPIClient): blueprints: resources.BlueprintsResource + deployments: resources.DeploymentsResource devboxes: resources.DevboxesResource functions: resources.FunctionsResource projects: resources.ProjectsResource @@ -108,6 +109,7 @@ def __init__( ) self.blueprints = resources.BlueprintsResource(self) + self.deployments = resources.DeploymentsResource(self) self.devboxes = resources.DevboxesResource(self) self.functions = resources.FunctionsResource(self) self.projects = resources.ProjectsResource(self) @@ -221,6 +223,7 @@ def _make_status_error( class AsyncRunloop(AsyncAPIClient): blueprints: resources.AsyncBlueprintsResource + deployments: resources.AsyncDeploymentsResource devboxes: resources.AsyncDevboxesResource functions: resources.AsyncFunctionsResource projects: resources.AsyncProjectsResource @@ -282,6 +285,7 @@ def __init__( ) self.blueprints = resources.AsyncBlueprintsResource(self) + self.deployments = resources.AsyncDeploymentsResource(self) self.devboxes = resources.AsyncDevboxesResource(self) self.functions = resources.AsyncFunctionsResource(self) self.projects = resources.AsyncProjectsResource(self) @@ -396,6 +400,7 @@ def _make_status_error( class RunloopWithRawResponse: def __init__(self, client: Runloop) -> None: self.blueprints = resources.BlueprintsResourceWithRawResponse(client.blueprints) + self.deployments = resources.DeploymentsResourceWithRawResponse(client.deployments) self.devboxes = resources.DevboxesResourceWithRawResponse(client.devboxes) self.functions = resources.FunctionsResourceWithRawResponse(client.functions) self.projects = resources.ProjectsResourceWithRawResponse(client.projects) @@ -404,6 +409,7 @@ def __init__(self, client: Runloop) -> None: class AsyncRunloopWithRawResponse: def __init__(self, client: AsyncRunloop) -> None: self.blueprints = resources.AsyncBlueprintsResourceWithRawResponse(client.blueprints) + self.deployments = resources.AsyncDeploymentsResourceWithRawResponse(client.deployments) self.devboxes = resources.AsyncDevboxesResourceWithRawResponse(client.devboxes) self.functions = resources.AsyncFunctionsResourceWithRawResponse(client.functions) self.projects = resources.AsyncProjectsResourceWithRawResponse(client.projects) @@ -412,6 +418,7 @@ def __init__(self, client: AsyncRunloop) -> None: class RunloopWithStreamedResponse: def __init__(self, client: Runloop) -> None: self.blueprints = resources.BlueprintsResourceWithStreamingResponse(client.blueprints) + self.deployments = resources.DeploymentsResourceWithStreamingResponse(client.deployments) self.devboxes = resources.DevboxesResourceWithStreamingResponse(client.devboxes) self.functions = resources.FunctionsResourceWithStreamingResponse(client.functions) self.projects = resources.ProjectsResourceWithStreamingResponse(client.projects) @@ -420,6 +427,7 @@ def __init__(self, client: Runloop) -> None: class AsyncRunloopWithStreamedResponse: def __init__(self, client: AsyncRunloop) -> None: self.blueprints = resources.AsyncBlueprintsResourceWithStreamingResponse(client.blueprints) + self.deployments = resources.AsyncDeploymentsResourceWithStreamingResponse(client.deployments) self.devboxes = resources.AsyncDevboxesResourceWithStreamingResponse(client.devboxes) self.functions = resources.AsyncFunctionsResourceWithStreamingResponse(client.functions) self.projects = resources.AsyncProjectsResourceWithStreamingResponse(client.projects) diff --git a/src/runloop_api_client/_constants.py b/src/runloop_api_client/_constants.py index 8e36fea12..a2ac3b6f3 100755 --- a/src/runloop_api_client/_constants.py +++ b/src/runloop_api_client/_constants.py @@ -7,8 +7,8 @@ # default timeout is 1 minute DEFAULT_TIMEOUT = httpx.Timeout(timeout=60.0, connect=5.0) -DEFAULT_MAX_RETRIES = 0 +DEFAULT_MAX_RETRIES = 2 DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20) -INITIAL_RETRY_DELAY = 1.0 -MAX_RETRY_DELAY = 5.0 +INITIAL_RETRY_DELAY = 0.5 +MAX_RETRY_DELAY = 8.0 diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index afe22f572..70a399d94 100755 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.1.0-alpha.13" # x-release-please-version +__version__ = "0.1.0-alpha.14" # x-release-please-version diff --git a/src/runloop_api_client/resources/__init__.py b/src/runloop_api_client/resources/__init__.py index f36499829..e26ff0410 100755 --- a/src/runloop_api_client/resources/__init__.py +++ b/src/runloop_api_client/resources/__init__.py @@ -32,6 +32,14 @@ BlueprintsResourceWithStreamingResponse, AsyncBlueprintsResourceWithStreamingResponse, ) +from .deployments import ( + DeploymentsResource, + AsyncDeploymentsResource, + DeploymentsResourceWithRawResponse, + AsyncDeploymentsResourceWithRawResponse, + DeploymentsResourceWithStreamingResponse, + AsyncDeploymentsResourceWithStreamingResponse, +) __all__ = [ "BlueprintsResource", @@ -40,6 +48,12 @@ "AsyncBlueprintsResourceWithRawResponse", "BlueprintsResourceWithStreamingResponse", "AsyncBlueprintsResourceWithStreamingResponse", + "DeploymentsResource", + "AsyncDeploymentsResource", + "DeploymentsResourceWithRawResponse", + "AsyncDeploymentsResourceWithRawResponse", + "DeploymentsResourceWithStreamingResponse", + "AsyncDeploymentsResourceWithStreamingResponse", "DevboxesResource", "AsyncDevboxesResource", "DevboxesResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/deployments.py b/src/runloop_api_client/resources/deployments.py new file mode 100755 index 000000000..70abbe237 --- /dev/null +++ b/src/runloop_api_client/resources/deployments.py @@ -0,0 +1,488 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..types import deployment_get_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + maybe_transform, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.deployment_get_response import DeploymentGetResponse +from ..types.deployment_logs_response import DeploymentLogsResponse +from ..types.deployment_tail_response import DeploymentTailResponse +from ..types.deployment_redeploy_response import DeploymentRedeployResponse +from ..types.deployment_retrieve_response import DeploymentRetrieveResponse + +__all__ = ["DeploymentsResource", "AsyncDeploymentsResource"] + + +class DeploymentsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> DeploymentsResourceWithRawResponse: + return DeploymentsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> DeploymentsResourceWithStreamingResponse: + return DeploymentsResourceWithStreamingResponse(self) + + def retrieve( + self, + deployment_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DeploymentRetrieveResponse: + """ + Get details of a deployment + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not deployment_id: + raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") + return self._get( + f"/v1/deployments/{deployment_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DeploymentRetrieveResponse, + ) + + def get( + self, + *, + limit: str | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DeploymentGetResponse: + """ + Get list of all deployments for the authenticated user. + + Args: + limit: Page Limit + + starting_after: Load the next page starting after the given token. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/v1/deployments", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + deployment_get_params.DeploymentGetParams, + ), + ), + cast_to=DeploymentGetResponse, + ) + + def logs( + self, + deployment_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DeploymentLogsResponse: + """ + Get list of all logs from a deployment. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not deployment_id: + raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") + return self._get( + f"/v1/deployments/{deployment_id}/logs", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DeploymentLogsResponse, + ) + + def redeploy( + self, + deployment_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DeploymentRedeployResponse: + """ + Creates a deployment for a previously deployed version. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not deployment_id: + raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") + return self._post( + f"/v1/deployments/{deployment_id}/redeploy", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DeploymentRedeployResponse, + ) + + def tail( + self, + deployment_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DeploymentTailResponse: + """ + Tails the logs for the given deployment with SSE streaming + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not deployment_id: + raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") + return self._get( + f"/v1/deployments/{deployment_id}/logs/tail", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DeploymentTailResponse, + ) + + +class AsyncDeploymentsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncDeploymentsResourceWithRawResponse: + return AsyncDeploymentsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncDeploymentsResourceWithStreamingResponse: + return AsyncDeploymentsResourceWithStreamingResponse(self) + + async def retrieve( + self, + deployment_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DeploymentRetrieveResponse: + """ + Get details of a deployment + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not deployment_id: + raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") + return await self._get( + f"/v1/deployments/{deployment_id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DeploymentRetrieveResponse, + ) + + async def get( + self, + *, + limit: str | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DeploymentGetResponse: + """ + Get list of all deployments for the authenticated user. + + Args: + limit: Page Limit + + starting_after: Load the next page starting after the given token. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/v1/deployments", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + deployment_get_params.DeploymentGetParams, + ), + ), + cast_to=DeploymentGetResponse, + ) + + async def logs( + self, + deployment_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DeploymentLogsResponse: + """ + Get list of all logs from a deployment. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not deployment_id: + raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") + return await self._get( + f"/v1/deployments/{deployment_id}/logs", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DeploymentLogsResponse, + ) + + async def redeploy( + self, + deployment_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DeploymentRedeployResponse: + """ + Creates a deployment for a previously deployed version. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not deployment_id: + raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") + return await self._post( + f"/v1/deployments/{deployment_id}/redeploy", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DeploymentRedeployResponse, + ) + + async def tail( + self, + deployment_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DeploymentTailResponse: + """ + Tails the logs for the given deployment with SSE streaming + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not deployment_id: + raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") + return await self._get( + f"/v1/deployments/{deployment_id}/logs/tail", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DeploymentTailResponse, + ) + + +class DeploymentsResourceWithRawResponse: + def __init__(self, deployments: DeploymentsResource) -> None: + self._deployments = deployments + + self.retrieve = to_raw_response_wrapper( + deployments.retrieve, + ) + self.get = to_raw_response_wrapper( + deployments.get, + ) + self.logs = to_raw_response_wrapper( + deployments.logs, + ) + self.redeploy = to_raw_response_wrapper( + deployments.redeploy, + ) + self.tail = to_raw_response_wrapper( + deployments.tail, + ) + + +class AsyncDeploymentsResourceWithRawResponse: + def __init__(self, deployments: AsyncDeploymentsResource) -> None: + self._deployments = deployments + + self.retrieve = async_to_raw_response_wrapper( + deployments.retrieve, + ) + self.get = async_to_raw_response_wrapper( + deployments.get, + ) + self.logs = async_to_raw_response_wrapper( + deployments.logs, + ) + self.redeploy = async_to_raw_response_wrapper( + deployments.redeploy, + ) + self.tail = async_to_raw_response_wrapper( + deployments.tail, + ) + + +class DeploymentsResourceWithStreamingResponse: + def __init__(self, deployments: DeploymentsResource) -> None: + self._deployments = deployments + + self.retrieve = to_streamed_response_wrapper( + deployments.retrieve, + ) + self.get = to_streamed_response_wrapper( + deployments.get, + ) + self.logs = to_streamed_response_wrapper( + deployments.logs, + ) + self.redeploy = to_streamed_response_wrapper( + deployments.redeploy, + ) + self.tail = to_streamed_response_wrapper( + deployments.tail, + ) + + +class AsyncDeploymentsResourceWithStreamingResponse: + def __init__(self, deployments: AsyncDeploymentsResource) -> None: + self._deployments = deployments + + self.retrieve = async_to_streamed_response_wrapper( + deployments.retrieve, + ) + self.get = async_to_streamed_response_wrapper( + deployments.get, + ) + self.logs = async_to_streamed_response_wrapper( + deployments.logs, + ) + self.redeploy = async_to_streamed_response_wrapper( + deployments.redeploy, + ) + self.tail = async_to_streamed_response_wrapper( + deployments.tail, + ) diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index 814a1ca00..ec7c746ac 100755 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -16,6 +16,14 @@ DevboxesResourceWithStreamingResponse, AsyncDevboxesResourceWithStreamingResponse, ) +from .executions import ( + ExecutionsResource, + AsyncExecutionsResource, + ExecutionsResourceWithRawResponse, + AsyncExecutionsResourceWithRawResponse, + ExecutionsResourceWithStreamingResponse, + AsyncExecutionsResourceWithStreamingResponse, +) __all__ = [ "LogsResource", @@ -24,6 +32,12 @@ "AsyncLogsResourceWithRawResponse", "LogsResourceWithStreamingResponse", "AsyncLogsResourceWithStreamingResponse", + "ExecutionsResource", + "AsyncExecutionsResource", + "ExecutionsResourceWithRawResponse", + "AsyncExecutionsResourceWithRawResponse", + "ExecutionsResourceWithStreamingResponse", + "AsyncExecutionsResourceWithStreamingResponse", "DevboxesResource", "AsyncDevboxesResource", "DevboxesResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 7b1c0388d..4586a46b5 100755 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -20,6 +20,7 @@ devbox_write_file_params, devbox_upload_file_params, devbox_execute_sync_params, + devbox_execute_async_params, devbox_read_file_contents_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes @@ -30,6 +31,14 @@ async_maybe_transform, ) from ..._compat import cached_property +from .executions import ( + ExecutionsResource, + AsyncExecutionsResource, + ExecutionsResourceWithRawResponse, + AsyncExecutionsResourceWithRawResponse, + ExecutionsResourceWithStreamingResponse, + AsyncExecutionsResourceWithStreamingResponse, +) from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( to_raw_response_wrapper, @@ -39,8 +48,10 @@ ) from ..._base_client import make_request_options from ...types.devbox_view import DevboxView -from ...types.devbox_list_view import DevboxListView -from ...types.devbox_execution_detail_view import DevboxExecutionDetailView +from ...types.devbox_list_response import DevboxListResponse +from ...types.devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse +from ...types.devboxes.devbox_execution_detail_view import DevboxExecutionDetailView +from ...types.devboxes.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView __all__ = ["DevboxesResource", "AsyncDevboxesResource"] @@ -50,6 +61,10 @@ class DevboxesResource(SyncAPIResource): def logs(self) -> LogsResource: return LogsResource(self._client) + @cached_property + def executions(self) -> ExecutionsResource: + return ExecutionsResource(self._client) + @cached_property def with_raw_response(self) -> DevboxesResourceWithRawResponse: return DevboxesResourceWithRawResponse(self) @@ -183,7 +198,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxListView: + ) -> DevboxListResponse: """List all devboxes or filter by status. If no status is provided, all devboxes @@ -220,7 +235,77 @@ def list( devbox_list_params.DevboxListParams, ), ), - cast_to=DevboxListView, + cast_to=DevboxListResponse, + ) + + def create_ssh_key( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxCreateSSHKeyResponse: + """ + Create an SSH key for a devbox by id. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/create_ssh_key", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxCreateSSHKeyResponse, + ) + + def execute_async( + self, + id: str, + *, + command: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Asynchronously execute a command on a devbox + + Args: + command: The command to execute on the Devbox. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/executions/execute_async", + body=maybe_transform({"command": command}, devbox_execute_async_params.DevboxExecuteAsyncParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxAsyncExecutionDetailView, ) def execute_sync( @@ -434,6 +519,10 @@ class AsyncDevboxesResource(AsyncAPIResource): def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) + @cached_property + def executions(self) -> AsyncExecutionsResource: + return AsyncExecutionsResource(self._client) + @cached_property def with_raw_response(self) -> AsyncDevboxesResourceWithRawResponse: return AsyncDevboxesResourceWithRawResponse(self) @@ -567,7 +656,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxListView: + ) -> DevboxListResponse: """List all devboxes or filter by status. If no status is provided, all devboxes @@ -604,7 +693,79 @@ async def list( devbox_list_params.DevboxListParams, ), ), - cast_to=DevboxListView, + cast_to=DevboxListResponse, + ) + + async def create_ssh_key( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxCreateSSHKeyResponse: + """ + Create an SSH key for a devbox by id. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/create_ssh_key", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxCreateSSHKeyResponse, + ) + + async def execute_async( + self, + id: str, + *, + command: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Asynchronously execute a command on a devbox + + Args: + command: The command to execute on the Devbox. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/executions/execute_async", + body=await async_maybe_transform( + {"command": command}, devbox_execute_async_params.DevboxExecuteAsyncParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxAsyncExecutionDetailView, ) async def execute_sync( @@ -826,6 +987,12 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.list = to_raw_response_wrapper( devboxes.list, ) + self.create_ssh_key = to_raw_response_wrapper( + devboxes.create_ssh_key, + ) + self.execute_async = to_raw_response_wrapper( + devboxes.execute_async, + ) self.execute_sync = to_raw_response_wrapper( devboxes.execute_sync, ) @@ -846,6 +1013,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) + @cached_property + def executions(self) -> ExecutionsResourceWithRawResponse: + return ExecutionsResourceWithRawResponse(self._devboxes.executions) + class AsyncDevboxesResourceWithRawResponse: def __init__(self, devboxes: AsyncDevboxesResource) -> None: @@ -860,6 +1031,12 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.list = async_to_raw_response_wrapper( devboxes.list, ) + self.create_ssh_key = async_to_raw_response_wrapper( + devboxes.create_ssh_key, + ) + self.execute_async = async_to_raw_response_wrapper( + devboxes.execute_async, + ) self.execute_sync = async_to_raw_response_wrapper( devboxes.execute_sync, ) @@ -880,6 +1057,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) + @cached_property + def executions(self) -> AsyncExecutionsResourceWithRawResponse: + return AsyncExecutionsResourceWithRawResponse(self._devboxes.executions) + class DevboxesResourceWithStreamingResponse: def __init__(self, devboxes: DevboxesResource) -> None: @@ -894,6 +1075,12 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.list = to_streamed_response_wrapper( devboxes.list, ) + self.create_ssh_key = to_streamed_response_wrapper( + devboxes.create_ssh_key, + ) + self.execute_async = to_streamed_response_wrapper( + devboxes.execute_async, + ) self.execute_sync = to_streamed_response_wrapper( devboxes.execute_sync, ) @@ -914,6 +1101,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) + @cached_property + def executions(self) -> ExecutionsResourceWithStreamingResponse: + return ExecutionsResourceWithStreamingResponse(self._devboxes.executions) + class AsyncDevboxesResourceWithStreamingResponse: def __init__(self, devboxes: AsyncDevboxesResource) -> None: @@ -928,6 +1119,12 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.list = async_to_streamed_response_wrapper( devboxes.list, ) + self.create_ssh_key = async_to_streamed_response_wrapper( + devboxes.create_ssh_key, + ) + self.execute_async = async_to_streamed_response_wrapper( + devboxes.execute_async, + ) self.execute_sync = async_to_streamed_response_wrapper( devboxes.execute_sync, ) @@ -947,3 +1144,7 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) + + @cached_property + def executions(self) -> AsyncExecutionsResourceWithStreamingResponse: + return AsyncExecutionsResourceWithStreamingResponse(self._devboxes.executions) diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py new file mode 100755 index 000000000..9b68a432f --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -0,0 +1,598 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import execution_retrieve_params, execution_execute_sync_params, execution_execute_async_params +from ...types.devboxes.devbox_logs_list_view import DevboxLogsListView +from ...types.devboxes.devbox_execution_detail_view import DevboxExecutionDetailView +from ...types.devboxes.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView + +__all__ = ["ExecutionsResource", "AsyncExecutionsResource"] + + +class ExecutionsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ExecutionsResourceWithRawResponse: + return ExecutionsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ExecutionsResourceWithStreamingResponse: + return ExecutionsResourceWithStreamingResponse(self) + + def retrieve( + self, + exe_id: str, + *, + id: str, + command: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Get status of an execution on a devbox. + + Args: + command: The command to execute on the Devbox. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not exe_id: + raise ValueError(f"Expected a non-empty value for `exe_id` but received {exe_id!r}") + return self._post( + f"/v1/devboxes/{id}/executions/{exe_id}", + body=maybe_transform({"command": command}, execution_retrieve_params.ExecutionRetrieveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + + def execute_async( + self, + id: str, + *, + command: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Asynchronously execute a command on a devbox + + Args: + command: The command to execute on the Devbox. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/executions/execute_async", + body=maybe_transform({"command": command}, execution_execute_async_params.ExecutionExecuteAsyncParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + + def execute_sync( + self, + id: str, + *, + command: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxExecutionDetailView: + """ + Synchronously execute a command on a devbox + + Args: + command: The command to execute on the Devbox. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/execute_sync", + body=maybe_transform({"command": command}, execution_execute_sync_params.ExecutionExecuteSyncParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxExecutionDetailView, + ) + + def kill( + self, + exe_id: str, + *, + id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Kill an asynchronous execution currently running on a devbox + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not exe_id: + raise ValueError(f"Expected a non-empty value for `exe_id` but received {exe_id!r}") + return self._post( + f"/v1/devboxes/{id}/executions/{exe_id}/kill", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + + def logs( + self, + execution_id: str, + *, + id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxLogsListView: + """ + Get all logs from a Devbox execution by id. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + return self._get( + f"/v1/devboxes/{id}/executions/{execution_id}/logs", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxLogsListView, + ) + + def tail( + self, + execution_id: str, + *, + id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> None: + """Tail the logs for the given devbox async execution. + + This will return past log + entries and continue from there. This is a streaming api and will continue to + stream logs until the connection is closed. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return self._get( + f"/v1/devboxes/{id}/executions/{execution_id}/logs/tail", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + + +class AsyncExecutionsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncExecutionsResourceWithRawResponse: + return AsyncExecutionsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncExecutionsResourceWithStreamingResponse: + return AsyncExecutionsResourceWithStreamingResponse(self) + + async def retrieve( + self, + exe_id: str, + *, + id: str, + command: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Get status of an execution on a devbox. + + Args: + command: The command to execute on the Devbox. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not exe_id: + raise ValueError(f"Expected a non-empty value for `exe_id` but received {exe_id!r}") + return await self._post( + f"/v1/devboxes/{id}/executions/{exe_id}", + body=await async_maybe_transform({"command": command}, execution_retrieve_params.ExecutionRetrieveParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + + async def execute_async( + self, + id: str, + *, + command: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Asynchronously execute a command on a devbox + + Args: + command: The command to execute on the Devbox. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/executions/execute_async", + body=await async_maybe_transform( + {"command": command}, execution_execute_async_params.ExecutionExecuteAsyncParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + + async def execute_sync( + self, + id: str, + *, + command: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxExecutionDetailView: + """ + Synchronously execute a command on a devbox + + Args: + command: The command to execute on the Devbox. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/execute_sync", + body=await async_maybe_transform( + {"command": command}, execution_execute_sync_params.ExecutionExecuteSyncParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxExecutionDetailView, + ) + + async def kill( + self, + exe_id: str, + *, + id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Kill an asynchronous execution currently running on a devbox + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not exe_id: + raise ValueError(f"Expected a non-empty value for `exe_id` but received {exe_id!r}") + return await self._post( + f"/v1/devboxes/{id}/executions/{exe_id}/kill", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + + async def logs( + self, + execution_id: str, + *, + id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxLogsListView: + """ + Get all logs from a Devbox execution by id. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + return await self._get( + f"/v1/devboxes/{id}/executions/{execution_id}/logs", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxLogsListView, + ) + + async def tail( + self, + execution_id: str, + *, + id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> None: + """Tail the logs for the given devbox async execution. + + This will return past log + entries and continue from there. This is a streaming api and will continue to + stream logs until the connection is closed. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return await self._get( + f"/v1/devboxes/{id}/executions/{execution_id}/logs/tail", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + + +class ExecutionsResourceWithRawResponse: + def __init__(self, executions: ExecutionsResource) -> None: + self._executions = executions + + self.retrieve = to_raw_response_wrapper( + executions.retrieve, + ) + self.execute_async = to_raw_response_wrapper( + executions.execute_async, + ) + self.execute_sync = to_raw_response_wrapper( + executions.execute_sync, + ) + self.kill = to_raw_response_wrapper( + executions.kill, + ) + self.logs = to_raw_response_wrapper( + executions.logs, + ) + self.tail = to_raw_response_wrapper( + executions.tail, + ) + + +class AsyncExecutionsResourceWithRawResponse: + def __init__(self, executions: AsyncExecutionsResource) -> None: + self._executions = executions + + self.retrieve = async_to_raw_response_wrapper( + executions.retrieve, + ) + self.execute_async = async_to_raw_response_wrapper( + executions.execute_async, + ) + self.execute_sync = async_to_raw_response_wrapper( + executions.execute_sync, + ) + self.kill = async_to_raw_response_wrapper( + executions.kill, + ) + self.logs = async_to_raw_response_wrapper( + executions.logs, + ) + self.tail = async_to_raw_response_wrapper( + executions.tail, + ) + + +class ExecutionsResourceWithStreamingResponse: + def __init__(self, executions: ExecutionsResource) -> None: + self._executions = executions + + self.retrieve = to_streamed_response_wrapper( + executions.retrieve, + ) + self.execute_async = to_streamed_response_wrapper( + executions.execute_async, + ) + self.execute_sync = to_streamed_response_wrapper( + executions.execute_sync, + ) + self.kill = to_streamed_response_wrapper( + executions.kill, + ) + self.logs = to_streamed_response_wrapper( + executions.logs, + ) + self.tail = to_streamed_response_wrapper( + executions.tail, + ) + + +class AsyncExecutionsResourceWithStreamingResponse: + def __init__(self, executions: AsyncExecutionsResource) -> None: + self._executions = executions + + self.retrieve = async_to_streamed_response_wrapper( + executions.retrieve, + ) + self.execute_async = async_to_streamed_response_wrapper( + executions.execute_async, + ) + self.execute_sync = async_to_streamed_response_wrapper( + executions.execute_sync, + ) + self.kill = async_to_streamed_response_wrapper( + executions.kill, + ) + self.logs = async_to_streamed_response_wrapper( + executions.logs, + ) + self.tail = async_to_streamed_response_wrapper( + executions.tail, + ) diff --git a/src/runloop_api_client/resources/devboxes/logs.py b/src/runloop_api_client/resources/devboxes/logs.py index cabe8f329..1f03fc023 100755 --- a/src/runloop_api_client/resources/devboxes/logs.py +++ b/src/runloop_api_client/resources/devboxes/logs.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -61,6 +61,43 @@ def list( cast_to=DevboxLogsListView, ) + def tail( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> None: + """Tail the logs for the given devbox. + + This will return past log entries and + continue from there. This is a streaming api and will continue to stream logs + until the connection is closed. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return self._get( + f"/v1/devboxes/{id}/logs/tail", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + class AsyncLogsResource(AsyncAPIResource): @cached_property @@ -104,6 +141,43 @@ async def list( cast_to=DevboxLogsListView, ) + async def tail( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> None: + """Tail the logs for the given devbox. + + This will return past log entries and + continue from there. This is a streaming api and will continue to stream logs + until the connection is closed. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return await self._get( + f"/v1/devboxes/{id}/logs/tail", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + class LogsResourceWithRawResponse: def __init__(self, logs: LogsResource) -> None: @@ -112,6 +186,9 @@ def __init__(self, logs: LogsResource) -> None: self.list = to_raw_response_wrapper( logs.list, ) + self.tail = to_raw_response_wrapper( + logs.tail, + ) class AsyncLogsResourceWithRawResponse: @@ -121,6 +198,9 @@ def __init__(self, logs: AsyncLogsResource) -> None: self.list = async_to_raw_response_wrapper( logs.list, ) + self.tail = async_to_raw_response_wrapper( + logs.tail, + ) class LogsResourceWithStreamingResponse: @@ -130,6 +210,9 @@ def __init__(self, logs: LogsResource) -> None: self.list = to_streamed_response_wrapper( logs.list, ) + self.tail = to_streamed_response_wrapper( + logs.tail, + ) class AsyncLogsResourceWithStreamingResponse: @@ -139,3 +222,6 @@ def __init__(self, logs: AsyncLogsResource) -> None: self.list = async_to_streamed_response_wrapper( logs.list, ) + self.tail = async_to_streamed_response_wrapper( + logs.tail, + ) diff --git a/src/runloop_api_client/resources/functions/functions.py b/src/runloop_api_client/resources/functions/functions.py index 006a23817..8628eca96 100755 --- a/src/runloop_api_client/resources/functions/functions.py +++ b/src/runloop_api_client/resources/functions/functions.py @@ -164,6 +164,25 @@ def invoke_sync( cast_to=FunctionInvocationExecutionDetailView, ) + def list_openapi( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get the OpenAPI Spec for this project.""" + return self._get( + "/v1/functions/openapi", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + class AsyncFunctionsResource(AsyncAPIResource): @cached_property @@ -296,6 +315,25 @@ async def invoke_sync( cast_to=FunctionInvocationExecutionDetailView, ) + async def list_openapi( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get the OpenAPI Spec for this project.""" + return await self._get( + "/v1/functions/openapi", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + class FunctionsResourceWithRawResponse: def __init__(self, functions: FunctionsResource) -> None: @@ -310,6 +348,9 @@ def __init__(self, functions: FunctionsResource) -> None: self.invoke_sync = to_raw_response_wrapper( functions.invoke_sync, ) + self.list_openapi = to_raw_response_wrapper( + functions.list_openapi, + ) @cached_property def invocations(self) -> InvocationsResourceWithRawResponse: @@ -329,6 +370,9 @@ def __init__(self, functions: AsyncFunctionsResource) -> None: self.invoke_sync = async_to_raw_response_wrapper( functions.invoke_sync, ) + self.list_openapi = async_to_raw_response_wrapper( + functions.list_openapi, + ) @cached_property def invocations(self) -> AsyncInvocationsResourceWithRawResponse: @@ -348,6 +392,9 @@ def __init__(self, functions: FunctionsResource) -> None: self.invoke_sync = to_streamed_response_wrapper( functions.invoke_sync, ) + self.list_openapi = to_streamed_response_wrapper( + functions.list_openapi, + ) @cached_property def invocations(self) -> InvocationsResourceWithStreamingResponse: @@ -367,6 +414,9 @@ def __init__(self, functions: AsyncFunctionsResource) -> None: self.invoke_sync = async_to_streamed_response_wrapper( functions.invoke_sync, ) + self.list_openapi = async_to_streamed_response_wrapper( + functions.list_openapi, + ) @cached_property def invocations(self) -> AsyncInvocationsResourceWithStreamingResponse: diff --git a/src/runloop_api_client/resources/functions/invocations.py b/src/runloop_api_client/resources/functions/invocations.py index 59491d1e7..5e9c2b046 100755 --- a/src/runloop_api_client/resources/functions/invocations.py +++ b/src/runloop_api_client/resources/functions/invocations.py @@ -19,6 +19,7 @@ ) from ..._base_client import make_request_options from ...types.functions import invocation_list_params +from ...types.functions.invocation_logs_response import InvocationLogsResponse from ...types.functions.function_invocation_list_view import FunctionInvocationListView from ...types.shared.function_invocation_execution_detail_view import FunctionInvocationExecutionDetailView @@ -149,6 +150,39 @@ def kill( cast_to=object, ) + def logs( + self, + invocation_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InvocationLogsResponse: + """ + Get the logs for the given invocation. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not invocation_id: + raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}") + return self._get( + f"/v1/functions/invocations/{invocation_id}/logs", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=InvocationLogsResponse, + ) + class AsyncInvocationsResource(AsyncAPIResource): @cached_property @@ -274,6 +308,39 @@ async def kill( cast_to=object, ) + async def logs( + self, + invocation_id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> InvocationLogsResponse: + """ + Get the logs for the given invocation. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not invocation_id: + raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}") + return await self._get( + f"/v1/functions/invocations/{invocation_id}/logs", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=InvocationLogsResponse, + ) + class InvocationsResourceWithRawResponse: def __init__(self, invocations: InvocationsResource) -> None: @@ -288,6 +355,9 @@ def __init__(self, invocations: InvocationsResource) -> None: self.kill = to_raw_response_wrapper( invocations.kill, ) + self.logs = to_raw_response_wrapper( + invocations.logs, + ) class AsyncInvocationsResourceWithRawResponse: @@ -303,6 +373,9 @@ def __init__(self, invocations: AsyncInvocationsResource) -> None: self.kill = async_to_raw_response_wrapper( invocations.kill, ) + self.logs = async_to_raw_response_wrapper( + invocations.logs, + ) class InvocationsResourceWithStreamingResponse: @@ -318,6 +391,9 @@ def __init__(self, invocations: InvocationsResource) -> None: self.kill = to_streamed_response_wrapper( invocations.kill, ) + self.logs = to_streamed_response_wrapper( + invocations.logs, + ) class AsyncInvocationsResourceWithStreamingResponse: @@ -333,3 +409,6 @@ def __init__(self, invocations: AsyncInvocationsResource) -> None: self.kill = async_to_streamed_response_wrapper( invocations.kill, ) + self.logs = async_to_streamed_response_wrapper( + invocations.logs, + ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 5817fab7d..e1b1ebff5 100755 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -9,26 +9,33 @@ from .devbox_view import DevboxView as DevboxView from .resource_size import ResourceSize as ResourceSize from .blueprint_view import BlueprintView as BlueprintView -from .devbox_list_view import DevboxListView as DevboxListView from .project_list_view import ProjectListView as ProjectListView from .devbox_list_params import DevboxListParams as DevboxListParams from .function_list_view import FunctionListView as FunctionListView from .blueprint_build_log import BlueprintBuildLog as BlueprintBuildLog from .blueprint_list_view import BlueprintListView as BlueprintListView from .devbox_create_params import DevboxCreateParams as DevboxCreateParams +from .devbox_list_response import DevboxListResponse as DevboxListResponse from .blueprint_list_params import BlueprintListParams as BlueprintListParams from .code_mount_parameters import CodeMountParameters as CodeMountParameters +from .deployment_get_params import DeploymentGetParams as DeploymentGetParams from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams +from .deployment_get_response import DeploymentGetResponse as DeploymentGetResponse from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams +from .deployment_logs_response import DeploymentLogsResponse as DeploymentLogsResponse +from .deployment_tail_response import DeploymentTailResponse as DeploymentTailResponse from .devbox_write_file_params import DevboxWriteFileParams as DevboxWriteFileParams from .devbox_upload_file_params import DevboxUploadFileParams as DevboxUploadFileParams from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams from .code_mount_parameters_param import CodeMountParametersParam as CodeMountParametersParam +from .devbox_execute_async_params import DevboxExecuteAsyncParams as DevboxExecuteAsyncParams from .function_invoke_sync_params import FunctionInvokeSyncParams as FunctionInvokeSyncParams -from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView +from .deployment_redeploy_response import DeploymentRedeployResponse as DeploymentRedeployResponse +from .deployment_retrieve_response import DeploymentRetrieveResponse as DeploymentRetrieveResponse from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams from .blueprint_build_logs_list_view import BlueprintBuildLogsListView as BlueprintBuildLogsListView +from .devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse as DevboxCreateSSHKeyResponse from .devbox_read_file_contents_params import DevboxReadFileContentsParams as DevboxReadFileContentsParams from .devbox_read_file_contents_response import DevboxReadFileContentsResponse as DevboxReadFileContentsResponse diff --git a/src/runloop_api_client/types/deployment_get_params.py b/src/runloop_api_client/types/deployment_get_params.py new file mode 100755 index 000000000..c4c564b6b --- /dev/null +++ b/src/runloop_api_client/types/deployment_get_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["DeploymentGetParams"] + + +class DeploymentGetParams(TypedDict, total=False): + limit: str + """Page Limit""" + + starting_after: str + """Load the next page starting after the given token.""" diff --git a/src/runloop_api_client/types/deployment_get_response.py b/src/runloop_api_client/types/deployment_get_response.py new file mode 100755 index 000000000..e291ac77f --- /dev/null +++ b/src/runloop_api_client/types/deployment_get_response.py @@ -0,0 +1,59 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["DeploymentGetResponse", "Deployment"] + + +class Deployment(BaseModel): + id: Optional[str] = None + """ID of the deployment.""" + + deploy_commit_message: Optional[str] = None + """Associated Commit Message""" + + deploy_commit_sha: Optional[str] = None + """Associated Commit Sha""" + + deploy_commit_time_ms: Optional[int] = None + """Associated Commit Time""" + + deploy_end_time_ms: Optional[int] = None + """Time the Deploy completed (Unix timestamp milliseconds).""" + + deploy_start_time_ms: Optional[int] = None + """Time the Deploy was started (Unix timestamp milliseconds).""" + + deployed_functions: Optional[List[str]] = None + """The list of deployed functions.""" + + failure_code: Optional[str] = None + """ + Failure code (generic_failure | git_clone_failure | not_runloop_repo | + secrets_failure | provision_failure | runtime_failure). Only set on + deploy_failed. + """ + + failure_message: Optional[str] = None + """Failure message""" + + project_name: Optional[str] = None + """Project name associated with the deployment.""" + + redeploy_of: Optional[str] = None + """ID of original deployment this is redeployment for.""" + + status: Optional[Literal["scheduled", "skipped", "in_progress", "failed", "deployed"]] = None + """Status of the deploy.""" + + +class DeploymentGetResponse(BaseModel): + deployments: Optional[List[Deployment]] = None + """List of projects matching given query.""" + + has_more: Optional[bool] = None + + total_count: Optional[int] = None diff --git a/src/runloop_api_client/types/deployment_logs_response.py b/src/runloop_api_client/types/deployment_logs_response.py new file mode 100755 index 000000000..ccd2ec3da --- /dev/null +++ b/src/runloop_api_client/types/deployment_logs_response.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from .._models import BaseModel + +__all__ = ["DeploymentLogsResponse", "Log"] + + +class Log(BaseModel): + level: Optional[str] = None + """Log line severity level.""" + + message: Optional[str] = None + """Log line message.""" + + timestamp_ms: Optional[int] = None + """Time of log (Unix timestamp milliseconds).""" + + +class DeploymentLogsResponse(BaseModel): + deployment_id: Optional[str] = None + """ID of the given deployment.""" + + logs: Optional[List[Log]] = None + """List of logs for the given deployment.""" diff --git a/src/runloop_api_client/types/deployment_redeploy_response.py b/src/runloop_api_client/types/deployment_redeploy_response.py new file mode 100755 index 000000000..679938a26 --- /dev/null +++ b/src/runloop_api_client/types/deployment_redeploy_response.py @@ -0,0 +1,50 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["DeploymentRedeployResponse"] + + +class DeploymentRedeployResponse(BaseModel): + id: Optional[str] = None + """ID of the deployment.""" + + deploy_commit_message: Optional[str] = None + """Associated Commit Message""" + + deploy_commit_sha: Optional[str] = None + """Associated Commit Sha""" + + deploy_commit_time_ms: Optional[int] = None + """Associated Commit Time""" + + deploy_end_time_ms: Optional[int] = None + """Time the Deploy completed (Unix timestamp milliseconds).""" + + deploy_start_time_ms: Optional[int] = None + """Time the Deploy was started (Unix timestamp milliseconds).""" + + deployed_functions: Optional[List[str]] = None + """The list of deployed functions.""" + + failure_code: Optional[str] = None + """ + Failure code (generic_failure | git_clone_failure | not_runloop_repo | + secrets_failure | provision_failure | runtime_failure). Only set on + deploy_failed. + """ + + failure_message: Optional[str] = None + """Failure message""" + + project_name: Optional[str] = None + """Project name associated with the deployment.""" + + redeploy_of: Optional[str] = None + """ID of original deployment this is redeployment for.""" + + status: Optional[Literal["scheduled", "skipped", "in_progress", "failed", "deployed"]] = None + """Status of the deploy.""" diff --git a/src/runloop_api_client/types/deployment_retrieve_response.py b/src/runloop_api_client/types/deployment_retrieve_response.py new file mode 100755 index 000000000..a2fa1bf41 --- /dev/null +++ b/src/runloop_api_client/types/deployment_retrieve_response.py @@ -0,0 +1,50 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["DeploymentRetrieveResponse"] + + +class DeploymentRetrieveResponse(BaseModel): + id: Optional[str] = None + """ID of the deployment.""" + + deploy_commit_message: Optional[str] = None + """Associated Commit Message""" + + deploy_commit_sha: Optional[str] = None + """Associated Commit Sha""" + + deploy_commit_time_ms: Optional[int] = None + """Associated Commit Time""" + + deploy_end_time_ms: Optional[int] = None + """Time the Deploy completed (Unix timestamp milliseconds).""" + + deploy_start_time_ms: Optional[int] = None + """Time the Deploy was started (Unix timestamp milliseconds).""" + + deployed_functions: Optional[List[str]] = None + """The list of deployed functions.""" + + failure_code: Optional[str] = None + """ + Failure code (generic_failure | git_clone_failure | not_runloop_repo | + secrets_failure | provision_failure | runtime_failure). Only set on + deploy_failed. + """ + + failure_message: Optional[str] = None + """Failure message""" + + project_name: Optional[str] = None + """Project name associated with the deployment.""" + + redeploy_of: Optional[str] = None + """ID of original deployment this is redeployment for.""" + + status: Optional[Literal["scheduled", "skipped", "in_progress", "failed", "deployed"]] = None + """Status of the deploy.""" diff --git a/src/runloop_api_client/types/deployment_tail_response.py b/src/runloop_api_client/types/deployment_tail_response.py new file mode 100755 index 000000000..afd26fc86 --- /dev/null +++ b/src/runloop_api_client/types/deployment_tail_response.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from .._models import BaseModel + +__all__ = ["DeploymentTailResponse", "Log"] + + +class Log(BaseModel): + level: Optional[str] = None + """Log line severity level.""" + + message: Optional[str] = None + """Log line message.""" + + timestamp_ms: Optional[int] = None + """Time of log (Unix timestamp milliseconds).""" + + +class DeploymentTailResponse(BaseModel): + deployment_id: Optional[str] = None + """ID of the given deployment.""" + + logs: Optional[List[Log]] = None + """List of logs for the given deployment.""" diff --git a/src/runloop_api_client/types/devbox_create_ssh_key_response.py b/src/runloop_api_client/types/devbox_create_ssh_key_response.py new file mode 100755 index 000000000..3f8c7c366 --- /dev/null +++ b/src/runloop_api_client/types/devbox_create_ssh_key_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["DevboxCreateSSHKeyResponse"] + + +class DevboxCreateSSHKeyResponse(BaseModel): + id: Optional[str] = None + """The id of the Devbox.""" + + ssh_private_key: Optional[str] = None + """The ssh private key, in PEM format.""" + + url: Optional[str] = None + """The url of the Devbox.""" diff --git a/src/runloop_api_client/types/devbox_execute_async_params.py b/src/runloop_api_client/types/devbox_execute_async_params.py new file mode 100755 index 000000000..9f5a7a8f4 --- /dev/null +++ b/src/runloop_api_client/types/devbox_execute_async_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["DevboxExecuteAsyncParams"] + + +class DevboxExecuteAsyncParams(TypedDict, total=False): + command: str + """The command to execute on the Devbox.""" diff --git a/src/runloop_api_client/types/devbox_list_response.py b/src/runloop_api_client/types/devbox_list_response.py new file mode 100755 index 000000000..d56c67f9f --- /dev/null +++ b/src/runloop_api_client/types/devbox_list_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from .._models import BaseModel +from .devbox_view import DevboxView + +__all__ = ["DevboxListResponse"] + + +class DevboxListResponse(BaseModel): + devboxes: Optional[List[DevboxView]] = None + """List of devboxes matching filter.""" + + has_more: Optional[bool] = None + + total_count: Optional[int] = None diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 71eb25578..e2433cc10 100755 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -21,6 +21,9 @@ class DevboxView(BaseModel): end_time_ms: Optional[int] = None """The time the Devbox finished execution (Unix timestamp milliseconds).""" + failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "execution_failed"]] = None + """The failure reason if the Devbox failed, if any.""" + initiator_id: Optional[str] = None """The initiator ID of the devbox.""" diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 7baebfdd7..90ed90bb5 100755 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -3,3 +3,8 @@ from __future__ import annotations from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView +from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView as DevboxAsyncExecutionDetailView diff --git a/src/runloop_api_client/types/devboxes/devbox_async_execution_detail_view.py b/src/runloop_api_client/types/devboxes/devbox_async_execution_detail_view.py new file mode 100755 index 000000000..ea60ca7f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/devbox_async_execution_detail_view.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["DevboxAsyncExecutionDetailView"] + + +class DevboxAsyncExecutionDetailView(BaseModel): + devbox_id: Optional[str] = None + """Devbox id where command was executed.""" + + execution_id: Optional[str] = None + """Ephemeral id of the execution in progress.""" + + exit_status: Optional[int] = None + """Exit code of command execution. + + This field will remain unset until the execution has completed. + """ + + status: Optional[Literal["running", "success", "failure", "canceled"]] = None + """Current status of the execution.""" + + stderr: Optional[str] = None + """Standard error generated by command. + + This field will remain unset until the execution has completed. + """ + + stdout: Optional[str] = None + """Standard out generated by command. + + This field will remain unset until the execution has completed. + """ diff --git a/src/runloop_api_client/types/devboxes/devbox_execution_detail_view.py b/src/runloop_api_client/types/devboxes/devbox_execution_detail_view.py new file mode 100755 index 000000000..eadd60b1d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/devbox_execution_detail_view.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["DevboxExecutionDetailView"] + + +class DevboxExecutionDetailView(BaseModel): + devbox_id: Optional[str] = None + """Devbox id where command was executed.""" + + exit_status: Optional[int] = None + """Exit status of command execution.""" + + stderr: Optional[str] = None + """Standard error generated by command.""" + + stdout: Optional[str] = None + """Standard out generated by command.""" diff --git a/src/runloop_api_client/types/devboxes/execution_execute_async_params.py b/src/runloop_api_client/types/devboxes/execution_execute_async_params.py new file mode 100755 index 000000000..7878309c5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/execution_execute_async_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["ExecutionExecuteAsyncParams"] + + +class ExecutionExecuteAsyncParams(TypedDict, total=False): + command: str + """The command to execute on the Devbox.""" diff --git a/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py b/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py new file mode 100755 index 000000000..392794ac9 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["ExecutionExecuteSyncParams"] + + +class ExecutionExecuteSyncParams(TypedDict, total=False): + command: str + """The command to execute on the Devbox.""" diff --git a/src/runloop_api_client/types/devboxes/execution_retrieve_params.py b/src/runloop_api_client/types/devboxes/execution_retrieve_params.py new file mode 100755 index 000000000..3cafe88fe --- /dev/null +++ b/src/runloop_api_client/types/devboxes/execution_retrieve_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["ExecutionRetrieveParams"] + + +class ExecutionRetrieveParams(TypedDict, total=False): + id: Required[str] + + command: str + """The command to execute on the Devbox.""" diff --git a/src/runloop_api_client/types/functions/__init__.py b/src/runloop_api_client/types/functions/__init__.py index 65762ab89..da953f2d5 100755 --- a/src/runloop_api_client/types/functions/__init__.py +++ b/src/runloop_api_client/types/functions/__init__.py @@ -3,4 +3,5 @@ from __future__ import annotations from .invocation_list_params import InvocationListParams as InvocationListParams +from .invocation_logs_response import InvocationLogsResponse as InvocationLogsResponse from .function_invocation_list_view import FunctionInvocationListView as FunctionInvocationListView diff --git a/src/runloop_api_client/types/functions/invocation_logs_response.py b/src/runloop_api_client/types/functions/invocation_logs_response.py new file mode 100755 index 000000000..240b32c4a --- /dev/null +++ b/src/runloop_api_client/types/functions/invocation_logs_response.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["InvocationLogsResponse", "Log"] + + +class Log(BaseModel): + level: Optional[str] = None + """Log line severity level.""" + + message: Optional[str] = None + """Log line message.""" + + timestamp_ms: Optional[int] = None + """Time of log (Unix timestamp milliseconds).""" + + +class InvocationLogsResponse(BaseModel): + invocation_id: Optional[str] = None + """ID of the invocation.""" + + logs: Optional[List[Log]] = None + """List of logs for the given invocation.""" diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py new file mode 100755 index 000000000..665142572 --- /dev/null +++ b/tests/api_resources/devboxes/test_executions.py @@ -0,0 +1,612 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + DevboxLogsListView, + DevboxExecutionDetailView, + DevboxAsyncExecutionDetailView, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestExecutions: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + execution = client.devboxes.executions.retrieve( + exe_id="exeId", + id="id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Runloop) -> None: + execution = client.devboxes.executions.retrieve( + exe_id="exeId", + id="id", + command="command", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.devboxes.executions.with_raw_response.retrieve( + exe_id="exeId", + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.devboxes.executions.with_streaming_response.retrieve( + exe_id="exeId", + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.executions.with_raw_response.retrieve( + exe_id="exeId", + id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `exe_id` but received ''"): + client.devboxes.executions.with_raw_response.retrieve( + exe_id="", + id="id", + ) + + @parametrize + def test_method_execute_async(self, client: Runloop) -> None: + execution = client.devboxes.executions.execute_async( + id="id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_method_execute_async_with_all_params(self, client: Runloop) -> None: + execution = client.devboxes.executions.execute_async( + id="id", + command="command", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_raw_response_execute_async(self, client: Runloop) -> None: + response = client.devboxes.executions.with_raw_response.execute_async( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_streaming_response_execute_async(self, client: Runloop) -> None: + with client.devboxes.executions.with_streaming_response.execute_async( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_execute_async(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.executions.with_raw_response.execute_async( + id="", + ) + + @parametrize + def test_method_execute_sync(self, client: Runloop) -> None: + execution = client.devboxes.executions.execute_sync( + id="id", + ) + assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_method_execute_sync_with_all_params(self, client: Runloop) -> None: + execution = client.devboxes.executions.execute_sync( + id="id", + command="command", + ) + assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_raw_response_execute_sync(self, client: Runloop) -> None: + response = client.devboxes.executions.with_raw_response.execute_sync( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = response.parse() + assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_streaming_response_execute_sync(self, client: Runloop) -> None: + with client.devboxes.executions.with_streaming_response.execute_sync( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = response.parse() + assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_execute_sync(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.executions.with_raw_response.execute_sync( + id="", + ) + + @parametrize + def test_method_kill(self, client: Runloop) -> None: + execution = client.devboxes.executions.kill( + exe_id="exeId", + id="id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_raw_response_kill(self, client: Runloop) -> None: + response = client.devboxes.executions.with_raw_response.kill( + exe_id="exeId", + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_streaming_response_kill(self, client: Runloop) -> None: + with client.devboxes.executions.with_streaming_response.kill( + exe_id="exeId", + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_kill(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.executions.with_raw_response.kill( + exe_id="exeId", + id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `exe_id` but received ''"): + client.devboxes.executions.with_raw_response.kill( + exe_id="", + id="id", + ) + + @parametrize + def test_method_logs(self, client: Runloop) -> None: + execution = client.devboxes.executions.logs( + execution_id="execution_id", + id="id", + ) + assert_matches_type(DevboxLogsListView, execution, path=["response"]) + + @parametrize + def test_raw_response_logs(self, client: Runloop) -> None: + response = client.devboxes.executions.with_raw_response.logs( + execution_id="execution_id", + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = response.parse() + assert_matches_type(DevboxLogsListView, execution, path=["response"]) + + @parametrize + def test_streaming_response_logs(self, client: Runloop) -> None: + with client.devboxes.executions.with_streaming_response.logs( + execution_id="execution_id", + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = response.parse() + assert_matches_type(DevboxLogsListView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_logs(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.executions.with_raw_response.logs( + execution_id="execution_id", + id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + client.devboxes.executions.with_raw_response.logs( + execution_id="", + id="id", + ) + + @parametrize + def test_method_tail(self, client: Runloop) -> None: + execution = client.devboxes.executions.tail( + execution_id="execution_id", + id="id", + ) + assert execution is None + + @parametrize + def test_raw_response_tail(self, client: Runloop) -> None: + response = client.devboxes.executions.with_raw_response.tail( + execution_id="execution_id", + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = response.parse() + assert execution is None + + @parametrize + def test_streaming_response_tail(self, client: Runloop) -> None: + with client.devboxes.executions.with_streaming_response.tail( + execution_id="execution_id", + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = response.parse() + assert execution is None + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_tail(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.executions.with_raw_response.tail( + execution_id="execution_id", + id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + client.devboxes.executions.with_raw_response.tail( + execution_id="", + id="id", + ) + + +class TestAsyncExecutions: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.retrieve( + exe_id="exeId", + id="id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.retrieve( + exe_id="exeId", + id="id", + command="command", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.executions.with_raw_response.retrieve( + exe_id="exeId", + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.executions.with_streaming_response.retrieve( + exe_id="exeId", + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.executions.with_raw_response.retrieve( + exe_id="exeId", + id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `exe_id` but received ''"): + await async_client.devboxes.executions.with_raw_response.retrieve( + exe_id="", + id="id", + ) + + @parametrize + async def test_method_execute_async(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.execute_async( + id="id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_method_execute_async_with_all_params(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.execute_async( + id="id", + command="command", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_raw_response_execute_async(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.executions.with_raw_response.execute_async( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_streaming_response_execute_async(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.executions.with_streaming_response.execute_async( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_execute_async(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.executions.with_raw_response.execute_async( + id="", + ) + + @parametrize + async def test_method_execute_sync(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.execute_sync( + id="id", + ) + assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_method_execute_sync_with_all_params(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.execute_sync( + id="id", + command="command", + ) + assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.executions.with_raw_response.execute_sync( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = await response.parse() + assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_streaming_response_execute_sync(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.executions.with_streaming_response.execute_sync( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = await response.parse() + assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.executions.with_raw_response.execute_sync( + id="", + ) + + @parametrize + async def test_method_kill(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.kill( + exe_id="exeId", + id="id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_raw_response_kill(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.executions.with_raw_response.kill( + exe_id="exeId", + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_streaming_response_kill(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.executions.with_streaming_response.kill( + exe_id="exeId", + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_kill(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.executions.with_raw_response.kill( + exe_id="exeId", + id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `exe_id` but received ''"): + await async_client.devboxes.executions.with_raw_response.kill( + exe_id="", + id="id", + ) + + @parametrize + async def test_method_logs(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.logs( + execution_id="execution_id", + id="id", + ) + assert_matches_type(DevboxLogsListView, execution, path=["response"]) + + @parametrize + async def test_raw_response_logs(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.executions.with_raw_response.logs( + execution_id="execution_id", + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = await response.parse() + assert_matches_type(DevboxLogsListView, execution, path=["response"]) + + @parametrize + async def test_streaming_response_logs(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.executions.with_streaming_response.logs( + execution_id="execution_id", + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = await response.parse() + assert_matches_type(DevboxLogsListView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_logs(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.executions.with_raw_response.logs( + execution_id="execution_id", + id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + await async_client.devboxes.executions.with_raw_response.logs( + execution_id="", + id="id", + ) + + @parametrize + async def test_method_tail(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.tail( + execution_id="execution_id", + id="id", + ) + assert execution is None + + @parametrize + async def test_raw_response_tail(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.executions.with_raw_response.tail( + execution_id="execution_id", + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = await response.parse() + assert execution is None + + @parametrize + async def test_streaming_response_tail(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.executions.with_streaming_response.tail( + execution_id="execution_id", + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = await response.parse() + assert execution is None + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_tail(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.executions.with_raw_response.tail( + execution_id="execution_id", + id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + await async_client.devboxes.executions.with_raw_response.tail( + execution_id="", + id="id", + ) diff --git a/tests/api_resources/devboxes/test_logs.py b/tests/api_resources/devboxes/test_logs.py index 85ea9be84..c0d8bdc24 100755 --- a/tests/api_resources/devboxes/test_logs.py +++ b/tests/api_resources/devboxes/test_logs.py @@ -55,6 +55,44 @@ def test_path_params_list(self, client: Runloop) -> None: "", ) + @parametrize + def test_method_tail(self, client: Runloop) -> None: + log = client.devboxes.logs.tail( + "id", + ) + assert log is None + + @parametrize + def test_raw_response_tail(self, client: Runloop) -> None: + response = client.devboxes.logs.with_raw_response.tail( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + log = response.parse() + assert log is None + + @parametrize + def test_streaming_response_tail(self, client: Runloop) -> None: + with client.devboxes.logs.with_streaming_response.tail( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + log = response.parse() + assert log is None + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_tail(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.logs.with_raw_response.tail( + "", + ) + class TestAsyncLogs: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -96,3 +134,41 @@ async def test_path_params_list(self, async_client: AsyncRunloop) -> None: await async_client.devboxes.logs.with_raw_response.list( "", ) + + @parametrize + async def test_method_tail(self, async_client: AsyncRunloop) -> None: + log = await async_client.devboxes.logs.tail( + "id", + ) + assert log is None + + @parametrize + async def test_raw_response_tail(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.logs.with_raw_response.tail( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + log = await response.parse() + assert log is None + + @parametrize + async def test_streaming_response_tail(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.logs.with_streaming_response.tail( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + log = await response.parse() + assert log is None + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_tail(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.logs.with_raw_response.tail( + "", + ) diff --git a/tests/api_resources/functions/test_invocations.py b/tests/api_resources/functions/test_invocations.py index 726e5843c..38953c074 100755 --- a/tests/api_resources/functions/test_invocations.py +++ b/tests/api_resources/functions/test_invocations.py @@ -10,7 +10,10 @@ from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types.shared import FunctionInvocationExecutionDetailView -from runloop_api_client.types.functions import FunctionInvocationListView +from runloop_api_client.types.functions import ( + InvocationLogsResponse, + FunctionInvocationListView, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -127,6 +130,44 @@ def test_path_params_kill(self, client: Runloop) -> None: "", ) + @parametrize + def test_method_logs(self, client: Runloop) -> None: + invocation = client.functions.invocations.logs( + "invocation_id", + ) + assert_matches_type(InvocationLogsResponse, invocation, path=["response"]) + + @parametrize + def test_raw_response_logs(self, client: Runloop) -> None: + response = client.functions.invocations.with_raw_response.logs( + "invocation_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + invocation = response.parse() + assert_matches_type(InvocationLogsResponse, invocation, path=["response"]) + + @parametrize + def test_streaming_response_logs(self, client: Runloop) -> None: + with client.functions.invocations.with_streaming_response.logs( + "invocation_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + invocation = response.parse() + assert_matches_type(InvocationLogsResponse, invocation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_logs(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `invocation_id` but received ''"): + client.functions.invocations.with_raw_response.logs( + "", + ) + class TestAsyncInvocations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -239,3 +280,41 @@ async def test_path_params_kill(self, async_client: AsyncRunloop) -> None: await async_client.functions.invocations.with_raw_response.kill( "", ) + + @parametrize + async def test_method_logs(self, async_client: AsyncRunloop) -> None: + invocation = await async_client.functions.invocations.logs( + "invocation_id", + ) + assert_matches_type(InvocationLogsResponse, invocation, path=["response"]) + + @parametrize + async def test_raw_response_logs(self, async_client: AsyncRunloop) -> None: + response = await async_client.functions.invocations.with_raw_response.logs( + "invocation_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + invocation = await response.parse() + assert_matches_type(InvocationLogsResponse, invocation, path=["response"]) + + @parametrize + async def test_streaming_response_logs(self, async_client: AsyncRunloop) -> None: + async with async_client.functions.invocations.with_streaming_response.logs( + "invocation_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + invocation = await response.parse() + assert_matches_type(InvocationLogsResponse, invocation, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_logs(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `invocation_id` but received ''"): + await async_client.functions.invocations.with_raw_response.logs( + "", + ) diff --git a/tests/api_resources/test_deployments.py b/tests/api_resources/test_deployments.py new file mode 100755 index 000000000..5a83bef98 --- /dev/null +++ b/tests/api_resources/test_deployments.py @@ -0,0 +1,398 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types import ( + DeploymentGetResponse, + DeploymentLogsResponse, + DeploymentTailResponse, + DeploymentRedeployResponse, + DeploymentRetrieveResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestDeployments: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + deployment = client.deployments.retrieve( + "deployment_id", + ) + assert_matches_type(DeploymentRetrieveResponse, deployment, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.deployments.with_raw_response.retrieve( + "deployment_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + deployment = response.parse() + assert_matches_type(DeploymentRetrieveResponse, deployment, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.deployments.with_streaming_response.retrieve( + "deployment_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + deployment = response.parse() + assert_matches_type(DeploymentRetrieveResponse, deployment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): + client.deployments.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_get(self, client: Runloop) -> None: + deployment = client.deployments.get() + assert_matches_type(DeploymentGetResponse, deployment, path=["response"]) + + @parametrize + def test_method_get_with_all_params(self, client: Runloop) -> None: + deployment = client.deployments.get( + limit="limit", + starting_after="starting_after", + ) + assert_matches_type(DeploymentGetResponse, deployment, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Runloop) -> None: + response = client.deployments.with_raw_response.get() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + deployment = response.parse() + assert_matches_type(DeploymentGetResponse, deployment, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Runloop) -> None: + with client.deployments.with_streaming_response.get() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + deployment = response.parse() + assert_matches_type(DeploymentGetResponse, deployment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_logs(self, client: Runloop) -> None: + deployment = client.deployments.logs( + "deployment_id", + ) + assert_matches_type(DeploymentLogsResponse, deployment, path=["response"]) + + @parametrize + def test_raw_response_logs(self, client: Runloop) -> None: + response = client.deployments.with_raw_response.logs( + "deployment_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + deployment = response.parse() + assert_matches_type(DeploymentLogsResponse, deployment, path=["response"]) + + @parametrize + def test_streaming_response_logs(self, client: Runloop) -> None: + with client.deployments.with_streaming_response.logs( + "deployment_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + deployment = response.parse() + assert_matches_type(DeploymentLogsResponse, deployment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_logs(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): + client.deployments.with_raw_response.logs( + "", + ) + + @parametrize + def test_method_redeploy(self, client: Runloop) -> None: + deployment = client.deployments.redeploy( + "deployment_id", + ) + assert_matches_type(DeploymentRedeployResponse, deployment, path=["response"]) + + @parametrize + def test_raw_response_redeploy(self, client: Runloop) -> None: + response = client.deployments.with_raw_response.redeploy( + "deployment_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + deployment = response.parse() + assert_matches_type(DeploymentRedeployResponse, deployment, path=["response"]) + + @parametrize + def test_streaming_response_redeploy(self, client: Runloop) -> None: + with client.deployments.with_streaming_response.redeploy( + "deployment_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + deployment = response.parse() + assert_matches_type(DeploymentRedeployResponse, deployment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_redeploy(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): + client.deployments.with_raw_response.redeploy( + "", + ) + + @parametrize + def test_method_tail(self, client: Runloop) -> None: + deployment = client.deployments.tail( + "deployment_id", + ) + assert_matches_type(DeploymentTailResponse, deployment, path=["response"]) + + @parametrize + def test_raw_response_tail(self, client: Runloop) -> None: + response = client.deployments.with_raw_response.tail( + "deployment_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + deployment = response.parse() + assert_matches_type(DeploymentTailResponse, deployment, path=["response"]) + + @parametrize + def test_streaming_response_tail(self, client: Runloop) -> None: + with client.deployments.with_streaming_response.tail( + "deployment_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + deployment = response.parse() + assert_matches_type(DeploymentTailResponse, deployment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_tail(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): + client.deployments.with_raw_response.tail( + "", + ) + + +class TestAsyncDeployments: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + deployment = await async_client.deployments.retrieve( + "deployment_id", + ) + assert_matches_type(DeploymentRetrieveResponse, deployment, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.deployments.with_raw_response.retrieve( + "deployment_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + deployment = await response.parse() + assert_matches_type(DeploymentRetrieveResponse, deployment, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.deployments.with_streaming_response.retrieve( + "deployment_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + deployment = await response.parse() + assert_matches_type(DeploymentRetrieveResponse, deployment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): + await async_client.deployments.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncRunloop) -> None: + deployment = await async_client.deployments.get() + assert_matches_type(DeploymentGetResponse, deployment, path=["response"]) + + @parametrize + async def test_method_get_with_all_params(self, async_client: AsyncRunloop) -> None: + deployment = await async_client.deployments.get( + limit="limit", + starting_after="starting_after", + ) + assert_matches_type(DeploymentGetResponse, deployment, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncRunloop) -> None: + response = await async_client.deployments.with_raw_response.get() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + deployment = await response.parse() + assert_matches_type(DeploymentGetResponse, deployment, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncRunloop) -> None: + async with async_client.deployments.with_streaming_response.get() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + deployment = await response.parse() + assert_matches_type(DeploymentGetResponse, deployment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_logs(self, async_client: AsyncRunloop) -> None: + deployment = await async_client.deployments.logs( + "deployment_id", + ) + assert_matches_type(DeploymentLogsResponse, deployment, path=["response"]) + + @parametrize + async def test_raw_response_logs(self, async_client: AsyncRunloop) -> None: + response = await async_client.deployments.with_raw_response.logs( + "deployment_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + deployment = await response.parse() + assert_matches_type(DeploymentLogsResponse, deployment, path=["response"]) + + @parametrize + async def test_streaming_response_logs(self, async_client: AsyncRunloop) -> None: + async with async_client.deployments.with_streaming_response.logs( + "deployment_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + deployment = await response.parse() + assert_matches_type(DeploymentLogsResponse, deployment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_logs(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): + await async_client.deployments.with_raw_response.logs( + "", + ) + + @parametrize + async def test_method_redeploy(self, async_client: AsyncRunloop) -> None: + deployment = await async_client.deployments.redeploy( + "deployment_id", + ) + assert_matches_type(DeploymentRedeployResponse, deployment, path=["response"]) + + @parametrize + async def test_raw_response_redeploy(self, async_client: AsyncRunloop) -> None: + response = await async_client.deployments.with_raw_response.redeploy( + "deployment_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + deployment = await response.parse() + assert_matches_type(DeploymentRedeployResponse, deployment, path=["response"]) + + @parametrize + async def test_streaming_response_redeploy(self, async_client: AsyncRunloop) -> None: + async with async_client.deployments.with_streaming_response.redeploy( + "deployment_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + deployment = await response.parse() + assert_matches_type(DeploymentRedeployResponse, deployment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_redeploy(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): + await async_client.deployments.with_raw_response.redeploy( + "", + ) + + @parametrize + async def test_method_tail(self, async_client: AsyncRunloop) -> None: + deployment = await async_client.deployments.tail( + "deployment_id", + ) + assert_matches_type(DeploymentTailResponse, deployment, path=["response"]) + + @parametrize + async def test_raw_response_tail(self, async_client: AsyncRunloop) -> None: + response = await async_client.deployments.with_raw_response.tail( + "deployment_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + deployment = await response.parse() + assert_matches_type(DeploymentTailResponse, deployment, path=["response"]) + + @parametrize + async def test_streaming_response_tail(self, async_client: AsyncRunloop) -> None: + async with async_client.deployments.with_streaming_response.tail( + "deployment_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + deployment = await response.parse() + assert_matches_type(DeploymentTailResponse, deployment, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_tail(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): + await async_client.deployments.with_raw_response.tail( + "", + ) diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 1024eb26f..9b82bde44 100755 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -11,9 +11,10 @@ from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types import ( DevboxView, - DevboxListView, - DevboxExecutionDetailView, + DevboxListResponse, + DevboxCreateSSHKeyResponse, ) +from runloop_api_client.types.devboxes import DevboxExecutionDetailView, DevboxAsyncExecutionDetailView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -106,7 +107,7 @@ def test_path_params_retrieve(self, client: Runloop) -> None: @parametrize def test_method_list(self, client: Runloop) -> None: devbox = client.devboxes.list() - assert_matches_type(DevboxListView, devbox, path=["response"]) + assert_matches_type(DevboxListResponse, devbox, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: @@ -115,7 +116,7 @@ def test_method_list_with_all_params(self, client: Runloop) -> None: starting_after="starting_after", status="status", ) - assert_matches_type(DevboxListView, devbox, path=["response"]) + assert_matches_type(DevboxListResponse, devbox, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -124,7 +125,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert_matches_type(DevboxListView, devbox, path=["response"]) + assert_matches_type(DevboxListResponse, devbox, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -133,10 +134,94 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert_matches_type(DevboxListView, devbox, path=["response"]) + assert_matches_type(DevboxListResponse, devbox, path=["response"]) assert cast(Any, response.is_closed) is True + @parametrize + def test_method_create_ssh_key(self, client: Runloop) -> None: + devbox = client.devboxes.create_ssh_key( + "id", + ) + assert_matches_type(DevboxCreateSSHKeyResponse, devbox, path=["response"]) + + @parametrize + def test_raw_response_create_ssh_key(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.create_ssh_key( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(DevboxCreateSSHKeyResponse, devbox, path=["response"]) + + @parametrize + def test_streaming_response_create_ssh_key(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.create_ssh_key( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(DevboxCreateSSHKeyResponse, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create_ssh_key(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.create_ssh_key( + "", + ) + + @parametrize + def test_method_execute_async(self, client: Runloop) -> None: + devbox = client.devboxes.execute_async( + id="id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_method_execute_async_with_all_params(self, client: Runloop) -> None: + devbox = client.devboxes.execute_async( + id="id", + command="command", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_raw_response_execute_async(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.execute_async( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_streaming_response_execute_async(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.execute_async( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_execute_async(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.execute_async( + id="", + ) + @parametrize def test_method_execute_sync(self, client: Runloop) -> None: devbox = client.devboxes.execute_sync( @@ -450,7 +535,7 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.list() - assert_matches_type(DevboxListView, devbox, path=["response"]) + assert_matches_type(DevboxListResponse, devbox, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -459,7 +544,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> starting_after="starting_after", status="status", ) - assert_matches_type(DevboxListView, devbox, path=["response"]) + assert_matches_type(DevboxListResponse, devbox, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -468,7 +553,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert_matches_type(DevboxListView, devbox, path=["response"]) + assert_matches_type(DevboxListResponse, devbox, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -477,10 +562,94 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert_matches_type(DevboxListView, devbox, path=["response"]) + assert_matches_type(DevboxListResponse, devbox, path=["response"]) assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_create_ssh_key(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.create_ssh_key( + "id", + ) + assert_matches_type(DevboxCreateSSHKeyResponse, devbox, path=["response"]) + + @parametrize + async def test_raw_response_create_ssh_key(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.create_ssh_key( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(DevboxCreateSSHKeyResponse, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_create_ssh_key(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.create_ssh_key( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(DevboxCreateSSHKeyResponse, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create_ssh_key(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.create_ssh_key( + "", + ) + + @parametrize + async def test_method_execute_async(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.execute_async( + id="id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_method_execute_async_with_all_params(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.execute_async( + id="id", + command="command", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_raw_response_execute_async(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.execute_async( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_execute_async(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.execute_async( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_execute_async(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.execute_async( + id="", + ) + @parametrize async def test_method_execute_sync(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.execute_sync( diff --git a/tests/api_resources/test_functions.py b/tests/api_resources/test_functions.py index e168b5de1..fa60f9801 100755 --- a/tests/api_resources/test_functions.py +++ b/tests/api_resources/test_functions.py @@ -169,6 +169,31 @@ def test_path_params_invoke_sync(self, client: Runloop) -> None: request={}, ) + @parametrize + def test_method_list_openapi(self, client: Runloop) -> None: + function = client.functions.list_openapi() + assert_matches_type(object, function, path=["response"]) + + @parametrize + def test_raw_response_list_openapi(self, client: Runloop) -> None: + response = client.functions.with_raw_response.list_openapi() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + function = response.parse() + assert_matches_type(object, function, path=["response"]) + + @parametrize + def test_streaming_response_list_openapi(self, client: Runloop) -> None: + with client.functions.with_streaming_response.list_openapi() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + function = response.parse() + assert_matches_type(object, function, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncFunctions: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -323,3 +348,28 @@ async def test_path_params_invoke_sync(self, async_client: AsyncRunloop) -> None project_name="project_name", request={}, ) + + @parametrize + async def test_method_list_openapi(self, async_client: AsyncRunloop) -> None: + function = await async_client.functions.list_openapi() + assert_matches_type(object, function, path=["response"]) + + @parametrize + async def test_raw_response_list_openapi(self, async_client: AsyncRunloop) -> None: + response = await async_client.functions.with_raw_response.list_openapi() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + function = await response.parse() + assert_matches_type(object, function, path=["response"]) + + @parametrize + async def test_streaming_response_list_openapi(self, async_client: AsyncRunloop) -> None: + async with async_client.functions.with_streaming_response.list_openapi() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + function = await response.parse() + assert_matches_type(object, function, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/test_client.py b/tests/test_client.py index a9738496a..ab10be034 100755 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -87,7 +87,7 @@ def test_copy_default_options(self) -> None: # options that have a default are overridden correctly copied = self.client.copy(max_retries=7) assert copied.max_retries == 7 - assert self.client.max_retries == 0 + assert self.client.max_retries == 2 copied2 = copied.copy(max_retries=6) assert copied2.max_retries == 6 @@ -706,20 +706,20 @@ class Model(BaseModel): "remaining_retries,retry_after,timeout", [ [3, "20", 20], - [3, "0", 1], - [3, "-10", 1], + [3, "0", 0.5], + [3, "-10", 0.5], [3, "60", 60], - [3, "61", 1], + [3, "61", 0.5], [3, "Fri, 29 Sep 2023 16:26:57 GMT", 20], - [3, "Fri, 29 Sep 2023 16:26:37 GMT", 1], - [3, "Fri, 29 Sep 2023 16:26:27 GMT", 1], + [3, "Fri, 29 Sep 2023 16:26:37 GMT", 0.5], + [3, "Fri, 29 Sep 2023 16:26:27 GMT", 0.5], [3, "Fri, 29 Sep 2023 16:27:37 GMT", 60], - [3, "Fri, 29 Sep 2023 16:27:38 GMT", 1], - [3, "99999999999999999999999999999999999", 1], - [3, "Zun, 29 Sep 2023 16:26:27 GMT", 1], - [3, "", 1], - [2, "", 1 * 2.0], - [1, "", 1 * 4.0], + [3, "Fri, 29 Sep 2023 16:27:38 GMT", 0.5], + [3, "99999999999999999999999999999999999", 0.5], + [3, "Zun, 29 Sep 2023 16:26:27 GMT", 0.5], + [3, "", 0.5], + [2, "", 0.5 * 2.0], + [1, "", 0.5 * 4.0], ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) @@ -729,7 +729,7 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) calculated = client._calculate_retry_timeout(remaining_retries, options, headers) - assert calculated == pytest.approx(timeout, 1 * 0.875) # pyright: ignore[reportUnknownMemberType] + assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) @@ -820,7 +820,7 @@ def test_copy_default_options(self) -> None: # options that have a default are overridden correctly copied = self.client.copy(max_retries=7) assert copied.max_retries == 7 - assert self.client.max_retries == 0 + assert self.client.max_retries == 2 copied2 = copied.copy(max_retries=6) assert copied2.max_retries == 6 @@ -1442,20 +1442,20 @@ class Model(BaseModel): "remaining_retries,retry_after,timeout", [ [3, "20", 20], - [3, "0", 1], - [3, "-10", 1], + [3, "0", 0.5], + [3, "-10", 0.5], [3, "60", 60], - [3, "61", 1], + [3, "61", 0.5], [3, "Fri, 29 Sep 2023 16:26:57 GMT", 20], - [3, "Fri, 29 Sep 2023 16:26:37 GMT", 1], - [3, "Fri, 29 Sep 2023 16:26:27 GMT", 1], + [3, "Fri, 29 Sep 2023 16:26:37 GMT", 0.5], + [3, "Fri, 29 Sep 2023 16:26:27 GMT", 0.5], [3, "Fri, 29 Sep 2023 16:27:37 GMT", 60], - [3, "Fri, 29 Sep 2023 16:27:38 GMT", 1], - [3, "99999999999999999999999999999999999", 1], - [3, "Zun, 29 Sep 2023 16:26:27 GMT", 1], - [3, "", 1], - [2, "", 1 * 2.0], - [1, "", 1 * 4.0], + [3, "Fri, 29 Sep 2023 16:27:38 GMT", 0.5], + [3, "99999999999999999999999999999999999", 0.5], + [3, "Zun, 29 Sep 2023 16:26:27 GMT", 0.5], + [3, "", 0.5], + [2, "", 0.5 * 2.0], + [1, "", 0.5 * 4.0], ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) @@ -1466,7 +1466,7 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) calculated = client._calculate_retry_timeout(remaining_retries, options, headers) - assert calculated == pytest.approx(timeout, 1 * 0.875) # pyright: ignore[reportUnknownMemberType] + assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) From a3c1c62e05e6f10b0e7e865e2d2a37abc3db981e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 23 Aug 2024 21:28:29 +0000 Subject: [PATCH 107/993] feat(api): manual updates (#118) --- src/runloop_api_client/_client.py | 4 ++ src/runloop_api_client/_streaming.py | 48 ++++++++++++++++++- .../api_resources/devboxes/test_executions.py | 8 ++++ tests/api_resources/devboxes/test_logs.py | 8 ++++ tests/api_resources/test_deployments.py | 8 ++++ tests/test_client.py | 24 ++++++++++ 6 files changed, 98 insertions(+), 2 deletions(-) diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index f173ecd62..720cd7196 100755 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -108,6 +108,8 @@ def __init__( _strict_response_validation=_strict_response_validation, ) + self._default_stream_cls = Stream + self.blueprints = resources.BlueprintsResource(self) self.deployments = resources.DeploymentsResource(self) self.devboxes = resources.DevboxesResource(self) @@ -284,6 +286,8 @@ def __init__( _strict_response_validation=_strict_response_validation, ) + self._default_stream_cls = AsyncStream + self.blueprints = resources.AsyncBlueprintsResource(self) self.deployments = resources.AsyncDeploymentsResource(self) self.devboxes = resources.AsyncDevboxesResource(self) diff --git a/src/runloop_api_client/_streaming.py b/src/runloop_api_client/_streaming.py index ded05ee4b..7a008d1c2 100755 --- a/src/runloop_api_client/_streaming.py +++ b/src/runloop_api_client/_streaming.py @@ -55,7 +55,29 @@ def __stream__(self) -> Iterator[_T]: iterator = self._iter_events() for sse in iterator: - yield process_data(data=sse.json(), cast_to=cast_to, response=response) + if sse.event == "completion": + yield process_data(data=sse.json(), cast_to=cast_to, response=response) + + if sse.event == "message_start" or sse.event == "content_block_stop": + yield process_data(data=sse.json(), cast_to=cast_to, response=response) + + if sse.event == "ping": + continue + + if sse.event == "error": + body = sse.data + + try: + body = sse.json() + err_msg = f"{body}" + except Exception: + err_msg = sse.data or f"Error code: {response.status_code}" + + raise self._client._make_status_error( + err_msg, + body=body, + response=self.response, + ) # Ensure the entire stream is consumed for _sse in iterator: @@ -119,7 +141,29 @@ async def __stream__(self) -> AsyncIterator[_T]: iterator = self._iter_events() async for sse in iterator: - yield process_data(data=sse.json(), cast_to=cast_to, response=response) + if sse.event == "completion": + yield process_data(data=sse.json(), cast_to=cast_to, response=response) + + if sse.event == "message_start" or sse.event == "content_block_stop": + yield process_data(data=sse.json(), cast_to=cast_to, response=response) + + if sse.event == "ping": + continue + + if sse.event == "error": + body = sse.data + + try: + body = sse.json() + err_msg = f"{body}" + except Exception: + err_msg = sse.data or f"Error code: {response.status_code}" + + raise self._client._make_status_error( + err_msg, + body=body, + response=self.response, + ) # Ensure the entire stream is consumed async for _sse in iterator: diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index 665142572..a841221f0 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -266,6 +266,7 @@ def test_path_params_logs(self, client: Runloop) -> None: id="id", ) + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize def test_method_tail(self, client: Runloop) -> None: execution = client.devboxes.executions.tail( @@ -274,6 +275,7 @@ def test_method_tail(self, client: Runloop) -> None: ) assert execution is None + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize def test_raw_response_tail(self, client: Runloop) -> None: response = client.devboxes.executions.with_raw_response.tail( @@ -286,6 +288,7 @@ def test_raw_response_tail(self, client: Runloop) -> None: execution = response.parse() assert execution is None + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize def test_streaming_response_tail(self, client: Runloop) -> None: with client.devboxes.executions.with_streaming_response.tail( @@ -300,6 +303,7 @@ def test_streaming_response_tail(self, client: Runloop) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize def test_path_params_tail(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): @@ -563,6 +567,7 @@ async def test_path_params_logs(self, async_client: AsyncRunloop) -> None: id="id", ) + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize async def test_method_tail(self, async_client: AsyncRunloop) -> None: execution = await async_client.devboxes.executions.tail( @@ -571,6 +576,7 @@ async def test_method_tail(self, async_client: AsyncRunloop) -> None: ) assert execution is None + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize async def test_raw_response_tail(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.executions.with_raw_response.tail( @@ -583,6 +589,7 @@ async def test_raw_response_tail(self, async_client: AsyncRunloop) -> None: execution = await response.parse() assert execution is None + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize async def test_streaming_response_tail(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.executions.with_streaming_response.tail( @@ -597,6 +604,7 @@ async def test_streaming_response_tail(self, async_client: AsyncRunloop) -> None assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize async def test_path_params_tail(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): diff --git a/tests/api_resources/devboxes/test_logs.py b/tests/api_resources/devboxes/test_logs.py index c0d8bdc24..370066940 100755 --- a/tests/api_resources/devboxes/test_logs.py +++ b/tests/api_resources/devboxes/test_logs.py @@ -55,6 +55,7 @@ def test_path_params_list(self, client: Runloop) -> None: "", ) + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize def test_method_tail(self, client: Runloop) -> None: log = client.devboxes.logs.tail( @@ -62,6 +63,7 @@ def test_method_tail(self, client: Runloop) -> None: ) assert log is None + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize def test_raw_response_tail(self, client: Runloop) -> None: response = client.devboxes.logs.with_raw_response.tail( @@ -73,6 +75,7 @@ def test_raw_response_tail(self, client: Runloop) -> None: log = response.parse() assert log is None + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize def test_streaming_response_tail(self, client: Runloop) -> None: with client.devboxes.logs.with_streaming_response.tail( @@ -86,6 +89,7 @@ def test_streaming_response_tail(self, client: Runloop) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize def test_path_params_tail(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): @@ -135,6 +139,7 @@ async def test_path_params_list(self, async_client: AsyncRunloop) -> None: "", ) + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize async def test_method_tail(self, async_client: AsyncRunloop) -> None: log = await async_client.devboxes.logs.tail( @@ -142,6 +147,7 @@ async def test_method_tail(self, async_client: AsyncRunloop) -> None: ) assert log is None + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize async def test_raw_response_tail(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.logs.with_raw_response.tail( @@ -153,6 +159,7 @@ async def test_raw_response_tail(self, async_client: AsyncRunloop) -> None: log = await response.parse() assert log is None + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize async def test_streaming_response_tail(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.logs.with_streaming_response.tail( @@ -166,6 +173,7 @@ async def test_streaming_response_tail(self, async_client: AsyncRunloop) -> None assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize async def test_path_params_tail(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): diff --git a/tests/api_resources/test_deployments.py b/tests/api_resources/test_deployments.py index 5a83bef98..1c1c11f74 100755 --- a/tests/api_resources/test_deployments.py +++ b/tests/api_resources/test_deployments.py @@ -170,6 +170,7 @@ def test_path_params_redeploy(self, client: Runloop) -> None: "", ) + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize def test_method_tail(self, client: Runloop) -> None: deployment = client.deployments.tail( @@ -177,6 +178,7 @@ def test_method_tail(self, client: Runloop) -> None: ) assert_matches_type(DeploymentTailResponse, deployment, path=["response"]) + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize def test_raw_response_tail(self, client: Runloop) -> None: response = client.deployments.with_raw_response.tail( @@ -188,6 +190,7 @@ def test_raw_response_tail(self, client: Runloop) -> None: deployment = response.parse() assert_matches_type(DeploymentTailResponse, deployment, path=["response"]) + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize def test_streaming_response_tail(self, client: Runloop) -> None: with client.deployments.with_streaming_response.tail( @@ -201,6 +204,7 @@ def test_streaming_response_tail(self, client: Runloop) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize def test_path_params_tail(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): @@ -359,6 +363,7 @@ async def test_path_params_redeploy(self, async_client: AsyncRunloop) -> None: "", ) + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize async def test_method_tail(self, async_client: AsyncRunloop) -> None: deployment = await async_client.deployments.tail( @@ -366,6 +371,7 @@ async def test_method_tail(self, async_client: AsyncRunloop) -> None: ) assert_matches_type(DeploymentTailResponse, deployment, path=["response"]) + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize async def test_raw_response_tail(self, async_client: AsyncRunloop) -> None: response = await async_client.deployments.with_raw_response.tail( @@ -377,6 +383,7 @@ async def test_raw_response_tail(self, async_client: AsyncRunloop) -> None: deployment = await response.parse() assert_matches_type(DeploymentTailResponse, deployment, path=["response"]) + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize async def test_streaming_response_tail(self, async_client: AsyncRunloop) -> None: async with async_client.deployments.with_streaming_response.tail( @@ -390,6 +397,7 @@ async def test_streaming_response_tail(self, async_client: AsyncRunloop) -> None assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="cannot test text/event-stream") @parametrize async def test_path_params_tail(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): diff --git a/tests/test_client.py b/tests/test_client.py index ab10be034..58485333a 100755 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -20,6 +20,7 @@ from runloop_api_client._types import Omit from runloop_api_client._models import BaseModel, FinalRequestOptions from runloop_api_client._constants import RAW_RESPONSE_HEADER +from runloop_api_client._streaming import Stream, AsyncStream from runloop_api_client._exceptions import RunloopError, APIStatusError, APITimeoutError, APIResponseValidationError from runloop_api_client._base_client import ( DEFAULT_TIMEOUT, @@ -685,6 +686,17 @@ def test_client_max_retries_validation(self) -> None: max_retries=cast(Any, None), ) + @pytest.mark.respx(base_url=base_url) + def test_default_stream_cls(self, respx_mock: MockRouter) -> None: + class Model(BaseModel): + name: str + + respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + + stream = self.client.post("/foo", cast_to=Model, stream=True, stream_cls=Stream[Model]) + assert isinstance(stream, Stream) + stream.response.close() + @pytest.mark.respx(base_url=base_url) def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None: class Model(BaseModel): @@ -1420,6 +1432,18 @@ async def test_client_max_retries_validation(self) -> None: max_retries=cast(Any, None), ) + @pytest.mark.respx(base_url=base_url) + @pytest.mark.asyncio + async def test_default_stream_cls(self, respx_mock: MockRouter) -> None: + class Model(BaseModel): + name: str + + respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + + stream = await self.client.post("/foo", cast_to=Model, stream=True, stream_cls=AsyncStream[Model]) + assert isinstance(stream, AsyncStream) + await stream.response.aclose() + @pytest.mark.respx(base_url=base_url) @pytest.mark.asyncio async def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None: From fe835f4fb0e52c4a7598b271f0d1e69e4cb3dc11 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 23 Aug 2024 23:31:14 +0000 Subject: [PATCH 108/993] feat(api): OpenAPI spec update via Stainless API (#120) --- .stats.yml | 4 +- api.md | 49 +-- src/runloop_api_client/_client.py | 12 - src/runloop_api_client/_streaming.py | 48 +- src/runloop_api_client/resources/__init__.py | 14 - .../resources/devboxes/devboxes.py | 10 +- .../resources/devboxes/executions.py | 357 +-------------- .../resources/devboxes/logs.py | 88 +--- .../resources/functions/functions.py | 50 --- .../resources/functions/invocations.py | 79 ---- src/runloop_api_client/types/__init__.py | 8 +- .../types/devboxes/__init__.py | 1 - .../types/functions/__init__.py | 1 - .../api_resources/devboxes/test_executions.py | 411 ------------------ tests/api_resources/devboxes/test_logs.py | 84 ---- .../functions/test_invocations.py | 81 +--- tests/api_resources/test_devboxes.py | 18 +- tests/api_resources/test_functions.py | 50 --- tests/test_client.py | 24 - 19 files changed, 35 insertions(+), 1354 deletions(-) diff --git a/.stats.yml b/.stats.yml index 41b5ab409..f0fee8e9b 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 36 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ea589851f2dbba35fea6c010ac4c577cad56aa44e1d5bd4e5b472c802b2f13c4.yml +configured_endpoints: 24 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2085d09cb7954db9bd300c0d93f1f08e25b69906011c0d65e899951880372ef1.yml diff --git a/api.md b/api.md index ba23ae8ae..6bae20322 100755 --- a/api.md +++ b/api.md @@ -43,36 +43,16 @@ Types: from runloop_api_client.types import CodeMountParameters ``` -# Deployments - -Types: - -```python -from runloop_api_client.types import ( - DeploymentRetrieveResponse, - DeploymentGetResponse, - DeploymentLogsResponse, - DeploymentRedeployResponse, - DeploymentTailResponse, -) -``` - -Methods: - -- client.deployments.retrieve(deployment_id) -> DeploymentRetrieveResponse -- client.deployments.get(\*\*params) -> DeploymentGetResponse -- client.deployments.logs(deployment_id) -> DeploymentLogsResponse -- client.deployments.redeploy(deployment_id) -> DeploymentRedeployResponse -- client.deployments.tail(deployment_id) -> DeploymentTailResponse - # Devboxes Types: ```python from runloop_api_client.types import ( + DevboxAsyncExecutionDetailView, + DevboxExecutionDetailView, + DevboxListView, DevboxView, - DevboxListResponse, DevboxCreateSSHKeyResponse, DevboxReadFileContentsResponse, DevboxUploadFileResponse, @@ -83,7 +63,7 @@ Methods: - client.devboxes.create(\*\*params) -> DevboxView - client.devboxes.retrieve(id) -> DevboxView -- client.devboxes.list(\*\*params) -> DevboxListResponse +- client.devboxes.list(\*\*params) -> DevboxListView - client.devboxes.create_ssh_key(id) -> DevboxCreateSSHKeyResponse - client.devboxes.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView @@ -94,10 +74,15 @@ Methods: ## Logs +Types: + +```python +from runloop_api_client.types.devboxes import DevboxLogsListView +``` + Methods: - client.devboxes.logs.list(id) -> DevboxLogsListView -- client.devboxes.logs.tail(id) -> None ## Executions @@ -113,19 +98,15 @@ from runloop_api_client.types.devboxes import ( Methods: -- client.devboxes.executions.retrieve(exe_id, \*, id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.execute_sync(id, \*\*params) -> DevboxExecutionDetailView -- client.devboxes.executions.kill(exe_id, \*, id) -> DevboxAsyncExecutionDetailView -- client.devboxes.executions.logs(execution_id, \*, id) -> DevboxLogsListView -- client.devboxes.executions.tail(execution_id, \*, id) -> None # Functions Types: ```python -from runloop_api_client.types import FunctionListView, FunctionListOpenAPIResponse +from runloop_api_client.types import FunctionListView ``` Methods: @@ -133,18 +114,13 @@ Methods: - client.functions.list() -> FunctionListView - client.functions.invoke_async(function_name, \*, project_name, \*\*params) -> FunctionInvocationExecutionDetailView - client.functions.invoke_sync(function_name, \*, project_name, \*\*params) -> FunctionInvocationExecutionDetailView -- client.functions.list_openapi() -> object ## Invocations Types: ```python -from runloop_api_client.types.functions import ( - FunctionInvocationListView, - KillOperationResponse, - InvocationLogsResponse, -) +from runloop_api_client.types.functions import FunctionInvocationListView, KillOperationResponse ``` Methods: @@ -152,7 +128,6 @@ Methods: - client.functions.invocations.retrieve(invocation_id) -> FunctionInvocationExecutionDetailView - client.functions.invocations.list(\*\*params) -> FunctionInvocationListView - client.functions.invocations.kill(invocation_id) -> object -- client.functions.invocations.logs(invocation_id) -> InvocationLogsResponse # Projects diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index 720cd7196..1609aebcc 100755 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -47,7 +47,6 @@ class Runloop(SyncAPIClient): blueprints: resources.BlueprintsResource - deployments: resources.DeploymentsResource devboxes: resources.DevboxesResource functions: resources.FunctionsResource projects: resources.ProjectsResource @@ -108,10 +107,7 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self._default_stream_cls = Stream - self.blueprints = resources.BlueprintsResource(self) - self.deployments = resources.DeploymentsResource(self) self.devboxes = resources.DevboxesResource(self) self.functions = resources.FunctionsResource(self) self.projects = resources.ProjectsResource(self) @@ -225,7 +221,6 @@ def _make_status_error( class AsyncRunloop(AsyncAPIClient): blueprints: resources.AsyncBlueprintsResource - deployments: resources.AsyncDeploymentsResource devboxes: resources.AsyncDevboxesResource functions: resources.AsyncFunctionsResource projects: resources.AsyncProjectsResource @@ -286,10 +281,7 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self._default_stream_cls = AsyncStream - self.blueprints = resources.AsyncBlueprintsResource(self) - self.deployments = resources.AsyncDeploymentsResource(self) self.devboxes = resources.AsyncDevboxesResource(self) self.functions = resources.AsyncFunctionsResource(self) self.projects = resources.AsyncProjectsResource(self) @@ -404,7 +396,6 @@ def _make_status_error( class RunloopWithRawResponse: def __init__(self, client: Runloop) -> None: self.blueprints = resources.BlueprintsResourceWithRawResponse(client.blueprints) - self.deployments = resources.DeploymentsResourceWithRawResponse(client.deployments) self.devboxes = resources.DevboxesResourceWithRawResponse(client.devboxes) self.functions = resources.FunctionsResourceWithRawResponse(client.functions) self.projects = resources.ProjectsResourceWithRawResponse(client.projects) @@ -413,7 +404,6 @@ def __init__(self, client: Runloop) -> None: class AsyncRunloopWithRawResponse: def __init__(self, client: AsyncRunloop) -> None: self.blueprints = resources.AsyncBlueprintsResourceWithRawResponse(client.blueprints) - self.deployments = resources.AsyncDeploymentsResourceWithRawResponse(client.deployments) self.devboxes = resources.AsyncDevboxesResourceWithRawResponse(client.devboxes) self.functions = resources.AsyncFunctionsResourceWithRawResponse(client.functions) self.projects = resources.AsyncProjectsResourceWithRawResponse(client.projects) @@ -422,7 +412,6 @@ def __init__(self, client: AsyncRunloop) -> None: class RunloopWithStreamedResponse: def __init__(self, client: Runloop) -> None: self.blueprints = resources.BlueprintsResourceWithStreamingResponse(client.blueprints) - self.deployments = resources.DeploymentsResourceWithStreamingResponse(client.deployments) self.devboxes = resources.DevboxesResourceWithStreamingResponse(client.devboxes) self.functions = resources.FunctionsResourceWithStreamingResponse(client.functions) self.projects = resources.ProjectsResourceWithStreamingResponse(client.projects) @@ -431,7 +420,6 @@ def __init__(self, client: Runloop) -> None: class AsyncRunloopWithStreamedResponse: def __init__(self, client: AsyncRunloop) -> None: self.blueprints = resources.AsyncBlueprintsResourceWithStreamingResponse(client.blueprints) - self.deployments = resources.AsyncDeploymentsResourceWithStreamingResponse(client.deployments) self.devboxes = resources.AsyncDevboxesResourceWithStreamingResponse(client.devboxes) self.functions = resources.AsyncFunctionsResourceWithStreamingResponse(client.functions) self.projects = resources.AsyncProjectsResourceWithStreamingResponse(client.projects) diff --git a/src/runloop_api_client/_streaming.py b/src/runloop_api_client/_streaming.py index 7a008d1c2..ded05ee4b 100755 --- a/src/runloop_api_client/_streaming.py +++ b/src/runloop_api_client/_streaming.py @@ -55,29 +55,7 @@ def __stream__(self) -> Iterator[_T]: iterator = self._iter_events() for sse in iterator: - if sse.event == "completion": - yield process_data(data=sse.json(), cast_to=cast_to, response=response) - - if sse.event == "message_start" or sse.event == "content_block_stop": - yield process_data(data=sse.json(), cast_to=cast_to, response=response) - - if sse.event == "ping": - continue - - if sse.event == "error": - body = sse.data - - try: - body = sse.json() - err_msg = f"{body}" - except Exception: - err_msg = sse.data or f"Error code: {response.status_code}" - - raise self._client._make_status_error( - err_msg, - body=body, - response=self.response, - ) + yield process_data(data=sse.json(), cast_to=cast_to, response=response) # Ensure the entire stream is consumed for _sse in iterator: @@ -141,29 +119,7 @@ async def __stream__(self) -> AsyncIterator[_T]: iterator = self._iter_events() async for sse in iterator: - if sse.event == "completion": - yield process_data(data=sse.json(), cast_to=cast_to, response=response) - - if sse.event == "message_start" or sse.event == "content_block_stop": - yield process_data(data=sse.json(), cast_to=cast_to, response=response) - - if sse.event == "ping": - continue - - if sse.event == "error": - body = sse.data - - try: - body = sse.json() - err_msg = f"{body}" - except Exception: - err_msg = sse.data or f"Error code: {response.status_code}" - - raise self._client._make_status_error( - err_msg, - body=body, - response=self.response, - ) + yield process_data(data=sse.json(), cast_to=cast_to, response=response) # Ensure the entire stream is consumed async for _sse in iterator: diff --git a/src/runloop_api_client/resources/__init__.py b/src/runloop_api_client/resources/__init__.py index e26ff0410..f36499829 100755 --- a/src/runloop_api_client/resources/__init__.py +++ b/src/runloop_api_client/resources/__init__.py @@ -32,14 +32,6 @@ BlueprintsResourceWithStreamingResponse, AsyncBlueprintsResourceWithStreamingResponse, ) -from .deployments import ( - DeploymentsResource, - AsyncDeploymentsResource, - DeploymentsResourceWithRawResponse, - AsyncDeploymentsResourceWithRawResponse, - DeploymentsResourceWithStreamingResponse, - AsyncDeploymentsResourceWithStreamingResponse, -) __all__ = [ "BlueprintsResource", @@ -48,12 +40,6 @@ "AsyncBlueprintsResourceWithRawResponse", "BlueprintsResourceWithStreamingResponse", "AsyncBlueprintsResourceWithStreamingResponse", - "DeploymentsResource", - "AsyncDeploymentsResource", - "DeploymentsResourceWithRawResponse", - "AsyncDeploymentsResourceWithRawResponse", - "DeploymentsResourceWithStreamingResponse", - "AsyncDeploymentsResourceWithStreamingResponse", "DevboxesResource", "AsyncDevboxesResource", "DevboxesResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4586a46b5..a45032569 100755 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -48,7 +48,7 @@ ) from ..._base_client import make_request_options from ...types.devbox_view import DevboxView -from ...types.devbox_list_response import DevboxListResponse +from ...types.devbox_list_view import DevboxListView from ...types.devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse from ...types.devboxes.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devboxes.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView @@ -198,7 +198,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxListResponse: + ) -> DevboxListView: """List all devboxes or filter by status. If no status is provided, all devboxes @@ -235,7 +235,7 @@ def list( devbox_list_params.DevboxListParams, ), ), - cast_to=DevboxListResponse, + cast_to=DevboxListView, ) def create_ssh_key( @@ -656,7 +656,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxListResponse: + ) -> DevboxListView: """List all devboxes or filter by status. If no status is provided, all devboxes @@ -693,7 +693,7 @@ async def list( devbox_list_params.DevboxListParams, ), ), - cast_to=DevboxListResponse, + cast_to=DevboxListView, ) async def create_ssh_key( diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index 9b68a432f..7886822a3 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( maybe_transform, async_maybe_transform, @@ -18,8 +18,7 @@ async_to_streamed_response_wrapper, ) from ..._base_client import make_request_options -from ...types.devboxes import execution_retrieve_params, execution_execute_sync_params, execution_execute_async_params -from ...types.devboxes.devbox_logs_list_view import DevboxLogsListView +from ...types.devboxes import execution_execute_sync_params, execution_execute_async_params from ...types.devboxes.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devboxes.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView @@ -35,46 +34,6 @@ def with_raw_response(self) -> ExecutionsResourceWithRawResponse: def with_streaming_response(self) -> ExecutionsResourceWithStreamingResponse: return ExecutionsResourceWithStreamingResponse(self) - def retrieve( - self, - exe_id: str, - *, - id: str, - command: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxAsyncExecutionDetailView: - """ - Get status of an execution on a devbox. - - Args: - command: The command to execute on the Devbox. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - if not exe_id: - raise ValueError(f"Expected a non-empty value for `exe_id` but received {exe_id!r}") - return self._post( - f"/v1/devboxes/{id}/executions/{exe_id}", - body=maybe_transform({"command": command}, execution_retrieve_params.ExecutionRetrieveParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DevboxAsyncExecutionDetailView, - ) - def execute_async( self, id: str, @@ -149,118 +108,6 @@ def execute_sync( cast_to=DevboxExecutionDetailView, ) - def kill( - self, - exe_id: str, - *, - id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxAsyncExecutionDetailView: - """ - Kill an asynchronous execution currently running on a devbox - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - if not exe_id: - raise ValueError(f"Expected a non-empty value for `exe_id` but received {exe_id!r}") - return self._post( - f"/v1/devboxes/{id}/executions/{exe_id}/kill", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DevboxAsyncExecutionDetailView, - ) - - def logs( - self, - execution_id: str, - *, - id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxLogsListView: - """ - Get all logs from a Devbox execution by id. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - if not execution_id: - raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") - return self._get( - f"/v1/devboxes/{id}/executions/{execution_id}/logs", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DevboxLogsListView, - ) - - def tail( - self, - execution_id: str, - *, - id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> None: - """Tail the logs for the given devbox async execution. - - This will return past log - entries and continue from there. This is a streaming api and will continue to - stream logs until the connection is closed. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - if not execution_id: - raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") - extra_headers = {"Accept": "*/*", **(extra_headers or {})} - return self._get( - f"/v1/devboxes/{id}/executions/{execution_id}/logs/tail", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=NoneType, - ) - class AsyncExecutionsResource(AsyncAPIResource): @cached_property @@ -271,46 +118,6 @@ def with_raw_response(self) -> AsyncExecutionsResourceWithRawResponse: def with_streaming_response(self) -> AsyncExecutionsResourceWithStreamingResponse: return AsyncExecutionsResourceWithStreamingResponse(self) - async def retrieve( - self, - exe_id: str, - *, - id: str, - command: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxAsyncExecutionDetailView: - """ - Get status of an execution on a devbox. - - Args: - command: The command to execute on the Devbox. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - if not exe_id: - raise ValueError(f"Expected a non-empty value for `exe_id` but received {exe_id!r}") - return await self._post( - f"/v1/devboxes/{id}/executions/{exe_id}", - body=await async_maybe_transform({"command": command}, execution_retrieve_params.ExecutionRetrieveParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DevboxAsyncExecutionDetailView, - ) - async def execute_async( self, id: str, @@ -389,210 +196,50 @@ async def execute_sync( cast_to=DevboxExecutionDetailView, ) - async def kill( - self, - exe_id: str, - *, - id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxAsyncExecutionDetailView: - """ - Kill an asynchronous execution currently running on a devbox - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - if not exe_id: - raise ValueError(f"Expected a non-empty value for `exe_id` but received {exe_id!r}") - return await self._post( - f"/v1/devboxes/{id}/executions/{exe_id}/kill", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DevboxAsyncExecutionDetailView, - ) - - async def logs( - self, - execution_id: str, - *, - id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxLogsListView: - """ - Get all logs from a Devbox execution by id. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - if not execution_id: - raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") - return await self._get( - f"/v1/devboxes/{id}/executions/{execution_id}/logs", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DevboxLogsListView, - ) - - async def tail( - self, - execution_id: str, - *, - id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> None: - """Tail the logs for the given devbox async execution. - - This will return past log - entries and continue from there. This is a streaming api and will continue to - stream logs until the connection is closed. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - if not execution_id: - raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") - extra_headers = {"Accept": "*/*", **(extra_headers or {})} - return await self._get( - f"/v1/devboxes/{id}/executions/{execution_id}/logs/tail", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=NoneType, - ) - class ExecutionsResourceWithRawResponse: def __init__(self, executions: ExecutionsResource) -> None: self._executions = executions - self.retrieve = to_raw_response_wrapper( - executions.retrieve, - ) self.execute_async = to_raw_response_wrapper( executions.execute_async, ) self.execute_sync = to_raw_response_wrapper( executions.execute_sync, ) - self.kill = to_raw_response_wrapper( - executions.kill, - ) - self.logs = to_raw_response_wrapper( - executions.logs, - ) - self.tail = to_raw_response_wrapper( - executions.tail, - ) class AsyncExecutionsResourceWithRawResponse: def __init__(self, executions: AsyncExecutionsResource) -> None: self._executions = executions - self.retrieve = async_to_raw_response_wrapper( - executions.retrieve, - ) self.execute_async = async_to_raw_response_wrapper( executions.execute_async, ) self.execute_sync = async_to_raw_response_wrapper( executions.execute_sync, ) - self.kill = async_to_raw_response_wrapper( - executions.kill, - ) - self.logs = async_to_raw_response_wrapper( - executions.logs, - ) - self.tail = async_to_raw_response_wrapper( - executions.tail, - ) class ExecutionsResourceWithStreamingResponse: def __init__(self, executions: ExecutionsResource) -> None: self._executions = executions - self.retrieve = to_streamed_response_wrapper( - executions.retrieve, - ) self.execute_async = to_streamed_response_wrapper( executions.execute_async, ) self.execute_sync = to_streamed_response_wrapper( executions.execute_sync, ) - self.kill = to_streamed_response_wrapper( - executions.kill, - ) - self.logs = to_streamed_response_wrapper( - executions.logs, - ) - self.tail = to_streamed_response_wrapper( - executions.tail, - ) class AsyncExecutionsResourceWithStreamingResponse: def __init__(self, executions: AsyncExecutionsResource) -> None: self._executions = executions - self.retrieve = async_to_streamed_response_wrapper( - executions.retrieve, - ) self.execute_async = async_to_streamed_response_wrapper( executions.execute_async, ) self.execute_sync = async_to_streamed_response_wrapper( executions.execute_sync, ) - self.kill = async_to_streamed_response_wrapper( - executions.kill, - ) - self.logs = async_to_streamed_response_wrapper( - executions.logs, - ) - self.tail = async_to_streamed_response_wrapper( - executions.tail, - ) diff --git a/src/runloop_api_client/resources/devboxes/logs.py b/src/runloop_api_client/resources/devboxes/logs.py index 1f03fc023..cabe8f329 100755 --- a/src/runloop_api_client/resources/devboxes/logs.py +++ b/src/runloop_api_client/resources/devboxes/logs.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -61,43 +61,6 @@ def list( cast_to=DevboxLogsListView, ) - def tail( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> None: - """Tail the logs for the given devbox. - - This will return past log entries and - continue from there. This is a streaming api and will continue to stream logs - until the connection is closed. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - extra_headers = {"Accept": "*/*", **(extra_headers or {})} - return self._get( - f"/v1/devboxes/{id}/logs/tail", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=NoneType, - ) - class AsyncLogsResource(AsyncAPIResource): @cached_property @@ -141,43 +104,6 @@ async def list( cast_to=DevboxLogsListView, ) - async def tail( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> None: - """Tail the logs for the given devbox. - - This will return past log entries and - continue from there. This is a streaming api and will continue to stream logs - until the connection is closed. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - extra_headers = {"Accept": "*/*", **(extra_headers or {})} - return await self._get( - f"/v1/devboxes/{id}/logs/tail", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=NoneType, - ) - class LogsResourceWithRawResponse: def __init__(self, logs: LogsResource) -> None: @@ -186,9 +112,6 @@ def __init__(self, logs: LogsResource) -> None: self.list = to_raw_response_wrapper( logs.list, ) - self.tail = to_raw_response_wrapper( - logs.tail, - ) class AsyncLogsResourceWithRawResponse: @@ -198,9 +121,6 @@ def __init__(self, logs: AsyncLogsResource) -> None: self.list = async_to_raw_response_wrapper( logs.list, ) - self.tail = async_to_raw_response_wrapper( - logs.tail, - ) class LogsResourceWithStreamingResponse: @@ -210,9 +130,6 @@ def __init__(self, logs: LogsResource) -> None: self.list = to_streamed_response_wrapper( logs.list, ) - self.tail = to_streamed_response_wrapper( - logs.tail, - ) class AsyncLogsResourceWithStreamingResponse: @@ -222,6 +139,3 @@ def __init__(self, logs: AsyncLogsResource) -> None: self.list = async_to_streamed_response_wrapper( logs.list, ) - self.tail = async_to_streamed_response_wrapper( - logs.tail, - ) diff --git a/src/runloop_api_client/resources/functions/functions.py b/src/runloop_api_client/resources/functions/functions.py index 8628eca96..006a23817 100755 --- a/src/runloop_api_client/resources/functions/functions.py +++ b/src/runloop_api_client/resources/functions/functions.py @@ -164,25 +164,6 @@ def invoke_sync( cast_to=FunctionInvocationExecutionDetailView, ) - def list_openapi( - self, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get the OpenAPI Spec for this project.""" - return self._get( - "/v1/functions/openapi", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - class AsyncFunctionsResource(AsyncAPIResource): @cached_property @@ -315,25 +296,6 @@ async def invoke_sync( cast_to=FunctionInvocationExecutionDetailView, ) - async def list_openapi( - self, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get the OpenAPI Spec for this project.""" - return await self._get( - "/v1/functions/openapi", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - class FunctionsResourceWithRawResponse: def __init__(self, functions: FunctionsResource) -> None: @@ -348,9 +310,6 @@ def __init__(self, functions: FunctionsResource) -> None: self.invoke_sync = to_raw_response_wrapper( functions.invoke_sync, ) - self.list_openapi = to_raw_response_wrapper( - functions.list_openapi, - ) @cached_property def invocations(self) -> InvocationsResourceWithRawResponse: @@ -370,9 +329,6 @@ def __init__(self, functions: AsyncFunctionsResource) -> None: self.invoke_sync = async_to_raw_response_wrapper( functions.invoke_sync, ) - self.list_openapi = async_to_raw_response_wrapper( - functions.list_openapi, - ) @cached_property def invocations(self) -> AsyncInvocationsResourceWithRawResponse: @@ -392,9 +348,6 @@ def __init__(self, functions: FunctionsResource) -> None: self.invoke_sync = to_streamed_response_wrapper( functions.invoke_sync, ) - self.list_openapi = to_streamed_response_wrapper( - functions.list_openapi, - ) @cached_property def invocations(self) -> InvocationsResourceWithStreamingResponse: @@ -414,9 +367,6 @@ def __init__(self, functions: AsyncFunctionsResource) -> None: self.invoke_sync = async_to_streamed_response_wrapper( functions.invoke_sync, ) - self.list_openapi = async_to_streamed_response_wrapper( - functions.list_openapi, - ) @cached_property def invocations(self) -> AsyncInvocationsResourceWithStreamingResponse: diff --git a/src/runloop_api_client/resources/functions/invocations.py b/src/runloop_api_client/resources/functions/invocations.py index 5e9c2b046..59491d1e7 100755 --- a/src/runloop_api_client/resources/functions/invocations.py +++ b/src/runloop_api_client/resources/functions/invocations.py @@ -19,7 +19,6 @@ ) from ..._base_client import make_request_options from ...types.functions import invocation_list_params -from ...types.functions.invocation_logs_response import InvocationLogsResponse from ...types.functions.function_invocation_list_view import FunctionInvocationListView from ...types.shared.function_invocation_execution_detail_view import FunctionInvocationExecutionDetailView @@ -150,39 +149,6 @@ def kill( cast_to=object, ) - def logs( - self, - invocation_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InvocationLogsResponse: - """ - Get the logs for the given invocation. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not invocation_id: - raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}") - return self._get( - f"/v1/functions/invocations/{invocation_id}/logs", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=InvocationLogsResponse, - ) - class AsyncInvocationsResource(AsyncAPIResource): @cached_property @@ -308,39 +274,6 @@ async def kill( cast_to=object, ) - async def logs( - self, - invocation_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> InvocationLogsResponse: - """ - Get the logs for the given invocation. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not invocation_id: - raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}") - return await self._get( - f"/v1/functions/invocations/{invocation_id}/logs", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=InvocationLogsResponse, - ) - class InvocationsResourceWithRawResponse: def __init__(self, invocations: InvocationsResource) -> None: @@ -355,9 +288,6 @@ def __init__(self, invocations: InvocationsResource) -> None: self.kill = to_raw_response_wrapper( invocations.kill, ) - self.logs = to_raw_response_wrapper( - invocations.logs, - ) class AsyncInvocationsResourceWithRawResponse: @@ -373,9 +303,6 @@ def __init__(self, invocations: AsyncInvocationsResource) -> None: self.kill = async_to_raw_response_wrapper( invocations.kill, ) - self.logs = async_to_raw_response_wrapper( - invocations.logs, - ) class InvocationsResourceWithStreamingResponse: @@ -391,9 +318,6 @@ def __init__(self, invocations: InvocationsResource) -> None: self.kill = to_streamed_response_wrapper( invocations.kill, ) - self.logs = to_streamed_response_wrapper( - invocations.logs, - ) class AsyncInvocationsResourceWithStreamingResponse: @@ -409,6 +333,3 @@ def __init__(self, invocations: AsyncInvocationsResource) -> None: self.kill = async_to_streamed_response_wrapper( invocations.kill, ) - self.logs = async_to_streamed_response_wrapper( - invocations.logs, - ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index e1b1ebff5..c24af1bd1 100755 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -9,22 +9,18 @@ from .devbox_view import DevboxView as DevboxView from .resource_size import ResourceSize as ResourceSize from .blueprint_view import BlueprintView as BlueprintView +from .devbox_list_view import DevboxListView as DevboxListView from .project_list_view import ProjectListView as ProjectListView from .devbox_list_params import DevboxListParams as DevboxListParams from .function_list_view import FunctionListView as FunctionListView from .blueprint_build_log import BlueprintBuildLog as BlueprintBuildLog from .blueprint_list_view import BlueprintListView as BlueprintListView from .devbox_create_params import DevboxCreateParams as DevboxCreateParams -from .devbox_list_response import DevboxListResponse as DevboxListResponse from .blueprint_list_params import BlueprintListParams as BlueprintListParams from .code_mount_parameters import CodeMountParameters as CodeMountParameters -from .deployment_get_params import DeploymentGetParams as DeploymentGetParams from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams -from .deployment_get_response import DeploymentGetResponse as DeploymentGetResponse from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams -from .deployment_logs_response import DeploymentLogsResponse as DeploymentLogsResponse -from .deployment_tail_response import DeploymentTailResponse as DeploymentTailResponse from .devbox_write_file_params import DevboxWriteFileParams as DevboxWriteFileParams from .devbox_upload_file_params import DevboxUploadFileParams as DevboxUploadFileParams from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters @@ -32,8 +28,6 @@ from .code_mount_parameters_param import CodeMountParametersParam as CodeMountParametersParam from .devbox_execute_async_params import DevboxExecuteAsyncParams as DevboxExecuteAsyncParams from .function_invoke_sync_params import FunctionInvokeSyncParams as FunctionInvokeSyncParams -from .deployment_redeploy_response import DeploymentRedeployResponse as DeploymentRedeployResponse -from .deployment_retrieve_response import DeploymentRetrieveResponse as DeploymentRetrieveResponse from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams from .blueprint_build_logs_list_view import BlueprintBuildLogsListView as BlueprintBuildLogsListView from .devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse as DevboxCreateSSHKeyResponse diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 90ed90bb5..cdfd4886e 100755 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -3,7 +3,6 @@ from __future__ import annotations from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams diff --git a/src/runloop_api_client/types/functions/__init__.py b/src/runloop_api_client/types/functions/__init__.py index da953f2d5..65762ab89 100755 --- a/src/runloop_api_client/types/functions/__init__.py +++ b/src/runloop_api_client/types/functions/__init__.py @@ -3,5 +3,4 @@ from __future__ import annotations from .invocation_list_params import InvocationListParams as InvocationListParams -from .invocation_logs_response import InvocationLogsResponse as InvocationLogsResponse from .function_invocation_list_view import FunctionInvocationListView as FunctionInvocationListView diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index a841221f0..540e32771 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -10,7 +10,6 @@ from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types.devboxes import ( - DevboxLogsListView, DevboxExecutionDetailView, DevboxAsyncExecutionDetailView, ) @@ -21,63 +20,6 @@ class TestExecutions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @parametrize - def test_method_retrieve(self, client: Runloop) -> None: - execution = client.devboxes.executions.retrieve( - exe_id="exeId", - id="id", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - def test_method_retrieve_with_all_params(self, client: Runloop) -> None: - execution = client.devboxes.executions.retrieve( - exe_id="exeId", - id="id", - command="command", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - def test_raw_response_retrieve(self, client: Runloop) -> None: - response = client.devboxes.executions.with_raw_response.retrieve( - exe_id="exeId", - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - execution = response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - def test_streaming_response_retrieve(self, client: Runloop) -> None: - with client.devboxes.executions.with_streaming_response.retrieve( - exe_id="exeId", - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - execution = response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_retrieve(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.executions.with_raw_response.retrieve( - exe_id="exeId", - id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `exe_id` but received ''"): - client.devboxes.executions.with_raw_response.retrieve( - exe_id="", - id="id", - ) - @parametrize def test_method_execute_async(self, client: Runloop) -> None: execution = client.devboxes.executions.execute_async( @@ -170,215 +112,10 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: id="", ) - @parametrize - def test_method_kill(self, client: Runloop) -> None: - execution = client.devboxes.executions.kill( - exe_id="exeId", - id="id", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - def test_raw_response_kill(self, client: Runloop) -> None: - response = client.devboxes.executions.with_raw_response.kill( - exe_id="exeId", - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - execution = response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - def test_streaming_response_kill(self, client: Runloop) -> None: - with client.devboxes.executions.with_streaming_response.kill( - exe_id="exeId", - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - execution = response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_kill(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.executions.with_raw_response.kill( - exe_id="exeId", - id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `exe_id` but received ''"): - client.devboxes.executions.with_raw_response.kill( - exe_id="", - id="id", - ) - - @parametrize - def test_method_logs(self, client: Runloop) -> None: - execution = client.devboxes.executions.logs( - execution_id="execution_id", - id="id", - ) - assert_matches_type(DevboxLogsListView, execution, path=["response"]) - - @parametrize - def test_raw_response_logs(self, client: Runloop) -> None: - response = client.devboxes.executions.with_raw_response.logs( - execution_id="execution_id", - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - execution = response.parse() - assert_matches_type(DevboxLogsListView, execution, path=["response"]) - - @parametrize - def test_streaming_response_logs(self, client: Runloop) -> None: - with client.devboxes.executions.with_streaming_response.logs( - execution_id="execution_id", - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - execution = response.parse() - assert_matches_type(DevboxLogsListView, execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_logs(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.executions.with_raw_response.logs( - execution_id="execution_id", - id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): - client.devboxes.executions.with_raw_response.logs( - execution_id="", - id="id", - ) - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - def test_method_tail(self, client: Runloop) -> None: - execution = client.devboxes.executions.tail( - execution_id="execution_id", - id="id", - ) - assert execution is None - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - def test_raw_response_tail(self, client: Runloop) -> None: - response = client.devboxes.executions.with_raw_response.tail( - execution_id="execution_id", - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - execution = response.parse() - assert execution is None - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - def test_streaming_response_tail(self, client: Runloop) -> None: - with client.devboxes.executions.with_streaming_response.tail( - execution_id="execution_id", - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - execution = response.parse() - assert execution is None - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - def test_path_params_tail(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.executions.with_raw_response.tail( - execution_id="execution_id", - id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): - client.devboxes.executions.with_raw_response.tail( - execution_id="", - id="id", - ) - class TestAsyncExecutions: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @parametrize - async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: - execution = await async_client.devboxes.executions.retrieve( - exe_id="exeId", - id="id", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncRunloop) -> None: - execution = await async_client.devboxes.executions.retrieve( - exe_id="exeId", - id="id", - command="command", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.executions.with_raw_response.retrieve( - exe_id="exeId", - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - execution = await response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.executions.with_streaming_response.retrieve( - exe_id="exeId", - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - execution = await response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.executions.with_raw_response.retrieve( - exe_id="exeId", - id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `exe_id` but received ''"): - await async_client.devboxes.executions.with_raw_response.retrieve( - exe_id="", - id="id", - ) - @parametrize async def test_method_execute_async(self, async_client: AsyncRunloop) -> None: execution = await async_client.devboxes.executions.execute_async( @@ -470,151 +207,3 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non await async_client.devboxes.executions.with_raw_response.execute_sync( id="", ) - - @parametrize - async def test_method_kill(self, async_client: AsyncRunloop) -> None: - execution = await async_client.devboxes.executions.kill( - exe_id="exeId", - id="id", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - async def test_raw_response_kill(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.executions.with_raw_response.kill( - exe_id="exeId", - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - execution = await response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - async def test_streaming_response_kill(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.executions.with_streaming_response.kill( - exe_id="exeId", - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - execution = await response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_kill(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.executions.with_raw_response.kill( - exe_id="exeId", - id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `exe_id` but received ''"): - await async_client.devboxes.executions.with_raw_response.kill( - exe_id="", - id="id", - ) - - @parametrize - async def test_method_logs(self, async_client: AsyncRunloop) -> None: - execution = await async_client.devboxes.executions.logs( - execution_id="execution_id", - id="id", - ) - assert_matches_type(DevboxLogsListView, execution, path=["response"]) - - @parametrize - async def test_raw_response_logs(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.executions.with_raw_response.logs( - execution_id="execution_id", - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - execution = await response.parse() - assert_matches_type(DevboxLogsListView, execution, path=["response"]) - - @parametrize - async def test_streaming_response_logs(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.executions.with_streaming_response.logs( - execution_id="execution_id", - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - execution = await response.parse() - assert_matches_type(DevboxLogsListView, execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_logs(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.executions.with_raw_response.logs( - execution_id="execution_id", - id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): - await async_client.devboxes.executions.with_raw_response.logs( - execution_id="", - id="id", - ) - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - async def test_method_tail(self, async_client: AsyncRunloop) -> None: - execution = await async_client.devboxes.executions.tail( - execution_id="execution_id", - id="id", - ) - assert execution is None - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - async def test_raw_response_tail(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.executions.with_raw_response.tail( - execution_id="execution_id", - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - execution = await response.parse() - assert execution is None - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - async def test_streaming_response_tail(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.executions.with_streaming_response.tail( - execution_id="execution_id", - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - execution = await response.parse() - assert execution is None - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - async def test_path_params_tail(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.executions.with_raw_response.tail( - execution_id="execution_id", - id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): - await async_client.devboxes.executions.with_raw_response.tail( - execution_id="", - id="id", - ) diff --git a/tests/api_resources/devboxes/test_logs.py b/tests/api_resources/devboxes/test_logs.py index 370066940..85ea9be84 100755 --- a/tests/api_resources/devboxes/test_logs.py +++ b/tests/api_resources/devboxes/test_logs.py @@ -55,48 +55,6 @@ def test_path_params_list(self, client: Runloop) -> None: "", ) - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - def test_method_tail(self, client: Runloop) -> None: - log = client.devboxes.logs.tail( - "id", - ) - assert log is None - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - def test_raw_response_tail(self, client: Runloop) -> None: - response = client.devboxes.logs.with_raw_response.tail( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - log = response.parse() - assert log is None - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - def test_streaming_response_tail(self, client: Runloop) -> None: - with client.devboxes.logs.with_streaming_response.tail( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - log = response.parse() - assert log is None - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - def test_path_params_tail(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.logs.with_raw_response.tail( - "", - ) - class TestAsyncLogs: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -138,45 +96,3 @@ async def test_path_params_list(self, async_client: AsyncRunloop) -> None: await async_client.devboxes.logs.with_raw_response.list( "", ) - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - async def test_method_tail(self, async_client: AsyncRunloop) -> None: - log = await async_client.devboxes.logs.tail( - "id", - ) - assert log is None - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - async def test_raw_response_tail(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.logs.with_raw_response.tail( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - log = await response.parse() - assert log is None - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - async def test_streaming_response_tail(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.logs.with_streaming_response.tail( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - log = await response.parse() - assert log is None - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - async def test_path_params_tail(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.logs.with_raw_response.tail( - "", - ) diff --git a/tests/api_resources/functions/test_invocations.py b/tests/api_resources/functions/test_invocations.py index 38953c074..726e5843c 100755 --- a/tests/api_resources/functions/test_invocations.py +++ b/tests/api_resources/functions/test_invocations.py @@ -10,10 +10,7 @@ from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types.shared import FunctionInvocationExecutionDetailView -from runloop_api_client.types.functions import ( - InvocationLogsResponse, - FunctionInvocationListView, -) +from runloop_api_client.types.functions import FunctionInvocationListView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -130,44 +127,6 @@ def test_path_params_kill(self, client: Runloop) -> None: "", ) - @parametrize - def test_method_logs(self, client: Runloop) -> None: - invocation = client.functions.invocations.logs( - "invocation_id", - ) - assert_matches_type(InvocationLogsResponse, invocation, path=["response"]) - - @parametrize - def test_raw_response_logs(self, client: Runloop) -> None: - response = client.functions.invocations.with_raw_response.logs( - "invocation_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - invocation = response.parse() - assert_matches_type(InvocationLogsResponse, invocation, path=["response"]) - - @parametrize - def test_streaming_response_logs(self, client: Runloop) -> None: - with client.functions.invocations.with_streaming_response.logs( - "invocation_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - invocation = response.parse() - assert_matches_type(InvocationLogsResponse, invocation, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_logs(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `invocation_id` but received ''"): - client.functions.invocations.with_raw_response.logs( - "", - ) - class TestAsyncInvocations: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -280,41 +239,3 @@ async def test_path_params_kill(self, async_client: AsyncRunloop) -> None: await async_client.functions.invocations.with_raw_response.kill( "", ) - - @parametrize - async def test_method_logs(self, async_client: AsyncRunloop) -> None: - invocation = await async_client.functions.invocations.logs( - "invocation_id", - ) - assert_matches_type(InvocationLogsResponse, invocation, path=["response"]) - - @parametrize - async def test_raw_response_logs(self, async_client: AsyncRunloop) -> None: - response = await async_client.functions.invocations.with_raw_response.logs( - "invocation_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - invocation = await response.parse() - assert_matches_type(InvocationLogsResponse, invocation, path=["response"]) - - @parametrize - async def test_streaming_response_logs(self, async_client: AsyncRunloop) -> None: - async with async_client.functions.invocations.with_streaming_response.logs( - "invocation_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - invocation = await response.parse() - assert_matches_type(InvocationLogsResponse, invocation, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_logs(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `invocation_id` but received ''"): - await async_client.functions.invocations.with_raw_response.logs( - "", - ) diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 9b82bde44..80fce2549 100755 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -11,7 +11,7 @@ from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types import ( DevboxView, - DevboxListResponse, + DevboxListView, DevboxCreateSSHKeyResponse, ) from runloop_api_client.types.devboxes import DevboxExecutionDetailView, DevboxAsyncExecutionDetailView @@ -107,7 +107,7 @@ def test_path_params_retrieve(self, client: Runloop) -> None: @parametrize def test_method_list(self, client: Runloop) -> None: devbox = client.devboxes.list() - assert_matches_type(DevboxListResponse, devbox, path=["response"]) + assert_matches_type(DevboxListView, devbox, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: @@ -116,7 +116,7 @@ def test_method_list_with_all_params(self, client: Runloop) -> None: starting_after="starting_after", status="status", ) - assert_matches_type(DevboxListResponse, devbox, path=["response"]) + assert_matches_type(DevboxListView, devbox, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -125,7 +125,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert_matches_type(DevboxListResponse, devbox, path=["response"]) + assert_matches_type(DevboxListView, devbox, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -134,7 +134,7 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert_matches_type(DevboxListResponse, devbox, path=["response"]) + assert_matches_type(DevboxListView, devbox, path=["response"]) assert cast(Any, response.is_closed) is True @@ -535,7 +535,7 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.list() - assert_matches_type(DevboxListResponse, devbox, path=["response"]) + assert_matches_type(DevboxListView, devbox, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -544,7 +544,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> starting_after="starting_after", status="status", ) - assert_matches_type(DevboxListResponse, devbox, path=["response"]) + assert_matches_type(DevboxListView, devbox, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -553,7 +553,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert_matches_type(DevboxListResponse, devbox, path=["response"]) + assert_matches_type(DevboxListView, devbox, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -562,7 +562,7 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert_matches_type(DevboxListResponse, devbox, path=["response"]) + assert_matches_type(DevboxListView, devbox, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_functions.py b/tests/api_resources/test_functions.py index fa60f9801..e168b5de1 100755 --- a/tests/api_resources/test_functions.py +++ b/tests/api_resources/test_functions.py @@ -169,31 +169,6 @@ def test_path_params_invoke_sync(self, client: Runloop) -> None: request={}, ) - @parametrize - def test_method_list_openapi(self, client: Runloop) -> None: - function = client.functions.list_openapi() - assert_matches_type(object, function, path=["response"]) - - @parametrize - def test_raw_response_list_openapi(self, client: Runloop) -> None: - response = client.functions.with_raw_response.list_openapi() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - function = response.parse() - assert_matches_type(object, function, path=["response"]) - - @parametrize - def test_streaming_response_list_openapi(self, client: Runloop) -> None: - with client.functions.with_streaming_response.list_openapi() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - function = response.parse() - assert_matches_type(object, function, path=["response"]) - - assert cast(Any, response.is_closed) is True - class TestAsyncFunctions: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -348,28 +323,3 @@ async def test_path_params_invoke_sync(self, async_client: AsyncRunloop) -> None project_name="project_name", request={}, ) - - @parametrize - async def test_method_list_openapi(self, async_client: AsyncRunloop) -> None: - function = await async_client.functions.list_openapi() - assert_matches_type(object, function, path=["response"]) - - @parametrize - async def test_raw_response_list_openapi(self, async_client: AsyncRunloop) -> None: - response = await async_client.functions.with_raw_response.list_openapi() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - function = await response.parse() - assert_matches_type(object, function, path=["response"]) - - @parametrize - async def test_streaming_response_list_openapi(self, async_client: AsyncRunloop) -> None: - async with async_client.functions.with_streaming_response.list_openapi() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - function = await response.parse() - assert_matches_type(object, function, path=["response"]) - - assert cast(Any, response.is_closed) is True diff --git a/tests/test_client.py b/tests/test_client.py index 58485333a..ab10be034 100755 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -20,7 +20,6 @@ from runloop_api_client._types import Omit from runloop_api_client._models import BaseModel, FinalRequestOptions from runloop_api_client._constants import RAW_RESPONSE_HEADER -from runloop_api_client._streaming import Stream, AsyncStream from runloop_api_client._exceptions import RunloopError, APIStatusError, APITimeoutError, APIResponseValidationError from runloop_api_client._base_client import ( DEFAULT_TIMEOUT, @@ -686,17 +685,6 @@ def test_client_max_retries_validation(self) -> None: max_retries=cast(Any, None), ) - @pytest.mark.respx(base_url=base_url) - def test_default_stream_cls(self, respx_mock: MockRouter) -> None: - class Model(BaseModel): - name: str - - respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - - stream = self.client.post("/foo", cast_to=Model, stream=True, stream_cls=Stream[Model]) - assert isinstance(stream, Stream) - stream.response.close() - @pytest.mark.respx(base_url=base_url) def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None: class Model(BaseModel): @@ -1432,18 +1420,6 @@ async def test_client_max_retries_validation(self) -> None: max_retries=cast(Any, None), ) - @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio - async def test_default_stream_cls(self, respx_mock: MockRouter) -> None: - class Model(BaseModel): - name: str - - respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - - stream = await self.client.post("/foo", cast_to=Model, stream=True, stream_cls=AsyncStream[Model]) - assert isinstance(stream, AsyncStream) - await stream.response.aclose() - @pytest.mark.respx(base_url=base_url) @pytest.mark.asyncio async def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None: From 25d54e4985a2fbb0afcfce90a4b6ac0b486843ce Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 23 Aug 2024 23:48:19 +0000 Subject: [PATCH 109/993] chore(internal): version bump (#121) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b0699969f..08e82c45c 100755 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.14" + ".": "0.1.0-alpha.15" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 22380a1af..a0b32864f 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.1.0-alpha.14" +version = "0.1.0-alpha.15" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 70a399d94..b1688be6c 100755 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.1.0-alpha.14" # x-release-please-version +__version__ = "0.1.0-alpha.15" # x-release-please-version From 6406b368b004de6f5faf5d1806905be14346c3aa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 24 Aug 2024 00:16:06 +0000 Subject: [PATCH 110/993] feat(api): OpenAPI spec update via Stainless API (#122) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index f0fee8e9b..d9b066b9f 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 24 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2085d09cb7954db9bd300c0d93f1f08e25b69906011c0d65e899951880372ef1.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ea589851f2dbba35fea6c010ac4c577cad56aa44e1d5bd4e5b472c802b2f13c4.yml From 5d08b2d3ad4edb422e013f36bddeedbe8c676f03 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 17:37:11 +0000 Subject: [PATCH 111/993] feat(api): OpenAPI spec update via Stainless API (#124) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d9b066b9f..aaa4a2093 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 24 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ea589851f2dbba35fea6c010ac4c577cad56aa44e1d5bd4e5b472c802b2f13c4.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-87ac732719d0d74984f695e9b8089220c1e5de2a5f9607ad92286b48b05ad161.yml From ba6bce27eddd6f14aa480394215cb01648f91109 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 18:09:22 +0000 Subject: [PATCH 112/993] feat(api): OpenAPI spec update via Stainless API (#125) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index aaa4a2093..e5785c42b 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 24 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-87ac732719d0d74984f695e9b8089220c1e5de2a5f9607ad92286b48b05ad161.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-7c0be2259b864df540fecbc3b04720c184dd4142bb666849941e081c14c67b5a.yml From 0ccdbaba84be5c50ca79b41b64c65b0c990f5e83 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 18:15:55 +0000 Subject: [PATCH 113/993] feat(api): OpenAPI spec update via Stainless API (#126) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e5785c42b..d9b066b9f 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 24 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-7c0be2259b864df540fecbc3b04720c184dd4142bb666849941e081c14c67b5a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ea589851f2dbba35fea6c010ac4c577cad56aa44e1d5bd4e5b472c802b2f13c4.yml From 611e2cdab3d1e2dc0e35aba5d2c4845d82e046e8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 18:18:27 +0000 Subject: [PATCH 114/993] feat(api): OpenAPI spec update via Stainless API (#127) --- .stats.yml | 4 +- api.md | 1 + .../resources/devboxes/executions.py | 85 ++++++++++++++++ .../api_resources/devboxes/test_executions.py | 97 +++++++++++++++++++ 4 files changed, 185 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d9b066b9f..e07a34ee2 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 24 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ea589851f2dbba35fea6c010ac4c577cad56aa44e1d5bd4e5b472c802b2f13c4.yml +configured_endpoints: 25 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-7c0be2259b864df540fecbc3b04720c184dd4142bb666849941e081c14c67b5a.yml diff --git a/api.md b/api.md index 6bae20322..11554b829 100755 --- a/api.md +++ b/api.md @@ -100,6 +100,7 @@ Methods: - client.devboxes.executions.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.execute_sync(id, \*\*params) -> DevboxExecutionDetailView +- client.devboxes.executions.logs(execution_id, \*, id) -> DevboxLogsListView # Functions diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index 7886822a3..2ca30c3ee 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -19,6 +19,7 @@ ) from ..._base_client import make_request_options from ...types.devboxes import execution_execute_sync_params, execution_execute_async_params +from ...types.devboxes.devbox_logs_list_view import DevboxLogsListView from ...types.devboxes.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devboxes.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView @@ -108,6 +109,42 @@ def execute_sync( cast_to=DevboxExecutionDetailView, ) + def logs( + self, + execution_id: str, + *, + id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxLogsListView: + """ + Get all logs from a Devbox execution by id. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + return self._get( + f"/v1/devboxes/{id}/executions/{execution_id}/logs", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxLogsListView, + ) + class AsyncExecutionsResource(AsyncAPIResource): @cached_property @@ -196,6 +233,42 @@ async def execute_sync( cast_to=DevboxExecutionDetailView, ) + async def logs( + self, + execution_id: str, + *, + id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxLogsListView: + """ + Get all logs from a Devbox execution by id. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + return await self._get( + f"/v1/devboxes/{id}/executions/{execution_id}/logs", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxLogsListView, + ) + class ExecutionsResourceWithRawResponse: def __init__(self, executions: ExecutionsResource) -> None: @@ -207,6 +280,9 @@ def __init__(self, executions: ExecutionsResource) -> None: self.execute_sync = to_raw_response_wrapper( executions.execute_sync, ) + self.logs = to_raw_response_wrapper( + executions.logs, + ) class AsyncExecutionsResourceWithRawResponse: @@ -219,6 +295,9 @@ def __init__(self, executions: AsyncExecutionsResource) -> None: self.execute_sync = async_to_raw_response_wrapper( executions.execute_sync, ) + self.logs = async_to_raw_response_wrapper( + executions.logs, + ) class ExecutionsResourceWithStreamingResponse: @@ -231,6 +310,9 @@ def __init__(self, executions: ExecutionsResource) -> None: self.execute_sync = to_streamed_response_wrapper( executions.execute_sync, ) + self.logs = to_streamed_response_wrapper( + executions.logs, + ) class AsyncExecutionsResourceWithStreamingResponse: @@ -243,3 +325,6 @@ def __init__(self, executions: AsyncExecutionsResource) -> None: self.execute_sync = async_to_streamed_response_wrapper( executions.execute_sync, ) + self.logs = async_to_streamed_response_wrapper( + executions.logs, + ) diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index 540e32771..02a72ccd0 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -10,6 +10,7 @@ from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types.devboxes import ( + DevboxLogsListView, DevboxExecutionDetailView, DevboxAsyncExecutionDetailView, ) @@ -112,6 +113,54 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: id="", ) + @parametrize + def test_method_logs(self, client: Runloop) -> None: + execution = client.devboxes.executions.logs( + execution_id="execution_id", + id="id", + ) + assert_matches_type(DevboxLogsListView, execution, path=["response"]) + + @parametrize + def test_raw_response_logs(self, client: Runloop) -> None: + response = client.devboxes.executions.with_raw_response.logs( + execution_id="execution_id", + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = response.parse() + assert_matches_type(DevboxLogsListView, execution, path=["response"]) + + @parametrize + def test_streaming_response_logs(self, client: Runloop) -> None: + with client.devboxes.executions.with_streaming_response.logs( + execution_id="execution_id", + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = response.parse() + assert_matches_type(DevboxLogsListView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_logs(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.executions.with_raw_response.logs( + execution_id="execution_id", + id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + client.devboxes.executions.with_raw_response.logs( + execution_id="", + id="id", + ) + class TestAsyncExecutions: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -207,3 +256,51 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non await async_client.devboxes.executions.with_raw_response.execute_sync( id="", ) + + @parametrize + async def test_method_logs(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.logs( + execution_id="execution_id", + id="id", + ) + assert_matches_type(DevboxLogsListView, execution, path=["response"]) + + @parametrize + async def test_raw_response_logs(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.executions.with_raw_response.logs( + execution_id="execution_id", + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = await response.parse() + assert_matches_type(DevboxLogsListView, execution, path=["response"]) + + @parametrize + async def test_streaming_response_logs(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.executions.with_streaming_response.logs( + execution_id="execution_id", + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = await response.parse() + assert_matches_type(DevboxLogsListView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_logs(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.executions.with_raw_response.logs( + execution_id="execution_id", + id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + await async_client.devboxes.executions.with_raw_response.logs( + execution_id="", + id="id", + ) From 830becb8ef09e517db8c4f4fde737a266e88bd0e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 18:33:45 +0000 Subject: [PATCH 115/993] feat(api): OpenAPI spec update via Stainless API (#128) --- .stats.yml | 4 +- api.md | 22 +- .../resources/devboxes/devboxes.py | 4 +- .../resources/devboxes/executions.py | 190 +++++++++++++++- src/runloop_api_client/types/__init__.py | 2 + .../devbox_async_execution_detail_view.py | 37 +++ .../types/devboxes/__init__.py | 3 +- .../devboxes/execution_retrieve_params.py | 4 +- .../api_resources/devboxes/test_executions.py | 213 +++++++++++++++++- tests/api_resources/test_devboxes.py | 3 +- 10 files changed, 453 insertions(+), 29 deletions(-) create mode 100755 src/runloop_api_client/types/devbox_async_execution_detail_view.py diff --git a/.stats.yml b/.stats.yml index e07a34ee2..6e8860be6 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 25 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-7c0be2259b864df540fecbc3b04720c184dd4142bb666849941e081c14c67b5a.yml +configured_endpoints: 27 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d63149ceb408730060b259bffc06fc16a400fe1f57ef518f1e9209b698c2105d.yml diff --git a/api.md b/api.md index 11554b829..6cf2d8202 100755 --- a/api.md +++ b/api.md @@ -65,12 +65,12 @@ Methods: - client.devboxes.retrieve(id) -> DevboxView - client.devboxes.list(\*\*params) -> DevboxListView - client.devboxes.create_ssh_key(id) -> DevboxCreateSSHKeyResponse -- client.devboxes.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView -- client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView +- client.devboxes.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView +- client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.read_file_contents(id, \*\*params) -> str - client.devboxes.shutdown(id) -> DevboxView - client.devboxes.upload_file(id, \*\*params) -> object -- client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +- client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView ## Logs @@ -86,20 +86,12 @@ Methods: ## Executions -Types: - -```python -from runloop_api_client.types.devboxes import ( - DevboxAsyncExecutionDetailView, - DevboxExecutionDetailView, - DevboxLogsListView, -) -``` - Methods: -- client.devboxes.executions.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView -- client.devboxes.executions.execute_sync(id, \*\*params) -> DevboxExecutionDetailView +- client.devboxes.executions.retrieve(execution_id, \*, id, \*\*params) -> DevboxAsyncExecutionDetailView +- client.devboxes.executions.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView +- client.devboxes.executions.execute_sync(id, \*\*params) -> DevboxExecutionDetailView +- client.devboxes.executions.kill(execution_id, \*, id) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.logs(execution_id, \*, id) -> DevboxLogsListView # Functions diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index a45032569..b97c599a4 100755 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -49,9 +49,9 @@ from ..._base_client import make_request_options from ...types.devbox_view import DevboxView from ...types.devbox_list_view import DevboxListView +from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse -from ...types.devboxes.devbox_execution_detail_view import DevboxExecutionDetailView -from ...types.devboxes.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView +from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView __all__ = ["DevboxesResource", "AsyncDevboxesResource"] diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index 2ca30c3ee..f293e218d 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -18,10 +18,10 @@ async_to_streamed_response_wrapper, ) from ..._base_client import make_request_options -from ...types.devboxes import execution_execute_sync_params, execution_execute_async_params +from ...types.devboxes import execution_retrieve_params, execution_execute_sync_params, execution_execute_async_params +from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devboxes.devbox_logs_list_view import DevboxLogsListView -from ...types.devboxes.devbox_execution_detail_view import DevboxExecutionDetailView -from ...types.devboxes.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView +from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView __all__ = ["ExecutionsResource", "AsyncExecutionsResource"] @@ -35,6 +35,49 @@ def with_raw_response(self) -> ExecutionsResourceWithRawResponse: def with_streaming_response(self) -> ExecutionsResourceWithStreamingResponse: return ExecutionsResourceWithStreamingResponse(self) + def retrieve( + self, + execution_id: str, + *, + id: str, + last_n: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Get status of an execution on a devbox. + + Args: + last_n: Last n lines of standard error / standard out to return + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + return self._get( + f"/v1/devboxes/{id}/executions/{execution_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"last_n": last_n}, execution_retrieve_params.ExecutionRetrieveParams), + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + def execute_async( self, id: str, @@ -109,6 +152,42 @@ def execute_sync( cast_to=DevboxExecutionDetailView, ) + def kill( + self, + execution_id: str, + *, + id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Kill an asynchronous execution currently running on a devbox + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + return self._post( + f"/v1/devboxes/{id}/executions/{execution_id}/kill", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + def logs( self, execution_id: str, @@ -155,6 +234,51 @@ def with_raw_response(self) -> AsyncExecutionsResourceWithRawResponse: def with_streaming_response(self) -> AsyncExecutionsResourceWithStreamingResponse: return AsyncExecutionsResourceWithStreamingResponse(self) + async def retrieve( + self, + execution_id: str, + *, + id: str, + last_n: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Get status of an execution on a devbox. + + Args: + last_n: Last n lines of standard error / standard out to return + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + return await self._get( + f"/v1/devboxes/{id}/executions/{execution_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + {"last_n": last_n}, execution_retrieve_params.ExecutionRetrieveParams + ), + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + async def execute_async( self, id: str, @@ -233,6 +357,42 @@ async def execute_sync( cast_to=DevboxExecutionDetailView, ) + async def kill( + self, + execution_id: str, + *, + id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Kill an asynchronous execution currently running on a devbox + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + return await self._post( + f"/v1/devboxes/{id}/executions/{execution_id}/kill", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + async def logs( self, execution_id: str, @@ -274,12 +434,18 @@ class ExecutionsResourceWithRawResponse: def __init__(self, executions: ExecutionsResource) -> None: self._executions = executions + self.retrieve = to_raw_response_wrapper( + executions.retrieve, + ) self.execute_async = to_raw_response_wrapper( executions.execute_async, ) self.execute_sync = to_raw_response_wrapper( executions.execute_sync, ) + self.kill = to_raw_response_wrapper( + executions.kill, + ) self.logs = to_raw_response_wrapper( executions.logs, ) @@ -289,12 +455,18 @@ class AsyncExecutionsResourceWithRawResponse: def __init__(self, executions: AsyncExecutionsResource) -> None: self._executions = executions + self.retrieve = async_to_raw_response_wrapper( + executions.retrieve, + ) self.execute_async = async_to_raw_response_wrapper( executions.execute_async, ) self.execute_sync = async_to_raw_response_wrapper( executions.execute_sync, ) + self.kill = async_to_raw_response_wrapper( + executions.kill, + ) self.logs = async_to_raw_response_wrapper( executions.logs, ) @@ -304,12 +476,18 @@ class ExecutionsResourceWithStreamingResponse: def __init__(self, executions: ExecutionsResource) -> None: self._executions = executions + self.retrieve = to_streamed_response_wrapper( + executions.retrieve, + ) self.execute_async = to_streamed_response_wrapper( executions.execute_async, ) self.execute_sync = to_streamed_response_wrapper( executions.execute_sync, ) + self.kill = to_streamed_response_wrapper( + executions.kill, + ) self.logs = to_streamed_response_wrapper( executions.logs, ) @@ -319,12 +497,18 @@ class AsyncExecutionsResourceWithStreamingResponse: def __init__(self, executions: AsyncExecutionsResource) -> None: self._executions = executions + self.retrieve = async_to_streamed_response_wrapper( + executions.retrieve, + ) self.execute_async = async_to_streamed_response_wrapper( executions.execute_async, ) self.execute_sync = async_to_streamed_response_wrapper( executions.execute_sync, ) + self.kill = async_to_streamed_response_wrapper( + executions.kill, + ) self.logs = async_to_streamed_response_wrapper( executions.logs, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index c24af1bd1..2facf2e81 100755 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -28,8 +28,10 @@ from .code_mount_parameters_param import CodeMountParametersParam as CodeMountParametersParam from .devbox_execute_async_params import DevboxExecuteAsyncParams as DevboxExecuteAsyncParams from .function_invoke_sync_params import FunctionInvokeSyncParams as FunctionInvokeSyncParams +from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams from .blueprint_build_logs_list_view import BlueprintBuildLogsListView as BlueprintBuildLogsListView from .devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse as DevboxCreateSSHKeyResponse from .devbox_read_file_contents_params import DevboxReadFileContentsParams as DevboxReadFileContentsParams +from .devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView as DevboxAsyncExecutionDetailView from .devbox_read_file_contents_response import DevboxReadFileContentsResponse as DevboxReadFileContentsResponse diff --git a/src/runloop_api_client/types/devbox_async_execution_detail_view.py b/src/runloop_api_client/types/devbox_async_execution_detail_view.py new file mode 100755 index 000000000..3ff4c9e22 --- /dev/null +++ b/src/runloop_api_client/types/devbox_async_execution_detail_view.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["DevboxAsyncExecutionDetailView"] + + +class DevboxAsyncExecutionDetailView(BaseModel): + devbox_id: Optional[str] = None + """Devbox id where command was executed.""" + + execution_id: Optional[str] = None + """Ephemeral id of the execution in progress.""" + + exit_status: Optional[int] = None + """Exit code of command execution. + + This field will remain unset until the execution has completed. + """ + + status: Optional[Literal["running", "success", "failure", "canceled"]] = None + """Current status of the execution.""" + + stderr: Optional[str] = None + """Standard error generated by command. + + This field will remain unset until the execution has completed. + """ + + stdout: Optional[str] = None + """Standard out generated by command. + + This field will remain unset until the execution has completed. + """ diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index cdfd4886e..b1b732fd4 100755 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -3,7 +3,6 @@ from __future__ import annotations from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView +from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView as DevboxAsyncExecutionDetailView diff --git a/src/runloop_api_client/types/devboxes/execution_retrieve_params.py b/src/runloop_api_client/types/devboxes/execution_retrieve_params.py index 3cafe88fe..3df3dd4a2 100755 --- a/src/runloop_api_client/types/devboxes/execution_retrieve_params.py +++ b/src/runloop_api_client/types/devboxes/execution_retrieve_params.py @@ -10,5 +10,5 @@ class ExecutionRetrieveParams(TypedDict, total=False): id: Required[str] - command: str - """The command to execute on the Devbox.""" + last_n: str + """Last n lines of standard error / standard out to return""" diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index 02a72ccd0..4d448b8ae 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -9,10 +9,9 @@ from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types import DevboxExecutionDetailView, DevboxAsyncExecutionDetailView from runloop_api_client.types.devboxes import ( DevboxLogsListView, - DevboxExecutionDetailView, - DevboxAsyncExecutionDetailView, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -21,6 +20,63 @@ class TestExecutions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + execution = client.devboxes.executions.retrieve( + execution_id="execution_id", + id="id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Runloop) -> None: + execution = client.devboxes.executions.retrieve( + execution_id="execution_id", + id="id", + last_n="last_n", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.devboxes.executions.with_raw_response.retrieve( + execution_id="execution_id", + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.devboxes.executions.with_streaming_response.retrieve( + execution_id="execution_id", + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.executions.with_raw_response.retrieve( + execution_id="execution_id", + id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + client.devboxes.executions.with_raw_response.retrieve( + execution_id="", + id="id", + ) + @parametrize def test_method_execute_async(self, client: Runloop) -> None: execution = client.devboxes.executions.execute_async( @@ -113,6 +169,54 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: id="", ) + @parametrize + def test_method_kill(self, client: Runloop) -> None: + execution = client.devboxes.executions.kill( + execution_id="execution_id", + id="id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_raw_response_kill(self, client: Runloop) -> None: + response = client.devboxes.executions.with_raw_response.kill( + execution_id="execution_id", + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_streaming_response_kill(self, client: Runloop) -> None: + with client.devboxes.executions.with_streaming_response.kill( + execution_id="execution_id", + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_kill(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.executions.with_raw_response.kill( + execution_id="execution_id", + id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + client.devboxes.executions.with_raw_response.kill( + execution_id="", + id="id", + ) + @parametrize def test_method_logs(self, client: Runloop) -> None: execution = client.devboxes.executions.logs( @@ -165,6 +269,63 @@ def test_path_params_logs(self, client: Runloop) -> None: class TestAsyncExecutions: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.retrieve( + execution_id="execution_id", + id="id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.retrieve( + execution_id="execution_id", + id="id", + last_n="last_n", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.executions.with_raw_response.retrieve( + execution_id="execution_id", + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.executions.with_streaming_response.retrieve( + execution_id="execution_id", + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.executions.with_raw_response.retrieve( + execution_id="execution_id", + id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + await async_client.devboxes.executions.with_raw_response.retrieve( + execution_id="", + id="id", + ) + @parametrize async def test_method_execute_async(self, async_client: AsyncRunloop) -> None: execution = await async_client.devboxes.executions.execute_async( @@ -257,6 +418,54 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non id="", ) + @parametrize + async def test_method_kill(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.kill( + execution_id="execution_id", + id="id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_raw_response_kill(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.executions.with_raw_response.kill( + execution_id="execution_id", + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_streaming_response_kill(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.executions.with_streaming_response.kill( + execution_id="execution_id", + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_kill(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.executions.with_raw_response.kill( + execution_id="execution_id", + id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + await async_client.devboxes.executions.with_raw_response.kill( + execution_id="", + id="id", + ) + @parametrize async def test_method_logs(self, async_client: AsyncRunloop) -> None: execution = await async_client.devboxes.executions.logs( diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 80fce2549..2b39d95da 100755 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -12,9 +12,10 @@ from runloop_api_client.types import ( DevboxView, DevboxListView, + DevboxExecutionDetailView, DevboxCreateSSHKeyResponse, + DevboxAsyncExecutionDetailView, ) -from runloop_api_client.types.devboxes import DevboxExecutionDetailView, DevboxAsyncExecutionDetailView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") From 1cebecfb5f3771073ff7ff73e7d83e661ee697b1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 18:39:50 +0000 Subject: [PATCH 116/993] chore(internal): version bump (#129) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 08e82c45c..7e56fe29a 100755 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.15" + ".": "0.1.0-alpha.16" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index a0b32864f..08e8c89b4 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.1.0-alpha.15" +version = "0.1.0-alpha.16" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index b1688be6c..f60e3debc 100755 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.1.0-alpha.15" # x-release-please-version +__version__ = "0.1.0-alpha.16" # x-release-please-version From 3723fa5047d67391b8bdb6454bc613e8df4ff0b6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 19:16:04 +0000 Subject: [PATCH 117/993] feat(api): OpenAPI spec update via Stainless API (#130) --- .stats.yml | 4 +- api.md | 2 - .../resources/devboxes/executions.py | 186 +--------------- .../types/devboxes/__init__.py | 1 - .../api_resources/devboxes/test_executions.py | 210 ------------------ 5 files changed, 3 insertions(+), 400 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6e8860be6..b90a979e7 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 27 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d63149ceb408730060b259bffc06fc16a400fe1f57ef518f1e9209b698c2105d.yml +configured_endpoints: 25 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ea589851f2dbba35fea6c010ac4c577cad56aa44e1d5bd4e5b472c802b2f13c4.yml diff --git a/api.md b/api.md index 6cf2d8202..bd67b903c 100755 --- a/api.md +++ b/api.md @@ -88,10 +88,8 @@ Methods: Methods: -- client.devboxes.executions.retrieve(execution_id, \*, id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.execute_sync(id, \*\*params) -> DevboxExecutionDetailView -- client.devboxes.executions.kill(execution_id, \*, id) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.logs(execution_id, \*, id) -> DevboxLogsListView # Functions diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index f293e218d..d7b123f67 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -18,7 +18,7 @@ async_to_streamed_response_wrapper, ) from ..._base_client import make_request_options -from ...types.devboxes import execution_retrieve_params, execution_execute_sync_params, execution_execute_async_params +from ...types.devboxes import execution_execute_sync_params, execution_execute_async_params from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devboxes.devbox_logs_list_view import DevboxLogsListView from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView @@ -35,49 +35,6 @@ def with_raw_response(self) -> ExecutionsResourceWithRawResponse: def with_streaming_response(self) -> ExecutionsResourceWithStreamingResponse: return ExecutionsResourceWithStreamingResponse(self) - def retrieve( - self, - execution_id: str, - *, - id: str, - last_n: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxAsyncExecutionDetailView: - """ - Get status of an execution on a devbox. - - Args: - last_n: Last n lines of standard error / standard out to return - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - if not execution_id: - raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") - return self._get( - f"/v1/devboxes/{id}/executions/{execution_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform({"last_n": last_n}, execution_retrieve_params.ExecutionRetrieveParams), - ), - cast_to=DevboxAsyncExecutionDetailView, - ) - def execute_async( self, id: str, @@ -152,42 +109,6 @@ def execute_sync( cast_to=DevboxExecutionDetailView, ) - def kill( - self, - execution_id: str, - *, - id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxAsyncExecutionDetailView: - """ - Kill an asynchronous execution currently running on a devbox - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - if not execution_id: - raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") - return self._post( - f"/v1/devboxes/{id}/executions/{execution_id}/kill", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DevboxAsyncExecutionDetailView, - ) - def logs( self, execution_id: str, @@ -234,51 +155,6 @@ def with_raw_response(self) -> AsyncExecutionsResourceWithRawResponse: def with_streaming_response(self) -> AsyncExecutionsResourceWithStreamingResponse: return AsyncExecutionsResourceWithStreamingResponse(self) - async def retrieve( - self, - execution_id: str, - *, - id: str, - last_n: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxAsyncExecutionDetailView: - """ - Get status of an execution on a devbox. - - Args: - last_n: Last n lines of standard error / standard out to return - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - if not execution_id: - raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") - return await self._get( - f"/v1/devboxes/{id}/executions/{execution_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - {"last_n": last_n}, execution_retrieve_params.ExecutionRetrieveParams - ), - ), - cast_to=DevboxAsyncExecutionDetailView, - ) - async def execute_async( self, id: str, @@ -357,42 +233,6 @@ async def execute_sync( cast_to=DevboxExecutionDetailView, ) - async def kill( - self, - execution_id: str, - *, - id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxAsyncExecutionDetailView: - """ - Kill an asynchronous execution currently running on a devbox - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - if not execution_id: - raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") - return await self._post( - f"/v1/devboxes/{id}/executions/{execution_id}/kill", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DevboxAsyncExecutionDetailView, - ) - async def logs( self, execution_id: str, @@ -434,18 +274,12 @@ class ExecutionsResourceWithRawResponse: def __init__(self, executions: ExecutionsResource) -> None: self._executions = executions - self.retrieve = to_raw_response_wrapper( - executions.retrieve, - ) self.execute_async = to_raw_response_wrapper( executions.execute_async, ) self.execute_sync = to_raw_response_wrapper( executions.execute_sync, ) - self.kill = to_raw_response_wrapper( - executions.kill, - ) self.logs = to_raw_response_wrapper( executions.logs, ) @@ -455,18 +289,12 @@ class AsyncExecutionsResourceWithRawResponse: def __init__(self, executions: AsyncExecutionsResource) -> None: self._executions = executions - self.retrieve = async_to_raw_response_wrapper( - executions.retrieve, - ) self.execute_async = async_to_raw_response_wrapper( executions.execute_async, ) self.execute_sync = async_to_raw_response_wrapper( executions.execute_sync, ) - self.kill = async_to_raw_response_wrapper( - executions.kill, - ) self.logs = async_to_raw_response_wrapper( executions.logs, ) @@ -476,18 +304,12 @@ class ExecutionsResourceWithStreamingResponse: def __init__(self, executions: ExecutionsResource) -> None: self._executions = executions - self.retrieve = to_streamed_response_wrapper( - executions.retrieve, - ) self.execute_async = to_streamed_response_wrapper( executions.execute_async, ) self.execute_sync = to_streamed_response_wrapper( executions.execute_sync, ) - self.kill = to_streamed_response_wrapper( - executions.kill, - ) self.logs = to_streamed_response_wrapper( executions.logs, ) @@ -497,18 +319,12 @@ class AsyncExecutionsResourceWithStreamingResponse: def __init__(self, executions: AsyncExecutionsResource) -> None: self._executions = executions - self.retrieve = async_to_streamed_response_wrapper( - executions.retrieve, - ) self.execute_async = async_to_streamed_response_wrapper( executions.execute_async, ) self.execute_sync = async_to_streamed_response_wrapper( executions.execute_sync, ) - self.kill = async_to_streamed_response_wrapper( - executions.kill, - ) self.logs = async_to_streamed_response_wrapper( executions.logs, ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index b1b732fd4..78164e487 100755 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -3,6 +3,5 @@ from __future__ import annotations from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index 4d448b8ae..39e846af5 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -20,63 +20,6 @@ class TestExecutions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @parametrize - def test_method_retrieve(self, client: Runloop) -> None: - execution = client.devboxes.executions.retrieve( - execution_id="execution_id", - id="id", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - def test_method_retrieve_with_all_params(self, client: Runloop) -> None: - execution = client.devboxes.executions.retrieve( - execution_id="execution_id", - id="id", - last_n="last_n", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - def test_raw_response_retrieve(self, client: Runloop) -> None: - response = client.devboxes.executions.with_raw_response.retrieve( - execution_id="execution_id", - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - execution = response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - def test_streaming_response_retrieve(self, client: Runloop) -> None: - with client.devboxes.executions.with_streaming_response.retrieve( - execution_id="execution_id", - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - execution = response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_retrieve(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.executions.with_raw_response.retrieve( - execution_id="execution_id", - id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): - client.devboxes.executions.with_raw_response.retrieve( - execution_id="", - id="id", - ) - @parametrize def test_method_execute_async(self, client: Runloop) -> None: execution = client.devboxes.executions.execute_async( @@ -169,54 +112,6 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: id="", ) - @parametrize - def test_method_kill(self, client: Runloop) -> None: - execution = client.devboxes.executions.kill( - execution_id="execution_id", - id="id", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - def test_raw_response_kill(self, client: Runloop) -> None: - response = client.devboxes.executions.with_raw_response.kill( - execution_id="execution_id", - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - execution = response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - def test_streaming_response_kill(self, client: Runloop) -> None: - with client.devboxes.executions.with_streaming_response.kill( - execution_id="execution_id", - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - execution = response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_kill(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.executions.with_raw_response.kill( - execution_id="execution_id", - id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): - client.devboxes.executions.with_raw_response.kill( - execution_id="", - id="id", - ) - @parametrize def test_method_logs(self, client: Runloop) -> None: execution = client.devboxes.executions.logs( @@ -269,63 +164,6 @@ def test_path_params_logs(self, client: Runloop) -> None: class TestAsyncExecutions: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @parametrize - async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: - execution = await async_client.devboxes.executions.retrieve( - execution_id="execution_id", - id="id", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncRunloop) -> None: - execution = await async_client.devboxes.executions.retrieve( - execution_id="execution_id", - id="id", - last_n="last_n", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.executions.with_raw_response.retrieve( - execution_id="execution_id", - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - execution = await response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.executions.with_streaming_response.retrieve( - execution_id="execution_id", - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - execution = await response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.executions.with_raw_response.retrieve( - execution_id="execution_id", - id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): - await async_client.devboxes.executions.with_raw_response.retrieve( - execution_id="", - id="id", - ) - @parametrize async def test_method_execute_async(self, async_client: AsyncRunloop) -> None: execution = await async_client.devboxes.executions.execute_async( @@ -418,54 +256,6 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non id="", ) - @parametrize - async def test_method_kill(self, async_client: AsyncRunloop) -> None: - execution = await async_client.devboxes.executions.kill( - execution_id="execution_id", - id="id", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - async def test_raw_response_kill(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.executions.with_raw_response.kill( - execution_id="execution_id", - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - execution = await response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - async def test_streaming_response_kill(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.executions.with_streaming_response.kill( - execution_id="execution_id", - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - execution = await response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_kill(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.executions.with_raw_response.kill( - execution_id="execution_id", - id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): - await async_client.devboxes.executions.with_raw_response.kill( - execution_id="", - id="id", - ) - @parametrize async def test_method_logs(self, async_client: AsyncRunloop) -> None: execution = await async_client.devboxes.executions.logs( From aebe27fb903230c8b38c412604788ad8b3a77975 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 21:16:12 +0000 Subject: [PATCH 118/993] feat(api): OpenAPI spec update via Stainless API (#132) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index b90a979e7..1c42ded55 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 25 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ea589851f2dbba35fea6c010ac4c577cad56aa44e1d5bd4e5b472c802b2f13c4.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-05b4374cd4751b3021b94365f5e0d14c27193946cc1ede9af948f7e318f80410.yml From b2e97da9248dfcd96f917172332cb86bd15c620d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 23:15:55 +0000 Subject: [PATCH 119/993] feat(api): OpenAPI spec update via Stainless API (#133) --- .stats.yml | 4 +- api.md | 2 + .../resources/devboxes/executions.py | 186 +++++++++++++++- .../types/devboxes/__init__.py | 1 + .../api_resources/devboxes/test_executions.py | 210 ++++++++++++++++++ 5 files changed, 400 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1c42ded55..b69a65bc5 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 25 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-05b4374cd4751b3021b94365f5e0d14c27193946cc1ede9af948f7e318f80410.yml +configured_endpoints: 27 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eeee06185591459ed75cfe68fd211ab2407a0c80bccb95d6cb876f6eb0cfbb11.yml diff --git a/api.md b/api.md index bd67b903c..6cf2d8202 100755 --- a/api.md +++ b/api.md @@ -88,8 +88,10 @@ Methods: Methods: +- client.devboxes.executions.retrieve(execution_id, \*, id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.execute_sync(id, \*\*params) -> DevboxExecutionDetailView +- client.devboxes.executions.kill(execution_id, \*, id) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.logs(execution_id, \*, id) -> DevboxLogsListView # Functions diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index d7b123f67..f293e218d 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -18,7 +18,7 @@ async_to_streamed_response_wrapper, ) from ..._base_client import make_request_options -from ...types.devboxes import execution_execute_sync_params, execution_execute_async_params +from ...types.devboxes import execution_retrieve_params, execution_execute_sync_params, execution_execute_async_params from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devboxes.devbox_logs_list_view import DevboxLogsListView from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView @@ -35,6 +35,49 @@ def with_raw_response(self) -> ExecutionsResourceWithRawResponse: def with_streaming_response(self) -> ExecutionsResourceWithStreamingResponse: return ExecutionsResourceWithStreamingResponse(self) + def retrieve( + self, + execution_id: str, + *, + id: str, + last_n: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Get status of an execution on a devbox. + + Args: + last_n: Last n lines of standard error / standard out to return + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + return self._get( + f"/v1/devboxes/{id}/executions/{execution_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"last_n": last_n}, execution_retrieve_params.ExecutionRetrieveParams), + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + def execute_async( self, id: str, @@ -109,6 +152,42 @@ def execute_sync( cast_to=DevboxExecutionDetailView, ) + def kill( + self, + execution_id: str, + *, + id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Kill an asynchronous execution currently running on a devbox + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + return self._post( + f"/v1/devboxes/{id}/executions/{execution_id}/kill", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + def logs( self, execution_id: str, @@ -155,6 +234,51 @@ def with_raw_response(self) -> AsyncExecutionsResourceWithRawResponse: def with_streaming_response(self) -> AsyncExecutionsResourceWithStreamingResponse: return AsyncExecutionsResourceWithStreamingResponse(self) + async def retrieve( + self, + execution_id: str, + *, + id: str, + last_n: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Get status of an execution on a devbox. + + Args: + last_n: Last n lines of standard error / standard out to return + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + return await self._get( + f"/v1/devboxes/{id}/executions/{execution_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + {"last_n": last_n}, execution_retrieve_params.ExecutionRetrieveParams + ), + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + async def execute_async( self, id: str, @@ -233,6 +357,42 @@ async def execute_sync( cast_to=DevboxExecutionDetailView, ) + async def kill( + self, + execution_id: str, + *, + id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Kill an asynchronous execution currently running on a devbox + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + return await self._post( + f"/v1/devboxes/{id}/executions/{execution_id}/kill", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + async def logs( self, execution_id: str, @@ -274,12 +434,18 @@ class ExecutionsResourceWithRawResponse: def __init__(self, executions: ExecutionsResource) -> None: self._executions = executions + self.retrieve = to_raw_response_wrapper( + executions.retrieve, + ) self.execute_async = to_raw_response_wrapper( executions.execute_async, ) self.execute_sync = to_raw_response_wrapper( executions.execute_sync, ) + self.kill = to_raw_response_wrapper( + executions.kill, + ) self.logs = to_raw_response_wrapper( executions.logs, ) @@ -289,12 +455,18 @@ class AsyncExecutionsResourceWithRawResponse: def __init__(self, executions: AsyncExecutionsResource) -> None: self._executions = executions + self.retrieve = async_to_raw_response_wrapper( + executions.retrieve, + ) self.execute_async = async_to_raw_response_wrapper( executions.execute_async, ) self.execute_sync = async_to_raw_response_wrapper( executions.execute_sync, ) + self.kill = async_to_raw_response_wrapper( + executions.kill, + ) self.logs = async_to_raw_response_wrapper( executions.logs, ) @@ -304,12 +476,18 @@ class ExecutionsResourceWithStreamingResponse: def __init__(self, executions: ExecutionsResource) -> None: self._executions = executions + self.retrieve = to_streamed_response_wrapper( + executions.retrieve, + ) self.execute_async = to_streamed_response_wrapper( executions.execute_async, ) self.execute_sync = to_streamed_response_wrapper( executions.execute_sync, ) + self.kill = to_streamed_response_wrapper( + executions.kill, + ) self.logs = to_streamed_response_wrapper( executions.logs, ) @@ -319,12 +497,18 @@ class AsyncExecutionsResourceWithStreamingResponse: def __init__(self, executions: AsyncExecutionsResource) -> None: self._executions = executions + self.retrieve = async_to_streamed_response_wrapper( + executions.retrieve, + ) self.execute_async = async_to_streamed_response_wrapper( executions.execute_async, ) self.execute_sync = async_to_streamed_response_wrapper( executions.execute_sync, ) + self.kill = async_to_streamed_response_wrapper( + executions.kill, + ) self.logs = async_to_streamed_response_wrapper( executions.logs, ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 78164e487..b1b732fd4 100755 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -3,5 +3,6 @@ from __future__ import annotations from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index 39e846af5..4d448b8ae 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -20,6 +20,63 @@ class TestExecutions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + execution = client.devboxes.executions.retrieve( + execution_id="execution_id", + id="id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Runloop) -> None: + execution = client.devboxes.executions.retrieve( + execution_id="execution_id", + id="id", + last_n="last_n", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.devboxes.executions.with_raw_response.retrieve( + execution_id="execution_id", + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.devboxes.executions.with_streaming_response.retrieve( + execution_id="execution_id", + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.executions.with_raw_response.retrieve( + execution_id="execution_id", + id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + client.devboxes.executions.with_raw_response.retrieve( + execution_id="", + id="id", + ) + @parametrize def test_method_execute_async(self, client: Runloop) -> None: execution = client.devboxes.executions.execute_async( @@ -112,6 +169,54 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: id="", ) + @parametrize + def test_method_kill(self, client: Runloop) -> None: + execution = client.devboxes.executions.kill( + execution_id="execution_id", + id="id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_raw_response_kill(self, client: Runloop) -> None: + response = client.devboxes.executions.with_raw_response.kill( + execution_id="execution_id", + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_streaming_response_kill(self, client: Runloop) -> None: + with client.devboxes.executions.with_streaming_response.kill( + execution_id="execution_id", + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_kill(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.executions.with_raw_response.kill( + execution_id="execution_id", + id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + client.devboxes.executions.with_raw_response.kill( + execution_id="", + id="id", + ) + @parametrize def test_method_logs(self, client: Runloop) -> None: execution = client.devboxes.executions.logs( @@ -164,6 +269,63 @@ def test_path_params_logs(self, client: Runloop) -> None: class TestAsyncExecutions: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.retrieve( + execution_id="execution_id", + id="id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.retrieve( + execution_id="execution_id", + id="id", + last_n="last_n", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.executions.with_raw_response.retrieve( + execution_id="execution_id", + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.executions.with_streaming_response.retrieve( + execution_id="execution_id", + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.executions.with_raw_response.retrieve( + execution_id="execution_id", + id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + await async_client.devboxes.executions.with_raw_response.retrieve( + execution_id="", + id="id", + ) + @parametrize async def test_method_execute_async(self, async_client: AsyncRunloop) -> None: execution = await async_client.devboxes.executions.execute_async( @@ -256,6 +418,54 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non id="", ) + @parametrize + async def test_method_kill(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.kill( + execution_id="execution_id", + id="id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_raw_response_kill(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.executions.with_raw_response.kill( + execution_id="execution_id", + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_streaming_response_kill(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.executions.with_streaming_response.kill( + execution_id="execution_id", + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_kill(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.executions.with_raw_response.kill( + execution_id="execution_id", + id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + await async_client.devboxes.executions.with_raw_response.kill( + execution_id="", + id="id", + ) + @parametrize async def test_method_logs(self, async_client: AsyncRunloop) -> None: execution = await async_client.devboxes.executions.logs( From a24e8e52768d23edc8069cd19f5345861ba4fb9d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2024 23:56:49 +0000 Subject: [PATCH 120/993] feat(api): OpenAPI spec update via Stainless API (#134) --- .stats.yml | 4 +- api.md | 6 +- .../resources/deployments.py | 488 ------------------ .../resources/devboxes/devboxes.py | 90 ---- .../resources/devboxes/executions.py | 89 +--- .../resources/devboxes/logs.py | 23 +- src/runloop_api_client/types/__init__.py | 1 - .../types/deployment_get_params.py | 15 - .../types/deployment_get_response.py | 59 --- .../types/deployment_logs_response.py | 26 - .../types/deployment_redeploy_response.py | 50 -- .../types/deployment_retrieve_response.py | 50 -- .../types/deployment_tail_response.py | 26 - .../devbox_async_execution_detail_view.py | 2 +- .../types/devbox_execute_async_params.py | 12 - .../types/devbox_list_response.py | 17 - .../types/devboxes/__init__.py | 1 + .../devbox_async_execution_detail_view.py | 37 -- .../devboxes/devbox_execution_detail_view.py | 21 - .../log_list_params.py} | 8 +- .../functions/invocation_logs_response.py | 26 - .../api_resources/devboxes/test_executions.py | 99 ---- tests/api_resources/devboxes/test_logs.py | 32 +- tests/api_resources/test_deployments.py | 406 --------------- tests/api_resources/test_devboxes.py | 93 ---- 25 files changed, 57 insertions(+), 1624 deletions(-) delete mode 100755 src/runloop_api_client/resources/deployments.py delete mode 100755 src/runloop_api_client/types/deployment_get_params.py delete mode 100755 src/runloop_api_client/types/deployment_get_response.py delete mode 100755 src/runloop_api_client/types/deployment_logs_response.py delete mode 100755 src/runloop_api_client/types/deployment_redeploy_response.py delete mode 100755 src/runloop_api_client/types/deployment_retrieve_response.py delete mode 100755 src/runloop_api_client/types/deployment_tail_response.py delete mode 100755 src/runloop_api_client/types/devbox_execute_async_params.py delete mode 100755 src/runloop_api_client/types/devbox_list_response.py delete mode 100755 src/runloop_api_client/types/devboxes/devbox_async_execution_detail_view.py delete mode 100755 src/runloop_api_client/types/devboxes/devbox_execution_detail_view.py rename src/runloop_api_client/types/{devbox_read_file_params.py => devboxes/log_list_params.py} (53%) mode change 100755 => 100644 delete mode 100755 src/runloop_api_client/types/functions/invocation_logs_response.py delete mode 100755 tests/api_resources/test_deployments.py diff --git a/.stats.yml b/.stats.yml index b69a65bc5..33321e045 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 27 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eeee06185591459ed75cfe68fd211ab2407a0c80bccb95d6cb876f6eb0cfbb11.yml +configured_endpoints: 26 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f604aab9dce4ace8553e47c1fba2785330184e2b57ef594de0ac6e4027b9fd66.yml diff --git a/api.md b/api.md index 6cf2d8202..7553b1877 100755 --- a/api.md +++ b/api.md @@ -65,7 +65,6 @@ Methods: - client.devboxes.retrieve(id) -> DevboxView - client.devboxes.list(\*\*params) -> DevboxListView - client.devboxes.create_ssh_key(id) -> DevboxCreateSSHKeyResponse -- client.devboxes.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.read_file_contents(id, \*\*params) -> str - client.devboxes.shutdown(id) -> DevboxView @@ -82,17 +81,16 @@ from runloop_api_client.types.devboxes import DevboxLogsListView Methods: -- client.devboxes.logs.list(id) -> DevboxLogsListView +- client.devboxes.logs.list(id, \*\*params) -> DevboxLogsListView ## Executions Methods: - client.devboxes.executions.retrieve(execution_id, \*, id, \*\*params) -> DevboxAsyncExecutionDetailView -- client.devboxes.executions.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView +- client.devboxes.executions.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.executions.kill(execution_id, \*, id) -> DevboxAsyncExecutionDetailView -- client.devboxes.executions.logs(execution_id, \*, id) -> DevboxLogsListView # Functions diff --git a/src/runloop_api_client/resources/deployments.py b/src/runloop_api_client/resources/deployments.py deleted file mode 100755 index 70abbe237..000000000 --- a/src/runloop_api_client/resources/deployments.py +++ /dev/null @@ -1,488 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..types import deployment_get_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._base_client import make_request_options -from ..types.deployment_get_response import DeploymentGetResponse -from ..types.deployment_logs_response import DeploymentLogsResponse -from ..types.deployment_tail_response import DeploymentTailResponse -from ..types.deployment_redeploy_response import DeploymentRedeployResponse -from ..types.deployment_retrieve_response import DeploymentRetrieveResponse - -__all__ = ["DeploymentsResource", "AsyncDeploymentsResource"] - - -class DeploymentsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> DeploymentsResourceWithRawResponse: - return DeploymentsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> DeploymentsResourceWithStreamingResponse: - return DeploymentsResourceWithStreamingResponse(self) - - def retrieve( - self, - deployment_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DeploymentRetrieveResponse: - """ - Get details of a deployment - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not deployment_id: - raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") - return self._get( - f"/v1/deployments/{deployment_id}", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DeploymentRetrieveResponse, - ) - - def get( - self, - *, - limit: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DeploymentGetResponse: - """ - Get list of all deployments for the authenticated user. - - Args: - limit: Page Limit - - starting_after: Load the next page starting after the given token. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get( - "/v1/deployments", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "limit": limit, - "starting_after": starting_after, - }, - deployment_get_params.DeploymentGetParams, - ), - ), - cast_to=DeploymentGetResponse, - ) - - def logs( - self, - deployment_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DeploymentLogsResponse: - """ - Get list of all logs from a deployment. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not deployment_id: - raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") - return self._get( - f"/v1/deployments/{deployment_id}/logs", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DeploymentLogsResponse, - ) - - def redeploy( - self, - deployment_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DeploymentRedeployResponse: - """ - Creates a deployment for a previously deployed version. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not deployment_id: - raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") - return self._post( - f"/v1/deployments/{deployment_id}/redeploy", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DeploymentRedeployResponse, - ) - - def tail( - self, - deployment_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DeploymentTailResponse: - """ - Tails the logs for the given deployment with SSE streaming - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not deployment_id: - raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") - return self._get( - f"/v1/deployments/{deployment_id}/logs/tail", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DeploymentTailResponse, - ) - - -class AsyncDeploymentsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncDeploymentsResourceWithRawResponse: - return AsyncDeploymentsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncDeploymentsResourceWithStreamingResponse: - return AsyncDeploymentsResourceWithStreamingResponse(self) - - async def retrieve( - self, - deployment_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DeploymentRetrieveResponse: - """ - Get details of a deployment - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not deployment_id: - raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") - return await self._get( - f"/v1/deployments/{deployment_id}", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DeploymentRetrieveResponse, - ) - - async def get( - self, - *, - limit: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DeploymentGetResponse: - """ - Get list of all deployments for the authenticated user. - - Args: - limit: Page Limit - - starting_after: Load the next page starting after the given token. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return await self._get( - "/v1/deployments", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "limit": limit, - "starting_after": starting_after, - }, - deployment_get_params.DeploymentGetParams, - ), - ), - cast_to=DeploymentGetResponse, - ) - - async def logs( - self, - deployment_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DeploymentLogsResponse: - """ - Get list of all logs from a deployment. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not deployment_id: - raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") - return await self._get( - f"/v1/deployments/{deployment_id}/logs", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DeploymentLogsResponse, - ) - - async def redeploy( - self, - deployment_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DeploymentRedeployResponse: - """ - Creates a deployment for a previously deployed version. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not deployment_id: - raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") - return await self._post( - f"/v1/deployments/{deployment_id}/redeploy", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DeploymentRedeployResponse, - ) - - async def tail( - self, - deployment_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DeploymentTailResponse: - """ - Tails the logs for the given deployment with SSE streaming - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not deployment_id: - raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}") - return await self._get( - f"/v1/deployments/{deployment_id}/logs/tail", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DeploymentTailResponse, - ) - - -class DeploymentsResourceWithRawResponse: - def __init__(self, deployments: DeploymentsResource) -> None: - self._deployments = deployments - - self.retrieve = to_raw_response_wrapper( - deployments.retrieve, - ) - self.get = to_raw_response_wrapper( - deployments.get, - ) - self.logs = to_raw_response_wrapper( - deployments.logs, - ) - self.redeploy = to_raw_response_wrapper( - deployments.redeploy, - ) - self.tail = to_raw_response_wrapper( - deployments.tail, - ) - - -class AsyncDeploymentsResourceWithRawResponse: - def __init__(self, deployments: AsyncDeploymentsResource) -> None: - self._deployments = deployments - - self.retrieve = async_to_raw_response_wrapper( - deployments.retrieve, - ) - self.get = async_to_raw_response_wrapper( - deployments.get, - ) - self.logs = async_to_raw_response_wrapper( - deployments.logs, - ) - self.redeploy = async_to_raw_response_wrapper( - deployments.redeploy, - ) - self.tail = async_to_raw_response_wrapper( - deployments.tail, - ) - - -class DeploymentsResourceWithStreamingResponse: - def __init__(self, deployments: DeploymentsResource) -> None: - self._deployments = deployments - - self.retrieve = to_streamed_response_wrapper( - deployments.retrieve, - ) - self.get = to_streamed_response_wrapper( - deployments.get, - ) - self.logs = to_streamed_response_wrapper( - deployments.logs, - ) - self.redeploy = to_streamed_response_wrapper( - deployments.redeploy, - ) - self.tail = to_streamed_response_wrapper( - deployments.tail, - ) - - -class AsyncDeploymentsResourceWithStreamingResponse: - def __init__(self, deployments: AsyncDeploymentsResource) -> None: - self._deployments = deployments - - self.retrieve = async_to_streamed_response_wrapper( - deployments.retrieve, - ) - self.get = async_to_streamed_response_wrapper( - deployments.get, - ) - self.logs = async_to_streamed_response_wrapper( - deployments.logs, - ) - self.redeploy = async_to_streamed_response_wrapper( - deployments.redeploy, - ) - self.tail = async_to_streamed_response_wrapper( - deployments.tail, - ) diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index b97c599a4..70be80571 100755 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -20,7 +20,6 @@ devbox_write_file_params, devbox_upload_file_params, devbox_execute_sync_params, - devbox_execute_async_params, devbox_read_file_contents_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes @@ -51,7 +50,6 @@ from ...types.devbox_list_view import DevboxListView from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse -from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView __all__ = ["DevboxesResource", "AsyncDevboxesResource"] @@ -271,43 +269,6 @@ def create_ssh_key( cast_to=DevboxCreateSSHKeyResponse, ) - def execute_async( - self, - id: str, - *, - command: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxAsyncExecutionDetailView: - """ - Asynchronously execute a command on a devbox - - Args: - command: The command to execute on the Devbox. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/executions/execute_async", - body=maybe_transform({"command": command}, devbox_execute_async_params.DevboxExecuteAsyncParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DevboxAsyncExecutionDetailView, - ) - def execute_sync( self, id: str, @@ -729,45 +690,6 @@ async def create_ssh_key( cast_to=DevboxCreateSSHKeyResponse, ) - async def execute_async( - self, - id: str, - *, - command: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxAsyncExecutionDetailView: - """ - Asynchronously execute a command on a devbox - - Args: - command: The command to execute on the Devbox. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/executions/execute_async", - body=await async_maybe_transform( - {"command": command}, devbox_execute_async_params.DevboxExecuteAsyncParams - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DevboxAsyncExecutionDetailView, - ) - async def execute_sync( self, id: str, @@ -990,9 +912,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.create_ssh_key = to_raw_response_wrapper( devboxes.create_ssh_key, ) - self.execute_async = to_raw_response_wrapper( - devboxes.execute_async, - ) self.execute_sync = to_raw_response_wrapper( devboxes.execute_sync, ) @@ -1034,9 +953,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.create_ssh_key = async_to_raw_response_wrapper( devboxes.create_ssh_key, ) - self.execute_async = async_to_raw_response_wrapper( - devboxes.execute_async, - ) self.execute_sync = async_to_raw_response_wrapper( devboxes.execute_sync, ) @@ -1078,9 +994,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.create_ssh_key = to_streamed_response_wrapper( devboxes.create_ssh_key, ) - self.execute_async = to_streamed_response_wrapper( - devboxes.execute_async, - ) self.execute_sync = to_streamed_response_wrapper( devboxes.execute_sync, ) @@ -1122,9 +1035,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.create_ssh_key = async_to_streamed_response_wrapper( devboxes.create_ssh_key, ) - self.execute_async = async_to_streamed_response_wrapper( - devboxes.execute_async, - ) self.execute_sync = async_to_streamed_response_wrapper( devboxes.execute_sync, ) diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index f293e218d..3ebba5fc9 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -20,7 +20,6 @@ from ..._base_client import make_request_options from ...types.devboxes import execution_retrieve_params, execution_execute_sync_params, execution_execute_async_params from ...types.devbox_execution_detail_view import DevboxExecutionDetailView -from ...types.devboxes.devbox_logs_list_view import DevboxLogsListView from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView __all__ = ["ExecutionsResource", "AsyncExecutionsResource"] @@ -107,7 +106,7 @@ def execute_async( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( - f"/v1/devboxes/{id}/executions/execute_async", + f"/v1/devboxes/{id}/execute_async", body=maybe_transform({"command": command}, execution_execute_async_params.ExecutionExecuteAsyncParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout @@ -188,42 +187,6 @@ def kill( cast_to=DevboxAsyncExecutionDetailView, ) - def logs( - self, - execution_id: str, - *, - id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxLogsListView: - """ - Get all logs from a Devbox execution by id. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - if not execution_id: - raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") - return self._get( - f"/v1/devboxes/{id}/executions/{execution_id}/logs", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DevboxLogsListView, - ) - class AsyncExecutionsResource(AsyncAPIResource): @cached_property @@ -308,7 +271,7 @@ async def execute_async( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( - f"/v1/devboxes/{id}/executions/execute_async", + f"/v1/devboxes/{id}/execute_async", body=await async_maybe_transform( {"command": command}, execution_execute_async_params.ExecutionExecuteAsyncParams ), @@ -393,42 +356,6 @@ async def kill( cast_to=DevboxAsyncExecutionDetailView, ) - async def logs( - self, - execution_id: str, - *, - id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxLogsListView: - """ - Get all logs from a Devbox execution by id. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - if not execution_id: - raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") - return await self._get( - f"/v1/devboxes/{id}/executions/{execution_id}/logs", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DevboxLogsListView, - ) - class ExecutionsResourceWithRawResponse: def __init__(self, executions: ExecutionsResource) -> None: @@ -446,9 +373,6 @@ def __init__(self, executions: ExecutionsResource) -> None: self.kill = to_raw_response_wrapper( executions.kill, ) - self.logs = to_raw_response_wrapper( - executions.logs, - ) class AsyncExecutionsResourceWithRawResponse: @@ -467,9 +391,6 @@ def __init__(self, executions: AsyncExecutionsResource) -> None: self.kill = async_to_raw_response_wrapper( executions.kill, ) - self.logs = async_to_raw_response_wrapper( - executions.logs, - ) class ExecutionsResourceWithStreamingResponse: @@ -488,9 +409,6 @@ def __init__(self, executions: ExecutionsResource) -> None: self.kill = to_streamed_response_wrapper( executions.kill, ) - self.logs = to_streamed_response_wrapper( - executions.logs, - ) class AsyncExecutionsResourceWithStreamingResponse: @@ -509,6 +427,3 @@ def __init__(self, executions: AsyncExecutionsResource) -> None: self.kill = async_to_streamed_response_wrapper( executions.kill, ) - self.logs = async_to_streamed_response_wrapper( - executions.logs, - ) diff --git a/src/runloop_api_client/resources/devboxes/logs.py b/src/runloop_api_client/resources/devboxes/logs.py index cabe8f329..70d046a87 100755 --- a/src/runloop_api_client/resources/devboxes/logs.py +++ b/src/runloop_api_client/resources/devboxes/logs.py @@ -5,6 +5,10 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -14,6 +18,7 @@ async_to_streamed_response_wrapper, ) from ..._base_client import make_request_options +from ...types.devboxes import log_list_params from ...types.devboxes.devbox_logs_list_view import DevboxLogsListView __all__ = ["LogsResource", "AsyncLogsResource"] @@ -32,6 +37,7 @@ def list( self, id: str, *, + execution_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -43,6 +49,8 @@ def list( Get all logs from a Devbox by id. Args: + execution_id: Id of execution to filter logs by. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -56,7 +64,11 @@ def list( return self._get( f"/v1/devboxes/{id}/logs", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"execution_id": execution_id}, log_list_params.LogListParams), ), cast_to=DevboxLogsListView, ) @@ -75,6 +87,7 @@ async def list( self, id: str, *, + execution_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -86,6 +99,8 @@ async def list( Get all logs from a Devbox by id. Args: + execution_id: Id of execution to filter logs by. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -99,7 +114,11 @@ async def list( return await self._get( f"/v1/devboxes/{id}/logs", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"execution_id": execution_id}, log_list_params.LogListParams), ), cast_to=DevboxLogsListView, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 2facf2e81..eceda8fd6 100755 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -26,7 +26,6 @@ from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams from .code_mount_parameters_param import CodeMountParametersParam as CodeMountParametersParam -from .devbox_execute_async_params import DevboxExecuteAsyncParams as DevboxExecuteAsyncParams from .function_invoke_sync_params import FunctionInvokeSyncParams as FunctionInvokeSyncParams from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams diff --git a/src/runloop_api_client/types/deployment_get_params.py b/src/runloop_api_client/types/deployment_get_params.py deleted file mode 100755 index c4c564b6b..000000000 --- a/src/runloop_api_client/types/deployment_get_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["DeploymentGetParams"] - - -class DeploymentGetParams(TypedDict, total=False): - limit: str - """Page Limit""" - - starting_after: str - """Load the next page starting after the given token.""" diff --git a/src/runloop_api_client/types/deployment_get_response.py b/src/runloop_api_client/types/deployment_get_response.py deleted file mode 100755 index e291ac77f..000000000 --- a/src/runloop_api_client/types/deployment_get_response.py +++ /dev/null @@ -1,59 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["DeploymentGetResponse", "Deployment"] - - -class Deployment(BaseModel): - id: Optional[str] = None - """ID of the deployment.""" - - deploy_commit_message: Optional[str] = None - """Associated Commit Message""" - - deploy_commit_sha: Optional[str] = None - """Associated Commit Sha""" - - deploy_commit_time_ms: Optional[int] = None - """Associated Commit Time""" - - deploy_end_time_ms: Optional[int] = None - """Time the Deploy completed (Unix timestamp milliseconds).""" - - deploy_start_time_ms: Optional[int] = None - """Time the Deploy was started (Unix timestamp milliseconds).""" - - deployed_functions: Optional[List[str]] = None - """The list of deployed functions.""" - - failure_code: Optional[str] = None - """ - Failure code (generic_failure | git_clone_failure | not_runloop_repo | - secrets_failure | provision_failure | runtime_failure). Only set on - deploy_failed. - """ - - failure_message: Optional[str] = None - """Failure message""" - - project_name: Optional[str] = None - """Project name associated with the deployment.""" - - redeploy_of: Optional[str] = None - """ID of original deployment this is redeployment for.""" - - status: Optional[Literal["scheduled", "skipped", "in_progress", "failed", "deployed"]] = None - """Status of the deploy.""" - - -class DeploymentGetResponse(BaseModel): - deployments: Optional[List[Deployment]] = None - """List of projects matching given query.""" - - has_more: Optional[bool] = None - - total_count: Optional[int] = None diff --git a/src/runloop_api_client/types/deployment_logs_response.py b/src/runloop_api_client/types/deployment_logs_response.py deleted file mode 100755 index ccd2ec3da..000000000 --- a/src/runloop_api_client/types/deployment_logs_response.py +++ /dev/null @@ -1,26 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from .._models import BaseModel - -__all__ = ["DeploymentLogsResponse", "Log"] - - -class Log(BaseModel): - level: Optional[str] = None - """Log line severity level.""" - - message: Optional[str] = None - """Log line message.""" - - timestamp_ms: Optional[int] = None - """Time of log (Unix timestamp milliseconds).""" - - -class DeploymentLogsResponse(BaseModel): - deployment_id: Optional[str] = None - """ID of the given deployment.""" - - logs: Optional[List[Log]] = None - """List of logs for the given deployment.""" diff --git a/src/runloop_api_client/types/deployment_redeploy_response.py b/src/runloop_api_client/types/deployment_redeploy_response.py deleted file mode 100755 index 679938a26..000000000 --- a/src/runloop_api_client/types/deployment_redeploy_response.py +++ /dev/null @@ -1,50 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["DeploymentRedeployResponse"] - - -class DeploymentRedeployResponse(BaseModel): - id: Optional[str] = None - """ID of the deployment.""" - - deploy_commit_message: Optional[str] = None - """Associated Commit Message""" - - deploy_commit_sha: Optional[str] = None - """Associated Commit Sha""" - - deploy_commit_time_ms: Optional[int] = None - """Associated Commit Time""" - - deploy_end_time_ms: Optional[int] = None - """Time the Deploy completed (Unix timestamp milliseconds).""" - - deploy_start_time_ms: Optional[int] = None - """Time the Deploy was started (Unix timestamp milliseconds).""" - - deployed_functions: Optional[List[str]] = None - """The list of deployed functions.""" - - failure_code: Optional[str] = None - """ - Failure code (generic_failure | git_clone_failure | not_runloop_repo | - secrets_failure | provision_failure | runtime_failure). Only set on - deploy_failed. - """ - - failure_message: Optional[str] = None - """Failure message""" - - project_name: Optional[str] = None - """Project name associated with the deployment.""" - - redeploy_of: Optional[str] = None - """ID of original deployment this is redeployment for.""" - - status: Optional[Literal["scheduled", "skipped", "in_progress", "failed", "deployed"]] = None - """Status of the deploy.""" diff --git a/src/runloop_api_client/types/deployment_retrieve_response.py b/src/runloop_api_client/types/deployment_retrieve_response.py deleted file mode 100755 index a2fa1bf41..000000000 --- a/src/runloop_api_client/types/deployment_retrieve_response.py +++ /dev/null @@ -1,50 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["DeploymentRetrieveResponse"] - - -class DeploymentRetrieveResponse(BaseModel): - id: Optional[str] = None - """ID of the deployment.""" - - deploy_commit_message: Optional[str] = None - """Associated Commit Message""" - - deploy_commit_sha: Optional[str] = None - """Associated Commit Sha""" - - deploy_commit_time_ms: Optional[int] = None - """Associated Commit Time""" - - deploy_end_time_ms: Optional[int] = None - """Time the Deploy completed (Unix timestamp milliseconds).""" - - deploy_start_time_ms: Optional[int] = None - """Time the Deploy was started (Unix timestamp milliseconds).""" - - deployed_functions: Optional[List[str]] = None - """The list of deployed functions.""" - - failure_code: Optional[str] = None - """ - Failure code (generic_failure | git_clone_failure | not_runloop_repo | - secrets_failure | provision_failure | runtime_failure). Only set on - deploy_failed. - """ - - failure_message: Optional[str] = None - """Failure message""" - - project_name: Optional[str] = None - """Project name associated with the deployment.""" - - redeploy_of: Optional[str] = None - """ID of original deployment this is redeployment for.""" - - status: Optional[Literal["scheduled", "skipped", "in_progress", "failed", "deployed"]] = None - """Status of the deploy.""" diff --git a/src/runloop_api_client/types/deployment_tail_response.py b/src/runloop_api_client/types/deployment_tail_response.py deleted file mode 100755 index afd26fc86..000000000 --- a/src/runloop_api_client/types/deployment_tail_response.py +++ /dev/null @@ -1,26 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from .._models import BaseModel - -__all__ = ["DeploymentTailResponse", "Log"] - - -class Log(BaseModel): - level: Optional[str] = None - """Log line severity level.""" - - message: Optional[str] = None - """Log line message.""" - - timestamp_ms: Optional[int] = None - """Time of log (Unix timestamp milliseconds).""" - - -class DeploymentTailResponse(BaseModel): - deployment_id: Optional[str] = None - """ID of the given deployment.""" - - logs: Optional[List[Log]] = None - """List of logs for the given deployment.""" diff --git a/src/runloop_api_client/types/devbox_async_execution_detail_view.py b/src/runloop_api_client/types/devbox_async_execution_detail_view.py index 3ff4c9e22..b172378b9 100755 --- a/src/runloop_api_client/types/devbox_async_execution_detail_view.py +++ b/src/runloop_api_client/types/devbox_async_execution_detail_view.py @@ -21,7 +21,7 @@ class DevboxAsyncExecutionDetailView(BaseModel): This field will remain unset until the execution has completed. """ - status: Optional[Literal["running", "success", "failure", "canceled"]] = None + status: Optional[Literal["running", "completed", "canceled"]] = None """Current status of the execution.""" stderr: Optional[str] = None diff --git a/src/runloop_api_client/types/devbox_execute_async_params.py b/src/runloop_api_client/types/devbox_execute_async_params.py deleted file mode 100755 index 9f5a7a8f4..000000000 --- a/src/runloop_api_client/types/devbox_execute_async_params.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["DevboxExecuteAsyncParams"] - - -class DevboxExecuteAsyncParams(TypedDict, total=False): - command: str - """The command to execute on the Devbox.""" diff --git a/src/runloop_api_client/types/devbox_list_response.py b/src/runloop_api_client/types/devbox_list_response.py deleted file mode 100755 index d56c67f9f..000000000 --- a/src/runloop_api_client/types/devbox_list_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from .._models import BaseModel -from .devbox_view import DevboxView - -__all__ = ["DevboxListResponse"] - - -class DevboxListResponse(BaseModel): - devboxes: Optional[List[DevboxView]] = None - """List of devboxes matching filter.""" - - has_more: Optional[bool] = None - - total_count: Optional[int] = None diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index b1b732fd4..809acc5e1 100755 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,6 +2,7 @@ from __future__ import annotations +from .log_list_params import LogListParams as LogListParams from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams diff --git a/src/runloop_api_client/types/devboxes/devbox_async_execution_detail_view.py b/src/runloop_api_client/types/devboxes/devbox_async_execution_detail_view.py deleted file mode 100755 index ea60ca7f0..000000000 --- a/src/runloop_api_client/types/devboxes/devbox_async_execution_detail_view.py +++ /dev/null @@ -1,37 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["DevboxAsyncExecutionDetailView"] - - -class DevboxAsyncExecutionDetailView(BaseModel): - devbox_id: Optional[str] = None - """Devbox id where command was executed.""" - - execution_id: Optional[str] = None - """Ephemeral id of the execution in progress.""" - - exit_status: Optional[int] = None - """Exit code of command execution. - - This field will remain unset until the execution has completed. - """ - - status: Optional[Literal["running", "success", "failure", "canceled"]] = None - """Current status of the execution.""" - - stderr: Optional[str] = None - """Standard error generated by command. - - This field will remain unset until the execution has completed. - """ - - stdout: Optional[str] = None - """Standard out generated by command. - - This field will remain unset until the execution has completed. - """ diff --git a/src/runloop_api_client/types/devboxes/devbox_execution_detail_view.py b/src/runloop_api_client/types/devboxes/devbox_execution_detail_view.py deleted file mode 100755 index eadd60b1d..000000000 --- a/src/runloop_api_client/types/devboxes/devbox_execution_detail_view.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel - -__all__ = ["DevboxExecutionDetailView"] - - -class DevboxExecutionDetailView(BaseModel): - devbox_id: Optional[str] = None - """Devbox id where command was executed.""" - - exit_status: Optional[int] = None - """Exit status of command execution.""" - - stderr: Optional[str] = None - """Standard error generated by command.""" - - stdout: Optional[str] = None - """Standard out generated by command.""" diff --git a/src/runloop_api_client/types/devbox_read_file_params.py b/src/runloop_api_client/types/devboxes/log_list_params.py old mode 100755 new mode 100644 similarity index 53% rename from src/runloop_api_client/types/devbox_read_file_params.py rename to src/runloop_api_client/types/devboxes/log_list_params.py index ef69ed4f9..5bc1fe974 --- a/src/runloop_api_client/types/devbox_read_file_params.py +++ b/src/runloop_api_client/types/devboxes/log_list_params.py @@ -4,9 +4,9 @@ from typing_extensions import TypedDict -__all__ = ["DevboxReadFileParams"] +__all__ = ["LogListParams"] -class DevboxReadFileParams(TypedDict, total=False): - file_path: str - """The path of the file to read.""" +class LogListParams(TypedDict, total=False): + execution_id: str + """Id of execution to filter logs by.""" diff --git a/src/runloop_api_client/types/functions/invocation_logs_response.py b/src/runloop_api_client/types/functions/invocation_logs_response.py deleted file mode 100755 index 240b32c4a..000000000 --- a/src/runloop_api_client/types/functions/invocation_logs_response.py +++ /dev/null @@ -1,26 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["InvocationLogsResponse", "Log"] - - -class Log(BaseModel): - level: Optional[str] = None - """Log line severity level.""" - - message: Optional[str] = None - """Log line message.""" - - timestamp_ms: Optional[int] = None - """Time of log (Unix timestamp milliseconds).""" - - -class InvocationLogsResponse(BaseModel): - invocation_id: Optional[str] = None - """ID of the invocation.""" - - logs: Optional[List[Log]] = None - """List of logs for the given invocation.""" diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index 4d448b8ae..8efd48b8b 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -10,9 +10,6 @@ from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types import DevboxExecutionDetailView, DevboxAsyncExecutionDetailView -from runloop_api_client.types.devboxes import ( - DevboxLogsListView, -) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -217,54 +214,6 @@ def test_path_params_kill(self, client: Runloop) -> None: id="id", ) - @parametrize - def test_method_logs(self, client: Runloop) -> None: - execution = client.devboxes.executions.logs( - execution_id="execution_id", - id="id", - ) - assert_matches_type(DevboxLogsListView, execution, path=["response"]) - - @parametrize - def test_raw_response_logs(self, client: Runloop) -> None: - response = client.devboxes.executions.with_raw_response.logs( - execution_id="execution_id", - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - execution = response.parse() - assert_matches_type(DevboxLogsListView, execution, path=["response"]) - - @parametrize - def test_streaming_response_logs(self, client: Runloop) -> None: - with client.devboxes.executions.with_streaming_response.logs( - execution_id="execution_id", - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - execution = response.parse() - assert_matches_type(DevboxLogsListView, execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_logs(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.executions.with_raw_response.logs( - execution_id="execution_id", - id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): - client.devboxes.executions.with_raw_response.logs( - execution_id="", - id="id", - ) - class TestAsyncExecutions: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -465,51 +414,3 @@ async def test_path_params_kill(self, async_client: AsyncRunloop) -> None: execution_id="", id="id", ) - - @parametrize - async def test_method_logs(self, async_client: AsyncRunloop) -> None: - execution = await async_client.devboxes.executions.logs( - execution_id="execution_id", - id="id", - ) - assert_matches_type(DevboxLogsListView, execution, path=["response"]) - - @parametrize - async def test_raw_response_logs(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.executions.with_raw_response.logs( - execution_id="execution_id", - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - execution = await response.parse() - assert_matches_type(DevboxLogsListView, execution, path=["response"]) - - @parametrize - async def test_streaming_response_logs(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.executions.with_streaming_response.logs( - execution_id="execution_id", - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - execution = await response.parse() - assert_matches_type(DevboxLogsListView, execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_logs(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.executions.with_raw_response.logs( - execution_id="execution_id", - id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): - await async_client.devboxes.executions.with_raw_response.logs( - execution_id="", - id="id", - ) diff --git a/tests/api_resources/devboxes/test_logs.py b/tests/api_resources/devboxes/test_logs.py index 85ea9be84..bf23b2f8e 100755 --- a/tests/api_resources/devboxes/test_logs.py +++ b/tests/api_resources/devboxes/test_logs.py @@ -20,14 +20,22 @@ class TestLogs: @parametrize def test_method_list(self, client: Runloop) -> None: log = client.devboxes.logs.list( - "id", + id="id", + ) + assert_matches_type(DevboxLogsListView, log, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + log = client.devboxes.logs.list( + id="id", + execution_id="execution_id", ) assert_matches_type(DevboxLogsListView, log, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: response = client.devboxes.logs.with_raw_response.list( - "id", + id="id", ) assert response.is_closed is True @@ -38,7 +46,7 @@ def test_raw_response_list(self, client: Runloop) -> None: @parametrize def test_streaming_response_list(self, client: Runloop) -> None: with client.devboxes.logs.with_streaming_response.list( - "id", + id="id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -52,7 +60,7 @@ def test_streaming_response_list(self, client: Runloop) -> None: def test_path_params_list(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.logs.with_raw_response.list( - "", + id="", ) @@ -62,14 +70,22 @@ class TestAsyncLogs: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: log = await async_client.devboxes.logs.list( - "id", + id="id", + ) + assert_matches_type(DevboxLogsListView, log, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + log = await async_client.devboxes.logs.list( + id="id", + execution_id="execution_id", ) assert_matches_type(DevboxLogsListView, log, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.logs.with_raw_response.list( - "id", + id="id", ) assert response.is_closed is True @@ -80,7 +96,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.logs.with_streaming_response.list( - "id", + id="id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -94,5 +110,5 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None async def test_path_params_list(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.logs.with_raw_response.list( - "", + id="", ) diff --git a/tests/api_resources/test_deployments.py b/tests/api_resources/test_deployments.py deleted file mode 100755 index 1c1c11f74..000000000 --- a/tests/api_resources/test_deployments.py +++ /dev/null @@ -1,406 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types import ( - DeploymentGetResponse, - DeploymentLogsResponse, - DeploymentTailResponse, - DeploymentRedeployResponse, - DeploymentRetrieveResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestDeployments: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_retrieve(self, client: Runloop) -> None: - deployment = client.deployments.retrieve( - "deployment_id", - ) - assert_matches_type(DeploymentRetrieveResponse, deployment, path=["response"]) - - @parametrize - def test_raw_response_retrieve(self, client: Runloop) -> None: - response = client.deployments.with_raw_response.retrieve( - "deployment_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - deployment = response.parse() - assert_matches_type(DeploymentRetrieveResponse, deployment, path=["response"]) - - @parametrize - def test_streaming_response_retrieve(self, client: Runloop) -> None: - with client.deployments.with_streaming_response.retrieve( - "deployment_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - deployment = response.parse() - assert_matches_type(DeploymentRetrieveResponse, deployment, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_retrieve(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): - client.deployments.with_raw_response.retrieve( - "", - ) - - @parametrize - def test_method_get(self, client: Runloop) -> None: - deployment = client.deployments.get() - assert_matches_type(DeploymentGetResponse, deployment, path=["response"]) - - @parametrize - def test_method_get_with_all_params(self, client: Runloop) -> None: - deployment = client.deployments.get( - limit="limit", - starting_after="starting_after", - ) - assert_matches_type(DeploymentGetResponse, deployment, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Runloop) -> None: - response = client.deployments.with_raw_response.get() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - deployment = response.parse() - assert_matches_type(DeploymentGetResponse, deployment, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Runloop) -> None: - with client.deployments.with_streaming_response.get() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - deployment = response.parse() - assert_matches_type(DeploymentGetResponse, deployment, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_logs(self, client: Runloop) -> None: - deployment = client.deployments.logs( - "deployment_id", - ) - assert_matches_type(DeploymentLogsResponse, deployment, path=["response"]) - - @parametrize - def test_raw_response_logs(self, client: Runloop) -> None: - response = client.deployments.with_raw_response.logs( - "deployment_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - deployment = response.parse() - assert_matches_type(DeploymentLogsResponse, deployment, path=["response"]) - - @parametrize - def test_streaming_response_logs(self, client: Runloop) -> None: - with client.deployments.with_streaming_response.logs( - "deployment_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - deployment = response.parse() - assert_matches_type(DeploymentLogsResponse, deployment, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_logs(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): - client.deployments.with_raw_response.logs( - "", - ) - - @parametrize - def test_method_redeploy(self, client: Runloop) -> None: - deployment = client.deployments.redeploy( - "deployment_id", - ) - assert_matches_type(DeploymentRedeployResponse, deployment, path=["response"]) - - @parametrize - def test_raw_response_redeploy(self, client: Runloop) -> None: - response = client.deployments.with_raw_response.redeploy( - "deployment_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - deployment = response.parse() - assert_matches_type(DeploymentRedeployResponse, deployment, path=["response"]) - - @parametrize - def test_streaming_response_redeploy(self, client: Runloop) -> None: - with client.deployments.with_streaming_response.redeploy( - "deployment_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - deployment = response.parse() - assert_matches_type(DeploymentRedeployResponse, deployment, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_redeploy(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): - client.deployments.with_raw_response.redeploy( - "", - ) - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - def test_method_tail(self, client: Runloop) -> None: - deployment = client.deployments.tail( - "deployment_id", - ) - assert_matches_type(DeploymentTailResponse, deployment, path=["response"]) - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - def test_raw_response_tail(self, client: Runloop) -> None: - response = client.deployments.with_raw_response.tail( - "deployment_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - deployment = response.parse() - assert_matches_type(DeploymentTailResponse, deployment, path=["response"]) - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - def test_streaming_response_tail(self, client: Runloop) -> None: - with client.deployments.with_streaming_response.tail( - "deployment_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - deployment = response.parse() - assert_matches_type(DeploymentTailResponse, deployment, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - def test_path_params_tail(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): - client.deployments.with_raw_response.tail( - "", - ) - - -class TestAsyncDeployments: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: - deployment = await async_client.deployments.retrieve( - "deployment_id", - ) - assert_matches_type(DeploymentRetrieveResponse, deployment, path=["response"]) - - @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: - response = await async_client.deployments.with_raw_response.retrieve( - "deployment_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - deployment = await response.parse() - assert_matches_type(DeploymentRetrieveResponse, deployment, path=["response"]) - - @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: - async with async_client.deployments.with_streaming_response.retrieve( - "deployment_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - deployment = await response.parse() - assert_matches_type(DeploymentRetrieveResponse, deployment, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): - await async_client.deployments.with_raw_response.retrieve( - "", - ) - - @parametrize - async def test_method_get(self, async_client: AsyncRunloop) -> None: - deployment = await async_client.deployments.get() - assert_matches_type(DeploymentGetResponse, deployment, path=["response"]) - - @parametrize - async def test_method_get_with_all_params(self, async_client: AsyncRunloop) -> None: - deployment = await async_client.deployments.get( - limit="limit", - starting_after="starting_after", - ) - assert_matches_type(DeploymentGetResponse, deployment, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncRunloop) -> None: - response = await async_client.deployments.with_raw_response.get() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - deployment = await response.parse() - assert_matches_type(DeploymentGetResponse, deployment, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncRunloop) -> None: - async with async_client.deployments.with_streaming_response.get() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - deployment = await response.parse() - assert_matches_type(DeploymentGetResponse, deployment, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_logs(self, async_client: AsyncRunloop) -> None: - deployment = await async_client.deployments.logs( - "deployment_id", - ) - assert_matches_type(DeploymentLogsResponse, deployment, path=["response"]) - - @parametrize - async def test_raw_response_logs(self, async_client: AsyncRunloop) -> None: - response = await async_client.deployments.with_raw_response.logs( - "deployment_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - deployment = await response.parse() - assert_matches_type(DeploymentLogsResponse, deployment, path=["response"]) - - @parametrize - async def test_streaming_response_logs(self, async_client: AsyncRunloop) -> None: - async with async_client.deployments.with_streaming_response.logs( - "deployment_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - deployment = await response.parse() - assert_matches_type(DeploymentLogsResponse, deployment, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_logs(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): - await async_client.deployments.with_raw_response.logs( - "", - ) - - @parametrize - async def test_method_redeploy(self, async_client: AsyncRunloop) -> None: - deployment = await async_client.deployments.redeploy( - "deployment_id", - ) - assert_matches_type(DeploymentRedeployResponse, deployment, path=["response"]) - - @parametrize - async def test_raw_response_redeploy(self, async_client: AsyncRunloop) -> None: - response = await async_client.deployments.with_raw_response.redeploy( - "deployment_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - deployment = await response.parse() - assert_matches_type(DeploymentRedeployResponse, deployment, path=["response"]) - - @parametrize - async def test_streaming_response_redeploy(self, async_client: AsyncRunloop) -> None: - async with async_client.deployments.with_streaming_response.redeploy( - "deployment_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - deployment = await response.parse() - assert_matches_type(DeploymentRedeployResponse, deployment, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_redeploy(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): - await async_client.deployments.with_raw_response.redeploy( - "", - ) - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - async def test_method_tail(self, async_client: AsyncRunloop) -> None: - deployment = await async_client.deployments.tail( - "deployment_id", - ) - assert_matches_type(DeploymentTailResponse, deployment, path=["response"]) - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - async def test_raw_response_tail(self, async_client: AsyncRunloop) -> None: - response = await async_client.deployments.with_raw_response.tail( - "deployment_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - deployment = await response.parse() - assert_matches_type(DeploymentTailResponse, deployment, path=["response"]) - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - async def test_streaming_response_tail(self, async_client: AsyncRunloop) -> None: - async with async_client.deployments.with_streaming_response.tail( - "deployment_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - deployment = await response.parse() - assert_matches_type(DeploymentTailResponse, deployment, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="cannot test text/event-stream") - @parametrize - async def test_path_params_tail(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `deployment_id` but received ''"): - await async_client.deployments.with_raw_response.tail( - "", - ) diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 2b39d95da..7d2b71574 100755 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -14,7 +14,6 @@ DevboxListView, DevboxExecutionDetailView, DevboxCreateSSHKeyResponse, - DevboxAsyncExecutionDetailView, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -177,52 +176,6 @@ def test_path_params_create_ssh_key(self, client: Runloop) -> None: "", ) - @parametrize - def test_method_execute_async(self, client: Runloop) -> None: - devbox = client.devboxes.execute_async( - id="id", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) - - @parametrize - def test_method_execute_async_with_all_params(self, client: Runloop) -> None: - devbox = client.devboxes.execute_async( - id="id", - command="command", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) - - @parametrize - def test_raw_response_execute_async(self, client: Runloop) -> None: - response = client.devboxes.with_raw_response.execute_async( - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - devbox = response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) - - @parametrize - def test_streaming_response_execute_async(self, client: Runloop) -> None: - with client.devboxes.with_streaming_response.execute_async( - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - devbox = response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_execute_async(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.with_raw_response.execute_async( - id="", - ) - @parametrize def test_method_execute_sync(self, client: Runloop) -> None: devbox = client.devboxes.execute_sync( @@ -605,52 +558,6 @@ async def test_path_params_create_ssh_key(self, async_client: AsyncRunloop) -> N "", ) - @parametrize - async def test_method_execute_async(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.execute_async( - id="id", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) - - @parametrize - async def test_method_execute_async_with_all_params(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.execute_async( - id="id", - command="command", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) - - @parametrize - async def test_raw_response_execute_async(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.with_raw_response.execute_async( - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - devbox = await response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) - - @parametrize - async def test_streaming_response_execute_async(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.with_streaming_response.execute_async( - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - devbox = await response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_execute_async(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.with_raw_response.execute_async( - id="", - ) - @parametrize async def test_method_execute_sync(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.execute_sync( From 424a1411bf8f6d11719afb4cb83644734979ba2a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 00:01:00 +0000 Subject: [PATCH 121/993] chore(internal): version bump (#135) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7e56fe29a..e2f2c0743 100755 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.16" + ".": "0.1.0-alpha.17" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 08e8c89b4..3aa0d07c5 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.1.0-alpha.16" +version = "0.1.0-alpha.17" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index f60e3debc..3e54497ee 100755 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.1.0-alpha.16" # x-release-please-version +__version__ = "0.1.0-alpha.17" # x-release-please-version From 8aa789450c615d8300416a6335f27328345ea875 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 00:16:15 +0000 Subject: [PATCH 122/993] feat(api): OpenAPI spec update via Stainless API (#136) --- .stats.yml | 2 +- api.md | 4 +- .../resources/devboxes/devboxes.py | 90 ++++++++++++++++++ .../resources/devboxes/executions.py | 90 +----------------- .../resources/devboxes/logs.py | 23 +---- src/runloop_api_client/types/__init__.py | 1 + ...rams.py => devbox_execute_async_params.py} | 4 +- .../types/devboxes/__init__.py | 2 - .../types/devboxes/log_list_params.py | 12 --- .../api_resources/devboxes/test_executions.py | 92 ------------------ tests/api_resources/devboxes/test_logs.py | 32 ++----- tests/api_resources/test_devboxes.py | 93 +++++++++++++++++++ 12 files changed, 200 insertions(+), 245 deletions(-) rename src/runloop_api_client/types/{devboxes/execution_execute_async_params.py => devbox_execute_async_params.py} (69%) mode change 100755 => 100644 delete mode 100644 src/runloop_api_client/types/devboxes/log_list_params.py diff --git a/.stats.yml b/.stats.yml index 33321e045..7dee429d8 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f604aab9dce4ace8553e47c1fba2785330184e2b57ef594de0ac6e4027b9fd66.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6f0c5d11d068264882131101603e33a7d1574db90f3de9b7777f02dbd4649954.yml diff --git a/api.md b/api.md index 7553b1877..4dcf46195 100755 --- a/api.md +++ b/api.md @@ -65,6 +65,7 @@ Methods: - client.devboxes.retrieve(id) -> DevboxView - client.devboxes.list(\*\*params) -> DevboxListView - client.devboxes.create_ssh_key(id) -> DevboxCreateSSHKeyResponse +- client.devboxes.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.read_file_contents(id, \*\*params) -> str - client.devboxes.shutdown(id) -> DevboxView @@ -81,14 +82,13 @@ from runloop_api_client.types.devboxes import DevboxLogsListView Methods: -- client.devboxes.logs.list(id, \*\*params) -> DevboxLogsListView +- client.devboxes.logs.list(id) -> DevboxLogsListView ## Executions Methods: - client.devboxes.executions.retrieve(execution_id, \*, id, \*\*params) -> DevboxAsyncExecutionDetailView -- client.devboxes.executions.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.executions.kill(execution_id, \*, id) -> DevboxAsyncExecutionDetailView diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 70be80571..b97c599a4 100755 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -20,6 +20,7 @@ devbox_write_file_params, devbox_upload_file_params, devbox_execute_sync_params, + devbox_execute_async_params, devbox_read_file_contents_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes @@ -50,6 +51,7 @@ from ...types.devbox_list_view import DevboxListView from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse +from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView __all__ = ["DevboxesResource", "AsyncDevboxesResource"] @@ -269,6 +271,43 @@ def create_ssh_key( cast_to=DevboxCreateSSHKeyResponse, ) + def execute_async( + self, + id: str, + *, + command: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Asynchronously execute a command on a devbox + + Args: + command: The command to execute on the Devbox. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/executions/execute_async", + body=maybe_transform({"command": command}, devbox_execute_async_params.DevboxExecuteAsyncParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + def execute_sync( self, id: str, @@ -690,6 +729,45 @@ async def create_ssh_key( cast_to=DevboxCreateSSHKeyResponse, ) + async def execute_async( + self, + id: str, + *, + command: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Asynchronously execute a command on a devbox + + Args: + command: The command to execute on the Devbox. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/executions/execute_async", + body=await async_maybe_transform( + {"command": command}, devbox_execute_async_params.DevboxExecuteAsyncParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + async def execute_sync( self, id: str, @@ -912,6 +990,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.create_ssh_key = to_raw_response_wrapper( devboxes.create_ssh_key, ) + self.execute_async = to_raw_response_wrapper( + devboxes.execute_async, + ) self.execute_sync = to_raw_response_wrapper( devboxes.execute_sync, ) @@ -953,6 +1034,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.create_ssh_key = async_to_raw_response_wrapper( devboxes.create_ssh_key, ) + self.execute_async = async_to_raw_response_wrapper( + devboxes.execute_async, + ) self.execute_sync = async_to_raw_response_wrapper( devboxes.execute_sync, ) @@ -994,6 +1078,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.create_ssh_key = to_streamed_response_wrapper( devboxes.create_ssh_key, ) + self.execute_async = to_streamed_response_wrapper( + devboxes.execute_async, + ) self.execute_sync = to_streamed_response_wrapper( devboxes.execute_sync, ) @@ -1035,6 +1122,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.create_ssh_key = async_to_streamed_response_wrapper( devboxes.create_ssh_key, ) + self.execute_async = async_to_streamed_response_wrapper( + devboxes.execute_async, + ) self.execute_sync = async_to_streamed_response_wrapper( devboxes.execute_sync, ) diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index 3ebba5fc9..7901a273f 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -18,7 +18,7 @@ async_to_streamed_response_wrapper, ) from ..._base_client import make_request_options -from ...types.devboxes import execution_retrieve_params, execution_execute_sync_params, execution_execute_async_params +from ...types.devboxes import execution_retrieve_params, execution_execute_sync_params from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView @@ -77,43 +77,6 @@ def retrieve( cast_to=DevboxAsyncExecutionDetailView, ) - def execute_async( - self, - id: str, - *, - command: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxAsyncExecutionDetailView: - """ - Asynchronously execute a command on a devbox - - Args: - command: The command to execute on the Devbox. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/execute_async", - body=maybe_transform({"command": command}, execution_execute_async_params.ExecutionExecuteAsyncParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DevboxAsyncExecutionDetailView, - ) - def execute_sync( self, id: str, @@ -242,45 +205,6 @@ async def retrieve( cast_to=DevboxAsyncExecutionDetailView, ) - async def execute_async( - self, - id: str, - *, - command: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxAsyncExecutionDetailView: - """ - Asynchronously execute a command on a devbox - - Args: - command: The command to execute on the Devbox. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/execute_async", - body=await async_maybe_transform( - {"command": command}, execution_execute_async_params.ExecutionExecuteAsyncParams - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DevboxAsyncExecutionDetailView, - ) - async def execute_sync( self, id: str, @@ -364,9 +288,6 @@ def __init__(self, executions: ExecutionsResource) -> None: self.retrieve = to_raw_response_wrapper( executions.retrieve, ) - self.execute_async = to_raw_response_wrapper( - executions.execute_async, - ) self.execute_sync = to_raw_response_wrapper( executions.execute_sync, ) @@ -382,9 +303,6 @@ def __init__(self, executions: AsyncExecutionsResource) -> None: self.retrieve = async_to_raw_response_wrapper( executions.retrieve, ) - self.execute_async = async_to_raw_response_wrapper( - executions.execute_async, - ) self.execute_sync = async_to_raw_response_wrapper( executions.execute_sync, ) @@ -400,9 +318,6 @@ def __init__(self, executions: ExecutionsResource) -> None: self.retrieve = to_streamed_response_wrapper( executions.retrieve, ) - self.execute_async = to_streamed_response_wrapper( - executions.execute_async, - ) self.execute_sync = to_streamed_response_wrapper( executions.execute_sync, ) @@ -418,9 +333,6 @@ def __init__(self, executions: AsyncExecutionsResource) -> None: self.retrieve = async_to_streamed_response_wrapper( executions.retrieve, ) - self.execute_async = async_to_streamed_response_wrapper( - executions.execute_async, - ) self.execute_sync = async_to_streamed_response_wrapper( executions.execute_sync, ) diff --git a/src/runloop_api_client/resources/devboxes/logs.py b/src/runloop_api_client/resources/devboxes/logs.py index 70d046a87..cabe8f329 100755 --- a/src/runloop_api_client/resources/devboxes/logs.py +++ b/src/runloop_api_client/resources/devboxes/logs.py @@ -5,10 +5,6 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -18,7 +14,6 @@ async_to_streamed_response_wrapper, ) from ..._base_client import make_request_options -from ...types.devboxes import log_list_params from ...types.devboxes.devbox_logs_list_view import DevboxLogsListView __all__ = ["LogsResource", "AsyncLogsResource"] @@ -37,7 +32,6 @@ def list( self, id: str, *, - execution_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -49,8 +43,6 @@ def list( Get all logs from a Devbox by id. Args: - execution_id: Id of execution to filter logs by. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -64,11 +56,7 @@ def list( return self._get( f"/v1/devboxes/{id}/logs", options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform({"execution_id": execution_id}, log_list_params.LogListParams), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=DevboxLogsListView, ) @@ -87,7 +75,6 @@ async def list( self, id: str, *, - execution_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -99,8 +86,6 @@ async def list( Get all logs from a Devbox by id. Args: - execution_id: Id of execution to filter logs by. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -114,11 +99,7 @@ async def list( return await self._get( f"/v1/devboxes/{id}/logs", options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform({"execution_id": execution_id}, log_list_params.LogListParams), + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=DevboxLogsListView, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index eceda8fd6..2facf2e81 100755 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -26,6 +26,7 @@ from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams from .code_mount_parameters_param import CodeMountParametersParam as CodeMountParametersParam +from .devbox_execute_async_params import DevboxExecuteAsyncParams as DevboxExecuteAsyncParams from .function_invoke_sync_params import FunctionInvokeSyncParams as FunctionInvokeSyncParams from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams diff --git a/src/runloop_api_client/types/devboxes/execution_execute_async_params.py b/src/runloop_api_client/types/devbox_execute_async_params.py old mode 100755 new mode 100644 similarity index 69% rename from src/runloop_api_client/types/devboxes/execution_execute_async_params.py rename to src/runloop_api_client/types/devbox_execute_async_params.py index 7878309c5..9f5a7a8f4 --- a/src/runloop_api_client/types/devboxes/execution_execute_async_params.py +++ b/src/runloop_api_client/types/devbox_execute_async_params.py @@ -4,9 +4,9 @@ from typing_extensions import TypedDict -__all__ = ["ExecutionExecuteAsyncParams"] +__all__ = ["DevboxExecuteAsyncParams"] -class ExecutionExecuteAsyncParams(TypedDict, total=False): +class DevboxExecuteAsyncParams(TypedDict, total=False): command: str """The command to execute on the Devbox.""" diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..ecb3d16e1 100755 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,6 @@ from __future__ import annotations -from .log_list_params import LogListParams as LogListParams from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams diff --git a/src/runloop_api_client/types/devboxes/log_list_params.py b/src/runloop_api_client/types/devboxes/log_list_params.py deleted file mode 100644 index 5bc1fe974..000000000 --- a/src/runloop_api_client/types/devboxes/log_list_params.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["LogListParams"] - - -class LogListParams(TypedDict, total=False): - execution_id: str - """Id of execution to filter logs by.""" diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index 8efd48b8b..94a190493 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -74,52 +74,6 @@ def test_path_params_retrieve(self, client: Runloop) -> None: id="id", ) - @parametrize - def test_method_execute_async(self, client: Runloop) -> None: - execution = client.devboxes.executions.execute_async( - id="id", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - def test_method_execute_async_with_all_params(self, client: Runloop) -> None: - execution = client.devboxes.executions.execute_async( - id="id", - command="command", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - def test_raw_response_execute_async(self, client: Runloop) -> None: - response = client.devboxes.executions.with_raw_response.execute_async( - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - execution = response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - def test_streaming_response_execute_async(self, client: Runloop) -> None: - with client.devboxes.executions.with_streaming_response.execute_async( - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - execution = response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_execute_async(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.executions.with_raw_response.execute_async( - id="", - ) - @parametrize def test_method_execute_sync(self, client: Runloop) -> None: execution = client.devboxes.executions.execute_sync( @@ -275,52 +229,6 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: id="id", ) - @parametrize - async def test_method_execute_async(self, async_client: AsyncRunloop) -> None: - execution = await async_client.devboxes.executions.execute_async( - id="id", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - async def test_method_execute_async_with_all_params(self, async_client: AsyncRunloop) -> None: - execution = await async_client.devboxes.executions.execute_async( - id="id", - command="command", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - async def test_raw_response_execute_async(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.executions.with_raw_response.execute_async( - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - execution = await response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - async def test_streaming_response_execute_async(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.executions.with_streaming_response.execute_async( - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - execution = await response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_execute_async(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.executions.with_raw_response.execute_async( - id="", - ) - @parametrize async def test_method_execute_sync(self, async_client: AsyncRunloop) -> None: execution = await async_client.devboxes.executions.execute_sync( diff --git a/tests/api_resources/devboxes/test_logs.py b/tests/api_resources/devboxes/test_logs.py index bf23b2f8e..85ea9be84 100755 --- a/tests/api_resources/devboxes/test_logs.py +++ b/tests/api_resources/devboxes/test_logs.py @@ -20,22 +20,14 @@ class TestLogs: @parametrize def test_method_list(self, client: Runloop) -> None: log = client.devboxes.logs.list( - id="id", - ) - assert_matches_type(DevboxLogsListView, log, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Runloop) -> None: - log = client.devboxes.logs.list( - id="id", - execution_id="execution_id", + "id", ) assert_matches_type(DevboxLogsListView, log, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: response = client.devboxes.logs.with_raw_response.list( - id="id", + "id", ) assert response.is_closed is True @@ -46,7 +38,7 @@ def test_raw_response_list(self, client: Runloop) -> None: @parametrize def test_streaming_response_list(self, client: Runloop) -> None: with client.devboxes.logs.with_streaming_response.list( - id="id", + "id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -60,7 +52,7 @@ def test_streaming_response_list(self, client: Runloop) -> None: def test_path_params_list(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.logs.with_raw_response.list( - id="", + "", ) @@ -70,22 +62,14 @@ class TestAsyncLogs: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: log = await async_client.devboxes.logs.list( - id="id", - ) - assert_matches_type(DevboxLogsListView, log, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: - log = await async_client.devboxes.logs.list( - id="id", - execution_id="execution_id", + "id", ) assert_matches_type(DevboxLogsListView, log, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.logs.with_raw_response.list( - id="id", + "id", ) assert response.is_closed is True @@ -96,7 +80,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.logs.with_streaming_response.list( - id="id", + "id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -110,5 +94,5 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None async def test_path_params_list(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.logs.with_raw_response.list( - id="", + "", ) diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 7d2b71574..2b39d95da 100755 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -14,6 +14,7 @@ DevboxListView, DevboxExecutionDetailView, DevboxCreateSSHKeyResponse, + DevboxAsyncExecutionDetailView, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -176,6 +177,52 @@ def test_path_params_create_ssh_key(self, client: Runloop) -> None: "", ) + @parametrize + def test_method_execute_async(self, client: Runloop) -> None: + devbox = client.devboxes.execute_async( + id="id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_method_execute_async_with_all_params(self, client: Runloop) -> None: + devbox = client.devboxes.execute_async( + id="id", + command="command", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_raw_response_execute_async(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.execute_async( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_streaming_response_execute_async(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.execute_async( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_execute_async(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.execute_async( + id="", + ) + @parametrize def test_method_execute_sync(self, client: Runloop) -> None: devbox = client.devboxes.execute_sync( @@ -558,6 +605,52 @@ async def test_path_params_create_ssh_key(self, async_client: AsyncRunloop) -> N "", ) + @parametrize + async def test_method_execute_async(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.execute_async( + id="id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_method_execute_async_with_all_params(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.execute_async( + id="id", + command="command", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_raw_response_execute_async(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.execute_async( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_execute_async(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.execute_async( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_execute_async(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.execute_async( + id="", + ) + @parametrize async def test_method_execute_sync(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.execute_sync( From 7a660b51c103ad2f00d68274e55450ebeafc7840 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 00:18:48 +0000 Subject: [PATCH 123/993] chore(internal): version bump (#138) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e2f2c0743..3cf71e62c 100755 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.17" + ".": "0.1.0-alpha.18" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 3aa0d07c5..b838acb97 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.1.0-alpha.17" +version = "0.1.0-alpha.18" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 3e54497ee..76888e200 100755 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.1.0-alpha.17" # x-release-please-version +__version__ = "0.1.0-alpha.18" # x-release-please-version From 98c7c39a6241c7bb9e06d19443a2ea801304aafe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 06:16:12 +0000 Subject: [PATCH 124/993] feat(api): OpenAPI spec update via Stainless API (#139) --- .stats.yml | 2 +- api.md | 4 +- .../resources/devboxes/devboxes.py | 90 ------------------ .../resources/devboxes/executions.py | 90 +++++++++++++++++- .../resources/devboxes/logs.py | 23 ++++- src/runloop_api_client/types/__init__.py | 1 - .../types/devboxes/__init__.py | 2 + .../execution_execute_async_params.py} | 4 +- .../types/devboxes/log_list_params.py | 12 +++ .../api_resources/devboxes/test_executions.py | 92 ++++++++++++++++++ tests/api_resources/devboxes/test_logs.py | 32 +++++-- tests/api_resources/test_devboxes.py | 93 ------------------- 12 files changed, 245 insertions(+), 200 deletions(-) rename src/runloop_api_client/types/{devbox_execute_async_params.py => devboxes/execution_execute_async_params.py} (69%) create mode 100644 src/runloop_api_client/types/devboxes/log_list_params.py diff --git a/.stats.yml b/.stats.yml index 7dee429d8..264da0fea 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6f0c5d11d068264882131101603e33a7d1574db90f3de9b7777f02dbd4649954.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e1f9515ca3a28d01bdf64ee9d93a785ba9bf4c603226f9bc3276e0b0f08d9acb.yml diff --git a/api.md b/api.md index 4dcf46195..7553b1877 100755 --- a/api.md +++ b/api.md @@ -65,7 +65,6 @@ Methods: - client.devboxes.retrieve(id) -> DevboxView - client.devboxes.list(\*\*params) -> DevboxListView - client.devboxes.create_ssh_key(id) -> DevboxCreateSSHKeyResponse -- client.devboxes.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.read_file_contents(id, \*\*params) -> str - client.devboxes.shutdown(id) -> DevboxView @@ -82,13 +81,14 @@ from runloop_api_client.types.devboxes import DevboxLogsListView Methods: -- client.devboxes.logs.list(id) -> DevboxLogsListView +- client.devboxes.logs.list(id, \*\*params) -> DevboxLogsListView ## Executions Methods: - client.devboxes.executions.retrieve(execution_id, \*, id, \*\*params) -> DevboxAsyncExecutionDetailView +- client.devboxes.executions.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.executions.kill(execution_id, \*, id) -> DevboxAsyncExecutionDetailView diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index b97c599a4..70be80571 100755 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -20,7 +20,6 @@ devbox_write_file_params, devbox_upload_file_params, devbox_execute_sync_params, - devbox_execute_async_params, devbox_read_file_contents_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes @@ -51,7 +50,6 @@ from ...types.devbox_list_view import DevboxListView from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse -from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView __all__ = ["DevboxesResource", "AsyncDevboxesResource"] @@ -271,43 +269,6 @@ def create_ssh_key( cast_to=DevboxCreateSSHKeyResponse, ) - def execute_async( - self, - id: str, - *, - command: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxAsyncExecutionDetailView: - """ - Asynchronously execute a command on a devbox - - Args: - command: The command to execute on the Devbox. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/executions/execute_async", - body=maybe_transform({"command": command}, devbox_execute_async_params.DevboxExecuteAsyncParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DevboxAsyncExecutionDetailView, - ) - def execute_sync( self, id: str, @@ -729,45 +690,6 @@ async def create_ssh_key( cast_to=DevboxCreateSSHKeyResponse, ) - async def execute_async( - self, - id: str, - *, - command: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxAsyncExecutionDetailView: - """ - Asynchronously execute a command on a devbox - - Args: - command: The command to execute on the Devbox. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/executions/execute_async", - body=await async_maybe_transform( - {"command": command}, devbox_execute_async_params.DevboxExecuteAsyncParams - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DevboxAsyncExecutionDetailView, - ) - async def execute_sync( self, id: str, @@ -990,9 +912,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.create_ssh_key = to_raw_response_wrapper( devboxes.create_ssh_key, ) - self.execute_async = to_raw_response_wrapper( - devboxes.execute_async, - ) self.execute_sync = to_raw_response_wrapper( devboxes.execute_sync, ) @@ -1034,9 +953,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.create_ssh_key = async_to_raw_response_wrapper( devboxes.create_ssh_key, ) - self.execute_async = async_to_raw_response_wrapper( - devboxes.execute_async, - ) self.execute_sync = async_to_raw_response_wrapper( devboxes.execute_sync, ) @@ -1078,9 +994,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.create_ssh_key = to_streamed_response_wrapper( devboxes.create_ssh_key, ) - self.execute_async = to_streamed_response_wrapper( - devboxes.execute_async, - ) self.execute_sync = to_streamed_response_wrapper( devboxes.execute_sync, ) @@ -1122,9 +1035,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.create_ssh_key = async_to_streamed_response_wrapper( devboxes.create_ssh_key, ) - self.execute_async = async_to_streamed_response_wrapper( - devboxes.execute_async, - ) self.execute_sync = async_to_streamed_response_wrapper( devboxes.execute_sync, ) diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index 7901a273f..3ebba5fc9 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -18,7 +18,7 @@ async_to_streamed_response_wrapper, ) from ..._base_client import make_request_options -from ...types.devboxes import execution_retrieve_params, execution_execute_sync_params +from ...types.devboxes import execution_retrieve_params, execution_execute_sync_params, execution_execute_async_params from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView @@ -77,6 +77,43 @@ def retrieve( cast_to=DevboxAsyncExecutionDetailView, ) + def execute_async( + self, + id: str, + *, + command: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Asynchronously execute a command on a devbox + + Args: + command: The command to execute on the Devbox. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/execute_async", + body=maybe_transform({"command": command}, execution_execute_async_params.ExecutionExecuteAsyncParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + def execute_sync( self, id: str, @@ -205,6 +242,45 @@ async def retrieve( cast_to=DevboxAsyncExecutionDetailView, ) + async def execute_async( + self, + id: str, + *, + command: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Asynchronously execute a command on a devbox + + Args: + command: The command to execute on the Devbox. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/execute_async", + body=await async_maybe_transform( + {"command": command}, execution_execute_async_params.ExecutionExecuteAsyncParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + async def execute_sync( self, id: str, @@ -288,6 +364,9 @@ def __init__(self, executions: ExecutionsResource) -> None: self.retrieve = to_raw_response_wrapper( executions.retrieve, ) + self.execute_async = to_raw_response_wrapper( + executions.execute_async, + ) self.execute_sync = to_raw_response_wrapper( executions.execute_sync, ) @@ -303,6 +382,9 @@ def __init__(self, executions: AsyncExecutionsResource) -> None: self.retrieve = async_to_raw_response_wrapper( executions.retrieve, ) + self.execute_async = async_to_raw_response_wrapper( + executions.execute_async, + ) self.execute_sync = async_to_raw_response_wrapper( executions.execute_sync, ) @@ -318,6 +400,9 @@ def __init__(self, executions: ExecutionsResource) -> None: self.retrieve = to_streamed_response_wrapper( executions.retrieve, ) + self.execute_async = to_streamed_response_wrapper( + executions.execute_async, + ) self.execute_sync = to_streamed_response_wrapper( executions.execute_sync, ) @@ -333,6 +418,9 @@ def __init__(self, executions: AsyncExecutionsResource) -> None: self.retrieve = async_to_streamed_response_wrapper( executions.retrieve, ) + self.execute_async = async_to_streamed_response_wrapper( + executions.execute_async, + ) self.execute_sync = async_to_streamed_response_wrapper( executions.execute_sync, ) diff --git a/src/runloop_api_client/resources/devboxes/logs.py b/src/runloop_api_client/resources/devboxes/logs.py index cabe8f329..70d046a87 100755 --- a/src/runloop_api_client/resources/devboxes/logs.py +++ b/src/runloop_api_client/resources/devboxes/logs.py @@ -5,6 +5,10 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -14,6 +18,7 @@ async_to_streamed_response_wrapper, ) from ..._base_client import make_request_options +from ...types.devboxes import log_list_params from ...types.devboxes.devbox_logs_list_view import DevboxLogsListView __all__ = ["LogsResource", "AsyncLogsResource"] @@ -32,6 +37,7 @@ def list( self, id: str, *, + execution_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -43,6 +49,8 @@ def list( Get all logs from a Devbox by id. Args: + execution_id: Id of execution to filter logs by. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -56,7 +64,11 @@ def list( return self._get( f"/v1/devboxes/{id}/logs", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"execution_id": execution_id}, log_list_params.LogListParams), ), cast_to=DevboxLogsListView, ) @@ -75,6 +87,7 @@ async def list( self, id: str, *, + execution_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -86,6 +99,8 @@ async def list( Get all logs from a Devbox by id. Args: + execution_id: Id of execution to filter logs by. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -99,7 +114,11 @@ async def list( return await self._get( f"/v1/devboxes/{id}/logs", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"execution_id": execution_id}, log_list_params.LogListParams), ), cast_to=DevboxLogsListView, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 2facf2e81..eceda8fd6 100755 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -26,7 +26,6 @@ from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams from .code_mount_parameters_param import CodeMountParametersParam as CodeMountParametersParam -from .devbox_execute_async_params import DevboxExecuteAsyncParams as DevboxExecuteAsyncParams from .function_invoke_sync_params import FunctionInvokeSyncParams as FunctionInvokeSyncParams from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index ecb3d16e1..809acc5e1 100755 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,6 +2,8 @@ from __future__ import annotations +from .log_list_params import LogListParams as LogListParams from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams diff --git a/src/runloop_api_client/types/devbox_execute_async_params.py b/src/runloop_api_client/types/devboxes/execution_execute_async_params.py similarity index 69% rename from src/runloop_api_client/types/devbox_execute_async_params.py rename to src/runloop_api_client/types/devboxes/execution_execute_async_params.py index 9f5a7a8f4..7878309c5 100644 --- a/src/runloop_api_client/types/devbox_execute_async_params.py +++ b/src/runloop_api_client/types/devboxes/execution_execute_async_params.py @@ -4,9 +4,9 @@ from typing_extensions import TypedDict -__all__ = ["DevboxExecuteAsyncParams"] +__all__ = ["ExecutionExecuteAsyncParams"] -class DevboxExecuteAsyncParams(TypedDict, total=False): +class ExecutionExecuteAsyncParams(TypedDict, total=False): command: str """The command to execute on the Devbox.""" diff --git a/src/runloop_api_client/types/devboxes/log_list_params.py b/src/runloop_api_client/types/devboxes/log_list_params.py new file mode 100644 index 000000000..5bc1fe974 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/log_list_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["LogListParams"] + + +class LogListParams(TypedDict, total=False): + execution_id: str + """Id of execution to filter logs by.""" diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index 94a190493..8efd48b8b 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -74,6 +74,52 @@ def test_path_params_retrieve(self, client: Runloop) -> None: id="id", ) + @parametrize + def test_method_execute_async(self, client: Runloop) -> None: + execution = client.devboxes.executions.execute_async( + id="id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_method_execute_async_with_all_params(self, client: Runloop) -> None: + execution = client.devboxes.executions.execute_async( + id="id", + command="command", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_raw_response_execute_async(self, client: Runloop) -> None: + response = client.devboxes.executions.with_raw_response.execute_async( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_streaming_response_execute_async(self, client: Runloop) -> None: + with client.devboxes.executions.with_streaming_response.execute_async( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_execute_async(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.executions.with_raw_response.execute_async( + id="", + ) + @parametrize def test_method_execute_sync(self, client: Runloop) -> None: execution = client.devboxes.executions.execute_sync( @@ -229,6 +275,52 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: id="id", ) + @parametrize + async def test_method_execute_async(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.execute_async( + id="id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_method_execute_async_with_all_params(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.execute_async( + id="id", + command="command", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_raw_response_execute_async(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.executions.with_raw_response.execute_async( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_streaming_response_execute_async(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.executions.with_streaming_response.execute_async( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_execute_async(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.executions.with_raw_response.execute_async( + id="", + ) + @parametrize async def test_method_execute_sync(self, async_client: AsyncRunloop) -> None: execution = await async_client.devboxes.executions.execute_sync( diff --git a/tests/api_resources/devboxes/test_logs.py b/tests/api_resources/devboxes/test_logs.py index 85ea9be84..bf23b2f8e 100755 --- a/tests/api_resources/devboxes/test_logs.py +++ b/tests/api_resources/devboxes/test_logs.py @@ -20,14 +20,22 @@ class TestLogs: @parametrize def test_method_list(self, client: Runloop) -> None: log = client.devboxes.logs.list( - "id", + id="id", + ) + assert_matches_type(DevboxLogsListView, log, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + log = client.devboxes.logs.list( + id="id", + execution_id="execution_id", ) assert_matches_type(DevboxLogsListView, log, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: response = client.devboxes.logs.with_raw_response.list( - "id", + id="id", ) assert response.is_closed is True @@ -38,7 +46,7 @@ def test_raw_response_list(self, client: Runloop) -> None: @parametrize def test_streaming_response_list(self, client: Runloop) -> None: with client.devboxes.logs.with_streaming_response.list( - "id", + id="id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -52,7 +60,7 @@ def test_streaming_response_list(self, client: Runloop) -> None: def test_path_params_list(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.logs.with_raw_response.list( - "", + id="", ) @@ -62,14 +70,22 @@ class TestAsyncLogs: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: log = await async_client.devboxes.logs.list( - "id", + id="id", + ) + assert_matches_type(DevboxLogsListView, log, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + log = await async_client.devboxes.logs.list( + id="id", + execution_id="execution_id", ) assert_matches_type(DevboxLogsListView, log, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.logs.with_raw_response.list( - "id", + id="id", ) assert response.is_closed is True @@ -80,7 +96,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.logs.with_streaming_response.list( - "id", + id="id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -94,5 +110,5 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None async def test_path_params_list(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.logs.with_raw_response.list( - "", + id="", ) diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 2b39d95da..7d2b71574 100755 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -14,7 +14,6 @@ DevboxListView, DevboxExecutionDetailView, DevboxCreateSSHKeyResponse, - DevboxAsyncExecutionDetailView, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -177,52 +176,6 @@ def test_path_params_create_ssh_key(self, client: Runloop) -> None: "", ) - @parametrize - def test_method_execute_async(self, client: Runloop) -> None: - devbox = client.devboxes.execute_async( - id="id", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) - - @parametrize - def test_method_execute_async_with_all_params(self, client: Runloop) -> None: - devbox = client.devboxes.execute_async( - id="id", - command="command", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) - - @parametrize - def test_raw_response_execute_async(self, client: Runloop) -> None: - response = client.devboxes.with_raw_response.execute_async( - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - devbox = response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) - - @parametrize - def test_streaming_response_execute_async(self, client: Runloop) -> None: - with client.devboxes.with_streaming_response.execute_async( - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - devbox = response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_execute_async(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.with_raw_response.execute_async( - id="", - ) - @parametrize def test_method_execute_sync(self, client: Runloop) -> None: devbox = client.devboxes.execute_sync( @@ -605,52 +558,6 @@ async def test_path_params_create_ssh_key(self, async_client: AsyncRunloop) -> N "", ) - @parametrize - async def test_method_execute_async(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.execute_async( - id="id", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) - - @parametrize - async def test_method_execute_async_with_all_params(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.execute_async( - id="id", - command="command", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) - - @parametrize - async def test_raw_response_execute_async(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.with_raw_response.execute_async( - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - devbox = await response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) - - @parametrize - async def test_streaming_response_execute_async(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.with_streaming_response.execute_async( - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - devbox = await response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_execute_async(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.with_raw_response.execute_async( - id="", - ) - @parametrize async def test_method_execute_sync(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.execute_sync( From b81a9a795eb845774c11fa3647152d534c679afe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 15:55:06 +0000 Subject: [PATCH 125/993] feat(api): OpenAPI spec update via Stainless API (#141) --- .stats.yml | 2 +- api.md | 1 + .../resources/devboxes/devboxes.py | 90 ++++++++++++++++++ src/runloop_api_client/types/__init__.py | 1 + .../types/devbox_execute_async_params.py | 12 +++ tests/api_resources/test_devboxes.py | 93 +++++++++++++++++++ 6 files changed, 198 insertions(+), 1 deletion(-) create mode 100644 src/runloop_api_client/types/devbox_execute_async_params.py diff --git a/.stats.yml b/.stats.yml index 264da0fea..33321e045 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e1f9515ca3a28d01bdf64ee9d93a785ba9bf4c603226f9bc3276e0b0f08d9acb.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f604aab9dce4ace8553e47c1fba2785330184e2b57ef594de0ac6e4027b9fd66.yml diff --git a/api.md b/api.md index 7553b1877..06ff3d790 100755 --- a/api.md +++ b/api.md @@ -65,6 +65,7 @@ Methods: - client.devboxes.retrieve(id) -> DevboxView - client.devboxes.list(\*\*params) -> DevboxListView - client.devboxes.create_ssh_key(id) -> DevboxCreateSSHKeyResponse +- client.devboxes.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.read_file_contents(id, \*\*params) -> str - client.devboxes.shutdown(id) -> DevboxView diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 70be80571..abdc8a8c1 100755 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -20,6 +20,7 @@ devbox_write_file_params, devbox_upload_file_params, devbox_execute_sync_params, + devbox_execute_async_params, devbox_read_file_contents_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes @@ -50,6 +51,7 @@ from ...types.devbox_list_view import DevboxListView from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse +from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView __all__ = ["DevboxesResource", "AsyncDevboxesResource"] @@ -269,6 +271,43 @@ def create_ssh_key( cast_to=DevboxCreateSSHKeyResponse, ) + def execute_async( + self, + id: str, + *, + command: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Asynchronously execute a command on a devbox + + Args: + command: The command to execute on the Devbox. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/execute_async", + body=maybe_transform({"command": command}, devbox_execute_async_params.DevboxExecuteAsyncParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + def execute_sync( self, id: str, @@ -690,6 +729,45 @@ async def create_ssh_key( cast_to=DevboxCreateSSHKeyResponse, ) + async def execute_async( + self, + id: str, + *, + command: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Asynchronously execute a command on a devbox + + Args: + command: The command to execute on the Devbox. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/execute_async", + body=await async_maybe_transform( + {"command": command}, devbox_execute_async_params.DevboxExecuteAsyncParams + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + async def execute_sync( self, id: str, @@ -912,6 +990,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.create_ssh_key = to_raw_response_wrapper( devboxes.create_ssh_key, ) + self.execute_async = to_raw_response_wrapper( + devboxes.execute_async, + ) self.execute_sync = to_raw_response_wrapper( devboxes.execute_sync, ) @@ -953,6 +1034,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.create_ssh_key = async_to_raw_response_wrapper( devboxes.create_ssh_key, ) + self.execute_async = async_to_raw_response_wrapper( + devboxes.execute_async, + ) self.execute_sync = async_to_raw_response_wrapper( devboxes.execute_sync, ) @@ -994,6 +1078,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.create_ssh_key = to_streamed_response_wrapper( devboxes.create_ssh_key, ) + self.execute_async = to_streamed_response_wrapper( + devboxes.execute_async, + ) self.execute_sync = to_streamed_response_wrapper( devboxes.execute_sync, ) @@ -1035,6 +1122,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.create_ssh_key = async_to_streamed_response_wrapper( devboxes.create_ssh_key, ) + self.execute_async = async_to_streamed_response_wrapper( + devboxes.execute_async, + ) self.execute_sync = async_to_streamed_response_wrapper( devboxes.execute_sync, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index eceda8fd6..2facf2e81 100755 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -26,6 +26,7 @@ from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams from .code_mount_parameters_param import CodeMountParametersParam as CodeMountParametersParam +from .devbox_execute_async_params import DevboxExecuteAsyncParams as DevboxExecuteAsyncParams from .function_invoke_sync_params import FunctionInvokeSyncParams as FunctionInvokeSyncParams from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams diff --git a/src/runloop_api_client/types/devbox_execute_async_params.py b/src/runloop_api_client/types/devbox_execute_async_params.py new file mode 100644 index 000000000..9f5a7a8f4 --- /dev/null +++ b/src/runloop_api_client/types/devbox_execute_async_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["DevboxExecuteAsyncParams"] + + +class DevboxExecuteAsyncParams(TypedDict, total=False): + command: str + """The command to execute on the Devbox.""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 7d2b71574..2b39d95da 100755 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -14,6 +14,7 @@ DevboxListView, DevboxExecutionDetailView, DevboxCreateSSHKeyResponse, + DevboxAsyncExecutionDetailView, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -176,6 +177,52 @@ def test_path_params_create_ssh_key(self, client: Runloop) -> None: "", ) + @parametrize + def test_method_execute_async(self, client: Runloop) -> None: + devbox = client.devboxes.execute_async( + id="id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_method_execute_async_with_all_params(self, client: Runloop) -> None: + devbox = client.devboxes.execute_async( + id="id", + command="command", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_raw_response_execute_async(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.execute_async( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_streaming_response_execute_async(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.execute_async( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_execute_async(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.execute_async( + id="", + ) + @parametrize def test_method_execute_sync(self, client: Runloop) -> None: devbox = client.devboxes.execute_sync( @@ -558,6 +605,52 @@ async def test_path_params_create_ssh_key(self, async_client: AsyncRunloop) -> N "", ) + @parametrize + async def test_method_execute_async(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.execute_async( + id="id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_method_execute_async_with_all_params(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.execute_async( + id="id", + command="command", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_raw_response_execute_async(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.execute_async( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_execute_async(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.execute_async( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_execute_async(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.execute_async( + id="", + ) + @parametrize async def test_method_execute_sync(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.execute_sync( From 5eb04a83021610a0dbae99f24255a0f4d52fb71b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 16:15:20 +0000 Subject: [PATCH 126/993] chore(internal): version bump (#142) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3cf71e62c..b386befd2 100755 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.18" + ".": "0.1.0-alpha.19" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index b838acb97..698db3ba7 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.1.0-alpha.18" +version = "0.1.0-alpha.19" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 76888e200..75e0b5781 100755 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.1.0-alpha.18" # x-release-please-version +__version__ = "0.1.0-alpha.19" # x-release-please-version From 7525a9bcbfb83758831599e9aff44655251cd796 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 16:16:20 +0000 Subject: [PATCH 127/993] feat(api): OpenAPI spec update via Stainless API (#143) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 33321e045..264da0fea 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f604aab9dce4ace8553e47c1fba2785330184e2b57ef594de0ac6e4027b9fd66.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e1f9515ca3a28d01bdf64ee9d93a785ba9bf4c603226f9bc3276e0b0f08d9acb.yml From 1bf47a3cca9a7cb0267bb5c0c15a29709ce81a10 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 21:08:00 +0000 Subject: [PATCH 128/993] feat(api): OpenAPI spec update via Stainless API (#145) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 264da0fea..33321e045 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e1f9515ca3a28d01bdf64ee9d93a785ba9bf4c603226f9bc3276e0b0f08d9acb.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f604aab9dce4ace8553e47c1fba2785330184e2b57ef594de0ac6e4027b9fd66.yml From fe40480bf046c6d52e2f91ab414bf24ff1d1867c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 21:16:09 +0000 Subject: [PATCH 129/993] feat(api): OpenAPI spec update via Stainless API (#146) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 33321e045..264da0fea 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f604aab9dce4ace8553e47c1fba2785330184e2b57ef594de0ac6e4027b9fd66.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e1f9515ca3a28d01bdf64ee9d93a785ba9bf4c603226f9bc3276e0b0f08d9acb.yml From 7b09dae9fa787ee3fc5f10281d4761e6663eeb9b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Sep 2024 18:16:51 +0000 Subject: [PATCH 130/993] feat(api): OpenAPI spec update via Stainless API (#147) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 4 ++-- src/runloop_api_client/types/devbox_list_params.py | 2 +- tests/api_resources/test_devboxes.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 264da0fea..ca871fc57 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e1f9515ca3a28d01bdf64ee9d93a785ba9bf4c603226f9bc3276e0b0f08d9acb.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-08b04704be6abc9df511c93bdf820d8a7243327ba3f7e9d15964591eb69309fe.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index abdc8a8c1..935cbe439 100755 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -189,7 +189,7 @@ def retrieve( def list( self, *, - limit: str | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, status: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -647,7 +647,7 @@ async def retrieve( async def list( self, *, - limit: str | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, status: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/runloop_api_client/types/devbox_list_params.py b/src/runloop_api_client/types/devbox_list_params.py index 4a3a37643..b39d3a795 100755 --- a/src/runloop_api_client/types/devbox_list_params.py +++ b/src/runloop_api_client/types/devbox_list_params.py @@ -8,7 +8,7 @@ class DevboxListParams(TypedDict, total=False): - limit: str + limit: int """Page Limit""" starting_after: str diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 2b39d95da..ab2f148ad 100755 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -113,7 +113,7 @@ def test_method_list(self, client: Runloop) -> None: @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.list( - limit="limit", + limit=0, starting_after="starting_after", status="status", ) @@ -541,7 +541,7 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.list( - limit="limit", + limit=0, starting_after="starting_after", status="status", ) From 46815796ba6f462a02615dc6dc8d0f17e21dc40d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Sep 2024 21:16:36 +0000 Subject: [PATCH 131/993] feat(api): OpenAPI spec update via Stainless API (#148) --- .stats.yml | 2 +- src/runloop_api_client/types/devbox_view.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ca871fc57..caa1d40d1 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-08b04704be6abc9df511c93bdf820d8a7243327ba3f7e9d15964591eb69309fe.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bf6b07b1a0ab706ec60c31ce84af006049328ea8a97483a4889ae8eedae1960d.yml diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index e2433cc10..b35689aba 100755 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -36,5 +36,8 @@ class DevboxView(BaseModel): name: Optional[str] = None """The name of the Devbox.""" + shutdown_reason: Optional[Literal["api_shutdown", "keep_alive_timeout", "entrypoint_exit"]] = None + """The shutdown reason if the Devbox shutdown, if any.""" + status: Optional[Literal["provisioning", "initializing", "running", "failure", "shutdown"]] = None """The current status of the Devbox.""" From 3fd922d91b11a4b0700ad2a982f380c83ce15701 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Sep 2024 21:17:10 +0000 Subject: [PATCH 132/993] chore: pyproject.toml formatting changes (#149) --- pyproject.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 698db3ba7..d948e4349 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,6 @@ dependencies = [ "distro>=1.7.0, <2", "sniffio", "cached-property; python_version < '3.8'", - ] requires-python = ">= 3.7" classifiers = [ @@ -36,8 +35,6 @@ classifiers = [ "License :: OSI Approved :: MIT License" ] - - [project.urls] Homepage = "https://github.com/runloopai/api-client-python" Repository = "https://github.com/runloopai/api-client-python" @@ -59,7 +56,6 @@ dev-dependencies = [ "dirty-equals>=0.6.0", "importlib-metadata>=6.7.0", "rich>=13.7.1", - ] [tool.rye.scripts] From cd170779f9dcb87530f97ea6282b17c81f9422fc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2024 18:16:57 +0000 Subject: [PATCH 133/993] feat(api): OpenAPI spec update via Stainless API (#150) --- .stats.yml | 2 +- .../resources/devboxes/devboxes.py | 42 +++++++++++++++++-- .../resources/devboxes/executions.py | 40 ++++++++++++++++-- .../devbox_async_execution_detail_view.py | 3 ++ .../types/devbox_execute_async_params.py | 3 ++ .../types/devbox_execute_sync_params.py | 3 ++ .../types/devbox_execution_detail_view.py | 3 ++ .../execution_execute_async_params.py | 3 ++ .../devboxes/execution_execute_sync_params.py | 3 ++ .../api_resources/devboxes/test_executions.py | 4 ++ tests/api_resources/test_devboxes.py | 4 ++ 11 files changed, 101 insertions(+), 9 deletions(-) diff --git a/.stats.yml b/.stats.yml index caa1d40d1..318fab26a 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bf6b07b1a0ab706ec60c31ce84af006049328ea8a97483a4889ae8eedae1960d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-91bc3d0eb0278e1a1cd12cf2bf252f02cebe5a4b8a6b09f0be986e83c82c432a.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 935cbe439..c4072d446 100755 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -276,6 +276,7 @@ def execute_async( id: str, *, command: str | NotGiven = NOT_GIVEN, + shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -289,6 +290,8 @@ def execute_async( Args: command: The command to execute on the Devbox. + shell_name: Which named shell to run the command in. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -301,7 +304,13 @@ def execute_async( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/execute_async", - body=maybe_transform({"command": command}, devbox_execute_async_params.DevboxExecuteAsyncParams), + body=maybe_transform( + { + "command": command, + "shell_name": shell_name, + }, + devbox_execute_async_params.DevboxExecuteAsyncParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -313,6 +322,7 @@ def execute_sync( id: str, *, command: str | NotGiven = NOT_GIVEN, + shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -326,6 +336,8 @@ def execute_sync( Args: command: The command to execute on the Devbox. + shell_name: Which named shell to run the command in. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -338,7 +350,13 @@ def execute_sync( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/execute_sync", - body=maybe_transform({"command": command}, devbox_execute_sync_params.DevboxExecuteSyncParams), + body=maybe_transform( + { + "command": command, + "shell_name": shell_name, + }, + devbox_execute_sync_params.DevboxExecuteSyncParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -734,6 +752,7 @@ async def execute_async( id: str, *, command: str | NotGiven = NOT_GIVEN, + shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -747,6 +766,8 @@ async def execute_async( Args: command: The command to execute on the Devbox. + shell_name: Which named shell to run the command in. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -760,7 +781,11 @@ async def execute_async( return await self._post( f"/v1/devboxes/{id}/execute_async", body=await async_maybe_transform( - {"command": command}, devbox_execute_async_params.DevboxExecuteAsyncParams + { + "command": command, + "shell_name": shell_name, + }, + devbox_execute_async_params.DevboxExecuteAsyncParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout @@ -773,6 +798,7 @@ async def execute_sync( id: str, *, command: str | NotGiven = NOT_GIVEN, + shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -786,6 +812,8 @@ async def execute_sync( Args: command: The command to execute on the Devbox. + shell_name: Which named shell to run the command in. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -798,7 +826,13 @@ async def execute_sync( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( f"/v1/devboxes/{id}/execute_sync", - body=await async_maybe_transform({"command": command}, devbox_execute_sync_params.DevboxExecuteSyncParams), + body=await async_maybe_transform( + { + "command": command, + "shell_name": shell_name, + }, + devbox_execute_sync_params.DevboxExecuteSyncParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index 3ebba5fc9..79f70af89 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -82,6 +82,7 @@ def execute_async( id: str, *, command: str | NotGiven = NOT_GIVEN, + shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -95,6 +96,8 @@ def execute_async( Args: command: The command to execute on the Devbox. + shell_name: Which named shell to run the command in. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -107,7 +110,13 @@ def execute_async( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/execute_async", - body=maybe_transform({"command": command}, execution_execute_async_params.ExecutionExecuteAsyncParams), + body=maybe_transform( + { + "command": command, + "shell_name": shell_name, + }, + execution_execute_async_params.ExecutionExecuteAsyncParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -119,6 +128,7 @@ def execute_sync( id: str, *, command: str | NotGiven = NOT_GIVEN, + shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -132,6 +142,8 @@ def execute_sync( Args: command: The command to execute on the Devbox. + shell_name: Which named shell to run the command in. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -144,7 +156,13 @@ def execute_sync( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/execute_sync", - body=maybe_transform({"command": command}, execution_execute_sync_params.ExecutionExecuteSyncParams), + body=maybe_transform( + { + "command": command, + "shell_name": shell_name, + }, + execution_execute_sync_params.ExecutionExecuteSyncParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -247,6 +265,7 @@ async def execute_async( id: str, *, command: str | NotGiven = NOT_GIVEN, + shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -260,6 +279,8 @@ async def execute_async( Args: command: The command to execute on the Devbox. + shell_name: Which named shell to run the command in. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -273,7 +294,11 @@ async def execute_async( return await self._post( f"/v1/devboxes/{id}/execute_async", body=await async_maybe_transform( - {"command": command}, execution_execute_async_params.ExecutionExecuteAsyncParams + { + "command": command, + "shell_name": shell_name, + }, + execution_execute_async_params.ExecutionExecuteAsyncParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout @@ -286,6 +311,7 @@ async def execute_sync( id: str, *, command: str | NotGiven = NOT_GIVEN, + shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -299,6 +325,8 @@ async def execute_sync( Args: command: The command to execute on the Devbox. + shell_name: Which named shell to run the command in. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -312,7 +340,11 @@ async def execute_sync( return await self._post( f"/v1/devboxes/{id}/execute_sync", body=await async_maybe_transform( - {"command": command}, execution_execute_sync_params.ExecutionExecuteSyncParams + { + "command": command, + "shell_name": shell_name, + }, + execution_execute_sync_params.ExecutionExecuteSyncParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout diff --git a/src/runloop_api_client/types/devbox_async_execution_detail_view.py b/src/runloop_api_client/types/devbox_async_execution_detail_view.py index b172378b9..499c65d73 100755 --- a/src/runloop_api_client/types/devbox_async_execution_detail_view.py +++ b/src/runloop_api_client/types/devbox_async_execution_detail_view.py @@ -21,6 +21,9 @@ class DevboxAsyncExecutionDetailView(BaseModel): This field will remain unset until the execution has completed. """ + shell_name: Optional[str] = None + """Shell name.""" + status: Optional[Literal["running", "completed", "canceled"]] = None """Current status of the execution.""" diff --git a/src/runloop_api_client/types/devbox_execute_async_params.py b/src/runloop_api_client/types/devbox_execute_async_params.py index 9f5a7a8f4..bdc0eef78 100644 --- a/src/runloop_api_client/types/devbox_execute_async_params.py +++ b/src/runloop_api_client/types/devbox_execute_async_params.py @@ -10,3 +10,6 @@ class DevboxExecuteAsyncParams(TypedDict, total=False): command: str """The command to execute on the Devbox.""" + + shell_name: str + """Which named shell to run the command in.""" diff --git a/src/runloop_api_client/types/devbox_execute_sync_params.py b/src/runloop_api_client/types/devbox_execute_sync_params.py index 12dbc2e0f..8f0c92c60 100755 --- a/src/runloop_api_client/types/devbox_execute_sync_params.py +++ b/src/runloop_api_client/types/devbox_execute_sync_params.py @@ -10,3 +10,6 @@ class DevboxExecuteSyncParams(TypedDict, total=False): command: str """The command to execute on the Devbox.""" + + shell_name: str + """Which named shell to run the command in.""" diff --git a/src/runloop_api_client/types/devbox_execution_detail_view.py b/src/runloop_api_client/types/devbox_execution_detail_view.py index 6ecde1050..029a3ca5e 100755 --- a/src/runloop_api_client/types/devbox_execution_detail_view.py +++ b/src/runloop_api_client/types/devbox_execution_detail_view.py @@ -14,6 +14,9 @@ class DevboxExecutionDetailView(BaseModel): exit_status: Optional[int] = None """Exit status of command execution.""" + shell_name: Optional[str] = None + """Shell name.""" + stderr: Optional[str] = None """Standard error generated by command.""" diff --git a/src/runloop_api_client/types/devboxes/execution_execute_async_params.py b/src/runloop_api_client/types/devboxes/execution_execute_async_params.py index 7878309c5..1dd99c082 100644 --- a/src/runloop_api_client/types/devboxes/execution_execute_async_params.py +++ b/src/runloop_api_client/types/devboxes/execution_execute_async_params.py @@ -10,3 +10,6 @@ class ExecutionExecuteAsyncParams(TypedDict, total=False): command: str """The command to execute on the Devbox.""" + + shell_name: str + """Which named shell to run the command in.""" diff --git a/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py b/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py index 392794ac9..089194877 100755 --- a/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py +++ b/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py @@ -10,3 +10,6 @@ class ExecutionExecuteSyncParams(TypedDict, total=False): command: str """The command to execute on the Devbox.""" + + shell_name: str + """Which named shell to run the command in.""" diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index 8efd48b8b..8c498b3a5 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -86,6 +86,7 @@ def test_method_execute_async_with_all_params(self, client: Runloop) -> None: execution = client.devboxes.executions.execute_async( id="id", command="command", + shell_name="shell_name", ) assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) @@ -132,6 +133,7 @@ def test_method_execute_sync_with_all_params(self, client: Runloop) -> None: execution = client.devboxes.executions.execute_sync( id="id", command="command", + shell_name="shell_name", ) assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) @@ -287,6 +289,7 @@ async def test_method_execute_async_with_all_params(self, async_client: AsyncRun execution = await async_client.devboxes.executions.execute_async( id="id", command="command", + shell_name="shell_name", ) assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) @@ -333,6 +336,7 @@ async def test_method_execute_sync_with_all_params(self, async_client: AsyncRunl execution = await async_client.devboxes.executions.execute_sync( id="id", command="command", + shell_name="shell_name", ) assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index ab2f148ad..7d40adeae 100755 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -189,6 +189,7 @@ def test_method_execute_async_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.execute_async( id="id", command="command", + shell_name="shell_name", ) assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) @@ -235,6 +236,7 @@ def test_method_execute_sync_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.execute_sync( id="id", command="command", + shell_name="shell_name", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @@ -617,6 +619,7 @@ async def test_method_execute_async_with_all_params(self, async_client: AsyncRun devbox = await async_client.devboxes.execute_async( id="id", command="command", + shell_name="shell_name", ) assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) @@ -663,6 +666,7 @@ async def test_method_execute_sync_with_all_params(self, async_client: AsyncRunl devbox = await async_client.devboxes.execute_sync( id="id", command="command", + shell_name="shell_name", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) From 9b6d0029f38c8c4a2485b5456f64eaa7d396e1ee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2024 20:17:00 +0000 Subject: [PATCH 134/993] feat(api): OpenAPI spec update via Stainless API (#151) --- .stats.yml | 2 +- .../resources/devboxes/logs.py | 22 +++++++++++++++++-- .../types/devboxes/devbox_logs_list_view.py | 3 +++ .../types/devboxes/log_list_params.py | 3 +++ tests/api_resources/devboxes/test_logs.py | 2 ++ 5 files changed, 29 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 318fab26a..a0051cce2 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-91bc3d0eb0278e1a1cd12cf2bf252f02cebe5a4b8a6b09f0be986e83c82c432a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a74eb49b9d15dec7e60238642fa01af39359b0b6b3a56306d5c3482c7c7af82.yml diff --git a/src/runloop_api_client/resources/devboxes/logs.py b/src/runloop_api_client/resources/devboxes/logs.py index 70d046a87..1b96611d7 100755 --- a/src/runloop_api_client/resources/devboxes/logs.py +++ b/src/runloop_api_client/resources/devboxes/logs.py @@ -38,6 +38,7 @@ def list( id: str, *, execution_id: str | NotGiven = NOT_GIVEN, + shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -51,6 +52,8 @@ def list( Args: execution_id: Id of execution to filter logs by. + shell_name: Shell Name to filter logs by. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -68,7 +71,13 @@ def list( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform({"execution_id": execution_id}, log_list_params.LogListParams), + query=maybe_transform( + { + "execution_id": execution_id, + "shell_name": shell_name, + }, + log_list_params.LogListParams, + ), ), cast_to=DevboxLogsListView, ) @@ -88,6 +97,7 @@ async def list( id: str, *, execution_id: str | NotGiven = NOT_GIVEN, + shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -101,6 +111,8 @@ async def list( Args: execution_id: Id of execution to filter logs by. + shell_name: Shell Name to filter logs by. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -118,7 +130,13 @@ async def list( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform({"execution_id": execution_id}, log_list_params.LogListParams), + query=await async_maybe_transform( + { + "execution_id": execution_id, + "shell_name": shell_name, + }, + log_list_params.LogListParams, + ), ), cast_to=DevboxLogsListView, ) diff --git a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py index e73fec580..3de2f5f36 100755 --- a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py +++ b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py @@ -24,6 +24,9 @@ class Log(BaseModel): message: Optional[str] = None """Log line message.""" + shell_name: Optional[str] = None + """The Shell name the cmd executed in.""" + source: Optional[Literal["setup_commands", "entrypoint", "exec"]] = None """The source of the log.""" diff --git a/src/runloop_api_client/types/devboxes/log_list_params.py b/src/runloop_api_client/types/devboxes/log_list_params.py index 5bc1fe974..88dfa1683 100644 --- a/src/runloop_api_client/types/devboxes/log_list_params.py +++ b/src/runloop_api_client/types/devboxes/log_list_params.py @@ -10,3 +10,6 @@ class LogListParams(TypedDict, total=False): execution_id: str """Id of execution to filter logs by.""" + + shell_name: str + """Shell Name to filter logs by.""" diff --git a/tests/api_resources/devboxes/test_logs.py b/tests/api_resources/devboxes/test_logs.py index bf23b2f8e..3546c378a 100755 --- a/tests/api_resources/devboxes/test_logs.py +++ b/tests/api_resources/devboxes/test_logs.py @@ -29,6 +29,7 @@ def test_method_list_with_all_params(self, client: Runloop) -> None: log = client.devboxes.logs.list( id="id", execution_id="execution_id", + shell_name="shell_name", ) assert_matches_type(DevboxLogsListView, log, path=["response"]) @@ -79,6 +80,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> log = await async_client.devboxes.logs.list( id="id", execution_id="execution_id", + shell_name="shell_name", ) assert_matches_type(DevboxLogsListView, log, path=["response"]) From 97368e974ccec6bb707daebb3c48e76e3c9a4df7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2024 23:51:36 +0000 Subject: [PATCH 135/993] feat(api): OpenAPI spec update via Stainless API (#152) --- .stats.yml | 2 +- .../types/devbox_async_execution_detail_view.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a0051cce2..49b1ac2fb 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a74eb49b9d15dec7e60238642fa01af39359b0b6b3a56306d5c3482c7c7af82.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-59aa5c5a07ca6209e281b977385e05cc70f06d497b83cbb8debc52df5139f6d2.yml diff --git a/src/runloop_api_client/types/devbox_async_execution_detail_view.py b/src/runloop_api_client/types/devbox_async_execution_detail_view.py index 499c65d73..0ee2ab6c0 100755 --- a/src/runloop_api_client/types/devbox_async_execution_detail_view.py +++ b/src/runloop_api_client/types/devbox_async_execution_detail_view.py @@ -24,7 +24,7 @@ class DevboxAsyncExecutionDetailView(BaseModel): shell_name: Optional[str] = None """Shell name.""" - status: Optional[Literal["running", "completed", "canceled"]] = None + status: Optional[Literal["queued", "running", "completed"]] = None """Current status of the execution.""" stderr: Optional[str] = None From 980c2e5b1bf4305191db29b98227b0945f14e484 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 6 Sep 2024 00:16:51 +0000 Subject: [PATCH 136/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 49b1ac2fb..c17f80ffa 100755 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-59aa5c5a07ca6209e281b977385e05cc70f06d497b83cbb8debc52df5139f6d2.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-66b295e911150517c1f395f497b041a007af04c562562935d3b5e70a7e02c2b6.yml From 71269cc416390933d430d1363668c80bb3fd46d2 Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Fri, 6 Sep 2024 12:27:23 -0400 Subject: [PATCH 137/993] fix file permissions --- .devcontainer/Dockerfile | 0 .devcontainer/devcontainer.json | 0 .github/workflows/ci.yml | 0 .github/workflows/publish-pypi.yml | 0 .github/workflows/release-doctor.yml | 0 .gitignore | 0 .python-version | 0 .release-please-manifest.json | 0 .stats.yml | 0 Brewfile | 0 CONTRIBUTING.md | 0 LICENSE | 0 README.md | 0 SECURITY.md | 0 api.md | 0 bin/check-release-environment | 0 bin/publish-pypi | 0 examples/.keep | 0 mypy.ini | 0 noxfile.py | 0 pyproject.toml | 0 release-please-config.json | 0 requirements-dev.lock | 0 requirements.lock | 0 scripts/utils/ruffen-docs.py | 0 src/runloop/lib/.keep | 0 src/runloop_api_client/__init__.py | 0 src/runloop_api_client/_base_client.py | 0 src/runloop_api_client/_client.py | 0 src/runloop_api_client/_compat.py | 0 src/runloop_api_client/_constants.py | 0 src/runloop_api_client/_exceptions.py | 0 src/runloop_api_client/_files.py | 0 src/runloop_api_client/_models.py | 0 src/runloop_api_client/_qs.py | 0 src/runloop_api_client/_resource.py | 0 src/runloop_api_client/_response.py | 0 src/runloop_api_client/_streaming.py | 0 src/runloop_api_client/_types.py | 0 src/runloop_api_client/_utils/__init__.py | 0 src/runloop_api_client/_utils/_logs.py | 0 src/runloop_api_client/_utils/_proxy.py | 0 src/runloop_api_client/_utils/_reflection.py | 0 src/runloop_api_client/_utils/_streams.py | 0 src/runloop_api_client/_utils/_sync.py | 0 src/runloop_api_client/_utils/_transform.py | 0 src/runloop_api_client/_utils/_typing.py | 0 src/runloop_api_client/_utils/_utils.py | 0 src/runloop_api_client/_version.py | 0 src/runloop_api_client/lib/.keep | 0 src/runloop_api_client/py.typed | 0 src/runloop_api_client/resources/__init__.py | 0 src/runloop_api_client/resources/blueprints.py | 0 src/runloop_api_client/resources/devboxes/__init__.py | 0 src/runloop_api_client/resources/devboxes/devboxes.py | 0 src/runloop_api_client/resources/devboxes/logs.py | 0 src/runloop_api_client/resources/functions/__init__.py | 0 src/runloop_api_client/resources/functions/functions.py | 0 src/runloop_api_client/resources/functions/invocations.py | 0 src/runloop_api_client/resources/projects/__init__.py | 0 src/runloop_api_client/resources/projects/logs.py | 0 src/runloop_api_client/resources/projects/projects.py | 0 src/runloop_api_client/types/__init__.py | 0 src/runloop_api_client/types/blueprint_build_log.py | 0 src/runloop_api_client/types/blueprint_build_logs_list_view.py | 0 src/runloop_api_client/types/blueprint_build_parameters.py | 0 src/runloop_api_client/types/blueprint_create_params.py | 0 src/runloop_api_client/types/blueprint_list_params.py | 0 src/runloop_api_client/types/blueprint_list_view.py | 0 src/runloop_api_client/types/blueprint_preview_params.py | 0 src/runloop_api_client/types/blueprint_preview_view.py | 0 src/runloop_api_client/types/blueprint_view.py | 0 src/runloop_api_client/types/code_mount_parameters.py | 0 src/runloop_api_client/types/code_mount_parameters_param.py | 0 src/runloop_api_client/types/devbox_create_params.py | 0 src/runloop_api_client/types/devbox_execute_sync_params.py | 0 src/runloop_api_client/types/devbox_execution_detail_view.py | 0 src/runloop_api_client/types/devbox_list_params.py | 0 src/runloop_api_client/types/devbox_list_view.py | 0 src/runloop_api_client/types/devbox_read_file_contents_params.py | 0 .../types/devbox_read_file_contents_response.py | 0 src/runloop_api_client/types/devbox_upload_file_params.py | 0 src/runloop_api_client/types/devbox_view.py | 0 src/runloop_api_client/types/devbox_write_file_params.py | 0 src/runloop_api_client/types/devboxes/__init__.py | 0 src/runloop_api_client/types/devboxes/devbox_logs_list_view.py | 0 src/runloop_api_client/types/function_invoke_async_params.py | 0 src/runloop_api_client/types/function_invoke_sync_params.py | 0 src/runloop_api_client/types/function_list_view.py | 0 src/runloop_api_client/types/functions/__init__.py | 0 .../types/functions/function_invocation_list_view.py | 0 src/runloop_api_client/types/functions/invocation_list_params.py | 0 src/runloop_api_client/types/project_list_view.py | 0 src/runloop_api_client/types/projects/__init__.py | 0 src/runloop_api_client/types/resource_size.py | 0 src/runloop_api_client/types/shared/__init__.py | 0 .../types/shared/function_invocation_execution_detail_view.py | 0 src/runloop_api_client/types/shared/project_logs_view.py | 0 src/runloop_minus_api_minus_client/lib/.keep | 0 tests/__init__.py | 0 tests/api_resources/__init__.py | 0 tests/api_resources/devboxes/__init__.py | 0 tests/api_resources/devboxes/test_logs.py | 0 tests/api_resources/functions/__init__.py | 0 tests/api_resources/functions/test_invocations.py | 0 tests/api_resources/projects/__init__.py | 0 tests/api_resources/projects/test_logs.py | 0 tests/api_resources/test_blueprints.py | 0 tests/api_resources/test_devboxes.py | 0 tests/api_resources/test_functions.py | 0 tests/api_resources/test_projects.py | 0 tests/conftest.py | 0 tests/sample_file.txt | 0 tests/test_client.py | 0 tests/test_deepcopy.py | 0 tests/test_extract_files.py | 0 tests/test_files.py | 0 tests/test_models.py | 0 tests/test_qs.py | 0 tests/test_required_args.py | 0 tests/test_response.py | 0 tests/test_streaming.py | 0 tests/test_transform.py | 0 tests/test_utils/test_proxy.py | 0 tests/test_utils/test_typing.py | 0 tests/utils.py | 0 126 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 .devcontainer/Dockerfile mode change 100755 => 100644 .devcontainer/devcontainer.json mode change 100755 => 100644 .github/workflows/ci.yml mode change 100755 => 100644 .github/workflows/publish-pypi.yml mode change 100755 => 100644 .github/workflows/release-doctor.yml mode change 100755 => 100644 .gitignore mode change 100755 => 100644 .python-version mode change 100755 => 100644 .release-please-manifest.json mode change 100755 => 100644 .stats.yml mode change 100755 => 100644 Brewfile mode change 100755 => 100644 CONTRIBUTING.md mode change 100755 => 100644 LICENSE mode change 100755 => 100644 README.md mode change 100755 => 100644 SECURITY.md mode change 100755 => 100644 api.md mode change 100755 => 100644 bin/check-release-environment mode change 100755 => 100644 bin/publish-pypi mode change 100755 => 100644 examples/.keep mode change 100755 => 100644 mypy.ini mode change 100755 => 100644 noxfile.py mode change 100755 => 100644 pyproject.toml mode change 100755 => 100644 release-please-config.json mode change 100755 => 100644 requirements-dev.lock mode change 100755 => 100644 requirements.lock mode change 100755 => 100644 scripts/utils/ruffen-docs.py mode change 100755 => 100644 src/runloop/lib/.keep mode change 100755 => 100644 src/runloop_api_client/__init__.py mode change 100755 => 100644 src/runloop_api_client/_base_client.py mode change 100755 => 100644 src/runloop_api_client/_client.py mode change 100755 => 100644 src/runloop_api_client/_compat.py mode change 100755 => 100644 src/runloop_api_client/_constants.py mode change 100755 => 100644 src/runloop_api_client/_exceptions.py mode change 100755 => 100644 src/runloop_api_client/_files.py mode change 100755 => 100644 src/runloop_api_client/_models.py mode change 100755 => 100644 src/runloop_api_client/_qs.py mode change 100755 => 100644 src/runloop_api_client/_resource.py mode change 100755 => 100644 src/runloop_api_client/_response.py mode change 100755 => 100644 src/runloop_api_client/_streaming.py mode change 100755 => 100644 src/runloop_api_client/_types.py mode change 100755 => 100644 src/runloop_api_client/_utils/__init__.py mode change 100755 => 100644 src/runloop_api_client/_utils/_logs.py mode change 100755 => 100644 src/runloop_api_client/_utils/_proxy.py mode change 100755 => 100644 src/runloop_api_client/_utils/_reflection.py mode change 100755 => 100644 src/runloop_api_client/_utils/_streams.py mode change 100755 => 100644 src/runloop_api_client/_utils/_sync.py mode change 100755 => 100644 src/runloop_api_client/_utils/_transform.py mode change 100755 => 100644 src/runloop_api_client/_utils/_typing.py mode change 100755 => 100644 src/runloop_api_client/_utils/_utils.py mode change 100755 => 100644 src/runloop_api_client/_version.py mode change 100755 => 100644 src/runloop_api_client/lib/.keep mode change 100755 => 100644 src/runloop_api_client/py.typed mode change 100755 => 100644 src/runloop_api_client/resources/__init__.py mode change 100755 => 100644 src/runloop_api_client/resources/blueprints.py mode change 100755 => 100644 src/runloop_api_client/resources/devboxes/__init__.py mode change 100755 => 100644 src/runloop_api_client/resources/devboxes/devboxes.py mode change 100755 => 100644 src/runloop_api_client/resources/devboxes/logs.py mode change 100755 => 100644 src/runloop_api_client/resources/functions/__init__.py mode change 100755 => 100644 src/runloop_api_client/resources/functions/functions.py mode change 100755 => 100644 src/runloop_api_client/resources/functions/invocations.py mode change 100755 => 100644 src/runloop_api_client/resources/projects/__init__.py mode change 100755 => 100644 src/runloop_api_client/resources/projects/logs.py mode change 100755 => 100644 src/runloop_api_client/resources/projects/projects.py mode change 100755 => 100644 src/runloop_api_client/types/__init__.py mode change 100755 => 100644 src/runloop_api_client/types/blueprint_build_log.py mode change 100755 => 100644 src/runloop_api_client/types/blueprint_build_logs_list_view.py mode change 100755 => 100644 src/runloop_api_client/types/blueprint_build_parameters.py mode change 100755 => 100644 src/runloop_api_client/types/blueprint_create_params.py mode change 100755 => 100644 src/runloop_api_client/types/blueprint_list_params.py mode change 100755 => 100644 src/runloop_api_client/types/blueprint_list_view.py mode change 100755 => 100644 src/runloop_api_client/types/blueprint_preview_params.py mode change 100755 => 100644 src/runloop_api_client/types/blueprint_preview_view.py mode change 100755 => 100644 src/runloop_api_client/types/blueprint_view.py mode change 100755 => 100644 src/runloop_api_client/types/code_mount_parameters.py mode change 100755 => 100644 src/runloop_api_client/types/code_mount_parameters_param.py mode change 100755 => 100644 src/runloop_api_client/types/devbox_create_params.py mode change 100755 => 100644 src/runloop_api_client/types/devbox_execute_sync_params.py mode change 100755 => 100644 src/runloop_api_client/types/devbox_execution_detail_view.py mode change 100755 => 100644 src/runloop_api_client/types/devbox_list_params.py mode change 100755 => 100644 src/runloop_api_client/types/devbox_list_view.py mode change 100755 => 100644 src/runloop_api_client/types/devbox_read_file_contents_params.py mode change 100755 => 100644 src/runloop_api_client/types/devbox_read_file_contents_response.py mode change 100755 => 100644 src/runloop_api_client/types/devbox_upload_file_params.py mode change 100755 => 100644 src/runloop_api_client/types/devbox_view.py mode change 100755 => 100644 src/runloop_api_client/types/devbox_write_file_params.py mode change 100755 => 100644 src/runloop_api_client/types/devboxes/__init__.py mode change 100755 => 100644 src/runloop_api_client/types/devboxes/devbox_logs_list_view.py mode change 100755 => 100644 src/runloop_api_client/types/function_invoke_async_params.py mode change 100755 => 100644 src/runloop_api_client/types/function_invoke_sync_params.py mode change 100755 => 100644 src/runloop_api_client/types/function_list_view.py mode change 100755 => 100644 src/runloop_api_client/types/functions/__init__.py mode change 100755 => 100644 src/runloop_api_client/types/functions/function_invocation_list_view.py mode change 100755 => 100644 src/runloop_api_client/types/functions/invocation_list_params.py mode change 100755 => 100644 src/runloop_api_client/types/project_list_view.py mode change 100755 => 100644 src/runloop_api_client/types/projects/__init__.py mode change 100755 => 100644 src/runloop_api_client/types/resource_size.py mode change 100755 => 100644 src/runloop_api_client/types/shared/__init__.py mode change 100755 => 100644 src/runloop_api_client/types/shared/function_invocation_execution_detail_view.py mode change 100755 => 100644 src/runloop_api_client/types/shared/project_logs_view.py mode change 100755 => 100644 src/runloop_minus_api_minus_client/lib/.keep mode change 100755 => 100644 tests/__init__.py mode change 100755 => 100644 tests/api_resources/__init__.py mode change 100755 => 100644 tests/api_resources/devboxes/__init__.py mode change 100755 => 100644 tests/api_resources/devboxes/test_logs.py mode change 100755 => 100644 tests/api_resources/functions/__init__.py mode change 100755 => 100644 tests/api_resources/functions/test_invocations.py mode change 100755 => 100644 tests/api_resources/projects/__init__.py mode change 100755 => 100644 tests/api_resources/projects/test_logs.py mode change 100755 => 100644 tests/api_resources/test_blueprints.py mode change 100755 => 100644 tests/api_resources/test_devboxes.py mode change 100755 => 100644 tests/api_resources/test_functions.py mode change 100755 => 100644 tests/api_resources/test_projects.py mode change 100755 => 100644 tests/conftest.py mode change 100755 => 100644 tests/sample_file.txt mode change 100755 => 100644 tests/test_client.py mode change 100755 => 100644 tests/test_deepcopy.py mode change 100755 => 100644 tests/test_extract_files.py mode change 100755 => 100644 tests/test_files.py mode change 100755 => 100644 tests/test_models.py mode change 100755 => 100644 tests/test_qs.py mode change 100755 => 100644 tests/test_required_args.py mode change 100755 => 100644 tests/test_response.py mode change 100755 => 100644 tests/test_streaming.py mode change 100755 => 100644 tests/test_transform.py mode change 100755 => 100644 tests/test_utils/test_proxy.py mode change 100755 => 100644 tests/test_utils/test_typing.py mode change 100755 => 100644 tests/utils.py diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile old mode 100755 new mode 100644 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json old mode 100755 new mode 100644 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml old mode 100755 new mode 100644 diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml old mode 100755 new mode 100644 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml old mode 100755 new mode 100644 diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 diff --git a/.python-version b/.python-version old mode 100755 new mode 100644 diff --git a/.release-please-manifest.json b/.release-please-manifest.json old mode 100755 new mode 100644 diff --git a/.stats.yml b/.stats.yml old mode 100755 new mode 100644 diff --git a/Brewfile b/Brewfile old mode 100755 new mode 100644 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md old mode 100755 new mode 100644 diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 diff --git a/SECURITY.md b/SECURITY.md old mode 100755 new mode 100644 diff --git a/api.md b/api.md old mode 100755 new mode 100644 diff --git a/bin/check-release-environment b/bin/check-release-environment old mode 100755 new mode 100644 diff --git a/bin/publish-pypi b/bin/publish-pypi old mode 100755 new mode 100644 diff --git a/examples/.keep b/examples/.keep old mode 100755 new mode 100644 diff --git a/mypy.ini b/mypy.ini old mode 100755 new mode 100644 diff --git a/noxfile.py b/noxfile.py old mode 100755 new mode 100644 diff --git a/pyproject.toml b/pyproject.toml old mode 100755 new mode 100644 diff --git a/release-please-config.json b/release-please-config.json old mode 100755 new mode 100644 diff --git a/requirements-dev.lock b/requirements-dev.lock old mode 100755 new mode 100644 diff --git a/requirements.lock b/requirements.lock old mode 100755 new mode 100644 diff --git a/scripts/utils/ruffen-docs.py b/scripts/utils/ruffen-docs.py old mode 100755 new mode 100644 diff --git a/src/runloop/lib/.keep b/src/runloop/lib/.keep old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/__init__.py b/src/runloop_api_client/__init__.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/_compat.py b/src/runloop_api_client/_compat.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/_constants.py b/src/runloop_api_client/_constants.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/_exceptions.py b/src/runloop_api_client/_exceptions.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/_files.py b/src/runloop_api_client/_files.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/_qs.py b/src/runloop_api_client/_qs.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/_resource.py b/src/runloop_api_client/_resource.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/_response.py b/src/runloop_api_client/_response.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/_streaming.py b/src/runloop_api_client/_streaming.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/_types.py b/src/runloop_api_client/_types.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/_utils/__init__.py b/src/runloop_api_client/_utils/__init__.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/_utils/_logs.py b/src/runloop_api_client/_utils/_logs.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/_utils/_proxy.py b/src/runloop_api_client/_utils/_proxy.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/_utils/_reflection.py b/src/runloop_api_client/_utils/_reflection.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/_utils/_streams.py b/src/runloop_api_client/_utils/_streams.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/_utils/_sync.py b/src/runloop_api_client/_utils/_sync.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/_utils/_transform.py b/src/runloop_api_client/_utils/_transform.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/_utils/_typing.py b/src/runloop_api_client/_utils/_typing.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/_utils/_utils.py b/src/runloop_api_client/_utils/_utils.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/lib/.keep b/src/runloop_api_client/lib/.keep old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/py.typed b/src/runloop_api_client/py.typed old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/resources/__init__.py b/src/runloop_api_client/resources/__init__.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/resources/devboxes/logs.py b/src/runloop_api_client/resources/devboxes/logs.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/resources/functions/__init__.py b/src/runloop_api_client/resources/functions/__init__.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/resources/functions/functions.py b/src/runloop_api_client/resources/functions/functions.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/resources/functions/invocations.py b/src/runloop_api_client/resources/functions/invocations.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/resources/projects/__init__.py b/src/runloop_api_client/resources/projects/__init__.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/resources/projects/logs.py b/src/runloop_api_client/resources/projects/logs.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/resources/projects/projects.py b/src/runloop_api_client/resources/projects/projects.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/blueprint_build_log.py b/src/runloop_api_client/types/blueprint_build_log.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/blueprint_build_logs_list_view.py b/src/runloop_api_client/types/blueprint_build_logs_list_view.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/blueprint_list_params.py b/src/runloop_api_client/types/blueprint_list_params.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/blueprint_list_view.py b/src/runloop_api_client/types/blueprint_list_view.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/blueprint_preview_view.py b/src/runloop_api_client/types/blueprint_preview_view.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/blueprint_view.py b/src/runloop_api_client/types/blueprint_view.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/code_mount_parameters.py b/src/runloop_api_client/types/code_mount_parameters.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/code_mount_parameters_param.py b/src/runloop_api_client/types/code_mount_parameters_param.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/devbox_execute_sync_params.py b/src/runloop_api_client/types/devbox_execute_sync_params.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/devbox_execution_detail_view.py b/src/runloop_api_client/types/devbox_execution_detail_view.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/devbox_list_params.py b/src/runloop_api_client/types/devbox_list_params.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/devbox_list_view.py b/src/runloop_api_client/types/devbox_list_view.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/devbox_read_file_contents_params.py b/src/runloop_api_client/types/devbox_read_file_contents_params.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/devbox_read_file_contents_response.py b/src/runloop_api_client/types/devbox_read_file_contents_response.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/devbox_upload_file_params.py b/src/runloop_api_client/types/devbox_upload_file_params.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/devbox_write_file_params.py b/src/runloop_api_client/types/devbox_write_file_params.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/function_invoke_async_params.py b/src/runloop_api_client/types/function_invoke_async_params.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/function_invoke_sync_params.py b/src/runloop_api_client/types/function_invoke_sync_params.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/function_list_view.py b/src/runloop_api_client/types/function_list_view.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/functions/__init__.py b/src/runloop_api_client/types/functions/__init__.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/functions/function_invocation_list_view.py b/src/runloop_api_client/types/functions/function_invocation_list_view.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/functions/invocation_list_params.py b/src/runloop_api_client/types/functions/invocation_list_params.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/project_list_view.py b/src/runloop_api_client/types/project_list_view.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/projects/__init__.py b/src/runloop_api_client/types/projects/__init__.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/resource_size.py b/src/runloop_api_client/types/resource_size.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/shared/__init__.py b/src/runloop_api_client/types/shared/__init__.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/shared/function_invocation_execution_detail_view.py b/src/runloop_api_client/types/shared/function_invocation_execution_detail_view.py old mode 100755 new mode 100644 diff --git a/src/runloop_api_client/types/shared/project_logs_view.py b/src/runloop_api_client/types/shared/project_logs_view.py old mode 100755 new mode 100644 diff --git a/src/runloop_minus_api_minus_client/lib/.keep b/src/runloop_minus_api_minus_client/lib/.keep old mode 100755 new mode 100644 diff --git a/tests/__init__.py b/tests/__init__.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/__init__.py b/tests/api_resources/__init__.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/devboxes/__init__.py b/tests/api_resources/devboxes/__init__.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/devboxes/test_logs.py b/tests/api_resources/devboxes/test_logs.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/functions/__init__.py b/tests/api_resources/functions/__init__.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/functions/test_invocations.py b/tests/api_resources/functions/test_invocations.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/projects/__init__.py b/tests/api_resources/projects/__init__.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/projects/test_logs.py b/tests/api_resources/projects/test_logs.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/test_functions.py b/tests/api_resources/test_functions.py old mode 100755 new mode 100644 diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py old mode 100755 new mode 100644 diff --git a/tests/conftest.py b/tests/conftest.py old mode 100755 new mode 100644 diff --git a/tests/sample_file.txt b/tests/sample_file.txt old mode 100755 new mode 100644 diff --git a/tests/test_client.py b/tests/test_client.py old mode 100755 new mode 100644 diff --git a/tests/test_deepcopy.py b/tests/test_deepcopy.py old mode 100755 new mode 100644 diff --git a/tests/test_extract_files.py b/tests/test_extract_files.py old mode 100755 new mode 100644 diff --git a/tests/test_files.py b/tests/test_files.py old mode 100755 new mode 100644 diff --git a/tests/test_models.py b/tests/test_models.py old mode 100755 new mode 100644 diff --git a/tests/test_qs.py b/tests/test_qs.py old mode 100755 new mode 100644 diff --git a/tests/test_required_args.py b/tests/test_required_args.py old mode 100755 new mode 100644 diff --git a/tests/test_response.py b/tests/test_response.py old mode 100755 new mode 100644 diff --git a/tests/test_streaming.py b/tests/test_streaming.py old mode 100755 new mode 100644 diff --git a/tests/test_transform.py b/tests/test_transform.py old mode 100755 new mode 100644 diff --git a/tests/test_utils/test_proxy.py b/tests/test_utils/test_proxy.py old mode 100755 new mode 100644 diff --git a/tests/test_utils/test_typing.py b/tests/test_utils/test_typing.py old mode 100755 new mode 100644 diff --git a/tests/utils.py b/tests/utils.py old mode 100755 new mode 100644 From 0bea18138ac6e645b4b83e91aa010d84618e74b7 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 6 Sep 2024 17:56:24 +0000 Subject: [PATCH 138/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c17f80ffa..3f25380a5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-66b295e911150517c1f395f497b041a007af04c562562935d3b5e70a7e02c2b6.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8e083622d148034420e27803d50f4f4021f9ffdc16603cf283091f760e5fb31b.yml From fac41861ef9e78c04bccc569d0d624385babb65a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2024 18:10:01 +0000 Subject: [PATCH 139/993] feat(api): OpenAPI spec update via Stainless API (#154) --- .stats.yml | 2 +- .../resources/devboxes/devboxes.py | 11 ++++- .../types/devbox_create_params.py | 6 ++- tests/api_resources/test_devboxes.py | 40 +++++++++++++++++++ 4 files changed, 56 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3f25380a5..544dd8429 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8e083622d148034420e27803d50f4f4021f9ffdc16603cf283091f760e5fb31b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e5814f43206695e4828bf231b12d995986b9e8e638e9075ebe104de68b2a29a4.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index c4072d446..59198714c 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Mapping, cast +from typing import Dict, List, Mapping, Iterable, cast import httpx @@ -49,6 +49,7 @@ from ..._base_client import make_request_options from ...types.devbox_view import DevboxView from ...types.devbox_list_view import DevboxListView +from ...types.code_mount_parameters_param import CodeMountParametersParam from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView @@ -78,6 +79,7 @@ def create( *, blueprint_id: str | NotGiven = NOT_GIVEN, blueprint_name: str | NotGiven = NOT_GIVEN, + code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, @@ -104,6 +106,8 @@ def create( blueprint_name: (Optional) Name of Blueprint to use for the Devbox. When set, this will load the latest successfully built Blueprint with the given name. + code_mounts: A list of code mounts to be included in the Devbox. + entrypoint: (Optional) When specified, the Devbox will run this script as its main executable. The devbox lifecycle will be bound to entrypoint, shutting down when the process is complete. @@ -136,6 +140,7 @@ def create( { "blueprint_id": blueprint_id, "blueprint_name": blueprint_name, + "code_mounts": code_mounts, "entrypoint": entrypoint, "environment_variables": environment_variables, "file_mounts": file_mounts, @@ -554,6 +559,7 @@ async def create( *, blueprint_id: str | NotGiven = NOT_GIVEN, blueprint_name: str | NotGiven = NOT_GIVEN, + code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, @@ -580,6 +586,8 @@ async def create( blueprint_name: (Optional) Name of Blueprint to use for the Devbox. When set, this will load the latest successfully built Blueprint with the given name. + code_mounts: A list of code mounts to be included in the Devbox. + entrypoint: (Optional) When specified, the Devbox will run this script as its main executable. The devbox lifecycle will be bound to entrypoint, shutting down when the process is complete. @@ -612,6 +620,7 @@ async def create( { "blueprint_id": blueprint_id, "blueprint_name": blueprint_name, + "code_mounts": code_mounts, "entrypoint": entrypoint, "environment_variables": environment_variables, "file_mounts": file_mounts, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 61bb1453a..7998fecf7 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -2,10 +2,11 @@ from __future__ import annotations -from typing import Dict, List +from typing import Dict, List, Iterable from typing_extensions import TypedDict from .resource_size import ResourceSize +from .code_mount_parameters_param import CodeMountParametersParam __all__ = ["DevboxCreateParams", "LaunchParameters"] @@ -24,6 +25,9 @@ class DevboxCreateParams(TypedDict, total=False): name. """ + code_mounts: Iterable[CodeMountParametersParam] + """A list of code mounts to be included in the Devbox.""" + entrypoint: str """ (Optional) When specified, the Devbox will run this script as its main diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 7d40adeae..2c6b20e5c 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -33,6 +33,26 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.create( blueprint_id="blueprint_id", blueprint_name="blueprint_name", + code_mounts=[ + { + "token": "token", + "install_command": "install_command", + "repo_name": "repo_name", + "repo_owner": "repo_owner", + }, + { + "token": "token", + "install_command": "install_command", + "repo_name": "repo_name", + "repo_owner": "repo_owner", + }, + { + "token": "token", + "install_command": "install_command", + "repo_name": "repo_name", + "repo_owner": "repo_owner", + }, + ], entrypoint="entrypoint", environment_variables={"foo": "string"}, file_mounts={"foo": "string"}, @@ -463,6 +483,26 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - devbox = await async_client.devboxes.create( blueprint_id="blueprint_id", blueprint_name="blueprint_name", + code_mounts=[ + { + "token": "token", + "install_command": "install_command", + "repo_name": "repo_name", + "repo_owner": "repo_owner", + }, + { + "token": "token", + "install_command": "install_command", + "repo_name": "repo_name", + "repo_owner": "repo_owner", + }, + { + "token": "token", + "install_command": "install_command", + "repo_name": "repo_name", + "repo_owner": "repo_owner", + }, + ], entrypoint="entrypoint", environment_variables={"foo": "string"}, file_mounts={"foo": "string"}, From a9788bd217fc18b64003afb0c3fd23472568bed6 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 6 Sep 2024 18:17:16 +0000 Subject: [PATCH 140/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 544dd8429..92062056e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e5814f43206695e4828bf231b12d995986b9e8e638e9075ebe104de68b2a29a4.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-961bb8c7671926de4e18137f188b71bc55d21a75086a6d40714a8844044207ac.yml From 36131f201cd6d4dede4419dd2c6d0e69b53315a7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2024 18:31:07 +0000 Subject: [PATCH 141/993] chore(internal): version bump (#155) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b386befd2..fac140743 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.19" + ".": "0.1.0-alpha.20" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index d948e4349..650dd2f4f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.1.0-alpha.19" +version = "0.1.0-alpha.20" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 75e0b5781..da975be7f 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.1.0-alpha.19" # x-release-please-version +__version__ = "0.1.0-alpha.20" # x-release-please-version From 21400abfd47a8c07e6bf646a5b6f5a4810056519 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 17:17:20 +0000 Subject: [PATCH 142/993] feat(api): OpenAPI spec update via Stainless API (#156) --- .stats.yml | 2 +- src/runloop_api_client/types/devbox_view.py | 22 +++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 92062056e..9c4e70db4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-961bb8c7671926de4e18137f188b71bc55d21a75086a6d40714a8844044207ac.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c77dce4134ebb2ea5a0cda4f7328b33caf19cb1a518d78f41187bc6adb727951.yml diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index b35689aba..65ac72725 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -1,11 +1,26 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Optional +from typing import Dict, List, Optional from typing_extensions import Literal from .._models import BaseModel +from .resource_size import ResourceSize -__all__ = ["DevboxView"] +__all__ = ["DevboxView", "LaunchParameters"] + + +class LaunchParameters(BaseModel): + keep_alive_time_seconds: Optional[int] = None + """Time in seconds after which Devbox will automatically shutdown. + + Default is 1 hour. + """ + + launch_commands: Optional[List[str]] = None + """Set of commands to be run at launch time, before the entrypoint process is run.""" + + resource_size_request: Optional[ResourceSize] = None + """Manual resource configuration for Devbox. If not set, defaults will be used.""" class DevboxView(BaseModel): @@ -30,6 +45,9 @@ class DevboxView(BaseModel): initiator_type: Optional[Literal["unknown", "api", "invocation"]] = None """The initiator of the devbox.""" + launch_parameters: Optional[LaunchParameters] = None + """The launch parameters used to create the Devbox.""" + metadata: Optional[Dict[str, str]] = None """The user defined Devbox metadata.""" From 8a874509926a108fc3cbf28cbc28c5b7485f2e88 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 17:18:18 +0000 Subject: [PATCH 143/993] chore: add docstrings to raw response properties (#158) --- .../resources/blueprints.py | 22 +++++++++++++++++++ .../resources/devboxes/devboxes.py | 22 +++++++++++++++++++ .../resources/devboxes/executions.py | 22 +++++++++++++++++++ .../resources/devboxes/logs.py | 22 +++++++++++++++++++ .../resources/functions/functions.py | 22 +++++++++++++++++++ .../resources/functions/invocations.py | 22 +++++++++++++++++++ .../resources/projects/logs.py | 22 +++++++++++++++++++ .../resources/projects/projects.py | 22 +++++++++++++++++++ 8 files changed, 176 insertions(+) diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index c3221a79d..cb8e1eee3 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -33,10 +33,21 @@ class BlueprintsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> BlueprintsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ return BlueprintsResourceWithRawResponse(self) @cached_property def with_streaming_response(self) -> BlueprintsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ return BlueprintsResourceWithStreamingResponse(self) def create( @@ -284,10 +295,21 @@ def preview( class AsyncBlueprintsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncBlueprintsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ return AsyncBlueprintsResourceWithRawResponse(self) @cached_property def with_streaming_response(self) -> AsyncBlueprintsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ return AsyncBlueprintsResourceWithStreamingResponse(self) async def create( diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 59198714c..f5e8c011a 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -68,10 +68,21 @@ def executions(self) -> ExecutionsResource: @cached_property def with_raw_response(self) -> DevboxesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ return DevboxesResourceWithRawResponse(self) @cached_property def with_streaming_response(self) -> DevboxesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ return DevboxesResourceWithStreamingResponse(self) def create( @@ -548,10 +559,21 @@ def executions(self) -> AsyncExecutionsResource: @cached_property def with_raw_response(self) -> AsyncDevboxesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ return AsyncDevboxesResourceWithRawResponse(self) @cached_property def with_streaming_response(self) -> AsyncDevboxesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ return AsyncDevboxesResourceWithStreamingResponse(self) async def create( diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index 79f70af89..c0dcf3dec 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -28,10 +28,21 @@ class ExecutionsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ExecutionsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ return ExecutionsResourceWithRawResponse(self) @cached_property def with_streaming_response(self) -> ExecutionsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ return ExecutionsResourceWithStreamingResponse(self) def retrieve( @@ -209,10 +220,21 @@ def kill( class AsyncExecutionsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncExecutionsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ return AsyncExecutionsResourceWithRawResponse(self) @cached_property def with_streaming_response(self) -> AsyncExecutionsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ return AsyncExecutionsResourceWithStreamingResponse(self) async def retrieve( diff --git a/src/runloop_api_client/resources/devboxes/logs.py b/src/runloop_api_client/resources/devboxes/logs.py index 1b96611d7..ce320d7bb 100644 --- a/src/runloop_api_client/resources/devboxes/logs.py +++ b/src/runloop_api_client/resources/devboxes/logs.py @@ -27,10 +27,21 @@ class LogsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> LogsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ return LogsResourceWithRawResponse(self) @cached_property def with_streaming_response(self) -> LogsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ return LogsResourceWithStreamingResponse(self) def list( @@ -86,10 +97,21 @@ def list( class AsyncLogsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncLogsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ return AsyncLogsResourceWithRawResponse(self) @cached_property def with_streaming_response(self) -> AsyncLogsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ return AsyncLogsResourceWithStreamingResponse(self) async def list( diff --git a/src/runloop_api_client/resources/functions/functions.py b/src/runloop_api_client/resources/functions/functions.py index 006a23817..5c771a8c9 100644 --- a/src/runloop_api_client/resources/functions/functions.py +++ b/src/runloop_api_client/resources/functions/functions.py @@ -40,10 +40,21 @@ def invocations(self) -> InvocationsResource: @cached_property def with_raw_response(self) -> FunctionsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ return FunctionsResourceWithRawResponse(self) @cached_property def with_streaming_response(self) -> FunctionsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ return FunctionsResourceWithStreamingResponse(self) def list( @@ -172,10 +183,21 @@ def invocations(self) -> AsyncInvocationsResource: @cached_property def with_raw_response(self) -> AsyncFunctionsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ return AsyncFunctionsResourceWithRawResponse(self) @cached_property def with_streaming_response(self) -> AsyncFunctionsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ return AsyncFunctionsResourceWithStreamingResponse(self) async def list( diff --git a/src/runloop_api_client/resources/functions/invocations.py b/src/runloop_api_client/resources/functions/invocations.py index 59491d1e7..d9a72c12e 100644 --- a/src/runloop_api_client/resources/functions/invocations.py +++ b/src/runloop_api_client/resources/functions/invocations.py @@ -28,10 +28,21 @@ class InvocationsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> InvocationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ return InvocationsResourceWithRawResponse(self) @cached_property def with_streaming_response(self) -> InvocationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ return InvocationsResourceWithStreamingResponse(self) def retrieve( @@ -153,10 +164,21 @@ def kill( class AsyncInvocationsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncInvocationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ return AsyncInvocationsResourceWithRawResponse(self) @cached_property def with_streaming_response(self) -> AsyncInvocationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ return AsyncInvocationsResourceWithStreamingResponse(self) async def retrieve( diff --git a/src/runloop_api_client/resources/projects/logs.py b/src/runloop_api_client/resources/projects/logs.py index e7f7269f0..8925b3025 100644 --- a/src/runloop_api_client/resources/projects/logs.py +++ b/src/runloop_api_client/resources/projects/logs.py @@ -22,10 +22,21 @@ class LogsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> LogsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ return LogsResourceWithRawResponse(self) @cached_property def with_streaming_response(self) -> LogsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ return LogsResourceWithStreamingResponse(self) def list( @@ -65,10 +76,21 @@ def list( class AsyncLogsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncLogsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ return AsyncLogsResourceWithRawResponse(self) @cached_property def with_streaming_response(self) -> AsyncLogsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ return AsyncLogsResourceWithStreamingResponse(self) async def list( diff --git a/src/runloop_api_client/resources/projects/projects.py b/src/runloop_api_client/resources/projects/projects.py index 5ec9208c0..259b2c10a 100644 --- a/src/runloop_api_client/resources/projects/projects.py +++ b/src/runloop_api_client/resources/projects/projects.py @@ -34,10 +34,21 @@ def logs(self) -> LogsResource: @cached_property def with_raw_response(self) -> ProjectsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ return ProjectsResourceWithRawResponse(self) @cached_property def with_streaming_response(self) -> ProjectsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ return ProjectsResourceWithStreamingResponse(self) def list( @@ -71,10 +82,21 @@ def logs(self) -> AsyncLogsResource: @cached_property def with_raw_response(self) -> AsyncProjectsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ return AsyncProjectsResourceWithRawResponse(self) @cached_property def with_streaming_response(self) -> AsyncProjectsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ return AsyncProjectsResourceWithStreamingResponse(self) async def list( From 2a0be95e7abd27aee6591e9c094d70c917d0b494 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 17:18:39 +0000 Subject: [PATCH 144/993] docs(readme): add section on determining installed version (#159) --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 8dc4c7e51..d35b91ed0 100644 --- a/README.md +++ b/README.md @@ -301,6 +301,17 @@ We take backwards-compatibility seriously and work hard to ensure you can rely o We are keen for your feedback; please open an [issue](https://www.github.com/runloopai/api-client-python/issues) with questions, bugs, or suggestions. +### Determining the installed version + +If you've upgraded to the latest version but aren't seeing any new features you were expecting then your python environment is likely still using an older version. + +You can determine the version that is being used at runtime with: + +```py +import runloop_api_client +print(runloop_api_client.__version__) +``` + ## Requirements Python 3.7 or higher. From 389bf58275a412f33a2d3d41780ec174690825e6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 22:17:58 +0000 Subject: [PATCH 145/993] feat(api): OpenAPI spec update via Stainless API (#160) --- .stats.yml | 2 +- src/runloop_api_client/types/resource_size.py | 2 +- tests/api_resources/test_blueprints.py | 8 ++++---- tests/api_resources/test_devboxes.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9c4e70db4..d8acff392 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c77dce4134ebb2ea5a0cda4f7328b33caf19cb1a518d78f41187bc6adb727951.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6a2957eefc52bc72e8f14bc3d6c6e3f6754c29f4c8189af201d19d2819e80b1a.yml diff --git a/src/runloop_api_client/types/resource_size.py b/src/runloop_api_client/types/resource_size.py index 3ae6370c1..956955c87 100644 --- a/src/runloop_api_client/types/resource_size.py +++ b/src/runloop_api_client/types/resource_size.py @@ -4,4 +4,4 @@ __all__ = ["ResourceSize"] -ResourceSize: TypeAlias = Literal["MINI", "SMALL", "MEDIUM", "LARGE", "X_LARGE"] +ResourceSize: TypeAlias = Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "CUSTOM_SIZE"] diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 84ccb1d9c..7aad480ed 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -55,7 +55,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: launch_parameters={ "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], - "resource_size_request": "MINI", + "resource_size_request": "SMALL", }, name="name", system_setup_commands=["string", "string", "string"], @@ -225,7 +225,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: launch_parameters={ "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], - "resource_size_request": "MINI", + "resource_size_request": "SMALL", }, name="name", system_setup_commands=["string", "string", "string"], @@ -289,7 +289,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - launch_parameters={ "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], - "resource_size_request": "MINI", + "resource_size_request": "SMALL", }, name="name", system_setup_commands=["string", "string", "string"], @@ -459,7 +459,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) launch_parameters={ "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], - "resource_size_request": "MINI", + "resource_size_request": "SMALL", }, name="name", system_setup_commands=["string", "string", "string"], diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 2c6b20e5c..e5281994f 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -59,7 +59,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: launch_parameters={ "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], - "resource_size_request": "MINI", + "resource_size_request": "SMALL", }, metadata={"foo": "string"}, name="name", @@ -509,7 +509,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - launch_parameters={ "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], - "resource_size_request": "MINI", + "resource_size_request": "SMALL", }, metadata={"foo": "string"}, name="name", From 43ba482d7323002c8616e2f2da3f26fbad1e351b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 19:17:28 +0000 Subject: [PATCH 146/993] feat(api): OpenAPI spec update via Stainless API (#161) --- .stats.yml | 2 +- src/runloop_api_client/types/resource_size.py | 2 +- tests/api_resources/test_blueprints.py | 8 ++++---- tests/api_resources/test_devboxes.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index d8acff392..9c4e70db4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6a2957eefc52bc72e8f14bc3d6c6e3f6754c29f4c8189af201d19d2819e80b1a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c77dce4134ebb2ea5a0cda4f7328b33caf19cb1a518d78f41187bc6adb727951.yml diff --git a/src/runloop_api_client/types/resource_size.py b/src/runloop_api_client/types/resource_size.py index 956955c87..3ae6370c1 100644 --- a/src/runloop_api_client/types/resource_size.py +++ b/src/runloop_api_client/types/resource_size.py @@ -4,4 +4,4 @@ __all__ = ["ResourceSize"] -ResourceSize: TypeAlias = Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "CUSTOM_SIZE"] +ResourceSize: TypeAlias = Literal["MINI", "SMALL", "MEDIUM", "LARGE", "X_LARGE"] diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 7aad480ed..84ccb1d9c 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -55,7 +55,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: launch_parameters={ "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], - "resource_size_request": "SMALL", + "resource_size_request": "MINI", }, name="name", system_setup_commands=["string", "string", "string"], @@ -225,7 +225,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: launch_parameters={ "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], - "resource_size_request": "SMALL", + "resource_size_request": "MINI", }, name="name", system_setup_commands=["string", "string", "string"], @@ -289,7 +289,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - launch_parameters={ "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], - "resource_size_request": "SMALL", + "resource_size_request": "MINI", }, name="name", system_setup_commands=["string", "string", "string"], @@ -459,7 +459,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) launch_parameters={ "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], - "resource_size_request": "SMALL", + "resource_size_request": "MINI", }, name="name", system_setup_commands=["string", "string", "string"], diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index e5281994f..2c6b20e5c 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -59,7 +59,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: launch_parameters={ "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], - "resource_size_request": "SMALL", + "resource_size_request": "MINI", }, metadata={"foo": "string"}, name="name", @@ -509,7 +509,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - launch_parameters={ "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], - "resource_size_request": "SMALL", + "resource_size_request": "MINI", }, metadata={"foo": "string"}, name="name", From 7031aa48726d4f55e505d78da9195112b95c0952 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 22:17:19 +0000 Subject: [PATCH 147/993] feat(api): OpenAPI spec update via Stainless API (#162) --- .stats.yml | 2 +- src/runloop_api_client/types/resource_size.py | 2 +- tests/api_resources/test_blueprints.py | 8 ++++---- tests/api_resources/test_devboxes.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9c4e70db4..d8acff392 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c77dce4134ebb2ea5a0cda4f7328b33caf19cb1a518d78f41187bc6adb727951.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6a2957eefc52bc72e8f14bc3d6c6e3f6754c29f4c8189af201d19d2819e80b1a.yml diff --git a/src/runloop_api_client/types/resource_size.py b/src/runloop_api_client/types/resource_size.py index 3ae6370c1..956955c87 100644 --- a/src/runloop_api_client/types/resource_size.py +++ b/src/runloop_api_client/types/resource_size.py @@ -4,4 +4,4 @@ __all__ = ["ResourceSize"] -ResourceSize: TypeAlias = Literal["MINI", "SMALL", "MEDIUM", "LARGE", "X_LARGE"] +ResourceSize: TypeAlias = Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "CUSTOM_SIZE"] diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 84ccb1d9c..7aad480ed 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -55,7 +55,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: launch_parameters={ "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], - "resource_size_request": "MINI", + "resource_size_request": "SMALL", }, name="name", system_setup_commands=["string", "string", "string"], @@ -225,7 +225,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: launch_parameters={ "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], - "resource_size_request": "MINI", + "resource_size_request": "SMALL", }, name="name", system_setup_commands=["string", "string", "string"], @@ -289,7 +289,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - launch_parameters={ "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], - "resource_size_request": "MINI", + "resource_size_request": "SMALL", }, name="name", system_setup_commands=["string", "string", "string"], @@ -459,7 +459,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) launch_parameters={ "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], - "resource_size_request": "MINI", + "resource_size_request": "SMALL", }, name="name", system_setup_commands=["string", "string", "string"], diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 2c6b20e5c..e5281994f 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -59,7 +59,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: launch_parameters={ "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], - "resource_size_request": "MINI", + "resource_size_request": "SMALL", }, metadata={"foo": "string"}, name="name", @@ -509,7 +509,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - launch_parameters={ "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], - "resource_size_request": "MINI", + "resource_size_request": "SMALL", }, metadata={"foo": "string"}, name="name", From d96b4236bf316d70787c697d8382830c82f4c015 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2024 23:17:25 +0000 Subject: [PATCH 148/993] feat(api): OpenAPI spec update via Stainless API (#163) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 8 ++++++++ src/runloop_api_client/types/devbox_create_params.py | 3 +++ tests/api_resources/test_devboxes.py | 2 ++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d8acff392..e1c2ec452 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6a2957eefc52bc72e8f14bc3d6c6e3f6754c29f4c8189af201d19d2819e80b1a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ecc02bc506fbcc56d59da2e33fbf6024ea1dd93c37ad058cb597afe38da36098.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index f5e8c011a..f9d0c281c 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -97,6 +97,7 @@ def create( launch_parameters: devbox_create_params.LaunchParameters | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, + prebuilt_handle: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -133,6 +134,8 @@ def create( name: (Optional) A user specified name to give the Devbox. + prebuilt_handle: Handle to prebuilt. + setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include fetching a tool or building your dependencies. Runloop will look optimize these steps for you. @@ -158,6 +161,7 @@ def create( "launch_parameters": launch_parameters, "metadata": metadata, "name": name, + "prebuilt_handle": prebuilt_handle, "setup_commands": setup_commands, }, devbox_create_params.DevboxCreateParams, @@ -588,6 +592,7 @@ async def create( launch_parameters: devbox_create_params.LaunchParameters | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, + prebuilt_handle: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -624,6 +629,8 @@ async def create( name: (Optional) A user specified name to give the Devbox. + prebuilt_handle: Handle to prebuilt. + setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include fetching a tool or building your dependencies. Runloop will look optimize these steps for you. @@ -649,6 +656,7 @@ async def create( "launch_parameters": launch_parameters, "metadata": metadata, "name": name, + "prebuilt_handle": prebuilt_handle, "setup_commands": setup_commands, }, devbox_create_params.DevboxCreateParams, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 7998fecf7..9f98565a2 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -50,6 +50,9 @@ class DevboxCreateParams(TypedDict, total=False): name: str """(Optional) A user specified name to give the Devbox.""" + prebuilt_handle: str + """Handle to prebuilt.""" + setup_commands: List[str] """(Optional) List of commands needed to set up your Devbox. diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index e5281994f..06d3a1e6a 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -63,6 +63,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: }, metadata={"foo": "string"}, name="name", + prebuilt_handle="prebuilt_handle", setup_commands=["string", "string", "string"], ) assert_matches_type(DevboxView, devbox, path=["response"]) @@ -513,6 +514,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - }, metadata={"foo": "string"}, name="name", + prebuilt_handle="prebuilt_handle", setup_commands=["string", "string", "string"], ) assert_matches_type(DevboxView, devbox, path=["response"]) From 4c002c30fcf6369dbb3f23d7d7cd0c7ee99793c8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2024 23:20:16 +0000 Subject: [PATCH 149/993] docs: update CONTRIBUTING.md (#164) --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c08e11c0e..d1ab4cc9b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,13 +31,13 @@ $ pip install -r requirements-dev.lock ## Modifying/Adding code -Most of the SDK is generated code, and any modified code will be overridden on the next generation. The -`src/runloop_api_client/lib/` and `examples/` directories are exceptions and will never be overridden. +Most of the SDK is generated code. Modifications to code will be persisted between generations, but may +result in merge conflicts between manual patches and changes from the generator. The generator will never +modify the contents of the `src/runloop_api_client/lib/` and `examples/` directories. ## Adding and running examples -All files in the `examples/` directory are not modified by the Stainless generator and can be freely edited or -added to. +All files in the `examples/` directory are not modified by the generator and can be freely edited or added to. ```bash # add an example to examples/.py From 5b836f3188be571fec37b0ffd45c5714d4f09629 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2024 23:21:25 +0000 Subject: [PATCH 150/993] chore(internal): bump ruff (#165) --- requirements-dev.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index 1a8bffd1f..117b79e76 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -80,7 +80,7 @@ pytz==2023.3.post1 # via dirty-equals respx==0.20.2 rich==13.7.1 -ruff==0.5.6 +ruff==0.6.5 setuptools==68.2.2 # via nodeenv six==1.16.0 From 728d82b2009d23781e5a54a90ddffbf9a4a17d0d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2024 23:21:49 +0000 Subject: [PATCH 151/993] chore(internal): bump pyright / mypy version (#166) --- requirements-dev.lock | 4 ++-- src/runloop_api_client/_utils/_utils.py | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index 117b79e76..178e0420f 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -49,7 +49,7 @@ markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py -mypy==1.10.1 +mypy==1.11.2 mypy-extensions==1.0.0 # via mypy nodeenv==1.8.0 @@ -70,7 +70,7 @@ pydantic-core==2.18.2 # via pydantic pygments==2.18.0 # via rich -pyright==1.1.374 +pyright==1.1.380 pytest==7.1.1 # via pytest-asyncio pytest-asyncio==0.21.1 diff --git a/src/runloop_api_client/_utils/_utils.py b/src/runloop_api_client/_utils/_utils.py index 2fc5a1c65..0bba17caa 100644 --- a/src/runloop_api_client/_utils/_utils.py +++ b/src/runloop_api_client/_utils/_utils.py @@ -363,12 +363,13 @@ def file_from_path(path: str) -> FileTypes: def get_required_header(headers: HeadersLike, header: str) -> str: lower_header = header.lower() - if isinstance(headers, Mapping): - for k, v in headers.items(): + if is_mapping_t(headers): + # mypy doesn't understand the type narrowing here + for k, v in headers.items(): # type: ignore if k.lower() == lower_header and isinstance(v, str): return v - """ to deal with the case where the header looks like Stainless-Event-Id """ + # to deal with the case where the header looks like Stainless-Event-Id intercaps_header = re.sub(r"([^\w])(\w)", lambda pat: pat.group(1) + pat.group(2).upper(), header.capitalize()) for normalized_header in [header, lower_header, header.upper(), intercaps_header]: From 8108aac478dd9317b5b83963aed736aa4bcf6e63 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 17:17:26 +0000 Subject: [PATCH 152/993] feat(api): OpenAPI spec update via Stainless API (#167) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 8 -------- src/runloop_api_client/types/devbox_create_params.py | 3 --- tests/api_resources/test_devboxes.py | 2 -- 4 files changed, 1 insertion(+), 14 deletions(-) diff --git a/.stats.yml b/.stats.yml index e1c2ec452..d8acff392 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ecc02bc506fbcc56d59da2e33fbf6024ea1dd93c37ad058cb597afe38da36098.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6a2957eefc52bc72e8f14bc3d6c6e3f6754c29f4c8189af201d19d2819e80b1a.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index f9d0c281c..f5e8c011a 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -97,7 +97,6 @@ def create( launch_parameters: devbox_create_params.LaunchParameters | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, - prebuilt_handle: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -134,8 +133,6 @@ def create( name: (Optional) A user specified name to give the Devbox. - prebuilt_handle: Handle to prebuilt. - setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include fetching a tool or building your dependencies. Runloop will look optimize these steps for you. @@ -161,7 +158,6 @@ def create( "launch_parameters": launch_parameters, "metadata": metadata, "name": name, - "prebuilt_handle": prebuilt_handle, "setup_commands": setup_commands, }, devbox_create_params.DevboxCreateParams, @@ -592,7 +588,6 @@ async def create( launch_parameters: devbox_create_params.LaunchParameters | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, - prebuilt_handle: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -629,8 +624,6 @@ async def create( name: (Optional) A user specified name to give the Devbox. - prebuilt_handle: Handle to prebuilt. - setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include fetching a tool or building your dependencies. Runloop will look optimize these steps for you. @@ -656,7 +649,6 @@ async def create( "launch_parameters": launch_parameters, "metadata": metadata, "name": name, - "prebuilt_handle": prebuilt_handle, "setup_commands": setup_commands, }, devbox_create_params.DevboxCreateParams, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 9f98565a2..7998fecf7 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -50,9 +50,6 @@ class DevboxCreateParams(TypedDict, total=False): name: str """(Optional) A user specified name to give the Devbox.""" - prebuilt_handle: str - """Handle to prebuilt.""" - setup_commands: List[str] """(Optional) List of commands needed to set up your Devbox. diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 06d3a1e6a..e5281994f 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -63,7 +63,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: }, metadata={"foo": "string"}, name="name", - prebuilt_handle="prebuilt_handle", setup_commands=["string", "string", "string"], ) assert_matches_type(DevboxView, devbox, path=["response"]) @@ -514,7 +513,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - }, metadata={"foo": "string"}, name="name", - prebuilt_handle="prebuilt_handle", setup_commands=["string", "string", "string"], ) assert_matches_type(DevboxView, devbox, path=["response"]) From d4a986f037a57dd39f5687c21c6fc0af27ab2647 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 19:18:02 +0000 Subject: [PATCH 153/993] feat(api): OpenAPI spec update via Stainless API (#168) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 8 ++++++++ src/runloop_api_client/types/devbox_create_params.py | 3 +++ tests/api_resources/test_devboxes.py | 2 ++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d8acff392..47702e821 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6a2957eefc52bc72e8f14bc3d6c6e3f6754c29f4c8189af201d19d2819e80b1a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-656ad8ac46b9a461b793c2f52f047a40bcdb78d7ce3ecf779ef028cf2ff51079.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index f5e8c011a..c525494d9 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -97,6 +97,7 @@ def create( launch_parameters: devbox_create_params.LaunchParameters | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, + prebuilt: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -133,6 +134,8 @@ def create( name: (Optional) A user specified name to give the Devbox. + prebuilt: Handle to prebuilt. + setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include fetching a tool or building your dependencies. Runloop will look optimize these steps for you. @@ -158,6 +161,7 @@ def create( "launch_parameters": launch_parameters, "metadata": metadata, "name": name, + "prebuilt": prebuilt, "setup_commands": setup_commands, }, devbox_create_params.DevboxCreateParams, @@ -588,6 +592,7 @@ async def create( launch_parameters: devbox_create_params.LaunchParameters | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, + prebuilt: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -624,6 +629,8 @@ async def create( name: (Optional) A user specified name to give the Devbox. + prebuilt: Handle to prebuilt. + setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include fetching a tool or building your dependencies. Runloop will look optimize these steps for you. @@ -649,6 +656,7 @@ async def create( "launch_parameters": launch_parameters, "metadata": metadata, "name": name, + "prebuilt": prebuilt, "setup_commands": setup_commands, }, devbox_create_params.DevboxCreateParams, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 7998fecf7..d9df2bd96 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -50,6 +50,9 @@ class DevboxCreateParams(TypedDict, total=False): name: str """(Optional) A user specified name to give the Devbox.""" + prebuilt: str + """Handle to prebuilt.""" + setup_commands: List[str] """(Optional) List of commands needed to set up your Devbox. diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index e5281994f..91fb3adbf 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -63,6 +63,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: }, metadata={"foo": "string"}, name="name", + prebuilt="prebuilt", setup_commands=["string", "string", "string"], ) assert_matches_type(DevboxView, devbox, path=["response"]) @@ -513,6 +514,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - }, metadata={"foo": "string"}, name="name", + prebuilt="prebuilt", setup_commands=["string", "string", "string"], ) assert_matches_type(DevboxView, devbox, path=["response"]) From 7443f0c94e324418f0e90826ea332b4f66daed7e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 19:19:18 +0000 Subject: [PATCH 154/993] fix(client): handle domains with underscores (#169) --- src/runloop_api_client/_base_client.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index dabdd0790..8836eaf3f 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -489,12 +489,17 @@ def _build_request( if not files: files = cast(HttpxRequestFiles, ForceMultipartDict()) + prepared_url = self._prepare_url(options.url) + if "_" in prepared_url.host: + # work around https://github.com/encode/httpx/discussions/2880 + kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")} + # TODO: report this error to httpx return self._client.build_request( # pyright: ignore[reportUnknownMemberType] headers=headers, timeout=self.timeout if isinstance(options.timeout, NotGiven) else options.timeout, method=options.method, - url=self._prepare_url(options.url), + url=prepared_url, # the `Query` type that we use is incompatible with qs' # `Params` type as it needs to be typed as `Mapping[str, object]` # so that passing a `TypedDict` doesn't cause an error. From a11670b815d52e207546c91a3c63edf2bd42db79 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Sep 2024 19:19:58 +0000 Subject: [PATCH 155/993] feat(client): send retry count header (#170) --- src/runloop_api_client/_base_client.py | 101 +++++++++++++------------ tests/test_client.py | 2 + 2 files changed, 56 insertions(+), 47 deletions(-) diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index 8836eaf3f..f12eb5ae3 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -400,14 +400,7 @@ def _make_status_error( ) -> _exceptions.APIStatusError: raise NotImplementedError() - def _remaining_retries( - self, - remaining_retries: Optional[int], - options: FinalRequestOptions, - ) -> int: - return remaining_retries if remaining_retries is not None else options.get_max_retries(self.max_retries) - - def _build_headers(self, options: FinalRequestOptions) -> httpx.Headers: + def _build_headers(self, options: FinalRequestOptions, *, retries_taken: int = 0) -> httpx.Headers: custom_headers = options.headers or {} headers_dict = _merge_mappings(self.default_headers, custom_headers) self._validate_headers(headers_dict, custom_headers) @@ -419,6 +412,8 @@ def _build_headers(self, options: FinalRequestOptions) -> httpx.Headers: if idempotency_header and options.method.lower() != "get" and idempotency_header not in headers: headers[idempotency_header] = options.idempotency_key or self._idempotency_key() + headers.setdefault("x-stainless-retry-count", str(retries_taken)) + return headers def _prepare_url(self, url: str) -> URL: @@ -440,6 +435,8 @@ def _make_sse_decoder(self) -> SSEDecoder | SSEBytesDecoder: def _build_request( self, options: FinalRequestOptions, + *, + retries_taken: int = 0, ) -> httpx.Request: if log.isEnabledFor(logging.DEBUG): log.debug("Request options: %s", model_dump(options, exclude_unset=True)) @@ -455,7 +452,7 @@ def _build_request( else: raise RuntimeError(f"Unexpected JSON data type, {type(json_data)}, cannot merge with `extra_body`") - headers = self._build_headers(options) + headers = self._build_headers(options, retries_taken=retries_taken) params = _merge_mappings(self.default_query, options.params) content_type = headers.get("Content-Type") files = options.files @@ -938,12 +935,17 @@ def request( stream: bool = False, stream_cls: type[_StreamT] | None = None, ) -> ResponseT | _StreamT: + if remaining_retries is not None: + retries_taken = options.get_max_retries(self.max_retries) - remaining_retries + else: + retries_taken = 0 + return self._request( cast_to=cast_to, options=options, stream=stream, stream_cls=stream_cls, - remaining_retries=remaining_retries, + retries_taken=retries_taken, ) def _request( @@ -951,7 +953,7 @@ def _request( *, cast_to: Type[ResponseT], options: FinalRequestOptions, - remaining_retries: int | None, + retries_taken: int, stream: bool, stream_cls: type[_StreamT] | None, ) -> ResponseT | _StreamT: @@ -963,8 +965,8 @@ def _request( cast_to = self._maybe_override_cast_to(cast_to, options) options = self._prepare_options(options) - retries = self._remaining_retries(remaining_retries, options) - request = self._build_request(options) + remaining_retries = options.get_max_retries(self.max_retries) - retries_taken + request = self._build_request(options, retries_taken=retries_taken) self._prepare_request(request) kwargs: HttpxSendArgs = {} @@ -982,11 +984,11 @@ def _request( except httpx.TimeoutException as err: log.debug("Encountered httpx.TimeoutException", exc_info=True) - if retries > 0: + if remaining_retries > 0: return self._retry_request( input_options, cast_to, - retries, + retries_taken=retries_taken, stream=stream, stream_cls=stream_cls, response_headers=None, @@ -997,11 +999,11 @@ def _request( except Exception as err: log.debug("Encountered Exception", exc_info=True) - if retries > 0: + if remaining_retries > 0: return self._retry_request( input_options, cast_to, - retries, + retries_taken=retries_taken, stream=stream, stream_cls=stream_cls, response_headers=None, @@ -1024,13 +1026,13 @@ def _request( except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code log.debug("Encountered httpx.HTTPStatusError", exc_info=True) - if retries > 0 and self._should_retry(err.response): + if remaining_retries > 0 and self._should_retry(err.response): err.response.close() return self._retry_request( input_options, cast_to, - retries, - err.response.headers, + retries_taken=retries_taken, + response_headers=err.response.headers, stream=stream, stream_cls=stream_cls, ) @@ -1049,26 +1051,26 @@ def _request( response=response, stream=stream, stream_cls=stream_cls, - retries_taken=options.get_max_retries(self.max_retries) - retries, + retries_taken=retries_taken, ) def _retry_request( self, options: FinalRequestOptions, cast_to: Type[ResponseT], - remaining_retries: int, - response_headers: httpx.Headers | None, *, + retries_taken: int, + response_headers: httpx.Headers | None, stream: bool, stream_cls: type[_StreamT] | None, ) -> ResponseT | _StreamT: - remaining = remaining_retries - 1 - if remaining == 1: + remaining_retries = options.get_max_retries(self.max_retries) - retries_taken + if remaining_retries == 1: log.debug("1 retry left") else: - log.debug("%i retries left", remaining) + log.debug("%i retries left", remaining_retries) - timeout = self._calculate_retry_timeout(remaining, options, response_headers) + timeout = self._calculate_retry_timeout(remaining_retries, options, response_headers) log.info("Retrying request to %s in %f seconds", options.url, timeout) # In a synchronous context we are blocking the entire thread. Up to the library user to run the client in a @@ -1078,7 +1080,7 @@ def _retry_request( return self._request( options=options, cast_to=cast_to, - remaining_retries=remaining, + retries_taken=retries_taken + 1, stream=stream, stream_cls=stream_cls, ) @@ -1496,12 +1498,17 @@ async def request( stream_cls: type[_AsyncStreamT] | None = None, remaining_retries: Optional[int] = None, ) -> ResponseT | _AsyncStreamT: + if remaining_retries is not None: + retries_taken = options.get_max_retries(self.max_retries) - remaining_retries + else: + retries_taken = 0 + return await self._request( cast_to=cast_to, options=options, stream=stream, stream_cls=stream_cls, - remaining_retries=remaining_retries, + retries_taken=retries_taken, ) async def _request( @@ -1511,7 +1518,7 @@ async def _request( *, stream: bool, stream_cls: type[_AsyncStreamT] | None, - remaining_retries: int | None, + retries_taken: int, ) -> ResponseT | _AsyncStreamT: if self._platform is None: # `get_platform` can make blocking IO calls so we @@ -1526,8 +1533,8 @@ async def _request( cast_to = self._maybe_override_cast_to(cast_to, options) options = await self._prepare_options(options) - retries = self._remaining_retries(remaining_retries, options) - request = self._build_request(options) + remaining_retries = options.get_max_retries(self.max_retries) - retries_taken + request = self._build_request(options, retries_taken=retries_taken) await self._prepare_request(request) kwargs: HttpxSendArgs = {} @@ -1543,11 +1550,11 @@ async def _request( except httpx.TimeoutException as err: log.debug("Encountered httpx.TimeoutException", exc_info=True) - if retries > 0: + if remaining_retries > 0: return await self._retry_request( input_options, cast_to, - retries, + retries_taken=retries_taken, stream=stream, stream_cls=stream_cls, response_headers=None, @@ -1558,11 +1565,11 @@ async def _request( except Exception as err: log.debug("Encountered Exception", exc_info=True) - if retries > 0: + if retries_taken > 0: return await self._retry_request( input_options, cast_to, - retries, + retries_taken=retries_taken, stream=stream, stream_cls=stream_cls, response_headers=None, @@ -1580,13 +1587,13 @@ async def _request( except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code log.debug("Encountered httpx.HTTPStatusError", exc_info=True) - if retries > 0 and self._should_retry(err.response): + if remaining_retries > 0 and self._should_retry(err.response): await err.response.aclose() return await self._retry_request( input_options, cast_to, - retries, - err.response.headers, + retries_taken=retries_taken, + response_headers=err.response.headers, stream=stream, stream_cls=stream_cls, ) @@ -1605,26 +1612,26 @@ async def _request( response=response, stream=stream, stream_cls=stream_cls, - retries_taken=options.get_max_retries(self.max_retries) - retries, + retries_taken=retries_taken, ) async def _retry_request( self, options: FinalRequestOptions, cast_to: Type[ResponseT], - remaining_retries: int, - response_headers: httpx.Headers | None, *, + retries_taken: int, + response_headers: httpx.Headers | None, stream: bool, stream_cls: type[_AsyncStreamT] | None, ) -> ResponseT | _AsyncStreamT: - remaining = remaining_retries - 1 - if remaining == 1: + remaining_retries = options.get_max_retries(self.max_retries) - retries_taken + if remaining_retries == 1: log.debug("1 retry left") else: - log.debug("%i retries left", remaining) + log.debug("%i retries left", remaining_retries) - timeout = self._calculate_retry_timeout(remaining, options, response_headers) + timeout = self._calculate_retry_timeout(remaining_retries, options, response_headers) log.info("Retrying request to %s in %f seconds", options.url, timeout) await anyio.sleep(timeout) @@ -1632,7 +1639,7 @@ async def _retry_request( return await self._request( options=options, cast_to=cast_to, - remaining_retries=remaining, + retries_taken=retries_taken + 1, stream=stream, stream_cls=stream_cls, ) diff --git a/tests/test_client.py b/tests/test_client.py index ab10be034..530fcdabf 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -781,6 +781,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: response = client.devboxes.with_raw_response.create() assert response.retries_taken == failures_before_success + assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success class TestAsyncRunloop: @@ -1521,3 +1522,4 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: response = await client.devboxes.with_raw_response.create() assert response.retries_taken == failures_before_success + assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success From d2e7c38f6c66e34e8f76bf98fb8c042678f9440e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Sep 2024 00:17:45 +0000 Subject: [PATCH 156/993] feat(api): OpenAPI spec update via Stainless API (#171) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 4 ++-- src/runloop_api_client/types/devbox_create_params.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 47702e821..87100f8b2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-656ad8ac46b9a461b793c2f52f047a40bcdb78d7ce3ecf779ef028cf2ff51079.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b3591c2e7b147a5cea5bdfa2e31bdc3647d3a4c66e922c146e7cf6181fbdde72.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index c525494d9..7baafe31a 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -134,7 +134,7 @@ def create( name: (Optional) A user specified name to give the Devbox. - prebuilt: Handle to prebuilt. + prebuilt: Reference to prebuilt Blueprint. setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include fetching a tool or building your dependencies. Runloop will look optimize these @@ -629,7 +629,7 @@ async def create( name: (Optional) A user specified name to give the Devbox. - prebuilt: Handle to prebuilt. + prebuilt: Reference to prebuilt Blueprint. setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include fetching a tool or building your dependencies. Runloop will look optimize these diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index d9df2bd96..ebea10fe1 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -51,7 +51,7 @@ class DevboxCreateParams(TypedDict, total=False): """(Optional) A user specified name to give the Devbox.""" prebuilt: str - """Handle to prebuilt.""" + """Reference to prebuilt Blueprint.""" setup_commands: List[str] """(Optional) List of commands needed to set up your Devbox. From 84e4fd1512b195f3ebc335862c163ed4eafec1be Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 1 Oct 2024 17:31:04 +0000 Subject: [PATCH 157/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 87100f8b2..3858531e0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b3591c2e7b147a5cea5bdfa2e31bdc3647d3a4c66e922c146e7cf6181fbdde72.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c9f371795ad847761daead788be0f418651129ad16ce4ca96085d51704939f13.yml From 35cc2603f82b81e7f4f7721361953ec4a0b2ef65 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 17:31:25 +0000 Subject: [PATCH 158/993] chore(internal): codegen related update (#172) --- src/runloop_api_client/_base_client.py | 5 +- src/runloop_api_client/_compat.py | 2 + tests/test_client.py | 94 ++++++++++++++++++++++++++ 3 files changed, 100 insertions(+), 1 deletion(-) diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index f12eb5ae3..abb01739d 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -412,7 +412,10 @@ def _build_headers(self, options: FinalRequestOptions, *, retries_taken: int = 0 if idempotency_header and options.method.lower() != "get" and idempotency_header not in headers: headers[idempotency_header] = options.idempotency_key or self._idempotency_key() - headers.setdefault("x-stainless-retry-count", str(retries_taken)) + # Don't set the retry count header if it was already set or removed by the caller. We check + # `custom_headers`, which can contain `Omit()`, instead of `headers` to account for the removal case. + if "x-stainless-retry-count" not in (header.lower() for header in custom_headers): + headers["x-stainless-retry-count"] = str(retries_taken) return headers diff --git a/src/runloop_api_client/_compat.py b/src/runloop_api_client/_compat.py index 21fe6941c..162a6fbe4 100644 --- a/src/runloop_api_client/_compat.py +++ b/src/runloop_api_client/_compat.py @@ -136,12 +136,14 @@ def model_dump( exclude: IncEx = None, exclude_unset: bool = False, exclude_defaults: bool = False, + warnings: bool = True, ) -> dict[str, Any]: if PYDANTIC_V2: return model.model_dump( exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, + warnings=warnings, ) return cast( "dict[str, Any]", diff --git a/tests/test_client.py b/tests/test_client.py index 530fcdabf..9a1762d7c 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -783,6 +783,52 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: assert response.retries_taken == failures_before_success assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success + @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) + @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @pytest.mark.respx(base_url=base_url) + def test_omit_retry_count_header( + self, client: Runloop, failures_before_success: int, respx_mock: MockRouter + ) -> None: + client = client.with_options(max_retries=4) + + nb_retries = 0 + + def retry_handler(_request: httpx.Request) -> httpx.Response: + nonlocal nb_retries + if nb_retries < failures_before_success: + nb_retries += 1 + return httpx.Response(500) + return httpx.Response(200) + + respx_mock.post("/v1/devboxes").mock(side_effect=retry_handler) + + response = client.devboxes.with_raw_response.create(extra_headers={"x-stainless-retry-count": Omit()}) + + assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 + + @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) + @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @pytest.mark.respx(base_url=base_url) + def test_overwrite_retry_count_header( + self, client: Runloop, failures_before_success: int, respx_mock: MockRouter + ) -> None: + client = client.with_options(max_retries=4) + + nb_retries = 0 + + def retry_handler(_request: httpx.Request) -> httpx.Response: + nonlocal nb_retries + if nb_retries < failures_before_success: + nb_retries += 1 + return httpx.Response(500) + return httpx.Response(200) + + respx_mock.post("/v1/devboxes").mock(side_effect=retry_handler) + + response = client.devboxes.with_raw_response.create(extra_headers={"x-stainless-retry-count": "42"}) + + assert response.http_request.headers.get("x-stainless-retry-count") == "42" + class TestAsyncRunloop: client = AsyncRunloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) @@ -1523,3 +1569,51 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: assert response.retries_taken == failures_before_success assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success + + @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) + @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @pytest.mark.respx(base_url=base_url) + @pytest.mark.asyncio + async def test_omit_retry_count_header( + self, async_client: AsyncRunloop, failures_before_success: int, respx_mock: MockRouter + ) -> None: + client = async_client.with_options(max_retries=4) + + nb_retries = 0 + + def retry_handler(_request: httpx.Request) -> httpx.Response: + nonlocal nb_retries + if nb_retries < failures_before_success: + nb_retries += 1 + return httpx.Response(500) + return httpx.Response(200) + + respx_mock.post("/v1/devboxes").mock(side_effect=retry_handler) + + response = await client.devboxes.with_raw_response.create(extra_headers={"x-stainless-retry-count": Omit()}) + + assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 + + @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) + @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) + @pytest.mark.respx(base_url=base_url) + @pytest.mark.asyncio + async def test_overwrite_retry_count_header( + self, async_client: AsyncRunloop, failures_before_success: int, respx_mock: MockRouter + ) -> None: + client = async_client.with_options(max_retries=4) + + nb_retries = 0 + + def retry_handler(_request: httpx.Request) -> httpx.Response: + nonlocal nb_retries + if nb_retries < failures_before_success: + nb_retries += 1 + return httpx.Response(500) + return httpx.Response(200) + + respx_mock.post("/v1/devboxes").mock(side_effect=retry_handler) + + response = await client.devboxes.with_raw_response.create(extra_headers={"x-stainless-retry-count": "42"}) + + assert response.http_request.headers.get("x-stainless-retry-count") == "42" From d0698fdaf3738ecbdeddf6ec78be964d405a6694 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 1 Oct 2024 18:17:38 +0000 Subject: [PATCH 159/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 3858531e0..87100f8b2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c9f371795ad847761daead788be0f418651129ad16ce4ca96085d51704939f13.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b3591c2e7b147a5cea5bdfa2e31bdc3647d3a4c66e922c146e7cf6181fbdde72.yml From 54b3c47cdf9b2afef0105655232699d554c53dfe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:30:44 +0000 Subject: [PATCH 160/993] chore(internal): version bump (#173) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index fac140743..7c31fce28 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.20" + ".": "0.1.0-alpha.21" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 650dd2f4f..abfcafdda 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.1.0-alpha.20" +version = "0.1.0-alpha.21" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index da975be7f..e0fb84dd3 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.1.0-alpha.20" # x-release-please-version +__version__ = "0.1.0-alpha.21" # x-release-please-version From b3208a298c882621d9ec1b49d051ba2627d9ab0a Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 1 Oct 2024 18:43:24 +0000 Subject: [PATCH 161/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 87100f8b2..3858531e0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b3591c2e7b147a5cea5bdfa2e31bdc3647d3a4c66e922c146e7cf6181fbdde72.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c9f371795ad847761daead788be0f418651129ad16ce4ca96085d51704939f13.yml From 3c915ca076cf51c3e28c35252da68e5af3f1d611 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 1 Oct 2024 19:17:33 +0000 Subject: [PATCH 162/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 3858531e0..87100f8b2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c9f371795ad847761daead788be0f418651129ad16ce4ca96085d51704939f13.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b3591c2e7b147a5cea5bdfa2e31bdc3647d3a4c66e922c146e7cf6181fbdde72.yml From ca50aa74605576e813282afc9a2444aeb3816102 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 20:28:02 +0000 Subject: [PATCH 163/993] feat(api): OpenAPI spec update via Stainless API (#174) --- .stats.yml | 2 +- CONTRIBUTING.md | 44 ++++---- README.md | 4 + .../resources/blueprints.py | 32 +++--- .../resources/devboxes/devboxes.py | 20 ++-- .../resources/devboxes/executions.py | 8 +- .../types/blueprint_build_log.py | 8 +- .../types/blueprint_build_logs_list_view.py | 6 +- .../types/blueprint_build_parameters.py | 6 +- .../types/blueprint_create_params.py | 8 +- .../types/blueprint_list_view.py | 8 +- .../types/blueprint_preview_params.py | 8 +- .../types/blueprint_preview_view.py | 4 +- .../types/blueprint_view.py | 16 +-- .../types/code_mount_parameters.py | 16 +-- .../types/code_mount_parameters_param.py | 18 +-- .../devbox_async_execution_detail_view.py | 10 +- .../types/devbox_create_ssh_key_response.py | 8 +- .../types/devbox_execute_async_params.py | 4 +- .../types/devbox_execute_sync_params.py | 4 +- .../types/devbox_execution_detail_view.py | 14 +-- .../types/devbox_list_view.py | 8 +- .../types/devbox_read_file_contents_params.py | 4 +- src/runloop_api_client/types/devbox_view.py | 36 +++--- .../types/devbox_write_file_params.py | 6 +- .../types/devboxes/devbox_logs_list_view.py | 20 ++-- .../execution_execute_async_params.py | 4 +- .../devboxes/execution_execute_sync_params.py | 4 +- .../types/project_list_view.py | 14 +-- .../types/shared/project_logs_view.py | 12 +- .../api_resources/devboxes/test_executions.py | 16 +++ tests/api_resources/test_blueprints.py | 104 +++++++++++------- tests/api_resources/test_devboxes.py | 86 ++++++++------- 33 files changed, 308 insertions(+), 254 deletions(-) diff --git a/.stats.yml b/.stats.yml index 87100f8b2..2eef7c03f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b3591c2e7b147a5cea5bdfa2e31bdc3647d3a4c66e922c146e7cf6181fbdde72.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-72d3aa191a9b7af61f359257e03889f6b43923cac4d186e5075aa1a696dd38ff.yml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d1ab4cc9b..fcf955358 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,9 +2,13 @@ ### With Rye -We use [Rye](https://rye.astral.sh/) to manage dependencies so we highly recommend [installing it](https://rye.astral.sh/guide/installation/) as it will automatically provision a Python environment with the expected Python version. +We use [Rye](https://rye.astral.sh/) to manage dependencies because it will automatically provision a Python environment with the expected Python version. To set it up, run: -After installing Rye, you'll just have to run this command: +```sh +$ ./scripts/bootstrap +``` + +Or [install Rye manually](https://rye.astral.sh/guide/installation/) and run: ```sh $ rye sync --all-features @@ -39,17 +43,17 @@ modify the contents of the `src/runloop_api_client/lib/` and `examples/` directo All files in the `examples/` directory are not modified by the generator and can be freely edited or added to. -```bash +```py # add an example to examples/.py #!/usr/bin/env -S rye run python … ``` -``` -chmod +x examples/.py +```sh +$ chmod +x examples/.py # run the example against your api -./examples/.py +$ ./examples/.py ``` ## Using the repository from source @@ -58,8 +62,8 @@ If you’d like to use the repository from source, you can either install from g To install via git: -```bash -pip install git+ssh://git@github.com/runloopai/api-client-python.git +```sh +$ pip install git+ssh://git@github.com/runloopai/api-client-python.git ``` Alternatively, you can build from source and install the wheel file: @@ -68,29 +72,29 @@ Building this package will create two files in the `dist/` directory, a `.tar.gz To create a distributable version of the library, all you have to do is run this command: -```bash -rye build +```sh +$ rye build # or -python -m build +$ python -m build ``` Then to install: ```sh -pip install ./path-to-wheel-file.whl +$ pip install ./path-to-wheel-file.whl ``` ## Running tests Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. -```bash +```sh # you will need npm installed -npx prism mock path/to/your/openapi.yml +$ npx prism mock path/to/your/openapi.yml ``` -```bash -rye run pytest +```sh +$ ./scripts/test ``` ## Linting and formatting @@ -100,14 +104,14 @@ This repository uses [ruff](https://github.com/astral-sh/ruff) and To lint: -```bash -rye run lint +```sh +$ ./scripts/lint ``` To format and fix all ruff issues automatically: -```bash -rye run format +```sh +$ ./scripts/format ``` ## Publishing and releases diff --git a/README.md b/README.md index d35b91ed0..3c8dbdbd0 100644 --- a/README.md +++ b/README.md @@ -315,3 +315,7 @@ print(runloop_api_client.__version__) ## Requirements Python 3.7 or higher. + +## Contributing + +See [the contributing documentation](./CONTRIBUTING.md). diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index cb8e1eee3..65d147225 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -53,11 +53,11 @@ def with_streaming_response(self) -> BlueprintsResourceWithStreamingResponse: def create( self, *, + name: str, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, launch_parameters: blueprint_create_params.LaunchParameters | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -73,6 +73,8 @@ def create( ready. Args: + name: Name of the Blueprint. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -81,8 +83,6 @@ def create( launch_parameters: Parameters to configure your Devbox at launch time. - name: Name of the Blueprint. - system_setup_commands: A list of commands to run to set up your system. extra_headers: Send extra headers @@ -97,11 +97,11 @@ def create( "/v1/blueprints", body=maybe_transform( { + "name": name, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, - "name": name, "system_setup_commands": system_setup_commands, }, blueprint_create_params.BlueprintCreateParams, @@ -233,11 +233,11 @@ def logs( def preview( self, *, + name: str, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, launch_parameters: blueprint_preview_params.LaunchParameters | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -252,6 +252,8 @@ def preview( resulting Dockerfile and test out your build. Args: + name: Name of the Blueprint. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -260,8 +262,6 @@ def preview( launch_parameters: Parameters to configure your Devbox at launch time. - name: Name of the Blueprint. - system_setup_commands: A list of commands to run to set up your system. extra_headers: Send extra headers @@ -276,11 +276,11 @@ def preview( "/v1/blueprints/preview", body=maybe_transform( { + "name": name, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, - "name": name, "system_setup_commands": system_setup_commands, }, blueprint_preview_params.BlueprintPreviewParams, @@ -315,11 +315,11 @@ def with_streaming_response(self) -> AsyncBlueprintsResourceWithStreamingRespons async def create( self, *, + name: str, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, launch_parameters: blueprint_create_params.LaunchParameters | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -335,6 +335,8 @@ async def create( ready. Args: + name: Name of the Blueprint. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -343,8 +345,6 @@ async def create( launch_parameters: Parameters to configure your Devbox at launch time. - name: Name of the Blueprint. - system_setup_commands: A list of commands to run to set up your system. extra_headers: Send extra headers @@ -359,11 +359,11 @@ async def create( "/v1/blueprints", body=await async_maybe_transform( { + "name": name, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, - "name": name, "system_setup_commands": system_setup_commands, }, blueprint_create_params.BlueprintCreateParams, @@ -495,11 +495,11 @@ async def logs( async def preview( self, *, + name: str, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, launch_parameters: blueprint_preview_params.LaunchParameters | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -514,6 +514,8 @@ async def preview( resulting Dockerfile and test out your build. Args: + name: Name of the Blueprint. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -522,8 +524,6 @@ async def preview( launch_parameters: Parameters to configure your Devbox at launch time. - name: Name of the Blueprint. - system_setup_commands: A list of commands to run to set up your system. extra_headers: Send extra headers @@ -538,11 +538,11 @@ async def preview( "/v1/blueprints/preview", body=await async_maybe_transform( { + "name": name, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, - "name": name, "system_setup_commands": system_setup_commands, }, blueprint_preview_params.BlueprintPreviewParams, diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 7baafe31a..756ab6213 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -295,7 +295,7 @@ def execute_async( self, id: str, *, - command: str | NotGiven = NOT_GIVEN, + command: str, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -341,7 +341,7 @@ def execute_sync( self, id: str, *, - command: str | NotGiven = NOT_GIVEN, + command: str, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -387,7 +387,7 @@ def read_file_contents( self, id: str, *, - file_path: str | NotGiven = NOT_GIVEN, + file_path: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -509,8 +509,8 @@ def write_file( self, id: str, *, - contents: str | NotGiven = NOT_GIVEN, - file_path: str | NotGiven = NOT_GIVEN, + contents: str, + file_path: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -790,7 +790,7 @@ async def execute_async( self, id: str, *, - command: str | NotGiven = NOT_GIVEN, + command: str, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -836,7 +836,7 @@ async def execute_sync( self, id: str, *, - command: str | NotGiven = NOT_GIVEN, + command: str, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -882,7 +882,7 @@ async def read_file_contents( self, id: str, *, - file_path: str | NotGiven = NOT_GIVEN, + file_path: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1004,8 +1004,8 @@ async def write_file( self, id: str, *, - contents: str | NotGiven = NOT_GIVEN, - file_path: str | NotGiven = NOT_GIVEN, + contents: str, + file_path: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index c0dcf3dec..c265dcd45 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -92,7 +92,7 @@ def execute_async( self, id: str, *, - command: str | NotGiven = NOT_GIVEN, + command: str, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -138,7 +138,7 @@ def execute_sync( self, id: str, *, - command: str | NotGiven = NOT_GIVEN, + command: str, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -286,7 +286,7 @@ async def execute_async( self, id: str, *, - command: str | NotGiven = NOT_GIVEN, + command: str, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -332,7 +332,7 @@ async def execute_sync( self, id: str, *, - command: str | NotGiven = NOT_GIVEN, + command: str, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/runloop_api_client/types/blueprint_build_log.py b/src/runloop_api_client/types/blueprint_build_log.py index e77767c2a..e2f685858 100644 --- a/src/runloop_api_client/types/blueprint_build_log.py +++ b/src/runloop_api_client/types/blueprint_build_log.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional + from .._models import BaseModel @@ -8,11 +8,11 @@ class BlueprintBuildLog(BaseModel): - level: Optional[str] = None + level: str """Log line severity level.""" - message: Optional[str] = None + message: str """Log line message.""" - timestamp_ms: Optional[int] = None + timestamp_ms: int """Time of log (Unix timestamp milliseconds).""" diff --git a/src/runloop_api_client/types/blueprint_build_logs_list_view.py b/src/runloop_api_client/types/blueprint_build_logs_list_view.py index 0d2618847..5a227ef6a 100644 --- a/src/runloop_api_client/types/blueprint_build_logs_list_view.py +++ b/src/runloop_api_client/types/blueprint_build_logs_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from .._models import BaseModel from .blueprint_build_log import BlueprintBuildLog @@ -9,8 +9,8 @@ class BlueprintBuildLogsListView(BaseModel): - blueprint_id: Optional[str] = None + blueprint_id: str """ID of the Blueprint.""" - logs: Optional[List[BlueprintBuildLog]] = None + logs: List[BlueprintBuildLog] """List of logs generated during Blueprint build.""" diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index 885ca389e..57d16c93c 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -24,6 +24,9 @@ class LaunchParameters(BaseModel): class BlueprintBuildParameters(BaseModel): + name: str + """Name of the Blueprint.""" + code_mounts: Optional[List[CodeMountParameters]] = None """A list of code mounts to be included in the Blueprint.""" @@ -36,8 +39,5 @@ class BlueprintBuildParameters(BaseModel): launch_parameters: Optional[LaunchParameters] = None """Parameters to configure your Devbox at launch time.""" - name: Optional[str] = None - """Name of the Blueprint.""" - system_setup_commands: Optional[List[str]] = None """A list of commands to run to set up your system.""" diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index 7a01d266b..742befdbb 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, List, Iterable -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from .resource_size import ResourceSize from .code_mount_parameters_param import CodeMountParametersParam @@ -12,6 +12,9 @@ class BlueprintCreateParams(TypedDict, total=False): + name: Required[str] + """Name of the Blueprint.""" + code_mounts: Iterable[CodeMountParametersParam] """A list of code mounts to be included in the Blueprint.""" @@ -24,9 +27,6 @@ class BlueprintCreateParams(TypedDict, total=False): launch_parameters: LaunchParameters """Parameters to configure your Devbox at launch time.""" - name: str - """Name of the Blueprint.""" - system_setup_commands: List[str] """A list of commands to run to set up your system.""" diff --git a/src/runloop_api_client/types/blueprint_list_view.py b/src/runloop_api_client/types/blueprint_list_view.py index 001c66308..57f845c95 100644 --- a/src/runloop_api_client/types/blueprint_list_view.py +++ b/src/runloop_api_client/types/blueprint_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from .._models import BaseModel from .blueprint_view import BlueprintView @@ -9,9 +9,9 @@ class BlueprintListView(BaseModel): - blueprints: Optional[List[BlueprintView]] = None + blueprints: List[BlueprintView] """List of blueprints matching filter.""" - has_more: Optional[bool] = None + has_more: bool - total_count: Optional[int] = None + total_count: int diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index 3b16ba655..eba4d0b20 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, List, Iterable -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from .resource_size import ResourceSize from .code_mount_parameters_param import CodeMountParametersParam @@ -12,6 +12,9 @@ class BlueprintPreviewParams(TypedDict, total=False): + name: Required[str] + """Name of the Blueprint.""" + code_mounts: Iterable[CodeMountParametersParam] """A list of code mounts to be included in the Blueprint.""" @@ -24,9 +27,6 @@ class BlueprintPreviewParams(TypedDict, total=False): launch_parameters: LaunchParameters """Parameters to configure your Devbox at launch time.""" - name: str - """Name of the Blueprint.""" - system_setup_commands: List[str] """A list of commands to run to set up your system.""" diff --git a/src/runloop_api_client/types/blueprint_preview_view.py b/src/runloop_api_client/types/blueprint_preview_view.py index 0e42327c2..f0f04aa24 100644 --- a/src/runloop_api_client/types/blueprint_preview_view.py +++ b/src/runloop_api_client/types/blueprint_preview_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional + from .._models import BaseModel @@ -8,5 +8,5 @@ class BlueprintPreviewView(BaseModel): - dockerfile: Optional[str] = None + dockerfile: str """The Dockerfile contents that will built.""" diff --git a/src/runloop_api_client/types/blueprint_view.py b/src/runloop_api_client/types/blueprint_view.py index 0d108badf..0840fff31 100644 --- a/src/runloop_api_client/types/blueprint_view.py +++ b/src/runloop_api_client/types/blueprint_view.py @@ -10,20 +10,20 @@ class BlueprintView(BaseModel): - id: Optional[str] = None + id: str """The id of the Blueprint.""" - create_time_ms: Optional[int] = None + create_time_ms: int """Creation time of the Blueprint (Unix timestamp milliseconds).""" - failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "build_failed"]] = None - """The failure reason if the Blueprint build failed, if any.""" - - name: Optional[str] = None + name: str """The name of the Blueprint.""" - parameters: Optional[BlueprintBuildParameters] = None + parameters: BlueprintBuildParameters """The parameters used to create Blueprint.""" - status: Optional[Literal["provisioning", "building", "failed", "build_complete"]] = None + status: Literal["provisioning", "building", "failed", "build_complete"] """The status of the Blueprint build.""" + + failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "build_failed"]] = None + """The failure reason if the Blueprint build failed, if any.""" diff --git a/src/runloop_api_client/types/code_mount_parameters.py b/src/runloop_api_client/types/code_mount_parameters.py index 1d4c1cac7..65abf51ba 100644 --- a/src/runloop_api_client/types/code_mount_parameters.py +++ b/src/runloop_api_client/types/code_mount_parameters.py @@ -8,17 +8,17 @@ class CodeMountParameters(BaseModel): - token: Optional[str] = None - """The authentication token necessary to pull repo.""" - - install_command: Optional[str] = None - """Installation command to install and setup repository.""" - - repo_name: Optional[str] = None + repo_name: str """The name of the repo to mount. By default, code will be mounted at /home/user/{repo_name}s. """ - repo_owner: Optional[str] = None + repo_owner: str """The owner of the repo.""" + + token: Optional[str] = None + """The authentication token necessary to pull repo.""" + + install_command: Optional[str] = None + """Installation command to install and setup repository.""" diff --git a/src/runloop_api_client/types/code_mount_parameters_param.py b/src/runloop_api_client/types/code_mount_parameters_param.py index 0fa99b5af..976471a76 100644 --- a/src/runloop_api_client/types/code_mount_parameters_param.py +++ b/src/runloop_api_client/types/code_mount_parameters_param.py @@ -2,23 +2,23 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["CodeMountParametersParam"] class CodeMountParametersParam(TypedDict, total=False): - token: str - """The authentication token necessary to pull repo.""" - - install_command: str - """Installation command to install and setup repository.""" - - repo_name: str + repo_name: Required[str] """The name of the repo to mount. By default, code will be mounted at /home/user/{repo_name}s. """ - repo_owner: str + repo_owner: Required[str] """The owner of the repo.""" + + token: str + """The authentication token necessary to pull repo.""" + + install_command: str + """Installation command to install and setup repository.""" diff --git a/src/runloop_api_client/types/devbox_async_execution_detail_view.py b/src/runloop_api_client/types/devbox_async_execution_detail_view.py index 0ee2ab6c0..fffbe61fe 100755 --- a/src/runloop_api_client/types/devbox_async_execution_detail_view.py +++ b/src/runloop_api_client/types/devbox_async_execution_detail_view.py @@ -9,12 +9,15 @@ class DevboxAsyncExecutionDetailView(BaseModel): - devbox_id: Optional[str] = None + devbox_id: str """Devbox id where command was executed.""" - execution_id: Optional[str] = None + execution_id: str """Ephemeral id of the execution in progress.""" + status: Literal["queued", "running", "completed"] + """Current status of the execution.""" + exit_status: Optional[int] = None """Exit code of command execution. @@ -24,9 +27,6 @@ class DevboxAsyncExecutionDetailView(BaseModel): shell_name: Optional[str] = None """Shell name.""" - status: Optional[Literal["queued", "running", "completed"]] = None - """Current status of the execution.""" - stderr: Optional[str] = None """Standard error generated by command. diff --git a/src/runloop_api_client/types/devbox_create_ssh_key_response.py b/src/runloop_api_client/types/devbox_create_ssh_key_response.py index 3f8c7c366..064bbc3e9 100755 --- a/src/runloop_api_client/types/devbox_create_ssh_key_response.py +++ b/src/runloop_api_client/types/devbox_create_ssh_key_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional + from .._models import BaseModel @@ -8,11 +8,11 @@ class DevboxCreateSSHKeyResponse(BaseModel): - id: Optional[str] = None + id: str """The id of the Devbox.""" - ssh_private_key: Optional[str] = None + ssh_private_key: str """The ssh private key, in PEM format.""" - url: Optional[str] = None + url: str """The url of the Devbox.""" diff --git a/src/runloop_api_client/types/devbox_execute_async_params.py b/src/runloop_api_client/types/devbox_execute_async_params.py index bdc0eef78..bae2d77b1 100644 --- a/src/runloop_api_client/types/devbox_execute_async_params.py +++ b/src/runloop_api_client/types/devbox_execute_async_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DevboxExecuteAsyncParams"] class DevboxExecuteAsyncParams(TypedDict, total=False): - command: str + command: Required[str] """The command to execute on the Devbox.""" shell_name: str diff --git a/src/runloop_api_client/types/devbox_execute_sync_params.py b/src/runloop_api_client/types/devbox_execute_sync_params.py index 8f0c92c60..e64d50965 100644 --- a/src/runloop_api_client/types/devbox_execute_sync_params.py +++ b/src/runloop_api_client/types/devbox_execute_sync_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DevboxExecuteSyncParams"] class DevboxExecuteSyncParams(TypedDict, total=False): - command: str + command: Required[str] """The command to execute on the Devbox.""" shell_name: str diff --git a/src/runloop_api_client/types/devbox_execution_detail_view.py b/src/runloop_api_client/types/devbox_execution_detail_view.py index 029a3ca5e..8c56bf86b 100644 --- a/src/runloop_api_client/types/devbox_execution_detail_view.py +++ b/src/runloop_api_client/types/devbox_execution_detail_view.py @@ -8,17 +8,17 @@ class DevboxExecutionDetailView(BaseModel): - devbox_id: Optional[str] = None + devbox_id: str """Devbox id where command was executed.""" - exit_status: Optional[int] = None + exit_status: int """Exit status of command execution.""" - shell_name: Optional[str] = None - """Shell name.""" - - stderr: Optional[str] = None + stderr: str """Standard error generated by command.""" - stdout: Optional[str] = None + stdout: str """Standard out generated by command.""" + + shell_name: Optional[str] = None + """Shell name.""" diff --git a/src/runloop_api_client/types/devbox_list_view.py b/src/runloop_api_client/types/devbox_list_view.py index 97f1e91ce..332b737f3 100644 --- a/src/runloop_api_client/types/devbox_list_view.py +++ b/src/runloop_api_client/types/devbox_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from .._models import BaseModel from .devbox_view import DevboxView @@ -9,9 +9,9 @@ class DevboxListView(BaseModel): - devboxes: Optional[List[DevboxView]] = None + devboxes: List[DevboxView] """List of devboxes matching filter.""" - has_more: Optional[bool] = None + has_more: bool - total_count: Optional[int] = None + total_count: int diff --git a/src/runloop_api_client/types/devbox_read_file_contents_params.py b/src/runloop_api_client/types/devbox_read_file_contents_params.py index 9132d834d..9405fc4a7 100644 --- a/src/runloop_api_client/types/devbox_read_file_contents_params.py +++ b/src/runloop_api_client/types/devbox_read_file_contents_params.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DevboxReadFileContentsParams"] class DevboxReadFileContentsParams(TypedDict, total=False): - file_path: str + file_path: Required[str] """The path of the file to read.""" diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 65ac72725..ce50abebf 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -24,38 +24,38 @@ class LaunchParameters(BaseModel): class DevboxView(BaseModel): - id: Optional[str] = None + id: str """The id of the Devbox.""" - blueprint_id: Optional[str] = None - """The Blueprint ID used in creation of the Devbox, if any.""" - - create_time_ms: Optional[int] = None + create_time_ms: int """Creation time of the Devbox (Unix timestamp milliseconds).""" - end_time_ms: Optional[int] = None - """The time the Devbox finished execution (Unix timestamp milliseconds).""" - - failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "execution_failed"]] = None - """The failure reason if the Devbox failed, if any.""" - - initiator_id: Optional[str] = None + initiator_id: str """The initiator ID of the devbox.""" - initiator_type: Optional[Literal["unknown", "api", "invocation"]] = None + initiator_type: Literal["unknown", "api", "invocation"] """The initiator of the devbox.""" - launch_parameters: Optional[LaunchParameters] = None + launch_parameters: LaunchParameters """The launch parameters used to create the Devbox.""" - metadata: Optional[Dict[str, str]] = None + metadata: Dict[str, str] """The user defined Devbox metadata.""" + status: Literal["provisioning", "initializing", "running", "failure", "shutdown"] + """The current status of the Devbox.""" + + blueprint_id: Optional[str] = None + """The Blueprint ID used in creation of the Devbox, if any.""" + + end_time_ms: Optional[int] = None + """The time the Devbox finished execution (Unix timestamp milliseconds).""" + + failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "execution_failed"]] = None + """The failure reason if the Devbox failed, if any.""" + name: Optional[str] = None """The name of the Devbox.""" shutdown_reason: Optional[Literal["api_shutdown", "keep_alive_timeout", "entrypoint_exit"]] = None """The shutdown reason if the Devbox shutdown, if any.""" - - status: Optional[Literal["provisioning", "initializing", "running", "failure", "shutdown"]] = None - """The current status of the Devbox.""" diff --git a/src/runloop_api_client/types/devbox_write_file_params.py b/src/runloop_api_client/types/devbox_write_file_params.py index 4bf249426..eca1cca16 100644 --- a/src/runloop_api_client/types/devbox_write_file_params.py +++ b/src/runloop_api_client/types/devbox_write_file_params.py @@ -2,14 +2,14 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DevboxWriteFileParams"] class DevboxWriteFileParams(TypedDict, total=False): - contents: str + contents: Required[str] """The contents to write to file.""" - file_path: str + file_path: Required[str] """The path of the file to read.""" diff --git a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py index 3de2f5f36..bd1ba5218 100644 --- a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py +++ b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py @@ -9,6 +9,15 @@ class Log(BaseModel): + level: str + """Log line severity level.""" + + source: Literal["setup_commands", "entrypoint", "exec"] + """The source of the log.""" + + timestamp_ms: int + """Time of log (Unix timestamp milliseconds).""" + cmd: Optional[str] = None """The Command Executed""" @@ -18,22 +27,13 @@ class Log(BaseModel): exit_code: Optional[int] = None """The Exit Code of the command""" - level: Optional[str] = None - """Log line severity level.""" - message: Optional[str] = None """Log line message.""" shell_name: Optional[str] = None """The Shell name the cmd executed in.""" - source: Optional[Literal["setup_commands", "entrypoint", "exec"]] = None - """The source of the log.""" - - timestamp_ms: Optional[int] = None - """Time of log (Unix timestamp milliseconds).""" - class DevboxLogsListView(BaseModel): - logs: Optional[List[Log]] = None + logs: List[Log] """List of logs for the given devbox.""" diff --git a/src/runloop_api_client/types/devboxes/execution_execute_async_params.py b/src/runloop_api_client/types/devboxes/execution_execute_async_params.py index 1dd99c082..8d9f92088 100644 --- a/src/runloop_api_client/types/devboxes/execution_execute_async_params.py +++ b/src/runloop_api_client/types/devboxes/execution_execute_async_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ExecutionExecuteAsyncParams"] class ExecutionExecuteAsyncParams(TypedDict, total=False): - command: str + command: Required[str] """The command to execute on the Devbox.""" shell_name: str diff --git a/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py b/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py index 089194877..9537ed816 100755 --- a/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py +++ b/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ExecutionExecuteSyncParams"] class ExecutionExecuteSyncParams(TypedDict, total=False): - command: str + command: Required[str] """The command to execute on the Devbox.""" shell_name: str diff --git a/src/runloop_api_client/types/project_list_view.py b/src/runloop_api_client/types/project_list_view.py index 6f525006d..e31248361 100644 --- a/src/runloop_api_client/types/project_list_view.py +++ b/src/runloop_api_client/types/project_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from .._models import BaseModel @@ -8,23 +8,23 @@ class Installation(BaseModel): - status: Optional[str] = None + status: str """Status of the installation (installed | uninstalled | never_installed).""" class Project(BaseModel): - id: Optional[str] = None + id: str """Unique id of Project.""" - gh_owner: Optional[str] = None + gh_owner: str """Owner of the project in Github""" - name: Optional[str] = None + name: str """Project display name.""" class ProjectListView(BaseModel): - installation: Optional[Installation] = None + installation: Installation - projects: Optional[List[Project]] = None + projects: List[Project] """List of projects matching given query.""" diff --git a/src/runloop_api_client/types/shared/project_logs_view.py b/src/runloop_api_client/types/shared/project_logs_view.py index 9b082f49d..4137cd73f 100644 --- a/src/runloop_api_client/types/shared/project_logs_view.py +++ b/src/runloop_api_client/types/shared/project_logs_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from ..._models import BaseModel @@ -8,15 +8,15 @@ class Log(BaseModel): - level: Optional[str] = None + level: str - message: Optional[str] = None + message: str - source: Optional[str] = None + source: str - timestamp: Optional[str] = None + timestamp: str class ProjectLogsView(BaseModel): - logs: Optional[List[Log]] = None + logs: List[Log] """List of logs for the given project.""" diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index 8c498b3a5..d2e37de0e 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -78,6 +78,7 @@ def test_path_params_retrieve(self, client: Runloop) -> None: def test_method_execute_async(self, client: Runloop) -> None: execution = client.devboxes.executions.execute_async( id="id", + command="command", ) assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) @@ -94,6 +95,7 @@ def test_method_execute_async_with_all_params(self, client: Runloop) -> None: def test_raw_response_execute_async(self, client: Runloop) -> None: response = client.devboxes.executions.with_raw_response.execute_async( id="id", + command="command", ) assert response.is_closed is True @@ -105,6 +107,7 @@ def test_raw_response_execute_async(self, client: Runloop) -> None: def test_streaming_response_execute_async(self, client: Runloop) -> None: with client.devboxes.executions.with_streaming_response.execute_async( id="id", + command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -119,12 +122,14 @@ def test_path_params_execute_async(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.executions.with_raw_response.execute_async( id="", + command="command", ) @parametrize def test_method_execute_sync(self, client: Runloop) -> None: execution = client.devboxes.executions.execute_sync( id="id", + command="command", ) assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) @@ -141,6 +146,7 @@ def test_method_execute_sync_with_all_params(self, client: Runloop) -> None: def test_raw_response_execute_sync(self, client: Runloop) -> None: response = client.devboxes.executions.with_raw_response.execute_sync( id="id", + command="command", ) assert response.is_closed is True @@ -152,6 +158,7 @@ def test_raw_response_execute_sync(self, client: Runloop) -> None: def test_streaming_response_execute_sync(self, client: Runloop) -> None: with client.devboxes.executions.with_streaming_response.execute_sync( id="id", + command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -166,6 +173,7 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.executions.with_raw_response.execute_sync( id="", + command="command", ) @parametrize @@ -281,6 +289,7 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: async def test_method_execute_async(self, async_client: AsyncRunloop) -> None: execution = await async_client.devboxes.executions.execute_async( id="id", + command="command", ) assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) @@ -297,6 +306,7 @@ async def test_method_execute_async_with_all_params(self, async_client: AsyncRun async def test_raw_response_execute_async(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.executions.with_raw_response.execute_async( id="id", + command="command", ) assert response.is_closed is True @@ -308,6 +318,7 @@ async def test_raw_response_execute_async(self, async_client: AsyncRunloop) -> N async def test_streaming_response_execute_async(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.executions.with_streaming_response.execute_async( id="id", + command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -322,12 +333,14 @@ async def test_path_params_execute_async(self, async_client: AsyncRunloop) -> No with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.executions.with_raw_response.execute_async( id="", + command="command", ) @parametrize async def test_method_execute_sync(self, async_client: AsyncRunloop) -> None: execution = await async_client.devboxes.executions.execute_sync( id="id", + command="command", ) assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) @@ -344,6 +357,7 @@ async def test_method_execute_sync_with_all_params(self, async_client: AsyncRunl async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.executions.with_raw_response.execute_sync( id="id", + command="command", ) assert response.is_closed is True @@ -355,6 +369,7 @@ async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> No async def test_streaming_response_execute_sync(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.executions.with_streaming_response.execute_sync( id="id", + command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -369,6 +384,7 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.executions.with_raw_response.execute_sync( id="", + command="command", ) @parametrize diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 7aad480ed..7fa9a7518 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -24,30 +24,33 @@ class TestBlueprints: @parametrize def test_method_create(self, client: Runloop) -> None: - blueprint = client.blueprints.create() + blueprint = client.blueprints.create( + name="name", + ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: blueprint = client.blueprints.create( + name="name", code_mounts=[ { - "token": "token", - "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - }, - { "token": "token", "install_command": "install_command", - "repo_name": "repo_name", - "repo_owner": "repo_owner", }, { + "repo_name": "repo_name", + "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", + }, + { "repo_name": "repo_name", "repo_owner": "repo_owner", + "token": "token", + "install_command": "install_command", }, ], dockerfile="dockerfile", @@ -57,14 +60,15 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", }, - name="name", system_setup_commands=["string", "string", "string"], ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize def test_raw_response_create(self, client: Runloop) -> None: - response = client.blueprints.with_raw_response.create() + response = client.blueprints.with_raw_response.create( + name="name", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -73,7 +77,9 @@ def test_raw_response_create(self, client: Runloop) -> None: @parametrize def test_streaming_response_create(self, client: Runloop) -> None: - with client.blueprints.with_streaming_response.create() as response: + with client.blueprints.with_streaming_response.create( + name="name", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -194,30 +200,33 @@ def test_path_params_logs(self, client: Runloop) -> None: @parametrize def test_method_preview(self, client: Runloop) -> None: - blueprint = client.blueprints.preview() + blueprint = client.blueprints.preview( + name="name", + ) assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) @parametrize def test_method_preview_with_all_params(self, client: Runloop) -> None: blueprint = client.blueprints.preview( + name="name", code_mounts=[ { - "token": "token", - "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - }, - { "token": "token", "install_command": "install_command", - "repo_name": "repo_name", - "repo_owner": "repo_owner", }, { + "repo_name": "repo_name", + "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", + }, + { "repo_name": "repo_name", "repo_owner": "repo_owner", + "token": "token", + "install_command": "install_command", }, ], dockerfile="dockerfile", @@ -227,14 +236,15 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", }, - name="name", system_setup_commands=["string", "string", "string"], ) assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) @parametrize def test_raw_response_preview(self, client: Runloop) -> None: - response = client.blueprints.with_raw_response.preview() + response = client.blueprints.with_raw_response.preview( + name="name", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -243,7 +253,9 @@ def test_raw_response_preview(self, client: Runloop) -> None: @parametrize def test_streaming_response_preview(self, client: Runloop) -> None: - with client.blueprints.with_streaming_response.preview() as response: + with client.blueprints.with_streaming_response.preview( + name="name", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -258,30 +270,33 @@ class TestAsyncBlueprints: @parametrize async def test_method_create(self, async_client: AsyncRunloop) -> None: - blueprint = await async_client.blueprints.create() + blueprint = await async_client.blueprints.create( + name="name", + ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.create( + name="name", code_mounts=[ { - "token": "token", - "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - }, - { "token": "token", "install_command": "install_command", - "repo_name": "repo_name", - "repo_owner": "repo_owner", }, { + "repo_name": "repo_name", + "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", + }, + { "repo_name": "repo_name", "repo_owner": "repo_owner", + "token": "token", + "install_command": "install_command", }, ], dockerfile="dockerfile", @@ -291,14 +306,15 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", }, - name="name", system_setup_commands=["string", "string", "string"], ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: - response = await async_client.blueprints.with_raw_response.create() + response = await async_client.blueprints.with_raw_response.create( + name="name", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -307,7 +323,9 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: - async with async_client.blueprints.with_streaming_response.create() as response: + async with async_client.blueprints.with_streaming_response.create( + name="name", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -428,30 +446,33 @@ async def test_path_params_logs(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_preview(self, async_client: AsyncRunloop) -> None: - blueprint = await async_client.blueprints.preview() + blueprint = await async_client.blueprints.preview( + name="name", + ) assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) @parametrize async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.preview( + name="name", code_mounts=[ { - "token": "token", - "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - }, - { "token": "token", "install_command": "install_command", - "repo_name": "repo_name", - "repo_owner": "repo_owner", }, { + "repo_name": "repo_name", + "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", + }, + { "repo_name": "repo_name", "repo_owner": "repo_owner", + "token": "token", + "install_command": "install_command", }, ], dockerfile="dockerfile", @@ -461,14 +482,15 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", }, - name="name", system_setup_commands=["string", "string", "string"], ) assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) @parametrize async def test_raw_response_preview(self, async_client: AsyncRunloop) -> None: - response = await async_client.blueprints.with_raw_response.preview() + response = await async_client.blueprints.with_raw_response.preview( + name="name", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -477,7 +499,9 @@ async def test_raw_response_preview(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_preview(self, async_client: AsyncRunloop) -> None: - async with async_client.blueprints.with_streaming_response.preview() as response: + async with async_client.blueprints.with_streaming_response.preview( + name="name", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 91fb3adbf..688dc3265 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -35,22 +35,22 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: blueprint_name="blueprint_name", code_mounts=[ { - "token": "token", - "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - }, - { "token": "token", "install_command": "install_command", - "repo_name": "repo_name", - "repo_owner": "repo_owner", }, { + "repo_name": "repo_name", + "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", + }, + { "repo_name": "repo_name", "repo_owner": "repo_owner", + "token": "token", + "install_command": "install_command", }, ], entrypoint="entrypoint", @@ -202,6 +202,7 @@ def test_path_params_create_ssh_key(self, client: Runloop) -> None: def test_method_execute_async(self, client: Runloop) -> None: devbox = client.devboxes.execute_async( id="id", + command="command", ) assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) @@ -218,6 +219,7 @@ def test_method_execute_async_with_all_params(self, client: Runloop) -> None: def test_raw_response_execute_async(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.execute_async( id="id", + command="command", ) assert response.is_closed is True @@ -229,6 +231,7 @@ def test_raw_response_execute_async(self, client: Runloop) -> None: def test_streaming_response_execute_async(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.execute_async( id="id", + command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -243,12 +246,14 @@ def test_path_params_execute_async(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.with_raw_response.execute_async( id="", + command="command", ) @parametrize def test_method_execute_sync(self, client: Runloop) -> None: devbox = client.devboxes.execute_sync( id="id", + command="command", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @@ -265,6 +270,7 @@ def test_method_execute_sync_with_all_params(self, client: Runloop) -> None: def test_raw_response_execute_sync(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.execute_sync( id="id", + command="command", ) assert response.is_closed is True @@ -276,6 +282,7 @@ def test_raw_response_execute_sync(self, client: Runloop) -> None: def test_streaming_response_execute_sync(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.execute_sync( id="id", + command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -290,17 +297,11 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.with_raw_response.execute_sync( id="", + command="command", ) @parametrize def test_method_read_file_contents(self, client: Runloop) -> None: - devbox = client.devboxes.read_file_contents( - id="id", - ) - assert_matches_type(str, devbox, path=["response"]) - - @parametrize - def test_method_read_file_contents_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.read_file_contents( id="id", file_path="file_path", @@ -311,6 +312,7 @@ def test_method_read_file_contents_with_all_params(self, client: Runloop) -> Non def test_raw_response_read_file_contents(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.read_file_contents( id="id", + file_path="file_path", ) assert response.is_closed is True @@ -322,6 +324,7 @@ def test_raw_response_read_file_contents(self, client: Runloop) -> None: def test_streaming_response_read_file_contents(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.read_file_contents( id="id", + file_path="file_path", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -336,6 +339,7 @@ def test_path_params_read_file_contents(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.with_raw_response.read_file_contents( id="", + file_path="file_path", ) @parametrize @@ -425,13 +429,6 @@ def test_path_params_upload_file(self, client: Runloop) -> None: @parametrize def test_method_write_file(self, client: Runloop) -> None: - devbox = client.devboxes.write_file( - id="id", - ) - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - - @parametrize - def test_method_write_file_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.write_file( id="id", contents="contents", @@ -443,6 +440,8 @@ def test_method_write_file_with_all_params(self, client: Runloop) -> None: def test_raw_response_write_file(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.write_file( id="id", + contents="contents", + file_path="file_path", ) assert response.is_closed is True @@ -454,6 +453,8 @@ def test_raw_response_write_file(self, client: Runloop) -> None: def test_streaming_response_write_file(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.write_file( id="id", + contents="contents", + file_path="file_path", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -468,6 +469,8 @@ def test_path_params_write_file(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.with_raw_response.write_file( id="", + contents="contents", + file_path="file_path", ) @@ -486,22 +489,22 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - blueprint_name="blueprint_name", code_mounts=[ { - "token": "token", - "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - }, - { "token": "token", "install_command": "install_command", - "repo_name": "repo_name", - "repo_owner": "repo_owner", }, { + "repo_name": "repo_name", + "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", + }, + { "repo_name": "repo_name", "repo_owner": "repo_owner", + "token": "token", + "install_command": "install_command", }, ], entrypoint="entrypoint", @@ -653,6 +656,7 @@ async def test_path_params_create_ssh_key(self, async_client: AsyncRunloop) -> N async def test_method_execute_async(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.execute_async( id="id", + command="command", ) assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) @@ -669,6 +673,7 @@ async def test_method_execute_async_with_all_params(self, async_client: AsyncRun async def test_raw_response_execute_async(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.execute_async( id="id", + command="command", ) assert response.is_closed is True @@ -680,6 +685,7 @@ async def test_raw_response_execute_async(self, async_client: AsyncRunloop) -> N async def test_streaming_response_execute_async(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.execute_async( id="id", + command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -694,12 +700,14 @@ async def test_path_params_execute_async(self, async_client: AsyncRunloop) -> No with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.with_raw_response.execute_async( id="", + command="command", ) @parametrize async def test_method_execute_sync(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.execute_sync( id="id", + command="command", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @@ -716,6 +724,7 @@ async def test_method_execute_sync_with_all_params(self, async_client: AsyncRunl async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.execute_sync( id="id", + command="command", ) assert response.is_closed is True @@ -727,6 +736,7 @@ async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> No async def test_streaming_response_execute_sync(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.execute_sync( id="id", + command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -741,17 +751,11 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.with_raw_response.execute_sync( id="", + command="command", ) @parametrize async def test_method_read_file_contents(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.read_file_contents( - id="id", - ) - assert_matches_type(str, devbox, path=["response"]) - - @parametrize - async def test_method_read_file_contents_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.read_file_contents( id="id", file_path="file_path", @@ -762,6 +766,7 @@ async def test_method_read_file_contents_with_all_params(self, async_client: Asy async def test_raw_response_read_file_contents(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.read_file_contents( id="id", + file_path="file_path", ) assert response.is_closed is True @@ -773,6 +778,7 @@ async def test_raw_response_read_file_contents(self, async_client: AsyncRunloop) async def test_streaming_response_read_file_contents(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.read_file_contents( id="id", + file_path="file_path", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -787,6 +793,7 @@ async def test_path_params_read_file_contents(self, async_client: AsyncRunloop) with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.with_raw_response.read_file_contents( id="", + file_path="file_path", ) @parametrize @@ -876,13 +883,6 @@ async def test_path_params_upload_file(self, async_client: AsyncRunloop) -> None @parametrize async def test_method_write_file(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.write_file( - id="id", - ) - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - - @parametrize - async def test_method_write_file_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.write_file( id="id", contents="contents", @@ -894,6 +894,8 @@ async def test_method_write_file_with_all_params(self, async_client: AsyncRunloo async def test_raw_response_write_file(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.write_file( id="id", + contents="contents", + file_path="file_path", ) assert response.is_closed is True @@ -905,6 +907,8 @@ async def test_raw_response_write_file(self, async_client: AsyncRunloop) -> None async def test_streaming_response_write_file(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.write_file( id="id", + contents="contents", + file_path="file_path", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -919,4 +923,6 @@ async def test_path_params_write_file(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.with_raw_response.write_file( id="", + contents="contents", + file_path="file_path", ) From 45b978a31606d955938b52db917b333473787327 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 20:30:08 +0000 Subject: [PATCH 164/993] chore(internal): version bump (#176) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7c31fce28..aa8487597 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.21" + ".": "0.1.0-alpha.22" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index abfcafdda..81ff07f81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.1.0-alpha.21" +version = "0.1.0-alpha.22" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index e0fb84dd3..9cb294c5a 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.1.0-alpha.21" # x-release-please-version +__version__ = "0.1.0-alpha.22" # x-release-please-version From 5b13827e15a5ecf633de4d1dc249dc9f05317b3b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 21:17:48 +0000 Subject: [PATCH 165/993] feat(api): OpenAPI spec update via Stainless API (#177) --- .stats.yml | 2 +- .../resources/blueprints.py | 32 +++--- .../resources/devboxes/devboxes.py | 20 ++-- .../resources/devboxes/executions.py | 8 +- .../types/blueprint_build_log.py | 8 +- .../types/blueprint_build_logs_list_view.py | 6 +- .../types/blueprint_build_parameters.py | 6 +- .../types/blueprint_create_params.py | 8 +- .../types/blueprint_list_view.py | 8 +- .../types/blueprint_preview_params.py | 8 +- .../types/blueprint_preview_view.py | 4 +- .../types/blueprint_view.py | 16 +-- .../types/code_mount_parameters.py | 16 +-- .../types/code_mount_parameters_param.py | 18 +-- .../devbox_async_execution_detail_view.py | 10 +- .../types/devbox_create_ssh_key_response.py | 8 +- .../types/devbox_execute_async_params.py | 4 +- .../types/devbox_execute_sync_params.py | 4 +- .../types/devbox_execution_detail_view.py | 14 +-- .../types/devbox_list_view.py | 8 +- .../types/devbox_read_file_contents_params.py | 4 +- src/runloop_api_client/types/devbox_view.py | 36 +++--- .../types/devbox_write_file_params.py | 6 +- .../types/devboxes/devbox_logs_list_view.py | 20 ++-- .../execution_execute_async_params.py | 4 +- .../devboxes/execution_execute_sync_params.py | 4 +- .../types/project_list_view.py | 14 +-- .../types/shared/project_logs_view.py | 12 +- .../api_resources/devboxes/test_executions.py | 16 --- tests/api_resources/test_blueprints.py | 104 +++++++----------- tests/api_resources/test_devboxes.py | 86 +++++++-------- 31 files changed, 234 insertions(+), 280 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2eef7c03f..87100f8b2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-72d3aa191a9b7af61f359257e03889f6b43923cac4d186e5075aa1a696dd38ff.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b3591c2e7b147a5cea5bdfa2e31bdc3647d3a4c66e922c146e7cf6181fbdde72.yml diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index 65d147225..cb8e1eee3 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -53,11 +53,11 @@ def with_streaming_response(self) -> BlueprintsResourceWithStreamingResponse: def create( self, *, - name: str, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, launch_parameters: blueprint_create_params.LaunchParameters | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -73,8 +73,6 @@ def create( ready. Args: - name: Name of the Blueprint. - code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -83,6 +81,8 @@ def create( launch_parameters: Parameters to configure your Devbox at launch time. + name: Name of the Blueprint. + system_setup_commands: A list of commands to run to set up your system. extra_headers: Send extra headers @@ -97,11 +97,11 @@ def create( "/v1/blueprints", body=maybe_transform( { - "name": name, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, + "name": name, "system_setup_commands": system_setup_commands, }, blueprint_create_params.BlueprintCreateParams, @@ -233,11 +233,11 @@ def logs( def preview( self, *, - name: str, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, launch_parameters: blueprint_preview_params.LaunchParameters | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -252,8 +252,6 @@ def preview( resulting Dockerfile and test out your build. Args: - name: Name of the Blueprint. - code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -262,6 +260,8 @@ def preview( launch_parameters: Parameters to configure your Devbox at launch time. + name: Name of the Blueprint. + system_setup_commands: A list of commands to run to set up your system. extra_headers: Send extra headers @@ -276,11 +276,11 @@ def preview( "/v1/blueprints/preview", body=maybe_transform( { - "name": name, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, + "name": name, "system_setup_commands": system_setup_commands, }, blueprint_preview_params.BlueprintPreviewParams, @@ -315,11 +315,11 @@ def with_streaming_response(self) -> AsyncBlueprintsResourceWithStreamingRespons async def create( self, *, - name: str, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, launch_parameters: blueprint_create_params.LaunchParameters | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -335,8 +335,6 @@ async def create( ready. Args: - name: Name of the Blueprint. - code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -345,6 +343,8 @@ async def create( launch_parameters: Parameters to configure your Devbox at launch time. + name: Name of the Blueprint. + system_setup_commands: A list of commands to run to set up your system. extra_headers: Send extra headers @@ -359,11 +359,11 @@ async def create( "/v1/blueprints", body=await async_maybe_transform( { - "name": name, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, + "name": name, "system_setup_commands": system_setup_commands, }, blueprint_create_params.BlueprintCreateParams, @@ -495,11 +495,11 @@ async def logs( async def preview( self, *, - name: str, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, launch_parameters: blueprint_preview_params.LaunchParameters | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -514,8 +514,6 @@ async def preview( resulting Dockerfile and test out your build. Args: - name: Name of the Blueprint. - code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -524,6 +522,8 @@ async def preview( launch_parameters: Parameters to configure your Devbox at launch time. + name: Name of the Blueprint. + system_setup_commands: A list of commands to run to set up your system. extra_headers: Send extra headers @@ -538,11 +538,11 @@ async def preview( "/v1/blueprints/preview", body=await async_maybe_transform( { - "name": name, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, + "name": name, "system_setup_commands": system_setup_commands, }, blueprint_preview_params.BlueprintPreviewParams, diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 756ab6213..7baafe31a 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -295,7 +295,7 @@ def execute_async( self, id: str, *, - command: str, + command: str | NotGiven = NOT_GIVEN, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -341,7 +341,7 @@ def execute_sync( self, id: str, *, - command: str, + command: str | NotGiven = NOT_GIVEN, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -387,7 +387,7 @@ def read_file_contents( self, id: str, *, - file_path: str, + file_path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -509,8 +509,8 @@ def write_file( self, id: str, *, - contents: str, - file_path: str, + contents: str | NotGiven = NOT_GIVEN, + file_path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -790,7 +790,7 @@ async def execute_async( self, id: str, *, - command: str, + command: str | NotGiven = NOT_GIVEN, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -836,7 +836,7 @@ async def execute_sync( self, id: str, *, - command: str, + command: str | NotGiven = NOT_GIVEN, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -882,7 +882,7 @@ async def read_file_contents( self, id: str, *, - file_path: str, + file_path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1004,8 +1004,8 @@ async def write_file( self, id: str, *, - contents: str, - file_path: str, + contents: str | NotGiven = NOT_GIVEN, + file_path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index c265dcd45..c0dcf3dec 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -92,7 +92,7 @@ def execute_async( self, id: str, *, - command: str, + command: str | NotGiven = NOT_GIVEN, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -138,7 +138,7 @@ def execute_sync( self, id: str, *, - command: str, + command: str | NotGiven = NOT_GIVEN, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -286,7 +286,7 @@ async def execute_async( self, id: str, *, - command: str, + command: str | NotGiven = NOT_GIVEN, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -332,7 +332,7 @@ async def execute_sync( self, id: str, *, - command: str, + command: str | NotGiven = NOT_GIVEN, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/runloop_api_client/types/blueprint_build_log.py b/src/runloop_api_client/types/blueprint_build_log.py index e2f685858..e77767c2a 100644 --- a/src/runloop_api_client/types/blueprint_build_log.py +++ b/src/runloop_api_client/types/blueprint_build_log.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - +from typing import Optional from .._models import BaseModel @@ -8,11 +8,11 @@ class BlueprintBuildLog(BaseModel): - level: str + level: Optional[str] = None """Log line severity level.""" - message: str + message: Optional[str] = None """Log line message.""" - timestamp_ms: int + timestamp_ms: Optional[int] = None """Time of log (Unix timestamp milliseconds).""" diff --git a/src/runloop_api_client/types/blueprint_build_logs_list_view.py b/src/runloop_api_client/types/blueprint_build_logs_list_view.py index 5a227ef6a..0d2618847 100644 --- a/src/runloop_api_client/types/blueprint_build_logs_list_view.py +++ b/src/runloop_api_client/types/blueprint_build_logs_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from .._models import BaseModel from .blueprint_build_log import BlueprintBuildLog @@ -9,8 +9,8 @@ class BlueprintBuildLogsListView(BaseModel): - blueprint_id: str + blueprint_id: Optional[str] = None """ID of the Blueprint.""" - logs: List[BlueprintBuildLog] + logs: Optional[List[BlueprintBuildLog]] = None """List of logs generated during Blueprint build.""" diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index 57d16c93c..885ca389e 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -24,9 +24,6 @@ class LaunchParameters(BaseModel): class BlueprintBuildParameters(BaseModel): - name: str - """Name of the Blueprint.""" - code_mounts: Optional[List[CodeMountParameters]] = None """A list of code mounts to be included in the Blueprint.""" @@ -39,5 +36,8 @@ class BlueprintBuildParameters(BaseModel): launch_parameters: Optional[LaunchParameters] = None """Parameters to configure your Devbox at launch time.""" + name: Optional[str] = None + """Name of the Blueprint.""" + system_setup_commands: Optional[List[str]] = None """A list of commands to run to set up your system.""" diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index 742befdbb..7a01d266b 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, List, Iterable -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict from .resource_size import ResourceSize from .code_mount_parameters_param import CodeMountParametersParam @@ -12,9 +12,6 @@ class BlueprintCreateParams(TypedDict, total=False): - name: Required[str] - """Name of the Blueprint.""" - code_mounts: Iterable[CodeMountParametersParam] """A list of code mounts to be included in the Blueprint.""" @@ -27,6 +24,9 @@ class BlueprintCreateParams(TypedDict, total=False): launch_parameters: LaunchParameters """Parameters to configure your Devbox at launch time.""" + name: str + """Name of the Blueprint.""" + system_setup_commands: List[str] """A list of commands to run to set up your system.""" diff --git a/src/runloop_api_client/types/blueprint_list_view.py b/src/runloop_api_client/types/blueprint_list_view.py index 57f845c95..001c66308 100644 --- a/src/runloop_api_client/types/blueprint_list_view.py +++ b/src/runloop_api_client/types/blueprint_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from .._models import BaseModel from .blueprint_view import BlueprintView @@ -9,9 +9,9 @@ class BlueprintListView(BaseModel): - blueprints: List[BlueprintView] + blueprints: Optional[List[BlueprintView]] = None """List of blueprints matching filter.""" - has_more: bool + has_more: Optional[bool] = None - total_count: int + total_count: Optional[int] = None diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index eba4d0b20..3b16ba655 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, List, Iterable -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict from .resource_size import ResourceSize from .code_mount_parameters_param import CodeMountParametersParam @@ -12,9 +12,6 @@ class BlueprintPreviewParams(TypedDict, total=False): - name: Required[str] - """Name of the Blueprint.""" - code_mounts: Iterable[CodeMountParametersParam] """A list of code mounts to be included in the Blueprint.""" @@ -27,6 +24,9 @@ class BlueprintPreviewParams(TypedDict, total=False): launch_parameters: LaunchParameters """Parameters to configure your Devbox at launch time.""" + name: str + """Name of the Blueprint.""" + system_setup_commands: List[str] """A list of commands to run to set up your system.""" diff --git a/src/runloop_api_client/types/blueprint_preview_view.py b/src/runloop_api_client/types/blueprint_preview_view.py index f0f04aa24..0e42327c2 100644 --- a/src/runloop_api_client/types/blueprint_preview_view.py +++ b/src/runloop_api_client/types/blueprint_preview_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - +from typing import Optional from .._models import BaseModel @@ -8,5 +8,5 @@ class BlueprintPreviewView(BaseModel): - dockerfile: str + dockerfile: Optional[str] = None """The Dockerfile contents that will built.""" diff --git a/src/runloop_api_client/types/blueprint_view.py b/src/runloop_api_client/types/blueprint_view.py index 0840fff31..0d108badf 100644 --- a/src/runloop_api_client/types/blueprint_view.py +++ b/src/runloop_api_client/types/blueprint_view.py @@ -10,20 +10,20 @@ class BlueprintView(BaseModel): - id: str + id: Optional[str] = None """The id of the Blueprint.""" - create_time_ms: int + create_time_ms: Optional[int] = None """Creation time of the Blueprint (Unix timestamp milliseconds).""" - name: str + failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "build_failed"]] = None + """The failure reason if the Blueprint build failed, if any.""" + + name: Optional[str] = None """The name of the Blueprint.""" - parameters: BlueprintBuildParameters + parameters: Optional[BlueprintBuildParameters] = None """The parameters used to create Blueprint.""" - status: Literal["provisioning", "building", "failed", "build_complete"] + status: Optional[Literal["provisioning", "building", "failed", "build_complete"]] = None """The status of the Blueprint build.""" - - failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "build_failed"]] = None - """The failure reason if the Blueprint build failed, if any.""" diff --git a/src/runloop_api_client/types/code_mount_parameters.py b/src/runloop_api_client/types/code_mount_parameters.py index 65abf51ba..1d4c1cac7 100644 --- a/src/runloop_api_client/types/code_mount_parameters.py +++ b/src/runloop_api_client/types/code_mount_parameters.py @@ -8,17 +8,17 @@ class CodeMountParameters(BaseModel): - repo_name: str + token: Optional[str] = None + """The authentication token necessary to pull repo.""" + + install_command: Optional[str] = None + """Installation command to install and setup repository.""" + + repo_name: Optional[str] = None """The name of the repo to mount. By default, code will be mounted at /home/user/{repo_name}s. """ - repo_owner: str + repo_owner: Optional[str] = None """The owner of the repo.""" - - token: Optional[str] = None - """The authentication token necessary to pull repo.""" - - install_command: Optional[str] = None - """Installation command to install and setup repository.""" diff --git a/src/runloop_api_client/types/code_mount_parameters_param.py b/src/runloop_api_client/types/code_mount_parameters_param.py index 976471a76..0fa99b5af 100644 --- a/src/runloop_api_client/types/code_mount_parameters_param.py +++ b/src/runloop_api_client/types/code_mount_parameters_param.py @@ -2,23 +2,23 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict __all__ = ["CodeMountParametersParam"] class CodeMountParametersParam(TypedDict, total=False): - repo_name: Required[str] + token: str + """The authentication token necessary to pull repo.""" + + install_command: str + """Installation command to install and setup repository.""" + + repo_name: str """The name of the repo to mount. By default, code will be mounted at /home/user/{repo_name}s. """ - repo_owner: Required[str] + repo_owner: str """The owner of the repo.""" - - token: str - """The authentication token necessary to pull repo.""" - - install_command: str - """Installation command to install and setup repository.""" diff --git a/src/runloop_api_client/types/devbox_async_execution_detail_view.py b/src/runloop_api_client/types/devbox_async_execution_detail_view.py index fffbe61fe..0ee2ab6c0 100755 --- a/src/runloop_api_client/types/devbox_async_execution_detail_view.py +++ b/src/runloop_api_client/types/devbox_async_execution_detail_view.py @@ -9,15 +9,12 @@ class DevboxAsyncExecutionDetailView(BaseModel): - devbox_id: str + devbox_id: Optional[str] = None """Devbox id where command was executed.""" - execution_id: str + execution_id: Optional[str] = None """Ephemeral id of the execution in progress.""" - status: Literal["queued", "running", "completed"] - """Current status of the execution.""" - exit_status: Optional[int] = None """Exit code of command execution. @@ -27,6 +24,9 @@ class DevboxAsyncExecutionDetailView(BaseModel): shell_name: Optional[str] = None """Shell name.""" + status: Optional[Literal["queued", "running", "completed"]] = None + """Current status of the execution.""" + stderr: Optional[str] = None """Standard error generated by command. diff --git a/src/runloop_api_client/types/devbox_create_ssh_key_response.py b/src/runloop_api_client/types/devbox_create_ssh_key_response.py index 064bbc3e9..3f8c7c366 100755 --- a/src/runloop_api_client/types/devbox_create_ssh_key_response.py +++ b/src/runloop_api_client/types/devbox_create_ssh_key_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - +from typing import Optional from .._models import BaseModel @@ -8,11 +8,11 @@ class DevboxCreateSSHKeyResponse(BaseModel): - id: str + id: Optional[str] = None """The id of the Devbox.""" - ssh_private_key: str + ssh_private_key: Optional[str] = None """The ssh private key, in PEM format.""" - url: str + url: Optional[str] = None """The url of the Devbox.""" diff --git a/src/runloop_api_client/types/devbox_execute_async_params.py b/src/runloop_api_client/types/devbox_execute_async_params.py index bae2d77b1..bdc0eef78 100644 --- a/src/runloop_api_client/types/devbox_execute_async_params.py +++ b/src/runloop_api_client/types/devbox_execute_async_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict __all__ = ["DevboxExecuteAsyncParams"] class DevboxExecuteAsyncParams(TypedDict, total=False): - command: Required[str] + command: str """The command to execute on the Devbox.""" shell_name: str diff --git a/src/runloop_api_client/types/devbox_execute_sync_params.py b/src/runloop_api_client/types/devbox_execute_sync_params.py index e64d50965..8f0c92c60 100644 --- a/src/runloop_api_client/types/devbox_execute_sync_params.py +++ b/src/runloop_api_client/types/devbox_execute_sync_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict __all__ = ["DevboxExecuteSyncParams"] class DevboxExecuteSyncParams(TypedDict, total=False): - command: Required[str] + command: str """The command to execute on the Devbox.""" shell_name: str diff --git a/src/runloop_api_client/types/devbox_execution_detail_view.py b/src/runloop_api_client/types/devbox_execution_detail_view.py index 8c56bf86b..029a3ca5e 100644 --- a/src/runloop_api_client/types/devbox_execution_detail_view.py +++ b/src/runloop_api_client/types/devbox_execution_detail_view.py @@ -8,17 +8,17 @@ class DevboxExecutionDetailView(BaseModel): - devbox_id: str + devbox_id: Optional[str] = None """Devbox id where command was executed.""" - exit_status: int + exit_status: Optional[int] = None """Exit status of command execution.""" - stderr: str + shell_name: Optional[str] = None + """Shell name.""" + + stderr: Optional[str] = None """Standard error generated by command.""" - stdout: str + stdout: Optional[str] = None """Standard out generated by command.""" - - shell_name: Optional[str] = None - """Shell name.""" diff --git a/src/runloop_api_client/types/devbox_list_view.py b/src/runloop_api_client/types/devbox_list_view.py index 332b737f3..97f1e91ce 100644 --- a/src/runloop_api_client/types/devbox_list_view.py +++ b/src/runloop_api_client/types/devbox_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from .._models import BaseModel from .devbox_view import DevboxView @@ -9,9 +9,9 @@ class DevboxListView(BaseModel): - devboxes: List[DevboxView] + devboxes: Optional[List[DevboxView]] = None """List of devboxes matching filter.""" - has_more: bool + has_more: Optional[bool] = None - total_count: int + total_count: Optional[int] = None diff --git a/src/runloop_api_client/types/devbox_read_file_contents_params.py b/src/runloop_api_client/types/devbox_read_file_contents_params.py index 9405fc4a7..9132d834d 100644 --- a/src/runloop_api_client/types/devbox_read_file_contents_params.py +++ b/src/runloop_api_client/types/devbox_read_file_contents_params.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict __all__ = ["DevboxReadFileContentsParams"] class DevboxReadFileContentsParams(TypedDict, total=False): - file_path: Required[str] + file_path: str """The path of the file to read.""" diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index ce50abebf..65ac72725 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -24,38 +24,38 @@ class LaunchParameters(BaseModel): class DevboxView(BaseModel): - id: str + id: Optional[str] = None """The id of the Devbox.""" - create_time_ms: int + blueprint_id: Optional[str] = None + """The Blueprint ID used in creation of the Devbox, if any.""" + + create_time_ms: Optional[int] = None """Creation time of the Devbox (Unix timestamp milliseconds).""" - initiator_id: str + end_time_ms: Optional[int] = None + """The time the Devbox finished execution (Unix timestamp milliseconds).""" + + failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "execution_failed"]] = None + """The failure reason if the Devbox failed, if any.""" + + initiator_id: Optional[str] = None """The initiator ID of the devbox.""" - initiator_type: Literal["unknown", "api", "invocation"] + initiator_type: Optional[Literal["unknown", "api", "invocation"]] = None """The initiator of the devbox.""" - launch_parameters: LaunchParameters + launch_parameters: Optional[LaunchParameters] = None """The launch parameters used to create the Devbox.""" - metadata: Dict[str, str] + metadata: Optional[Dict[str, str]] = None """The user defined Devbox metadata.""" - status: Literal["provisioning", "initializing", "running", "failure", "shutdown"] - """The current status of the Devbox.""" - - blueprint_id: Optional[str] = None - """The Blueprint ID used in creation of the Devbox, if any.""" - - end_time_ms: Optional[int] = None - """The time the Devbox finished execution (Unix timestamp milliseconds).""" - - failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "execution_failed"]] = None - """The failure reason if the Devbox failed, if any.""" - name: Optional[str] = None """The name of the Devbox.""" shutdown_reason: Optional[Literal["api_shutdown", "keep_alive_timeout", "entrypoint_exit"]] = None """The shutdown reason if the Devbox shutdown, if any.""" + + status: Optional[Literal["provisioning", "initializing", "running", "failure", "shutdown"]] = None + """The current status of the Devbox.""" diff --git a/src/runloop_api_client/types/devbox_write_file_params.py b/src/runloop_api_client/types/devbox_write_file_params.py index eca1cca16..4bf249426 100644 --- a/src/runloop_api_client/types/devbox_write_file_params.py +++ b/src/runloop_api_client/types/devbox_write_file_params.py @@ -2,14 +2,14 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict __all__ = ["DevboxWriteFileParams"] class DevboxWriteFileParams(TypedDict, total=False): - contents: Required[str] + contents: str """The contents to write to file.""" - file_path: Required[str] + file_path: str """The path of the file to read.""" diff --git a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py index bd1ba5218..3de2f5f36 100644 --- a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py +++ b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py @@ -9,15 +9,6 @@ class Log(BaseModel): - level: str - """Log line severity level.""" - - source: Literal["setup_commands", "entrypoint", "exec"] - """The source of the log.""" - - timestamp_ms: int - """Time of log (Unix timestamp milliseconds).""" - cmd: Optional[str] = None """The Command Executed""" @@ -27,13 +18,22 @@ class Log(BaseModel): exit_code: Optional[int] = None """The Exit Code of the command""" + level: Optional[str] = None + """Log line severity level.""" + message: Optional[str] = None """Log line message.""" shell_name: Optional[str] = None """The Shell name the cmd executed in.""" + source: Optional[Literal["setup_commands", "entrypoint", "exec"]] = None + """The source of the log.""" + + timestamp_ms: Optional[int] = None + """Time of log (Unix timestamp milliseconds).""" + class DevboxLogsListView(BaseModel): - logs: List[Log] + logs: Optional[List[Log]] = None """List of logs for the given devbox.""" diff --git a/src/runloop_api_client/types/devboxes/execution_execute_async_params.py b/src/runloop_api_client/types/devboxes/execution_execute_async_params.py index 8d9f92088..1dd99c082 100644 --- a/src/runloop_api_client/types/devboxes/execution_execute_async_params.py +++ b/src/runloop_api_client/types/devboxes/execution_execute_async_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict __all__ = ["ExecutionExecuteAsyncParams"] class ExecutionExecuteAsyncParams(TypedDict, total=False): - command: Required[str] + command: str """The command to execute on the Devbox.""" shell_name: str diff --git a/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py b/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py index 9537ed816..089194877 100755 --- a/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py +++ b/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict __all__ = ["ExecutionExecuteSyncParams"] class ExecutionExecuteSyncParams(TypedDict, total=False): - command: Required[str] + command: str """The command to execute on the Devbox.""" shell_name: str diff --git a/src/runloop_api_client/types/project_list_view.py b/src/runloop_api_client/types/project_list_view.py index e31248361..6f525006d 100644 --- a/src/runloop_api_client/types/project_list_view.py +++ b/src/runloop_api_client/types/project_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from .._models import BaseModel @@ -8,23 +8,23 @@ class Installation(BaseModel): - status: str + status: Optional[str] = None """Status of the installation (installed | uninstalled | never_installed).""" class Project(BaseModel): - id: str + id: Optional[str] = None """Unique id of Project.""" - gh_owner: str + gh_owner: Optional[str] = None """Owner of the project in Github""" - name: str + name: Optional[str] = None """Project display name.""" class ProjectListView(BaseModel): - installation: Installation + installation: Optional[Installation] = None - projects: List[Project] + projects: Optional[List[Project]] = None """List of projects matching given query.""" diff --git a/src/runloop_api_client/types/shared/project_logs_view.py b/src/runloop_api_client/types/shared/project_logs_view.py index 4137cd73f..9b082f49d 100644 --- a/src/runloop_api_client/types/shared/project_logs_view.py +++ b/src/runloop_api_client/types/shared/project_logs_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from ..._models import BaseModel @@ -8,15 +8,15 @@ class Log(BaseModel): - level: str + level: Optional[str] = None - message: str + message: Optional[str] = None - source: str + source: Optional[str] = None - timestamp: str + timestamp: Optional[str] = None class ProjectLogsView(BaseModel): - logs: List[Log] + logs: Optional[List[Log]] = None """List of logs for the given project.""" diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index d2e37de0e..8c498b3a5 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -78,7 +78,6 @@ def test_path_params_retrieve(self, client: Runloop) -> None: def test_method_execute_async(self, client: Runloop) -> None: execution = client.devboxes.executions.execute_async( id="id", - command="command", ) assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) @@ -95,7 +94,6 @@ def test_method_execute_async_with_all_params(self, client: Runloop) -> None: def test_raw_response_execute_async(self, client: Runloop) -> None: response = client.devboxes.executions.with_raw_response.execute_async( id="id", - command="command", ) assert response.is_closed is True @@ -107,7 +105,6 @@ def test_raw_response_execute_async(self, client: Runloop) -> None: def test_streaming_response_execute_async(self, client: Runloop) -> None: with client.devboxes.executions.with_streaming_response.execute_async( id="id", - command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -122,14 +119,12 @@ def test_path_params_execute_async(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.executions.with_raw_response.execute_async( id="", - command="command", ) @parametrize def test_method_execute_sync(self, client: Runloop) -> None: execution = client.devboxes.executions.execute_sync( id="id", - command="command", ) assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) @@ -146,7 +141,6 @@ def test_method_execute_sync_with_all_params(self, client: Runloop) -> None: def test_raw_response_execute_sync(self, client: Runloop) -> None: response = client.devboxes.executions.with_raw_response.execute_sync( id="id", - command="command", ) assert response.is_closed is True @@ -158,7 +152,6 @@ def test_raw_response_execute_sync(self, client: Runloop) -> None: def test_streaming_response_execute_sync(self, client: Runloop) -> None: with client.devboxes.executions.with_streaming_response.execute_sync( id="id", - command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -173,7 +166,6 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.executions.with_raw_response.execute_sync( id="", - command="command", ) @parametrize @@ -289,7 +281,6 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: async def test_method_execute_async(self, async_client: AsyncRunloop) -> None: execution = await async_client.devboxes.executions.execute_async( id="id", - command="command", ) assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) @@ -306,7 +297,6 @@ async def test_method_execute_async_with_all_params(self, async_client: AsyncRun async def test_raw_response_execute_async(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.executions.with_raw_response.execute_async( id="id", - command="command", ) assert response.is_closed is True @@ -318,7 +308,6 @@ async def test_raw_response_execute_async(self, async_client: AsyncRunloop) -> N async def test_streaming_response_execute_async(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.executions.with_streaming_response.execute_async( id="id", - command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -333,14 +322,12 @@ async def test_path_params_execute_async(self, async_client: AsyncRunloop) -> No with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.executions.with_raw_response.execute_async( id="", - command="command", ) @parametrize async def test_method_execute_sync(self, async_client: AsyncRunloop) -> None: execution = await async_client.devboxes.executions.execute_sync( id="id", - command="command", ) assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) @@ -357,7 +344,6 @@ async def test_method_execute_sync_with_all_params(self, async_client: AsyncRunl async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.executions.with_raw_response.execute_sync( id="id", - command="command", ) assert response.is_closed is True @@ -369,7 +355,6 @@ async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> No async def test_streaming_response_execute_sync(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.executions.with_streaming_response.execute_sync( id="id", - command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -384,7 +369,6 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.executions.with_raw_response.execute_sync( id="", - command="command", ) @parametrize diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 7fa9a7518..7aad480ed 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -24,33 +24,30 @@ class TestBlueprints: @parametrize def test_method_create(self, client: Runloop) -> None: - blueprint = client.blueprints.create( - name="name", - ) + blueprint = client.blueprints.create() assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: blueprint = client.blueprints.create( - name="name", code_mounts=[ { - "repo_name": "repo_name", - "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", - }, - { "repo_name": "repo_name", "repo_owner": "repo_owner", - "token": "token", - "install_command": "install_command", }, { + "token": "token", + "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", + }, + { "token": "token", "install_command": "install_command", + "repo_name": "repo_name", + "repo_owner": "repo_owner", }, ], dockerfile="dockerfile", @@ -60,15 +57,14 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", }, + name="name", system_setup_commands=["string", "string", "string"], ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize def test_raw_response_create(self, client: Runloop) -> None: - response = client.blueprints.with_raw_response.create( - name="name", - ) + response = client.blueprints.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -77,9 +73,7 @@ def test_raw_response_create(self, client: Runloop) -> None: @parametrize def test_streaming_response_create(self, client: Runloop) -> None: - with client.blueprints.with_streaming_response.create( - name="name", - ) as response: + with client.blueprints.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -200,33 +194,30 @@ def test_path_params_logs(self, client: Runloop) -> None: @parametrize def test_method_preview(self, client: Runloop) -> None: - blueprint = client.blueprints.preview( - name="name", - ) + blueprint = client.blueprints.preview() assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) @parametrize def test_method_preview_with_all_params(self, client: Runloop) -> None: blueprint = client.blueprints.preview( - name="name", code_mounts=[ { - "repo_name": "repo_name", - "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", - }, - { "repo_name": "repo_name", "repo_owner": "repo_owner", - "token": "token", - "install_command": "install_command", }, { + "token": "token", + "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", + }, + { "token": "token", "install_command": "install_command", + "repo_name": "repo_name", + "repo_owner": "repo_owner", }, ], dockerfile="dockerfile", @@ -236,15 +227,14 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", }, + name="name", system_setup_commands=["string", "string", "string"], ) assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) @parametrize def test_raw_response_preview(self, client: Runloop) -> None: - response = client.blueprints.with_raw_response.preview( - name="name", - ) + response = client.blueprints.with_raw_response.preview() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -253,9 +243,7 @@ def test_raw_response_preview(self, client: Runloop) -> None: @parametrize def test_streaming_response_preview(self, client: Runloop) -> None: - with client.blueprints.with_streaming_response.preview( - name="name", - ) as response: + with client.blueprints.with_streaming_response.preview() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -270,33 +258,30 @@ class TestAsyncBlueprints: @parametrize async def test_method_create(self, async_client: AsyncRunloop) -> None: - blueprint = await async_client.blueprints.create( - name="name", - ) + blueprint = await async_client.blueprints.create() assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.create( - name="name", code_mounts=[ { - "repo_name": "repo_name", - "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", - }, - { "repo_name": "repo_name", "repo_owner": "repo_owner", - "token": "token", - "install_command": "install_command", }, { + "token": "token", + "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", + }, + { "token": "token", "install_command": "install_command", + "repo_name": "repo_name", + "repo_owner": "repo_owner", }, ], dockerfile="dockerfile", @@ -306,15 +291,14 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", }, + name="name", system_setup_commands=["string", "string", "string"], ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: - response = await async_client.blueprints.with_raw_response.create( - name="name", - ) + response = await async_client.blueprints.with_raw_response.create() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -323,9 +307,7 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: - async with async_client.blueprints.with_streaming_response.create( - name="name", - ) as response: + async with async_client.blueprints.with_streaming_response.create() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -446,33 +428,30 @@ async def test_path_params_logs(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_preview(self, async_client: AsyncRunloop) -> None: - blueprint = await async_client.blueprints.preview( - name="name", - ) + blueprint = await async_client.blueprints.preview() assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) @parametrize async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.preview( - name="name", code_mounts=[ { - "repo_name": "repo_name", - "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", - }, - { "repo_name": "repo_name", "repo_owner": "repo_owner", - "token": "token", - "install_command": "install_command", }, { + "token": "token", + "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", + }, + { "token": "token", "install_command": "install_command", + "repo_name": "repo_name", + "repo_owner": "repo_owner", }, ], dockerfile="dockerfile", @@ -482,15 +461,14 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", }, + name="name", system_setup_commands=["string", "string", "string"], ) assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) @parametrize async def test_raw_response_preview(self, async_client: AsyncRunloop) -> None: - response = await async_client.blueprints.with_raw_response.preview( - name="name", - ) + response = await async_client.blueprints.with_raw_response.preview() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -499,9 +477,7 @@ async def test_raw_response_preview(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_preview(self, async_client: AsyncRunloop) -> None: - async with async_client.blueprints.with_streaming_response.preview( - name="name", - ) as response: + async with async_client.blueprints.with_streaming_response.preview() as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 688dc3265..91fb3adbf 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -35,22 +35,22 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: blueprint_name="blueprint_name", code_mounts=[ { - "repo_name": "repo_name", - "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", - }, - { "repo_name": "repo_name", "repo_owner": "repo_owner", - "token": "token", - "install_command": "install_command", }, { + "token": "token", + "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", + }, + { "token": "token", "install_command": "install_command", + "repo_name": "repo_name", + "repo_owner": "repo_owner", }, ], entrypoint="entrypoint", @@ -202,7 +202,6 @@ def test_path_params_create_ssh_key(self, client: Runloop) -> None: def test_method_execute_async(self, client: Runloop) -> None: devbox = client.devboxes.execute_async( id="id", - command="command", ) assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) @@ -219,7 +218,6 @@ def test_method_execute_async_with_all_params(self, client: Runloop) -> None: def test_raw_response_execute_async(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.execute_async( id="id", - command="command", ) assert response.is_closed is True @@ -231,7 +229,6 @@ def test_raw_response_execute_async(self, client: Runloop) -> None: def test_streaming_response_execute_async(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.execute_async( id="id", - command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -246,14 +243,12 @@ def test_path_params_execute_async(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.with_raw_response.execute_async( id="", - command="command", ) @parametrize def test_method_execute_sync(self, client: Runloop) -> None: devbox = client.devboxes.execute_sync( id="id", - command="command", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @@ -270,7 +265,6 @@ def test_method_execute_sync_with_all_params(self, client: Runloop) -> None: def test_raw_response_execute_sync(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.execute_sync( id="id", - command="command", ) assert response.is_closed is True @@ -282,7 +276,6 @@ def test_raw_response_execute_sync(self, client: Runloop) -> None: def test_streaming_response_execute_sync(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.execute_sync( id="id", - command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -297,11 +290,17 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.with_raw_response.execute_sync( id="", - command="command", ) @parametrize def test_method_read_file_contents(self, client: Runloop) -> None: + devbox = client.devboxes.read_file_contents( + id="id", + ) + assert_matches_type(str, devbox, path=["response"]) + + @parametrize + def test_method_read_file_contents_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.read_file_contents( id="id", file_path="file_path", @@ -312,7 +311,6 @@ def test_method_read_file_contents(self, client: Runloop) -> None: def test_raw_response_read_file_contents(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.read_file_contents( id="id", - file_path="file_path", ) assert response.is_closed is True @@ -324,7 +322,6 @@ def test_raw_response_read_file_contents(self, client: Runloop) -> None: def test_streaming_response_read_file_contents(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.read_file_contents( id="id", - file_path="file_path", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -339,7 +336,6 @@ def test_path_params_read_file_contents(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.with_raw_response.read_file_contents( id="", - file_path="file_path", ) @parametrize @@ -429,6 +425,13 @@ def test_path_params_upload_file(self, client: Runloop) -> None: @parametrize def test_method_write_file(self, client: Runloop) -> None: + devbox = client.devboxes.write_file( + id="id", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_method_write_file_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.write_file( id="id", contents="contents", @@ -440,8 +443,6 @@ def test_method_write_file(self, client: Runloop) -> None: def test_raw_response_write_file(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.write_file( id="id", - contents="contents", - file_path="file_path", ) assert response.is_closed is True @@ -453,8 +454,6 @@ def test_raw_response_write_file(self, client: Runloop) -> None: def test_streaming_response_write_file(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.write_file( id="id", - contents="contents", - file_path="file_path", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -469,8 +468,6 @@ def test_path_params_write_file(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.with_raw_response.write_file( id="", - contents="contents", - file_path="file_path", ) @@ -489,22 +486,22 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - blueprint_name="blueprint_name", code_mounts=[ { - "repo_name": "repo_name", - "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", - }, - { "repo_name": "repo_name", "repo_owner": "repo_owner", - "token": "token", - "install_command": "install_command", }, { + "token": "token", + "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", + }, + { "token": "token", "install_command": "install_command", + "repo_name": "repo_name", + "repo_owner": "repo_owner", }, ], entrypoint="entrypoint", @@ -656,7 +653,6 @@ async def test_path_params_create_ssh_key(self, async_client: AsyncRunloop) -> N async def test_method_execute_async(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.execute_async( id="id", - command="command", ) assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) @@ -673,7 +669,6 @@ async def test_method_execute_async_with_all_params(self, async_client: AsyncRun async def test_raw_response_execute_async(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.execute_async( id="id", - command="command", ) assert response.is_closed is True @@ -685,7 +680,6 @@ async def test_raw_response_execute_async(self, async_client: AsyncRunloop) -> N async def test_streaming_response_execute_async(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.execute_async( id="id", - command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -700,14 +694,12 @@ async def test_path_params_execute_async(self, async_client: AsyncRunloop) -> No with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.with_raw_response.execute_async( id="", - command="command", ) @parametrize async def test_method_execute_sync(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.execute_sync( id="id", - command="command", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @@ -724,7 +716,6 @@ async def test_method_execute_sync_with_all_params(self, async_client: AsyncRunl async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.execute_sync( id="id", - command="command", ) assert response.is_closed is True @@ -736,7 +727,6 @@ async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> No async def test_streaming_response_execute_sync(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.execute_sync( id="id", - command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -751,11 +741,17 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.with_raw_response.execute_sync( id="", - command="command", ) @parametrize async def test_method_read_file_contents(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.read_file_contents( + id="id", + ) + assert_matches_type(str, devbox, path=["response"]) + + @parametrize + async def test_method_read_file_contents_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.read_file_contents( id="id", file_path="file_path", @@ -766,7 +762,6 @@ async def test_method_read_file_contents(self, async_client: AsyncRunloop) -> No async def test_raw_response_read_file_contents(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.read_file_contents( id="id", - file_path="file_path", ) assert response.is_closed is True @@ -778,7 +773,6 @@ async def test_raw_response_read_file_contents(self, async_client: AsyncRunloop) async def test_streaming_response_read_file_contents(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.read_file_contents( id="id", - file_path="file_path", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -793,7 +787,6 @@ async def test_path_params_read_file_contents(self, async_client: AsyncRunloop) with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.with_raw_response.read_file_contents( id="", - file_path="file_path", ) @parametrize @@ -883,6 +876,13 @@ async def test_path_params_upload_file(self, async_client: AsyncRunloop) -> None @parametrize async def test_method_write_file(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.write_file( + id="id", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_method_write_file_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.write_file( id="id", contents="contents", @@ -894,8 +894,6 @@ async def test_method_write_file(self, async_client: AsyncRunloop) -> None: async def test_raw_response_write_file(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.write_file( id="id", - contents="contents", - file_path="file_path", ) assert response.is_closed is True @@ -907,8 +905,6 @@ async def test_raw_response_write_file(self, async_client: AsyncRunloop) -> None async def test_streaming_response_write_file(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.write_file( id="id", - contents="contents", - file_path="file_path", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -923,6 +919,4 @@ async def test_path_params_write_file(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.with_raw_response.write_file( id="", - contents="contents", - file_path="file_path", ) From 27359ec153ea0ce5b50ed956b1634d425652a5f4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 05:17:40 +0000 Subject: [PATCH 166/993] feat(api): OpenAPI spec update via Stainless API (#179) --- .stats.yml | 2 +- .../resources/blueprints.py | 32 +++--- .../resources/devboxes/devboxes.py | 20 ++-- .../resources/devboxes/executions.py | 8 +- .../types/blueprint_build_log.py | 8 +- .../types/blueprint_build_logs_list_view.py | 6 +- .../types/blueprint_build_parameters.py | 6 +- .../types/blueprint_create_params.py | 8 +- .../types/blueprint_list_view.py | 8 +- .../types/blueprint_preview_params.py | 8 +- .../types/blueprint_preview_view.py | 4 +- .../types/blueprint_view.py | 16 +-- .../types/code_mount_parameters.py | 16 +-- .../types/code_mount_parameters_param.py | 18 +-- .../devbox_async_execution_detail_view.py | 10 +- .../types/devbox_create_ssh_key_response.py | 8 +- .../types/devbox_execute_async_params.py | 4 +- .../types/devbox_execute_sync_params.py | 4 +- .../types/devbox_execution_detail_view.py | 14 +-- .../types/devbox_list_view.py | 8 +- .../types/devbox_read_file_contents_params.py | 4 +- src/runloop_api_client/types/devbox_view.py | 36 +++--- .../types/devbox_write_file_params.py | 6 +- .../types/devboxes/devbox_logs_list_view.py | 20 ++-- .../execution_execute_async_params.py | 4 +- .../devboxes/execution_execute_sync_params.py | 4 +- .../types/project_list_view.py | 14 +-- .../types/shared/project_logs_view.py | 12 +- .../api_resources/devboxes/test_executions.py | 16 +++ tests/api_resources/test_blueprints.py | 104 +++++++++++------- tests/api_resources/test_devboxes.py | 86 ++++++++------- 31 files changed, 280 insertions(+), 234 deletions(-) diff --git a/.stats.yml b/.stats.yml index 87100f8b2..bec2a7c70 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b3591c2e7b147a5cea5bdfa2e31bdc3647d3a4c66e922c146e7cf6181fbdde72.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d2e481e5b4893c4f436c7d63bda88034040fbb4e0076c785832cd3810b2076c6.yml diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index cb8e1eee3..65d147225 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -53,11 +53,11 @@ def with_streaming_response(self) -> BlueprintsResourceWithStreamingResponse: def create( self, *, + name: str, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, launch_parameters: blueprint_create_params.LaunchParameters | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -73,6 +73,8 @@ def create( ready. Args: + name: Name of the Blueprint. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -81,8 +83,6 @@ def create( launch_parameters: Parameters to configure your Devbox at launch time. - name: Name of the Blueprint. - system_setup_commands: A list of commands to run to set up your system. extra_headers: Send extra headers @@ -97,11 +97,11 @@ def create( "/v1/blueprints", body=maybe_transform( { + "name": name, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, - "name": name, "system_setup_commands": system_setup_commands, }, blueprint_create_params.BlueprintCreateParams, @@ -233,11 +233,11 @@ def logs( def preview( self, *, + name: str, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, launch_parameters: blueprint_preview_params.LaunchParameters | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -252,6 +252,8 @@ def preview( resulting Dockerfile and test out your build. Args: + name: Name of the Blueprint. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -260,8 +262,6 @@ def preview( launch_parameters: Parameters to configure your Devbox at launch time. - name: Name of the Blueprint. - system_setup_commands: A list of commands to run to set up your system. extra_headers: Send extra headers @@ -276,11 +276,11 @@ def preview( "/v1/blueprints/preview", body=maybe_transform( { + "name": name, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, - "name": name, "system_setup_commands": system_setup_commands, }, blueprint_preview_params.BlueprintPreviewParams, @@ -315,11 +315,11 @@ def with_streaming_response(self) -> AsyncBlueprintsResourceWithStreamingRespons async def create( self, *, + name: str, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, launch_parameters: blueprint_create_params.LaunchParameters | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -335,6 +335,8 @@ async def create( ready. Args: + name: Name of the Blueprint. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -343,8 +345,6 @@ async def create( launch_parameters: Parameters to configure your Devbox at launch time. - name: Name of the Blueprint. - system_setup_commands: A list of commands to run to set up your system. extra_headers: Send extra headers @@ -359,11 +359,11 @@ async def create( "/v1/blueprints", body=await async_maybe_transform( { + "name": name, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, - "name": name, "system_setup_commands": system_setup_commands, }, blueprint_create_params.BlueprintCreateParams, @@ -495,11 +495,11 @@ async def logs( async def preview( self, *, + name: str, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, launch_parameters: blueprint_preview_params.LaunchParameters | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -514,6 +514,8 @@ async def preview( resulting Dockerfile and test out your build. Args: + name: Name of the Blueprint. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -522,8 +524,6 @@ async def preview( launch_parameters: Parameters to configure your Devbox at launch time. - name: Name of the Blueprint. - system_setup_commands: A list of commands to run to set up your system. extra_headers: Send extra headers @@ -538,11 +538,11 @@ async def preview( "/v1/blueprints/preview", body=await async_maybe_transform( { + "name": name, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, - "name": name, "system_setup_commands": system_setup_commands, }, blueprint_preview_params.BlueprintPreviewParams, diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 7baafe31a..756ab6213 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -295,7 +295,7 @@ def execute_async( self, id: str, *, - command: str | NotGiven = NOT_GIVEN, + command: str, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -341,7 +341,7 @@ def execute_sync( self, id: str, *, - command: str | NotGiven = NOT_GIVEN, + command: str, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -387,7 +387,7 @@ def read_file_contents( self, id: str, *, - file_path: str | NotGiven = NOT_GIVEN, + file_path: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -509,8 +509,8 @@ def write_file( self, id: str, *, - contents: str | NotGiven = NOT_GIVEN, - file_path: str | NotGiven = NOT_GIVEN, + contents: str, + file_path: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -790,7 +790,7 @@ async def execute_async( self, id: str, *, - command: str | NotGiven = NOT_GIVEN, + command: str, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -836,7 +836,7 @@ async def execute_sync( self, id: str, *, - command: str | NotGiven = NOT_GIVEN, + command: str, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -882,7 +882,7 @@ async def read_file_contents( self, id: str, *, - file_path: str | NotGiven = NOT_GIVEN, + file_path: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1004,8 +1004,8 @@ async def write_file( self, id: str, *, - contents: str | NotGiven = NOT_GIVEN, - file_path: str | NotGiven = NOT_GIVEN, + contents: str, + file_path: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index c0dcf3dec..c265dcd45 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -92,7 +92,7 @@ def execute_async( self, id: str, *, - command: str | NotGiven = NOT_GIVEN, + command: str, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -138,7 +138,7 @@ def execute_sync( self, id: str, *, - command: str | NotGiven = NOT_GIVEN, + command: str, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -286,7 +286,7 @@ async def execute_async( self, id: str, *, - command: str | NotGiven = NOT_GIVEN, + command: str, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -332,7 +332,7 @@ async def execute_sync( self, id: str, *, - command: str | NotGiven = NOT_GIVEN, + command: str, shell_name: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/runloop_api_client/types/blueprint_build_log.py b/src/runloop_api_client/types/blueprint_build_log.py index e77767c2a..e2f685858 100644 --- a/src/runloop_api_client/types/blueprint_build_log.py +++ b/src/runloop_api_client/types/blueprint_build_log.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional + from .._models import BaseModel @@ -8,11 +8,11 @@ class BlueprintBuildLog(BaseModel): - level: Optional[str] = None + level: str """Log line severity level.""" - message: Optional[str] = None + message: str """Log line message.""" - timestamp_ms: Optional[int] = None + timestamp_ms: int """Time of log (Unix timestamp milliseconds).""" diff --git a/src/runloop_api_client/types/blueprint_build_logs_list_view.py b/src/runloop_api_client/types/blueprint_build_logs_list_view.py index 0d2618847..5a227ef6a 100644 --- a/src/runloop_api_client/types/blueprint_build_logs_list_view.py +++ b/src/runloop_api_client/types/blueprint_build_logs_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from .._models import BaseModel from .blueprint_build_log import BlueprintBuildLog @@ -9,8 +9,8 @@ class BlueprintBuildLogsListView(BaseModel): - blueprint_id: Optional[str] = None + blueprint_id: str """ID of the Blueprint.""" - logs: Optional[List[BlueprintBuildLog]] = None + logs: List[BlueprintBuildLog] """List of logs generated during Blueprint build.""" diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index 885ca389e..57d16c93c 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -24,6 +24,9 @@ class LaunchParameters(BaseModel): class BlueprintBuildParameters(BaseModel): + name: str + """Name of the Blueprint.""" + code_mounts: Optional[List[CodeMountParameters]] = None """A list of code mounts to be included in the Blueprint.""" @@ -36,8 +39,5 @@ class BlueprintBuildParameters(BaseModel): launch_parameters: Optional[LaunchParameters] = None """Parameters to configure your Devbox at launch time.""" - name: Optional[str] = None - """Name of the Blueprint.""" - system_setup_commands: Optional[List[str]] = None """A list of commands to run to set up your system.""" diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index 7a01d266b..742befdbb 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, List, Iterable -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from .resource_size import ResourceSize from .code_mount_parameters_param import CodeMountParametersParam @@ -12,6 +12,9 @@ class BlueprintCreateParams(TypedDict, total=False): + name: Required[str] + """Name of the Blueprint.""" + code_mounts: Iterable[CodeMountParametersParam] """A list of code mounts to be included in the Blueprint.""" @@ -24,9 +27,6 @@ class BlueprintCreateParams(TypedDict, total=False): launch_parameters: LaunchParameters """Parameters to configure your Devbox at launch time.""" - name: str - """Name of the Blueprint.""" - system_setup_commands: List[str] """A list of commands to run to set up your system.""" diff --git a/src/runloop_api_client/types/blueprint_list_view.py b/src/runloop_api_client/types/blueprint_list_view.py index 001c66308..57f845c95 100644 --- a/src/runloop_api_client/types/blueprint_list_view.py +++ b/src/runloop_api_client/types/blueprint_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from .._models import BaseModel from .blueprint_view import BlueprintView @@ -9,9 +9,9 @@ class BlueprintListView(BaseModel): - blueprints: Optional[List[BlueprintView]] = None + blueprints: List[BlueprintView] """List of blueprints matching filter.""" - has_more: Optional[bool] = None + has_more: bool - total_count: Optional[int] = None + total_count: int diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index 3b16ba655..eba4d0b20 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, List, Iterable -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from .resource_size import ResourceSize from .code_mount_parameters_param import CodeMountParametersParam @@ -12,6 +12,9 @@ class BlueprintPreviewParams(TypedDict, total=False): + name: Required[str] + """Name of the Blueprint.""" + code_mounts: Iterable[CodeMountParametersParam] """A list of code mounts to be included in the Blueprint.""" @@ -24,9 +27,6 @@ class BlueprintPreviewParams(TypedDict, total=False): launch_parameters: LaunchParameters """Parameters to configure your Devbox at launch time.""" - name: str - """Name of the Blueprint.""" - system_setup_commands: List[str] """A list of commands to run to set up your system.""" diff --git a/src/runloop_api_client/types/blueprint_preview_view.py b/src/runloop_api_client/types/blueprint_preview_view.py index 0e42327c2..f0f04aa24 100644 --- a/src/runloop_api_client/types/blueprint_preview_view.py +++ b/src/runloop_api_client/types/blueprint_preview_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional + from .._models import BaseModel @@ -8,5 +8,5 @@ class BlueprintPreviewView(BaseModel): - dockerfile: Optional[str] = None + dockerfile: str """The Dockerfile contents that will built.""" diff --git a/src/runloop_api_client/types/blueprint_view.py b/src/runloop_api_client/types/blueprint_view.py index 0d108badf..0840fff31 100644 --- a/src/runloop_api_client/types/blueprint_view.py +++ b/src/runloop_api_client/types/blueprint_view.py @@ -10,20 +10,20 @@ class BlueprintView(BaseModel): - id: Optional[str] = None + id: str """The id of the Blueprint.""" - create_time_ms: Optional[int] = None + create_time_ms: int """Creation time of the Blueprint (Unix timestamp milliseconds).""" - failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "build_failed"]] = None - """The failure reason if the Blueprint build failed, if any.""" - - name: Optional[str] = None + name: str """The name of the Blueprint.""" - parameters: Optional[BlueprintBuildParameters] = None + parameters: BlueprintBuildParameters """The parameters used to create Blueprint.""" - status: Optional[Literal["provisioning", "building", "failed", "build_complete"]] = None + status: Literal["provisioning", "building", "failed", "build_complete"] """The status of the Blueprint build.""" + + failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "build_failed"]] = None + """The failure reason if the Blueprint build failed, if any.""" diff --git a/src/runloop_api_client/types/code_mount_parameters.py b/src/runloop_api_client/types/code_mount_parameters.py index 1d4c1cac7..65abf51ba 100644 --- a/src/runloop_api_client/types/code_mount_parameters.py +++ b/src/runloop_api_client/types/code_mount_parameters.py @@ -8,17 +8,17 @@ class CodeMountParameters(BaseModel): - token: Optional[str] = None - """The authentication token necessary to pull repo.""" - - install_command: Optional[str] = None - """Installation command to install and setup repository.""" - - repo_name: Optional[str] = None + repo_name: str """The name of the repo to mount. By default, code will be mounted at /home/user/{repo_name}s. """ - repo_owner: Optional[str] = None + repo_owner: str """The owner of the repo.""" + + token: Optional[str] = None + """The authentication token necessary to pull repo.""" + + install_command: Optional[str] = None + """Installation command to install and setup repository.""" diff --git a/src/runloop_api_client/types/code_mount_parameters_param.py b/src/runloop_api_client/types/code_mount_parameters_param.py index 0fa99b5af..976471a76 100644 --- a/src/runloop_api_client/types/code_mount_parameters_param.py +++ b/src/runloop_api_client/types/code_mount_parameters_param.py @@ -2,23 +2,23 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["CodeMountParametersParam"] class CodeMountParametersParam(TypedDict, total=False): - token: str - """The authentication token necessary to pull repo.""" - - install_command: str - """Installation command to install and setup repository.""" - - repo_name: str + repo_name: Required[str] """The name of the repo to mount. By default, code will be mounted at /home/user/{repo_name}s. """ - repo_owner: str + repo_owner: Required[str] """The owner of the repo.""" + + token: str + """The authentication token necessary to pull repo.""" + + install_command: str + """Installation command to install and setup repository.""" diff --git a/src/runloop_api_client/types/devbox_async_execution_detail_view.py b/src/runloop_api_client/types/devbox_async_execution_detail_view.py index 0ee2ab6c0..fffbe61fe 100755 --- a/src/runloop_api_client/types/devbox_async_execution_detail_view.py +++ b/src/runloop_api_client/types/devbox_async_execution_detail_view.py @@ -9,12 +9,15 @@ class DevboxAsyncExecutionDetailView(BaseModel): - devbox_id: Optional[str] = None + devbox_id: str """Devbox id where command was executed.""" - execution_id: Optional[str] = None + execution_id: str """Ephemeral id of the execution in progress.""" + status: Literal["queued", "running", "completed"] + """Current status of the execution.""" + exit_status: Optional[int] = None """Exit code of command execution. @@ -24,9 +27,6 @@ class DevboxAsyncExecutionDetailView(BaseModel): shell_name: Optional[str] = None """Shell name.""" - status: Optional[Literal["queued", "running", "completed"]] = None - """Current status of the execution.""" - stderr: Optional[str] = None """Standard error generated by command. diff --git a/src/runloop_api_client/types/devbox_create_ssh_key_response.py b/src/runloop_api_client/types/devbox_create_ssh_key_response.py index 3f8c7c366..064bbc3e9 100755 --- a/src/runloop_api_client/types/devbox_create_ssh_key_response.py +++ b/src/runloop_api_client/types/devbox_create_ssh_key_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional + from .._models import BaseModel @@ -8,11 +8,11 @@ class DevboxCreateSSHKeyResponse(BaseModel): - id: Optional[str] = None + id: str """The id of the Devbox.""" - ssh_private_key: Optional[str] = None + ssh_private_key: str """The ssh private key, in PEM format.""" - url: Optional[str] = None + url: str """The url of the Devbox.""" diff --git a/src/runloop_api_client/types/devbox_execute_async_params.py b/src/runloop_api_client/types/devbox_execute_async_params.py index bdc0eef78..bae2d77b1 100644 --- a/src/runloop_api_client/types/devbox_execute_async_params.py +++ b/src/runloop_api_client/types/devbox_execute_async_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DevboxExecuteAsyncParams"] class DevboxExecuteAsyncParams(TypedDict, total=False): - command: str + command: Required[str] """The command to execute on the Devbox.""" shell_name: str diff --git a/src/runloop_api_client/types/devbox_execute_sync_params.py b/src/runloop_api_client/types/devbox_execute_sync_params.py index 8f0c92c60..e64d50965 100644 --- a/src/runloop_api_client/types/devbox_execute_sync_params.py +++ b/src/runloop_api_client/types/devbox_execute_sync_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DevboxExecuteSyncParams"] class DevboxExecuteSyncParams(TypedDict, total=False): - command: str + command: Required[str] """The command to execute on the Devbox.""" shell_name: str diff --git a/src/runloop_api_client/types/devbox_execution_detail_view.py b/src/runloop_api_client/types/devbox_execution_detail_view.py index 029a3ca5e..8c56bf86b 100644 --- a/src/runloop_api_client/types/devbox_execution_detail_view.py +++ b/src/runloop_api_client/types/devbox_execution_detail_view.py @@ -8,17 +8,17 @@ class DevboxExecutionDetailView(BaseModel): - devbox_id: Optional[str] = None + devbox_id: str """Devbox id where command was executed.""" - exit_status: Optional[int] = None + exit_status: int """Exit status of command execution.""" - shell_name: Optional[str] = None - """Shell name.""" - - stderr: Optional[str] = None + stderr: str """Standard error generated by command.""" - stdout: Optional[str] = None + stdout: str """Standard out generated by command.""" + + shell_name: Optional[str] = None + """Shell name.""" diff --git a/src/runloop_api_client/types/devbox_list_view.py b/src/runloop_api_client/types/devbox_list_view.py index 97f1e91ce..332b737f3 100644 --- a/src/runloop_api_client/types/devbox_list_view.py +++ b/src/runloop_api_client/types/devbox_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from .._models import BaseModel from .devbox_view import DevboxView @@ -9,9 +9,9 @@ class DevboxListView(BaseModel): - devboxes: Optional[List[DevboxView]] = None + devboxes: List[DevboxView] """List of devboxes matching filter.""" - has_more: Optional[bool] = None + has_more: bool - total_count: Optional[int] = None + total_count: int diff --git a/src/runloop_api_client/types/devbox_read_file_contents_params.py b/src/runloop_api_client/types/devbox_read_file_contents_params.py index 9132d834d..9405fc4a7 100644 --- a/src/runloop_api_client/types/devbox_read_file_contents_params.py +++ b/src/runloop_api_client/types/devbox_read_file_contents_params.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DevboxReadFileContentsParams"] class DevboxReadFileContentsParams(TypedDict, total=False): - file_path: str + file_path: Required[str] """The path of the file to read.""" diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 65ac72725..ce50abebf 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -24,38 +24,38 @@ class LaunchParameters(BaseModel): class DevboxView(BaseModel): - id: Optional[str] = None + id: str """The id of the Devbox.""" - blueprint_id: Optional[str] = None - """The Blueprint ID used in creation of the Devbox, if any.""" - - create_time_ms: Optional[int] = None + create_time_ms: int """Creation time of the Devbox (Unix timestamp milliseconds).""" - end_time_ms: Optional[int] = None - """The time the Devbox finished execution (Unix timestamp milliseconds).""" - - failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "execution_failed"]] = None - """The failure reason if the Devbox failed, if any.""" - - initiator_id: Optional[str] = None + initiator_id: str """The initiator ID of the devbox.""" - initiator_type: Optional[Literal["unknown", "api", "invocation"]] = None + initiator_type: Literal["unknown", "api", "invocation"] """The initiator of the devbox.""" - launch_parameters: Optional[LaunchParameters] = None + launch_parameters: LaunchParameters """The launch parameters used to create the Devbox.""" - metadata: Optional[Dict[str, str]] = None + metadata: Dict[str, str] """The user defined Devbox metadata.""" + status: Literal["provisioning", "initializing", "running", "failure", "shutdown"] + """The current status of the Devbox.""" + + blueprint_id: Optional[str] = None + """The Blueprint ID used in creation of the Devbox, if any.""" + + end_time_ms: Optional[int] = None + """The time the Devbox finished execution (Unix timestamp milliseconds).""" + + failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "execution_failed"]] = None + """The failure reason if the Devbox failed, if any.""" + name: Optional[str] = None """The name of the Devbox.""" shutdown_reason: Optional[Literal["api_shutdown", "keep_alive_timeout", "entrypoint_exit"]] = None """The shutdown reason if the Devbox shutdown, if any.""" - - status: Optional[Literal["provisioning", "initializing", "running", "failure", "shutdown"]] = None - """The current status of the Devbox.""" diff --git a/src/runloop_api_client/types/devbox_write_file_params.py b/src/runloop_api_client/types/devbox_write_file_params.py index 4bf249426..eca1cca16 100644 --- a/src/runloop_api_client/types/devbox_write_file_params.py +++ b/src/runloop_api_client/types/devbox_write_file_params.py @@ -2,14 +2,14 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["DevboxWriteFileParams"] class DevboxWriteFileParams(TypedDict, total=False): - contents: str + contents: Required[str] """The contents to write to file.""" - file_path: str + file_path: Required[str] """The path of the file to read.""" diff --git a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py index 3de2f5f36..bd1ba5218 100644 --- a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py +++ b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py @@ -9,6 +9,15 @@ class Log(BaseModel): + level: str + """Log line severity level.""" + + source: Literal["setup_commands", "entrypoint", "exec"] + """The source of the log.""" + + timestamp_ms: int + """Time of log (Unix timestamp milliseconds).""" + cmd: Optional[str] = None """The Command Executed""" @@ -18,22 +27,13 @@ class Log(BaseModel): exit_code: Optional[int] = None """The Exit Code of the command""" - level: Optional[str] = None - """Log line severity level.""" - message: Optional[str] = None """Log line message.""" shell_name: Optional[str] = None """The Shell name the cmd executed in.""" - source: Optional[Literal["setup_commands", "entrypoint", "exec"]] = None - """The source of the log.""" - - timestamp_ms: Optional[int] = None - """Time of log (Unix timestamp milliseconds).""" - class DevboxLogsListView(BaseModel): - logs: Optional[List[Log]] = None + logs: List[Log] """List of logs for the given devbox.""" diff --git a/src/runloop_api_client/types/devboxes/execution_execute_async_params.py b/src/runloop_api_client/types/devboxes/execution_execute_async_params.py index 1dd99c082..8d9f92088 100644 --- a/src/runloop_api_client/types/devboxes/execution_execute_async_params.py +++ b/src/runloop_api_client/types/devboxes/execution_execute_async_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ExecutionExecuteAsyncParams"] class ExecutionExecuteAsyncParams(TypedDict, total=False): - command: str + command: Required[str] """The command to execute on the Devbox.""" shell_name: str diff --git a/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py b/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py index 089194877..9537ed816 100755 --- a/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py +++ b/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict __all__ = ["ExecutionExecuteSyncParams"] class ExecutionExecuteSyncParams(TypedDict, total=False): - command: str + command: Required[str] """The command to execute on the Devbox.""" shell_name: str diff --git a/src/runloop_api_client/types/project_list_view.py b/src/runloop_api_client/types/project_list_view.py index 6f525006d..e31248361 100644 --- a/src/runloop_api_client/types/project_list_view.py +++ b/src/runloop_api_client/types/project_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from .._models import BaseModel @@ -8,23 +8,23 @@ class Installation(BaseModel): - status: Optional[str] = None + status: str """Status of the installation (installed | uninstalled | never_installed).""" class Project(BaseModel): - id: Optional[str] = None + id: str """Unique id of Project.""" - gh_owner: Optional[str] = None + gh_owner: str """Owner of the project in Github""" - name: Optional[str] = None + name: str """Project display name.""" class ProjectListView(BaseModel): - installation: Optional[Installation] = None + installation: Installation - projects: Optional[List[Project]] = None + projects: List[Project] """List of projects matching given query.""" diff --git a/src/runloop_api_client/types/shared/project_logs_view.py b/src/runloop_api_client/types/shared/project_logs_view.py index 9b082f49d..4137cd73f 100644 --- a/src/runloop_api_client/types/shared/project_logs_view.py +++ b/src/runloop_api_client/types/shared/project_logs_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List from ..._models import BaseModel @@ -8,15 +8,15 @@ class Log(BaseModel): - level: Optional[str] = None + level: str - message: Optional[str] = None + message: str - source: Optional[str] = None + source: str - timestamp: Optional[str] = None + timestamp: str class ProjectLogsView(BaseModel): - logs: Optional[List[Log]] = None + logs: List[Log] """List of logs for the given project.""" diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index 8c498b3a5..d2e37de0e 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -78,6 +78,7 @@ def test_path_params_retrieve(self, client: Runloop) -> None: def test_method_execute_async(self, client: Runloop) -> None: execution = client.devboxes.executions.execute_async( id="id", + command="command", ) assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) @@ -94,6 +95,7 @@ def test_method_execute_async_with_all_params(self, client: Runloop) -> None: def test_raw_response_execute_async(self, client: Runloop) -> None: response = client.devboxes.executions.with_raw_response.execute_async( id="id", + command="command", ) assert response.is_closed is True @@ -105,6 +107,7 @@ def test_raw_response_execute_async(self, client: Runloop) -> None: def test_streaming_response_execute_async(self, client: Runloop) -> None: with client.devboxes.executions.with_streaming_response.execute_async( id="id", + command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -119,12 +122,14 @@ def test_path_params_execute_async(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.executions.with_raw_response.execute_async( id="", + command="command", ) @parametrize def test_method_execute_sync(self, client: Runloop) -> None: execution = client.devboxes.executions.execute_sync( id="id", + command="command", ) assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) @@ -141,6 +146,7 @@ def test_method_execute_sync_with_all_params(self, client: Runloop) -> None: def test_raw_response_execute_sync(self, client: Runloop) -> None: response = client.devboxes.executions.with_raw_response.execute_sync( id="id", + command="command", ) assert response.is_closed is True @@ -152,6 +158,7 @@ def test_raw_response_execute_sync(self, client: Runloop) -> None: def test_streaming_response_execute_sync(self, client: Runloop) -> None: with client.devboxes.executions.with_streaming_response.execute_sync( id="id", + command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -166,6 +173,7 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.executions.with_raw_response.execute_sync( id="", + command="command", ) @parametrize @@ -281,6 +289,7 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: async def test_method_execute_async(self, async_client: AsyncRunloop) -> None: execution = await async_client.devboxes.executions.execute_async( id="id", + command="command", ) assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) @@ -297,6 +306,7 @@ async def test_method_execute_async_with_all_params(self, async_client: AsyncRun async def test_raw_response_execute_async(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.executions.with_raw_response.execute_async( id="id", + command="command", ) assert response.is_closed is True @@ -308,6 +318,7 @@ async def test_raw_response_execute_async(self, async_client: AsyncRunloop) -> N async def test_streaming_response_execute_async(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.executions.with_streaming_response.execute_async( id="id", + command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -322,12 +333,14 @@ async def test_path_params_execute_async(self, async_client: AsyncRunloop) -> No with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.executions.with_raw_response.execute_async( id="", + command="command", ) @parametrize async def test_method_execute_sync(self, async_client: AsyncRunloop) -> None: execution = await async_client.devboxes.executions.execute_sync( id="id", + command="command", ) assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) @@ -344,6 +357,7 @@ async def test_method_execute_sync_with_all_params(self, async_client: AsyncRunl async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.executions.with_raw_response.execute_sync( id="id", + command="command", ) assert response.is_closed is True @@ -355,6 +369,7 @@ async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> No async def test_streaming_response_execute_sync(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.executions.with_streaming_response.execute_sync( id="id", + command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -369,6 +384,7 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.executions.with_raw_response.execute_sync( id="", + command="command", ) @parametrize diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 7aad480ed..7fa9a7518 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -24,30 +24,33 @@ class TestBlueprints: @parametrize def test_method_create(self, client: Runloop) -> None: - blueprint = client.blueprints.create() + blueprint = client.blueprints.create( + name="name", + ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: blueprint = client.blueprints.create( + name="name", code_mounts=[ { - "token": "token", - "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - }, - { "token": "token", "install_command": "install_command", - "repo_name": "repo_name", - "repo_owner": "repo_owner", }, { + "repo_name": "repo_name", + "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", + }, + { "repo_name": "repo_name", "repo_owner": "repo_owner", + "token": "token", + "install_command": "install_command", }, ], dockerfile="dockerfile", @@ -57,14 +60,15 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", }, - name="name", system_setup_commands=["string", "string", "string"], ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize def test_raw_response_create(self, client: Runloop) -> None: - response = client.blueprints.with_raw_response.create() + response = client.blueprints.with_raw_response.create( + name="name", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -73,7 +77,9 @@ def test_raw_response_create(self, client: Runloop) -> None: @parametrize def test_streaming_response_create(self, client: Runloop) -> None: - with client.blueprints.with_streaming_response.create() as response: + with client.blueprints.with_streaming_response.create( + name="name", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -194,30 +200,33 @@ def test_path_params_logs(self, client: Runloop) -> None: @parametrize def test_method_preview(self, client: Runloop) -> None: - blueprint = client.blueprints.preview() + blueprint = client.blueprints.preview( + name="name", + ) assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) @parametrize def test_method_preview_with_all_params(self, client: Runloop) -> None: blueprint = client.blueprints.preview( + name="name", code_mounts=[ { - "token": "token", - "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - }, - { "token": "token", "install_command": "install_command", - "repo_name": "repo_name", - "repo_owner": "repo_owner", }, { + "repo_name": "repo_name", + "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", + }, + { "repo_name": "repo_name", "repo_owner": "repo_owner", + "token": "token", + "install_command": "install_command", }, ], dockerfile="dockerfile", @@ -227,14 +236,15 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", }, - name="name", system_setup_commands=["string", "string", "string"], ) assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) @parametrize def test_raw_response_preview(self, client: Runloop) -> None: - response = client.blueprints.with_raw_response.preview() + response = client.blueprints.with_raw_response.preview( + name="name", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -243,7 +253,9 @@ def test_raw_response_preview(self, client: Runloop) -> None: @parametrize def test_streaming_response_preview(self, client: Runloop) -> None: - with client.blueprints.with_streaming_response.preview() as response: + with client.blueprints.with_streaming_response.preview( + name="name", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -258,30 +270,33 @@ class TestAsyncBlueprints: @parametrize async def test_method_create(self, async_client: AsyncRunloop) -> None: - blueprint = await async_client.blueprints.create() + blueprint = await async_client.blueprints.create( + name="name", + ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.create( + name="name", code_mounts=[ { - "token": "token", - "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - }, - { "token": "token", "install_command": "install_command", - "repo_name": "repo_name", - "repo_owner": "repo_owner", }, { + "repo_name": "repo_name", + "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", + }, + { "repo_name": "repo_name", "repo_owner": "repo_owner", + "token": "token", + "install_command": "install_command", }, ], dockerfile="dockerfile", @@ -291,14 +306,15 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", }, - name="name", system_setup_commands=["string", "string", "string"], ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: - response = await async_client.blueprints.with_raw_response.create() + response = await async_client.blueprints.with_raw_response.create( + name="name", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -307,7 +323,9 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: - async with async_client.blueprints.with_streaming_response.create() as response: + async with async_client.blueprints.with_streaming_response.create( + name="name", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -428,30 +446,33 @@ async def test_path_params_logs(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_preview(self, async_client: AsyncRunloop) -> None: - blueprint = await async_client.blueprints.preview() + blueprint = await async_client.blueprints.preview( + name="name", + ) assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) @parametrize async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.preview( + name="name", code_mounts=[ { - "token": "token", - "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - }, - { "token": "token", "install_command": "install_command", - "repo_name": "repo_name", - "repo_owner": "repo_owner", }, { + "repo_name": "repo_name", + "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", + }, + { "repo_name": "repo_name", "repo_owner": "repo_owner", + "token": "token", + "install_command": "install_command", }, ], dockerfile="dockerfile", @@ -461,14 +482,15 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", }, - name="name", system_setup_commands=["string", "string", "string"], ) assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) @parametrize async def test_raw_response_preview(self, async_client: AsyncRunloop) -> None: - response = await async_client.blueprints.with_raw_response.preview() + response = await async_client.blueprints.with_raw_response.preview( + name="name", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -477,7 +499,9 @@ async def test_raw_response_preview(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_preview(self, async_client: AsyncRunloop) -> None: - async with async_client.blueprints.with_streaming_response.preview() as response: + async with async_client.blueprints.with_streaming_response.preview( + name="name", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 91fb3adbf..688dc3265 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -35,22 +35,22 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: blueprint_name="blueprint_name", code_mounts=[ { - "token": "token", - "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - }, - { "token": "token", "install_command": "install_command", - "repo_name": "repo_name", - "repo_owner": "repo_owner", }, { + "repo_name": "repo_name", + "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", + }, + { "repo_name": "repo_name", "repo_owner": "repo_owner", + "token": "token", + "install_command": "install_command", }, ], entrypoint="entrypoint", @@ -202,6 +202,7 @@ def test_path_params_create_ssh_key(self, client: Runloop) -> None: def test_method_execute_async(self, client: Runloop) -> None: devbox = client.devboxes.execute_async( id="id", + command="command", ) assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) @@ -218,6 +219,7 @@ def test_method_execute_async_with_all_params(self, client: Runloop) -> None: def test_raw_response_execute_async(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.execute_async( id="id", + command="command", ) assert response.is_closed is True @@ -229,6 +231,7 @@ def test_raw_response_execute_async(self, client: Runloop) -> None: def test_streaming_response_execute_async(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.execute_async( id="id", + command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -243,12 +246,14 @@ def test_path_params_execute_async(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.with_raw_response.execute_async( id="", + command="command", ) @parametrize def test_method_execute_sync(self, client: Runloop) -> None: devbox = client.devboxes.execute_sync( id="id", + command="command", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @@ -265,6 +270,7 @@ def test_method_execute_sync_with_all_params(self, client: Runloop) -> None: def test_raw_response_execute_sync(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.execute_sync( id="id", + command="command", ) assert response.is_closed is True @@ -276,6 +282,7 @@ def test_raw_response_execute_sync(self, client: Runloop) -> None: def test_streaming_response_execute_sync(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.execute_sync( id="id", + command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -290,17 +297,11 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.with_raw_response.execute_sync( id="", + command="command", ) @parametrize def test_method_read_file_contents(self, client: Runloop) -> None: - devbox = client.devboxes.read_file_contents( - id="id", - ) - assert_matches_type(str, devbox, path=["response"]) - - @parametrize - def test_method_read_file_contents_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.read_file_contents( id="id", file_path="file_path", @@ -311,6 +312,7 @@ def test_method_read_file_contents_with_all_params(self, client: Runloop) -> Non def test_raw_response_read_file_contents(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.read_file_contents( id="id", + file_path="file_path", ) assert response.is_closed is True @@ -322,6 +324,7 @@ def test_raw_response_read_file_contents(self, client: Runloop) -> None: def test_streaming_response_read_file_contents(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.read_file_contents( id="id", + file_path="file_path", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -336,6 +339,7 @@ def test_path_params_read_file_contents(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.with_raw_response.read_file_contents( id="", + file_path="file_path", ) @parametrize @@ -425,13 +429,6 @@ def test_path_params_upload_file(self, client: Runloop) -> None: @parametrize def test_method_write_file(self, client: Runloop) -> None: - devbox = client.devboxes.write_file( - id="id", - ) - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - - @parametrize - def test_method_write_file_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.write_file( id="id", contents="contents", @@ -443,6 +440,8 @@ def test_method_write_file_with_all_params(self, client: Runloop) -> None: def test_raw_response_write_file(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.write_file( id="id", + contents="contents", + file_path="file_path", ) assert response.is_closed is True @@ -454,6 +453,8 @@ def test_raw_response_write_file(self, client: Runloop) -> None: def test_streaming_response_write_file(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.write_file( id="id", + contents="contents", + file_path="file_path", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -468,6 +469,8 @@ def test_path_params_write_file(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.with_raw_response.write_file( id="", + contents="contents", + file_path="file_path", ) @@ -486,22 +489,22 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - blueprint_name="blueprint_name", code_mounts=[ { - "token": "token", - "install_command": "install_command", "repo_name": "repo_name", "repo_owner": "repo_owner", - }, - { "token": "token", "install_command": "install_command", - "repo_name": "repo_name", - "repo_owner": "repo_owner", }, { + "repo_name": "repo_name", + "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", + }, + { "repo_name": "repo_name", "repo_owner": "repo_owner", + "token": "token", + "install_command": "install_command", }, ], entrypoint="entrypoint", @@ -653,6 +656,7 @@ async def test_path_params_create_ssh_key(self, async_client: AsyncRunloop) -> N async def test_method_execute_async(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.execute_async( id="id", + command="command", ) assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) @@ -669,6 +673,7 @@ async def test_method_execute_async_with_all_params(self, async_client: AsyncRun async def test_raw_response_execute_async(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.execute_async( id="id", + command="command", ) assert response.is_closed is True @@ -680,6 +685,7 @@ async def test_raw_response_execute_async(self, async_client: AsyncRunloop) -> N async def test_streaming_response_execute_async(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.execute_async( id="id", + command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -694,12 +700,14 @@ async def test_path_params_execute_async(self, async_client: AsyncRunloop) -> No with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.with_raw_response.execute_async( id="", + command="command", ) @parametrize async def test_method_execute_sync(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.execute_sync( id="id", + command="command", ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @@ -716,6 +724,7 @@ async def test_method_execute_sync_with_all_params(self, async_client: AsyncRunl async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.execute_sync( id="id", + command="command", ) assert response.is_closed is True @@ -727,6 +736,7 @@ async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> No async def test_streaming_response_execute_sync(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.execute_sync( id="id", + command="command", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -741,17 +751,11 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.with_raw_response.execute_sync( id="", + command="command", ) @parametrize async def test_method_read_file_contents(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.read_file_contents( - id="id", - ) - assert_matches_type(str, devbox, path=["response"]) - - @parametrize - async def test_method_read_file_contents_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.read_file_contents( id="id", file_path="file_path", @@ -762,6 +766,7 @@ async def test_method_read_file_contents_with_all_params(self, async_client: Asy async def test_raw_response_read_file_contents(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.read_file_contents( id="id", + file_path="file_path", ) assert response.is_closed is True @@ -773,6 +778,7 @@ async def test_raw_response_read_file_contents(self, async_client: AsyncRunloop) async def test_streaming_response_read_file_contents(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.read_file_contents( id="id", + file_path="file_path", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -787,6 +793,7 @@ async def test_path_params_read_file_contents(self, async_client: AsyncRunloop) with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.with_raw_response.read_file_contents( id="", + file_path="file_path", ) @parametrize @@ -876,13 +883,6 @@ async def test_path_params_upload_file(self, async_client: AsyncRunloop) -> None @parametrize async def test_method_write_file(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.write_file( - id="id", - ) - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - - @parametrize - async def test_method_write_file_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.write_file( id="id", contents="contents", @@ -894,6 +894,8 @@ async def test_method_write_file_with_all_params(self, async_client: AsyncRunloo async def test_raw_response_write_file(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.write_file( id="id", + contents="contents", + file_path="file_path", ) assert response.is_closed is True @@ -905,6 +907,8 @@ async def test_raw_response_write_file(self, async_client: AsyncRunloop) -> None async def test_streaming_response_write_file(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.write_file( id="id", + contents="contents", + file_path="file_path", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -919,4 +923,6 @@ async def test_path_params_write_file(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.with_raw_response.write_file( id="", + contents="contents", + file_path="file_path", ) From c149945fe549b27afab09f1ac9e36f3dd495c868 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 18:17:44 +0000 Subject: [PATCH 167/993] feat(api): OpenAPI spec update via Stainless API (#180) --- .stats.yml | 2 +- src/runloop_api_client/resources/blueprints.py | 4 ++-- src/runloop_api_client/types/blueprint_list_params.py | 2 +- tests/api_resources/test_blueprints.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index bec2a7c70..9edc9abf0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d2e481e5b4893c4f436c7d63bda88034040fbb4e0076c785832cd3810b2076c6.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-24e010ce60e00a05ad30fd6ceb0b6930139f4384ae6d9fe4c64749229890cd20.yml diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index 65d147225..f4405b773 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -148,7 +148,7 @@ def retrieve( def list( self, *, - limit: str | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -410,7 +410,7 @@ async def retrieve( async def list( self, *, - limit: str | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/runloop_api_client/types/blueprint_list_params.py b/src/runloop_api_client/types/blueprint_list_params.py index 45f5f70ae..20bb215cf 100644 --- a/src/runloop_api_client/types/blueprint_list_params.py +++ b/src/runloop_api_client/types/blueprint_list_params.py @@ -8,7 +8,7 @@ class BlueprintListParams(TypedDict, total=False): - limit: str + limit: int """Page Limit""" name: str diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 7fa9a7518..229003632 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -134,7 +134,7 @@ def test_method_list(self, client: Runloop) -> None: @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: blueprint = client.blueprints.list( - limit="limit", + limit=0, name="name", starting_after="starting_after", ) @@ -380,7 +380,7 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.list( - limit="limit", + limit=0, name="name", starting_after="starting_after", ) From 0565c54eb4f0c5a5ed6587fcd69394a1ab458ef9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 18:24:33 +0000 Subject: [PATCH 168/993] chore(internal): add support for parsing bool response content (#181) --- src/runloop_api_client/_response.py | 3 ++ tests/test_response.py | 50 +++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/src/runloop_api_client/_response.py b/src/runloop_api_client/_response.py index d891cc0b0..e68be043a 100644 --- a/src/runloop_api_client/_response.py +++ b/src/runloop_api_client/_response.py @@ -192,6 +192,9 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: if cast_to == float: return cast(R, float(response.text)) + if cast_to == bool: + return cast(R, response.text.lower() == "true") + origin = get_origin(cast_to) or cast_to if origin == APIResponse: diff --git a/tests/test_response.py b/tests/test_response.py index 849a519e5..85e98bae8 100644 --- a/tests/test_response.py +++ b/tests/test_response.py @@ -190,6 +190,56 @@ async def test_async_response_parse_annotated_type(async_client: AsyncRunloop) - assert obj.bar == 2 +@pytest.mark.parametrize( + "content, expected", + [ + ("false", False), + ("true", True), + ("False", False), + ("True", True), + ("TrUe", True), + ("FalSe", False), + ], +) +def test_response_parse_bool(client: Runloop, content: str, expected: bool) -> None: + response = APIResponse( + raw=httpx.Response(200, content=content), + client=client, + stream=False, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + result = response.parse(to=bool) + assert result is expected + + +@pytest.mark.parametrize( + "content, expected", + [ + ("false", False), + ("true", True), + ("False", False), + ("True", True), + ("TrUe", True), + ("FalSe", False), + ], +) +async def test_async_response_parse_bool(client: AsyncRunloop, content: str, expected: bool) -> None: + response = AsyncAPIResponse( + raw=httpx.Response(200, content=content), + client=client, + stream=False, + stream_cls=None, + cast_to=str, + options=FinalRequestOptions.construct(method="get", url="/foo"), + ) + + result = await response.parse(to=bool) + assert result is expected + + class OtherModel(BaseModel): a: str From af9a662f0cfeb0d3d9a4cb8b95dbaf6af2dad1e5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 18:28:23 +0000 Subject: [PATCH 169/993] fix(client): avoid OverflowError with very large retry counts (#182) --- src/runloop_api_client/_base_client.py | 3 ++- tests/test_client.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index abb01739d..9fd50d12d 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -689,7 +689,8 @@ def _calculate_retry_timeout( if retry_after is not None and 0 < retry_after <= 60: return retry_after - nb_retries = max_retries - remaining_retries + # Also cap retry count to 1000 to avoid any potential overflows with `pow` + nb_retries = min(max_retries - remaining_retries, 1000) # Apply exponential backoff, but not more than the max. sleep_seconds = min(INITIAL_RETRY_DELAY * pow(2.0, nb_retries), MAX_RETRY_DELAY) diff --git a/tests/test_client.py b/tests/test_client.py index 9a1762d7c..d14292bc4 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -720,6 +720,7 @@ class Model(BaseModel): [3, "", 0.5], [2, "", 0.5 * 2.0], [1, "", 0.5 * 4.0], + [-1100, "", 7.8], # test large number potentially overflowing ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) @@ -1503,6 +1504,7 @@ class Model(BaseModel): [3, "", 0.5], [2, "", 0.5 * 2.0], [1, "", 0.5 * 4.0], + [-1100, "", 7.8], # test large number potentially overflowing ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) From cc346db03e64d26c4db5a5c5b969d6458849635b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 18:29:01 +0000 Subject: [PATCH 170/993] chore: add repr to PageInfo class (#183) --- src/runloop_api_client/_base_client.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index 9fd50d12d..c77409d58 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -143,6 +143,12 @@ def __init__( self.url = url self.params = params + @override + def __repr__(self) -> str: + if self.url: + return f"{self.__class__.__name__}(url={self.url})" + return f"{self.__class__.__name__}(params={self.params})" + class BasePage(GenericModel, Generic[_T]): """ From 0eb97ae705c0f94912d2c7280e982f519b600a9d Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 7 Oct 2024 18:31:28 +0000 Subject: [PATCH 171/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9edc9abf0..bc34140a9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-24e010ce60e00a05ad30fd6ceb0b6930139f4384ae6d9fe4c64749229890cd20.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-fbdcac787258c36334017389efd318753b4e2eae259dc2ffc0cba579b24a1254.yml From 64bceb4f186a100d537aa8b8887554f29f77107a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:14:54 +0000 Subject: [PATCH 172/993] feat(api): OpenAPI spec update via Stainless API (#184) --- .stats.yml | 4 +- api.md | 1 + .../resources/devboxes/devboxes.py | 101 +++++++++++++++ src/runloop_api_client/types/__init__.py | 1 + .../types/devbox_download_file_params.py | 12 ++ tests/api_resources/test_devboxes.py | 116 ++++++++++++++++++ 6 files changed, 233 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/types/devbox_download_file_params.py diff --git a/.stats.yml b/.stats.yml index bc34140a9..020a38f72 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 26 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-fbdcac787258c36334017389efd318753b4e2eae259dc2ffc0cba579b24a1254.yml +configured_endpoints: 27 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d934c31884a197ffe8f114a062e2da781a4ea6e3df45b691d1f4dba30734a61b.yml diff --git a/api.md b/api.md index 06ff3d790..3d79a575d 100644 --- a/api.md +++ b/api.md @@ -65,6 +65,7 @@ Methods: - client.devboxes.retrieve(id) -> DevboxView - client.devboxes.list(\*\*params) -> DevboxListView - client.devboxes.create_ssh_key(id) -> DevboxCreateSSHKeyResponse +- client.devboxes.download_file(id, \*\*params) -> BinaryAPIResponse - client.devboxes.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.read_file_contents(id, \*\*params) -> str diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 756ab6213..a0baf0db3 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -20,6 +20,7 @@ devbox_write_file_params, devbox_upload_file_params, devbox_execute_sync_params, + devbox_download_file_params, devbox_execute_async_params, devbox_read_file_contents_params, ) @@ -41,10 +42,18 @@ ) from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( + BinaryAPIResponse, + AsyncBinaryAPIResponse, + StreamedBinaryAPIResponse, + AsyncStreamedBinaryAPIResponse, to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, + to_custom_raw_response_wrapper, async_to_streamed_response_wrapper, + to_custom_streamed_response_wrapper, + async_to_custom_raw_response_wrapper, + async_to_custom_streamed_response_wrapper, ) from ..._base_client import make_request_options from ...types.devbox_view import DevboxView @@ -291,6 +300,44 @@ def create_ssh_key( cast_to=DevboxCreateSSHKeyResponse, ) + def download_file( + self, + id: str, + *, + path: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BinaryAPIResponse: + """ + Download file contents to a file at path on the Devbox. + + Args: + path: The path on the devbox to read the file + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = {"Accept": "application/octet-stream", **(extra_headers or {})} + return self._post( + f"/v1/devboxes/{id}/download_file", + body=maybe_transform({"path": path}, devbox_download_file_params.DevboxDownloadFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BinaryAPIResponse, + ) + def execute_async( self, id: str, @@ -786,6 +833,44 @@ async def create_ssh_key( cast_to=DevboxCreateSSHKeyResponse, ) + async def download_file( + self, + id: str, + *, + path: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncBinaryAPIResponse: + """ + Download file contents to a file at path on the Devbox. + + Args: + path: The path on the devbox to read the file + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = {"Accept": "application/octet-stream", **(extra_headers or {})} + return await self._post( + f"/v1/devboxes/{id}/download_file", + body=await async_maybe_transform({"path": path}, devbox_download_file_params.DevboxDownloadFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AsyncBinaryAPIResponse, + ) + async def execute_async( self, id: str, @@ -1063,6 +1148,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.create_ssh_key = to_raw_response_wrapper( devboxes.create_ssh_key, ) + self.download_file = to_custom_raw_response_wrapper( + devboxes.download_file, + BinaryAPIResponse, + ) self.execute_async = to_raw_response_wrapper( devboxes.execute_async, ) @@ -1107,6 +1196,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.create_ssh_key = async_to_raw_response_wrapper( devboxes.create_ssh_key, ) + self.download_file = async_to_custom_raw_response_wrapper( + devboxes.download_file, + AsyncBinaryAPIResponse, + ) self.execute_async = async_to_raw_response_wrapper( devboxes.execute_async, ) @@ -1151,6 +1244,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.create_ssh_key = to_streamed_response_wrapper( devboxes.create_ssh_key, ) + self.download_file = to_custom_streamed_response_wrapper( + devboxes.download_file, + StreamedBinaryAPIResponse, + ) self.execute_async = to_streamed_response_wrapper( devboxes.execute_async, ) @@ -1195,6 +1292,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.create_ssh_key = async_to_streamed_response_wrapper( devboxes.create_ssh_key, ) + self.download_file = async_to_custom_streamed_response_wrapper( + devboxes.download_file, + AsyncStreamedBinaryAPIResponse, + ) self.execute_async = async_to_streamed_response_wrapper( devboxes.execute_async, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 2facf2e81..2209d527e 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -26,6 +26,7 @@ from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams from .code_mount_parameters_param import CodeMountParametersParam as CodeMountParametersParam +from .devbox_download_file_params import DevboxDownloadFileParams as DevboxDownloadFileParams from .devbox_execute_async_params import DevboxExecuteAsyncParams as DevboxExecuteAsyncParams from .function_invoke_sync_params import FunctionInvokeSyncParams as FunctionInvokeSyncParams from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView diff --git a/src/runloop_api_client/types/devbox_download_file_params.py b/src/runloop_api_client/types/devbox_download_file_params.py new file mode 100644 index 000000000..f5fa7409a --- /dev/null +++ b/src/runloop_api_client/types/devbox_download_file_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["DevboxDownloadFileParams"] + + +class DevboxDownloadFileParams(TypedDict, total=False): + path: Required[str] + """The path on the devbox to read the file""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 688dc3265..ff0532e83 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -5,7 +5,9 @@ import os from typing import Any, cast +import httpx import pytest +from respx import MockRouter from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop @@ -16,6 +18,12 @@ DevboxCreateSSHKeyResponse, DevboxAsyncExecutionDetailView, ) +from runloop_api_client._response import ( + BinaryAPIResponse, + AsyncBinaryAPIResponse, + StreamedBinaryAPIResponse, + AsyncStreamedBinaryAPIResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -198,6 +206,60 @@ def test_path_params_create_ssh_key(self, client: Runloop) -> None: "", ) + @parametrize + @pytest.mark.respx(base_url=base_url) + def test_method_download_file(self, client: Runloop, respx_mock: MockRouter) -> None: + respx_mock.post("/v1/devboxes/id/download_file").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + devbox = client.devboxes.download_file( + id="id", + path="path", + ) + assert devbox.is_closed + assert devbox.json() == {"foo": "bar"} + assert cast(Any, devbox.is_closed) is True + assert isinstance(devbox, BinaryAPIResponse) + + @parametrize + @pytest.mark.respx(base_url=base_url) + def test_raw_response_download_file(self, client: Runloop, respx_mock: MockRouter) -> None: + respx_mock.post("/v1/devboxes/id/download_file").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + + devbox = client.devboxes.with_raw_response.download_file( + id="id", + path="path", + ) + + assert devbox.is_closed is True + assert devbox.http_request.headers.get("X-Stainless-Lang") == "python" + assert devbox.json() == {"foo": "bar"} + assert isinstance(devbox, BinaryAPIResponse) + + @parametrize + @pytest.mark.respx(base_url=base_url) + def test_streaming_response_download_file(self, client: Runloop, respx_mock: MockRouter) -> None: + respx_mock.post("/v1/devboxes/id/download_file").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + with client.devboxes.with_streaming_response.download_file( + id="id", + path="path", + ) as devbox: + assert not devbox.is_closed + assert devbox.http_request.headers.get("X-Stainless-Lang") == "python" + + assert devbox.json() == {"foo": "bar"} + assert cast(Any, devbox.is_closed) is True + assert isinstance(devbox, StreamedBinaryAPIResponse) + + assert cast(Any, devbox.is_closed) is True + + @parametrize + @pytest.mark.respx(base_url=base_url) + def test_path_params_download_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.download_file( + id="", + path="path", + ) + @parametrize def test_method_execute_async(self, client: Runloop) -> None: devbox = client.devboxes.execute_async( @@ -652,6 +714,60 @@ async def test_path_params_create_ssh_key(self, async_client: AsyncRunloop) -> N "", ) + @parametrize + @pytest.mark.respx(base_url=base_url) + async def test_method_download_file(self, async_client: AsyncRunloop, respx_mock: MockRouter) -> None: + respx_mock.post("/v1/devboxes/id/download_file").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + devbox = await async_client.devboxes.download_file( + id="id", + path="path", + ) + assert devbox.is_closed + assert await devbox.json() == {"foo": "bar"} + assert cast(Any, devbox.is_closed) is True + assert isinstance(devbox, AsyncBinaryAPIResponse) + + @parametrize + @pytest.mark.respx(base_url=base_url) + async def test_raw_response_download_file(self, async_client: AsyncRunloop, respx_mock: MockRouter) -> None: + respx_mock.post("/v1/devboxes/id/download_file").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + + devbox = await async_client.devboxes.with_raw_response.download_file( + id="id", + path="path", + ) + + assert devbox.is_closed is True + assert devbox.http_request.headers.get("X-Stainless-Lang") == "python" + assert await devbox.json() == {"foo": "bar"} + assert isinstance(devbox, AsyncBinaryAPIResponse) + + @parametrize + @pytest.mark.respx(base_url=base_url) + async def test_streaming_response_download_file(self, async_client: AsyncRunloop, respx_mock: MockRouter) -> None: + respx_mock.post("/v1/devboxes/id/download_file").mock(return_value=httpx.Response(200, json={"foo": "bar"})) + async with async_client.devboxes.with_streaming_response.download_file( + id="id", + path="path", + ) as devbox: + assert not devbox.is_closed + assert devbox.http_request.headers.get("X-Stainless-Lang") == "python" + + assert await devbox.json() == {"foo": "bar"} + assert cast(Any, devbox.is_closed) is True + assert isinstance(devbox, AsyncStreamedBinaryAPIResponse) + + assert cast(Any, devbox.is_closed) is True + + @parametrize + @pytest.mark.respx(base_url=base_url) + async def test_path_params_download_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.download_file( + id="", + path="path", + ) + @parametrize async def test_method_execute_async(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.execute_async( From 9160782668e3ba63c0c9976f48f5cc0ab8d99e95 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:17:42 +0000 Subject: [PATCH 173/993] chore(internal): version bump (#185) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index aa8487597..1c0bb8852 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.22" + ".": "0.1.0-alpha.23" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 81ff07f81..148978741 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.1.0-alpha.22" +version = "0.1.0-alpha.23" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 9cb294c5a..7bd91e9f3 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.1.0-alpha.22" # x-release-please-version +__version__ = "0.1.0-alpha.23" # x-release-please-version From 51c7183c3da3fbe46ef2ae6aa56e5f79c9302b78 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 7 Oct 2024 19:17:51 +0000 Subject: [PATCH 174/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 020a38f72..5da65c4ac 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 27 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d934c31884a197ffe8f114a062e2da781a4ea6e3df45b691d1f4dba30734a61b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-0e0915a741e537df00bfedb280f1bd214866a2878f6382f3664e108f19719e89.yml From e986dbfee5262e465c461ca65f31a796fb40bedd Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 7 Oct 2024 20:35:04 +0000 Subject: [PATCH 175/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 5da65c4ac..d4ed80713 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 27 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-0e0915a741e537df00bfedb280f1bd214866a2878f6382f3664e108f19719e89.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-9766f91fc4d8a7b75dde3f8937d44dcfba3179b7873c7b2f5b6614e4cd27982e.yml From fc8f8719baf1466b1dc11215494eb934ef429285 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 7 Oct 2024 21:17:33 +0000 Subject: [PATCH 176/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d4ed80713..5da65c4ac 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 27 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-9766f91fc4d8a7b75dde3f8937d44dcfba3179b7873c7b2f5b6614e4cd27982e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-0e0915a741e537df00bfedb280f1bd214866a2878f6382f3664e108f19719e89.yml From 06434edca1074540d86e95e54f06000f87b2972d Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 8 Oct 2024 19:17:34 +0000 Subject: [PATCH 177/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 5da65c4ac..653759051 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 27 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-0e0915a741e537df00bfedb280f1bd214866a2878f6382f3664e108f19719e89.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ec0adec99c6779da0f166f8ff466d681b287a8465e98529368b123123ac0c43.yml From ae0cc06f449a6505190eafdc782cf0d0bf250008 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 19:08:25 +0000 Subject: [PATCH 178/993] feat(api): api update (#186) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 8 ++++++++ src/runloop_api_client/types/devbox_create_params.py | 3 +++ tests/api_resources/test_devboxes.py | 2 ++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 653759051..7c88cae28 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 27 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ec0adec99c6779da0f166f8ff466d681b287a8465e98529368b123123ac0c43.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8284fde181cf470e6d029c6b2a01497e86b27cf07cdde64d59d9ba063f281b86.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index a0baf0db3..acfabc3fa 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -108,6 +108,7 @@ def create( name: str | NotGiven = NOT_GIVEN, prebuilt: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, + snapshot_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -149,6 +150,8 @@ def create( fetching a tool or building your dependencies. Runloop will look optimize these steps for you. + snapshot_id: Snapshot ID to use for the Devbox. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -172,6 +175,7 @@ def create( "name": name, "prebuilt": prebuilt, "setup_commands": setup_commands, + "snapshot_id": snapshot_id, }, devbox_create_params.DevboxCreateParams, ), @@ -641,6 +645,7 @@ async def create( name: str | NotGiven = NOT_GIVEN, prebuilt: str | NotGiven = NOT_GIVEN, setup_commands: List[str] | NotGiven = NOT_GIVEN, + snapshot_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -682,6 +687,8 @@ async def create( fetching a tool or building your dependencies. Runloop will look optimize these steps for you. + snapshot_id: Snapshot ID to use for the Devbox. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -705,6 +712,7 @@ async def create( "name": name, "prebuilt": prebuilt, "setup_commands": setup_commands, + "snapshot_id": snapshot_id, }, devbox_create_params.DevboxCreateParams, ), diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index ebea10fe1..5f8455746 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -60,6 +60,9 @@ class DevboxCreateParams(TypedDict, total=False): will look optimize these steps for you. """ + snapshot_id: str + """Snapshot ID to use for the Devbox.""" + class LaunchParameters(TypedDict, total=False): keep_alive_time_seconds: int diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index ff0532e83..a229a2209 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -73,6 +73,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: name="name", prebuilt="prebuilt", setup_commands=["string", "string", "string"], + snapshot_id="snapshot_id", ) assert_matches_type(DevboxView, devbox, path=["response"]) @@ -581,6 +582,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - name="name", prebuilt="prebuilt", setup_commands=["string", "string", "string"], + snapshot_id="snapshot_id", ) assert_matches_type(DevboxView, devbox, path=["response"]) From 44641f562825b09ff98a2a1ebc8ba7de02568d0a Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 10 Oct 2024 19:17:33 +0000 Subject: [PATCH 179/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7c88cae28..dd5d2ebe8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 27 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8284fde181cf470e6d029c6b2a01497e86b27cf07cdde64d59d9ba063f281b86.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c56cac6f18dfcb269710c97b59e78c611f00fabf2ffcbee728de67e02e154a3a.yml From 03de81c868c98106dbe25652405d3a5c3ab509db Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 20:03:54 +0000 Subject: [PATCH 180/993] feat(api): api update (#188) --- .stats.yml | 4 +- api.md | 2 + .../resources/devboxes/devboxes.py | 106 ++++++++++++++++++ src/runloop_api_client/types/__init__.py | 2 + .../types/devbox_disk_snapshots_params.py | 15 +++ .../types/devbox_disk_snapshots_response.py | 32 ++++++ tests/api_resources/test_devboxes.py | 67 +++++++++++ 7 files changed, 226 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/types/devbox_disk_snapshots_params.py create mode 100644 src/runloop_api_client/types/devbox_disk_snapshots_response.py diff --git a/.stats.yml b/.stats.yml index dd5d2ebe8..3acddfa16 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 27 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c56cac6f18dfcb269710c97b59e78c611f00fabf2ffcbee728de67e02e154a3a.yml +configured_endpoints: 28 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-0df6d6ebd504bc4dd8734a3e0ddc1eb48adb3e93dcbd9f693a45421276733887.yml diff --git a/api.md b/api.md index 3d79a575d..f9ca5e509 100644 --- a/api.md +++ b/api.md @@ -54,6 +54,7 @@ from runloop_api_client.types import ( DevboxListView, DevboxView, DevboxCreateSSHKeyResponse, + DevboxDiskSnapshotsResponse, DevboxReadFileContentsResponse, DevboxUploadFileResponse, ) @@ -65,6 +66,7 @@ Methods: - client.devboxes.retrieve(id) -> DevboxView - client.devboxes.list(\*\*params) -> DevboxListView - client.devboxes.create_ssh_key(id) -> DevboxCreateSSHKeyResponse +- client.devboxes.disk_snapshots(\*\*params) -> DevboxDiskSnapshotsResponse - client.devboxes.download_file(id, \*\*params) -> BinaryAPIResponse - client.devboxes.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index acfabc3fa..df85bf094 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -22,6 +22,7 @@ devbox_execute_sync_params, devbox_download_file_params, devbox_execute_async_params, + devbox_disk_snapshots_params, devbox_read_file_contents_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes @@ -61,6 +62,7 @@ from ...types.code_mount_parameters_param import CodeMountParametersParam from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse +from ...types.devbox_disk_snapshots_response import DevboxDiskSnapshotsResponse from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView __all__ = ["DevboxesResource", "AsyncDevboxesResource"] @@ -304,6 +306,52 @@ def create_ssh_key( cast_to=DevboxCreateSSHKeyResponse, ) + def disk_snapshots( + self, + *, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxDiskSnapshotsResponse: + """ + List all snapshots of a devbox by id. + + Args: + limit: Page Limit + + starting_after: Load the next page starting after the given token. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/v1/devboxes/disk_snapshots", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + devbox_disk_snapshots_params.DevboxDiskSnapshotsParams, + ), + ), + cast_to=DevboxDiskSnapshotsResponse, + ) + def download_file( self, id: str, @@ -841,6 +889,52 @@ async def create_ssh_key( cast_to=DevboxCreateSSHKeyResponse, ) + async def disk_snapshots( + self, + *, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxDiskSnapshotsResponse: + """ + List all snapshots of a devbox by id. + + Args: + limit: Page Limit + + starting_after: Load the next page starting after the given token. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/v1/devboxes/disk_snapshots", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + devbox_disk_snapshots_params.DevboxDiskSnapshotsParams, + ), + ), + cast_to=DevboxDiskSnapshotsResponse, + ) + async def download_file( self, id: str, @@ -1156,6 +1250,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.create_ssh_key = to_raw_response_wrapper( devboxes.create_ssh_key, ) + self.disk_snapshots = to_raw_response_wrapper( + devboxes.disk_snapshots, + ) self.download_file = to_custom_raw_response_wrapper( devboxes.download_file, BinaryAPIResponse, @@ -1204,6 +1301,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.create_ssh_key = async_to_raw_response_wrapper( devboxes.create_ssh_key, ) + self.disk_snapshots = async_to_raw_response_wrapper( + devboxes.disk_snapshots, + ) self.download_file = async_to_custom_raw_response_wrapper( devboxes.download_file, AsyncBinaryAPIResponse, @@ -1252,6 +1352,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.create_ssh_key = to_streamed_response_wrapper( devboxes.create_ssh_key, ) + self.disk_snapshots = to_streamed_response_wrapper( + devboxes.disk_snapshots, + ) self.download_file = to_custom_streamed_response_wrapper( devboxes.download_file, StreamedBinaryAPIResponse, @@ -1300,6 +1403,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.create_ssh_key = async_to_streamed_response_wrapper( devboxes.create_ssh_key, ) + self.disk_snapshots = async_to_streamed_response_wrapper( + devboxes.disk_snapshots, + ) self.download_file = async_to_custom_streamed_response_wrapper( devboxes.download_file, AsyncStreamedBinaryAPIResponse, diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 2209d527e..1b6c191cd 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -29,10 +29,12 @@ from .devbox_download_file_params import DevboxDownloadFileParams as DevboxDownloadFileParams from .devbox_execute_async_params import DevboxExecuteAsyncParams as DevboxExecuteAsyncParams from .function_invoke_sync_params import FunctionInvokeSyncParams as FunctionInvokeSyncParams +from .devbox_disk_snapshots_params import DevboxDiskSnapshotsParams as DevboxDiskSnapshotsParams from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams from .blueprint_build_logs_list_view import BlueprintBuildLogsListView as BlueprintBuildLogsListView from .devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse as DevboxCreateSSHKeyResponse +from .devbox_disk_snapshots_response import DevboxDiskSnapshotsResponse as DevboxDiskSnapshotsResponse from .devbox_read_file_contents_params import DevboxReadFileContentsParams as DevboxReadFileContentsParams from .devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView as DevboxAsyncExecutionDetailView from .devbox_read_file_contents_response import DevboxReadFileContentsResponse as DevboxReadFileContentsResponse diff --git a/src/runloop_api_client/types/devbox_disk_snapshots_params.py b/src/runloop_api_client/types/devbox_disk_snapshots_params.py new file mode 100644 index 000000000..adb37cc8d --- /dev/null +++ b/src/runloop_api_client/types/devbox_disk_snapshots_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["DevboxDiskSnapshotsParams"] + + +class DevboxDiskSnapshotsParams(TypedDict, total=False): + limit: int + """Page Limit""" + + starting_after: str + """Load the next page starting after the given token.""" diff --git a/src/runloop_api_client/types/devbox_disk_snapshots_response.py b/src/runloop_api_client/types/devbox_disk_snapshots_response.py new file mode 100644 index 000000000..31fa9e713 --- /dev/null +++ b/src/runloop_api_client/types/devbox_disk_snapshots_response.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["DevboxDiskSnapshotsResponse", "Snapshot"] + + +class Snapshot(BaseModel): + id: str + """The unique identifier of the snapshot.""" + + metadata: Dict[str, str] + """metadata associated with the snapshot.""" + + source_devbox_id: str = FieldInfo(alias="sourceDevboxId") + """The source devbox identifier.""" + + name: Optional[str] = None + """(Optional) The custom name of the snapshot.""" + + +class DevboxDiskSnapshotsResponse(BaseModel): + has_more: bool + + snapshots: List[Snapshot] + """List of snapshots matching filter.""" + + total_count: int diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index a229a2209..5d48d1830 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -16,6 +16,7 @@ DevboxListView, DevboxExecutionDetailView, DevboxCreateSSHKeyResponse, + DevboxDiskSnapshotsResponse, DevboxAsyncExecutionDetailView, ) from runloop_api_client._response import ( @@ -207,6 +208,39 @@ def test_path_params_create_ssh_key(self, client: Runloop) -> None: "", ) + @parametrize + def test_method_disk_snapshots(self, client: Runloop) -> None: + devbox = client.devboxes.disk_snapshots() + assert_matches_type(DevboxDiskSnapshotsResponse, devbox, path=["response"]) + + @parametrize + def test_method_disk_snapshots_with_all_params(self, client: Runloop) -> None: + devbox = client.devboxes.disk_snapshots( + limit=0, + starting_after="starting_after", + ) + assert_matches_type(DevboxDiskSnapshotsResponse, devbox, path=["response"]) + + @parametrize + def test_raw_response_disk_snapshots(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.disk_snapshots() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(DevboxDiskSnapshotsResponse, devbox, path=["response"]) + + @parametrize + def test_streaming_response_disk_snapshots(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.disk_snapshots() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(DevboxDiskSnapshotsResponse, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize @pytest.mark.respx(base_url=base_url) def test_method_download_file(self, client: Runloop, respx_mock: MockRouter) -> None: @@ -716,6 +750,39 @@ async def test_path_params_create_ssh_key(self, async_client: AsyncRunloop) -> N "", ) + @parametrize + async def test_method_disk_snapshots(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.disk_snapshots() + assert_matches_type(DevboxDiskSnapshotsResponse, devbox, path=["response"]) + + @parametrize + async def test_method_disk_snapshots_with_all_params(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.disk_snapshots( + limit=0, + starting_after="starting_after", + ) + assert_matches_type(DevboxDiskSnapshotsResponse, devbox, path=["response"]) + + @parametrize + async def test_raw_response_disk_snapshots(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.disk_snapshots() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(DevboxDiskSnapshotsResponse, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_disk_snapshots(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.disk_snapshots() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(DevboxDiskSnapshotsResponse, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize @pytest.mark.respx(base_url=base_url) async def test_method_download_file(self, async_client: AsyncRunloop, respx_mock: MockRouter) -> None: From f106a1d29664286bb9482a53d8ed35cfe72682cb Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 10 Oct 2024 20:17:35 +0000 Subject: [PATCH 181/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 3acddfa16..40d23e1b2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 28 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-0df6d6ebd504bc4dd8734a3e0ddc1eb48adb3e93dcbd9f693a45421276733887.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1b1dd59a8326d972ab26f979561252cda4bcaeeb0cc7eb1ab2b8fe2522f90ec0.yml From 5f5cb2bd727b01d48bb878042f2b213bd287ae5f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 20:32:07 +0000 Subject: [PATCH 182/993] feat(api): api update (#189) --- .stats.yml | 2 +- tests/api_resources/test_devboxes.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 40d23e1b2..d9a0a6044 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 28 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1b1dd59a8326d972ab26f979561252cda4bcaeeb0cc7eb1ab2b8fe2522f90ec0.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d5b31b4bbf540f07391766a9217f0dc872e3c9015dc2282b7b346f6594acbe0c.yml diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 5d48d1830..2989ccb88 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -241,6 +241,7 @@ def test_streaming_response_disk_snapshots(self, client: Runloop) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="prism can't support octet") @parametrize @pytest.mark.respx(base_url=base_url) def test_method_download_file(self, client: Runloop, respx_mock: MockRouter) -> None: @@ -254,6 +255,7 @@ def test_method_download_file(self, client: Runloop, respx_mock: MockRouter) -> assert cast(Any, devbox.is_closed) is True assert isinstance(devbox, BinaryAPIResponse) + @pytest.mark.skip(reason="prism can't support octet") @parametrize @pytest.mark.respx(base_url=base_url) def test_raw_response_download_file(self, client: Runloop, respx_mock: MockRouter) -> None: @@ -269,6 +271,7 @@ def test_raw_response_download_file(self, client: Runloop, respx_mock: MockRoute assert devbox.json() == {"foo": "bar"} assert isinstance(devbox, BinaryAPIResponse) + @pytest.mark.skip(reason="prism can't support octet") @parametrize @pytest.mark.respx(base_url=base_url) def test_streaming_response_download_file(self, client: Runloop, respx_mock: MockRouter) -> None: @@ -286,6 +289,7 @@ def test_streaming_response_download_file(self, client: Runloop, respx_mock: Moc assert cast(Any, devbox.is_closed) is True + @pytest.mark.skip(reason="prism can't support octet") @parametrize @pytest.mark.respx(base_url=base_url) def test_path_params_download_file(self, client: Runloop) -> None: @@ -783,6 +787,7 @@ async def test_streaming_response_disk_snapshots(self, async_client: AsyncRunloo assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="prism can't support octet") @parametrize @pytest.mark.respx(base_url=base_url) async def test_method_download_file(self, async_client: AsyncRunloop, respx_mock: MockRouter) -> None: @@ -796,6 +801,7 @@ async def test_method_download_file(self, async_client: AsyncRunloop, respx_mock assert cast(Any, devbox.is_closed) is True assert isinstance(devbox, AsyncBinaryAPIResponse) + @pytest.mark.skip(reason="prism can't support octet") @parametrize @pytest.mark.respx(base_url=base_url) async def test_raw_response_download_file(self, async_client: AsyncRunloop, respx_mock: MockRouter) -> None: @@ -811,6 +817,7 @@ async def test_raw_response_download_file(self, async_client: AsyncRunloop, resp assert await devbox.json() == {"foo": "bar"} assert isinstance(devbox, AsyncBinaryAPIResponse) + @pytest.mark.skip(reason="prism can't support octet") @parametrize @pytest.mark.respx(base_url=base_url) async def test_streaming_response_download_file(self, async_client: AsyncRunloop, respx_mock: MockRouter) -> None: @@ -828,6 +835,7 @@ async def test_streaming_response_download_file(self, async_client: AsyncRunloop assert cast(Any, devbox.is_closed) is True + @pytest.mark.skip(reason="prism can't support octet") @parametrize @pytest.mark.respx(base_url=base_url) async def test_path_params_download_file(self, async_client: AsyncRunloop) -> None: From 3ddce86926280e38df30b8915bb06debacb1de1d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 22:28:17 +0000 Subject: [PATCH 183/993] feat(api): api update (#190) --- .release-please-manifest.json | 2 +- .stats.yml | 2 +- README.md | 2 +- api.md | 6 ++++- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- .../resources/blueprints.py | 9 ++++--- .../resources/devboxes/devboxes.py | 5 ++-- src/runloop_api_client/types/__init__.py | 1 + .../types/blueprint_build_parameters.py | 20 +++------------ .../types/blueprint_create_params.py | 20 +++------------ .../types/blueprint_preview_params.py | 20 +++------------ .../types/devbox_create_params.py | 20 +++------------ src/runloop_api_client/types/devbox_view.py | 22 +++------------- .../types/shared/__init__.py | 1 + .../types/shared/lauch_parameters.py | 22 ++++++++++++++++ .../types/shared_params/__init__.py | 3 +++ .../types/shared_params/lauch_parameters.py | 25 +++++++++++++++++++ 18 files changed, 86 insertions(+), 98 deletions(-) create mode 100644 src/runloop_api_client/types/shared/lauch_parameters.py create mode 100644 src/runloop_api_client/types/shared_params/__init__.py create mode 100644 src/runloop_api_client/types/shared_params/lauch_parameters.py diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1c0bb8852..10f309169 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.23" + ".": "0.2.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index d9a0a6044..40d23e1b2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 28 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d5b31b4bbf540f07391766a9217f0dc872e3c9015dc2282b7b346f6594acbe0c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1b1dd59a8326d972ab26f979561252cda4bcaeeb0cc7eb1ab2b8fe2522f90ec0.yml diff --git a/README.md b/README.md index 3c8dbdbd0..16c2947ae 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ The REST API documentation can be found on [runloop.ai](https://runloop.ai). The ```sh # install from PyPI -pip install --pre runloop_api_client +pip install runloop_api_client ``` ## Usage diff --git a/api.md b/api.md index f9ca5e509..0ddfd9895 100644 --- a/api.md +++ b/api.md @@ -1,7 +1,11 @@ # Shared Types ```python -from runloop_api_client.types import FunctionInvocationExecutionDetailView, ProjectLogsView +from runloop_api_client.types import ( + FunctionInvocationExecutionDetailView, + LauchParameters, + ProjectLogsView, +) ``` # Account diff --git a/pyproject.toml b/pyproject.toml index 148978741..4077fc8eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.1.0-alpha.23" +version = "0.2.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 7bd91e9f3..7e03c3115 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.1.0-alpha.23" # x-release-please-version +__version__ = "0.2.0" # x-release-please-version diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index f4405b773..c702f3861 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -26,6 +26,7 @@ from ..types.blueprint_preview_view import BlueprintPreviewView from ..types.code_mount_parameters_param import CodeMountParametersParam from ..types.blueprint_build_logs_list_view import BlueprintBuildLogsListView +from ..types.shared_params.lauch_parameters import LauchParameters __all__ = ["BlueprintsResource", "AsyncBlueprintsResource"] @@ -57,7 +58,7 @@ def create( code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: blueprint_create_params.LaunchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -237,7 +238,7 @@ def preview( code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: blueprint_preview_params.LaunchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -319,7 +320,7 @@ async def create( code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: blueprint_create_params.LaunchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -499,7 +500,7 @@ async def preview( code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: blueprint_preview_params.LaunchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index df85bf094..dd7a4d3b1 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -63,6 +63,7 @@ from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse from ...types.devbox_disk_snapshots_response import DevboxDiskSnapshotsResponse +from ...types.shared_params.lauch_parameters import LauchParameters from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView __all__ = ["DevboxesResource", "AsyncDevboxesResource"] @@ -105,7 +106,7 @@ def create( entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: devbox_create_params.LaunchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, prebuilt: str | NotGiven = NOT_GIVEN, @@ -688,7 +689,7 @@ async def create( entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: devbox_create_params.LaunchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, prebuilt: str | NotGiven = NOT_GIVEN, diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 1b6c191cd..00d698ab8 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -3,6 +3,7 @@ from __future__ import annotations from .shared import ( + LauchParameters as LauchParameters, ProjectLogsView as ProjectLogsView, FunctionInvocationExecutionDetailView as FunctionInvocationExecutionDetailView, ) diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index 57d16c93c..b27ed818f 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -3,24 +3,10 @@ from typing import Dict, List, Optional from .._models import BaseModel -from .resource_size import ResourceSize from .code_mount_parameters import CodeMountParameters +from .shared.lauch_parameters import LauchParameters -__all__ = ["BlueprintBuildParameters", "LaunchParameters"] - - -class LaunchParameters(BaseModel): - keep_alive_time_seconds: Optional[int] = None - """Time in seconds after which Devbox will automatically shutdown. - - Default is 1 hour. - """ - - launch_commands: Optional[List[str]] = None - """Set of commands to be run at launch time, before the entrypoint process is run.""" - - resource_size_request: Optional[ResourceSize] = None - """Manual resource configuration for Devbox. If not set, defaults will be used.""" +__all__ = ["BlueprintBuildParameters"] class BlueprintBuildParameters(BaseModel): @@ -36,7 +22,7 @@ class BlueprintBuildParameters(BaseModel): file_mounts: Optional[Dict[str, str]] = None """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: Optional[LaunchParameters] = None + launch_parameters: Optional[LauchParameters] = None """Parameters to configure your Devbox at launch time.""" system_setup_commands: Optional[List[str]] = None diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index 742befdbb..6507bd147 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -5,10 +5,10 @@ from typing import Dict, List, Iterable from typing_extensions import Required, TypedDict -from .resource_size import ResourceSize from .code_mount_parameters_param import CodeMountParametersParam +from .shared_params.lauch_parameters import LauchParameters -__all__ = ["BlueprintCreateParams", "LaunchParameters"] +__all__ = ["BlueprintCreateParams"] class BlueprintCreateParams(TypedDict, total=False): @@ -24,22 +24,8 @@ class BlueprintCreateParams(TypedDict, total=False): file_mounts: Dict[str, str] """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: LaunchParameters + launch_parameters: LauchParameters """Parameters to configure your Devbox at launch time.""" system_setup_commands: List[str] """A list of commands to run to set up your system.""" - - -class LaunchParameters(TypedDict, total=False): - keep_alive_time_seconds: int - """Time in seconds after which Devbox will automatically shutdown. - - Default is 1 hour. - """ - - launch_commands: List[str] - """Set of commands to be run at launch time, before the entrypoint process is run.""" - - resource_size_request: ResourceSize - """Manual resource configuration for Devbox. If not set, defaults will be used.""" diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index eba4d0b20..5415988c5 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -5,10 +5,10 @@ from typing import Dict, List, Iterable from typing_extensions import Required, TypedDict -from .resource_size import ResourceSize from .code_mount_parameters_param import CodeMountParametersParam +from .shared_params.lauch_parameters import LauchParameters -__all__ = ["BlueprintPreviewParams", "LaunchParameters"] +__all__ = ["BlueprintPreviewParams"] class BlueprintPreviewParams(TypedDict, total=False): @@ -24,22 +24,8 @@ class BlueprintPreviewParams(TypedDict, total=False): file_mounts: Dict[str, str] """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: LaunchParameters + launch_parameters: LauchParameters """Parameters to configure your Devbox at launch time.""" system_setup_commands: List[str] """A list of commands to run to set up your system.""" - - -class LaunchParameters(TypedDict, total=False): - keep_alive_time_seconds: int - """Time in seconds after which Devbox will automatically shutdown. - - Default is 1 hour. - """ - - launch_commands: List[str] - """Set of commands to be run at launch time, before the entrypoint process is run.""" - - resource_size_request: ResourceSize - """Manual resource configuration for Devbox. If not set, defaults will be used.""" diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 5f8455746..01fbd811d 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -5,10 +5,10 @@ from typing import Dict, List, Iterable from typing_extensions import TypedDict -from .resource_size import ResourceSize from .code_mount_parameters_param import CodeMountParametersParam +from .shared_params.lauch_parameters import LauchParameters -__all__ = ["DevboxCreateParams", "LaunchParameters"] +__all__ = ["DevboxCreateParams"] class DevboxCreateParams(TypedDict, total=False): @@ -41,7 +41,7 @@ class DevboxCreateParams(TypedDict, total=False): file_mounts: Dict[str, str] """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: LaunchParameters + launch_parameters: LauchParameters """Parameters to configure the resources and launch time behavior of the Devbox.""" metadata: Dict[str, str] @@ -62,17 +62,3 @@ class DevboxCreateParams(TypedDict, total=False): snapshot_id: str """Snapshot ID to use for the Devbox.""" - - -class LaunchParameters(TypedDict, total=False): - keep_alive_time_seconds: int - """Time in seconds after which Devbox will automatically shutdown. - - Default is 1 hour. - """ - - launch_commands: List[str] - """Set of commands to be run at launch time, before the entrypoint process is run.""" - - resource_size_request: ResourceSize - """Manual resource configuration for Devbox. If not set, defaults will be used.""" diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index ce50abebf..d24734202 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -1,26 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional +from typing import Dict, Optional from typing_extensions import Literal from .._models import BaseModel -from .resource_size import ResourceSize +from .shared.lauch_parameters import LauchParameters -__all__ = ["DevboxView", "LaunchParameters"] - - -class LaunchParameters(BaseModel): - keep_alive_time_seconds: Optional[int] = None - """Time in seconds after which Devbox will automatically shutdown. - - Default is 1 hour. - """ - - launch_commands: Optional[List[str]] = None - """Set of commands to be run at launch time, before the entrypoint process is run.""" - - resource_size_request: Optional[ResourceSize] = None - """Manual resource configuration for Devbox. If not set, defaults will be used.""" +__all__ = ["DevboxView"] class DevboxView(BaseModel): @@ -36,7 +22,7 @@ class DevboxView(BaseModel): initiator_type: Literal["unknown", "api", "invocation"] """The initiator of the devbox.""" - launch_parameters: LaunchParameters + launch_parameters: LauchParameters """The launch parameters used to create the Devbox.""" metadata: Dict[str, str] diff --git a/src/runloop_api_client/types/shared/__init__.py b/src/runloop_api_client/types/shared/__init__.py index e7ddc6d87..7bd350b35 100644 --- a/src/runloop_api_client/types/shared/__init__.py +++ b/src/runloop_api_client/types/shared/__init__.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lauch_parameters import LauchParameters as LauchParameters from .project_logs_view import ProjectLogsView as ProjectLogsView from .function_invocation_execution_detail_view import ( FunctionInvocationExecutionDetailView as FunctionInvocationExecutionDetailView, diff --git a/src/runloop_api_client/types/shared/lauch_parameters.py b/src/runloop_api_client/types/shared/lauch_parameters.py new file mode 100644 index 000000000..bc0ae8f25 --- /dev/null +++ b/src/runloop_api_client/types/shared/lauch_parameters.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel +from ..resource_size import ResourceSize + +__all__ = ["LauchParameters"] + + +class LauchParameters(BaseModel): + keep_alive_time_seconds: Optional[int] = None + """Time in seconds after which Devbox will automatically shutdown. + + Default is 1 hour. + """ + + launch_commands: Optional[List[str]] = None + """Set of commands to be run at launch time, before the entrypoint process is run.""" + + resource_size_request: Optional[ResourceSize] = None + """Manual resource configuration for Devbox. If not set, defaults will be used.""" diff --git a/src/runloop_api_client/types/shared_params/__init__.py b/src/runloop_api_client/types/shared_params/__init__.py new file mode 100644 index 000000000..d8a6bca13 --- /dev/null +++ b/src/runloop_api_client/types/shared_params/__init__.py @@ -0,0 +1,3 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .lauch_parameters import LauchParameters as LauchParameters diff --git a/src/runloop_api_client/types/shared_params/lauch_parameters.py b/src/runloop_api_client/types/shared_params/lauch_parameters.py new file mode 100644 index 000000000..371f1b652 --- /dev/null +++ b/src/runloop_api_client/types/shared_params/lauch_parameters.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import TypedDict + +from .resource_size import ResourceSize +from ..resource_size import ResourceSize + +__all__ = ["LauchParameters"] + + +class LauchParameters(TypedDict, total=False): + keep_alive_time_seconds: int + """Time in seconds after which Devbox will automatically shutdown. + + Default is 1 hour. + """ + + launch_commands: List[str] + """Set of commands to be run at launch time, before the entrypoint process is run.""" + + resource_size_request: ResourceSize + """Manual resource configuration for Devbox. If not set, defaults will be used.""" From af7c3e988947b910af1cdb30a1391083af10cf7d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 23:17:38 +0000 Subject: [PATCH 184/993] feat(api): api update (#192) --- .stats.yml | 2 +- api.md | 5 ++-- .../resources/devboxes/devboxes.py | 10 ++++---- src/runloop_api_client/types/__init__.py | 3 ++- .../types/devbox_snapshot_list_view.py | 17 ++++++++++++++ .../types/devbox_snapshot_view.py | 23 +++++++++++++++++++ tests/api_resources/test_devboxes.py | 18 +++++++-------- 7 files changed, 60 insertions(+), 18 deletions(-) create mode 100644 src/runloop_api_client/types/devbox_snapshot_list_view.py create mode 100644 src/runloop_api_client/types/devbox_snapshot_view.py diff --git a/.stats.yml b/.stats.yml index 40d23e1b2..7aec8c676 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 28 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1b1dd59a8326d972ab26f979561252cda4bcaeeb0cc7eb1ab2b8fe2522f90ec0.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1f5b6bcd6819f627874dddd0d1101d4865944a1321f30fccacbb14355298bbfa.yml diff --git a/api.md b/api.md index 0ddfd9895..17bff4c64 100644 --- a/api.md +++ b/api.md @@ -56,9 +56,10 @@ from runloop_api_client.types import ( DevboxAsyncExecutionDetailView, DevboxExecutionDetailView, DevboxListView, + DevboxSnapshotListView, + DevboxSnapshotView, DevboxView, DevboxCreateSSHKeyResponse, - DevboxDiskSnapshotsResponse, DevboxReadFileContentsResponse, DevboxUploadFileResponse, ) @@ -70,7 +71,7 @@ Methods: - client.devboxes.retrieve(id) -> DevboxView - client.devboxes.list(\*\*params) -> DevboxListView - client.devboxes.create_ssh_key(id) -> DevboxCreateSSHKeyResponse -- client.devboxes.disk_snapshots(\*\*params) -> DevboxDiskSnapshotsResponse +- client.devboxes.disk_snapshots(\*\*params) -> DevboxSnapshotListView - client.devboxes.download_file(id, \*\*params) -> BinaryAPIResponse - client.devboxes.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index dd7a4d3b1..334b5657a 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -59,10 +59,10 @@ from ..._base_client import make_request_options from ...types.devbox_view import DevboxView from ...types.devbox_list_view import DevboxListView +from ...types.devbox_snapshot_list_view import DevboxSnapshotListView from ...types.code_mount_parameters_param import CodeMountParametersParam from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse -from ...types.devbox_disk_snapshots_response import DevboxDiskSnapshotsResponse from ...types.shared_params.lauch_parameters import LauchParameters from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView @@ -318,7 +318,7 @@ def disk_snapshots( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxDiskSnapshotsResponse: + ) -> DevboxSnapshotListView: """ List all snapshots of a devbox by id. @@ -350,7 +350,7 @@ def disk_snapshots( devbox_disk_snapshots_params.DevboxDiskSnapshotsParams, ), ), - cast_to=DevboxDiskSnapshotsResponse, + cast_to=DevboxSnapshotListView, ) def download_file( @@ -901,7 +901,7 @@ async def disk_snapshots( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxDiskSnapshotsResponse: + ) -> DevboxSnapshotListView: """ List all snapshots of a devbox by id. @@ -933,7 +933,7 @@ async def disk_snapshots( devbox_disk_snapshots_params.DevboxDiskSnapshotsParams, ), ), - cast_to=DevboxDiskSnapshotsResponse, + cast_to=DevboxSnapshotListView, ) async def download_file( diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 00d698ab8..b4f75f0e9 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -17,12 +17,14 @@ from .blueprint_build_log import BlueprintBuildLog as BlueprintBuildLog from .blueprint_list_view import BlueprintListView as BlueprintListView from .devbox_create_params import DevboxCreateParams as DevboxCreateParams +from .devbox_snapshot_view import DevboxSnapshotView as DevboxSnapshotView from .blueprint_list_params import BlueprintListParams as BlueprintListParams from .code_mount_parameters import CodeMountParameters as CodeMountParameters from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams from .devbox_write_file_params import DevboxWriteFileParams as DevboxWriteFileParams +from .devbox_snapshot_list_view import DevboxSnapshotListView as DevboxSnapshotListView from .devbox_upload_file_params import DevboxUploadFileParams as DevboxUploadFileParams from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams @@ -35,7 +37,6 @@ from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams from .blueprint_build_logs_list_view import BlueprintBuildLogsListView as BlueprintBuildLogsListView from .devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse as DevboxCreateSSHKeyResponse -from .devbox_disk_snapshots_response import DevboxDiskSnapshotsResponse as DevboxDiskSnapshotsResponse from .devbox_read_file_contents_params import DevboxReadFileContentsParams as DevboxReadFileContentsParams from .devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView as DevboxAsyncExecutionDetailView from .devbox_read_file_contents_response import DevboxReadFileContentsResponse as DevboxReadFileContentsResponse diff --git a/src/runloop_api_client/types/devbox_snapshot_list_view.py b/src/runloop_api_client/types/devbox_snapshot_list_view.py new file mode 100644 index 000000000..6bb1eb530 --- /dev/null +++ b/src/runloop_api_client/types/devbox_snapshot_list_view.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .devbox_snapshot_view import DevboxSnapshotView + +__all__ = ["DevboxSnapshotListView"] + + +class DevboxSnapshotListView(BaseModel): + has_more: bool + + snapshots: List[DevboxSnapshotView] + """List of snapshots matching filter.""" + + total_count: int diff --git a/src/runloop_api_client/types/devbox_snapshot_view.py b/src/runloop_api_client/types/devbox_snapshot_view.py new file mode 100644 index 000000000..8e98726ee --- /dev/null +++ b/src/runloop_api_client/types/devbox_snapshot_view.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Optional + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["DevboxSnapshotView"] + + +class DevboxSnapshotView(BaseModel): + id: str + """The unique identifier of the snapshot.""" + + metadata: Dict[str, str] + """metadata associated with the snapshot.""" + + source_devbox_id: str = FieldInfo(alias="sourceDevboxId") + """The source devbox identifier.""" + + name: Optional[str] = None + """(Optional) The custom name of the snapshot.""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 2989ccb88..de56f1ea0 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -14,9 +14,9 @@ from runloop_api_client.types import ( DevboxView, DevboxListView, + DevboxSnapshotListView, DevboxExecutionDetailView, DevboxCreateSSHKeyResponse, - DevboxDiskSnapshotsResponse, DevboxAsyncExecutionDetailView, ) from runloop_api_client._response import ( @@ -211,7 +211,7 @@ def test_path_params_create_ssh_key(self, client: Runloop) -> None: @parametrize def test_method_disk_snapshots(self, client: Runloop) -> None: devbox = client.devboxes.disk_snapshots() - assert_matches_type(DevboxDiskSnapshotsResponse, devbox, path=["response"]) + assert_matches_type(DevboxSnapshotListView, devbox, path=["response"]) @parametrize def test_method_disk_snapshots_with_all_params(self, client: Runloop) -> None: @@ -219,7 +219,7 @@ def test_method_disk_snapshots_with_all_params(self, client: Runloop) -> None: limit=0, starting_after="starting_after", ) - assert_matches_type(DevboxDiskSnapshotsResponse, devbox, path=["response"]) + assert_matches_type(DevboxSnapshotListView, devbox, path=["response"]) @parametrize def test_raw_response_disk_snapshots(self, client: Runloop) -> None: @@ -228,7 +228,7 @@ def test_raw_response_disk_snapshots(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert_matches_type(DevboxDiskSnapshotsResponse, devbox, path=["response"]) + assert_matches_type(DevboxSnapshotListView, devbox, path=["response"]) @parametrize def test_streaming_response_disk_snapshots(self, client: Runloop) -> None: @@ -237,7 +237,7 @@ def test_streaming_response_disk_snapshots(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert_matches_type(DevboxDiskSnapshotsResponse, devbox, path=["response"]) + assert_matches_type(DevboxSnapshotListView, devbox, path=["response"]) assert cast(Any, response.is_closed) is True @@ -757,7 +757,7 @@ async def test_path_params_create_ssh_key(self, async_client: AsyncRunloop) -> N @parametrize async def test_method_disk_snapshots(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.disk_snapshots() - assert_matches_type(DevboxDiskSnapshotsResponse, devbox, path=["response"]) + assert_matches_type(DevboxSnapshotListView, devbox, path=["response"]) @parametrize async def test_method_disk_snapshots_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -765,7 +765,7 @@ async def test_method_disk_snapshots_with_all_params(self, async_client: AsyncRu limit=0, starting_after="starting_after", ) - assert_matches_type(DevboxDiskSnapshotsResponse, devbox, path=["response"]) + assert_matches_type(DevboxSnapshotListView, devbox, path=["response"]) @parametrize async def test_raw_response_disk_snapshots(self, async_client: AsyncRunloop) -> None: @@ -774,7 +774,7 @@ async def test_raw_response_disk_snapshots(self, async_client: AsyncRunloop) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert_matches_type(DevboxDiskSnapshotsResponse, devbox, path=["response"]) + assert_matches_type(DevboxSnapshotListView, devbox, path=["response"]) @parametrize async def test_streaming_response_disk_snapshots(self, async_client: AsyncRunloop) -> None: @@ -783,7 +783,7 @@ async def test_streaming_response_disk_snapshots(self, async_client: AsyncRunloo assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert_matches_type(DevboxDiskSnapshotsResponse, devbox, path=["response"]) + assert_matches_type(DevboxSnapshotListView, devbox, path=["response"]) assert cast(Any, response.is_closed) is True From 4e4b8d0707576aced6d3a0e77065cd3a4cf75d59 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 21:55:20 +0000 Subject: [PATCH 185/993] feat(api): api update (#193) --- api.md | 1 + src/runloop_api_client/types/__init__.py | 1 + src/runloop_api_client/types/shared/__init__.py | 1 + src/runloop_api_client/types/shared/resource_size.py | 7 +++++++ 4 files changed, 10 insertions(+) create mode 100644 src/runloop_api_client/types/shared/resource_size.py diff --git a/api.md b/api.md index 17bff4c64..8d3ee15f4 100644 --- a/api.md +++ b/api.md @@ -5,6 +5,7 @@ from runloop_api_client.types import ( FunctionInvocationExecutionDetailView, LauchParameters, ProjectLogsView, + ResourceSize, ) ``` diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index b4f75f0e9..8c7075f6e 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -3,6 +3,7 @@ from __future__ import annotations from .shared import ( + ResourceSize as ResourceSize, LauchParameters as LauchParameters, ProjectLogsView as ProjectLogsView, FunctionInvocationExecutionDetailView as FunctionInvocationExecutionDetailView, diff --git a/src/runloop_api_client/types/shared/__init__.py b/src/runloop_api_client/types/shared/__init__.py index 7bd350b35..4185c8851 100644 --- a/src/runloop_api_client/types/shared/__init__.py +++ b/src/runloop_api_client/types/shared/__init__.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .resource_size import ResourceSize as ResourceSize from .lauch_parameters import LauchParameters as LauchParameters from .project_logs_view import ProjectLogsView as ProjectLogsView from .function_invocation_execution_detail_view import ( diff --git a/src/runloop_api_client/types/shared/resource_size.py b/src/runloop_api_client/types/shared/resource_size.py new file mode 100644 index 000000000..956955c87 --- /dev/null +++ b/src/runloop_api_client/types/shared/resource_size.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["ResourceSize"] + +ResourceSize: TypeAlias = Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "CUSTOM_SIZE"] From 2d237789712a5b9f24871b985ca7d11ba78c438a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 21:56:51 +0000 Subject: [PATCH 186/993] feat(api): api update (#194) --- api.md | 1 - src/runloop_api_client/types/__init__.py | 1 - src/runloop_api_client/types/shared/__init__.py | 1 - 3 files changed, 3 deletions(-) diff --git a/api.md b/api.md index 8d3ee15f4..17bff4c64 100644 --- a/api.md +++ b/api.md @@ -5,7 +5,6 @@ from runloop_api_client.types import ( FunctionInvocationExecutionDetailView, LauchParameters, ProjectLogsView, - ResourceSize, ) ``` diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 8c7075f6e..b4f75f0e9 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -3,7 +3,6 @@ from __future__ import annotations from .shared import ( - ResourceSize as ResourceSize, LauchParameters as LauchParameters, ProjectLogsView as ProjectLogsView, FunctionInvocationExecutionDetailView as FunctionInvocationExecutionDetailView, diff --git a/src/runloop_api_client/types/shared/__init__.py b/src/runloop_api_client/types/shared/__init__.py index 4185c8851..7bd350b35 100644 --- a/src/runloop_api_client/types/shared/__init__.py +++ b/src/runloop_api_client/types/shared/__init__.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .resource_size import ResourceSize as ResourceSize from .lauch_parameters import LauchParameters as LauchParameters from .project_logs_view import ProjectLogsView as ProjectLogsView from .function_invocation_execution_detail_view import ( From 9f2e82e2d7ac8d93afe683356281d186b0ed43db Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 21:57:27 +0000 Subject: [PATCH 187/993] feat(api): api update (#195) --- .stats.yml | 2 +- api.md | 1 + .../resources/devboxes/devboxes.py | 109 +++++++++++++++++- src/runloop_api_client/types/__init__.py | 1 + .../types/devbox_snapshot_disk_params.py | 16 +++ tests/api_resources/test_devboxes.py | 94 +++++++++++++++ 6 files changed, 221 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/types/devbox_snapshot_disk_params.py diff --git a/.stats.yml b/.stats.yml index 7aec8c676..7da059bf3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 28 +configured_endpoints: 29 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1f5b6bcd6819f627874dddd0d1101d4865944a1321f30fccacbb14355298bbfa.yml diff --git a/api.md b/api.md index 17bff4c64..a7afcd3cd 100644 --- a/api.md +++ b/api.md @@ -77,6 +77,7 @@ Methods: - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.read_file_contents(id, \*\*params) -> str - client.devboxes.shutdown(id) -> DevboxView +- client.devboxes.snapshot_disk(id, \*\*params) -> None - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 334b5657a..0adfc8ed9 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -22,10 +22,11 @@ devbox_execute_sync_params, devbox_download_file_params, devbox_execute_async_params, + devbox_snapshot_disk_params, devbox_disk_snapshots_params, devbox_read_file_contents_params, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes +from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, FileTypes from ..._utils import ( extract_files, maybe_transform, @@ -557,6 +558,53 @@ def shutdown( cast_to=DevboxView, ) + def snapshot_disk( + self, + id: str, + *, + metadata: Dict[str, str] | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> None: + """ + Create a filesystem snapshot of a devbox with the specified name and metadata. + + Args: + metadata: (Optional) Metadata used to describe the snapshot + + name: (Optional) A user specified name to give the snapshot + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return self._post( + f"/v1/devboxes/{id}/snapshot_disk", + body=maybe_transform( + { + "metadata": metadata, + "name": name, + }, + devbox_snapshot_disk_params.DevboxSnapshotDiskParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + def upload_file( self, id: str, @@ -1140,6 +1188,53 @@ async def shutdown( cast_to=DevboxView, ) + async def snapshot_disk( + self, + id: str, + *, + metadata: Dict[str, str] | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> None: + """ + Create a filesystem snapshot of a devbox with the specified name and metadata. + + Args: + metadata: (Optional) Metadata used to describe the snapshot + + name: (Optional) A user specified name to give the snapshot + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return await self._post( + f"/v1/devboxes/{id}/snapshot_disk", + body=await async_maybe_transform( + { + "metadata": metadata, + "name": name, + }, + devbox_snapshot_disk_params.DevboxSnapshotDiskParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + async def upload_file( self, id: str, @@ -1270,6 +1365,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.shutdown = to_raw_response_wrapper( devboxes.shutdown, ) + self.snapshot_disk = to_raw_response_wrapper( + devboxes.snapshot_disk, + ) self.upload_file = to_raw_response_wrapper( devboxes.upload_file, ) @@ -1321,6 +1419,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.shutdown = async_to_raw_response_wrapper( devboxes.shutdown, ) + self.snapshot_disk = async_to_raw_response_wrapper( + devboxes.snapshot_disk, + ) self.upload_file = async_to_raw_response_wrapper( devboxes.upload_file, ) @@ -1372,6 +1473,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.shutdown = to_streamed_response_wrapper( devboxes.shutdown, ) + self.snapshot_disk = to_streamed_response_wrapper( + devboxes.snapshot_disk, + ) self.upload_file = to_streamed_response_wrapper( devboxes.upload_file, ) @@ -1423,6 +1527,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.shutdown = async_to_streamed_response_wrapper( devboxes.shutdown, ) + self.snapshot_disk = async_to_streamed_response_wrapper( + devboxes.snapshot_disk, + ) self.upload_file = async_to_streamed_response_wrapper( devboxes.upload_file, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index b4f75f0e9..f65daa2af 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -31,6 +31,7 @@ from .code_mount_parameters_param import CodeMountParametersParam as CodeMountParametersParam from .devbox_download_file_params import DevboxDownloadFileParams as DevboxDownloadFileParams from .devbox_execute_async_params import DevboxExecuteAsyncParams as DevboxExecuteAsyncParams +from .devbox_snapshot_disk_params import DevboxSnapshotDiskParams as DevboxSnapshotDiskParams from .function_invoke_sync_params import FunctionInvokeSyncParams as FunctionInvokeSyncParams from .devbox_disk_snapshots_params import DevboxDiskSnapshotsParams as DevboxDiskSnapshotsParams from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView diff --git a/src/runloop_api_client/types/devbox_snapshot_disk_params.py b/src/runloop_api_client/types/devbox_snapshot_disk_params.py new file mode 100644 index 000000000..ed30fa14d --- /dev/null +++ b/src/runloop_api_client/types/devbox_snapshot_disk_params.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict +from typing_extensions import TypedDict + +__all__ = ["DevboxSnapshotDiskParams"] + + +class DevboxSnapshotDiskParams(TypedDict, total=False): + metadata: Dict[str, str] + """(Optional) Metadata used to describe the snapshot""" + + name: str + """(Optional) A user specified name to give the snapshot""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index de56f1ea0..b938328f1 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -481,6 +481,53 @@ def test_path_params_shutdown(self, client: Runloop) -> None: "", ) + @parametrize + def test_method_snapshot_disk(self, client: Runloop) -> None: + devbox = client.devboxes.snapshot_disk( + id="id", + ) + assert devbox is None + + @parametrize + def test_method_snapshot_disk_with_all_params(self, client: Runloop) -> None: + devbox = client.devboxes.snapshot_disk( + id="id", + metadata={"foo": "string"}, + name="name", + ) + assert devbox is None + + @parametrize + def test_raw_response_snapshot_disk(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.snapshot_disk( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert devbox is None + + @parametrize + def test_streaming_response_snapshot_disk(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.snapshot_disk( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert devbox is None + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_snapshot_disk(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.snapshot_disk( + id="", + ) + @parametrize def test_method_upload_file(self, client: Runloop) -> None: devbox = client.devboxes.upload_file( @@ -1027,6 +1074,53 @@ async def test_path_params_shutdown(self, async_client: AsyncRunloop) -> None: "", ) + @parametrize + async def test_method_snapshot_disk(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.snapshot_disk( + id="id", + ) + assert devbox is None + + @parametrize + async def test_method_snapshot_disk_with_all_params(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.snapshot_disk( + id="id", + metadata={"foo": "string"}, + name="name", + ) + assert devbox is None + + @parametrize + async def test_raw_response_snapshot_disk(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.snapshot_disk( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert devbox is None + + @parametrize + async def test_streaming_response_snapshot_disk(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.snapshot_disk( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert devbox is None + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_snapshot_disk(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.snapshot_disk( + id="", + ) + @parametrize async def test_method_upload_file(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.upload_file( From ffc99b999b49d7515ddc6d90c2f4fe32f1de8b5c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 22:00:08 +0000 Subject: [PATCH 188/993] feat(api): api update (#196) --- api.md | 2 +- .../resources/blueprints.py | 10 ++++---- .../resources/devboxes/devboxes.py | 6 ++--- src/runloop_api_client/types/__init__.py | 2 +- .../types/blueprint_build_parameters.py | 4 +-- .../types/blueprint_create_params.py | 4 +-- .../types/blueprint_preview_params.py | 4 +-- .../types/devbox_create_params.py | 4 +-- src/runloop_api_client/types/devbox_view.py | 4 +-- .../types/shared/__init__.py | 2 +- .../types/shared/launch_parameters.py | 22 ++++++++++++++++ .../types/shared_params/__init__.py | 2 +- .../types/shared_params/launch_parameters.py | 25 +++++++++++++++++++ 13 files changed, 69 insertions(+), 22 deletions(-) create mode 100644 src/runloop_api_client/types/shared/launch_parameters.py create mode 100644 src/runloop_api_client/types/shared_params/launch_parameters.py diff --git a/api.md b/api.md index a7afcd3cd..27a3b6be7 100644 --- a/api.md +++ b/api.md @@ -3,7 +3,7 @@ ```python from runloop_api_client.types import ( FunctionInvocationExecutionDetailView, - LauchParameters, + LaunchParameters, ProjectLogsView, ) ``` diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index c702f3861..8acbd7631 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -26,7 +26,7 @@ from ..types.blueprint_preview_view import BlueprintPreviewView from ..types.code_mount_parameters_param import CodeMountParametersParam from ..types.blueprint_build_logs_list_view import BlueprintBuildLogsListView -from ..types.shared_params.lauch_parameters import LauchParameters +from ..types.shared_params.launch_parameters import LaunchParameters __all__ = ["BlueprintsResource", "AsyncBlueprintsResource"] @@ -58,7 +58,7 @@ def create( code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -238,7 +238,7 @@ def preview( code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -320,7 +320,7 @@ async def create( code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -500,7 +500,7 @@ async def preview( code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 0adfc8ed9..4c35bda9e 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -64,7 +64,7 @@ from ...types.code_mount_parameters_param import CodeMountParametersParam from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse -from ...types.shared_params.lauch_parameters import LauchParameters +from ...types.shared_params.launch_parameters import LaunchParameters from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView __all__ = ["DevboxesResource", "AsyncDevboxesResource"] @@ -107,7 +107,7 @@ def create( entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, prebuilt: str | NotGiven = NOT_GIVEN, @@ -737,7 +737,7 @@ async def create( entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, prebuilt: str | NotGiven = NOT_GIVEN, diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index f65daa2af..26fa0a444 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -3,8 +3,8 @@ from __future__ import annotations from .shared import ( - LauchParameters as LauchParameters, ProjectLogsView as ProjectLogsView, + LaunchParameters as LaunchParameters, FunctionInvocationExecutionDetailView as FunctionInvocationExecutionDetailView, ) from .devbox_view import DevboxView as DevboxView diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index b27ed818f..cbd1f4fab 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -4,7 +4,7 @@ from .._models import BaseModel from .code_mount_parameters import CodeMountParameters -from .shared.lauch_parameters import LauchParameters +from .shared.launch_parameters import LaunchParameters __all__ = ["BlueprintBuildParameters"] @@ -22,7 +22,7 @@ class BlueprintBuildParameters(BaseModel): file_mounts: Optional[Dict[str, str]] = None """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: Optional[LauchParameters] = None + launch_parameters: Optional[LaunchParameters] = None """Parameters to configure your Devbox at launch time.""" system_setup_commands: Optional[List[str]] = None diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index 6507bd147..f5468a881 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -6,7 +6,7 @@ from typing_extensions import Required, TypedDict from .code_mount_parameters_param import CodeMountParametersParam -from .shared_params.lauch_parameters import LauchParameters +from .shared_params.launch_parameters import LaunchParameters __all__ = ["BlueprintCreateParams"] @@ -24,7 +24,7 @@ class BlueprintCreateParams(TypedDict, total=False): file_mounts: Dict[str, str] """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: LauchParameters + launch_parameters: LaunchParameters """Parameters to configure your Devbox at launch time.""" system_setup_commands: List[str] diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index 5415988c5..5093e1549 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -6,7 +6,7 @@ from typing_extensions import Required, TypedDict from .code_mount_parameters_param import CodeMountParametersParam -from .shared_params.lauch_parameters import LauchParameters +from .shared_params.launch_parameters import LaunchParameters __all__ = ["BlueprintPreviewParams"] @@ -24,7 +24,7 @@ class BlueprintPreviewParams(TypedDict, total=False): file_mounts: Dict[str, str] """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: LauchParameters + launch_parameters: LaunchParameters """Parameters to configure your Devbox at launch time.""" system_setup_commands: List[str] diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 01fbd811d..092476a18 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -6,7 +6,7 @@ from typing_extensions import TypedDict from .code_mount_parameters_param import CodeMountParametersParam -from .shared_params.lauch_parameters import LauchParameters +from .shared_params.launch_parameters import LaunchParameters __all__ = ["DevboxCreateParams"] @@ -41,7 +41,7 @@ class DevboxCreateParams(TypedDict, total=False): file_mounts: Dict[str, str] """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: LauchParameters + launch_parameters: LaunchParameters """Parameters to configure the resources and launch time behavior of the Devbox.""" metadata: Dict[str, str] diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index d24734202..4831b5425 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -4,7 +4,7 @@ from typing_extensions import Literal from .._models import BaseModel -from .shared.lauch_parameters import LauchParameters +from .shared.launch_parameters import LaunchParameters __all__ = ["DevboxView"] @@ -22,7 +22,7 @@ class DevboxView(BaseModel): initiator_type: Literal["unknown", "api", "invocation"] """The initiator of the devbox.""" - launch_parameters: LauchParameters + launch_parameters: LaunchParameters """The launch parameters used to create the Devbox.""" metadata: Dict[str, str] diff --git a/src/runloop_api_client/types/shared/__init__.py b/src/runloop_api_client/types/shared/__init__.py index 7bd350b35..0c30deb6b 100644 --- a/src/runloop_api_client/types/shared/__init__.py +++ b/src/runloop_api_client/types/shared/__init__.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lauch_parameters import LauchParameters as LauchParameters +from .launch_parameters import LaunchParameters as LaunchParameters from .project_logs_view import ProjectLogsView as ProjectLogsView from .function_invocation_execution_detail_view import ( FunctionInvocationExecutionDetailView as FunctionInvocationExecutionDetailView, diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py new file mode 100644 index 000000000..99d2febb0 --- /dev/null +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel +from ..resource_size import ResourceSize + +__all__ = ["LaunchParameters"] + + +class LaunchParameters(BaseModel): + keep_alive_time_seconds: Optional[int] = None + """Time in seconds after which Devbox will automatically shutdown. + + Default is 1 hour. + """ + + launch_commands: Optional[List[str]] = None + """Set of commands to be run at launch time, before the entrypoint process is run.""" + + resource_size_request: Optional[ResourceSize] = None + """Manual resource configuration for Devbox. If not set, defaults will be used.""" diff --git a/src/runloop_api_client/types/shared_params/__init__.py b/src/runloop_api_client/types/shared_params/__init__.py index d8a6bca13..4e215e900 100644 --- a/src/runloop_api_client/types/shared_params/__init__.py +++ b/src/runloop_api_client/types/shared_params/__init__.py @@ -1,3 +1,3 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lauch_parameters import LauchParameters as LauchParameters +from .launch_parameters import LaunchParameters as LaunchParameters diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py new file mode 100644 index 000000000..46186b1e3 --- /dev/null +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import TypedDict + +from .resource_size import ResourceSize +from ..resource_size import ResourceSize + +__all__ = ["LaunchParameters"] + + +class LaunchParameters(TypedDict, total=False): + keep_alive_time_seconds: int + """Time in seconds after which Devbox will automatically shutdown. + + Default is 1 hour. + """ + + launch_commands: List[str] + """Set of commands to be run at launch time, before the entrypoint process is run.""" + + resource_size_request: ResourceSize + """Manual resource configuration for Devbox. If not set, defaults will be used.""" From 895448052ede836bb6414d615342cae14c8cbb0d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 22:01:43 +0000 Subject: [PATCH 189/993] feat(api): api update (#197) --- .stats.yml | 2 +- api.md | 2 +- src/runloop_api_client/resources/blueprints.py | 10 +++++----- src/runloop_api_client/resources/devboxes/devboxes.py | 6 +++--- src/runloop_api_client/types/__init__.py | 2 +- .../types/blueprint_build_parameters.py | 4 ++-- .../types/blueprint_create_params.py | 4 ++-- .../types/blueprint_preview_params.py | 4 ++-- src/runloop_api_client/types/devbox_create_params.py | 4 ++-- src/runloop_api_client/types/devbox_view.py | 4 ++-- src/runloop_api_client/types/shared/__init__.py | 2 +- src/runloop_api_client/types/shared_params/__init__.py | 2 +- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7da059bf3..87416d7da 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1f5b6bcd6819f627874dddd0d1101d4865944a1321f30fccacbb14355298bbfa.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-9637e8217fe437592df1d3e503321093cd72be915633e35aada927c3336148da.yml diff --git a/api.md b/api.md index 27a3b6be7..a7afcd3cd 100644 --- a/api.md +++ b/api.md @@ -3,7 +3,7 @@ ```python from runloop_api_client.types import ( FunctionInvocationExecutionDetailView, - LaunchParameters, + LauchParameters, ProjectLogsView, ) ``` diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index 8acbd7631..c702f3861 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -26,7 +26,7 @@ from ..types.blueprint_preview_view import BlueprintPreviewView from ..types.code_mount_parameters_param import CodeMountParametersParam from ..types.blueprint_build_logs_list_view import BlueprintBuildLogsListView -from ..types.shared_params.launch_parameters import LaunchParameters +from ..types.shared_params.lauch_parameters import LauchParameters __all__ = ["BlueprintsResource", "AsyncBlueprintsResource"] @@ -58,7 +58,7 @@ def create( code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -238,7 +238,7 @@ def preview( code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -320,7 +320,7 @@ async def create( code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -500,7 +500,7 @@ async def preview( code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4c35bda9e..0adfc8ed9 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -64,7 +64,7 @@ from ...types.code_mount_parameters_param import CodeMountParametersParam from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse -from ...types.shared_params.launch_parameters import LaunchParameters +from ...types.shared_params.lauch_parameters import LauchParameters from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView __all__ = ["DevboxesResource", "AsyncDevboxesResource"] @@ -107,7 +107,7 @@ def create( entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, prebuilt: str | NotGiven = NOT_GIVEN, @@ -737,7 +737,7 @@ async def create( entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, prebuilt: str | NotGiven = NOT_GIVEN, diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 26fa0a444..f65daa2af 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -3,8 +3,8 @@ from __future__ import annotations from .shared import ( + LauchParameters as LauchParameters, ProjectLogsView as ProjectLogsView, - LaunchParameters as LaunchParameters, FunctionInvocationExecutionDetailView as FunctionInvocationExecutionDetailView, ) from .devbox_view import DevboxView as DevboxView diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index cbd1f4fab..b27ed818f 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -4,7 +4,7 @@ from .._models import BaseModel from .code_mount_parameters import CodeMountParameters -from .shared.launch_parameters import LaunchParameters +from .shared.lauch_parameters import LauchParameters __all__ = ["BlueprintBuildParameters"] @@ -22,7 +22,7 @@ class BlueprintBuildParameters(BaseModel): file_mounts: Optional[Dict[str, str]] = None """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: Optional[LaunchParameters] = None + launch_parameters: Optional[LauchParameters] = None """Parameters to configure your Devbox at launch time.""" system_setup_commands: Optional[List[str]] = None diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index f5468a881..6507bd147 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -6,7 +6,7 @@ from typing_extensions import Required, TypedDict from .code_mount_parameters_param import CodeMountParametersParam -from .shared_params.launch_parameters import LaunchParameters +from .shared_params.lauch_parameters import LauchParameters __all__ = ["BlueprintCreateParams"] @@ -24,7 +24,7 @@ class BlueprintCreateParams(TypedDict, total=False): file_mounts: Dict[str, str] """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: LaunchParameters + launch_parameters: LauchParameters """Parameters to configure your Devbox at launch time.""" system_setup_commands: List[str] diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index 5093e1549..5415988c5 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -6,7 +6,7 @@ from typing_extensions import Required, TypedDict from .code_mount_parameters_param import CodeMountParametersParam -from .shared_params.launch_parameters import LaunchParameters +from .shared_params.lauch_parameters import LauchParameters __all__ = ["BlueprintPreviewParams"] @@ -24,7 +24,7 @@ class BlueprintPreviewParams(TypedDict, total=False): file_mounts: Dict[str, str] """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: LaunchParameters + launch_parameters: LauchParameters """Parameters to configure your Devbox at launch time.""" system_setup_commands: List[str] diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 092476a18..01fbd811d 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -6,7 +6,7 @@ from typing_extensions import TypedDict from .code_mount_parameters_param import CodeMountParametersParam -from .shared_params.launch_parameters import LaunchParameters +from .shared_params.lauch_parameters import LauchParameters __all__ = ["DevboxCreateParams"] @@ -41,7 +41,7 @@ class DevboxCreateParams(TypedDict, total=False): file_mounts: Dict[str, str] """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: LaunchParameters + launch_parameters: LauchParameters """Parameters to configure the resources and launch time behavior of the Devbox.""" metadata: Dict[str, str] diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 4831b5425..d24734202 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -4,7 +4,7 @@ from typing_extensions import Literal from .._models import BaseModel -from .shared.launch_parameters import LaunchParameters +from .shared.lauch_parameters import LauchParameters __all__ = ["DevboxView"] @@ -22,7 +22,7 @@ class DevboxView(BaseModel): initiator_type: Literal["unknown", "api", "invocation"] """The initiator of the devbox.""" - launch_parameters: LaunchParameters + launch_parameters: LauchParameters """The launch parameters used to create the Devbox.""" metadata: Dict[str, str] diff --git a/src/runloop_api_client/types/shared/__init__.py b/src/runloop_api_client/types/shared/__init__.py index 0c30deb6b..7bd350b35 100644 --- a/src/runloop_api_client/types/shared/__init__.py +++ b/src/runloop_api_client/types/shared/__init__.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .launch_parameters import LaunchParameters as LaunchParameters +from .lauch_parameters import LauchParameters as LauchParameters from .project_logs_view import ProjectLogsView as ProjectLogsView from .function_invocation_execution_detail_view import ( FunctionInvocationExecutionDetailView as FunctionInvocationExecutionDetailView, diff --git a/src/runloop_api_client/types/shared_params/__init__.py b/src/runloop_api_client/types/shared_params/__init__.py index 4e215e900..d8a6bca13 100644 --- a/src/runloop_api_client/types/shared_params/__init__.py +++ b/src/runloop_api_client/types/shared_params/__init__.py @@ -1,3 +1,3 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .launch_parameters import LaunchParameters as LaunchParameters +from .lauch_parameters import LauchParameters as LauchParameters From 38368946b23d48c8a994428852c8c7e5ad9e406f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 22:03:55 +0000 Subject: [PATCH 190/993] feat(api): api update (#198) --- api.md | 12 ++---------- src/runloop_api_client/resources/blueprints.py | 10 +++++----- .../resources/devboxes/devboxes.py | 6 +++--- src/runloop_api_client/types/__init__.py | 2 +- .../types/blueprint_build_parameters.py | 4 ++-- .../types/blueprint_create_params.py | 4 ++-- .../types/blueprint_preview_params.py | 4 ++-- src/runloop_api_client/types/devbox_create_params.py | 4 ++-- src/runloop_api_client/types/devbox_view.py | 4 ++-- src/runloop_api_client/types/shared/__init__.py | 2 +- .../types/shared_params/__init__.py | 2 +- 11 files changed, 23 insertions(+), 31 deletions(-) diff --git a/api.md b/api.md index a7afcd3cd..451df80cc 100644 --- a/api.md +++ b/api.md @@ -3,19 +3,11 @@ ```python from runloop_api_client.types import ( FunctionInvocationExecutionDetailView, - LauchParameters, + LaunchParameters, ProjectLogsView, ) ``` -# Account - -Types: - -```python -from runloop_api_client.types import ResourceSize -``` - # Blueprints Types: @@ -107,7 +99,7 @@ Methods: Types: ```python -from runloop_api_client.types import FunctionListView +from runloop_api_client.types import FunctionListView, ResourceSize ``` Methods: diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index c702f3861..8acbd7631 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -26,7 +26,7 @@ from ..types.blueprint_preview_view import BlueprintPreviewView from ..types.code_mount_parameters_param import CodeMountParametersParam from ..types.blueprint_build_logs_list_view import BlueprintBuildLogsListView -from ..types.shared_params.lauch_parameters import LauchParameters +from ..types.shared_params.launch_parameters import LaunchParameters __all__ = ["BlueprintsResource", "AsyncBlueprintsResource"] @@ -58,7 +58,7 @@ def create( code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -238,7 +238,7 @@ def preview( code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -320,7 +320,7 @@ async def create( code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -500,7 +500,7 @@ async def preview( code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, dockerfile: str | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, system_setup_commands: List[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 0adfc8ed9..4c35bda9e 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -64,7 +64,7 @@ from ...types.code_mount_parameters_param import CodeMountParametersParam from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse -from ...types.shared_params.lauch_parameters import LauchParameters +from ...types.shared_params.launch_parameters import LaunchParameters from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView __all__ = ["DevboxesResource", "AsyncDevboxesResource"] @@ -107,7 +107,7 @@ def create( entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, prebuilt: str | NotGiven = NOT_GIVEN, @@ -737,7 +737,7 @@ async def create( entrypoint: str | NotGiven = NOT_GIVEN, environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LauchParameters | NotGiven = NOT_GIVEN, + launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, prebuilt: str | NotGiven = NOT_GIVEN, diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index f65daa2af..26fa0a444 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -3,8 +3,8 @@ from __future__ import annotations from .shared import ( - LauchParameters as LauchParameters, ProjectLogsView as ProjectLogsView, + LaunchParameters as LaunchParameters, FunctionInvocationExecutionDetailView as FunctionInvocationExecutionDetailView, ) from .devbox_view import DevboxView as DevboxView diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index b27ed818f..cbd1f4fab 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -4,7 +4,7 @@ from .._models import BaseModel from .code_mount_parameters import CodeMountParameters -from .shared.lauch_parameters import LauchParameters +from .shared.launch_parameters import LaunchParameters __all__ = ["BlueprintBuildParameters"] @@ -22,7 +22,7 @@ class BlueprintBuildParameters(BaseModel): file_mounts: Optional[Dict[str, str]] = None """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: Optional[LauchParameters] = None + launch_parameters: Optional[LaunchParameters] = None """Parameters to configure your Devbox at launch time.""" system_setup_commands: Optional[List[str]] = None diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index 6507bd147..f5468a881 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -6,7 +6,7 @@ from typing_extensions import Required, TypedDict from .code_mount_parameters_param import CodeMountParametersParam -from .shared_params.lauch_parameters import LauchParameters +from .shared_params.launch_parameters import LaunchParameters __all__ = ["BlueprintCreateParams"] @@ -24,7 +24,7 @@ class BlueprintCreateParams(TypedDict, total=False): file_mounts: Dict[str, str] """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: LauchParameters + launch_parameters: LaunchParameters """Parameters to configure your Devbox at launch time.""" system_setup_commands: List[str] diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index 5415988c5..5093e1549 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -6,7 +6,7 @@ from typing_extensions import Required, TypedDict from .code_mount_parameters_param import CodeMountParametersParam -from .shared_params.lauch_parameters import LauchParameters +from .shared_params.launch_parameters import LaunchParameters __all__ = ["BlueprintPreviewParams"] @@ -24,7 +24,7 @@ class BlueprintPreviewParams(TypedDict, total=False): file_mounts: Dict[str, str] """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: LauchParameters + launch_parameters: LaunchParameters """Parameters to configure your Devbox at launch time.""" system_setup_commands: List[str] diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 01fbd811d..092476a18 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -6,7 +6,7 @@ from typing_extensions import TypedDict from .code_mount_parameters_param import CodeMountParametersParam -from .shared_params.lauch_parameters import LauchParameters +from .shared_params.launch_parameters import LaunchParameters __all__ = ["DevboxCreateParams"] @@ -41,7 +41,7 @@ class DevboxCreateParams(TypedDict, total=False): file_mounts: Dict[str, str] """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: LauchParameters + launch_parameters: LaunchParameters """Parameters to configure the resources and launch time behavior of the Devbox.""" metadata: Dict[str, str] diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index d24734202..4831b5425 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -4,7 +4,7 @@ from typing_extensions import Literal from .._models import BaseModel -from .shared.lauch_parameters import LauchParameters +from .shared.launch_parameters import LaunchParameters __all__ = ["DevboxView"] @@ -22,7 +22,7 @@ class DevboxView(BaseModel): initiator_type: Literal["unknown", "api", "invocation"] """The initiator of the devbox.""" - launch_parameters: LauchParameters + launch_parameters: LaunchParameters """The launch parameters used to create the Devbox.""" metadata: Dict[str, str] diff --git a/src/runloop_api_client/types/shared/__init__.py b/src/runloop_api_client/types/shared/__init__.py index 7bd350b35..0c30deb6b 100644 --- a/src/runloop_api_client/types/shared/__init__.py +++ b/src/runloop_api_client/types/shared/__init__.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lauch_parameters import LauchParameters as LauchParameters +from .launch_parameters import LaunchParameters as LaunchParameters from .project_logs_view import ProjectLogsView as ProjectLogsView from .function_invocation_execution_detail_view import ( FunctionInvocationExecutionDetailView as FunctionInvocationExecutionDetailView, diff --git a/src/runloop_api_client/types/shared_params/__init__.py b/src/runloop_api_client/types/shared_params/__init__.py index d8a6bca13..4e215e900 100644 --- a/src/runloop_api_client/types/shared_params/__init__.py +++ b/src/runloop_api_client/types/shared_params/__init__.py @@ -1,3 +1,3 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lauch_parameters import LauchParameters as LauchParameters +from .launch_parameters import LaunchParameters as LaunchParameters From 4b84f7e388af9d8c0a3d92f76194a876cb4d0c38 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 22:10:50 +0000 Subject: [PATCH 191/993] feat(api): api update (#199) --- api.md | 1 + src/runloop_api_client/types/__init__.py | 1 + src/runloop_api_client/types/shared/__init__.py | 1 + 3 files changed, 3 insertions(+) diff --git a/api.md b/api.md index 451df80cc..c284481e4 100644 --- a/api.md +++ b/api.md @@ -5,6 +5,7 @@ from runloop_api_client.types import ( FunctionInvocationExecutionDetailView, LaunchParameters, ProjectLogsView, + ResourceSize, ) ``` diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 26fa0a444..6c10ddb2a 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -3,6 +3,7 @@ from __future__ import annotations from .shared import ( + ResourceSize as ResourceSize, ProjectLogsView as ProjectLogsView, LaunchParameters as LaunchParameters, FunctionInvocationExecutionDetailView as FunctionInvocationExecutionDetailView, diff --git a/src/runloop_api_client/types/shared/__init__.py b/src/runloop_api_client/types/shared/__init__.py index 0c30deb6b..63af2b891 100644 --- a/src/runloop_api_client/types/shared/__init__.py +++ b/src/runloop_api_client/types/shared/__init__.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .resource_size import ResourceSize as ResourceSize from .launch_parameters import LaunchParameters as LaunchParameters from .project_logs_view import ProjectLogsView as ProjectLogsView from .function_invocation_execution_detail_view import ( From 51c53e116ad6213ffa2cb4edc9b42da3a4b8615e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 22:11:56 +0000 Subject: [PATCH 192/993] feat(api): api update (#200) --- api.md | 3 +-- src/runloop_api_client/types/__init__.py | 2 -- src/runloop_api_client/types/shared/__init__.py | 1 - src/runloop_api_client/types/shared/launch_parameters.py | 4 ++-- .../types/shared_params/launch_parameters.py | 7 ++----- 5 files changed, 5 insertions(+), 12 deletions(-) diff --git a/api.md b/api.md index c284481e4..7185c77d4 100644 --- a/api.md +++ b/api.md @@ -5,7 +5,6 @@ from runloop_api_client.types import ( FunctionInvocationExecutionDetailView, LaunchParameters, ProjectLogsView, - ResourceSize, ) ``` @@ -100,7 +99,7 @@ Methods: Types: ```python -from runloop_api_client.types import FunctionListView, ResourceSize +from runloop_api_client.types import FunctionListView ``` Methods: diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 6c10ddb2a..a5fe07214 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -3,13 +3,11 @@ from __future__ import annotations from .shared import ( - ResourceSize as ResourceSize, ProjectLogsView as ProjectLogsView, LaunchParameters as LaunchParameters, FunctionInvocationExecutionDetailView as FunctionInvocationExecutionDetailView, ) from .devbox_view import DevboxView as DevboxView -from .resource_size import ResourceSize as ResourceSize from .blueprint_view import BlueprintView as BlueprintView from .devbox_list_view import DevboxListView as DevboxListView from .project_list_view import ProjectListView as ProjectListView diff --git a/src/runloop_api_client/types/shared/__init__.py b/src/runloop_api_client/types/shared/__init__.py index 63af2b891..0c30deb6b 100644 --- a/src/runloop_api_client/types/shared/__init__.py +++ b/src/runloop_api_client/types/shared/__init__.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .resource_size import ResourceSize as ResourceSize from .launch_parameters import LaunchParameters as LaunchParameters from .project_logs_view import ProjectLogsView as ProjectLogsView from .function_invocation_execution_detail_view import ( diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index 99d2febb0..438162797 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -1,9 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional +from typing_extensions import Literal from ..._models import BaseModel -from ..resource_size import ResourceSize __all__ = ["LaunchParameters"] @@ -18,5 +18,5 @@ class LaunchParameters(BaseModel): launch_commands: Optional[List[str]] = None """Set of commands to be run at launch time, before the entrypoint process is run.""" - resource_size_request: Optional[ResourceSize] = None + resource_size_request: Optional[Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "CUSTOM_SIZE"]] = None """Manual resource configuration for Devbox. If not set, defaults will be used.""" diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index 46186b1e3..19995fdef 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -3,10 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import TypedDict - -from .resource_size import ResourceSize -from ..resource_size import ResourceSize +from typing_extensions import Literal, TypedDict __all__ = ["LaunchParameters"] @@ -21,5 +18,5 @@ class LaunchParameters(TypedDict, total=False): launch_commands: List[str] """Set of commands to be run at launch time, before the entrypoint process is run.""" - resource_size_request: ResourceSize + resource_size_request: Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "CUSTOM_SIZE"] """Manual resource configuration for Devbox. If not set, defaults will be used.""" From 2426f030e2ccef6fa11f582614d8f4fd50ba249a Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 11 Oct 2024 22:17:32 +0000 Subject: [PATCH 193/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 87416d7da..7da059bf3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-9637e8217fe437592df1d3e503321093cd72be915633e35aada927c3336148da.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1f5b6bcd6819f627874dddd0d1101d4865944a1321f30fccacbb14355298bbfa.yml From 06ddfa6299551091b6f45047c34b3dfb84d9bfab Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 22:29:30 +0000 Subject: [PATCH 194/993] feat(api): api update (#202) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 10f309169..d66ca57c5 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.2.0" + ".": "0.2.2" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 4077fc8eb..5d87de505 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.2.0" +version = "0.2.2" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 7e03c3115..9be0072aa 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.2.0" # x-release-please-version +__version__ = "0.2.2" # x-release-please-version From 386a3656b13f4760ba56037fd34cf12caaa93c51 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 11 Oct 2024 22:39:12 +0000 Subject: [PATCH 195/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7da059bf3..87416d7da 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1f5b6bcd6819f627874dddd0d1101d4865944a1321f30fccacbb14355298bbfa.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-9637e8217fe437592df1d3e503321093cd72be915633e35aada927c3336148da.yml From dc0052fdb3e0bad87def0c25491541449629b086 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 11 Oct 2024 23:17:29 +0000 Subject: [PATCH 196/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 87416d7da..7da059bf3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-9637e8217fe437592df1d3e503321093cd72be915633e35aada927c3336148da.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1f5b6bcd6819f627874dddd0d1101d4865944a1321f30fccacbb14355298bbfa.yml From 640c1fa4807f3f30f29b212728f828a622ad786f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 20:50:32 +0000 Subject: [PATCH 197/993] feat(api): api update (#203) --- .stats.yml | 2 +- api.md | 2 +- .../resources/devboxes/devboxes.py | 13 ++++++------- tests/api_resources/test_devboxes.py | 17 +++++++++-------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7da059bf3..c7ec0e091 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1f5b6bcd6819f627874dddd0d1101d4865944a1321f30fccacbb14355298bbfa.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-27190c4495c3af7a4071f72c910c78ec818cf96fcd3558b0c1af1b9e578f2e58.yml diff --git a/api.md b/api.md index 7185c77d4..48c1ca6f7 100644 --- a/api.md +++ b/api.md @@ -69,7 +69,7 @@ Methods: - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.read_file_contents(id, \*\*params) -> str - client.devboxes.shutdown(id) -> DevboxView -- client.devboxes.snapshot_disk(id, \*\*params) -> None +- client.devboxes.snapshot_disk(id, \*\*params) -> DevboxSnapshotView - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4c35bda9e..13efe11fa 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -26,7 +26,7 @@ devbox_disk_snapshots_params, devbox_read_file_contents_params, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, FileTypes +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes from ..._utils import ( extract_files, maybe_transform, @@ -60,6 +60,7 @@ from ..._base_client import make_request_options from ...types.devbox_view import DevboxView from ...types.devbox_list_view import DevboxListView +from ...types.devbox_snapshot_view import DevboxSnapshotView from ...types.devbox_snapshot_list_view import DevboxSnapshotListView from ...types.code_mount_parameters_param import CodeMountParametersParam from ...types.devbox_execution_detail_view import DevboxExecutionDetailView @@ -570,7 +571,7 @@ def snapshot_disk( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> None: + ) -> DevboxSnapshotView: """ Create a filesystem snapshot of a devbox with the specified name and metadata. @@ -589,7 +590,6 @@ def snapshot_disk( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - extra_headers = {"Accept": "*/*", **(extra_headers or {})} return self._post( f"/v1/devboxes/{id}/snapshot_disk", body=maybe_transform( @@ -602,7 +602,7 @@ def snapshot_disk( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=NoneType, + cast_to=DevboxSnapshotView, ) def upload_file( @@ -1200,7 +1200,7 @@ async def snapshot_disk( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> None: + ) -> DevboxSnapshotView: """ Create a filesystem snapshot of a devbox with the specified name and metadata. @@ -1219,7 +1219,6 @@ async def snapshot_disk( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - extra_headers = {"Accept": "*/*", **(extra_headers or {})} return await self._post( f"/v1/devboxes/{id}/snapshot_disk", body=await async_maybe_transform( @@ -1232,7 +1231,7 @@ async def snapshot_disk( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=NoneType, + cast_to=DevboxSnapshotView, ) async def upload_file( diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index b938328f1..1a927f711 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -14,6 +14,7 @@ from runloop_api_client.types import ( DevboxView, DevboxListView, + DevboxSnapshotView, DevboxSnapshotListView, DevboxExecutionDetailView, DevboxCreateSSHKeyResponse, @@ -486,7 +487,7 @@ def test_method_snapshot_disk(self, client: Runloop) -> None: devbox = client.devboxes.snapshot_disk( id="id", ) - assert devbox is None + assert_matches_type(DevboxSnapshotView, devbox, path=["response"]) @parametrize def test_method_snapshot_disk_with_all_params(self, client: Runloop) -> None: @@ -495,7 +496,7 @@ def test_method_snapshot_disk_with_all_params(self, client: Runloop) -> None: metadata={"foo": "string"}, name="name", ) - assert devbox is None + assert_matches_type(DevboxSnapshotView, devbox, path=["response"]) @parametrize def test_raw_response_snapshot_disk(self, client: Runloop) -> None: @@ -506,7 +507,7 @@ def test_raw_response_snapshot_disk(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert devbox is None + assert_matches_type(DevboxSnapshotView, devbox, path=["response"]) @parametrize def test_streaming_response_snapshot_disk(self, client: Runloop) -> None: @@ -517,7 +518,7 @@ def test_streaming_response_snapshot_disk(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert devbox is None + assert_matches_type(DevboxSnapshotView, devbox, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1079,7 +1080,7 @@ async def test_method_snapshot_disk(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.snapshot_disk( id="id", ) - assert devbox is None + assert_matches_type(DevboxSnapshotView, devbox, path=["response"]) @parametrize async def test_method_snapshot_disk_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -1088,7 +1089,7 @@ async def test_method_snapshot_disk_with_all_params(self, async_client: AsyncRun metadata={"foo": "string"}, name="name", ) - assert devbox is None + assert_matches_type(DevboxSnapshotView, devbox, path=["response"]) @parametrize async def test_raw_response_snapshot_disk(self, async_client: AsyncRunloop) -> None: @@ -1099,7 +1100,7 @@ async def test_raw_response_snapshot_disk(self, async_client: AsyncRunloop) -> N assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert devbox is None + assert_matches_type(DevboxSnapshotView, devbox, path=["response"]) @parametrize async def test_streaming_response_snapshot_disk(self, async_client: AsyncRunloop) -> None: @@ -1110,7 +1111,7 @@ async def test_streaming_response_snapshot_disk(self, async_client: AsyncRunloop assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert devbox is None + assert_matches_type(DevboxSnapshotView, devbox, path=["response"]) assert cast(Any, response.is_closed) is True From 88f56cd10fc4360bd931eaf54f7c6f91ab1e256f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 20:53:14 +0000 Subject: [PATCH 198/993] feat(api): api update (#205) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d66ca57c5..6b7b74c5f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.2.2" + ".": "0.3.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 5d87de505..14dc2ee89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.2.2" +version = "0.3.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 9be0072aa..f2069d70e 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.2.2" # x-release-please-version +__version__ = "0.3.0" # x-release-please-version From ce6afd57c104c0df5d301638909579a34c559bf9 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 14 Oct 2024 21:17:46 +0000 Subject: [PATCH 199/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c7ec0e091..5a619e9c0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-27190c4495c3af7a4071f72c910c78ec818cf96fcd3558b0c1af1b9e578f2e58.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-928794c453b8b15f199b93829b9bd34cd82007f33ca6eb14cb62ec9bd300a8c9.yml From 544e2cdb24cabd01680592159e085fe160a8a78c Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 14 Oct 2024 21:52:53 +0000 Subject: [PATCH 200/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 5a619e9c0..c7ec0e091 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-928794c453b8b15f199b93829b9bd34cd82007f33ca6eb14cb62ec9bd300a8c9.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-27190c4495c3af7a4071f72c910c78ec818cf96fcd3558b0c1af1b9e578f2e58.yml From 98f18f9fcaccadaca95b8ce21c4fede2448d423e Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 14 Oct 2024 22:17:49 +0000 Subject: [PATCH 201/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c7ec0e091..5a619e9c0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-27190c4495c3af7a4071f72c910c78ec818cf96fcd3558b0c1af1b9e578f2e58.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-928794c453b8b15f199b93829b9bd34cd82007f33ca6eb14cb62ec9bd300a8c9.yml From ce83de41ffc2a7143a3446c32896bf46c5bbf58c Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 14 Oct 2024 22:53:27 +0000 Subject: [PATCH 202/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 5a619e9c0..c7ec0e091 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-928794c453b8b15f199b93829b9bd34cd82007f33ca6eb14cb62ec9bd300a8c9.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-27190c4495c3af7a4071f72c910c78ec818cf96fcd3558b0c1af1b9e578f2e58.yml From eca6ca745540c44692b3c3ec27b35bc12e3671b5 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 14 Oct 2024 23:17:46 +0000 Subject: [PATCH 203/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c7ec0e091..5a619e9c0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-27190c4495c3af7a4071f72c910c78ec818cf96fcd3558b0c1af1b9e578f2e58.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-928794c453b8b15f199b93829b9bd34cd82007f33ca6eb14cb62ec9bd300a8c9.yml From 0c69f6db93ee84b05c8dfffe6a294cacd482b573 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 15 Oct 2024 15:37:55 +0000 Subject: [PATCH 204/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 5a619e9c0..c3632bc0a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-928794c453b8b15f199b93829b9bd34cd82007f33ca6eb14cb62ec9bd300a8c9.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e12eaba71a773722580bd3e87594e6d431e2fea4c85a53f1edd8f1e2f5420197.yml From 457a1002e843fa09eda1157be5a0d8613ddeeb3d Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 15 Oct 2024 16:17:46 +0000 Subject: [PATCH 205/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c3632bc0a..5a619e9c0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e12eaba71a773722580bd3e87594e6d431e2fea4c85a53f1edd8f1e2f5420197.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-928794c453b8b15f199b93829b9bd34cd82007f33ca6eb14cb62ec9bd300a8c9.yml From ce2ec4eceacd1d2561849a156bfe91622bec4d1b Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 15 Oct 2024 17:33:55 +0000 Subject: [PATCH 206/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 5a619e9c0..c3632bc0a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-928794c453b8b15f199b93829b9bd34cd82007f33ca6eb14cb62ec9bd300a8c9.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e12eaba71a773722580bd3e87594e6d431e2fea4c85a53f1edd8f1e2f5420197.yml From 17919b1de63d48d3c19a30cc3da917dc9bc917c9 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 15 Oct 2024 18:17:54 +0000 Subject: [PATCH 207/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c3632bc0a..0366f9878 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e12eaba71a773722580bd3e87594e6d431e2fea4c85a53f1edd8f1e2f5420197.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3e582d4708b73832b497579c201f470f1e1886892954b82a953336dac2db6b37.yml From aea75d30f62a1dd03181b1bc0addba6b7c8cb79a Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 15 Oct 2024 22:22:50 +0000 Subject: [PATCH 208/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 0366f9878..c3632bc0a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3e582d4708b73832b497579c201f470f1e1886892954b82a953336dac2db6b37.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e12eaba71a773722580bd3e87594e6d431e2fea4c85a53f1edd8f1e2f5420197.yml From 800a2bf136e9995c34bbd64219b54ba30736801d Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 15 Oct 2024 23:17:45 +0000 Subject: [PATCH 209/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c3632bc0a..0366f9878 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e12eaba71a773722580bd3e87594e6d431e2fea4c85a53f1edd8f1e2f5420197.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3e582d4708b73832b497579c201f470f1e1886892954b82a953336dac2db6b37.yml From 831233f284b8202b2c03353617be745d4434714f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 00:28:02 +0000 Subject: [PATCH 210/993] feat(api): api update (#206) --- .stats.yml | 2 +- src/runloop_api_client/types/devbox_snapshot_view.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 0366f9878..6f1ed9edb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3e582d4708b73832b497579c201f470f1e1886892954b82a953336dac2db6b37.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d9df49b813da632a1c544c2d72b3cad31b9d43eecd03ee341f1c14d300797f19.yml diff --git a/src/runloop_api_client/types/devbox_snapshot_view.py b/src/runloop_api_client/types/devbox_snapshot_view.py index 8e98726ee..48f9a67ff 100644 --- a/src/runloop_api_client/types/devbox_snapshot_view.py +++ b/src/runloop_api_client/types/devbox_snapshot_view.py @@ -13,6 +13,9 @@ class DevboxSnapshotView(BaseModel): id: str """The unique identifier of the snapshot.""" + create_time_ms: int + """Creation time of the Snapshot (Unix timestamp milliseconds).""" + metadata: Dict[str, str] """metadata associated with the snapshot.""" From 4c56955e998c3bd2d415f988aec7de23b929e110 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 01:17:53 +0000 Subject: [PATCH 211/993] feat(api): api update (#208) --- .stats.yml | 2 +- src/runloop_api_client/types/devbox_snapshot_view.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6f1ed9edb..0366f9878 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d9df49b813da632a1c544c2d72b3cad31b9d43eecd03ee341f1c14d300797f19.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3e582d4708b73832b497579c201f470f1e1886892954b82a953336dac2db6b37.yml diff --git a/src/runloop_api_client/types/devbox_snapshot_view.py b/src/runloop_api_client/types/devbox_snapshot_view.py index 48f9a67ff..8e98726ee 100644 --- a/src/runloop_api_client/types/devbox_snapshot_view.py +++ b/src/runloop_api_client/types/devbox_snapshot_view.py @@ -13,9 +13,6 @@ class DevboxSnapshotView(BaseModel): id: str """The unique identifier of the snapshot.""" - create_time_ms: int - """Creation time of the Snapshot (Unix timestamp milliseconds).""" - metadata: Dict[str, str] """metadata associated with the snapshot.""" From 80c6b64b0ad1b44924eb6f4c64bab432f2c0adc8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 19:17:51 +0000 Subject: [PATCH 212/993] feat(api): api update (#209) --- .stats.yml | 2 +- src/runloop_api_client/types/devbox_snapshot_view.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 0366f9878..b3efa0d9f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3e582d4708b73832b497579c201f470f1e1886892954b82a953336dac2db6b37.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-cd534b623ddae29ab741a95159a91d3082eace141924b16328cca1f251f3c5d2.yml diff --git a/src/runloop_api_client/types/devbox_snapshot_view.py b/src/runloop_api_client/types/devbox_snapshot_view.py index 8e98726ee..48f9a67ff 100644 --- a/src/runloop_api_client/types/devbox_snapshot_view.py +++ b/src/runloop_api_client/types/devbox_snapshot_view.py @@ -13,6 +13,9 @@ class DevboxSnapshotView(BaseModel): id: str """The unique identifier of the snapshot.""" + create_time_ms: int + """Creation time of the Snapshot (Unix timestamp milliseconds).""" + metadata: Dict[str, str] """metadata associated with the snapshot.""" From bc89f5ed2b6718511153a3ead0d3b821860b400c Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 16 Oct 2024 19:27:35 +0000 Subject: [PATCH 213/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index b3efa0d9f..6f1ed9edb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-cd534b623ddae29ab741a95159a91d3082eace141924b16328cca1f251f3c5d2.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d9df49b813da632a1c544c2d72b3cad31b9d43eecd03ee341f1c14d300797f19.yml From 4a71ecbe2832ac591ff60815392ad659ef40f0cf Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 16 Oct 2024 20:17:47 +0000 Subject: [PATCH 214/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 6f1ed9edb..b3efa0d9f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d9df49b813da632a1c544c2d72b3cad31b9d43eecd03ee341f1c14d300797f19.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-cd534b623ddae29ab741a95159a91d3082eace141924b16328cca1f251f3c5d2.yml From b7be8c4a4dc425b4007ba9398381e19ef8f50737 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 19:43:22 +0000 Subject: [PATCH 215/993] feat(api): api update (#210) --- .stats.yml | 2 +- pyproject.toml | 3 ++- requirements-dev.lock | 2 +- src/runloop_api_client/types/blueprint_build_log.py | 1 - src/runloop_api_client/types/blueprint_preview_view.py | 1 - src/runloop_api_client/types/devbox_create_ssh_key_response.py | 1 - tests/test_models.py | 2 +- 7 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.stats.yml b/.stats.yml index b3efa0d9f..6f1ed9edb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-cd534b623ddae29ab741a95159a91d3082eace141924b16328cca1f251f3c5d2.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d9df49b813da632a1c544c2d72b3cad31b9d43eecd03ee341f1c14d300797f19.yml diff --git a/pyproject.toml b/pyproject.toml index 14dc2ee89..28a7b0142 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,11 +63,12 @@ format = { chain = [ "format:ruff", "format:docs", "fix:ruff", + # run formatting again to fix any inconsistencies when imports are stripped + "format:ruff", ]} "format:black" = "black ." "format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md" "format:ruff" = "ruff format" -"format:isort" = "isort ." "lint" = { chain = [ "check:ruff", diff --git a/requirements-dev.lock b/requirements-dev.lock index 178e0420f..13bb75fb5 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -80,7 +80,7 @@ pytz==2023.3.post1 # via dirty-equals respx==0.20.2 rich==13.7.1 -ruff==0.6.5 +ruff==0.6.9 setuptools==68.2.2 # via nodeenv six==1.16.0 diff --git a/src/runloop_api_client/types/blueprint_build_log.py b/src/runloop_api_client/types/blueprint_build_log.py index e2f685858..3343bb16f 100644 --- a/src/runloop_api_client/types/blueprint_build_log.py +++ b/src/runloop_api_client/types/blueprint_build_log.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from .._models import BaseModel __all__ = ["BlueprintBuildLog"] diff --git a/src/runloop_api_client/types/blueprint_preview_view.py b/src/runloop_api_client/types/blueprint_preview_view.py index f0f04aa24..5703115a4 100644 --- a/src/runloop_api_client/types/blueprint_preview_view.py +++ b/src/runloop_api_client/types/blueprint_preview_view.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from .._models import BaseModel __all__ = ["BlueprintPreviewView"] diff --git a/src/runloop_api_client/types/devbox_create_ssh_key_response.py b/src/runloop_api_client/types/devbox_create_ssh_key_response.py index 064bbc3e9..584ce6029 100755 --- a/src/runloop_api_client/types/devbox_create_ssh_key_response.py +++ b/src/runloop_api_client/types/devbox_create_ssh_key_response.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from .._models import BaseModel __all__ = ["DevboxCreateSSHKeyResponse"] diff --git a/tests/test_models.py b/tests/test_models.py index 7679a783a..14b49009f 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -245,7 +245,7 @@ class Model(BaseModel): assert m.foo is True m = Model.construct(foo="CARD_HOLDER") - assert m.foo is "CARD_HOLDER" + assert m.foo == "CARD_HOLDER" m = Model.construct(foo={"bar": False}) assert isinstance(m.foo, Submodel1) From 73794debd7ea22d1cc07fecc26a69a555ad8328b Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 18 Oct 2024 20:17:45 +0000 Subject: [PATCH 216/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 6f1ed9edb..b3efa0d9f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d9df49b813da632a1c544c2d72b3cad31b9d43eecd03ee341f1c14d300797f19.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-cd534b623ddae29ab741a95159a91d3082eace141924b16328cca1f251f3c5d2.yml From fe10cda49e476854e2c637d19cf4a97cd6e2319d Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 18 Oct 2024 21:34:54 +0000 Subject: [PATCH 217/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index b3efa0d9f..bbc3b807a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-cd534b623ddae29ab741a95159a91d3082eace141924b16328cca1f251f3c5d2.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c40cea26561cc5976de1fb8e31ea7236db81c0cc8dd6bbaedb9044531f053291.yml From dcbf1ac79fbc713b83edc518bfcd25061fd286fb Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 18 Oct 2024 22:17:43 +0000 Subject: [PATCH 218/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index bbc3b807a..b3efa0d9f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c40cea26561cc5976de1fb8e31ea7236db81c0cc8dd6bbaedb9044531f053291.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-cd534b623ddae29ab741a95159a91d3082eace141924b16328cca1f251f3c5d2.yml From 0402f381c07561b97278dd8fb1976163491ee084 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 23:17:52 +0000 Subject: [PATCH 219/993] feat(api): api update (#211) --- .stats.yml | 2 +- src/runloop_api_client/types/devbox_view.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b3efa0d9f..69d7ecf28 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-cd534b623ddae29ab741a95159a91d3082eace141924b16328cca1f251f3c5d2.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a9fc3134def272f346fadb80a9d27fa888f58f506007fe1071323e90f706d87f.yml diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 4831b5425..ab94d0658 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -28,7 +28,7 @@ class DevboxView(BaseModel): metadata: Dict[str, str] """The user defined Devbox metadata.""" - status: Literal["provisioning", "initializing", "running", "failure", "shutdown"] + status: Literal["provisioning", "initializing", "running", "suspending", "suspended", "failure", "shutdown"] """The current status of the Devbox.""" blueprint_id: Optional[str] = None From 69bb26bbac73d956e03065951932922bd91efc08 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 19 Oct 2024 16:26:37 +0000 Subject: [PATCH 220/993] feat(api): api update (#212) --- .stats.yml | 2 +- src/runloop_api_client/types/devbox_view.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 69d7ecf28..bbc3b807a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a9fc3134def272f346fadb80a9d27fa888f58f506007fe1071323e90f706d87f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c40cea26561cc5976de1fb8e31ea7236db81c0cc8dd6bbaedb9044531f053291.yml diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index ab94d0658..4831b5425 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -28,7 +28,7 @@ class DevboxView(BaseModel): metadata: Dict[str, str] """The user defined Devbox metadata.""" - status: Literal["provisioning", "initializing", "running", "suspending", "suspended", "failure", "shutdown"] + status: Literal["provisioning", "initializing", "running", "failure", "shutdown"] """The current status of the Devbox.""" blueprint_id: Optional[str] = None From 8ec81ee6ec5c4fa7d768051664eef46134535a09 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 19 Oct 2024 17:17:54 +0000 Subject: [PATCH 221/993] feat(api): api update (#213) --- .stats.yml | 2 +- src/runloop_api_client/types/devbox_view.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index bbc3b807a..69d7ecf28 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c40cea26561cc5976de1fb8e31ea7236db81c0cc8dd6bbaedb9044531f053291.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a9fc3134def272f346fadb80a9d27fa888f58f506007fe1071323e90f706d87f.yml diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 4831b5425..ab94d0658 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -28,7 +28,7 @@ class DevboxView(BaseModel): metadata: Dict[str, str] """The user defined Devbox metadata.""" - status: Literal["provisioning", "initializing", "running", "failure", "shutdown"] + status: Literal["provisioning", "initializing", "running", "suspending", "suspended", "failure", "shutdown"] """The current status of the Devbox.""" blueprint_id: Optional[str] = None From b85a13ffb1df595e58d92ee172f3415260836642 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 02:17:51 +0000 Subject: [PATCH 222/993] feat(api): api update (#214) --- .stats.yml | 2 +- src/runloop_api_client/types/devbox_view.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 69d7ecf28..29424f7a9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a9fc3134def272f346fadb80a9d27fa888f58f506007fe1071323e90f706d87f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6ce9273caf6f377592aeb470bf089784ff983e0a7ffde6b48258e8910e314add.yml diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index ab94d0658..4831b5425 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -28,7 +28,7 @@ class DevboxView(BaseModel): metadata: Dict[str, str] """The user defined Devbox metadata.""" - status: Literal["provisioning", "initializing", "running", "suspending", "suspended", "failure", "shutdown"] + status: Literal["provisioning", "initializing", "running", "failure", "shutdown"] """The current status of the Devbox.""" blueprint_id: Optional[str] = None From 41870df445dcb65ccbe0288419da5ee909681f73 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 21 Oct 2024 02:28:14 +0000 Subject: [PATCH 223/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 29424f7a9..bbc3b807a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6ce9273caf6f377592aeb470bf089784ff983e0a7ffde6b48258e8910e314add.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c40cea26561cc5976de1fb8e31ea7236db81c0cc8dd6bbaedb9044531f053291.yml From d2d16cd67954d148f8e61ee20efac997195d71e5 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 21 Oct 2024 03:17:42 +0000 Subject: [PATCH 224/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index bbc3b807a..29424f7a9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c40cea26561cc5976de1fb8e31ea7236db81c0cc8dd6bbaedb9044531f053291.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6ce9273caf6f377592aeb470bf089784ff983e0a7ffde6b48258e8910e314add.yml From b5485fb4a80725aa6c8175fd227ad2c8a72698ad Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 16:46:12 +0000 Subject: [PATCH 225/993] feat(api): api update (#215) --- .stats.yml | 2 +- pyproject.toml | 5 ----- src/runloop_api_client/_base_client.py | 2 +- tests/test_client.py | 21 +++++++++++++++++++-- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.stats.yml b/.stats.yml index 29424f7a9..bbc3b807a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6ce9273caf6f377592aeb470bf089784ff983e0a7ffde6b48258e8910e314add.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c40cea26561cc5976de1fb8e31ea7236db81c0cc8dd6bbaedb9044531f053291.yml diff --git a/pyproject.toml b/pyproject.toml index 28a7b0142..fc21a5080 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,7 +66,6 @@ format = { chain = [ # run formatting again to fix any inconsistencies when imports are stripped "format:ruff", ]} -"format:black" = "black ." "format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md" "format:ruff" = "ruff format" @@ -126,10 +125,6 @@ path = "README.md" pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)' replacement = '[\1](https://github.com/runloopai/api-client-python/tree/main/\g<2>)' -[tool.black] -line-length = 120 -target-version = ["py37"] - [tool.pytest.ini_options] testpaths = ["tests"] addopts = "--tb=short" diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index c77409d58..3c132d01c 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -1575,7 +1575,7 @@ async def _request( except Exception as err: log.debug("Encountered Exception", exc_info=True) - if retries_taken > 0: + if remaining_retries > 0: return await self._retry_request( input_options, cast_to, diff --git a/tests/test_client.py b/tests/test_client.py index d14292bc4..f9bb2c8f5 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -10,6 +10,7 @@ import tracemalloc from typing import Any, Union, cast from unittest import mock +from typing_extensions import Literal import httpx import pytest @@ -765,7 +766,14 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - def test_retries_taken(self, client: Runloop, failures_before_success: int, respx_mock: MockRouter) -> None: + @pytest.mark.parametrize("failure_mode", ["status", "exception"]) + def test_retries_taken( + self, + client: Runloop, + failures_before_success: int, + failure_mode: Literal["status", "exception"], + respx_mock: MockRouter, + ) -> None: client = client.with_options(max_retries=4) nb_retries = 0 @@ -774,6 +782,8 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: nonlocal nb_retries if nb_retries < failures_before_success: nb_retries += 1 + if failure_mode == "exception": + raise RuntimeError("oops") return httpx.Response(500) return httpx.Response(200) @@ -1551,8 +1561,13 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) @pytest.mark.asyncio + @pytest.mark.parametrize("failure_mode", ["status", "exception"]) async def test_retries_taken( - self, async_client: AsyncRunloop, failures_before_success: int, respx_mock: MockRouter + self, + async_client: AsyncRunloop, + failures_before_success: int, + failure_mode: Literal["status", "exception"], + respx_mock: MockRouter, ) -> None: client = async_client.with_options(max_retries=4) @@ -1562,6 +1577,8 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: nonlocal nb_retries if nb_retries < failures_before_success: nb_retries += 1 + if failure_mode == "exception": + raise RuntimeError("oops") return httpx.Response(500) return httpx.Response(200) From 067b0e7db8fa988e688da273fb0ce599e041dd1b Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 21 Oct 2024 17:17:49 +0000 Subject: [PATCH 226/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index bbc3b807a..29424f7a9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c40cea26561cc5976de1fb8e31ea7236db81c0cc8dd6bbaedb9044531f053291.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6ce9273caf6f377592aeb470bf089784ff983e0a7ffde6b48258e8910e314add.yml From b06d26b37204f9fe94f51cd6e90683121014c09c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 18:17:52 +0000 Subject: [PATCH 227/993] feat(api): api update (#216) --- .stats.yml | 2 +- src/runloop_api_client/types/devbox_view.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 29424f7a9..69d7ecf28 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6ce9273caf6f377592aeb470bf089784ff983e0a7ffde6b48258e8910e314add.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a9fc3134def272f346fadb80a9d27fa888f58f506007fe1071323e90f706d87f.yml diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 4831b5425..ab94d0658 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -28,7 +28,7 @@ class DevboxView(BaseModel): metadata: Dict[str, str] """The user defined Devbox metadata.""" - status: Literal["provisioning", "initializing", "running", "failure", "shutdown"] + status: Literal["provisioning", "initializing", "running", "suspending", "suspended", "failure", "shutdown"] """The current status of the Devbox.""" blueprint_id: Optional[str] = None From 55eb207f173535194be953570139ef446acfcf4e Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 21 Oct 2024 19:17:43 +0000 Subject: [PATCH 228/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 69d7ecf28..b746f8153 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a9fc3134def272f346fadb80a9d27fa888f58f506007fe1071323e90f706d87f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f629929c548c63d1814cc58af1d1dafc2211d7af7d3277faa6e7984033d1037a.yml From 0a28a5ee6e42685f260d5727976863776cbb3886 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 20:54:14 +0000 Subject: [PATCH 229/993] feat(api): api update (#217) --- .stats.yml | 2 +- src/runloop_api_client/types/devbox_view.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b746f8153..bbc3b807a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f629929c548c63d1814cc58af1d1dafc2211d7af7d3277faa6e7984033d1037a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c40cea26561cc5976de1fb8e31ea7236db81c0cc8dd6bbaedb9044531f053291.yml diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index ab94d0658..4831b5425 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -28,7 +28,7 @@ class DevboxView(BaseModel): metadata: Dict[str, str] """The user defined Devbox metadata.""" - status: Literal["provisioning", "initializing", "running", "suspending", "suspended", "failure", "shutdown"] + status: Literal["provisioning", "initializing", "running", "failure", "shutdown"] """The current status of the Devbox.""" blueprint_id: Optional[str] = None From f4957d6ae6e89d2d4fb9d8b609dbfef2ee899d77 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:17:49 +0000 Subject: [PATCH 230/993] feat(api): api update (#218) --- .stats.yml | 2 +- src/runloop_api_client/types/devbox_view.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index bbc3b807a..b746f8153 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c40cea26561cc5976de1fb8e31ea7236db81c0cc8dd6bbaedb9044531f053291.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f629929c548c63d1814cc58af1d1dafc2211d7af7d3277faa6e7984033d1037a.yml diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 4831b5425..ab94d0658 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -28,7 +28,7 @@ class DevboxView(BaseModel): metadata: Dict[str, str] """The user defined Devbox metadata.""" - status: Literal["provisioning", "initializing", "running", "failure", "shutdown"] + status: Literal["provisioning", "initializing", "running", "suspending", "suspended", "failure", "shutdown"] """The current status of the Devbox.""" blueprint_id: Optional[str] = None From c8910e306bf69dcc78c19f5418f5750896df9ca2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 22:17:50 +0000 Subject: [PATCH 231/993] feat(api): api update (#219) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 10 ++++++++++ src/runloop_api_client/types/devbox_create_params.py | 6 ++++++ src/runloop_api_client/types/devbox_view.py | 2 +- tests/api_resources/test_devboxes.py | 2 ++ 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b746f8153..7dc85dc14 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f629929c548c63d1814cc58af1d1dafc2211d7af7d3277faa6e7984033d1037a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c5f29b6d5424246c8c6d585c697032f4b4b6c49e316c9d28706cc0d0683609a3.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 13efe11fa..36c719ff2 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -102,6 +102,7 @@ def with_streaming_response(self) -> DevboxesResourceWithStreamingResponse: def create( self, *, + available_ports: Iterable[int] | NotGiven = NOT_GIVEN, blueprint_id: str | NotGiven = NOT_GIVEN, blueprint_name: str | NotGiven = NOT_GIVEN, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, @@ -127,6 +128,9 @@ def create( the 'pending' state and will transition to 'running' once it is ready. Args: + available_ports: A list of ports to make available on the Devbox. Call createTunnel to open a + tunnel to the port. + blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be created with the default Runloop Devbox image. @@ -169,6 +173,7 @@ def create( "/v1/devboxes", body=maybe_transform( { + "available_ports": available_ports, "blueprint_id": blueprint_id, "blueprint_name": blueprint_name, "code_mounts": code_mounts, @@ -731,6 +736,7 @@ def with_streaming_response(self) -> AsyncDevboxesResourceWithStreamingResponse: async def create( self, *, + available_ports: Iterable[int] | NotGiven = NOT_GIVEN, blueprint_id: str | NotGiven = NOT_GIVEN, blueprint_name: str | NotGiven = NOT_GIVEN, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, @@ -756,6 +762,9 @@ async def create( the 'pending' state and will transition to 'running' once it is ready. Args: + available_ports: A list of ports to make available on the Devbox. Call createTunnel to open a + tunnel to the port. + blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be created with the default Runloop Devbox image. @@ -798,6 +807,7 @@ async def create( "/v1/devboxes", body=await async_maybe_transform( { + "available_ports": available_ports, "blueprint_id": blueprint_id, "blueprint_name": blueprint_name, "code_mounts": code_mounts, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 092476a18..7f74600cd 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -12,6 +12,12 @@ class DevboxCreateParams(TypedDict, total=False): + available_ports: Iterable[int] + """A list of ports to make available on the Devbox. + + Call createTunnel to open a tunnel to the port. + """ + blueprint_id: str """(Optional) Blueprint to use for the Devbox. diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index ab94d0658..4831b5425 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -28,7 +28,7 @@ class DevboxView(BaseModel): metadata: Dict[str, str] """The user defined Devbox metadata.""" - status: Literal["provisioning", "initializing", "running", "suspending", "suspended", "failure", "shutdown"] + status: Literal["provisioning", "initializing", "running", "failure", "shutdown"] """The current status of the Devbox.""" blueprint_id: Optional[str] = None diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 1a927f711..c9937b4dc 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -41,6 +41,7 @@ def test_method_create(self, client: Runloop) -> None: @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.create( + available_ports=[0, 0, 0], blueprint_id="blueprint_id", blueprint_name="blueprint_name", code_mounts=[ @@ -634,6 +635,7 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.create( + available_ports=[0, 0, 0], blueprint_id="blueprint_id", blueprint_name="blueprint_name", code_mounts=[ From a462fbc4ba34d35d5cd3176bb1682603c1894ab7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 23:10:13 +0000 Subject: [PATCH 232/993] feat(api): api update (#220) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 10 ---------- src/runloop_api_client/types/devbox_create_params.py | 6 ------ tests/api_resources/test_devboxes.py | 2 -- 4 files changed, 1 insertion(+), 19 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7dc85dc14..bbc3b807a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c5f29b6d5424246c8c6d585c697032f4b4b6c49e316c9d28706cc0d0683609a3.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c40cea26561cc5976de1fb8e31ea7236db81c0cc8dd6bbaedb9044531f053291.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 36c719ff2..13efe11fa 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -102,7 +102,6 @@ def with_streaming_response(self) -> DevboxesResourceWithStreamingResponse: def create( self, *, - available_ports: Iterable[int] | NotGiven = NOT_GIVEN, blueprint_id: str | NotGiven = NOT_GIVEN, blueprint_name: str | NotGiven = NOT_GIVEN, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, @@ -128,9 +127,6 @@ def create( the 'pending' state and will transition to 'running' once it is ready. Args: - available_ports: A list of ports to make available on the Devbox. Call createTunnel to open a - tunnel to the port. - blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be created with the default Runloop Devbox image. @@ -173,7 +169,6 @@ def create( "/v1/devboxes", body=maybe_transform( { - "available_ports": available_ports, "blueprint_id": blueprint_id, "blueprint_name": blueprint_name, "code_mounts": code_mounts, @@ -736,7 +731,6 @@ def with_streaming_response(self) -> AsyncDevboxesResourceWithStreamingResponse: async def create( self, *, - available_ports: Iterable[int] | NotGiven = NOT_GIVEN, blueprint_id: str | NotGiven = NOT_GIVEN, blueprint_name: str | NotGiven = NOT_GIVEN, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, @@ -762,9 +756,6 @@ async def create( the 'pending' state and will transition to 'running' once it is ready. Args: - available_ports: A list of ports to make available on the Devbox. Call createTunnel to open a - tunnel to the port. - blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be created with the default Runloop Devbox image. @@ -807,7 +798,6 @@ async def create( "/v1/devboxes", body=await async_maybe_transform( { - "available_ports": available_ports, "blueprint_id": blueprint_id, "blueprint_name": blueprint_name, "code_mounts": code_mounts, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 7f74600cd..092476a18 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -12,12 +12,6 @@ class DevboxCreateParams(TypedDict, total=False): - available_ports: Iterable[int] - """A list of ports to make available on the Devbox. - - Call createTunnel to open a tunnel to the port. - """ - blueprint_id: str """(Optional) Blueprint to use for the Devbox. diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index c9937b4dc..1a927f711 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -41,7 +41,6 @@ def test_method_create(self, client: Runloop) -> None: @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.create( - available_ports=[0, 0, 0], blueprint_id="blueprint_id", blueprint_name="blueprint_name", code_mounts=[ @@ -635,7 +634,6 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.create( - available_ports=[0, 0, 0], blueprint_id="blueprint_id", blueprint_name="blueprint_name", code_mounts=[ From a0e55880a0d44ab439b5f92f02d5e353c013231b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 23:17:48 +0000 Subject: [PATCH 233/993] feat(api): api update (#221) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 10 ++++++++++ src/runloop_api_client/types/devbox_create_params.py | 6 ++++++ tests/api_resources/test_devboxes.py | 2 ++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index bbc3b807a..7dc85dc14 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c40cea26561cc5976de1fb8e31ea7236db81c0cc8dd6bbaedb9044531f053291.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c5f29b6d5424246c8c6d585c697032f4b4b6c49e316c9d28706cc0d0683609a3.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 13efe11fa..36c719ff2 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -102,6 +102,7 @@ def with_streaming_response(self) -> DevboxesResourceWithStreamingResponse: def create( self, *, + available_ports: Iterable[int] | NotGiven = NOT_GIVEN, blueprint_id: str | NotGiven = NOT_GIVEN, blueprint_name: str | NotGiven = NOT_GIVEN, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, @@ -127,6 +128,9 @@ def create( the 'pending' state and will transition to 'running' once it is ready. Args: + available_ports: A list of ports to make available on the Devbox. Call createTunnel to open a + tunnel to the port. + blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be created with the default Runloop Devbox image. @@ -169,6 +173,7 @@ def create( "/v1/devboxes", body=maybe_transform( { + "available_ports": available_ports, "blueprint_id": blueprint_id, "blueprint_name": blueprint_name, "code_mounts": code_mounts, @@ -731,6 +736,7 @@ def with_streaming_response(self) -> AsyncDevboxesResourceWithStreamingResponse: async def create( self, *, + available_ports: Iterable[int] | NotGiven = NOT_GIVEN, blueprint_id: str | NotGiven = NOT_GIVEN, blueprint_name: str | NotGiven = NOT_GIVEN, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, @@ -756,6 +762,9 @@ async def create( the 'pending' state and will transition to 'running' once it is ready. Args: + available_ports: A list of ports to make available on the Devbox. Call createTunnel to open a + tunnel to the port. + blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be created with the default Runloop Devbox image. @@ -798,6 +807,7 @@ async def create( "/v1/devboxes", body=await async_maybe_transform( { + "available_ports": available_ports, "blueprint_id": blueprint_id, "blueprint_name": blueprint_name, "code_mounts": code_mounts, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 092476a18..7f74600cd 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -12,6 +12,12 @@ class DevboxCreateParams(TypedDict, total=False): + available_ports: Iterable[int] + """A list of ports to make available on the Devbox. + + Call createTunnel to open a tunnel to the port. + """ + blueprint_id: str """(Optional) Blueprint to use for the Devbox. diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 1a927f711..c9937b4dc 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -41,6 +41,7 @@ def test_method_create(self, client: Runloop) -> None: @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.create( + available_ports=[0, 0, 0], blueprint_id="blueprint_id", blueprint_name="blueprint_name", code_mounts=[ @@ -634,6 +635,7 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.create( + available_ports=[0, 0, 0], blueprint_id="blueprint_id", blueprint_name="blueprint_name", code_mounts=[ From 06b18103f67f6413cfdd0bc06096358eb3114dae Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 00:17:53 +0000 Subject: [PATCH 234/993] feat(api): api update (#222) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 10 ---------- src/runloop_api_client/types/devbox_create_params.py | 6 ------ src/runloop_api_client/types/devbox_view.py | 4 +++- tests/api_resources/test_devboxes.py | 2 -- 5 files changed, 4 insertions(+), 20 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7dc85dc14..afb5dfb81 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c5f29b6d5424246c8c6d585c697032f4b4b6c49e316c9d28706cc0d0683609a3.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b04b5ec571b401333d19cf7d9c5ff55470cb9be675843eed0dc3c73b948fd335.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 36c719ff2..13efe11fa 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -102,7 +102,6 @@ def with_streaming_response(self) -> DevboxesResourceWithStreamingResponse: def create( self, *, - available_ports: Iterable[int] | NotGiven = NOT_GIVEN, blueprint_id: str | NotGiven = NOT_GIVEN, blueprint_name: str | NotGiven = NOT_GIVEN, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, @@ -128,9 +127,6 @@ def create( the 'pending' state and will transition to 'running' once it is ready. Args: - available_ports: A list of ports to make available on the Devbox. Call createTunnel to open a - tunnel to the port. - blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be created with the default Runloop Devbox image. @@ -173,7 +169,6 @@ def create( "/v1/devboxes", body=maybe_transform( { - "available_ports": available_ports, "blueprint_id": blueprint_id, "blueprint_name": blueprint_name, "code_mounts": code_mounts, @@ -736,7 +731,6 @@ def with_streaming_response(self) -> AsyncDevboxesResourceWithStreamingResponse: async def create( self, *, - available_ports: Iterable[int] | NotGiven = NOT_GIVEN, blueprint_id: str | NotGiven = NOT_GIVEN, blueprint_name: str | NotGiven = NOT_GIVEN, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, @@ -762,9 +756,6 @@ async def create( the 'pending' state and will transition to 'running' once it is ready. Args: - available_ports: A list of ports to make available on the Devbox. Call createTunnel to open a - tunnel to the port. - blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be created with the default Runloop Devbox image. @@ -807,7 +798,6 @@ async def create( "/v1/devboxes", body=await async_maybe_transform( { - "available_ports": available_ports, "blueprint_id": blueprint_id, "blueprint_name": blueprint_name, "code_mounts": code_mounts, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 7f74600cd..092476a18 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -12,12 +12,6 @@ class DevboxCreateParams(TypedDict, total=False): - available_ports: Iterable[int] - """A list of ports to make available on the Devbox. - - Call createTunnel to open a tunnel to the port. - """ - blueprint_id: str """(Optional) Blueprint to use for the Devbox. diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 4831b5425..2ad186da4 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -28,7 +28,9 @@ class DevboxView(BaseModel): metadata: Dict[str, str] """The user defined Devbox metadata.""" - status: Literal["provisioning", "initializing", "running", "failure", "shutdown"] + status: Literal[ + "provisioning", "initializing", "running", "suspending", "suspended", "resuming", "failure", "shutdown" + ] """The current status of the Devbox.""" blueprint_id: Optional[str] = None diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index c9937b4dc..1a927f711 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -41,7 +41,6 @@ def test_method_create(self, client: Runloop) -> None: @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.create( - available_ports=[0, 0, 0], blueprint_id="blueprint_id", blueprint_name="blueprint_name", code_mounts=[ @@ -635,7 +634,6 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.create( - available_ports=[0, 0, 0], blueprint_id="blueprint_id", blueprint_name="blueprint_name", code_mounts=[ From 2522d0fead73a97009ffab821eacef7252a6dc68 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 22 Oct 2024 00:39:36 +0000 Subject: [PATCH 235/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index afb5dfb81..354854a07 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b04b5ec571b401333d19cf7d9c5ff55470cb9be675843eed0dc3c73b948fd335.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-83b5c438a7939120d875f431f0f3860f3a6ce6165d84cdd673a6cfb06a36542a.yml From 9dc4824ac060e28be9dfb67f1d4ea42046d9c4b4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 00:55:44 +0000 Subject: [PATCH 236/993] feat(api): api update (#223) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6b7b74c5f..da59f99ea 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.3.0" + ".": "0.4.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index fc21a5080..c64d8ef28 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.3.0" +version = "0.4.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index f2069d70e..719692362 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.3.0" # x-release-please-version +__version__ = "0.4.0" # x-release-please-version From 96df9f5e824d0f0d988a036ef24430e16a14d292 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 01:17:52 +0000 Subject: [PATCH 237/993] feat(api): api update (#224) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 10 ++++++++++ src/runloop_api_client/types/devbox_create_params.py | 6 ++++++ src/runloop_api_client/types/devbox_view.py | 4 +--- tests/api_resources/test_devboxes.py | 2 ++ 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 354854a07..7dc85dc14 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-83b5c438a7939120d875f431f0f3860f3a6ce6165d84cdd673a6cfb06a36542a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c5f29b6d5424246c8c6d585c697032f4b4b6c49e316c9d28706cc0d0683609a3.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 13efe11fa..36c719ff2 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -102,6 +102,7 @@ def with_streaming_response(self) -> DevboxesResourceWithStreamingResponse: def create( self, *, + available_ports: Iterable[int] | NotGiven = NOT_GIVEN, blueprint_id: str | NotGiven = NOT_GIVEN, blueprint_name: str | NotGiven = NOT_GIVEN, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, @@ -127,6 +128,9 @@ def create( the 'pending' state and will transition to 'running' once it is ready. Args: + available_ports: A list of ports to make available on the Devbox. Call createTunnel to open a + tunnel to the port. + blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be created with the default Runloop Devbox image. @@ -169,6 +173,7 @@ def create( "/v1/devboxes", body=maybe_transform( { + "available_ports": available_ports, "blueprint_id": blueprint_id, "blueprint_name": blueprint_name, "code_mounts": code_mounts, @@ -731,6 +736,7 @@ def with_streaming_response(self) -> AsyncDevboxesResourceWithStreamingResponse: async def create( self, *, + available_ports: Iterable[int] | NotGiven = NOT_GIVEN, blueprint_id: str | NotGiven = NOT_GIVEN, blueprint_name: str | NotGiven = NOT_GIVEN, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, @@ -756,6 +762,9 @@ async def create( the 'pending' state and will transition to 'running' once it is ready. Args: + available_ports: A list of ports to make available on the Devbox. Call createTunnel to open a + tunnel to the port. + blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be created with the default Runloop Devbox image. @@ -798,6 +807,7 @@ async def create( "/v1/devboxes", body=await async_maybe_transform( { + "available_ports": available_ports, "blueprint_id": blueprint_id, "blueprint_name": blueprint_name, "code_mounts": code_mounts, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 092476a18..7f74600cd 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -12,6 +12,12 @@ class DevboxCreateParams(TypedDict, total=False): + available_ports: Iterable[int] + """A list of ports to make available on the Devbox. + + Call createTunnel to open a tunnel to the port. + """ + blueprint_id: str """(Optional) Blueprint to use for the Devbox. diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 2ad186da4..4831b5425 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -28,9 +28,7 @@ class DevboxView(BaseModel): metadata: Dict[str, str] """The user defined Devbox metadata.""" - status: Literal[ - "provisioning", "initializing", "running", "suspending", "suspended", "resuming", "failure", "shutdown" - ] + status: Literal["provisioning", "initializing", "running", "failure", "shutdown"] """The current status of the Devbox.""" blueprint_id: Optional[str] = None diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 1a927f711..c9937b4dc 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -41,6 +41,7 @@ def test_method_create(self, client: Runloop) -> None: @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.create( + available_ports=[0, 0, 0], blueprint_id="blueprint_id", blueprint_name="blueprint_name", code_mounts=[ @@ -634,6 +635,7 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.create( + available_ports=[0, 0, 0], blueprint_id="blueprint_id", blueprint_name="blueprint_name", code_mounts=[ From 3854cac355d98444185d71b69cca0545ad4ad3ea Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 15:57:36 +0000 Subject: [PATCH 238/993] feat(api): api update (#226) --- .stats.yml | 2 +- src/runloop_api_client/types/devbox_view.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7dc85dc14..9f3693352 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c5f29b6d5424246c8c6d585c697032f4b4b6c49e316c9d28706cc0d0683609a3.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6cf047d01929db28b7655b33123900eeb28f3c5c12878b4a6d59676d839e8ccc.yml diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 4831b5425..2ad186da4 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -28,7 +28,9 @@ class DevboxView(BaseModel): metadata: Dict[str, str] """The user defined Devbox metadata.""" - status: Literal["provisioning", "initializing", "running", "failure", "shutdown"] + status: Literal[ + "provisioning", "initializing", "running", "suspending", "suspended", "resuming", "failure", "shutdown" + ] """The current status of the Devbox.""" blueprint_id: Optional[str] = None From a7b006c32050c8278bed86d0904de88755843eb8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 16:17:50 +0000 Subject: [PATCH 239/993] feat(api): api update (#227) --- .stats.yml | 2 +- src/runloop_api_client/types/devbox_view.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9f3693352..7dc85dc14 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6cf047d01929db28b7655b33123900eeb28f3c5c12878b4a6d59676d839e8ccc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c5f29b6d5424246c8c6d585c697032f4b4b6c49e316c9d28706cc0d0683609a3.yml diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 2ad186da4..4831b5425 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -28,9 +28,7 @@ class DevboxView(BaseModel): metadata: Dict[str, str] """The user defined Devbox metadata.""" - status: Literal[ - "provisioning", "initializing", "running", "suspending", "suspended", "resuming", "failure", "shutdown" - ] + status: Literal["provisioning", "initializing", "running", "failure", "shutdown"] """The current status of the Devbox.""" blueprint_id: Optional[str] = None From 3858cf423887532bd1444a40eeffbd90a1df9b7c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:53:29 +0000 Subject: [PATCH 240/993] feat(api): api update (#228) --- .stats.yml | 2 +- src/runloop_api_client/types/devbox_view.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7dc85dc14..9f3693352 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 29 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c5f29b6d5424246c8c6d585c697032f4b4b6c49e316c9d28706cc0d0683609a3.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6cf047d01929db28b7655b33123900eeb28f3c5c12878b4a6d59676d839e8ccc.yml diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 4831b5425..2ad186da4 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -28,7 +28,9 @@ class DevboxView(BaseModel): metadata: Dict[str, str] """The user defined Devbox metadata.""" - status: Literal["provisioning", "initializing", "running", "failure", "shutdown"] + status: Literal[ + "provisioning", "initializing", "running", "suspending", "suspended", "resuming", "failure", "shutdown" + ] """The current status of the Devbox.""" blueprint_id: Optional[str] = None From dad94b798581f1b690975efa704f26eb688d7a0c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 18:13:57 +0000 Subject: [PATCH 241/993] feat(api): api update (#229) --- .stats.yml | 2 +- api.md | 4 + .../resources/devboxes/devboxes.py | 237 ++++++++++++++++++ src/runloop_api_client/types/__init__.py | 1 + .../types/devbox_tunnel_view.py | 17 ++ tests/api_resources/test_devboxes.py | 229 +++++++++++++++++ 6 files changed, 489 insertions(+), 1 deletion(-) create mode 100644 src/runloop_api_client/types/devbox_tunnel_view.py diff --git a/.stats.yml b/.stats.yml index 9f3693352..b14afa98a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 29 +configured_endpoints: 32 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6cf047d01929db28b7655b33123900eeb28f3c5c12878b4a6d59676d839e8ccc.yml diff --git a/api.md b/api.md index 48c1ca6f7..16dff227f 100644 --- a/api.md +++ b/api.md @@ -50,6 +50,7 @@ from runloop_api_client.types import ( DevboxListView, DevboxSnapshotListView, DevboxSnapshotView, + DevboxTunnelView, DevboxView, DevboxCreateSSHKeyResponse, DevboxReadFileContentsResponse, @@ -63,13 +64,16 @@ Methods: - client.devboxes.retrieve(id) -> DevboxView - client.devboxes.list(\*\*params) -> DevboxListView - client.devboxes.create_ssh_key(id) -> DevboxCreateSSHKeyResponse +- client.devboxes.create_tunnel(id) -> DevboxTunnelView - client.devboxes.disk_snapshots(\*\*params) -> DevboxSnapshotListView - client.devboxes.download_file(id, \*\*params) -> BinaryAPIResponse - client.devboxes.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.read_file_contents(id, \*\*params) -> str +- client.devboxes.resume(id) -> DevboxView - client.devboxes.shutdown(id) -> DevboxView - client.devboxes.snapshot_disk(id, \*\*params) -> DevboxSnapshotView +- client.devboxes.suspend(id) -> DevboxView - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 36c719ff2..0ac6caf62 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -60,6 +60,7 @@ from ..._base_client import make_request_options from ...types.devbox_view import DevboxView from ...types.devbox_list_view import DevboxListView +from ...types.devbox_tunnel_view import DevboxTunnelView from ...types.devbox_snapshot_view import DevboxSnapshotView from ...types.devbox_snapshot_list_view import DevboxSnapshotListView from ...types.code_mount_parameters_param import CodeMountParametersParam @@ -314,6 +315,39 @@ def create_ssh_key( cast_to=DevboxCreateSSHKeyResponse, ) + def create_tunnel( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxTunnelView: + """ + Create a tunnel to an available port on the Devbox. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/create_tunnel", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxTunnelView, + ) + def disk_snapshots( self, *, @@ -530,6 +564,39 @@ def read_file_contents( cast_to=str, ) + def resume( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxView: + """ + Resume a suspended devbox by id. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/resume", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxView, + ) + def shutdown( self, id: str, @@ -610,6 +677,40 @@ def snapshot_disk( cast_to=DevboxSnapshotView, ) + def suspend( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxView: + """Suspend a devbox by id. + + This will take the devbox out of service. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/suspend", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxView, + ) + def upload_file( self, id: str, @@ -948,6 +1049,39 @@ async def create_ssh_key( cast_to=DevboxCreateSSHKeyResponse, ) + async def create_tunnel( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxTunnelView: + """ + Create a tunnel to an available port on the Devbox. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/create_tunnel", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxTunnelView, + ) + async def disk_snapshots( self, *, @@ -1164,6 +1298,39 @@ async def read_file_contents( cast_to=str, ) + async def resume( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxView: + """ + Resume a suspended devbox by id. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/resume", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxView, + ) + async def shutdown( self, id: str, @@ -1244,6 +1411,40 @@ async def snapshot_disk( cast_to=DevboxSnapshotView, ) + async def suspend( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxView: + """Suspend a devbox by id. + + This will take the devbox out of service. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/suspend", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxView, + ) + async def upload_file( self, id: str, @@ -1355,6 +1556,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.create_ssh_key = to_raw_response_wrapper( devboxes.create_ssh_key, ) + self.create_tunnel = to_raw_response_wrapper( + devboxes.create_tunnel, + ) self.disk_snapshots = to_raw_response_wrapper( devboxes.disk_snapshots, ) @@ -1371,12 +1575,18 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.read_file_contents = to_raw_response_wrapper( devboxes.read_file_contents, ) + self.resume = to_raw_response_wrapper( + devboxes.resume, + ) self.shutdown = to_raw_response_wrapper( devboxes.shutdown, ) self.snapshot_disk = to_raw_response_wrapper( devboxes.snapshot_disk, ) + self.suspend = to_raw_response_wrapper( + devboxes.suspend, + ) self.upload_file = to_raw_response_wrapper( devboxes.upload_file, ) @@ -1409,6 +1619,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.create_ssh_key = async_to_raw_response_wrapper( devboxes.create_ssh_key, ) + self.create_tunnel = async_to_raw_response_wrapper( + devboxes.create_tunnel, + ) self.disk_snapshots = async_to_raw_response_wrapper( devboxes.disk_snapshots, ) @@ -1425,12 +1638,18 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.read_file_contents = async_to_raw_response_wrapper( devboxes.read_file_contents, ) + self.resume = async_to_raw_response_wrapper( + devboxes.resume, + ) self.shutdown = async_to_raw_response_wrapper( devboxes.shutdown, ) self.snapshot_disk = async_to_raw_response_wrapper( devboxes.snapshot_disk, ) + self.suspend = async_to_raw_response_wrapper( + devboxes.suspend, + ) self.upload_file = async_to_raw_response_wrapper( devboxes.upload_file, ) @@ -1463,6 +1682,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.create_ssh_key = to_streamed_response_wrapper( devboxes.create_ssh_key, ) + self.create_tunnel = to_streamed_response_wrapper( + devboxes.create_tunnel, + ) self.disk_snapshots = to_streamed_response_wrapper( devboxes.disk_snapshots, ) @@ -1479,12 +1701,18 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.read_file_contents = to_streamed_response_wrapper( devboxes.read_file_contents, ) + self.resume = to_streamed_response_wrapper( + devboxes.resume, + ) self.shutdown = to_streamed_response_wrapper( devboxes.shutdown, ) self.snapshot_disk = to_streamed_response_wrapper( devboxes.snapshot_disk, ) + self.suspend = to_streamed_response_wrapper( + devboxes.suspend, + ) self.upload_file = to_streamed_response_wrapper( devboxes.upload_file, ) @@ -1517,6 +1745,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.create_ssh_key = async_to_streamed_response_wrapper( devboxes.create_ssh_key, ) + self.create_tunnel = async_to_streamed_response_wrapper( + devboxes.create_tunnel, + ) self.disk_snapshots = async_to_streamed_response_wrapper( devboxes.disk_snapshots, ) @@ -1533,12 +1764,18 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.read_file_contents = async_to_streamed_response_wrapper( devboxes.read_file_contents, ) + self.resume = async_to_streamed_response_wrapper( + devboxes.resume, + ) self.shutdown = async_to_streamed_response_wrapper( devboxes.shutdown, ) self.snapshot_disk = async_to_streamed_response_wrapper( devboxes.snapshot_disk, ) + self.suspend = async_to_streamed_response_wrapper( + devboxes.suspend, + ) self.upload_file = async_to_streamed_response_wrapper( devboxes.upload_file, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index a5fe07214..3d10e51f1 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -12,6 +12,7 @@ from .devbox_list_view import DevboxListView as DevboxListView from .project_list_view import ProjectListView as ProjectListView from .devbox_list_params import DevboxListParams as DevboxListParams +from .devbox_tunnel_view import DevboxTunnelView as DevboxTunnelView from .function_list_view import FunctionListView as FunctionListView from .blueprint_build_log import BlueprintBuildLog as BlueprintBuildLog from .blueprint_list_view import BlueprintListView as BlueprintListView diff --git a/src/runloop_api_client/types/devbox_tunnel_view.py b/src/runloop_api_client/types/devbox_tunnel_view.py new file mode 100644 index 000000000..ac47c82a0 --- /dev/null +++ b/src/runloop_api_client/types/devbox_tunnel_view.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .._models import BaseModel + +__all__ = ["DevboxTunnelView"] + + +class DevboxTunnelView(BaseModel): + devbox_id: str + """ID of the Devbox the tunnel routes to.""" + + port: int + """Port of the Devbox the tunnel routes to.""" + + url: str + """Public url used to access Devbox.""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index c9937b4dc..45031943d 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -14,6 +14,7 @@ from runloop_api_client.types import ( DevboxView, DevboxListView, + DevboxTunnelView, DevboxSnapshotView, DevboxSnapshotListView, DevboxExecutionDetailView, @@ -210,6 +211,44 @@ def test_path_params_create_ssh_key(self, client: Runloop) -> None: "", ) + @parametrize + def test_method_create_tunnel(self, client: Runloop) -> None: + devbox = client.devboxes.create_tunnel( + "id", + ) + assert_matches_type(DevboxTunnelView, devbox, path=["response"]) + + @parametrize + def test_raw_response_create_tunnel(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.create_tunnel( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(DevboxTunnelView, devbox, path=["response"]) + + @parametrize + def test_streaming_response_create_tunnel(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.create_tunnel( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(DevboxTunnelView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create_tunnel(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.create_tunnel( + "", + ) + @parametrize def test_method_disk_snapshots(self, client: Runloop) -> None: devbox = client.devboxes.disk_snapshots() @@ -445,6 +484,44 @@ def test_path_params_read_file_contents(self, client: Runloop) -> None: file_path="file_path", ) + @parametrize + def test_method_resume(self, client: Runloop) -> None: + devbox = client.devboxes.resume( + "id", + ) + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + def test_raw_response_resume(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.resume( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + def test_streaming_response_resume(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.resume( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_resume(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.resume( + "", + ) + @parametrize def test_method_shutdown(self, client: Runloop) -> None: devbox = client.devboxes.shutdown( @@ -530,6 +607,44 @@ def test_path_params_snapshot_disk(self, client: Runloop) -> None: id="", ) + @parametrize + def test_method_suspend(self, client: Runloop) -> None: + devbox = client.devboxes.suspend( + "id", + ) + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + def test_raw_response_suspend(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.suspend( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + def test_streaming_response_suspend(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.suspend( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_suspend(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.suspend( + "", + ) + @parametrize def test_method_upload_file(self, client: Runloop) -> None: devbox = client.devboxes.upload_file( @@ -804,6 +919,44 @@ async def test_path_params_create_ssh_key(self, async_client: AsyncRunloop) -> N "", ) + @parametrize + async def test_method_create_tunnel(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.create_tunnel( + "id", + ) + assert_matches_type(DevboxTunnelView, devbox, path=["response"]) + + @parametrize + async def test_raw_response_create_tunnel(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.create_tunnel( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(DevboxTunnelView, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_create_tunnel(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.create_tunnel( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(DevboxTunnelView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create_tunnel(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.create_tunnel( + "", + ) + @parametrize async def test_method_disk_snapshots(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.disk_snapshots() @@ -1039,6 +1192,44 @@ async def test_path_params_read_file_contents(self, async_client: AsyncRunloop) file_path="file_path", ) + @parametrize + async def test_method_resume(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.resume( + "id", + ) + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + async def test_raw_response_resume(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.resume( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_resume(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.resume( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_resume(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.resume( + "", + ) + @parametrize async def test_method_shutdown(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.shutdown( @@ -1124,6 +1315,44 @@ async def test_path_params_snapshot_disk(self, async_client: AsyncRunloop) -> No id="", ) + @parametrize + async def test_method_suspend(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.suspend( + "id", + ) + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + async def test_raw_response_suspend(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.suspend( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_suspend(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.suspend( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_suspend(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.suspend( + "", + ) + @parametrize async def test_method_upload_file(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.upload_file( From 99a51931227c00941ff76a83da89a49520fc731f Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 22 Oct 2024 18:17:43 +0000 Subject: [PATCH 242/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index b14afa98a..a06616ca2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6cf047d01929db28b7655b33123900eeb28f3c5c12878b4a6d59676d839e8ccc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d1c9bf36f07cc070f3bf4c0065d35b6e310907810b819b66539be4a950536496.yml From b699f757f011a98a6f0f9e30fa43e0d5b3a618df Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 18:19:35 +0000 Subject: [PATCH 243/993] feat(api): api update (#230) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index da59f99ea..2aca35ae2 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.4.0" + ".": "0.5.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index c64d8ef28..ec54406f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.4.0" +version = "0.5.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 719692362..02a84905c 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.4.0" # x-release-please-version +__version__ = "0.5.0" # x-release-please-version From 8f7e22d308d3cad488e5f83fbaf68fdb1b7b57cc Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 22 Oct 2024 19:12:30 +0000 Subject: [PATCH 244/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a06616ca2..b14afa98a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d1c9bf36f07cc070f3bf4c0065d35b6e310907810b819b66539be4a950536496.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6cf047d01929db28b7655b33123900eeb28f3c5c12878b4a6d59676d839e8ccc.yml From c990db9ec2b9980899a4ab14a3f18ad26e44cd32 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 22 Oct 2024 19:17:45 +0000 Subject: [PATCH 245/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index b14afa98a..a06616ca2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6cf047d01929db28b7655b33123900eeb28f3c5c12878b4a6d59676d839e8ccc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d1c9bf36f07cc070f3bf4c0065d35b6e310907810b819b66539be4a950536496.yml From db23341a4d9e801bf4b18aeffbbe8fc5cecea6d5 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 23 Oct 2024 15:52:08 +0000 Subject: [PATCH 246/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a06616ca2..b14afa98a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d1c9bf36f07cc070f3bf4c0065d35b6e310907810b819b66539be4a950536496.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6cf047d01929db28b7655b33123900eeb28f3c5c12878b4a6d59676d839e8ccc.yml From a9809c28fe6d580fe2859f265c4985aba91c10e7 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 23 Oct 2024 16:18:08 +0000 Subject: [PATCH 247/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index b14afa98a..a06616ca2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6cf047d01929db28b7655b33123900eeb28f3c5c12878b4a6d59676d839e8ccc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d1c9bf36f07cc070f3bf4c0065d35b6e310907810b819b66539be4a950536496.yml From 44adafcf68e0967d07e7937bfdd881a757bf410e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 19:18:20 +0000 Subject: [PATCH 248/993] feat(api): api update (#231) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 10 ---------- src/runloop_api_client/types/devbox_create_params.py | 6 ------ .../types/shared/launch_parameters.py | 6 ++++++ .../types/shared_params/launch_parameters.py | 8 +++++++- tests/api_resources/test_blueprints.py | 4 ++++ tests/api_resources/test_devboxes.py | 4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.stats.yml b/.stats.yml index a06616ca2..7de92ff41 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d1c9bf36f07cc070f3bf4c0065d35b6e310907810b819b66539be4a950536496.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-56beb98c6aa0c8bb041c5bb832d3c2a67812be83e1ff1099768e6c9b01f25e48.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 0ac6caf62..11ba45162 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -103,7 +103,6 @@ def with_streaming_response(self) -> DevboxesResourceWithStreamingResponse: def create( self, *, - available_ports: Iterable[int] | NotGiven = NOT_GIVEN, blueprint_id: str | NotGiven = NOT_GIVEN, blueprint_name: str | NotGiven = NOT_GIVEN, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, @@ -129,9 +128,6 @@ def create( the 'pending' state and will transition to 'running' once it is ready. Args: - available_ports: A list of ports to make available on the Devbox. Call createTunnel to open a - tunnel to the port. - blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be created with the default Runloop Devbox image. @@ -174,7 +170,6 @@ def create( "/v1/devboxes", body=maybe_transform( { - "available_ports": available_ports, "blueprint_id": blueprint_id, "blueprint_name": blueprint_name, "code_mounts": code_mounts, @@ -837,7 +832,6 @@ def with_streaming_response(self) -> AsyncDevboxesResourceWithStreamingResponse: async def create( self, *, - available_ports: Iterable[int] | NotGiven = NOT_GIVEN, blueprint_id: str | NotGiven = NOT_GIVEN, blueprint_name: str | NotGiven = NOT_GIVEN, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, @@ -863,9 +857,6 @@ async def create( the 'pending' state and will transition to 'running' once it is ready. Args: - available_ports: A list of ports to make available on the Devbox. Call createTunnel to open a - tunnel to the port. - blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be created with the default Runloop Devbox image. @@ -908,7 +899,6 @@ async def create( "/v1/devboxes", body=await async_maybe_transform( { - "available_ports": available_ports, "blueprint_id": blueprint_id, "blueprint_name": blueprint_name, "code_mounts": code_mounts, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 7f74600cd..092476a18 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -12,12 +12,6 @@ class DevboxCreateParams(TypedDict, total=False): - available_ports: Iterable[int] - """A list of ports to make available on the Devbox. - - Call createTunnel to open a tunnel to the port. - """ - blueprint_id: str """(Optional) Blueprint to use for the Devbox. diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index 438162797..5b7a19b84 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -9,6 +9,12 @@ class LaunchParameters(BaseModel): + available_ports: Optional[List[int]] = None + """A list of ports to make available on the Devbox. + + Call createTunnel to open a tunnel to the port. + """ + keep_alive_time_seconds: Optional[int] = None """Time in seconds after which Devbox will automatically shutdown. diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index 19995fdef..8a621c4af 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -2,13 +2,19 @@ from __future__ import annotations -from typing import List +from typing import List, Iterable from typing_extensions import Literal, TypedDict __all__ = ["LaunchParameters"] class LaunchParameters(TypedDict, total=False): + available_ports: Iterable[int] + """A list of ports to make available on the Devbox. + + Call createTunnel to open a tunnel to the port. + """ + keep_alive_time_seconds: int """Time in seconds after which Devbox will automatically shutdown. diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 229003632..42b83b4a3 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -56,6 +56,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ + "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", @@ -232,6 +233,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ + "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", @@ -302,6 +304,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ + "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", @@ -478,6 +481,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ + "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 45031943d..5e63aff8c 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -42,7 +42,6 @@ def test_method_create(self, client: Runloop) -> None: @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.create( - available_ports=[0, 0, 0], blueprint_id="blueprint_id", blueprint_name="blueprint_name", code_mounts=[ @@ -69,6 +68,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: environment_variables={"foo": "string"}, file_mounts={"foo": "string"}, launch_parameters={ + "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", @@ -750,7 +750,6 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.create( - available_ports=[0, 0, 0], blueprint_id="blueprint_id", blueprint_name="blueprint_name", code_mounts=[ @@ -777,6 +776,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - environment_variables={"foo": "string"}, file_mounts={"foo": "string"}, launch_parameters={ + "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", From abd0999c995ab1390dc50593e300960e9709a0b0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 20:17:58 +0000 Subject: [PATCH 249/993] feat(api): api update (#233) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 10 ++++++++++ src/runloop_api_client/types/devbox_create_params.py | 6 ++++++ .../types/shared/launch_parameters.py | 6 ------ .../types/shared_params/launch_parameters.py | 8 +------- tests/api_resources/test_blueprints.py | 4 ---- tests/api_resources/test_devboxes.py | 4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7de92ff41..a06616ca2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-56beb98c6aa0c8bb041c5bb832d3c2a67812be83e1ff1099768e6c9b01f25e48.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d1c9bf36f07cc070f3bf4c0065d35b6e310907810b819b66539be4a950536496.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 11ba45162..0ac6caf62 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -103,6 +103,7 @@ def with_streaming_response(self) -> DevboxesResourceWithStreamingResponse: def create( self, *, + available_ports: Iterable[int] | NotGiven = NOT_GIVEN, blueprint_id: str | NotGiven = NOT_GIVEN, blueprint_name: str | NotGiven = NOT_GIVEN, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, @@ -128,6 +129,9 @@ def create( the 'pending' state and will transition to 'running' once it is ready. Args: + available_ports: A list of ports to make available on the Devbox. Call createTunnel to open a + tunnel to the port. + blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be created with the default Runloop Devbox image. @@ -170,6 +174,7 @@ def create( "/v1/devboxes", body=maybe_transform( { + "available_ports": available_ports, "blueprint_id": blueprint_id, "blueprint_name": blueprint_name, "code_mounts": code_mounts, @@ -832,6 +837,7 @@ def with_streaming_response(self) -> AsyncDevboxesResourceWithStreamingResponse: async def create( self, *, + available_ports: Iterable[int] | NotGiven = NOT_GIVEN, blueprint_id: str | NotGiven = NOT_GIVEN, blueprint_name: str | NotGiven = NOT_GIVEN, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, @@ -857,6 +863,9 @@ async def create( the 'pending' state and will transition to 'running' once it is ready. Args: + available_ports: A list of ports to make available on the Devbox. Call createTunnel to open a + tunnel to the port. + blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be created with the default Runloop Devbox image. @@ -899,6 +908,7 @@ async def create( "/v1/devboxes", body=await async_maybe_transform( { + "available_ports": available_ports, "blueprint_id": blueprint_id, "blueprint_name": blueprint_name, "code_mounts": code_mounts, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 092476a18..7f74600cd 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -12,6 +12,12 @@ class DevboxCreateParams(TypedDict, total=False): + available_ports: Iterable[int] + """A list of ports to make available on the Devbox. + + Call createTunnel to open a tunnel to the port. + """ + blueprint_id: str """(Optional) Blueprint to use for the Devbox. diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index 5b7a19b84..438162797 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -9,12 +9,6 @@ class LaunchParameters(BaseModel): - available_ports: Optional[List[int]] = None - """A list of ports to make available on the Devbox. - - Call createTunnel to open a tunnel to the port. - """ - keep_alive_time_seconds: Optional[int] = None """Time in seconds after which Devbox will automatically shutdown. diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index 8a621c4af..19995fdef 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -2,19 +2,13 @@ from __future__ import annotations -from typing import List, Iterable +from typing import List from typing_extensions import Literal, TypedDict __all__ = ["LaunchParameters"] class LaunchParameters(TypedDict, total=False): - available_ports: Iterable[int] - """A list of ports to make available on the Devbox. - - Call createTunnel to open a tunnel to the port. - """ - keep_alive_time_seconds: int """Time in seconds after which Devbox will automatically shutdown. diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 42b83b4a3..229003632 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -56,7 +56,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ - "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", @@ -233,7 +232,6 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ - "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", @@ -304,7 +302,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ - "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", @@ -481,7 +478,6 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ - "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 5e63aff8c..45031943d 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -42,6 +42,7 @@ def test_method_create(self, client: Runloop) -> None: @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.create( + available_ports=[0, 0, 0], blueprint_id="blueprint_id", blueprint_name="blueprint_name", code_mounts=[ @@ -68,7 +69,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: environment_variables={"foo": "string"}, file_mounts={"foo": "string"}, launch_parameters={ - "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", @@ -750,6 +750,7 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.create( + available_ports=[0, 0, 0], blueprint_id="blueprint_id", blueprint_name="blueprint_name", code_mounts=[ @@ -776,7 +777,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - environment_variables={"foo": "string"}, file_mounts={"foo": "string"}, launch_parameters={ - "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", From 825905b9b7be46913e109cafdafa2321d5cd3a10 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 20:56:53 +0000 Subject: [PATCH 250/993] feat(api): api update (#234) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 10 ---------- src/runloop_api_client/types/devbox_create_params.py | 6 ------ .../types/shared/launch_parameters.py | 6 ++++++ .../types/shared_params/launch_parameters.py | 8 +++++++- tests/api_resources/test_blueprints.py | 4 ++++ tests/api_resources/test_devboxes.py | 4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.stats.yml b/.stats.yml index a06616ca2..7de92ff41 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d1c9bf36f07cc070f3bf4c0065d35b6e310907810b819b66539be4a950536496.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-56beb98c6aa0c8bb041c5bb832d3c2a67812be83e1ff1099768e6c9b01f25e48.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 0ac6caf62..11ba45162 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -103,7 +103,6 @@ def with_streaming_response(self) -> DevboxesResourceWithStreamingResponse: def create( self, *, - available_ports: Iterable[int] | NotGiven = NOT_GIVEN, blueprint_id: str | NotGiven = NOT_GIVEN, blueprint_name: str | NotGiven = NOT_GIVEN, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, @@ -129,9 +128,6 @@ def create( the 'pending' state and will transition to 'running' once it is ready. Args: - available_ports: A list of ports to make available on the Devbox. Call createTunnel to open a - tunnel to the port. - blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be created with the default Runloop Devbox image. @@ -174,7 +170,6 @@ def create( "/v1/devboxes", body=maybe_transform( { - "available_ports": available_ports, "blueprint_id": blueprint_id, "blueprint_name": blueprint_name, "code_mounts": code_mounts, @@ -837,7 +832,6 @@ def with_streaming_response(self) -> AsyncDevboxesResourceWithStreamingResponse: async def create( self, *, - available_ports: Iterable[int] | NotGiven = NOT_GIVEN, blueprint_id: str | NotGiven = NOT_GIVEN, blueprint_name: str | NotGiven = NOT_GIVEN, code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, @@ -863,9 +857,6 @@ async def create( the 'pending' state and will transition to 'running' once it is ready. Args: - available_ports: A list of ports to make available on the Devbox. Call createTunnel to open a - tunnel to the port. - blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be created with the default Runloop Devbox image. @@ -908,7 +899,6 @@ async def create( "/v1/devboxes", body=await async_maybe_transform( { - "available_ports": available_ports, "blueprint_id": blueprint_id, "blueprint_name": blueprint_name, "code_mounts": code_mounts, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 7f74600cd..092476a18 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -12,12 +12,6 @@ class DevboxCreateParams(TypedDict, total=False): - available_ports: Iterable[int] - """A list of ports to make available on the Devbox. - - Call createTunnel to open a tunnel to the port. - """ - blueprint_id: str """(Optional) Blueprint to use for the Devbox. diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index 438162797..5b7a19b84 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -9,6 +9,12 @@ class LaunchParameters(BaseModel): + available_ports: Optional[List[int]] = None + """A list of ports to make available on the Devbox. + + Call createTunnel to open a tunnel to the port. + """ + keep_alive_time_seconds: Optional[int] = None """Time in seconds after which Devbox will automatically shutdown. diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index 19995fdef..8a621c4af 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -2,13 +2,19 @@ from __future__ import annotations -from typing import List +from typing import List, Iterable from typing_extensions import Literal, TypedDict __all__ = ["LaunchParameters"] class LaunchParameters(TypedDict, total=False): + available_ports: Iterable[int] + """A list of ports to make available on the Devbox. + + Call createTunnel to open a tunnel to the port. + """ + keep_alive_time_seconds: int """Time in seconds after which Devbox will automatically shutdown. diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 229003632..42b83b4a3 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -56,6 +56,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ + "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", @@ -232,6 +233,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ + "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", @@ -302,6 +304,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ + "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", @@ -478,6 +481,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ + "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 45031943d..5e63aff8c 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -42,7 +42,6 @@ def test_method_create(self, client: Runloop) -> None: @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.create( - available_ports=[0, 0, 0], blueprint_id="blueprint_id", blueprint_name="blueprint_name", code_mounts=[ @@ -69,6 +68,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: environment_variables={"foo": "string"}, file_mounts={"foo": "string"}, launch_parameters={ + "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", @@ -750,7 +750,6 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.create( - available_ports=[0, 0, 0], blueprint_id="blueprint_id", blueprint_name="blueprint_name", code_mounts=[ @@ -777,6 +776,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - environment_variables={"foo": "string"}, file_mounts={"foo": "string"}, launch_parameters={ + "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], "resource_size_request": "SMALL", From 1b85a119ee41db0fabf91fd69026bdda7cf04038 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 23 Oct 2024 21:17:53 +0000 Subject: [PATCH 251/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7de92ff41..2d78be935 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-56beb98c6aa0c8bb041c5bb832d3c2a67812be83e1ff1099768e6c9b01f25e48.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-07fcefe880969dc7bb3c631d9943c83ff37c08f8f234fa303b05db09447b4a42.yml From d10eda03dbb6c63e842179c09707b9909e18de93 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 23 Oct 2024 21:36:33 +0000 Subject: [PATCH 252/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2d78be935..7de92ff41 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-07fcefe880969dc7bb3c631d9943c83ff37c08f8f234fa303b05db09447b4a42.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-56beb98c6aa0c8bb041c5bb832d3c2a67812be83e1ff1099768e6c9b01f25e48.yml From 62b4266cd433c4330cef836b19277f3b4891c339 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Oct 2024 22:05:27 +0000 Subject: [PATCH 253/993] feat(api): api update (#235) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2aca35ae2..4208b5cb7 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.5.0" + ".": "0.6.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index ec54406f5..458defbb9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.5.0" +version = "0.6.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 02a84905c..b2544e98a 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.5.0" # x-release-please-version +__version__ = "0.6.0" # x-release-please-version From 99fca3664149727a4368e275cd3c4d56318c51bd Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 23 Oct 2024 22:17:46 +0000 Subject: [PATCH 254/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7de92ff41..2d78be935 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-56beb98c6aa0c8bb041c5bb832d3c2a67812be83e1ff1099768e6c9b01f25e48.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-07fcefe880969dc7bb3c631d9943c83ff37c08f8f234fa303b05db09447b4a42.yml From c4abdccc7b35730552a3537cbdb48298c522630f Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 23 Oct 2024 22:52:45 +0000 Subject: [PATCH 255/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2d78be935..7de92ff41 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-07fcefe880969dc7bb3c631d9943c83ff37c08f8f234fa303b05db09447b4a42.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-56beb98c6aa0c8bb041c5bb832d3c2a67812be83e1ff1099768e6c9b01f25e48.yml From 54b71d8a9b849aceaf928d3680aed6e87bdcdaa8 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 23 Oct 2024 23:17:50 +0000 Subject: [PATCH 256/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7de92ff41..2d78be935 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-56beb98c6aa0c8bb041c5bb832d3c2a67812be83e1ff1099768e6c9b01f25e48.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-07fcefe880969dc7bb3c631d9943c83ff37c08f8f234fa303b05db09447b4a42.yml From 6295744aa2df7b53870a3099c80bd6f4695cb82b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Oct 2024 00:00:38 +0000 Subject: [PATCH 257/993] feat(api): api update (#236) --- .stats.yml | 2 +- api.md | 2 +- .../resources/devboxes/devboxes.py | 9 +++++++ src/runloop_api_client/types/__init__.py | 1 + .../types/devbox_create_tunnel_params.py | 12 ++++++++++ tests/api_resources/test_devboxes.py | 24 ++++++++++++------- 6 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 src/runloop_api_client/types/devbox_create_tunnel_params.py diff --git a/.stats.yml b/.stats.yml index 2d78be935..16c8a2301 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-07fcefe880969dc7bb3c631d9943c83ff37c08f8f234fa303b05db09447b4a42.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml diff --git a/api.md b/api.md index 16dff227f..075b95f85 100644 --- a/api.md +++ b/api.md @@ -64,7 +64,7 @@ Methods: - client.devboxes.retrieve(id) -> DevboxView - client.devboxes.list(\*\*params) -> DevboxListView - client.devboxes.create_ssh_key(id) -> DevboxCreateSSHKeyResponse -- client.devboxes.create_tunnel(id) -> DevboxTunnelView +- client.devboxes.create_tunnel(id, \*\*params) -> DevboxTunnelView - client.devboxes.disk_snapshots(\*\*params) -> DevboxSnapshotListView - client.devboxes.download_file(id, \*\*params) -> BinaryAPIResponse - client.devboxes.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 11ba45162..9893585f2 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -20,6 +20,7 @@ devbox_write_file_params, devbox_upload_file_params, devbox_execute_sync_params, + devbox_create_tunnel_params, devbox_download_file_params, devbox_execute_async_params, devbox_snapshot_disk_params, @@ -314,6 +315,7 @@ def create_tunnel( self, id: str, *, + port: int, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -325,6 +327,8 @@ def create_tunnel( Create a tunnel to an available port on the Devbox. Args: + port: Devbox port that tunnel will expose. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -337,6 +341,7 @@ def create_tunnel( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/create_tunnel", + body=maybe_transform({"port": port}, devbox_create_tunnel_params.DevboxCreateTunnelParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -1043,6 +1048,7 @@ async def create_tunnel( self, id: str, *, + port: int, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1054,6 +1060,8 @@ async def create_tunnel( Create a tunnel to an available port on the Devbox. Args: + port: Devbox port that tunnel will expose. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1066,6 +1074,7 @@ async def create_tunnel( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( f"/v1/devboxes/{id}/create_tunnel", + body=await async_maybe_transform({"port": port}, devbox_create_tunnel_params.DevboxCreateTunnelParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 3d10e51f1..cc42a3c39 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -29,6 +29,7 @@ from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams from .code_mount_parameters_param import CodeMountParametersParam as CodeMountParametersParam +from .devbox_create_tunnel_params import DevboxCreateTunnelParams as DevboxCreateTunnelParams from .devbox_download_file_params import DevboxDownloadFileParams as DevboxDownloadFileParams from .devbox_execute_async_params import DevboxExecuteAsyncParams as DevboxExecuteAsyncParams from .devbox_snapshot_disk_params import DevboxSnapshotDiskParams as DevboxSnapshotDiskParams diff --git a/src/runloop_api_client/types/devbox_create_tunnel_params.py b/src/runloop_api_client/types/devbox_create_tunnel_params.py new file mode 100644 index 000000000..5700e37ac --- /dev/null +++ b/src/runloop_api_client/types/devbox_create_tunnel_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["DevboxCreateTunnelParams"] + + +class DevboxCreateTunnelParams(TypedDict, total=False): + port: Required[int] + """Devbox port that tunnel will expose.""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 5e63aff8c..f3a9e088d 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -214,14 +214,16 @@ def test_path_params_create_ssh_key(self, client: Runloop) -> None: @parametrize def test_method_create_tunnel(self, client: Runloop) -> None: devbox = client.devboxes.create_tunnel( - "id", + id="id", + port=0, ) assert_matches_type(DevboxTunnelView, devbox, path=["response"]) @parametrize def test_raw_response_create_tunnel(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.create_tunnel( - "id", + id="id", + port=0, ) assert response.is_closed is True @@ -232,7 +234,8 @@ def test_raw_response_create_tunnel(self, client: Runloop) -> None: @parametrize def test_streaming_response_create_tunnel(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.create_tunnel( - "id", + id="id", + port=0, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -246,7 +249,8 @@ def test_streaming_response_create_tunnel(self, client: Runloop) -> None: def test_path_params_create_tunnel(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.with_raw_response.create_tunnel( - "", + id="", + port=0, ) @parametrize @@ -922,14 +926,16 @@ async def test_path_params_create_ssh_key(self, async_client: AsyncRunloop) -> N @parametrize async def test_method_create_tunnel(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.create_tunnel( - "id", + id="id", + port=0, ) assert_matches_type(DevboxTunnelView, devbox, path=["response"]) @parametrize async def test_raw_response_create_tunnel(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.create_tunnel( - "id", + id="id", + port=0, ) assert response.is_closed is True @@ -940,7 +946,8 @@ async def test_raw_response_create_tunnel(self, async_client: AsyncRunloop) -> N @parametrize async def test_streaming_response_create_tunnel(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.create_tunnel( - "id", + id="id", + port=0, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -954,7 +961,8 @@ async def test_streaming_response_create_tunnel(self, async_client: AsyncRunloop async def test_path_params_create_tunnel(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.with_raw_response.create_tunnel( - "", + id="", + port=0, ) @parametrize From ebb2c2f18b3064687f9c5a699e1d3ce11b7ae21d Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 24 Oct 2024 00:17:44 +0000 Subject: [PATCH 258/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 16c8a2301..30e57b9c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml From 8cae111c99c758d773293ebf8d7eeb6aa2abbbee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Oct 2024 00:30:23 +0000 Subject: [PATCH 259/993] feat(api): api update (#238) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4208b5cb7..1b77f506d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.6.0" + ".": "0.7.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 458defbb9..df2b828c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.6.0" +version = "0.7.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index b2544e98a..8af0ed385 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.6.0" # x-release-please-version +__version__ = "0.7.0" # x-release-please-version From fb097224db4234a17dab375f65038081685a5131 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 24 Oct 2024 01:57:55 +0000 Subject: [PATCH 260/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 30e57b9c4..16c8a2301 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml From 62019dd5554b9785fc624e1f790372d62c2eb424 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 24 Oct 2024 02:17:44 +0000 Subject: [PATCH 261/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 16c8a2301..30e57b9c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml From 2b79b0aef2b2725d6ad07a2ab35d9001134cd3ab Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 24 Oct 2024 15:21:17 +0000 Subject: [PATCH 262/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 30e57b9c4..16c8a2301 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml From d6e239b1d4099e4e217361e2432a6d5e7338e9c9 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 24 Oct 2024 16:17:44 +0000 Subject: [PATCH 263/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 16c8a2301..30e57b9c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml From 34828a6b922c2646fd6b5d7067716302b0cc6df4 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 25 Oct 2024 21:59:16 +0000 Subject: [PATCH 264/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 30e57b9c4..16c8a2301 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml From 38e6f38696eae3bff8f4b01e901a279b8a360fa3 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 25 Oct 2024 22:18:00 +0000 Subject: [PATCH 265/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 16c8a2301..30e57b9c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml From 48eb8320b08372472ec02160a179a1f56c5c659f Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Sun, 27 Oct 2024 21:43:14 +0000 Subject: [PATCH 266/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 30e57b9c4..16c8a2301 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml From a0b689824423e75c65d38d216073a4b11d50b0e1 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Sun, 27 Oct 2024 22:17:53 +0000 Subject: [PATCH 267/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 16c8a2301..30e57b9c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml From b5476176cff495c04acc174d879423fff28740e4 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Sun, 27 Oct 2024 22:20:21 +0000 Subject: [PATCH 268/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 30e57b9c4..16c8a2301 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml From 75afdf306c633457c371704a062c683eb0596067 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Sun, 27 Oct 2024 23:17:58 +0000 Subject: [PATCH 269/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 16c8a2301..30e57b9c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml From edf4271640e1ac4c0f34fce324710b47fe229fc7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 14:06:56 +0000 Subject: [PATCH 270/993] feat(api): api update (#239) --- .stats.yml | 2 +- requirements-dev.lock | 21 +++++++++------------ requirements.lock | 8 ++++---- src/runloop_api_client/_compat.py | 2 +- src/runloop_api_client/_models.py | 10 +++++----- src/runloop_api_client/_types.py | 6 ++++-- tests/conftest.py | 14 ++++++++------ 7 files changed, 32 insertions(+), 31 deletions(-) diff --git a/.stats.yml b/.stats.yml index 30e57b9c4..16c8a2301 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml diff --git a/requirements-dev.lock b/requirements-dev.lock index 13bb75fb5..3095573de 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -16,8 +16,6 @@ anyio==4.4.0 # via runloop-api-client argcomplete==3.1.2 # via nox -attrs==23.1.0 - # via pytest certifi==2023.7.22 # via httpcore # via httpx @@ -28,8 +26,9 @@ distlib==0.3.7 # via virtualenv distro==1.8.0 # via runloop-api-client -exceptiongroup==1.1.3 +exceptiongroup==1.2.2 # via anyio + # via pytest filelock==3.12.4 # via virtualenv h11==0.14.0 @@ -60,20 +59,18 @@ packaging==23.2 # via pytest platformdirs==3.11.0 # via virtualenv -pluggy==1.3.0 - # via pytest -py==1.11.0 +pluggy==1.5.0 # via pytest -pydantic==2.7.1 +pydantic==2.9.2 # via runloop-api-client -pydantic-core==2.18.2 +pydantic-core==2.23.4 # via pydantic pygments==2.18.0 # via rich pyright==1.1.380 -pytest==7.1.1 +pytest==8.3.3 # via pytest-asyncio -pytest-asyncio==0.21.1 +pytest-asyncio==0.24.0 python-dateutil==2.8.2 # via time-machine pytz==2023.3.post1 @@ -90,10 +87,10 @@ sniffio==1.3.0 # via httpx # via runloop-api-client time-machine==2.9.0 -tomli==2.0.1 +tomli==2.0.2 # via mypy # via pytest -typing-extensions==4.8.0 +typing-extensions==4.12.2 # via anyio # via mypy # via pydantic diff --git a/requirements.lock b/requirements.lock index 40847b24e..d04f8e874 100644 --- a/requirements.lock +++ b/requirements.lock @@ -19,7 +19,7 @@ certifi==2023.7.22 # via httpx distro==1.8.0 # via runloop-api-client -exceptiongroup==1.1.3 +exceptiongroup==1.2.2 # via anyio h11==0.14.0 # via httpcore @@ -30,15 +30,15 @@ httpx==0.25.2 idna==3.4 # via anyio # via httpx -pydantic==2.7.1 +pydantic==2.9.2 # via runloop-api-client -pydantic-core==2.18.2 +pydantic-core==2.23.4 # via pydantic sniffio==1.3.0 # via anyio # via httpx # via runloop-api-client -typing-extensions==4.8.0 +typing-extensions==4.12.2 # via anyio # via pydantic # via pydantic-core diff --git a/src/runloop_api_client/_compat.py b/src/runloop_api_client/_compat.py index 162a6fbe4..d89920d95 100644 --- a/src/runloop_api_client/_compat.py +++ b/src/runloop_api_client/_compat.py @@ -133,7 +133,7 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str: def model_dump( model: pydantic.BaseModel, *, - exclude: IncEx = None, + exclude: IncEx | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, warnings: bool = True, diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index d386eaa3a..42551b769 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -176,7 +176,7 @@ def __str__(self) -> str: # Based on https://github.com/samuelcolvin/pydantic/issues/1168#issuecomment-817742836. @classmethod @override - def construct( + def construct( # pyright: ignore[reportIncompatibleMethodOverride] cls: Type[ModelT], _fields_set: set[str] | None = None, **values: object, @@ -248,8 +248,8 @@ def model_dump( self, *, mode: Literal["json", "python"] | str = "python", - include: IncEx = None, - exclude: IncEx = None, + include: IncEx | None = None, + exclude: IncEx | None = None, by_alias: bool = False, exclude_unset: bool = False, exclude_defaults: bool = False, @@ -303,8 +303,8 @@ def model_dump_json( self, *, indent: int | None = None, - include: IncEx = None, - exclude: IncEx = None, + include: IncEx | None = None, + exclude: IncEx | None = None, by_alias: bool = False, exclude_unset: bool = False, exclude_defaults: bool = False, diff --git a/src/runloop_api_client/_types.py b/src/runloop_api_client/_types.py index d066b1aa0..1b43b06d2 100644 --- a/src/runloop_api_client/_types.py +++ b/src/runloop_api_client/_types.py @@ -16,7 +16,7 @@ Optional, Sequence, ) -from typing_extensions import Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable +from typing_extensions import Set, Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable import httpx import pydantic @@ -193,7 +193,9 @@ def get(self, __key: str) -> str | None: ... # Note: copied from Pydantic # https://github.com/pydantic/pydantic/blob/32ea570bf96e84234d2992e1ddf40ab8a565925a/pydantic/main.py#L49 -IncEx: TypeAlias = "set[int] | set[str] | dict[int, Any] | dict[str, Any] | None" +IncEx: TypeAlias = Union[ + Set[int], Set[str], Mapping[int, Union["IncEx", Literal[True]]], Mapping[str, Union["IncEx", Literal[True]]] +] PostParser = Callable[[Any], Any] diff --git a/tests/conftest.py b/tests/conftest.py index 405150e14..60d391097 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,11 +1,11 @@ from __future__ import annotations import os -import asyncio import logging from typing import TYPE_CHECKING, Iterator, AsyncIterator import pytest +from pytest_asyncio import is_async_test from runloop_api_client import Runloop, AsyncRunloop @@ -17,11 +17,13 @@ logging.getLogger("runloop_api_client").setLevel(logging.DEBUG) -@pytest.fixture(scope="session") -def event_loop() -> Iterator[asyncio.AbstractEventLoop]: - loop = asyncio.new_event_loop() - yield loop - loop.close() +# automatically add `pytest.mark.asyncio()` to all of our async tests +# so we don't have to add that boilerplate everywhere +def pytest_collection_modifyitems(items: list[pytest.Function]) -> None: + pytest_asyncio_tests = (item for item in items if is_async_test(item)) + session_scope_marker = pytest.mark.asyncio(loop_scope="session") + for async_test in pytest_asyncio_tests: + async_test.add_marker(session_scope_marker, append=False) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") From b022608e145a9c71ddbbabb53e4b06819af075f4 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 28 Oct 2024 14:18:06 +0000 Subject: [PATCH 271/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 16c8a2301..30e57b9c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml From 2a15557e8d6b1f56aebe17eca8f256741dd6b606 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 28 Oct 2024 19:46:42 +0000 Subject: [PATCH 272/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 30e57b9c4..16c8a2301 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml From 765c1634c496ef5268b07509f67c3c5bcb9d19b2 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 28 Oct 2024 20:43:59 +0000 Subject: [PATCH 273/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 16c8a2301..2178e20c0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f9e5b6865ee5f09818241f5c9cdc804a9d922ebffccc0e1191ee3cd921f75d4f.yml From ea39b2c680ede331d1dd8f13852898484c655aea Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 28 Oct 2024 20:59:58 +0000 Subject: [PATCH 274/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2178e20c0..eb27471a2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f9e5b6865ee5f09818241f5c9cdc804a9d922ebffccc0e1191ee3cd921f75d4f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-40ce276be35d71a55de3ba66f7b2a1281b39c8082d05419bb3584095718f0709.yml From 05aec4cd66446c02318bb89b8b1c7c8d7490eddc Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 28 Oct 2024 21:18:00 +0000 Subject: [PATCH 275/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index eb27471a2..30e57b9c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-40ce276be35d71a55de3ba66f7b2a1281b39c8082d05419bb3584095718f0709.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml From f886d3e80a2dc24b0b279ba5e8206d1a78a16745 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 29 Oct 2024 00:01:55 +0000 Subject: [PATCH 276/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 30e57b9c4..16c8a2301 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml From 78333f952013b464465149a188b284cde4c478db Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 29 Oct 2024 00:17:53 +0000 Subject: [PATCH 277/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 16c8a2301..30e57b9c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml From 06720480bbfe0d95aa31ed8481dc96c00d48c478 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 29 Oct 2024 00:46:36 +0000 Subject: [PATCH 278/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 30e57b9c4..16c8a2301 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml From a8643e25ba7600256bee28994787da684a3bac8c Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 29 Oct 2024 01:17:57 +0000 Subject: [PATCH 279/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 16c8a2301..30e57b9c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml From 6732d5af666ada90b9375d195a51fa86e956763b Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 29 Oct 2024 17:31:39 +0000 Subject: [PATCH 280/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 30e57b9c4..16c8a2301 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml From a35661e468d4e964b869ee7292852577dce4552b Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 29 Oct 2024 18:17:49 +0000 Subject: [PATCH 281/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 16c8a2301..30e57b9c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml From e66fa10c8690b945b524b2c5bd63297d7517eea1 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 29 Oct 2024 19:24:51 +0000 Subject: [PATCH 282/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 30e57b9c4..16c8a2301 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml From 07ba31c7eddf07fff0ea1f967808b035fd63c5d3 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 29 Oct 2024 20:17:55 +0000 Subject: [PATCH 283/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 16c8a2301..30e57b9c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml From ae792421a80a7bf282b1bef2d433a5e79460dc2f Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 29 Oct 2024 20:34:08 +0000 Subject: [PATCH 284/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 30e57b9c4..16c8a2301 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml From 28c3c8f8dafe8ae37c8b03c775a4dde748e89198 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 29 Oct 2024 21:17:47 +0000 Subject: [PATCH 285/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 16c8a2301..30e57b9c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml From 47354c03a160f0340220509d9c378665b2b18b0a Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 29 Oct 2024 22:46:41 +0000 Subject: [PATCH 286/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 30e57b9c4..16c8a2301 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml From 0313e7b3c6d454c73e76e90f5754a88d37dcb480 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 29 Oct 2024 23:17:47 +0000 Subject: [PATCH 287/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 16c8a2301..30e57b9c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3514fda365f190ba42def1c37a4893abb983bbc168970a03dcfb6fc1bd996a38.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml From 3943cb8b394cd2aed25df0298653caa1ff32f31d Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 29 Oct 2024 23:19:06 +0000 Subject: [PATCH 288/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 30e57b9c4..42b05cfa4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-80b27bf74d0e74edb61ee8100140df6cf5e37e34cd74bf7901029a273da83042.yml From 855011c1f7093d84f1b038ef821658f3748cb8d2 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 30 Oct 2024 00:18:14 +0000 Subject: [PATCH 289/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 42b05cfa4..30e57b9c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-80b27bf74d0e74edb61ee8100140df6cf5e37e34cd74bf7901029a273da83042.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml From 9947f25451a9d852f4ff5e66a8b6d5c077f585d0 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 30 Oct 2024 00:41:24 +0000 Subject: [PATCH 290/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 30e57b9c4..42b05cfa4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-80b27bf74d0e74edb61ee8100140df6cf5e37e34cd74bf7901029a273da83042.yml From df1d06ff9ceb69195be9209b8fe0195a274512fe Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 30 Oct 2024 01:17:46 +0000 Subject: [PATCH 291/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 42b05cfa4..30e57b9c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-80b27bf74d0e74edb61ee8100140df6cf5e37e34cd74bf7901029a273da83042.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml From 7352c007c04c9660f2bb1a36f0aede269880c335 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 30 Oct 2024 14:52:27 +0000 Subject: [PATCH 292/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 30e57b9c4..42b05cfa4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-80b27bf74d0e74edb61ee8100140df6cf5e37e34cd74bf7901029a273da83042.yml From 4ddf8ee1b05abb4a8c493480b3a2c7bf42cf7329 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 30 Oct 2024 15:18:13 +0000 Subject: [PATCH 293/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 42b05cfa4..30e57b9c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-80b27bf74d0e74edb61ee8100140df6cf5e37e34cd74bf7901029a273da83042.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml From 0b9ad18db25441629b6851930f739a5567765dc9 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 30 Oct 2024 18:34:00 +0000 Subject: [PATCH 294/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 30e57b9c4..ebc576f15 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml From 1ae58d6f42a3be5135a630f21ca4e455990396a1 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 30 Oct 2024 19:18:06 +0000 Subject: [PATCH 295/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ebc576f15..30e57b9c4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml From 26eaf4ad00ede950c7e47ad734d5d09f119661c1 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 30 Oct 2024 23:35:36 +0000 Subject: [PATCH 296/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 30e57b9c4..ebc576f15 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ab9bce72ab371de1bed419bb2815e09e8e78770780dd6b806fbaf6fdc414a67b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml From afa096503c2c97210b7c864f79430efc1a586ac7 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 31 Oct 2024 00:17:52 +0000 Subject: [PATCH 297/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ebc576f15..9d6e80360 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml From 6babc7fcdc49b36eee11af2830cb9fb11e1a1e43 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 31 Oct 2024 03:44:21 +0000 Subject: [PATCH 298/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9d6e80360..ebc576f15 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml From 7f18802a2579d061bc382bd7d9daec3bb02cc96b Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 31 Oct 2024 04:17:48 +0000 Subject: [PATCH 299/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ebc576f15..9d6e80360 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml From 7f1b70a2f48b57c374a74e4e2aaa0b2caaae2a74 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 31 Oct 2024 17:34:13 +0000 Subject: [PATCH 300/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9d6e80360..ebc576f15 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml From b2855faf0942336fe7e2bf16c2f626b34bd3217e Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 31 Oct 2024 18:17:52 +0000 Subject: [PATCH 301/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ebc576f15..9d6e80360 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml From 14812b3186d2d3b5ca94ec1f4b44dfbac7db89e5 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 31 Oct 2024 20:09:20 +0000 Subject: [PATCH 302/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9d6e80360..ebc576f15 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml From 05be49a957b4d30986696c5e6a6fccfe5d342f38 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 01:18:42 +0000 Subject: [PATCH 303/993] feat(api): api update (#241) --- .stats.yml | 2 +- .../types/devbox_disk_snapshots_response.py | 32 ------------------- src/runloop_api_client/types/resource_size.py | 7 ---- .../types/shared/lauch_parameters.py | 22 ------------- .../types/shared/resource_size.py | 7 ---- .../types/shared_params/lauch_parameters.py | 25 --------------- 6 files changed, 1 insertion(+), 94 deletions(-) delete mode 100644 src/runloop_api_client/types/devbox_disk_snapshots_response.py delete mode 100644 src/runloop_api_client/types/resource_size.py delete mode 100644 src/runloop_api_client/types/shared/lauch_parameters.py delete mode 100644 src/runloop_api_client/types/shared/resource_size.py delete mode 100644 src/runloop_api_client/types/shared_params/lauch_parameters.py diff --git a/.stats.yml b/.stats.yml index ebc576f15..9d6e80360 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml diff --git a/src/runloop_api_client/types/devbox_disk_snapshots_response.py b/src/runloop_api_client/types/devbox_disk_snapshots_response.py deleted file mode 100644 index 31fa9e713..000000000 --- a/src/runloop_api_client/types/devbox_disk_snapshots_response.py +++ /dev/null @@ -1,32 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Optional - -from pydantic import Field as FieldInfo - -from .._models import BaseModel - -__all__ = ["DevboxDiskSnapshotsResponse", "Snapshot"] - - -class Snapshot(BaseModel): - id: str - """The unique identifier of the snapshot.""" - - metadata: Dict[str, str] - """metadata associated with the snapshot.""" - - source_devbox_id: str = FieldInfo(alias="sourceDevboxId") - """The source devbox identifier.""" - - name: Optional[str] = None - """(Optional) The custom name of the snapshot.""" - - -class DevboxDiskSnapshotsResponse(BaseModel): - has_more: bool - - snapshots: List[Snapshot] - """List of snapshots matching filter.""" - - total_count: int diff --git a/src/runloop_api_client/types/resource_size.py b/src/runloop_api_client/types/resource_size.py deleted file mode 100644 index 956955c87..000000000 --- a/src/runloop_api_client/types/resource_size.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["ResourceSize"] - -ResourceSize: TypeAlias = Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "CUSTOM_SIZE"] diff --git a/src/runloop_api_client/types/shared/lauch_parameters.py b/src/runloop_api_client/types/shared/lauch_parameters.py deleted file mode 100644 index bc0ae8f25..000000000 --- a/src/runloop_api_client/types/shared/lauch_parameters.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel -from ..resource_size import ResourceSize - -__all__ = ["LauchParameters"] - - -class LauchParameters(BaseModel): - keep_alive_time_seconds: Optional[int] = None - """Time in seconds after which Devbox will automatically shutdown. - - Default is 1 hour. - """ - - launch_commands: Optional[List[str]] = None - """Set of commands to be run at launch time, before the entrypoint process is run.""" - - resource_size_request: Optional[ResourceSize] = None - """Manual resource configuration for Devbox. If not set, defaults will be used.""" diff --git a/src/runloop_api_client/types/shared/resource_size.py b/src/runloop_api_client/types/shared/resource_size.py deleted file mode 100644 index 956955c87..000000000 --- a/src/runloop_api_client/types/shared/resource_size.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["ResourceSize"] - -ResourceSize: TypeAlias = Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "CUSTOM_SIZE"] diff --git a/src/runloop_api_client/types/shared_params/lauch_parameters.py b/src/runloop_api_client/types/shared_params/lauch_parameters.py deleted file mode 100644 index 371f1b652..000000000 --- a/src/runloop_api_client/types/shared_params/lauch_parameters.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List -from typing_extensions import TypedDict - -from .resource_size import ResourceSize -from ..resource_size import ResourceSize - -__all__ = ["LauchParameters"] - - -class LauchParameters(TypedDict, total=False): - keep_alive_time_seconds: int - """Time in seconds after which Devbox will automatically shutdown. - - Default is 1 hour. - """ - - launch_commands: List[str] - """Set of commands to be run at launch time, before the entrypoint process is run.""" - - resource_size_request: ResourceSize - """Manual resource configuration for Devbox. If not set, defaults will be used.""" From f7b7f7b2c9ec1094cd1d4616ba7dab1797aaef51 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 19:46:01 +0000 Subject: [PATCH 304/993] feat(api): api update (#242) --- .stats.yml | 2 +- requirements-dev.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9d6e80360..ebc576f15 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml diff --git a/requirements-dev.lock b/requirements-dev.lock index 3095573de..332c5abbd 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -48,7 +48,7 @@ markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py -mypy==1.11.2 +mypy==1.13.0 mypy-extensions==1.0.0 # via mypy nodeenv==1.8.0 From 6ead4fd43722b50c46942cee7666bfe1d341f3ea Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 1 Nov 2024 20:18:07 +0000 Subject: [PATCH 305/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ebc576f15..9d6e80360 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml From 26bc21930df5bde895ae21ed4deb4665f3404523 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 2 Nov 2024 19:19:35 +0000 Subject: [PATCH 306/993] feat(api): api update (#243) --- .stats.yml | 2 +- src/runloop_api_client/_utils/_transform.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9d6e80360..ebc576f15 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml diff --git a/src/runloop_api_client/_utils/_transform.py b/src/runloop_api_client/_utils/_transform.py index 47e262a51..7e9663d36 100644 --- a/src/runloop_api_client/_utils/_transform.py +++ b/src/runloop_api_client/_utils/_transform.py @@ -173,6 +173,11 @@ def _transform_recursive( # Iterable[T] or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str)) ): + # dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually + # intended as an iterable, so we don't transform it. + if isinstance(data, dict): + return cast(object, data) + inner_type = extract_type_arg(stripped_type, 0) return [_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data] From dfb35d8212aab22065c7e1f374c9737af646c529 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Sat, 2 Nov 2024 20:18:13 +0000 Subject: [PATCH 307/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ebc576f15..9d6e80360 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml From a6036e5e03b7ce7d98ebb80c2a9a4ef7936b0887 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 17:10:01 +0000 Subject: [PATCH 308/993] feat(api): api update (#244) --- .stats.yml | 2 +- src/runloop_api_client/_compat.py | 6 ++++-- src/runloop_api_client/_models.py | 9 ++++++--- src/runloop_api_client/_utils/__init__.py | 1 + src/runloop_api_client/_utils/_transform.py | 4 ++-- src/runloop_api_client/_utils/_utils.py | 17 +++++++++++++++++ tests/test_models.py | 21 +++++++-------------- tests/test_transform.py | 15 +++++++++++++++ 8 files changed, 53 insertions(+), 22 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9d6e80360..ebc576f15 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml diff --git a/src/runloop_api_client/_compat.py b/src/runloop_api_client/_compat.py index d89920d95..4794129c4 100644 --- a/src/runloop_api_client/_compat.py +++ b/src/runloop_api_client/_compat.py @@ -2,7 +2,7 @@ from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload from datetime import date, datetime -from typing_extensions import Self +from typing_extensions import Self, Literal import pydantic from pydantic.fields import FieldInfo @@ -137,9 +137,11 @@ def model_dump( exclude_unset: bool = False, exclude_defaults: bool = False, warnings: bool = True, + mode: Literal["json", "python"] = "python", ) -> dict[str, Any]: - if PYDANTIC_V2: + if PYDANTIC_V2 or hasattr(model, "model_dump"): return model.model_dump( + mode=mode, exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index 42551b769..6cb469e21 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -37,6 +37,7 @@ PropertyInfo, is_list, is_given, + json_safe, lru_cache, is_mapping, parse_date, @@ -279,8 +280,8 @@ def model_dump( Returns: A dictionary representation of the model. """ - if mode != "python": - raise ValueError("mode is only supported in Pydantic v2") + if mode not in {"json", "python"}: + raise ValueError("mode must be either 'json' or 'python'") if round_trip != False: raise ValueError("round_trip is only supported in Pydantic v2") if warnings != True: @@ -289,7 +290,7 @@ def model_dump( raise ValueError("context is only supported in Pydantic v2") if serialize_as_any != False: raise ValueError("serialize_as_any is only supported in Pydantic v2") - return super().dict( # pyright: ignore[reportDeprecated] + dumped = super().dict( # pyright: ignore[reportDeprecated] include=include, exclude=exclude, by_alias=by_alias, @@ -298,6 +299,8 @@ def model_dump( exclude_none=exclude_none, ) + return cast(dict[str, Any], json_safe(dumped)) if mode == "json" else dumped + @override def model_dump_json( self, diff --git a/src/runloop_api_client/_utils/__init__.py b/src/runloop_api_client/_utils/__init__.py index 3efe66c8e..a7cff3c09 100644 --- a/src/runloop_api_client/_utils/__init__.py +++ b/src/runloop_api_client/_utils/__init__.py @@ -6,6 +6,7 @@ is_list as is_list, is_given as is_given, is_tuple as is_tuple, + json_safe as json_safe, lru_cache as lru_cache, is_mapping as is_mapping, is_tuple_t as is_tuple_t, diff --git a/src/runloop_api_client/_utils/_transform.py b/src/runloop_api_client/_utils/_transform.py index 7e9663d36..d7c05345d 100644 --- a/src/runloop_api_client/_utils/_transform.py +++ b/src/runloop_api_client/_utils/_transform.py @@ -191,7 +191,7 @@ def _transform_recursive( return data if isinstance(data, pydantic.BaseModel): - return model_dump(data, exclude_unset=True) + return model_dump(data, exclude_unset=True, mode="json") annotated_type = _get_annotated_type(annotation) if annotated_type is None: @@ -329,7 +329,7 @@ async def _async_transform_recursive( return data if isinstance(data, pydantic.BaseModel): - return model_dump(data, exclude_unset=True) + return model_dump(data, exclude_unset=True, mode="json") annotated_type = _get_annotated_type(annotation) if annotated_type is None: diff --git a/src/runloop_api_client/_utils/_utils.py b/src/runloop_api_client/_utils/_utils.py index 0bba17caa..e5811bba4 100644 --- a/src/runloop_api_client/_utils/_utils.py +++ b/src/runloop_api_client/_utils/_utils.py @@ -16,6 +16,7 @@ overload, ) from pathlib import Path +from datetime import date, datetime from typing_extensions import TypeGuard import sniffio @@ -395,3 +396,19 @@ def lru_cache(*, maxsize: int | None = 128) -> Callable[[CallableT], CallableT]: maxsize=maxsize, ) return cast(Any, wrapper) # type: ignore[no-any-return] + + +def json_safe(data: object) -> object: + """Translates a mapping / sequence recursively in the same fashion + as `pydantic` v2's `model_dump(mode="json")`. + """ + if is_mapping(data): + return {json_safe(key): json_safe(value) for key, value in data.items()} + + if is_iterable(data) and not isinstance(data, (str, bytes, bytearray)): + return [json_safe(item) for item in data] + + if isinstance(data, (datetime, date)): + return data.isoformat() + + return data diff --git a/tests/test_models.py b/tests/test_models.py index 14b49009f..2023eaef5 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -520,19 +520,15 @@ class Model(BaseModel): assert m3.to_dict(exclude_none=True) == {} assert m3.to_dict(exclude_defaults=True) == {} - if PYDANTIC_V2: - - class Model2(BaseModel): - created_at: datetime + class Model2(BaseModel): + created_at: datetime - time_str = "2024-03-21T11:39:01.275859" - m4 = Model2.construct(created_at=time_str) - assert m4.to_dict(mode="python") == {"created_at": datetime.fromisoformat(time_str)} - assert m4.to_dict(mode="json") == {"created_at": time_str} - else: - with pytest.raises(ValueError, match="mode is only supported in Pydantic v2"): - m.to_dict(mode="json") + time_str = "2024-03-21T11:39:01.275859" + m4 = Model2.construct(created_at=time_str) + assert m4.to_dict(mode="python") == {"created_at": datetime.fromisoformat(time_str)} + assert m4.to_dict(mode="json") == {"created_at": time_str} + if not PYDANTIC_V2: with pytest.raises(ValueError, match="warnings is only supported in Pydantic v2"): m.to_dict(warnings=False) @@ -558,9 +554,6 @@ class Model(BaseModel): assert m3.model_dump(exclude_none=True) == {} if not PYDANTIC_V2: - with pytest.raises(ValueError, match="mode is only supported in Pydantic v2"): - m.model_dump(mode="json") - with pytest.raises(ValueError, match="round_trip is only supported in Pydantic v2"): m.model_dump(round_trip=True) diff --git a/tests/test_transform.py b/tests/test_transform.py index 969ae7ecb..839b59a76 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -177,17 +177,32 @@ class DateDict(TypedDict, total=False): foo: Annotated[date, PropertyInfo(format="iso8601")] +class DatetimeModel(BaseModel): + foo: datetime + + +class DateModel(BaseModel): + foo: Optional[date] + + @parametrize @pytest.mark.asyncio async def test_iso8601_format(use_async: bool) -> None: dt = datetime.fromisoformat("2023-02-23T14:16:36.337692+00:00") + tz = "Z" if PYDANTIC_V2 else "+00:00" assert await transform({"foo": dt}, DatetimeDict, use_async) == {"foo": "2023-02-23T14:16:36.337692+00:00"} # type: ignore[comparison-overlap] + assert await transform(DatetimeModel(foo=dt), Any, use_async) == {"foo": "2023-02-23T14:16:36.337692" + tz} # type: ignore[comparison-overlap] dt = dt.replace(tzinfo=None) assert await transform({"foo": dt}, DatetimeDict, use_async) == {"foo": "2023-02-23T14:16:36.337692"} # type: ignore[comparison-overlap] + assert await transform(DatetimeModel(foo=dt), Any, use_async) == {"foo": "2023-02-23T14:16:36.337692"} # type: ignore[comparison-overlap] assert await transform({"foo": None}, DateDict, use_async) == {"foo": None} # type: ignore[comparison-overlap] + assert await transform(DateModel(foo=None), Any, use_async) == {"foo": None} # type: ignore assert await transform({"foo": date.fromisoformat("2023-02-23")}, DateDict, use_async) == {"foo": "2023-02-23"} # type: ignore[comparison-overlap] + assert await transform(DateModel(foo=date.fromisoformat("2023-02-23")), DateDict, use_async) == { + "foo": "2023-02-23" + } # type: ignore[comparison-overlap] @parametrize From 63c96886f7816f730dbd41e3b3a3296a31a23713 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 4 Nov 2024 17:16:55 +0000 Subject: [PATCH 309/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ebc576f15..9d6e80360 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml From 1af41985f3d59133a1ac7607efb154f012cf147a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 19:07:54 +0000 Subject: [PATCH 310/993] feat(api): api update (#245) --- .stats.yml | 2 +- README.md | 4 ++-- pyproject.toml | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9d6e80360..ebc576f15 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml diff --git a/README.md b/README.md index 16c2947ae..94f81d1a5 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![PyPI version](https://img.shields.io/pypi/v/runloop_api_client.svg)](https://pypi.org/project/runloop_api_client/) -The Runloop Python library provides convenient access to the Runloop REST API from any Python 3.7+ +The Runloop Python library provides convenient access to the Runloop REST API from any Python 3.8+ application. The library includes type definitions for all request params and response fields, and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx). @@ -314,7 +314,7 @@ print(runloop_api_client.__version__) ## Requirements -Python 3.7 or higher. +Python 3.8 or higher. ## Contributing diff --git a/pyproject.toml b/pyproject.toml index df2b828c8..53af3fbc2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,11 +16,10 @@ dependencies = [ "sniffio", "cached-property; python_version < '3.8'", ] -requires-python = ">= 3.7" +requires-python = ">= 3.8" classifiers = [ "Typing :: Typed", "Intended Audience :: Developers", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -139,7 +138,7 @@ filterwarnings = [ # there are a couple of flags that are still disabled by # default in strict mode as they are experimental and niche. typeCheckingMode = "strict" -pythonVersion = "3.7" +pythonVersion = "3.8" exclude = [ "_dev", From bc30d75402f66b8b6b525e799876e0a4be1cc8e9 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 4 Nov 2024 19:16:57 +0000 Subject: [PATCH 311/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ebc576f15..9d6e80360 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml From 2fd0b3205c7646742536ecf1f6f256007c691d81 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 4 Nov 2024 19:20:29 +0000 Subject: [PATCH 312/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9d6e80360..ebc576f15 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml From f77c73a89b7b80a118445d24bd5a4496db14c3bf Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 4 Nov 2024 20:16:58 +0000 Subject: [PATCH 313/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ebc576f15..9d6e80360 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml From 073a9df1e2d0be0948741b249c468aac18dce8fe Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 4 Nov 2024 21:56:04 +0000 Subject: [PATCH 314/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9d6e80360..ebc576f15 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml From 1e754b5e8fbe2d535b809ef0a9f70d634cffe3f4 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 4 Nov 2024 22:17:50 +0000 Subject: [PATCH 315/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ebc576f15..9d6e80360 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml From 106a9cf21773424b7cd43d5d38a21984d64c356d Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 4 Nov 2024 23:10:10 +0000 Subject: [PATCH 316/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9d6e80360..ebc576f15 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml From 1b21892fdc2a64ee02529fb15eff2a7d9e395e9d Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 4 Nov 2024 23:18:47 +0000 Subject: [PATCH 317/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ebc576f15..9d6e80360 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml From fbb0063fedf15f5f8d7cf99b9d7e41330d15f3a8 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 5 Nov 2024 00:30:33 +0000 Subject: [PATCH 318/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9d6e80360..ebc576f15 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml From d7e8f1e3092ccb68bd8973fcb058f3c12c023542 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 5 Nov 2024 01:18:15 +0000 Subject: [PATCH 319/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ebc576f15..9d6e80360 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml From e3eec55795fbbe5431c0256526bbab49e8d31e38 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 5 Nov 2024 01:33:40 +0000 Subject: [PATCH 320/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9d6e80360..ebc576f15 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml From 2b095801de9ed72e7c82d295b961b4ff8f51573e Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 5 Nov 2024 02:18:22 +0000 Subject: [PATCH 321/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ebc576f15..9d6e80360 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml From 383ac55f039c2f970145fdf05dfaff2fc06c2ff0 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 5 Nov 2024 04:06:47 +0000 Subject: [PATCH 322/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9d6e80360..ebc576f15 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml From 3cd460078e0ca327eb830bb2dc8faaec671963a6 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 5 Nov 2024 04:17:17 +0000 Subject: [PATCH 323/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ebc576f15..9d6e80360 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml From 2d795b78b49f2059ba816edf00fd2d8031c55332 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 5 Nov 2024 18:01:22 +0000 Subject: [PATCH 324/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9d6e80360..ebc576f15 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml From d83885218ac2c42737bf2d25a84bd1e13125115f Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 5 Nov 2024 18:17:26 +0000 Subject: [PATCH 325/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ebc576f15..9d6e80360 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml From 54a292b7cd0fa82ad703a63b224147e2b54c2544 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 5 Nov 2024 18:50:13 +0000 Subject: [PATCH 326/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9d6e80360..ebc576f15 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml From 92905bd55938e0c2a5715962a072dc70980a6792 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 5 Nov 2024 20:17:11 +0000 Subject: [PATCH 327/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ebc576f15..9d6e80360 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml From e7b985b83e679b1dce3fd5a94fe68e29896dc7e3 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 5 Nov 2024 21:19:28 +0000 Subject: [PATCH 328/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9d6e80360..ebc576f15 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml From b079d8ae6ffbf240b965f2a589f4e85935a7dced Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 22:08:53 +0000 Subject: [PATCH 329/993] feat(api): api update (#246) --- .stats.yml | 2 +- .../types/shared/launch_parameters.py | 16 +++++++++++++++- .../types/shared_params/launch_parameters.py | 18 ++++++++++++++++-- tests/api_resources/test_blueprints.py | 16 ++++++++++++++++ tests/api_resources/test_devboxes.py | 8 ++++++++ 5 files changed, 56 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index ebc576f15..4ff237508 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f01e27b49a9956c66510af5fd655d1a4c0daab8d24bd67fb0b74369e43a62d2d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a685abd27bfc2a49493a3a944b4f53e89fb76cfe13945ff32b47e6e36e1857ad.yml diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index 5b7a19b84..cd366bad6 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -5,10 +5,24 @@ from ..._models import BaseModel -__all__ = ["LaunchParameters"] +__all__ = ["LaunchParameters", "AfterIdle"] + + +class AfterIdle(BaseModel): + idle_time_seconds: int + """After idle_time_seconds, on_idle action will be taken.""" + + on_idle: Literal["unknown", "shutdown", "suspend"] + """Action to take after Devbox becomes idle.""" class LaunchParameters(BaseModel): + after_idle: Optional[AfterIdle] = None + """Configure Devbox lifecycle based on idle activity. + + If after_idle is set, Devbox will ignore keep_alive_time_seconds. + """ + available_ports: Optional[List[int]] = None """A list of ports to make available on the Devbox. diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index 8a621c4af..8d695139d 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -3,12 +3,26 @@ from __future__ import annotations from typing import List, Iterable -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict -__all__ = ["LaunchParameters"] +__all__ = ["LaunchParameters", "AfterIdle"] + + +class AfterIdle(TypedDict, total=False): + idle_time_seconds: Required[int] + """After idle_time_seconds, on_idle action will be taken.""" + + on_idle: Required[Literal["unknown", "shutdown", "suspend"]] + """Action to take after Devbox becomes idle.""" class LaunchParameters(TypedDict, total=False): + after_idle: AfterIdle + """Configure Devbox lifecycle based on idle activity. + + If after_idle is set, Devbox will ignore keep_alive_time_seconds. + """ + available_ports: Iterable[int] """A list of ports to make available on the Devbox. diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 42b83b4a3..765cdec37 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -56,6 +56,10 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "unknown", + }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], @@ -233,6 +237,10 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "unknown", + }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], @@ -304,6 +312,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "unknown", + }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], @@ -481,6 +493,10 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "unknown", + }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index f3a9e088d..a3f6cea16 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -68,6 +68,10 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: environment_variables={"foo": "string"}, file_mounts={"foo": "string"}, launch_parameters={ + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "unknown", + }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], @@ -780,6 +784,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - environment_variables={"foo": "string"}, file_mounts={"foo": "string"}, launch_parameters={ + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "unknown", + }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], From 7fdea8b6cf2602064878d66d7914c142619a33cd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 22:17:31 +0000 Subject: [PATCH 330/993] feat(api): api update (#247) --- .stats.yml | 2 +- .../types/shared/launch_parameters.py | 16 +--------------- .../types/shared_params/launch_parameters.py | 18 ++---------------- tests/api_resources/test_blueprints.py | 16 ---------------- tests/api_resources/test_devboxes.py | 8 -------- 5 files changed, 4 insertions(+), 56 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4ff237508..9d6e80360 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a685abd27bfc2a49493a3a944b4f53e89fb76cfe13945ff32b47e6e36e1857ad.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index cd366bad6..5b7a19b84 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -5,24 +5,10 @@ from ..._models import BaseModel -__all__ = ["LaunchParameters", "AfterIdle"] - - -class AfterIdle(BaseModel): - idle_time_seconds: int - """After idle_time_seconds, on_idle action will be taken.""" - - on_idle: Literal["unknown", "shutdown", "suspend"] - """Action to take after Devbox becomes idle.""" +__all__ = ["LaunchParameters"] class LaunchParameters(BaseModel): - after_idle: Optional[AfterIdle] = None - """Configure Devbox lifecycle based on idle activity. - - If after_idle is set, Devbox will ignore keep_alive_time_seconds. - """ - available_ports: Optional[List[int]] = None """A list of ports to make available on the Devbox. diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index 8d695139d..8a621c4af 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -3,26 +3,12 @@ from __future__ import annotations from typing import List, Iterable -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Literal, TypedDict -__all__ = ["LaunchParameters", "AfterIdle"] - - -class AfterIdle(TypedDict, total=False): - idle_time_seconds: Required[int] - """After idle_time_seconds, on_idle action will be taken.""" - - on_idle: Required[Literal["unknown", "shutdown", "suspend"]] - """Action to take after Devbox becomes idle.""" +__all__ = ["LaunchParameters"] class LaunchParameters(TypedDict, total=False): - after_idle: AfterIdle - """Configure Devbox lifecycle based on idle activity. - - If after_idle is set, Devbox will ignore keep_alive_time_seconds. - """ - available_ports: Iterable[int] """A list of ports to make available on the Devbox. diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 765cdec37..42b83b4a3 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -56,10 +56,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ - "after_idle": { - "idle_time_seconds": 0, - "on_idle": "unknown", - }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], @@ -237,10 +233,6 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ - "after_idle": { - "idle_time_seconds": 0, - "on_idle": "unknown", - }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], @@ -312,10 +304,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ - "after_idle": { - "idle_time_seconds": 0, - "on_idle": "unknown", - }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], @@ -493,10 +481,6 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ - "after_idle": { - "idle_time_seconds": 0, - "on_idle": "unknown", - }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index a3f6cea16..f3a9e088d 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -68,10 +68,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: environment_variables={"foo": "string"}, file_mounts={"foo": "string"}, launch_parameters={ - "after_idle": { - "idle_time_seconds": 0, - "on_idle": "unknown", - }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], @@ -784,10 +780,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - environment_variables={"foo": "string"}, file_mounts={"foo": "string"}, launch_parameters={ - "after_idle": { - "idle_time_seconds": 0, - "on_idle": "unknown", - }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], From d2900c63e64614b255aeaed4d4de1edb1e727242 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 22:27:58 +0000 Subject: [PATCH 331/993] feat(api): api update (#248) --- .stats.yml | 2 +- .../types/shared/launch_parameters.py | 16 +++++++++++++++- .../types/shared_params/launch_parameters.py | 18 ++++++++++++++++-- tests/api_resources/test_blueprints.py | 16 ++++++++++++++++ tests/api_resources/test_devboxes.py | 8 ++++++++ 5 files changed, 56 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9d6e80360..4ff237508 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2e3b777b8fc9e4acd582a11a152308408a8ec85c69c5b9c8fdce52262bd94073.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a685abd27bfc2a49493a3a944b4f53e89fb76cfe13945ff32b47e6e36e1857ad.yml diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index 5b7a19b84..cd366bad6 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -5,10 +5,24 @@ from ..._models import BaseModel -__all__ = ["LaunchParameters"] +__all__ = ["LaunchParameters", "AfterIdle"] + + +class AfterIdle(BaseModel): + idle_time_seconds: int + """After idle_time_seconds, on_idle action will be taken.""" + + on_idle: Literal["unknown", "shutdown", "suspend"] + """Action to take after Devbox becomes idle.""" class LaunchParameters(BaseModel): + after_idle: Optional[AfterIdle] = None + """Configure Devbox lifecycle based on idle activity. + + If after_idle is set, Devbox will ignore keep_alive_time_seconds. + """ + available_ports: Optional[List[int]] = None """A list of ports to make available on the Devbox. diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index 8a621c4af..8d695139d 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -3,12 +3,26 @@ from __future__ import annotations from typing import List, Iterable -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict -__all__ = ["LaunchParameters"] +__all__ = ["LaunchParameters", "AfterIdle"] + + +class AfterIdle(TypedDict, total=False): + idle_time_seconds: Required[int] + """After idle_time_seconds, on_idle action will be taken.""" + + on_idle: Required[Literal["unknown", "shutdown", "suspend"]] + """Action to take after Devbox becomes idle.""" class LaunchParameters(TypedDict, total=False): + after_idle: AfterIdle + """Configure Devbox lifecycle based on idle activity. + + If after_idle is set, Devbox will ignore keep_alive_time_seconds. + """ + available_ports: Iterable[int] """A list of ports to make available on the Devbox. diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 42b83b4a3..765cdec37 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -56,6 +56,10 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "unknown", + }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], @@ -233,6 +237,10 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "unknown", + }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], @@ -304,6 +312,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "unknown", + }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], @@ -481,6 +493,10 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "unknown", + }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index f3a9e088d..a3f6cea16 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -68,6 +68,10 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: environment_variables={"foo": "string"}, file_mounts={"foo": "string"}, launch_parameters={ + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "unknown", + }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], @@ -780,6 +784,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - environment_variables={"foo": "string"}, file_mounts={"foo": "string"}, launch_parameters={ + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "unknown", + }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, "launch_commands": ["string", "string", "string"], From ea8cf78540a8471f0e7314cebc0afd665165819e Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 5 Nov 2024 23:17:14 +0000 Subject: [PATCH 332/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 4ff237508..e29311a1d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a685abd27bfc2a49493a3a944b4f53e89fb76cfe13945ff32b47e6e36e1857ad.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c730f33e9faabe5c8868a7093515b6cfc9090555ef1677e06f6e1365715a5231.yml From 799a884891017716575afb146fba3edad2a6a6f9 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 5 Nov 2024 23:23:28 +0000 Subject: [PATCH 333/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e29311a1d..4ff237508 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c730f33e9faabe5c8868a7093515b6cfc9090555ef1677e06f6e1365715a5231.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a685abd27bfc2a49493a3a944b4f53e89fb76cfe13945ff32b47e6e36e1857ad.yml From 45cfaa701cc8de313ff37797cf95db25997b0db7 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 5 Nov 2024 23:35:19 +0000 Subject: [PATCH 334/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 4ff237508..2062b5b02 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a685abd27bfc2a49493a3a944b4f53e89fb76cfe13945ff32b47e6e36e1857ad.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ccfa8c2908a106904fb113cd9fc0380ae8f0d45ae1785af250cb50be8cc791e.yml From 19c7d9eca18a4e5328165b13248dff1e93365a2d Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 6 Nov 2024 00:17:12 +0000 Subject: [PATCH 335/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2062b5b02..e29311a1d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ccfa8c2908a106904fb113cd9fc0380ae8f0d45ae1785af250cb50be8cc791e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c730f33e9faabe5c8868a7093515b6cfc9090555ef1677e06f6e1365715a5231.yml From 980f158201a3544ec83314760c2b74b0679e9f31 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 6 Nov 2024 01:31:54 +0000 Subject: [PATCH 336/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e29311a1d..2062b5b02 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c730f33e9faabe5c8868a7093515b6cfc9090555ef1677e06f6e1365715a5231.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ccfa8c2908a106904fb113cd9fc0380ae8f0d45ae1785af250cb50be8cc791e.yml From 2b7b09e5de95a7a7eff32cf646fb117b9a382bc0 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 6 Nov 2024 02:16:52 +0000 Subject: [PATCH 337/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2062b5b02..e29311a1d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ccfa8c2908a106904fb113cd9fc0380ae8f0d45ae1785af250cb50be8cc791e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c730f33e9faabe5c8868a7093515b6cfc9090555ef1677e06f6e1365715a5231.yml From c52e8b562713a83303d91a66a9b23fbe7658694c Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 6 Nov 2024 03:37:03 +0000 Subject: [PATCH 338/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e29311a1d..2062b5b02 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c730f33e9faabe5c8868a7093515b6cfc9090555ef1677e06f6e1365715a5231.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ccfa8c2908a106904fb113cd9fc0380ae8f0d45ae1785af250cb50be8cc791e.yml From 90be1946e00637d2f3582d6a5e04a3c698e09f9d Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 6 Nov 2024 04:16:53 +0000 Subject: [PATCH 339/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2062b5b02..e29311a1d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ccfa8c2908a106904fb113cd9fc0380ae8f0d45ae1785af250cb50be8cc791e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c730f33e9faabe5c8868a7093515b6cfc9090555ef1677e06f6e1365715a5231.yml From 91aaafb77a27a9d8da551d8656ae9b56348f049f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Nov 2024 16:31:04 +0000 Subject: [PATCH 340/993] feat(api): api update (#249) --- .stats.yml | 2 +- tests/test_client.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index e29311a1d..2062b5b02 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c730f33e9faabe5c8868a7093515b6cfc9090555ef1677e06f6e1365715a5231.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ccfa8c2908a106904fb113cd9fc0380ae8f0d45ae1785af250cb50be8cc791e.yml diff --git a/tests/test_client.py b/tests/test_client.py index f9bb2c8f5..b236d53a2 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -721,7 +721,7 @@ class Model(BaseModel): [3, "", 0.5], [2, "", 0.5 * 2.0], [1, "", 0.5 * 4.0], - [-1100, "", 7.8], # test large number potentially overflowing + [-1100, "", 8], # test large number potentially overflowing ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) @@ -1514,7 +1514,7 @@ class Model(BaseModel): [3, "", 0.5], [2, "", 0.5 * 2.0], [1, "", 0.5 * 4.0], - [-1100, "", 7.8], # test large number potentially overflowing + [-1100, "", 8], # test large number potentially overflowing ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) From ccb006a12d3b8b2eb322b138c4c3d45806962450 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 6 Nov 2024 17:16:41 +0000 Subject: [PATCH 341/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2062b5b02..e29311a1d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ccfa8c2908a106904fb113cd9fc0380ae8f0d45ae1785af250cb50be8cc791e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c730f33e9faabe5c8868a7093515b6cfc9090555ef1677e06f6e1365715a5231.yml From 7a8ea0dbc8b7903b7724a5b43f236d37ff35e859 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 6 Nov 2024 18:17:35 +0000 Subject: [PATCH 342/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e29311a1d..2062b5b02 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c730f33e9faabe5c8868a7093515b6cfc9090555ef1677e06f6e1365715a5231.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ccfa8c2908a106904fb113cd9fc0380ae8f0d45ae1785af250cb50be8cc791e.yml From 2a83d3fd9a6583c6f4846164fb90461177122855 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 6 Nov 2024 19:17:08 +0000 Subject: [PATCH 343/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2062b5b02..e29311a1d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ccfa8c2908a106904fb113cd9fc0380ae8f0d45ae1785af250cb50be8cc791e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c730f33e9faabe5c8868a7093515b6cfc9090555ef1677e06f6e1365715a5231.yml From 572538da2185c12b3a9dbcbcabed331fc02cfa22 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 6 Nov 2024 19:20:44 +0000 Subject: [PATCH 344/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e29311a1d..2062b5b02 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c730f33e9faabe5c8868a7093515b6cfc9090555ef1677e06f6e1365715a5231.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ccfa8c2908a106904fb113cd9fc0380ae8f0d45ae1785af250cb50be8cc791e.yml From b560a67a2c45681db1028f490f97dac61f1211e9 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 6 Nov 2024 20:16:52 +0000 Subject: [PATCH 345/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2062b5b02..e29311a1d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ccfa8c2908a106904fb113cd9fc0380ae8f0d45ae1785af250cb50be8cc791e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c730f33e9faabe5c8868a7093515b6cfc9090555ef1677e06f6e1365715a5231.yml From 7710cbd90d99ef70af4d2a95186a03626a35cf43 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 6 Nov 2024 20:47:55 +0000 Subject: [PATCH 346/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e29311a1d..2062b5b02 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c730f33e9faabe5c8868a7093515b6cfc9090555ef1677e06f6e1365715a5231.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ccfa8c2908a106904fb113cd9fc0380ae8f0d45ae1785af250cb50be8cc791e.yml From d4e3f3aea8ed61c60e02193b6a3f15697c3533ad Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 6 Nov 2024 21:16:49 +0000 Subject: [PATCH 347/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2062b5b02..e29311a1d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ccfa8c2908a106904fb113cd9fc0380ae8f0d45ae1785af250cb50be8cc791e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c730f33e9faabe5c8868a7093515b6cfc9090555ef1677e06f6e1365715a5231.yml From 80a4d474d904e37dcccdb613bb94dd9e71083325 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 6 Nov 2024 21:19:06 +0000 Subject: [PATCH 348/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e29311a1d..2062b5b02 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c730f33e9faabe5c8868a7093515b6cfc9090555ef1677e06f6e1365715a5231.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ccfa8c2908a106904fb113cd9fc0380ae8f0d45ae1785af250cb50be8cc791e.yml From 484d1c48208c160a1d2540fba2e39dda46e7dea2 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 6 Nov 2024 22:17:23 +0000 Subject: [PATCH 349/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2062b5b02..a25af988e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ccfa8c2908a106904fb113cd9fc0380ae8f0d45ae1785af250cb50be8cc791e.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e5de15cb4a8bd529106541f2ac44e427e6f346265e1f8a843185b3654d7b7c83.yml From 55b528c31c85131615938b674862af96eba30216 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Nov 2024 23:35:54 +0000 Subject: [PATCH 350/993] feat(api): api update (#250) --- .stats.yml | 2 +- src/runloop_api_client/types/shared/launch_parameters.py | 2 +- src/runloop_api_client/types/shared_params/launch_parameters.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index a25af988e..8660193cf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e5de15cb4a8bd529106541f2ac44e427e6f346265e1f8a843185b3654d7b7c83.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bc11b45978765d1ce9e6bd844a88e626afa6662a445429327b98365aa1772589.yml diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index cd366bad6..70da59d06 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -38,5 +38,5 @@ class LaunchParameters(BaseModel): launch_commands: Optional[List[str]] = None """Set of commands to be run at launch time, before the entrypoint process is run.""" - resource_size_request: Optional[Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "CUSTOM_SIZE"]] = None + resource_size_request: Optional[Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "XX_LARGE", "CUSTOM_SIZE"]] = None """Manual resource configuration for Devbox. If not set, defaults will be used.""" diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index 8d695139d..74028b0af 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -38,5 +38,5 @@ class LaunchParameters(TypedDict, total=False): launch_commands: List[str] """Set of commands to be run at launch time, before the entrypoint process is run.""" - resource_size_request: Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "CUSTOM_SIZE"] + resource_size_request: Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "XX_LARGE", "CUSTOM_SIZE"] """Manual resource configuration for Devbox. If not set, defaults will be used.""" From c07f300631d13e0478e46d0ef4685513321e114b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Nov 2024 23:57:01 +0000 Subject: [PATCH 351/993] chore(internal): version bump (#251) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1b77f506d..6538ca917 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.7.0" + ".": "0.8.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 53af3fbc2..2d50d433c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.7.0" +version = "0.8.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 8af0ed385..3cde8c822 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.7.0" # x-release-please-version +__version__ = "0.8.0" # x-release-please-version From f3051975b4b9aa6156fab32bd024e65a501cc172 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 00:16:52 +0000 Subject: [PATCH 352/993] feat(api): api update (#252) --- .stats.yml | 2 +- src/runloop_api_client/types/shared/launch_parameters.py | 2 +- src/runloop_api_client/types/shared_params/launch_parameters.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8660193cf..a25af988e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bc11b45978765d1ce9e6bd844a88e626afa6662a445429327b98365aa1772589.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e5de15cb4a8bd529106541f2ac44e427e6f346265e1f8a843185b3654d7b7c83.yml diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index 70da59d06..cd366bad6 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -38,5 +38,5 @@ class LaunchParameters(BaseModel): launch_commands: Optional[List[str]] = None """Set of commands to be run at launch time, before the entrypoint process is run.""" - resource_size_request: Optional[Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "XX_LARGE", "CUSTOM_SIZE"]] = None + resource_size_request: Optional[Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "CUSTOM_SIZE"]] = None """Manual resource configuration for Devbox. If not set, defaults will be used.""" diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index 74028b0af..8d695139d 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -38,5 +38,5 @@ class LaunchParameters(TypedDict, total=False): launch_commands: List[str] """Set of commands to be run at launch time, before the entrypoint process is run.""" - resource_size_request: Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "XX_LARGE", "CUSTOM_SIZE"] + resource_size_request: Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "CUSTOM_SIZE"] """Manual resource configuration for Devbox. If not set, defaults will be used.""" From 4f32f8c3e53cf674041f9de5cdeaaa5aa50da675 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 00:50:45 +0000 Subject: [PATCH 353/993] feat(api): api update (#254) --- .stats.yml | 2 +- src/runloop_api_client/types/shared/launch_parameters.py | 2 +- src/runloop_api_client/types/shared_params/launch_parameters.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index a25af988e..8660193cf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e5de15cb4a8bd529106541f2ac44e427e6f346265e1f8a843185b3654d7b7c83.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bc11b45978765d1ce9e6bd844a88e626afa6662a445429327b98365aa1772589.yml diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index cd366bad6..70da59d06 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -38,5 +38,5 @@ class LaunchParameters(BaseModel): launch_commands: Optional[List[str]] = None """Set of commands to be run at launch time, before the entrypoint process is run.""" - resource_size_request: Optional[Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "CUSTOM_SIZE"]] = None + resource_size_request: Optional[Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "XX_LARGE", "CUSTOM_SIZE"]] = None """Manual resource configuration for Devbox. If not set, defaults will be used.""" diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index 8d695139d..74028b0af 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -38,5 +38,5 @@ class LaunchParameters(TypedDict, total=False): launch_commands: List[str] """Set of commands to be run at launch time, before the entrypoint process is run.""" - resource_size_request: Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "CUSTOM_SIZE"] + resource_size_request: Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "XX_LARGE", "CUSTOM_SIZE"] """Manual resource configuration for Devbox. If not set, defaults will be used.""" From a5880e5c10454582a57dc4a4b81b5d7dc567ea7d Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 7 Nov 2024 01:16:50 +0000 Subject: [PATCH 354/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8660193cf..dbef49efc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bc11b45978765d1ce9e6bd844a88e626afa6662a445429327b98365aa1772589.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb9d7d556ce8bb09ae1142131a70bce4aa1536e7f38963d8cbaf98cf7f757f20.yml From 0082e30210a077ae114343c4fa04391a0cf8ccc5 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 7 Nov 2024 16:48:16 +0000 Subject: [PATCH 355/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index dbef49efc..8660193cf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb9d7d556ce8bb09ae1142131a70bce4aa1536e7f38963d8cbaf98cf7f757f20.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bc11b45978765d1ce9e6bd844a88e626afa6662a445429327b98365aa1772589.yml From f91643b3c669d1c28247e897fc1886acc90dc0bc Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 7 Nov 2024 17:17:01 +0000 Subject: [PATCH 356/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8660193cf..dbef49efc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bc11b45978765d1ce9e6bd844a88e626afa6662a445429327b98365aa1772589.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb9d7d556ce8bb09ae1142131a70bce4aa1536e7f38963d8cbaf98cf7f757f20.yml From 73006c543e434c9fce1ff86599d7415f8739eadc Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 7 Nov 2024 17:53:52 +0000 Subject: [PATCH 357/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index dbef49efc..8660193cf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb9d7d556ce8bb09ae1142131a70bce4aa1536e7f38963d8cbaf98cf7f757f20.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bc11b45978765d1ce9e6bd844a88e626afa6662a445429327b98365aa1772589.yml From e21bdc5d74ee2e01b67139969b09db58e21126e6 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 7 Nov 2024 18:16:43 +0000 Subject: [PATCH 358/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8660193cf..dbef49efc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bc11b45978765d1ce9e6bd844a88e626afa6662a445429327b98365aa1772589.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb9d7d556ce8bb09ae1142131a70bce4aa1536e7f38963d8cbaf98cf7f757f20.yml From c4499d2e9c72e6ac39997d2cef0459ecc71c2fbc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 18:30:44 +0000 Subject: [PATCH 359/993] feat(api): manual updates (#255) --- api.md | 1 + src/runloop_api_client/types/__init__.py | 1 + src/runloop_api_client/types/shared/__init__.py | 1 + src/runloop_api_client/types/shared/after_idle.py | 15 +++++++++++++++ .../types/shared/launch_parameters.py | 11 ++--------- .../types/shared_params/__init__.py | 1 + .../types/shared_params/after_idle.py | 15 +++++++++++++++ .../types/shared_params/launch_parameters.py | 12 +++--------- 8 files changed, 39 insertions(+), 18 deletions(-) create mode 100644 src/runloop_api_client/types/shared/after_idle.py create mode 100644 src/runloop_api_client/types/shared_params/after_idle.py diff --git a/api.md b/api.md index 075b95f85..8fbc97026 100644 --- a/api.md +++ b/api.md @@ -2,6 +2,7 @@ ```python from runloop_api_client.types import ( + AfterIdle, FunctionInvocationExecutionDetailView, LaunchParameters, ProjectLogsView, diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index cc42a3c39..1f6ecb59b 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -3,6 +3,7 @@ from __future__ import annotations from .shared import ( + AfterIdle as AfterIdle, ProjectLogsView as ProjectLogsView, LaunchParameters as LaunchParameters, FunctionInvocationExecutionDetailView as FunctionInvocationExecutionDetailView, diff --git a/src/runloop_api_client/types/shared/__init__.py b/src/runloop_api_client/types/shared/__init__.py index 0c30deb6b..fe8f6f15d 100644 --- a/src/runloop_api_client/types/shared/__init__.py +++ b/src/runloop_api_client/types/shared/__init__.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .after_idle import AfterIdle as AfterIdle from .launch_parameters import LaunchParameters as LaunchParameters from .project_logs_view import ProjectLogsView as ProjectLogsView from .function_invocation_execution_detail_view import ( diff --git a/src/runloop_api_client/types/shared/after_idle.py b/src/runloop_api_client/types/shared/after_idle.py new file mode 100644 index 000000000..09eba857d --- /dev/null +++ b/src/runloop_api_client/types/shared/after_idle.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["AfterIdle"] + + +class AfterIdle(BaseModel): + idle_time_seconds: int + """After idle_time_seconds, on_idle action will be taken.""" + + on_idle: Literal["unknown", "shutdown", "suspend"] + """Action to take after Devbox becomes idle.""" diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index 70da59d06..ba7397a86 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -4,16 +4,9 @@ from typing_extensions import Literal from ..._models import BaseModel +from .after_idle import AfterIdle -__all__ = ["LaunchParameters", "AfterIdle"] - - -class AfterIdle(BaseModel): - idle_time_seconds: int - """After idle_time_seconds, on_idle action will be taken.""" - - on_idle: Literal["unknown", "shutdown", "suspend"] - """Action to take after Devbox becomes idle.""" +__all__ = ["LaunchParameters"] class LaunchParameters(BaseModel): diff --git a/src/runloop_api_client/types/shared_params/__init__.py b/src/runloop_api_client/types/shared_params/__init__.py index 4e215e900..6f0cc271b 100644 --- a/src/runloop_api_client/types/shared_params/__init__.py +++ b/src/runloop_api_client/types/shared_params/__init__.py @@ -1,3 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .after_idle import AfterIdle as AfterIdle from .launch_parameters import LaunchParameters as LaunchParameters diff --git a/src/runloop_api_client/types/shared_params/after_idle.py b/src/runloop_api_client/types/shared_params/after_idle.py new file mode 100644 index 000000000..f603ee209 --- /dev/null +++ b/src/runloop_api_client/types/shared_params/after_idle.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["AfterIdle"] + + +class AfterIdle(TypedDict, total=False): + idle_time_seconds: Required[int] + """After idle_time_seconds, on_idle action will be taken.""" + + on_idle: Required[Literal["unknown", "shutdown", "suspend"]] + """Action to take after Devbox becomes idle.""" diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index 74028b0af..bff83f41a 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -3,17 +3,11 @@ from __future__ import annotations from typing import List, Iterable -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Literal, TypedDict -__all__ = ["LaunchParameters", "AfterIdle"] +from .after_idle import AfterIdle - -class AfterIdle(TypedDict, total=False): - idle_time_seconds: Required[int] - """After idle_time_seconds, on_idle action will be taken.""" - - on_idle: Required[Literal["unknown", "shutdown", "suspend"]] - """Action to take after Devbox becomes idle.""" +__all__ = ["LaunchParameters"] class LaunchParameters(TypedDict, total=False): From 57fc94c0c36d5ddf0191ab3b1490116f9e84050b Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 7 Nov 2024 19:27:09 +0000 Subject: [PATCH 360/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index dbef49efc..8660193cf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb9d7d556ce8bb09ae1142131a70bce4aa1536e7f38963d8cbaf98cf7f757f20.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bc11b45978765d1ce9e6bd844a88e626afa6662a445429327b98365aa1772589.yml From 63487e0968efe0d83ac12d88ad6ffb2eb9025514 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 19:29:28 +0000 Subject: [PATCH 361/993] chore(internal): version bump (#256) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6538ca917..6d78745c4 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.8.0" + ".": "0.9.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 2d50d433c..eddf5f90b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.8.0" +version = "0.9.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 3cde8c822..304d7f533 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.8.0" # x-release-please-version +__version__ = "0.9.0" # x-release-please-version From 0f9533e323ff0343797006a0fcf9959846ba35e5 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 7 Nov 2024 20:16:48 +0000 Subject: [PATCH 362/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8660193cf..dbef49efc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bc11b45978765d1ce9e6bd844a88e626afa6662a445429327b98365aa1772589.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb9d7d556ce8bb09ae1142131a70bce4aa1536e7f38963d8cbaf98cf7f757f20.yml From 275151006f0325703270681ff1ff566b2651cefe Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 7 Nov 2024 20:32:55 +0000 Subject: [PATCH 363/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index dbef49efc..8660193cf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb9d7d556ce8bb09ae1142131a70bce4aa1536e7f38963d8cbaf98cf7f757f20.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bc11b45978765d1ce9e6bd844a88e626afa6662a445429327b98365aa1772589.yml From c79fac4390642c4b4aaa47104e369782664948fd Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Thu, 7 Nov 2024 21:16:44 +0000 Subject: [PATCH 364/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8660193cf..dbef49efc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bc11b45978765d1ce9e6bd844a88e626afa6662a445429327b98365aa1772589.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb9d7d556ce8bb09ae1142131a70bce4aa1536e7f38963d8cbaf98cf7f757f20.yml From 4c8e36563956320225e5aae31f2793874e9a9195 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 23:23:16 +0000 Subject: [PATCH 365/993] feat(api): api update (#257) --- .stats.yml | 2 +- src/runloop_api_client/types/shared/after_idle.py | 2 +- src/runloop_api_client/types/shared_params/after_idle.py | 2 +- tests/api_resources/test_blueprints.py | 8 ++++---- tests/api_resources/test_devboxes.py | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.stats.yml b/.stats.yml index dbef49efc..6dd35a632 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb9d7d556ce8bb09ae1142131a70bce4aa1536e7f38963d8cbaf98cf7f757f20.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b8f197cfb474d0286fe38200bfa00e56952448f397cc166c2a6061bbd8597a28.yml diff --git a/src/runloop_api_client/types/shared/after_idle.py b/src/runloop_api_client/types/shared/after_idle.py index 09eba857d..b9511d7f2 100644 --- a/src/runloop_api_client/types/shared/after_idle.py +++ b/src/runloop_api_client/types/shared/after_idle.py @@ -11,5 +11,5 @@ class AfterIdle(BaseModel): idle_time_seconds: int """After idle_time_seconds, on_idle action will be taken.""" - on_idle: Literal["unknown", "shutdown", "suspend"] + on_idle: Literal["shutdown", "suspend"] """Action to take after Devbox becomes idle.""" diff --git a/src/runloop_api_client/types/shared_params/after_idle.py b/src/runloop_api_client/types/shared_params/after_idle.py index f603ee209..a9112b6b8 100644 --- a/src/runloop_api_client/types/shared_params/after_idle.py +++ b/src/runloop_api_client/types/shared_params/after_idle.py @@ -11,5 +11,5 @@ class AfterIdle(TypedDict, total=False): idle_time_seconds: Required[int] """After idle_time_seconds, on_idle action will be taken.""" - on_idle: Required[Literal["unknown", "shutdown", "suspend"]] + on_idle: Required[Literal["shutdown", "suspend"]] """Action to take after Devbox becomes idle.""" diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 765cdec37..1e9b97c83 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -58,7 +58,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -239,7 +239,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -314,7 +314,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -495,7 +495,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index a3f6cea16..8ec53acd3 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -70,7 +70,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -786,7 +786,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, From d437503161688c39d6dc44a9eb792e61ad7069b8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2024 00:16:45 +0000 Subject: [PATCH 366/993] feat(api): api update (#259) --- .stats.yml | 2 +- src/runloop_api_client/types/shared/after_idle.py | 2 +- src/runloop_api_client/types/shared_params/after_idle.py | 2 +- tests/api_resources/test_blueprints.py | 8 ++++---- tests/api_resources/test_devboxes.py | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6dd35a632..dbef49efc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b8f197cfb474d0286fe38200bfa00e56952448f397cc166c2a6061bbd8597a28.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb9d7d556ce8bb09ae1142131a70bce4aa1536e7f38963d8cbaf98cf7f757f20.yml diff --git a/src/runloop_api_client/types/shared/after_idle.py b/src/runloop_api_client/types/shared/after_idle.py index b9511d7f2..09eba857d 100644 --- a/src/runloop_api_client/types/shared/after_idle.py +++ b/src/runloop_api_client/types/shared/after_idle.py @@ -11,5 +11,5 @@ class AfterIdle(BaseModel): idle_time_seconds: int """After idle_time_seconds, on_idle action will be taken.""" - on_idle: Literal["shutdown", "suspend"] + on_idle: Literal["unknown", "shutdown", "suspend"] """Action to take after Devbox becomes idle.""" diff --git a/src/runloop_api_client/types/shared_params/after_idle.py b/src/runloop_api_client/types/shared_params/after_idle.py index a9112b6b8..f603ee209 100644 --- a/src/runloop_api_client/types/shared_params/after_idle.py +++ b/src/runloop_api_client/types/shared_params/after_idle.py @@ -11,5 +11,5 @@ class AfterIdle(TypedDict, total=False): idle_time_seconds: Required[int] """After idle_time_seconds, on_idle action will be taken.""" - on_idle: Required[Literal["shutdown", "suspend"]] + on_idle: Required[Literal["unknown", "shutdown", "suspend"]] """Action to take after Devbox becomes idle.""" diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 1e9b97c83..765cdec37 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -58,7 +58,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "shutdown", + "on_idle": "unknown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -239,7 +239,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "shutdown", + "on_idle": "unknown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -314,7 +314,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "shutdown", + "on_idle": "unknown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -495,7 +495,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "shutdown", + "on_idle": "unknown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 8ec53acd3..a3f6cea16 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -70,7 +70,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "shutdown", + "on_idle": "unknown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -786,7 +786,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "shutdown", + "on_idle": "unknown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, From 84a5236d5b3bf268bca24e5cf4cc8d0ae87a93f5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2024 01:56:08 +0000 Subject: [PATCH 367/993] feat(api): api update (#260) --- .stats.yml | 2 +- src/runloop_api_client/types/shared/after_idle.py | 2 +- src/runloop_api_client/types/shared_params/after_idle.py | 2 +- tests/api_resources/test_blueprints.py | 8 ++++---- tests/api_resources/test_devboxes.py | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.stats.yml b/.stats.yml index dbef49efc..6dd35a632 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb9d7d556ce8bb09ae1142131a70bce4aa1536e7f38963d8cbaf98cf7f757f20.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b8f197cfb474d0286fe38200bfa00e56952448f397cc166c2a6061bbd8597a28.yml diff --git a/src/runloop_api_client/types/shared/after_idle.py b/src/runloop_api_client/types/shared/after_idle.py index 09eba857d..b9511d7f2 100644 --- a/src/runloop_api_client/types/shared/after_idle.py +++ b/src/runloop_api_client/types/shared/after_idle.py @@ -11,5 +11,5 @@ class AfterIdle(BaseModel): idle_time_seconds: int """After idle_time_seconds, on_idle action will be taken.""" - on_idle: Literal["unknown", "shutdown", "suspend"] + on_idle: Literal["shutdown", "suspend"] """Action to take after Devbox becomes idle.""" diff --git a/src/runloop_api_client/types/shared_params/after_idle.py b/src/runloop_api_client/types/shared_params/after_idle.py index f603ee209..a9112b6b8 100644 --- a/src/runloop_api_client/types/shared_params/after_idle.py +++ b/src/runloop_api_client/types/shared_params/after_idle.py @@ -11,5 +11,5 @@ class AfterIdle(TypedDict, total=False): idle_time_seconds: Required[int] """After idle_time_seconds, on_idle action will be taken.""" - on_idle: Required[Literal["unknown", "shutdown", "suspend"]] + on_idle: Required[Literal["shutdown", "suspend"]] """Action to take after Devbox becomes idle.""" diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 765cdec37..1e9b97c83 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -58,7 +58,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -239,7 +239,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -314,7 +314,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -495,7 +495,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index a3f6cea16..8ec53acd3 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -70,7 +70,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -786,7 +786,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, From 945753be737d0aefc633324945d14d84ee7dded7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2024 02:17:19 +0000 Subject: [PATCH 368/993] feat(api): api update (#261) --- .stats.yml | 2 +- src/runloop_api_client/types/shared/after_idle.py | 2 +- src/runloop_api_client/types/shared_params/after_idle.py | 2 +- tests/api_resources/test_blueprints.py | 8 ++++---- tests/api_resources/test_devboxes.py | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6dd35a632..dbef49efc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b8f197cfb474d0286fe38200bfa00e56952448f397cc166c2a6061bbd8597a28.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb9d7d556ce8bb09ae1142131a70bce4aa1536e7f38963d8cbaf98cf7f757f20.yml diff --git a/src/runloop_api_client/types/shared/after_idle.py b/src/runloop_api_client/types/shared/after_idle.py index b9511d7f2..09eba857d 100644 --- a/src/runloop_api_client/types/shared/after_idle.py +++ b/src/runloop_api_client/types/shared/after_idle.py @@ -11,5 +11,5 @@ class AfterIdle(BaseModel): idle_time_seconds: int """After idle_time_seconds, on_idle action will be taken.""" - on_idle: Literal["shutdown", "suspend"] + on_idle: Literal["unknown", "shutdown", "suspend"] """Action to take after Devbox becomes idle.""" diff --git a/src/runloop_api_client/types/shared_params/after_idle.py b/src/runloop_api_client/types/shared_params/after_idle.py index a9112b6b8..f603ee209 100644 --- a/src/runloop_api_client/types/shared_params/after_idle.py +++ b/src/runloop_api_client/types/shared_params/after_idle.py @@ -11,5 +11,5 @@ class AfterIdle(TypedDict, total=False): idle_time_seconds: Required[int] """After idle_time_seconds, on_idle action will be taken.""" - on_idle: Required[Literal["shutdown", "suspend"]] + on_idle: Required[Literal["unknown", "shutdown", "suspend"]] """Action to take after Devbox becomes idle.""" diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 1e9b97c83..765cdec37 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -58,7 +58,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "shutdown", + "on_idle": "unknown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -239,7 +239,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "shutdown", + "on_idle": "unknown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -314,7 +314,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "shutdown", + "on_idle": "unknown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -495,7 +495,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "shutdown", + "on_idle": "unknown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 8ec53acd3..a3f6cea16 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -70,7 +70,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "shutdown", + "on_idle": "unknown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -786,7 +786,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "shutdown", + "on_idle": "unknown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, From f8f77fd4632fccaaf33471e319973d85968d16bf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2024 17:03:44 +0000 Subject: [PATCH 369/993] feat(api): api update (#262) --- .stats.yml | 2 +- src/runloop_api_client/types/shared/after_idle.py | 2 +- src/runloop_api_client/types/shared_params/after_idle.py | 2 +- tests/api_resources/test_blueprints.py | 8 ++++---- tests/api_resources/test_devboxes.py | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.stats.yml b/.stats.yml index dbef49efc..6dd35a632 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb9d7d556ce8bb09ae1142131a70bce4aa1536e7f38963d8cbaf98cf7f757f20.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b8f197cfb474d0286fe38200bfa00e56952448f397cc166c2a6061bbd8597a28.yml diff --git a/src/runloop_api_client/types/shared/after_idle.py b/src/runloop_api_client/types/shared/after_idle.py index 09eba857d..b9511d7f2 100644 --- a/src/runloop_api_client/types/shared/after_idle.py +++ b/src/runloop_api_client/types/shared/after_idle.py @@ -11,5 +11,5 @@ class AfterIdle(BaseModel): idle_time_seconds: int """After idle_time_seconds, on_idle action will be taken.""" - on_idle: Literal["unknown", "shutdown", "suspend"] + on_idle: Literal["shutdown", "suspend"] """Action to take after Devbox becomes idle.""" diff --git a/src/runloop_api_client/types/shared_params/after_idle.py b/src/runloop_api_client/types/shared_params/after_idle.py index f603ee209..a9112b6b8 100644 --- a/src/runloop_api_client/types/shared_params/after_idle.py +++ b/src/runloop_api_client/types/shared_params/after_idle.py @@ -11,5 +11,5 @@ class AfterIdle(TypedDict, total=False): idle_time_seconds: Required[int] """After idle_time_seconds, on_idle action will be taken.""" - on_idle: Required[Literal["unknown", "shutdown", "suspend"]] + on_idle: Required[Literal["shutdown", "suspend"]] """Action to take after Devbox becomes idle.""" diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 765cdec37..1e9b97c83 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -58,7 +58,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -239,7 +239,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -314,7 +314,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -495,7 +495,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index a3f6cea16..8ec53acd3 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -70,7 +70,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -786,7 +786,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, From 28c7c6645689ae6aa691ce9dac2d3d500e0037d2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2024 17:16:51 +0000 Subject: [PATCH 370/993] feat(api): api update (#263) --- .stats.yml | 2 +- src/runloop_api_client/types/shared/after_idle.py | 2 +- src/runloop_api_client/types/shared_params/after_idle.py | 2 +- tests/api_resources/test_blueprints.py | 8 ++++---- tests/api_resources/test_devboxes.py | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6dd35a632..dbef49efc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b8f197cfb474d0286fe38200bfa00e56952448f397cc166c2a6061bbd8597a28.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb9d7d556ce8bb09ae1142131a70bce4aa1536e7f38963d8cbaf98cf7f757f20.yml diff --git a/src/runloop_api_client/types/shared/after_idle.py b/src/runloop_api_client/types/shared/after_idle.py index b9511d7f2..09eba857d 100644 --- a/src/runloop_api_client/types/shared/after_idle.py +++ b/src/runloop_api_client/types/shared/after_idle.py @@ -11,5 +11,5 @@ class AfterIdle(BaseModel): idle_time_seconds: int """After idle_time_seconds, on_idle action will be taken.""" - on_idle: Literal["shutdown", "suspend"] + on_idle: Literal["unknown", "shutdown", "suspend"] """Action to take after Devbox becomes idle.""" diff --git a/src/runloop_api_client/types/shared_params/after_idle.py b/src/runloop_api_client/types/shared_params/after_idle.py index a9112b6b8..f603ee209 100644 --- a/src/runloop_api_client/types/shared_params/after_idle.py +++ b/src/runloop_api_client/types/shared_params/after_idle.py @@ -11,5 +11,5 @@ class AfterIdle(TypedDict, total=False): idle_time_seconds: Required[int] """After idle_time_seconds, on_idle action will be taken.""" - on_idle: Required[Literal["shutdown", "suspend"]] + on_idle: Required[Literal["unknown", "shutdown", "suspend"]] """Action to take after Devbox becomes idle.""" diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 1e9b97c83..765cdec37 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -58,7 +58,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "shutdown", + "on_idle": "unknown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -239,7 +239,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "shutdown", + "on_idle": "unknown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -314,7 +314,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "shutdown", + "on_idle": "unknown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -495,7 +495,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "shutdown", + "on_idle": "unknown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 8ec53acd3..a3f6cea16 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -70,7 +70,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "shutdown", + "on_idle": "unknown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -786,7 +786,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "shutdown", + "on_idle": "unknown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, From db635e98bb999a310124c134f39bfb8b1ee33842 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2024 18:12:08 +0000 Subject: [PATCH 371/993] feat(api): api update (#264) --- .stats.yml | 2 +- src/runloop_api_client/types/shared/after_idle.py | 2 +- src/runloop_api_client/types/shared_params/after_idle.py | 2 +- tests/api_resources/test_blueprints.py | 8 ++++---- tests/api_resources/test_devboxes.py | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.stats.yml b/.stats.yml index dbef49efc..6dd35a632 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb9d7d556ce8bb09ae1142131a70bce4aa1536e7f38963d8cbaf98cf7f757f20.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b8f197cfb474d0286fe38200bfa00e56952448f397cc166c2a6061bbd8597a28.yml diff --git a/src/runloop_api_client/types/shared/after_idle.py b/src/runloop_api_client/types/shared/after_idle.py index 09eba857d..b9511d7f2 100644 --- a/src/runloop_api_client/types/shared/after_idle.py +++ b/src/runloop_api_client/types/shared/after_idle.py @@ -11,5 +11,5 @@ class AfterIdle(BaseModel): idle_time_seconds: int """After idle_time_seconds, on_idle action will be taken.""" - on_idle: Literal["unknown", "shutdown", "suspend"] + on_idle: Literal["shutdown", "suspend"] """Action to take after Devbox becomes idle.""" diff --git a/src/runloop_api_client/types/shared_params/after_idle.py b/src/runloop_api_client/types/shared_params/after_idle.py index f603ee209..a9112b6b8 100644 --- a/src/runloop_api_client/types/shared_params/after_idle.py +++ b/src/runloop_api_client/types/shared_params/after_idle.py @@ -11,5 +11,5 @@ class AfterIdle(TypedDict, total=False): idle_time_seconds: Required[int] """After idle_time_seconds, on_idle action will be taken.""" - on_idle: Required[Literal["unknown", "shutdown", "suspend"]] + on_idle: Required[Literal["shutdown", "suspend"]] """Action to take after Devbox becomes idle.""" diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 765cdec37..1e9b97c83 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -58,7 +58,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -239,7 +239,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -314,7 +314,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -495,7 +495,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index a3f6cea16..8ec53acd3 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -70,7 +70,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, @@ -786,7 +786,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - launch_parameters={ "after_idle": { "idle_time_seconds": 0, - "on_idle": "unknown", + "on_idle": "shutdown", }, "available_ports": [0, 0, 0], "keep_alive_time_seconds": 0, From 0dacf40b031bbfbffb19f85294bbdccb87905a1e Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 8 Nov 2024 18:16:45 +0000 Subject: [PATCH 372/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 6dd35a632..610aef74d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b8f197cfb474d0286fe38200bfa00e56952448f397cc166c2a6061bbd8597a28.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-9ece0eb6c3a04dc53f45eeb2207f729b5ea57d68e63b211fc3fb7eaf99395e77.yml From 6af915a25b0b8acb98031e45fbd03b82c9353e99 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2024 19:01:08 +0000 Subject: [PATCH 373/993] feat(api): api update (#265) --- .stats.yml | 4 +- api.md | 2 + .../resources/devboxes/devboxes.py | 78 +++++++++++++++++++ tests/api_resources/test_devboxes.py | 76 ++++++++++++++++++ 4 files changed, 158 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 610aef74d..d9b513d63 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-9ece0eb6c3a04dc53f45eeb2207f729b5ea57d68e63b211fc3fb7eaf99395e77.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c93213df96468708c029381048af8d18f1d14118051946429590dd0faedce456.yml diff --git a/api.md b/api.md index 8fbc97026..160665026 100644 --- a/api.md +++ b/api.md @@ -54,6 +54,7 @@ from runloop_api_client.types import ( DevboxTunnelView, DevboxView, DevboxCreateSSHKeyResponse, + DevboxKeepAliveResponse, DevboxReadFileContentsResponse, DevboxUploadFileResponse, ) @@ -70,6 +71,7 @@ Methods: - client.devboxes.download_file(id, \*\*params) -> BinaryAPIResponse - client.devboxes.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView +- client.devboxes.keep_alive(id) -> object - client.devboxes.read_file_contents(id, \*\*params) -> str - client.devboxes.resume(id) -> DevboxView - client.devboxes.shutdown(id) -> DevboxView diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9893585f2..b4115afdc 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -524,6 +524,39 @@ def execute_sync( cast_to=DevboxExecutionDetailView, ) + def keep_alive( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Keep alive a running devbox that is configured to shutdown on idle. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/keep_alive", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + def read_file_contents( self, id: str, @@ -1257,6 +1290,39 @@ async def execute_sync( cast_to=DevboxExecutionDetailView, ) + async def keep_alive( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Keep alive a running devbox that is configured to shutdown on idle. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/keep_alive", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + async def read_file_contents( self, id: str, @@ -1571,6 +1637,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.execute_sync = to_raw_response_wrapper( devboxes.execute_sync, ) + self.keep_alive = to_raw_response_wrapper( + devboxes.keep_alive, + ) self.read_file_contents = to_raw_response_wrapper( devboxes.read_file_contents, ) @@ -1634,6 +1703,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.execute_sync = async_to_raw_response_wrapper( devboxes.execute_sync, ) + self.keep_alive = async_to_raw_response_wrapper( + devboxes.keep_alive, + ) self.read_file_contents = async_to_raw_response_wrapper( devboxes.read_file_contents, ) @@ -1697,6 +1769,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.execute_sync = to_streamed_response_wrapper( devboxes.execute_sync, ) + self.keep_alive = to_streamed_response_wrapper( + devboxes.keep_alive, + ) self.read_file_contents = to_streamed_response_wrapper( devboxes.read_file_contents, ) @@ -1760,6 +1835,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.execute_sync = async_to_streamed_response_wrapper( devboxes.execute_sync, ) + self.keep_alive = async_to_streamed_response_wrapper( + devboxes.keep_alive, + ) self.read_file_contents = async_to_streamed_response_wrapper( devboxes.read_file_contents, ) diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 8ec53acd3..8b8803b26 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -450,6 +450,44 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: command="command", ) + @parametrize + def test_method_keep_alive(self, client: Runloop) -> None: + devbox = client.devboxes.keep_alive( + "id", + ) + assert_matches_type(object, devbox, path=["response"]) + + @parametrize + def test_raw_response_keep_alive(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.keep_alive( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(object, devbox, path=["response"]) + + @parametrize + def test_streaming_response_keep_alive(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.keep_alive( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(object, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_keep_alive(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.keep_alive( + "", + ) + @parametrize def test_method_read_file_contents(self, client: Runloop) -> None: devbox = client.devboxes.read_file_contents( @@ -1166,6 +1204,44 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non command="command", ) + @parametrize + async def test_method_keep_alive(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.keep_alive( + "id", + ) + assert_matches_type(object, devbox, path=["response"]) + + @parametrize + async def test_raw_response_keep_alive(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.keep_alive( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(object, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_keep_alive(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.keep_alive( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(object, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_keep_alive(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.keep_alive( + "", + ) + @parametrize async def test_method_read_file_contents(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.read_file_contents( From 231672e7f60235395da95dee729f3087689b3fc7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2024 19:21:53 +0000 Subject: [PATCH 374/993] chore(internal): version bump (#266) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6d78745c4..091cfb127 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.9.0" + ".": "0.10.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index eddf5f90b..cb9458aaa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.9.0" +version = "0.10.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 304d7f533..1713908ea 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.9.0" # x-release-please-version +__version__ = "0.10.0" # x-release-please-version From 2dd36f5442c880b4f1d23ff5c9450470bb919f24 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2024 19:24:23 +0000 Subject: [PATCH 375/993] feat(api): api update (#267) --- .stats.yml | 4 +- api.md | 2 - .../resources/devboxes/devboxes.py | 78 ------------------- tests/api_resources/test_devboxes.py | 76 ------------------ 4 files changed, 2 insertions(+), 158 deletions(-) diff --git a/.stats.yml b/.stats.yml index d9b513d63..610aef74d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c93213df96468708c029381048af8d18f1d14118051946429590dd0faedce456.yml +configured_endpoints: 32 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-9ece0eb6c3a04dc53f45eeb2207f729b5ea57d68e63b211fc3fb7eaf99395e77.yml diff --git a/api.md b/api.md index 160665026..8fbc97026 100644 --- a/api.md +++ b/api.md @@ -54,7 +54,6 @@ from runloop_api_client.types import ( DevboxTunnelView, DevboxView, DevboxCreateSSHKeyResponse, - DevboxKeepAliveResponse, DevboxReadFileContentsResponse, DevboxUploadFileResponse, ) @@ -71,7 +70,6 @@ Methods: - client.devboxes.download_file(id, \*\*params) -> BinaryAPIResponse - client.devboxes.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView -- client.devboxes.keep_alive(id) -> object - client.devboxes.read_file_contents(id, \*\*params) -> str - client.devboxes.resume(id) -> DevboxView - client.devboxes.shutdown(id) -> DevboxView diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index b4115afdc..9893585f2 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -524,39 +524,6 @@ def execute_sync( cast_to=DevboxExecutionDetailView, ) - def keep_alive( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Keep alive a running devbox that is configured to shutdown on idle. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/keep_alive", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - def read_file_contents( self, id: str, @@ -1290,39 +1257,6 @@ async def execute_sync( cast_to=DevboxExecutionDetailView, ) - async def keep_alive( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Keep alive a running devbox that is configured to shutdown on idle. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/keep_alive", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - async def read_file_contents( self, id: str, @@ -1637,9 +1571,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.execute_sync = to_raw_response_wrapper( devboxes.execute_sync, ) - self.keep_alive = to_raw_response_wrapper( - devboxes.keep_alive, - ) self.read_file_contents = to_raw_response_wrapper( devboxes.read_file_contents, ) @@ -1703,9 +1634,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.execute_sync = async_to_raw_response_wrapper( devboxes.execute_sync, ) - self.keep_alive = async_to_raw_response_wrapper( - devboxes.keep_alive, - ) self.read_file_contents = async_to_raw_response_wrapper( devboxes.read_file_contents, ) @@ -1769,9 +1697,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.execute_sync = to_streamed_response_wrapper( devboxes.execute_sync, ) - self.keep_alive = to_streamed_response_wrapper( - devboxes.keep_alive, - ) self.read_file_contents = to_streamed_response_wrapper( devboxes.read_file_contents, ) @@ -1835,9 +1760,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.execute_sync = async_to_streamed_response_wrapper( devboxes.execute_sync, ) - self.keep_alive = async_to_streamed_response_wrapper( - devboxes.keep_alive, - ) self.read_file_contents = async_to_streamed_response_wrapper( devboxes.read_file_contents, ) diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 8b8803b26..8ec53acd3 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -450,44 +450,6 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: command="command", ) - @parametrize - def test_method_keep_alive(self, client: Runloop) -> None: - devbox = client.devboxes.keep_alive( - "id", - ) - assert_matches_type(object, devbox, path=["response"]) - - @parametrize - def test_raw_response_keep_alive(self, client: Runloop) -> None: - response = client.devboxes.with_raw_response.keep_alive( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - devbox = response.parse() - assert_matches_type(object, devbox, path=["response"]) - - @parametrize - def test_streaming_response_keep_alive(self, client: Runloop) -> None: - with client.devboxes.with_streaming_response.keep_alive( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - devbox = response.parse() - assert_matches_type(object, devbox, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_keep_alive(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.with_raw_response.keep_alive( - "", - ) - @parametrize def test_method_read_file_contents(self, client: Runloop) -> None: devbox = client.devboxes.read_file_contents( @@ -1204,44 +1166,6 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non command="command", ) - @parametrize - async def test_method_keep_alive(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.keep_alive( - "id", - ) - assert_matches_type(object, devbox, path=["response"]) - - @parametrize - async def test_raw_response_keep_alive(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.with_raw_response.keep_alive( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - devbox = await response.parse() - assert_matches_type(object, devbox, path=["response"]) - - @parametrize - async def test_streaming_response_keep_alive(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.with_streaming_response.keep_alive( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - devbox = await response.parse() - assert_matches_type(object, devbox, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_keep_alive(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.with_raw_response.keep_alive( - "", - ) - @parametrize async def test_method_read_file_contents(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.read_file_contents( From ff1f868e74b5540340a49e294eefdcdd12c2a8bb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2024 20:25:51 +0000 Subject: [PATCH 376/993] feat(api): api update (#269) --- .stats.yml | 4 +- api.md | 2 + .../resources/devboxes/devboxes.py | 78 +++++++++++++++++++ tests/api_resources/test_devboxes.py | 76 ++++++++++++++++++ 4 files changed, 158 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 610aef74d..d8039040f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-9ece0eb6c3a04dc53f45eeb2207f729b5ea57d68e63b211fc3fb7eaf99395e77.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a78c6e9e72b6199cc4e538566d01eda7b5f593221b28b27d9eac89c2035931bc.yml diff --git a/api.md b/api.md index 8fbc97026..160665026 100644 --- a/api.md +++ b/api.md @@ -54,6 +54,7 @@ from runloop_api_client.types import ( DevboxTunnelView, DevboxView, DevboxCreateSSHKeyResponse, + DevboxKeepAliveResponse, DevboxReadFileContentsResponse, DevboxUploadFileResponse, ) @@ -70,6 +71,7 @@ Methods: - client.devboxes.download_file(id, \*\*params) -> BinaryAPIResponse - client.devboxes.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView +- client.devboxes.keep_alive(id) -> object - client.devboxes.read_file_contents(id, \*\*params) -> str - client.devboxes.resume(id) -> DevboxView - client.devboxes.shutdown(id) -> DevboxView diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9893585f2..b4115afdc 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -524,6 +524,39 @@ def execute_sync( cast_to=DevboxExecutionDetailView, ) + def keep_alive( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Keep alive a running devbox that is configured to shutdown on idle. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/keep_alive", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + def read_file_contents( self, id: str, @@ -1257,6 +1290,39 @@ async def execute_sync( cast_to=DevboxExecutionDetailView, ) + async def keep_alive( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Keep alive a running devbox that is configured to shutdown on idle. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/keep_alive", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + async def read_file_contents( self, id: str, @@ -1571,6 +1637,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.execute_sync = to_raw_response_wrapper( devboxes.execute_sync, ) + self.keep_alive = to_raw_response_wrapper( + devboxes.keep_alive, + ) self.read_file_contents = to_raw_response_wrapper( devboxes.read_file_contents, ) @@ -1634,6 +1703,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.execute_sync = async_to_raw_response_wrapper( devboxes.execute_sync, ) + self.keep_alive = async_to_raw_response_wrapper( + devboxes.keep_alive, + ) self.read_file_contents = async_to_raw_response_wrapper( devboxes.read_file_contents, ) @@ -1697,6 +1769,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.execute_sync = to_streamed_response_wrapper( devboxes.execute_sync, ) + self.keep_alive = to_streamed_response_wrapper( + devboxes.keep_alive, + ) self.read_file_contents = to_streamed_response_wrapper( devboxes.read_file_contents, ) @@ -1760,6 +1835,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.execute_sync = async_to_streamed_response_wrapper( devboxes.execute_sync, ) + self.keep_alive = async_to_streamed_response_wrapper( + devboxes.keep_alive, + ) self.read_file_contents = async_to_streamed_response_wrapper( devboxes.read_file_contents, ) diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 8ec53acd3..8b8803b26 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -450,6 +450,44 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: command="command", ) + @parametrize + def test_method_keep_alive(self, client: Runloop) -> None: + devbox = client.devboxes.keep_alive( + "id", + ) + assert_matches_type(object, devbox, path=["response"]) + + @parametrize + def test_raw_response_keep_alive(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.keep_alive( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(object, devbox, path=["response"]) + + @parametrize + def test_streaming_response_keep_alive(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.keep_alive( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(object, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_keep_alive(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.keep_alive( + "", + ) + @parametrize def test_method_read_file_contents(self, client: Runloop) -> None: devbox = client.devboxes.read_file_contents( @@ -1166,6 +1204,44 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non command="command", ) + @parametrize + async def test_method_keep_alive(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.keep_alive( + "id", + ) + assert_matches_type(object, devbox, path=["response"]) + + @parametrize + async def test_raw_response_keep_alive(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.keep_alive( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(object, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_keep_alive(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.keep_alive( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(object, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_keep_alive(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.keep_alive( + "", + ) + @parametrize async def test_method_read_file_contents(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.read_file_contents( From 9e9b96432a811028b5a03e148f2a0d953ee545f4 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 8 Nov 2024 21:40:41 +0000 Subject: [PATCH 377/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d8039040f..d9b513d63 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a78c6e9e72b6199cc4e538566d01eda7b5f593221b28b27d9eac89c2035931bc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c93213df96468708c029381048af8d18f1d14118051946429590dd0faedce456.yml From 425ca593ecc4b9c28c14f829ba82df7329f23366 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 8 Nov 2024 22:22:16 +0000 Subject: [PATCH 378/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d9b513d63..d8039040f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c93213df96468708c029381048af8d18f1d14118051946429590dd0faedce456.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a78c6e9e72b6199cc4e538566d01eda7b5f593221b28b27d9eac89c2035931bc.yml From 91cefda3315e2d7a6be2c3b3bd5aa6937916f046 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 8 Nov 2024 22:27:16 +0000 Subject: [PATCH 379/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d8039040f..d9b513d63 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a78c6e9e72b6199cc4e538566d01eda7b5f593221b28b27d9eac89c2035931bc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c93213df96468708c029381048af8d18f1d14118051946429590dd0faedce456.yml From bb86f7f26538fbb75211a12d69ba1f4fbbf1c480 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Fri, 8 Nov 2024 23:24:45 +0000 Subject: [PATCH 380/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d9b513d63..d8039040f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c93213df96468708c029381048af8d18f1d14118051946429590dd0faedce456.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a78c6e9e72b6199cc4e538566d01eda7b5f593221b28b27d9eac89c2035931bc.yml From 5499af37cb163b723aa78273451961490ebbbd40 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Sat, 9 Nov 2024 23:28:24 +0000 Subject: [PATCH 381/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d8039040f..d9b513d63 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a78c6e9e72b6199cc4e538566d01eda7b5f593221b28b27d9eac89c2035931bc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c93213df96468708c029381048af8d18f1d14118051946429590dd0faedce456.yml From 96096071e41b9642ddfbe93c7dcdfa567b465161 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Sun, 10 Nov 2024 00:24:35 +0000 Subject: [PATCH 382/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d9b513d63..d8039040f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c93213df96468708c029381048af8d18f1d14118051946429590dd0faedce456.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a78c6e9e72b6199cc4e538566d01eda7b5f593221b28b27d9eac89c2035931bc.yml From 831787eca826b1086b364ce50b3f3d798c8d8f7d Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 11 Nov 2024 14:56:12 +0000 Subject: [PATCH 383/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d8039040f..d9b513d63 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a78c6e9e72b6199cc4e538566d01eda7b5f593221b28b27d9eac89c2035931bc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c93213df96468708c029381048af8d18f1d14118051946429590dd0faedce456.yml From 43707fec4cc04109ae088839d8c4ed85ec4eea8e Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 11 Nov 2024 15:24:36 +0000 Subject: [PATCH 384/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d9b513d63..d8039040f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c93213df96468708c029381048af8d18f1d14118051946429590dd0faedce456.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a78c6e9e72b6199cc4e538566d01eda7b5f593221b28b27d9eac89c2035931bc.yml From 84c1112f3206ed0631b9395e9cdf26c44ed759de Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 11 Nov 2024 16:09:59 +0000 Subject: [PATCH 385/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d8039040f..d9b513d63 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a78c6e9e72b6199cc4e538566d01eda7b5f593221b28b27d9eac89c2035931bc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c93213df96468708c029381048af8d18f1d14118051946429590dd0faedce456.yml From 3dad5f3be7538b90720c780847b5d1cec7dce540 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 11 Nov 2024 16:24:37 +0000 Subject: [PATCH 386/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d9b513d63..d8039040f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c93213df96468708c029381048af8d18f1d14118051946429590dd0faedce456.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a78c6e9e72b6199cc4e538566d01eda7b5f593221b28b27d9eac89c2035931bc.yml From 90ce91327b00a26be85b838ca12034a33321239f Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 11 Nov 2024 17:07:42 +0000 Subject: [PATCH 387/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d8039040f..d9b513d63 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a78c6e9e72b6199cc4e538566d01eda7b5f593221b28b27d9eac89c2035931bc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c93213df96468708c029381048af8d18f1d14118051946429590dd0faedce456.yml From 8f1b523a90232cb6441f53b1aa61893a1dce8a08 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 11 Nov 2024 17:24:35 +0000 Subject: [PATCH 388/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d9b513d63..d8039040f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c93213df96468708c029381048af8d18f1d14118051946429590dd0faedce456.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a78c6e9e72b6199cc4e538566d01eda7b5f593221b28b27d9eac89c2035931bc.yml From c66f2a9b51bfb40e8668e364b3d2abefa2d25677 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 11 Nov 2024 18:31:25 +0000 Subject: [PATCH 389/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d8039040f..d9b513d63 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a78c6e9e72b6199cc4e538566d01eda7b5f593221b28b27d9eac89c2035931bc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c93213df96468708c029381048af8d18f1d14118051946429590dd0faedce456.yml From e8daea7cd91b8137d8b55ca907b98d99aa7de698 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 11 Nov 2024 19:24:15 +0000 Subject: [PATCH 390/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d9b513d63..d8039040f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c93213df96468708c029381048af8d18f1d14118051946429590dd0faedce456.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a78c6e9e72b6199cc4e538566d01eda7b5f593221b28b27d9eac89c2035931bc.yml From c9c42adc2fce2d2ce11d96866c25a15dc05754d0 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 11 Nov 2024 19:42:34 +0000 Subject: [PATCH 391/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d8039040f..d9b513d63 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a78c6e9e72b6199cc4e538566d01eda7b5f593221b28b27d9eac89c2035931bc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c93213df96468708c029381048af8d18f1d14118051946429590dd0faedce456.yml From df5487e79f6b4227421f443652c495c068c69455 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 11 Nov 2024 20:24:16 +0000 Subject: [PATCH 392/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d9b513d63..d8039040f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c93213df96468708c029381048af8d18f1d14118051946429590dd0faedce456.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a78c6e9e72b6199cc4e538566d01eda7b5f593221b28b27d9eac89c2035931bc.yml From b1fc8a75425ad2b91a73892692bbd6674e20b55d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 21:46:21 +0000 Subject: [PATCH 393/993] feat(api): api update (#270) --- .stats.yml | 2 +- src/runloop_api_client/types/devbox_view.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d8039040f..dbb32b026 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a78c6e9e72b6199cc4e538566d01eda7b5f593221b28b27d9eac89c2035931bc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-56176ce883d8a3fef0df5ec4a0b1e6252c700892aa385a41df8c532c1a704941.yml diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 2ad186da4..ebe9f5048 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -45,5 +45,7 @@ class DevboxView(BaseModel): name: Optional[str] = None """The name of the Devbox.""" - shutdown_reason: Optional[Literal["api_shutdown", "keep_alive_timeout", "entrypoint_exit"]] = None + shutdown_reason: Optional[ + Literal["api_shutdown", "keep_alive_timeout", "entrypoint_exit", "idle", "lambda_lifecycle"] + ] = None """The shutdown reason if the Devbox shutdown, if any.""" From 0bd8a0aa0c88cf0bcd8746723606143e3e580f9d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 22:24:22 +0000 Subject: [PATCH 394/993] feat(api): api update (#271) --- .stats.yml | 2 +- README.md | 6 ++---- src/runloop_api_client/types/devbox_view.py | 4 +--- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index dbb32b026..d8039040f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-56176ce883d8a3fef0df5ec4a0b1e6252c700892aa385a41df8c532c1a704941.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a78c6e9e72b6199cc4e538566d01eda7b5f593221b28b27d9eac89c2035931bc.yml diff --git a/README.md b/README.md index 94f81d1a5..5b4e3beb6 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,7 @@ import os from runloop_api_client import Runloop client = Runloop( - # This is the default and can be omitted - bearer_token=os.environ.get("RUNLOOP_API_KEY"), + bearer_token=os.environ.get("RUNLOOP_API_KEY"), # This is the default and can be omitted ) devbox_view = client.devboxes.create() @@ -51,8 +50,7 @@ import asyncio from runloop_api_client import AsyncRunloop client = AsyncRunloop( - # This is the default and can be omitted - bearer_token=os.environ.get("RUNLOOP_API_KEY"), + bearer_token=os.environ.get("RUNLOOP_API_KEY"), # This is the default and can be omitted ) diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index ebe9f5048..2ad186da4 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -45,7 +45,5 @@ class DevboxView(BaseModel): name: Optional[str] = None """The name of the Devbox.""" - shutdown_reason: Optional[ - Literal["api_shutdown", "keep_alive_timeout", "entrypoint_exit", "idle", "lambda_lifecycle"] - ] = None + shutdown_reason: Optional[Literal["api_shutdown", "keep_alive_timeout", "entrypoint_exit"]] = None """The shutdown reason if the Devbox shutdown, if any.""" From 3598f118de652d96a2b4e0b3e74f67d212f502e3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 12 Nov 2024 00:06:27 +0000 Subject: [PATCH 395/993] feat(api): api update (#272) --- .stats.yml | 2 +- src/runloop_api_client/types/devbox_view.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d8039040f..dbb32b026 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a78c6e9e72b6199cc4e538566d01eda7b5f593221b28b27d9eac89c2035931bc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-56176ce883d8a3fef0df5ec4a0b1e6252c700892aa385a41df8c532c1a704941.yml diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 2ad186da4..ebe9f5048 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -45,5 +45,7 @@ class DevboxView(BaseModel): name: Optional[str] = None """The name of the Devbox.""" - shutdown_reason: Optional[Literal["api_shutdown", "keep_alive_timeout", "entrypoint_exit"]] = None + shutdown_reason: Optional[ + Literal["api_shutdown", "keep_alive_timeout", "entrypoint_exit", "idle", "lambda_lifecycle"] + ] = None """The shutdown reason if the Devbox shutdown, if any.""" From 97157aafbb1711099f0346b6267739e8ef5d4210 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 12 Nov 2024 00:24:42 +0000 Subject: [PATCH 396/993] feat(api): api update (#273) --- .stats.yml | 2 +- src/runloop_api_client/resources/devboxes/devboxes.py | 4 ++-- src/runloop_api_client/types/devbox_write_file_params.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index dbb32b026..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-56176ce883d8a3fef0df5ec4a0b1e6252c700892aa385a41df8c532c1a704941.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index b4115afdc..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -811,7 +811,7 @@ def write_file( Args: contents: The contents to write to file. - file_path: The path of the file to read. + file_path: The path of the file to write. extra_headers: Send extra headers @@ -1577,7 +1577,7 @@ async def write_file( Args: contents: The contents to write to file. - file_path: The path of the file to read. + file_path: The path of the file to write. extra_headers: Send extra headers diff --git a/src/runloop_api_client/types/devbox_write_file_params.py b/src/runloop_api_client/types/devbox_write_file_params.py index eca1cca16..af2abad06 100644 --- a/src/runloop_api_client/types/devbox_write_file_params.py +++ b/src/runloop_api_client/types/devbox_write_file_params.py @@ -12,4 +12,4 @@ class DevboxWriteFileParams(TypedDict, total=False): """The contents to write to file.""" file_path: Required[str] - """The path of the file to read.""" + """The path of the file to write.""" From 7edc74e47b7342cf3f4fcccb6fc50ff4809f57f2 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 12 Nov 2024 01:05:37 +0000 Subject: [PATCH 397/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 45d420f36..de4ae532e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-52be0b71770b582caa2f4b4948ed877410ff87b565e7ff6aded7363059bfac83.yml From 107246dd0494819983657cb2d1a543a49459f2d9 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 12 Nov 2024 01:24:18 +0000 Subject: [PATCH 398/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index de4ae532e..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-52be0b71770b582caa2f4b4948ed877410ff87b565e7ff6aded7363059bfac83.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml From da00e97c98fb1de546a5bb341bba4130c55f80e3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:45:11 +0000 Subject: [PATCH 399/993] feat(api): api update (#274) --- .stats.yml | 2 +- src/runloop_api_client/_utils/_transform.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 45d420f36..de4ae532e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-52be0b71770b582caa2f4b4948ed877410ff87b565e7ff6aded7363059bfac83.yml diff --git a/src/runloop_api_client/_utils/_transform.py b/src/runloop_api_client/_utils/_transform.py index d7c05345d..a6b62cad0 100644 --- a/src/runloop_api_client/_utils/_transform.py +++ b/src/runloop_api_client/_utils/_transform.py @@ -316,6 +316,11 @@ async def _async_transform_recursive( # Iterable[T] or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str)) ): + # dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually + # intended as an iterable, so we don't transform it. + if isinstance(data, dict): + return cast(object, data) + inner_type = extract_type_arg(stripped_type, 0) return [await _async_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data] From 460c76cac4aac091eeacaaf1466cc6ce03220c3a Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 12 Nov 2024 17:24:16 +0000 Subject: [PATCH 400/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index de4ae532e..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-52be0b71770b582caa2f4b4948ed877410ff87b565e7ff6aded7363059bfac83.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml From 9679fe5752787a75dbf5ee987c7e7966ea3934cd Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 12 Nov 2024 18:48:50 +0000 Subject: [PATCH 401/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 45d420f36..de4ae532e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-52be0b71770b582caa2f4b4948ed877410ff87b565e7ff6aded7363059bfac83.yml From ddfba5dcf534be3fde82fe4f385bf0bd1b1907d8 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 12 Nov 2024 19:24:37 +0000 Subject: [PATCH 402/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index de4ae532e..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-52be0b71770b582caa2f4b4948ed877410ff87b565e7ff6aded7363059bfac83.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml From ad23252f7de06fd558d55178912883d8fea5be0f Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 12 Nov 2024 20:24:15 +0000 Subject: [PATCH 403/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 45d420f36..de4ae532e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-52be0b71770b582caa2f4b4948ed877410ff87b565e7ff6aded7363059bfac83.yml From 03c3efdcc97c413ea5ea1fd10d91b6c83ea86fc2 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 12 Nov 2024 21:24:16 +0000 Subject: [PATCH 404/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index de4ae532e..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-52be0b71770b582caa2f4b4948ed877410ff87b565e7ff6aded7363059bfac83.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml From 89228894eeb6ead2c4323088210c08b0ce548492 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 12 Nov 2024 21:39:36 +0000 Subject: [PATCH 405/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 45d420f36..de4ae532e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-52be0b71770b582caa2f4b4948ed877410ff87b565e7ff6aded7363059bfac83.yml From b3a27976d98672eb7f93376bf69587e451636375 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 12 Nov 2024 22:24:14 +0000 Subject: [PATCH 406/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index de4ae532e..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-52be0b71770b582caa2f4b4948ed877410ff87b565e7ff6aded7363059bfac83.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml From 62bbccb12f74bd22a9db49f43863edf38e8c4622 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 12 Nov 2024 22:50:12 +0000 Subject: [PATCH 407/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 45d420f36..de4ae532e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-52be0b71770b582caa2f4b4948ed877410ff87b565e7ff6aded7363059bfac83.yml From ba3479d94fde0902fd31fedf90a52849ad59860b Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 12 Nov 2024 23:24:16 +0000 Subject: [PATCH 408/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index de4ae532e..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-52be0b71770b582caa2f4b4948ed877410ff87b565e7ff6aded7363059bfac83.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml From 6865a4947545c1bbe3cb424bdea7d2be3acb72a5 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 13 Nov 2024 00:53:31 +0000 Subject: [PATCH 409/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 45d420f36..de4ae532e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-52be0b71770b582caa2f4b4948ed877410ff87b565e7ff6aded7363059bfac83.yml From 281c0771a7167a23fca17bffcf32dc84faa07bab Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 13 Nov 2024 01:24:16 +0000 Subject: [PATCH 410/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index de4ae532e..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-52be0b71770b582caa2f4b4948ed877410ff87b565e7ff6aded7363059bfac83.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml From 1ddac3e548ae7c8571d4eedb68e09803f33ec8ff Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 13 Nov 2024 06:11:29 +0000 Subject: [PATCH 411/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 45d420f36..de4ae532e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-52be0b71770b582caa2f4b4948ed877410ff87b565e7ff6aded7363059bfac83.yml From 1990ae9cf471f47665d5f900ff7bea7eb8e3d619 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 13 Nov 2024 06:24:15 +0000 Subject: [PATCH 412/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index de4ae532e..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-52be0b71770b582caa2f4b4948ed877410ff87b565e7ff6aded7363059bfac83.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml From 81ad56013db3018b582480d0a84c4be9f6864211 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 13 Nov 2024 16:58:10 +0000 Subject: [PATCH 413/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 45d420f36..de4ae532e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-52be0b71770b582caa2f4b4948ed877410ff87b565e7ff6aded7363059bfac83.yml From e39da485132b17665681104de9b6e349aee7e2e6 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 13 Nov 2024 17:24:15 +0000 Subject: [PATCH 414/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index de4ae532e..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-52be0b71770b582caa2f4b4948ed877410ff87b565e7ff6aded7363059bfac83.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml From 6cb2a63e33e2ab8f283af9ce20299304807db093 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 13 Nov 2024 19:05:51 +0000 Subject: [PATCH 415/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 45d420f36..6e70972e5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml From 49c977ac9a86b5c764a894b1b51d385f2e77e2f4 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 13 Nov 2024 19:24:26 +0000 Subject: [PATCH 416/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 6e70972e5..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml From 5846070badb1793b950a3bdaadac264b56581c74 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2024 19:52:06 +0000 Subject: [PATCH 417/993] feat(api): api update (#275) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 ++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1999 +++++++++++++++++ 70 files changed, 4757 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..e68ed575f --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1999 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 7dc2af621e892ad5f7a2a021ed5f9750a2a3dc23 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2024 20:24:27 +0000 Subject: [PATCH 418/993] feat(api): api update (#276) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 ------------ .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1999 ----------------- 70 files changed, 2 insertions(+), 4757 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index e68ed575f..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1999 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 0731e692fee54604e81772cefd45ddd17a59ddbb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2024 20:25:09 +0000 Subject: [PATCH 419/993] feat(api): api update (#277) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 ++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1999 +++++++++++++++++ 70 files changed, 4757 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..e68ed575f --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1999 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 0e84ce67ca35dae7484e74d1be485f09cac2800c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2024 21:24:27 +0000 Subject: [PATCH 420/993] feat(api): api update (#278) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 ------------ .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1999 ----------------- 70 files changed, 2 insertions(+), 4757 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index e68ed575f..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1999 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 6d72cabf57b5cc45f851209bbdc5d5c25b8e5f24 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 00:14:18 +0000 Subject: [PATCH 421/993] feat(api): api update (#279) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 ++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1999 +++++++++++++++++ 70 files changed, 4757 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..e68ed575f --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1999 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 1338e9f1bca6ea71616f039e5abda6d3230ee921 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 00:24:24 +0000 Subject: [PATCH 422/993] feat(api): api update (#280) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 ------------ .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1999 ----------------- 70 files changed, 2 insertions(+), 4757 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index e68ed575f..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1999 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 30a985fe28f1a165340c1c3f3360be1cf73a0175 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 17:01:57 +0000 Subject: [PATCH 423/993] feat(api): api update (#281) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 ++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1999 +++++++++++++++++ 70 files changed, 4757 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..e68ed575f --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1999 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From a52929919f3e68a8e21931b0b819c9703f487daf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 17:24:26 +0000 Subject: [PATCH 424/993] feat(api): api update (#282) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 ------------ .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1999 ----------------- 70 files changed, 2 insertions(+), 4757 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index e68ed575f..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1999 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 080276cc6eaec1b46d6e153858a974c8c8f0fe17 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 18:01:12 +0000 Subject: [PATCH 425/993] feat(api): api update (#283) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 ++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1999 +++++++++++++++++ 70 files changed, 4757 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..e68ed575f --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1999 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From e5e2b921e4b2dd8738d1c1300b570dd55d56762e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 18:24:44 +0000 Subject: [PATCH 426/993] feat(api): api update (#284) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 ------------ .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1999 ----------------- 70 files changed, 2 insertions(+), 4757 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index e68ed575f..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1999 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From a12b0b11b02fe59b0e5de2d3a13a443b36ac9e4e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 20:07:14 +0000 Subject: [PATCH 427/993] feat(api): api update (#285) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 ++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1999 +++++++++++++++++ 70 files changed, 4757 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..e68ed575f --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1999 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From b2b22498448866e6a931da6bc7267f44053de489 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 20:24:42 +0000 Subject: [PATCH 428/993] feat(api): api update (#286) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 ------------ .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1999 ----------------- 70 files changed, 2 insertions(+), 4757 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index e68ed575f..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1999 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 050017eb48ba34d6668e88330df178440279666c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 20:43:02 +0000 Subject: [PATCH 429/993] feat(api): api update (#287) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 ++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1999 +++++++++++++++++ 70 files changed, 4757 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..e68ed575f --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1999 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 903c8f252de56363936312aeaed962dbc0388210 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:24:27 +0000 Subject: [PATCH 430/993] feat(api): api update (#288) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 ------------ .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1999 ----------------- 70 files changed, 2 insertions(+), 4757 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index e68ed575f..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1999 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 3b23ed244527765d6685a07dc129ee2fd972c412 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 22:13:35 +0000 Subject: [PATCH 431/993] feat(api): api update (#289) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 ++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1999 +++++++++++++++++ 70 files changed, 4757 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..e68ed575f --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1999 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From e342235de0b995f51c15bdbf632220637f3a5b0b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 22:24:43 +0000 Subject: [PATCH 432/993] feat(api): api update (#290) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 ------------ .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1999 ----------------- 70 files changed, 2 insertions(+), 4757 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index e68ed575f..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1999 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 6df92565a4fab4785bbb263653e3ed3ccd8c1438 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 23:07:50 +0000 Subject: [PATCH 433/993] feat(api): api update (#291) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 ++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1999 +++++++++++++++++ 70 files changed, 4757 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..e68ed575f --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1999 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From ab6949f578599cdaf050d58cc6545a154c31a640 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 23:24:22 +0000 Subject: [PATCH 434/993] feat(api): api update (#292) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 ------------ .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1999 ----------------- 70 files changed, 2 insertions(+), 4757 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index e68ed575f..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1999 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 6c9ac63a09ee17a2e501fe49c9757de13ef97cc1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 23:51:50 +0000 Subject: [PATCH 435/993] feat(api): api update (#293) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 ++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1999 +++++++++++++++++ 70 files changed, 4757 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..e68ed575f --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1999 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 715568e724ebceb04f7c0f19ffaa5eefb684ecb3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 00:25:05 +0000 Subject: [PATCH 436/993] feat(api): api update (#294) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 ------------ .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1999 ----------------- 70 files changed, 2 insertions(+), 4757 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index e68ed575f..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1999 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 3534e349b30505a3f81deb2a207a9adc6c38b7c2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 01:27:16 +0000 Subject: [PATCH 437/993] feat(api): api update (#295) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 ++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1999 +++++++++++++++++ 70 files changed, 4757 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..e68ed575f --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1999 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 70bad59d8884cab5040baddf165030f0249a8b10 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 02:24:27 +0000 Subject: [PATCH 438/993] feat(api): api update (#296) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 ------------ .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1999 ----------------- 70 files changed, 2 insertions(+), 4757 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index e68ed575f..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1999 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 7c03d05369a0ea4f0c0c0c8a71723eec45db0d38 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:27:13 +0000 Subject: [PATCH 439/993] feat(api): api update (#297) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 ++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1999 +++++++++++++++++ 70 files changed, 4757 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..e68ed575f --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1999 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From fe004dff1f0bdb0af26f75bb0a335a65efe61036 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 16:24:45 +0000 Subject: [PATCH 440/993] feat(api): api update (#298) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 ------------ .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1999 ----------------- 70 files changed, 2 insertions(+), 4757 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index e68ed575f..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1999 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From ad985701e8c2f2dfb052cdca5029e698c582fc77 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 18:57:13 +0000 Subject: [PATCH 441/993] feat(api): api update (#299) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 ++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1999 +++++++++++++++++ 70 files changed, 4757 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..e68ed575f --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1999 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 457d9c0c4630dc7655562d1ac010125c84e913b7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 19:24:21 +0000 Subject: [PATCH 442/993] feat(api): api update (#300) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 ------------ .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1999 ----------------- 70 files changed, 2 insertions(+), 4757 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index e68ed575f..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1999 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From f15a7675777e6ba4ed330aa64b03b0b58fe5ea8f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 21:12:00 +0000 Subject: [PATCH 443/993] feat(api): api update (#301) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 ++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1999 +++++++++++++++++ 70 files changed, 4757 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..e68ed575f --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1999 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 91883a7e20fe790dd11f7071a29e88311021dbbc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 21:24:52 +0000 Subject: [PATCH 444/993] feat(api): api update (#302) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 ------------ .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1999 ----------------- 70 files changed, 2 insertions(+), 4757 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index e68ed575f..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1999 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From f77ae02deaf8ad2e1c453653e7879d4d87836410 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 16 Nov 2024 17:52:40 +0000 Subject: [PATCH 445/993] feat(api): api update (#303) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 ++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1999 +++++++++++++++++ 70 files changed, 4757 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..e68ed575f --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1999 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 25134944e83e50a64805b2cbc7055bff360458e7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 16 Nov 2024 18:24:46 +0000 Subject: [PATCH 446/993] feat(api): api update (#304) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 ------------ .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1999 ----------------- 70 files changed, 2 insertions(+), 4757 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index e68ed575f..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1999 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 321b82cf3748fd4e0cc8ec685b334e664d31d400 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 02:38:37 +0000 Subject: [PATCH 447/993] feat(api): api update (#305) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 ++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1999 +++++++++++++++++ 70 files changed, 4757 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..e68ed575f --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1999 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}, {}, {}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + }, + ], + "severity": 1, + "source": "source", + "tags": [1, 2], + }, + ], + "only": ["string", "string", "string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From dae0290d2e2bb2a0b86747ebc96b5ed4d44d5151 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 03:24:55 +0000 Subject: [PATCH 448/993] feat(api): api update (#306) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 ------------ .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1999 ----------------- 70 files changed, 2 insertions(+), 4757 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index e68ed575f..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1999 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}, {}, {}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - }, - ], - "severity": 1, - "source": "source", - "tags": [1, 2], - }, - ], - "only": ["string", "string", "string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 62392e113a11de93688feb209af3c7df44616ce8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 11:13:06 +0000 Subject: [PATCH 449/993] chore: rebuild project due to codegen change (#307) --- tests/api_resources/test_blueprints.py | 80 ++++++-------------------- tests/api_resources/test_devboxes.py | 40 +++---------- 2 files changed, 24 insertions(+), 96 deletions(-) diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 1e9b97c83..f0f4fc6ba 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -39,19 +39,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", - }, - { - "repo_name": "repo_name", - "repo_owner": "repo_owner", - "token": "token", - "install_command": "install_command", - }, - { - "repo_name": "repo_name", - "repo_owner": "repo_owner", - "token": "token", - "install_command": "install_command", - }, + } ], dockerfile="dockerfile", file_mounts={"foo": "string"}, @@ -60,12 +48,12 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "idle_time_seconds": 0, "on_idle": "shutdown", }, - "available_ports": [0, 0, 0], + "available_ports": [0], "keep_alive_time_seconds": 0, - "launch_commands": ["string", "string", "string"], + "launch_commands": ["string"], "resource_size_request": "SMALL", }, - system_setup_commands=["string", "string", "string"], + system_setup_commands=["string"], ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @@ -220,19 +208,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", - }, - { - "repo_name": "repo_name", - "repo_owner": "repo_owner", - "token": "token", - "install_command": "install_command", - }, - { - "repo_name": "repo_name", - "repo_owner": "repo_owner", - "token": "token", - "install_command": "install_command", - }, + } ], dockerfile="dockerfile", file_mounts={"foo": "string"}, @@ -241,12 +217,12 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: "idle_time_seconds": 0, "on_idle": "shutdown", }, - "available_ports": [0, 0, 0], + "available_ports": [0], "keep_alive_time_seconds": 0, - "launch_commands": ["string", "string", "string"], + "launch_commands": ["string"], "resource_size_request": "SMALL", }, - system_setup_commands=["string", "string", "string"], + system_setup_commands=["string"], ) assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) @@ -295,19 +271,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", - }, - { - "repo_name": "repo_name", - "repo_owner": "repo_owner", - "token": "token", - "install_command": "install_command", - }, - { - "repo_name": "repo_name", - "repo_owner": "repo_owner", - "token": "token", - "install_command": "install_command", - }, + } ], dockerfile="dockerfile", file_mounts={"foo": "string"}, @@ -316,12 +280,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "idle_time_seconds": 0, "on_idle": "shutdown", }, - "available_ports": [0, 0, 0], + "available_ports": [0], "keep_alive_time_seconds": 0, - "launch_commands": ["string", "string", "string"], + "launch_commands": ["string"], "resource_size_request": "SMALL", }, - system_setup_commands=["string", "string", "string"], + system_setup_commands=["string"], ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @@ -476,19 +440,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", - }, - { - "repo_name": "repo_name", - "repo_owner": "repo_owner", - "token": "token", - "install_command": "install_command", - }, - { - "repo_name": "repo_name", - "repo_owner": "repo_owner", - "token": "token", - "install_command": "install_command", - }, + } ], dockerfile="dockerfile", file_mounts={"foo": "string"}, @@ -497,12 +449,12 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) "idle_time_seconds": 0, "on_idle": "shutdown", }, - "available_ports": [0, 0, 0], + "available_ports": [0], "keep_alive_time_seconds": 0, - "launch_commands": ["string", "string", "string"], + "launch_commands": ["string"], "resource_size_request": "SMALL", }, - system_setup_commands=["string", "string", "string"], + system_setup_commands=["string"], ) assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 8b8803b26..96482f9af 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -50,19 +50,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", - }, - { - "repo_name": "repo_name", - "repo_owner": "repo_owner", - "token": "token", - "install_command": "install_command", - }, - { - "repo_name": "repo_name", - "repo_owner": "repo_owner", - "token": "token", - "install_command": "install_command", - }, + } ], entrypoint="entrypoint", environment_variables={"foo": "string"}, @@ -72,15 +60,15 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "idle_time_seconds": 0, "on_idle": "shutdown", }, - "available_ports": [0, 0, 0], + "available_ports": [0], "keep_alive_time_seconds": 0, - "launch_commands": ["string", "string", "string"], + "launch_commands": ["string"], "resource_size_request": "SMALL", }, metadata={"foo": "string"}, name="name", prebuilt="prebuilt", - setup_commands=["string", "string", "string"], + setup_commands=["string"], snapshot_id="snapshot_id", ) assert_matches_type(DevboxView, devbox, path=["response"]) @@ -804,19 +792,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "repo_owner": "repo_owner", "token": "token", "install_command": "install_command", - }, - { - "repo_name": "repo_name", - "repo_owner": "repo_owner", - "token": "token", - "install_command": "install_command", - }, - { - "repo_name": "repo_name", - "repo_owner": "repo_owner", - "token": "token", - "install_command": "install_command", - }, + } ], entrypoint="entrypoint", environment_variables={"foo": "string"}, @@ -826,15 +802,15 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "idle_time_seconds": 0, "on_idle": "shutdown", }, - "available_ports": [0, 0, 0], + "available_ports": [0], "keep_alive_time_seconds": 0, - "launch_commands": ["string", "string", "string"], + "launch_commands": ["string"], "resource_size_request": "SMALL", }, metadata={"foo": "string"}, name="name", prebuilt="prebuilt", - setup_commands=["string", "string", "string"], + setup_commands=["string"], snapshot_id="snapshot_id", ) assert_matches_type(DevboxView, devbox, path=["response"]) From 052c50663c3f01bd4da36a2f7b6f376a9217d16a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 13:00:03 +0000 Subject: [PATCH 450/993] chore: rebuild project due to codegen change (#308) --- pyproject.toml | 1 + requirements-dev.lock | 1 + src/runloop_api_client/_utils/_sync.py | 90 ++++++++++++-------------- tests/test_client.py | 38 +++++++++++ 4 files changed, 80 insertions(+), 50 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cb9458aaa..35c27f050 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,6 +55,7 @@ dev-dependencies = [ "dirty-equals>=0.6.0", "importlib-metadata>=6.7.0", "rich>=13.7.1", + "nest_asyncio==1.6.0" ] [tool.rye.scripts] diff --git a/requirements-dev.lock b/requirements-dev.lock index 332c5abbd..ba48805c2 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -51,6 +51,7 @@ mdurl==0.1.2 mypy==1.13.0 mypy-extensions==1.0.0 # via mypy +nest-asyncio==1.6.0 nodeenv==1.8.0 # via pyright nox==2023.4.22 diff --git a/src/runloop_api_client/_utils/_sync.py b/src/runloop_api_client/_utils/_sync.py index d0d810337..8b3aaf2b5 100644 --- a/src/runloop_api_client/_utils/_sync.py +++ b/src/runloop_api_client/_utils/_sync.py @@ -1,56 +1,62 @@ from __future__ import annotations +import sys +import asyncio import functools -from typing import TypeVar, Callable, Awaitable +import contextvars +from typing import Any, TypeVar, Callable, Awaitable from typing_extensions import ParamSpec -import anyio -import anyio.to_thread - -from ._reflection import function_has_argument - T_Retval = TypeVar("T_Retval") T_ParamSpec = ParamSpec("T_ParamSpec") -# copied from `asyncer`, https://github.com/tiangolo/asyncer -def asyncify( - function: Callable[T_ParamSpec, T_Retval], - *, - cancellable: bool = False, - limiter: anyio.CapacityLimiter | None = None, -) -> Callable[T_ParamSpec, Awaitable[T_Retval]]: +if sys.version_info >= (3, 9): + to_thread = asyncio.to_thread +else: + # backport of https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread + # for Python 3.8 support + async def to_thread( + func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs + ) -> Any: + """Asynchronously run function *func* in a separate thread. + + Any *args and **kwargs supplied for this function are directly passed + to *func*. Also, the current :class:`contextvars.Context` is propagated, + allowing context variables from the main thread to be accessed in the + separate thread. + + Returns a coroutine that can be awaited to get the eventual result of *func*. + """ + loop = asyncio.events.get_running_loop() + ctx = contextvars.copy_context() + func_call = functools.partial(ctx.run, func, *args, **kwargs) + return await loop.run_in_executor(None, func_call) + + +# inspired by `asyncer`, https://github.com/tiangolo/asyncer +def asyncify(function: Callable[T_ParamSpec, T_Retval]) -> Callable[T_ParamSpec, Awaitable[T_Retval]]: """ Take a blocking function and create an async one that receives the same - positional and keyword arguments, and that when called, calls the original function - in a worker thread using `anyio.to_thread.run_sync()`. Internally, - `asyncer.asyncify()` uses the same `anyio.to_thread.run_sync()`, but it supports - keyword arguments additional to positional arguments and it adds better support for - autocompletion and inline errors for the arguments of the function called and the - return value. - - If the `cancellable` option is enabled and the task waiting for its completion is - cancelled, the thread will still run its course but its return value (or any raised - exception) will be ignored. + positional and keyword arguments. For python version 3.9 and above, it uses + asyncio.to_thread to run the function in a separate thread. For python version + 3.8, it uses locally defined copy of the asyncio.to_thread function which was + introduced in python 3.9. - Use it like this: + Usage: - ```Python - def do_work(arg1, arg2, kwarg1="", kwarg2="") -> str: - # Do work - return "Some result" + ```python + def blocking_func(arg1, arg2, kwarg1=None): + # blocking code + return result - result = await to_thread.asyncify(do_work)("spam", "ham", kwarg1="a", kwarg2="b") - print(result) + result = asyncify(blocking_function)(arg1, arg2, kwarg1=value1) ``` ## Arguments `function`: a blocking regular callable (e.g. a function) - `cancellable`: `True` to allow cancellation of the operation - `limiter`: capacity limiter to use to limit the total amount of threads running - (if omitted, the default limiter is used) ## Return @@ -60,22 +66,6 @@ def do_work(arg1, arg2, kwarg1="", kwarg2="") -> str: """ async def wrapper(*args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs) -> T_Retval: - partial_f = functools.partial(function, *args, **kwargs) - - # In `v4.1.0` anyio added the `abandon_on_cancel` argument and deprecated the old - # `cancellable` argument, so we need to use the new `abandon_on_cancel` to avoid - # surfacing deprecation warnings. - if function_has_argument(anyio.to_thread.run_sync, "abandon_on_cancel"): - return await anyio.to_thread.run_sync( - partial_f, - abandon_on_cancel=cancellable, - limiter=limiter, - ) - - return await anyio.to_thread.run_sync( - partial_f, - cancellable=cancellable, - limiter=limiter, - ) + return await to_thread(function, *args, **kwargs) return wrapper diff --git a/tests/test_client.py b/tests/test_client.py index b236d53a2..022d2e8a8 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -4,11 +4,14 @@ import gc import os +import sys import json import asyncio import inspect +import subprocess import tracemalloc from typing import Any, Union, cast +from textwrap import dedent from unittest import mock from typing_extensions import Literal @@ -1636,3 +1639,38 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: response = await client.devboxes.with_raw_response.create(extra_headers={"x-stainless-retry-count": "42"}) assert response.http_request.headers.get("x-stainless-retry-count") == "42" + + def test_get_platform(self) -> None: + # A previous implementation of asyncify could leave threads unterminated when + # used with nest_asyncio. + # + # Since nest_asyncio.apply() is global and cannot be un-applied, this + # test is run in a separate process to avoid affecting other tests. + test_code = dedent(""" + import asyncio + import nest_asyncio + import threading + + from runloop_api_client._utils import asyncify + from runloop_api_client._base_client import get_platform + + async def test_main() -> None: + result = await asyncify(get_platform)() + print(result) + for thread in threading.enumerate(): + print(thread.name) + + nest_asyncio.apply() + asyncio.run(test_main()) + """) + with subprocess.Popen( + [sys.executable, "-c", test_code], + text=True, + ) as process: + try: + process.wait(2) + if process.returncode: + raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code") + except subprocess.TimeoutExpired as e: + process.kill() + raise AssertionError("calling get_platform using asyncify resulted in a hung process") from e From 387c41477270abe02575ee53d78b8536ab9c83be Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 15:40:35 +0000 Subject: [PATCH 451/993] feat(api): api update (#309) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 46690b37084625231fcb160ff6c1cb3099893cfc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:35:48 +0000 Subject: [PATCH 452/993] feat(api): api update (#311) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From db8ec909312f60e5f935961c9d5507e4ad972945 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 17:27:17 +0000 Subject: [PATCH 453/993] feat(api): api update (#312) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 6384d0812f59ae1c15a521bbb01f3e873728bcac Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 18:24:43 +0000 Subject: [PATCH 454/993] feat(api): api update (#313) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From d040dab395f339cce2543c60b8a2807d151da5b3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 21:35:32 +0000 Subject: [PATCH 455/993] feat(api): api update (#314) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 61a23859b2882ac2646df60c60bfb3f48517f77e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 22:24:53 +0000 Subject: [PATCH 456/993] feat(api): api update (#315) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 4e6f791cdcdfc385e45f80b67eaa4b3bc8c401ed Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 23:29:18 +0000 Subject: [PATCH 457/993] feat(api): api update (#316) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 78b21baa00af4eac7da252c8f14d10f5538c72ed Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 00:24:55 +0000 Subject: [PATCH 458/993] feat(api): api update (#317) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 0234110796a6c83ac9abf67e4ad45d2d080dd6c9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 16:57:13 +0000 Subject: [PATCH 459/993] feat(api): api update (#318) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From c9626b5ddb76512dec5bcce60f48317f587cc607 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 17:24:51 +0000 Subject: [PATCH 460/993] feat(api): api update (#319) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From b1eaabfbb1bb1c206709307defbae73c9669772d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 17:25:38 +0000 Subject: [PATCH 461/993] feat(api): api update (#320) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 5bf5d9fa60f306efa935eef2eedc578528ec6b89 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 18:59:54 +0000 Subject: [PATCH 462/993] feat(api): api update (#321) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From ef4930e8c12a633e98c704c890ac03ec1c6f9952 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 19:13:33 +0000 Subject: [PATCH 463/993] feat(api): api update (#322) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 2f249bc97252b499bcb925155f86e59011ec23ba Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 19:24:50 +0000 Subject: [PATCH 464/993] feat(api): api update (#323) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 03f9b2bb02a8ce6d8bec01cc2d9658fdc35f35cf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 21:00:29 +0000 Subject: [PATCH 465/993] feat(api): api update (#324) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 29405baa35c5439ffeda52836300108f93f85d2e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 21:24:52 +0000 Subject: [PATCH 466/993] feat(api): api update (#325) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From f9947e4a30e637ba3fcf8b1058935b5867fbbd00 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 21:56:37 +0000 Subject: [PATCH 467/993] feat(api): api update (#326) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From c5b6eb5cff500c20256213143ad4ac49fa8f3dd0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 23:23:59 +0000 Subject: [PATCH 468/993] feat(api): api update (#327) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 699805a8822e91e6567f37802f3fa9dc2f283890 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 19:04:25 +0000 Subject: [PATCH 469/993] feat(api): api update (#328) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 195ee771748f413f9ca45131314ac515f8df8db3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 19:24:49 +0000 Subject: [PATCH 470/993] feat(api): api update (#329) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 8ef4c6ba56902501122ea5ea50d3e852c95c1535 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 21:12:46 +0000 Subject: [PATCH 471/993] feat(api): api update (#330) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 76bb32ff9a3e9341f283f226963467506f6833cc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 21:24:30 +0000 Subject: [PATCH 472/993] feat(api): api update (#331) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 876258e40ecda11a50eea5d022868d8ce5653514 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 22:47:46 +0000 Subject: [PATCH 473/993] feat(api): api update (#332) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From ecfd48ab29c4c4eff60c0bc943aa04b207c1adea Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 23:24:37 +0000 Subject: [PATCH 474/993] feat(api): api update (#333) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From a275b22db0ad07ac0700e1650e52908faf6ceebe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 23:55:44 +0000 Subject: [PATCH 475/993] feat(api): api update (#334) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 1a235c538285136b01753168913af3fd89b465a9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 00:24:35 +0000 Subject: [PATCH 476/993] feat(api): api update (#335) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 211eeb68e3381160dd75f26bd7e6af6858ee3c14 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 04:31:58 +0000 Subject: [PATCH 477/993] feat(api): api update (#336) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From cb6f07f8ad622d357791733c6bf776021ea7eac5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 05:24:51 +0000 Subject: [PATCH 478/993] feat(api): api update (#337) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From cb6b72609034929add4789dcc515dd49f6e12375 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:31:09 +0000 Subject: [PATCH 479/993] feat(api): api update (#338) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 1a59da2043dbbb9eadcc8a62020eb8be4f4b8e6c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:25:02 +0000 Subject: [PATCH 480/993] feat(api): api update (#339) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From dee197ed5c8708727816a1a10ddd66930c8e603e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:55:10 +0000 Subject: [PATCH 481/993] feat(api): api update (#340) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From adfcf52284576ce87e023d8048e7c02e3ff1035b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 17:25:25 +0000 Subject: [PATCH 482/993] feat(api): api update (#341) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 8eea5708fe684ccd286eb168ad68613dd197722d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 18:41:23 +0000 Subject: [PATCH 483/993] feat(api): api update (#342) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From af0bf9ce6f5a770e8d30780b3bb92fa05ca60cc0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 19:25:05 +0000 Subject: [PATCH 484/993] chore(internal): codegen related update (#343) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 88c4ec70f073f58f7a850928d8f699779099adea Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 20:27:02 +0000 Subject: [PATCH 485/993] feat(api): api update (#344) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 9053af1299ab81177b62abb7d08fe33eb7bcfc34 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 21:25:01 +0000 Subject: [PATCH 486/993] feat(api): api update (#345) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 1232b94a7868d4a354f0068063a48f5274610638 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 22:54:58 +0000 Subject: [PATCH 487/993] feat(api): api update (#346) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From d9100049258f066dbf586a7a327176123a172803 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 21 Nov 2024 23:24:59 +0000 Subject: [PATCH 488/993] feat(api): api update (#347) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From eb60ff3a513ec2b588c6d956badd0edf825b5bd0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 22 Nov 2024 03:58:07 +0000 Subject: [PATCH 489/993] feat(api): api update (#348) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From ff099079984d28010160c3f30340f68221cc77bc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 22 Nov 2024 04:25:12 +0000 Subject: [PATCH 490/993] feat(api): api update (#349) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 0fae5a6139a7731c839ab8de98ddd096933bc581 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 22 Nov 2024 19:21:27 +0000 Subject: [PATCH 491/993] feat(api): api update (#350) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From f947106a9290076a273caab6296da1ed3d19b776 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 22 Nov 2024 19:25:07 +0000 Subject: [PATCH 492/993] feat(api): api update (#351) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From b1952574eaac0734c7ae7e59c6554b09e440540b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 22 Nov 2024 21:25:34 +0000 Subject: [PATCH 493/993] feat(api): api update (#352) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From af5e71c94f69ad441e91dcaffa01eada6c575381 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 22 Nov 2024 22:31:35 +0000 Subject: [PATCH 494/993] feat(api): api update (#353) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index d5e332922..45d420f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..9e53c1633 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -852,10 +840,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1678,10 +1662,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1748,10 +1728,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1818,10 +1794,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1888,10 +1860,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 71dfdf2ae0a12199e08e10ae6b7e484210bb6d06 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 23 Nov 2024 00:23:09 +0000 Subject: [PATCH 495/993] feat(api): api update (#354) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 45d420f36..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a7d2f5dd47f9a588ee54346097c35e45faa34684c4b0da098915a31753e2840.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9e53c1633..2e3c7bc03 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -840,6 +852,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1662,6 +1678,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1728,6 +1748,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1794,6 +1818,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1860,6 +1888,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 3fa04c168d74e59c3718d25079859b24715dcdd4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 23 Nov 2024 07:56:39 +0000 Subject: [PATCH 496/993] chore(internal): fix compat model_dump method when warnings are passed (#355) --- src/runloop_api_client/_compat.py | 3 ++- tests/test_models.py | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/runloop_api_client/_compat.py b/src/runloop_api_client/_compat.py index 4794129c4..df173f85e 100644 --- a/src/runloop_api_client/_compat.py +++ b/src/runloop_api_client/_compat.py @@ -145,7 +145,8 @@ def model_dump( exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, - warnings=warnings, + # warnings are not supported in Pydantic v1 + warnings=warnings if PYDANTIC_V2 else True, ) return cast( "dict[str, Any]", diff --git a/tests/test_models.py b/tests/test_models.py index 2023eaef5..efdbd6605 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -561,6 +561,14 @@ class Model(BaseModel): m.model_dump(warnings=False) +def test_compat_method_no_error_for_warnings() -> None: + class Model(BaseModel): + foo: Optional[str] + + m = Model(foo="hello") + assert isinstance(model_dump(m, warnings=False), dict) + + def test_to_json() -> None: class Model(BaseModel): foo: Optional[str] = Field(alias="FOO", default=None) From 5bcd1a1f264d718f304ac93bfd2eee1f190ec98e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 23 Nov 2024 07:58:05 +0000 Subject: [PATCH 497/993] docs: add info log level to readme (#356) --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5b4e3beb6..642feeb74 100644 --- a/README.md +++ b/README.md @@ -168,12 +168,14 @@ Note that requests that time out are [retried twice by default](#retries). We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module. -You can enable logging by setting the environment variable `RUNLOOP_LOG` to `debug`. +You can enable logging by setting the environment variable `RUNLOOP_LOG` to `info`. ```shell -$ export RUNLOOP_LOG=debug +$ export RUNLOOP_LOG=info ``` +Or to `debug` for more verbose logging. + ### How to tell whether `None` means `null` or missing In an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`: From 50f3e22daf9389cf1b4fed8ccded20f017d9104a Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 25 Nov 2024 16:21:08 +0000 Subject: [PATCH 498/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d5e332922..7742ba505 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-473b610ec51bd9b7cffc41a9a4b37c229b145d663e63b9f2f323fda674b51b41.yml From c4a52c57ec28f9a903941144b5be2610ea9fe612 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Mon, 25 Nov 2024 19:52:34 +0000 Subject: [PATCH 499/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7742ba505..d5e332922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-473b610ec51bd9b7cffc41a9a4b37c229b145d663e63b9f2f323fda674b51b41.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml From 0480c6ec0e88520ebb35a8054eef72477292f159 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 07:17:16 +0000 Subject: [PATCH 500/993] chore: remove now unused `cached-property` dep (#357) --- pyproject.toml | 1 - src/runloop_api_client/_compat.py | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 35c27f050..b5f777d41 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,6 @@ dependencies = [ "anyio>=3.5.0, <5", "distro>=1.7.0, <2", "sniffio", - "cached-property; python_version < '3.8'", ] requires-python = ">= 3.8" classifiers = [ diff --git a/src/runloop_api_client/_compat.py b/src/runloop_api_client/_compat.py index df173f85e..92d9ee61e 100644 --- a/src/runloop_api_client/_compat.py +++ b/src/runloop_api_client/_compat.py @@ -214,9 +214,6 @@ def __set_name__(self, owner: type[Any], name: str) -> None: ... # __set__ is not defined at runtime, but @cached_property is designed to be settable def __set__(self, instance: object, value: _T) -> None: ... else: - try: - from functools import cached_property as cached_property - except ImportError: - from cached_property import cached_property as cached_property + from functools import cached_property as cached_property typed_cached_property = cached_property From 74d768f8f11ab292650d7b49c57b17184eb89fb2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 23:18:00 +0000 Subject: [PATCH 501/993] feat(api): api update (#358) --- .stats.yml | 2 +- .../resources/devboxes/devboxes.py | 14 +------------- .../types/devbox_create_params.py | 9 +-------- tests/api_resources/test_devboxes.py | 2 -- 4 files changed, 3 insertions(+), 24 deletions(-) diff --git a/.stats.yml b/.stats.yml index d5e332922..b0b5ea152 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bb75051b5b1bd5fe1a0e7912e0f221a29b8bb78980fc0398efe5b98e0136d867.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2e3c7bc03..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Mapping, Iterable, cast +from typing import Dict, Mapping, Iterable, cast import httpx @@ -126,7 +126,6 @@ def create( metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, prebuilt: str | NotGiven = NOT_GIVEN, - setup_commands: List[str] | NotGiven = NOT_GIVEN, snapshot_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -165,10 +164,6 @@ def create( prebuilt: Reference to prebuilt Blueprint. - setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include - fetching a tool or building your dependencies. Runloop will look optimize these - steps for you. - snapshot_id: Snapshot ID to use for the Devbox. extra_headers: Send extra headers @@ -193,7 +188,6 @@ def create( "metadata": metadata, "name": name, "prebuilt": prebuilt, - "setup_commands": setup_commands, "snapshot_id": snapshot_id, }, devbox_create_params.DevboxCreateParams, @@ -896,7 +890,6 @@ async def create( metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, prebuilt: str | NotGiven = NOT_GIVEN, - setup_commands: List[str] | NotGiven = NOT_GIVEN, snapshot_id: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -935,10 +928,6 @@ async def create( prebuilt: Reference to prebuilt Blueprint. - setup_commands: (Optional) List of commands needed to set up your Devbox. Examples might include - fetching a tool or building your dependencies. Runloop will look optimize these - steps for you. - snapshot_id: Snapshot ID to use for the Devbox. extra_headers: Send extra headers @@ -963,7 +952,6 @@ async def create( "metadata": metadata, "name": name, "prebuilt": prebuilt, - "setup_commands": setup_commands, "snapshot_id": snapshot_id, }, devbox_create_params.DevboxCreateParams, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 092476a18..68ffc9bba 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Iterable +from typing import Dict, Iterable from typing_extensions import TypedDict from .code_mount_parameters_param import CodeMountParametersParam @@ -53,12 +53,5 @@ class DevboxCreateParams(TypedDict, total=False): prebuilt: str """Reference to prebuilt Blueprint.""" - setup_commands: List[str] - """(Optional) List of commands needed to set up your Devbox. - - Examples might include fetching a tool or building your dependencies. Runloop - will look optimize these steps for you. - """ - snapshot_id: str """Snapshot ID to use for the Devbox.""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 96482f9af..33b7bf481 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -68,7 +68,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: metadata={"foo": "string"}, name="name", prebuilt="prebuilt", - setup_commands=["string"], snapshot_id="snapshot_id", ) assert_matches_type(DevboxView, devbox, path=["response"]) @@ -810,7 +809,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - metadata={"foo": "string"}, name="name", prebuilt="prebuilt", - setup_commands=["string"], snapshot_id="snapshot_id", ) assert_matches_type(DevboxView, devbox, path=["response"]) From d490ca153e4572b5286df50e8354bf5a919a3081 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 07:20:26 +0000 Subject: [PATCH 502/993] chore(internal): exclude mypy from running on tests (#359) --- mypy.ini | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mypy.ini b/mypy.ini index 0ecdd0f55..f2a97a0a9 100644 --- a/mypy.ini +++ b/mypy.ini @@ -5,7 +5,10 @@ show_error_codes = True # Exclude _files.py because mypy isn't smart enough to apply # the correct type narrowing and as this is an internal module # it's fine to just use Pyright. -exclude = ^(src/runloop_api_client/_files\.py|_dev/.*\.py)$ +# +# We also exclude our `tests` as mypy doesn't always infer +# types correctly and Pyright will still catch any type errors. +exclude = ^(src/runloop_api_client/_files\.py|_dev/.*\.py|tests/.*)$ strict_equality = True implicit_reexport = True From 6f615820b39a821025d2e900a3e64638b59f2b19 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 19:11:43 +0000 Subject: [PATCH 503/993] fix(client): compat with new httpx 0.28.0 release (#360) --- src/runloop_api_client/_base_client.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index 3c132d01c..7d7679e78 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -792,6 +792,7 @@ def __init__( custom_query: Mapping[str, object] | None = None, _strict_response_validation: bool, ) -> None: + kwargs: dict[str, Any] = {} if limits is not None: warnings.warn( "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead", @@ -804,6 +805,7 @@ def __init__( limits = DEFAULT_CONNECTION_LIMITS if transport is not None: + kwargs["transport"] = transport warnings.warn( "The `transport` argument is deprecated. The `http_client` argument should be passed instead", category=DeprecationWarning, @@ -813,6 +815,7 @@ def __init__( raise ValueError("The `http_client` argument is mutually exclusive with `transport`") if proxies is not None: + kwargs["proxies"] = proxies warnings.warn( "The `proxies` argument is deprecated. The `http_client` argument should be passed instead", category=DeprecationWarning, @@ -856,10 +859,9 @@ def __init__( base_url=base_url, # cast to a valid type because mypy doesn't understand our type narrowing timeout=cast(Timeout, timeout), - proxies=proxies, - transport=transport, limits=limits, follow_redirects=True, + **kwargs, # type: ignore ) def is_closed(self) -> bool: @@ -1358,6 +1360,7 @@ def __init__( custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, ) -> None: + kwargs: dict[str, Any] = {} if limits is not None: warnings.warn( "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead", @@ -1370,6 +1373,7 @@ def __init__( limits = DEFAULT_CONNECTION_LIMITS if transport is not None: + kwargs["transport"] = transport warnings.warn( "The `transport` argument is deprecated. The `http_client` argument should be passed instead", category=DeprecationWarning, @@ -1379,6 +1383,7 @@ def __init__( raise ValueError("The `http_client` argument is mutually exclusive with `transport`") if proxies is not None: + kwargs["proxies"] = proxies warnings.warn( "The `proxies` argument is deprecated. The `http_client` argument should be passed instead", category=DeprecationWarning, @@ -1422,10 +1427,9 @@ def __init__( base_url=base_url, # cast to a valid type because mypy doesn't understand our type narrowing timeout=cast(Timeout, timeout), - proxies=proxies, - transport=transport, limits=limits, follow_redirects=True, + **kwargs, # type: ignore ) def is_closed(self) -> bool: From 830af3bb91bf58e710fb4ca1daffaa63bed23756 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 29 Nov 2024 12:53:08 +0000 Subject: [PATCH 504/993] chore(internal): version bump (#361) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 091cfb127..f7014c353 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.10.0" + ".": "0.11.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index b5f777d41..e41228c09 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.10.0" +version = "0.11.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 1713908ea..e4792147b 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.10.0" # x-release-please-version +__version__ = "0.11.0" # x-release-please-version From 402adf46f9def3673423db07666f8e63850a7060 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 00:24:31 +0000 Subject: [PATCH 505/993] feat(api): api update (#362) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b0b5ea152..9973627ef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 35b79d4112a76d8844784d98fc831075718aa888 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 00:26:16 +0000 Subject: [PATCH 506/993] feat(api): api update (#364) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 9973627ef..b0b5ea152 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From eaae4572df4b4f9cf784c1abf4ae9aa81cc789f7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 01:24:25 +0000 Subject: [PATCH 507/993] feat(api): api update (#365) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b0b5ea152..9973627ef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 1502a2aea900e1dd9462a43098b26544381abb81 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 01:51:05 +0000 Subject: [PATCH 508/993] feat(api): api update (#366) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 9973627ef..b0b5ea152 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 78e001c5fe19479ab8791d3da29ec67d8a2cc0a3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 02:24:29 +0000 Subject: [PATCH 509/993] feat(api): api update (#367) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b0b5ea152..9973627ef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 9421d54dbc72dcffde8970f76ef7e554f209c3cf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 07:33:24 +0000 Subject: [PATCH 510/993] chore(internal): codegen related update (#368) --- requirements-dev.lock | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index ba48805c2..ad436e85d 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -68,7 +68,7 @@ pydantic-core==2.23.4 # via pydantic pygments==2.18.0 # via rich -pyright==1.1.380 +pyright==1.1.389 pytest==8.3.3 # via pytest-asyncio pytest-asyncio==0.24.0 @@ -96,6 +96,7 @@ typing-extensions==4.12.2 # via mypy # via pydantic # via pydantic-core + # via pyright # via runloop-api-client virtualenv==20.24.5 # via nox From 8e7b092fc6787f78c726c0d662bbcc98f2083ae1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:38:13 +0000 Subject: [PATCH 511/993] feat(api): api update (#369) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 9973627ef..b0b5ea152 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 0a59169cc14c96398a71b3a6cbd8fb55fe08f55c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 17:24:58 +0000 Subject: [PATCH 512/993] feat(api): api update (#370) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b0b5ea152..9973627ef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 9b4da637f9388cbad72967cec1e3fdb365f8abee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 01:06:41 +0000 Subject: [PATCH 513/993] feat(api): api update (#371) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 9973627ef..b0b5ea152 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 5c4fe823249e8f17ab0de0a6943dec347c8c3ce8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 01:24:53 +0000 Subject: [PATCH 514/993] feat(api): api update (#372) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b0b5ea152..9973627ef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 07eccb07d8d3b03cef8124b5a3e90ab0d0b5c034 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 07:27:13 +0000 Subject: [PATCH 515/993] chore: make the `Omit` type public (#373) --- src/runloop_api_client/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/runloop_api_client/__init__.py b/src/runloop_api_client/__init__.py index 4e060bb42..42d79a14c 100644 --- a/src/runloop_api_client/__init__.py +++ b/src/runloop_api_client/__init__.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from . import types -from ._types import NOT_GIVEN, NoneType, NotGiven, Transport, ProxiesTypes +from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes from ._utils import file_from_path from ._client import Client, Stream, Runloop, Timeout, Transport, AsyncClient, AsyncStream, AsyncRunloop, RequestOptions from ._models import BaseModel @@ -36,6 +36,7 @@ "ProxiesTypes", "NotGiven", "NOT_GIVEN", + "Omit", "RunloopError", "APIError", "APIStatusError", From 1ac52efbd5d75b87bf375680ed58eba66a96269e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 20:04:13 +0000 Subject: [PATCH 516/993] feat(api): api update (#374) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 9973627ef..b0b5ea152 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 87c5f4914a647782c83d506f9ca8375d13574bda Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 20:24:57 +0000 Subject: [PATCH 517/993] feat(api): api update (#375) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b0b5ea152..9973627ef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 1f49bee03161cfef3eac435bcab68d7a52ec38df Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 20:48:07 +0000 Subject: [PATCH 518/993] feat(api): api update (#376) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 9973627ef..b0b5ea152 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 7dcb953100df5ba6d9fd00562f1a5da7810192f7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 21:24:43 +0000 Subject: [PATCH 519/993] feat(api): api update (#377) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b0b5ea152..9973627ef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From e97c7fe5db828d99850f555f047d8b98e97ade05 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 21:45:38 +0000 Subject: [PATCH 520/993] feat(api): api update (#378) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 9973627ef..b0b5ea152 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 9389b3b6fdf848e692d0fd50c0b5520bc8570819 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 22:24:33 +0000 Subject: [PATCH 521/993] feat(api): api update (#379) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b0b5ea152..9973627ef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From a0b5cc9d27553a736d013489e914f51c5ca3d6ee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 22:40:33 +0000 Subject: [PATCH 522/993] feat(api): api update (#380) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 9973627ef..b0b5ea152 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 2152a0eb0873908fa1440070aaf0219418c08f4e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 23:25:06 +0000 Subject: [PATCH 523/993] feat(api): api update (#381) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b0b5ea152..9973627ef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From df07bc259feebac54cc69ddcdd585dc81548467b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 23:33:24 +0000 Subject: [PATCH 524/993] feat(api): api update (#382) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 9973627ef..b0b5ea152 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From e1fbc033ae8ede1aa8785168ab60bc87cd8d6b3b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 00:24:32 +0000 Subject: [PATCH 525/993] feat(api): api update (#383) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b0b5ea152..9973627ef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 3ddd743b52055328d6a9ca94f27bb6ba2b784384 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 01:06:13 +0000 Subject: [PATCH 526/993] feat(api): api update (#384) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 9973627ef..b0b5ea152 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 443573e74deb486722c5666d0723f0bb28ed0151 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 01:24:54 +0000 Subject: [PATCH 527/993] feat(api): api update (#385) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b0b5ea152..9973627ef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 45d14620d6fcd1904d0785f8a97783597a750da3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 05:49:15 +0000 Subject: [PATCH 528/993] feat(api): api update (#386) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 9973627ef..b0b5ea152 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 57e04aeae0dfb0e3290a35e13084bfe41bb08bac Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 06:24:53 +0000 Subject: [PATCH 529/993] feat(api): api update (#387) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b0b5ea152..9973627ef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 544b8196787c916c32bbc122c85ee8d24a0c015c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 17:32:33 +0000 Subject: [PATCH 530/993] feat(api): api update (#388) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 9973627ef..b0b5ea152 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 22b3abd060ed36148cec032219390f48d4cfd6ad Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 18:24:38 +0000 Subject: [PATCH 531/993] feat(api): api update (#389) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b0b5ea152..9973627ef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 33d2da66a2e5036421c81f823696dfa18c0bb58d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 20:06:48 +0000 Subject: [PATCH 532/993] feat(api): api update (#390) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 9973627ef..b0b5ea152 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 7a08f135e85b0184c7575cedbe71d52708cb28cc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 20:24:40 +0000 Subject: [PATCH 533/993] feat(api): api update (#391) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b0b5ea152..9973627ef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b0385adb6f63afa04a7bfdc2c5822727d240a456be8ebd1edde4023b96d23147.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 0bd2fc5bc77510642863396d0e533abe31eaf43c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 20:35:28 +0000 Subject: [PATCH 534/993] feat(api): api update (#392) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/devbox_logs_list_view.py | 2 +- .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 71 files changed, 4366 insertions(+), 3 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 9973627ef..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py index bd1ba5218..9bddac9a4 100644 --- a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py +++ b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py @@ -12,7 +12,7 @@ class Log(BaseModel): level: str """Log line severity level.""" - source: Literal["setup_commands", "entrypoint", "exec"] + source: Literal["setup_commands", "entrypoint", "exec", "files"] """The source of the log.""" timestamp_ms: int diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 2489c42714d44790a571536fcac0fb19825684c6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 22:24:39 +0000 Subject: [PATCH 535/993] feat(api): api update (#393) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 16fc0833548a199d64563613078ff11969985bb6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Dec 2024 00:33:08 +0000 Subject: [PATCH 536/993] feat(api): api update (#394) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 870e0f1c73e37a2086bc04ae78b2496e888add80 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Dec 2024 01:24:45 +0000 Subject: [PATCH 537/993] feat(api): api update (#395) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/devbox_logs_list_view.py | 2 +- .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 71 files changed, 3 insertions(+), 4366 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..9973627ef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py index 9bddac9a4..bd1ba5218 100644 --- a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py +++ b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py @@ -12,7 +12,7 @@ class Log(BaseModel): level: str """Log line severity level.""" - source: Literal["setup_commands", "entrypoint", "exec", "files"] + source: Literal["setup_commands", "entrypoint", "exec"] """The source of the log.""" timestamp_ms: int diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 88b4c767973693d940020faa5684b1af0dad5152 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Dec 2024 18:51:24 +0000 Subject: [PATCH 538/993] feat(api): api update (#396) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/devbox_logs_list_view.py | 2 +- .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 71 files changed, 4366 insertions(+), 3 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 9973627ef..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py index bd1ba5218..9bddac9a4 100644 --- a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py +++ b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py @@ -12,7 +12,7 @@ class Log(BaseModel): level: str """Log line severity level.""" - source: Literal["setup_commands", "entrypoint", "exec"] + source: Literal["setup_commands", "entrypoint", "exec", "files"] """The source of the log.""" timestamp_ms: int diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From d2d215bda9a6f5cc562892fdc46e8a31bde382b2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Dec 2024 19:24:53 +0000 Subject: [PATCH 539/993] feat(api): api update (#397) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/devbox_logs_list_view.py | 2 +- .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 71 files changed, 3 insertions(+), 4366 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..9973627ef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py index 9bddac9a4..bd1ba5218 100644 --- a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py +++ b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py @@ -12,7 +12,7 @@ class Log(BaseModel): level: str """Log line severity level.""" - source: Literal["setup_commands", "entrypoint", "exec", "files"] + source: Literal["setup_commands", "entrypoint", "exec"] """The source of the log.""" timestamp_ms: int diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 74c44d2b88a63866dbbd298589f7c97afd04b7f0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Dec 2024 21:24:42 +0000 Subject: [PATCH 540/993] feat(api): api update (#398) --- .stats.yml | 2 +- src/runloop_api_client/types/devboxes/devbox_logs_list_view.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9973627ef..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4228450eeadb9701b86eb7cb86f835f26d1202733ca7c434eb79c32d8a89893a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py index bd1ba5218..9bddac9a4 100644 --- a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py +++ b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py @@ -12,7 +12,7 @@ class Log(BaseModel): level: str """Log line severity level.""" - source: Literal["setup_commands", "entrypoint", "exec"] + source: Literal["setup_commands", "entrypoint", "exec", "files"] """The source of the log.""" timestamp_ms: int From 4a1b2eba1bbcb9a6881a1f6fefa9b84cc76175bf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Dec 2024 22:38:14 +0000 Subject: [PATCH 541/993] feat(api): api update (#399) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From dd049dbb17bd72724d38e7290a5f3f39ccdb729c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Dec 2024 23:24:45 +0000 Subject: [PATCH 542/993] feat(api): api update (#400) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 2c72370cd6db1f541a534f2a8b80589692c2d980 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 7 Dec 2024 01:45:52 +0000 Subject: [PATCH 543/993] feat(api): api update (#401) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 7b22989cf712a94a19aaf4cca273f332cc95e74d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 7 Dec 2024 02:24:44 +0000 Subject: [PATCH 544/993] feat(api): api update (#402) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From e901b9dcc9f9415e643e54d1012daff69faac2aa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 7 Dec 2024 22:55:40 +0000 Subject: [PATCH 545/993] feat(api): api update (#403) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 5b61bbdaac0c50a7b5d2575b6491944a156c730d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 7 Dec 2024 23:24:57 +0000 Subject: [PATCH 546/993] feat(api): api update (#404) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From d9288d031344b01b350825db047ec6d1e2a01e98 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:05:14 +0000 Subject: [PATCH 547/993] feat(api): api update (#405) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From c24971b81ca75e8f0debecc39dd33bbfd284de30 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:24:42 +0000 Subject: [PATCH 548/993] feat(api): api update (#406) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 7b0fd3037aa859aec8095faad3432cb4878e0be3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:29:55 +0000 Subject: [PATCH 549/993] feat(api): api update (#407) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 12fd2df6de312bd7bb7274c424cd3f6e594d66a8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 18:24:45 +0000 Subject: [PATCH 550/993] feat(api): api update (#408) --- .stats.yml | 4 +- README.md | 7 +- api.md | 82 - requirements-dev.lock | 4 +- requirements.lock | 4 +- src/runloop_api_client/_types.py | 6 +- .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 74 files changed, 12 insertions(+), 4376 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/README.md b/README.md index 642feeb74..0b8a33e85 100644 --- a/README.md +++ b/README.md @@ -262,18 +262,19 @@ can also get all the extra fields on the Pydantic model as a dict with You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including: -- Support for proxies -- Custom transports +- Support for [proxies](https://www.python-httpx.org/advanced/proxies/) +- Custom [transports](https://www.python-httpx.org/advanced/transports/) - Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality ```python +import httpx from runloop_api_client import Runloop, DefaultHttpxClient client = Runloop( # Or use the `RUNLOOP_BASE_URL` env var base_url="http://my.test.server.example.com:8083", http_client=DefaultHttpxClient( - proxies="http://my.test.proxy.example.com", + proxy="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0"), ), ) diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/requirements-dev.lock b/requirements-dev.lock index ad436e85d..e4c141cf6 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -62,9 +62,9 @@ platformdirs==3.11.0 # via virtualenv pluggy==1.5.0 # via pytest -pydantic==2.9.2 +pydantic==2.10.3 # via runloop-api-client -pydantic-core==2.23.4 +pydantic-core==2.27.1 # via pydantic pygments==2.18.0 # via rich diff --git a/requirements.lock b/requirements.lock index d04f8e874..56423d17c 100644 --- a/requirements.lock +++ b/requirements.lock @@ -30,9 +30,9 @@ httpx==0.25.2 idna==3.4 # via anyio # via httpx -pydantic==2.9.2 +pydantic==2.10.3 # via runloop-api-client -pydantic-core==2.23.4 +pydantic-core==2.27.1 # via pydantic sniffio==1.3.0 # via anyio diff --git a/src/runloop_api_client/_types.py b/src/runloop_api_client/_types.py index 1b43b06d2..114eefd47 100644 --- a/src/runloop_api_client/_types.py +++ b/src/runloop_api_client/_types.py @@ -192,10 +192,8 @@ def get(self, __key: str) -> str | None: ... StrBytesIntFloat = Union[str, bytes, int, float] # Note: copied from Pydantic -# https://github.com/pydantic/pydantic/blob/32ea570bf96e84234d2992e1ddf40ab8a565925a/pydantic/main.py#L49 -IncEx: TypeAlias = Union[ - Set[int], Set[str], Mapping[int, Union["IncEx", Literal[True]]], Mapping[str, Union["IncEx", Literal[True]]] -] +# https://github.com/pydantic/pydantic/blob/6f31f8f68ef011f84357330186f603ff295312fd/pydantic/main.py#L79 +IncEx: TypeAlias = Union[Set[int], Set[str], Mapping[int, Union["IncEx", bool]], Mapping[str, Union["IncEx", bool]]] PostParser = Callable[[Any], Any] diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 0310a6e22ef8c8e8ad31edcc96c4929e9beb87a9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 19:46:07 +0000 Subject: [PATCH 551/993] feat(api): api update (#409) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From f94331470737da9954e4c73f305e2a57d12c38b3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 20:24:45 +0000 Subject: [PATCH 552/993] feat(api): api update (#410) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From ffaebbcb40c520db03e261342d85c97300bee581 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 18:09:18 +0000 Subject: [PATCH 553/993] feat(api): api update (#411) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 650907c841902dedcf4d7bee1fc024aaa36e4f3e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 18:24:24 +0000 Subject: [PATCH 554/993] feat(api): api update (#412) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 58683f534522ce5dcd485125bc76e9b4302a4cf8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 19:03:00 +0000 Subject: [PATCH 555/993] feat(api): api update (#413) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 57a8f3f1de6a0601ff09b46d3d1af41626cd1e31 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 19:24:21 +0000 Subject: [PATCH 556/993] feat(api): api update (#414) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 05ee377d2b21522b8e2f602099399782327eeff3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 19:33:39 +0000 Subject: [PATCH 557/993] feat(api): api update (#415) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From e23f79a8b1e4dd4b7337339aad95244b31f7d613 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 20:24:46 +0000 Subject: [PATCH 558/993] feat(api): api update (#416) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From bf9d74306d0097c395293d56f46f522f4c8100b7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 20:29:03 +0000 Subject: [PATCH 559/993] feat(api): api update (#417) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From a278f00094d663db42c90a9a6f0a97f9af523916 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 21:24:22 +0000 Subject: [PATCH 560/993] feat(api): api update (#418) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 3644e3dca7ecd0292c2e304af856d67ccaefb146 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 18:20:59 +0000 Subject: [PATCH 561/993] feat(api): api update (#419) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 9a6da7c2e80861dd161c92f4c1a48e1cc6bca244 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 18:24:36 +0000 Subject: [PATCH 562/993] feat(api): api update (#420) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 4db64f3d00900dc946d5ce7fd51465a1dd635589 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 19:20:08 +0000 Subject: [PATCH 563/993] feat(api): api update (#421) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From d7df1f66b72a044479008d308634cb25ecbb5c0b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 19:24:17 +0000 Subject: [PATCH 564/993] feat(api): api update (#422) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From a36df9cce0d30df64144fb95fa07d11bc8a7b31d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 20:45:44 +0000 Subject: [PATCH 565/993] feat(api): api update (#423) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 1570d426b175e797df18818f4ff76f3d46afe831 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 21:24:15 +0000 Subject: [PATCH 566/993] feat(api): api update (#424) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From ee65dd43b0a27ab84e46eddfb98224ed2a5e9875 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 23:45:41 +0000 Subject: [PATCH 567/993] feat(api): api update (#425) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From ebaa71d25f36c4657a0a8ede84f9b999b9966a13 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 00:24:16 +0000 Subject: [PATCH 568/993] feat(api): api update (#426) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From e189d8e81ab465bb51b37b93ba28e9506fb54a9c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 00:38:08 +0000 Subject: [PATCH 569/993] feat(api): api update (#427) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 5cd148d08bc0d655da5c99b0aa3c28aea59bb02f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 01:24:16 +0000 Subject: [PATCH 570/993] feat(api): api update (#428) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 217533549d19bb8195cea1f4589ac1d3b5545614 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 07:25:51 +0000 Subject: [PATCH 571/993] chore(internal): bump pyright (#429) --- requirements-dev.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index e4c141cf6..913a9ba6f 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -68,7 +68,7 @@ pydantic-core==2.27.1 # via pydantic pygments==2.18.0 # via rich -pyright==1.1.389 +pyright==1.1.390 pytest==8.3.3 # via pytest-asyncio pytest-asyncio==0.24.0 From fa7c2d853f9350e8f94e8a945d1fa3168857f421 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 07:26:42 +0000 Subject: [PATCH 572/993] chore(internal): add support for TypeAliasType (#430) --- pyproject.toml | 2 +- src/runloop_api_client/_models.py | 3 +++ src/runloop_api_client/_response.py | 20 +++++++-------- src/runloop_api_client/_utils/__init__.py | 1 + src/runloop_api_client/_utils/_typing.py | 31 ++++++++++++++++++++++- tests/test_models.py | 18 ++++++++++++- tests/utils.py | 4 +++ 7 files changed, 66 insertions(+), 13 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e41228c09..df10a4876 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ authors = [ dependencies = [ "httpx>=0.23.0, <1", "pydantic>=1.9.0, <3", - "typing-extensions>=4.7, <5", + "typing-extensions>=4.10, <5", "anyio>=3.5.0, <5", "distro>=1.7.0, <2", "sniffio", diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index 6cb469e21..7a547ce5c 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -46,6 +46,7 @@ strip_not_given, extract_type_arg, is_annotated_type, + is_type_alias_type, strip_annotated_type, ) from ._compat import ( @@ -428,6 +429,8 @@ def construct_type(*, value: object, type_: object) -> object: # we allow `object` as the input type because otherwise, passing things like # `Literal['value']` will be reported as a type error by type checkers type_ = cast("type[object]", type_) + if is_type_alias_type(type_): + type_ = type_.__value__ # type: ignore[unreachable] # unwrap `Annotated[T, ...]` -> `T` if is_annotated_type(type_): diff --git a/src/runloop_api_client/_response.py b/src/runloop_api_client/_response.py index e68be043a..1d55ca296 100644 --- a/src/runloop_api_client/_response.py +++ b/src/runloop_api_client/_response.py @@ -25,7 +25,7 @@ import pydantic from ._types import NoneType -from ._utils import is_given, extract_type_arg, is_annotated_type, extract_type_var_from_base +from ._utils import is_given, extract_type_arg, is_annotated_type, is_type_alias_type, extract_type_var_from_base from ._models import BaseModel, is_basemodel from ._constants import RAW_RESPONSE_HEADER, OVERRIDE_CAST_TO_HEADER from ._streaming import Stream, AsyncStream, is_stream_class_type, extract_stream_chunk_type @@ -126,9 +126,15 @@ def __repr__(self) -> str: ) def _parse(self, *, to: type[_T] | None = None) -> R | _T: + cast_to = to if to is not None else self._cast_to + + # unwrap `TypeAlias('Name', T)` -> `T` + if is_type_alias_type(cast_to): + cast_to = cast_to.__value__ # type: ignore[unreachable] + # unwrap `Annotated[T, ...]` -> `T` - if to and is_annotated_type(to): - to = extract_type_arg(to, 0) + if cast_to and is_annotated_type(cast_to): + cast_to = extract_type_arg(cast_to, 0) if self._is_sse_stream: if to: @@ -164,18 +170,12 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: return cast( R, stream_cls( - cast_to=self._cast_to, + cast_to=cast_to, response=self.http_response, client=cast(Any, self._client), ), ) - cast_to = to if to is not None else self._cast_to - - # unwrap `Annotated[T, ...]` -> `T` - if is_annotated_type(cast_to): - cast_to = extract_type_arg(cast_to, 0) - if cast_to is NoneType: return cast(R, None) diff --git a/src/runloop_api_client/_utils/__init__.py b/src/runloop_api_client/_utils/__init__.py index a7cff3c09..d4fda26f3 100644 --- a/src/runloop_api_client/_utils/__init__.py +++ b/src/runloop_api_client/_utils/__init__.py @@ -39,6 +39,7 @@ is_iterable_type as is_iterable_type, is_required_type as is_required_type, is_annotated_type as is_annotated_type, + is_type_alias_type as is_type_alias_type, strip_annotated_type as strip_annotated_type, extract_type_var_from_base as extract_type_var_from_base, ) diff --git a/src/runloop_api_client/_utils/_typing.py b/src/runloop_api_client/_utils/_typing.py index c036991f0..278749b14 100644 --- a/src/runloop_api_client/_utils/_typing.py +++ b/src/runloop_api_client/_utils/_typing.py @@ -1,8 +1,17 @@ from __future__ import annotations +import sys +import typing +import typing_extensions from typing import Any, TypeVar, Iterable, cast from collections import abc as _c_abc -from typing_extensions import Required, Annotated, get_args, get_origin +from typing_extensions import ( + TypeIs, + Required, + Annotated, + get_args, + get_origin, +) from .._types import InheritsGeneric from .._compat import is_union as _is_union @@ -36,6 +45,26 @@ def is_typevar(typ: type) -> bool: return type(typ) == TypeVar # type: ignore +_TYPE_ALIAS_TYPES: tuple[type[typing_extensions.TypeAliasType], ...] = (typing_extensions.TypeAliasType,) +if sys.version_info >= (3, 12): + _TYPE_ALIAS_TYPES = (*_TYPE_ALIAS_TYPES, typing.TypeAliasType) + + +def is_type_alias_type(tp: Any, /) -> TypeIs[typing_extensions.TypeAliasType]: + """Return whether the provided argument is an instance of `TypeAliasType`. + + ```python + type Int = int + is_type_alias_type(Int) + # > True + Str = TypeAliasType("Str", str) + is_type_alias_type(Str) + # > True + ``` + """ + return isinstance(tp, _TYPE_ALIAS_TYPES) + + # Extracts T from Annotated[T, ...] or from Required[Annotated[T, ...]] def strip_annotated_type(typ: type) -> type: if is_required_type(typ) or is_annotated_type(typ): diff --git a/tests/test_models.py b/tests/test_models.py index efdbd6605..2dac47483 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -1,7 +1,7 @@ import json from typing import Any, Dict, List, Union, Optional, cast from datetime import datetime, timezone -from typing_extensions import Literal, Annotated +from typing_extensions import Literal, Annotated, TypeAliasType import pytest import pydantic @@ -828,3 +828,19 @@ class B(BaseModel): # if the discriminator details object stays the same between invocations then # we hit the cache assert UnionType.__discriminator__ is discriminator + + +@pytest.mark.skipif(not PYDANTIC_V2, reason="TypeAliasType is not supported in Pydantic v1") +def test_type_alias_type() -> None: + Alias = TypeAliasType("Alias", str) + + class Model(BaseModel): + alias: Alias + union: Union[int, Alias] + + m = construct_type(value={"alias": "foo", "union": "bar"}, type_=Model) + assert isinstance(m, Model) + assert isinstance(m.alias, str) + assert m.alias == "foo" + assert isinstance(m.union, str) + assert m.union == "bar" diff --git a/tests/utils.py b/tests/utils.py index 3e87b5baa..9ae192db0 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -16,6 +16,7 @@ is_union_type, extract_type_arg, is_annotated_type, + is_type_alias_type, ) from runloop_api_client._compat import PYDANTIC_V2, field_outer_type, get_model_fields from runloop_api_client._models import BaseModel @@ -51,6 +52,9 @@ def assert_matches_type( path: list[str], allow_none: bool = False, ) -> None: + if is_type_alias_type(type_): + type_ = type_.__value__ + # unwrap `Annotated[T, ...]` -> `T` if is_annotated_type(type_): type_ = extract_type_arg(type_, 0) From 8126a9572d4210ec9ba2d9764d5ef5cc28d2ad8d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 15:54:05 +0000 Subject: [PATCH 573/993] feat(api): api update (#431) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From c04ca87cd3fafa8cb43eeff1d4bc337d9ac4b127 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 16:24:16 +0000 Subject: [PATCH 574/993] feat(api): api update (#432) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 0930decbd6acd70b86dda1a6ebd74e6c69544e29 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 18:55:30 +0000 Subject: [PATCH 575/993] feat(api): api update (#433) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From eb9f620b1aa33c7b6486ef7719e2711d844ebf48 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 19:24:13 +0000 Subject: [PATCH 576/993] feat(api): api update (#434) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 81010d331854f40a9d37545a4e9cb43f51b4cc7e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 21:55:44 +0000 Subject: [PATCH 577/993] feat(api): api update (#435) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From c06b70778202484735c023fe19a105af1ff64d10 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 22:24:15 +0000 Subject: [PATCH 578/993] feat(api): api update (#436) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 412c161bb200faad3532cb03564267b3a3439d57 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 01:13:27 +0000 Subject: [PATCH 579/993] feat(api): api update (#437) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From f1aca700243ad1e74f0be7ce84de28d64b4fe08c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 01:24:15 +0000 Subject: [PATCH 580/993] feat(api): api update (#438) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 26869b0f8eac559bb76b06fbb329b3dc970a2795 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 07:09:36 +0000 Subject: [PATCH 581/993] chore(internal): codegen related update (#439) --- src/runloop_api_client/_client.py | 82 ++++++++++++++----------------- 1 file changed, 38 insertions(+), 44 deletions(-) diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index 1609aebcc..fcafda610 100644 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -8,7 +8,7 @@ import httpx -from . import resources, _exceptions +from . import _exceptions from ._qs import Querystring from ._types import ( NOT_GIVEN, @@ -24,6 +24,7 @@ get_async_library, ) from ._version import __version__ +from .resources import blueprints from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import RunloopError, APIStatusError from ._base_client import ( @@ -31,25 +32,18 @@ SyncAPIClient, AsyncAPIClient, ) +from .resources.devboxes import devboxes +from .resources.projects import projects +from .resources.functions import functions -__all__ = [ - "Timeout", - "Transport", - "ProxiesTypes", - "RequestOptions", - "resources", - "Runloop", - "AsyncRunloop", - "Client", - "AsyncClient", -] +__all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Runloop", "AsyncRunloop", "Client", "AsyncClient"] class Runloop(SyncAPIClient): - blueprints: resources.BlueprintsResource - devboxes: resources.DevboxesResource - functions: resources.FunctionsResource - projects: resources.ProjectsResource + blueprints: blueprints.BlueprintsResource + devboxes: devboxes.DevboxesResource + functions: functions.FunctionsResource + projects: projects.ProjectsResource with_raw_response: RunloopWithRawResponse with_streaming_response: RunloopWithStreamedResponse @@ -107,10 +101,10 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.blueprints = resources.BlueprintsResource(self) - self.devboxes = resources.DevboxesResource(self) - self.functions = resources.FunctionsResource(self) - self.projects = resources.ProjectsResource(self) + self.blueprints = blueprints.BlueprintsResource(self) + self.devboxes = devboxes.DevboxesResource(self) + self.functions = functions.FunctionsResource(self) + self.projects = projects.ProjectsResource(self) self.with_raw_response = RunloopWithRawResponse(self) self.with_streaming_response = RunloopWithStreamedResponse(self) @@ -220,10 +214,10 @@ def _make_status_error( class AsyncRunloop(AsyncAPIClient): - blueprints: resources.AsyncBlueprintsResource - devboxes: resources.AsyncDevboxesResource - functions: resources.AsyncFunctionsResource - projects: resources.AsyncProjectsResource + blueprints: blueprints.AsyncBlueprintsResource + devboxes: devboxes.AsyncDevboxesResource + functions: functions.AsyncFunctionsResource + projects: projects.AsyncProjectsResource with_raw_response: AsyncRunloopWithRawResponse with_streaming_response: AsyncRunloopWithStreamedResponse @@ -281,10 +275,10 @@ def __init__( _strict_response_validation=_strict_response_validation, ) - self.blueprints = resources.AsyncBlueprintsResource(self) - self.devboxes = resources.AsyncDevboxesResource(self) - self.functions = resources.AsyncFunctionsResource(self) - self.projects = resources.AsyncProjectsResource(self) + self.blueprints = blueprints.AsyncBlueprintsResource(self) + self.devboxes = devboxes.AsyncDevboxesResource(self) + self.functions = functions.AsyncFunctionsResource(self) + self.projects = projects.AsyncProjectsResource(self) self.with_raw_response = AsyncRunloopWithRawResponse(self) self.with_streaming_response = AsyncRunloopWithStreamedResponse(self) @@ -395,34 +389,34 @@ def _make_status_error( class RunloopWithRawResponse: def __init__(self, client: Runloop) -> None: - self.blueprints = resources.BlueprintsResourceWithRawResponse(client.blueprints) - self.devboxes = resources.DevboxesResourceWithRawResponse(client.devboxes) - self.functions = resources.FunctionsResourceWithRawResponse(client.functions) - self.projects = resources.ProjectsResourceWithRawResponse(client.projects) + self.blueprints = blueprints.BlueprintsResourceWithRawResponse(client.blueprints) + self.devboxes = devboxes.DevboxesResourceWithRawResponse(client.devboxes) + self.functions = functions.FunctionsResourceWithRawResponse(client.functions) + self.projects = projects.ProjectsResourceWithRawResponse(client.projects) class AsyncRunloopWithRawResponse: def __init__(self, client: AsyncRunloop) -> None: - self.blueprints = resources.AsyncBlueprintsResourceWithRawResponse(client.blueprints) - self.devboxes = resources.AsyncDevboxesResourceWithRawResponse(client.devboxes) - self.functions = resources.AsyncFunctionsResourceWithRawResponse(client.functions) - self.projects = resources.AsyncProjectsResourceWithRawResponse(client.projects) + self.blueprints = blueprints.AsyncBlueprintsResourceWithRawResponse(client.blueprints) + self.devboxes = devboxes.AsyncDevboxesResourceWithRawResponse(client.devboxes) + self.functions = functions.AsyncFunctionsResourceWithRawResponse(client.functions) + self.projects = projects.AsyncProjectsResourceWithRawResponse(client.projects) class RunloopWithStreamedResponse: def __init__(self, client: Runloop) -> None: - self.blueprints = resources.BlueprintsResourceWithStreamingResponse(client.blueprints) - self.devboxes = resources.DevboxesResourceWithStreamingResponse(client.devboxes) - self.functions = resources.FunctionsResourceWithStreamingResponse(client.functions) - self.projects = resources.ProjectsResourceWithStreamingResponse(client.projects) + self.blueprints = blueprints.BlueprintsResourceWithStreamingResponse(client.blueprints) + self.devboxes = devboxes.DevboxesResourceWithStreamingResponse(client.devboxes) + self.functions = functions.FunctionsResourceWithStreamingResponse(client.functions) + self.projects = projects.ProjectsResourceWithStreamingResponse(client.projects) class AsyncRunloopWithStreamedResponse: def __init__(self, client: AsyncRunloop) -> None: - self.blueprints = resources.AsyncBlueprintsResourceWithStreamingResponse(client.blueprints) - self.devboxes = resources.AsyncDevboxesResourceWithStreamingResponse(client.devboxes) - self.functions = resources.AsyncFunctionsResourceWithStreamingResponse(client.functions) - self.projects = resources.AsyncProjectsResourceWithStreamingResponse(client.projects) + self.blueprints = blueprints.AsyncBlueprintsResourceWithStreamingResponse(client.blueprints) + self.devboxes = devboxes.AsyncDevboxesResourceWithStreamingResponse(client.devboxes) + self.functions = functions.AsyncFunctionsResourceWithStreamingResponse(client.functions) + self.projects = projects.AsyncProjectsResourceWithStreamingResponse(client.projects) Client = Runloop From 7354f5da03f39218ef9e1d28dbf4e03ae1532d18 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 17:05:25 +0000 Subject: [PATCH 582/993] feat(api): api update (#440) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From daa40261eaa5019cc6a4256962c732e87cebac49 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 17:24:24 +0000 Subject: [PATCH 583/993] feat(api): api update (#441) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 9329d09160cb6c759654a5b755cb3a5f9b054dfe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 18:02:37 +0000 Subject: [PATCH 584/993] feat(api): api update (#442) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From e593f53690f1403fa1df850e6e1e50f0ec3895a5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 18:24:41 +0000 Subject: [PATCH 585/993] feat(api): api update (#443) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 7dc39f56f66469135e6a50f78c1a26b47f19639e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 21:05:12 +0000 Subject: [PATCH 586/993] feat(api): api update (#444) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From a4130aec00e615eba9f56e5b44e99092c6b35eff Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 21:24:42 +0000 Subject: [PATCH 587/993] feat(api): api update (#445) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From b5d542a45846b169133ccc35248989c97bb02ef4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 21:48:03 +0000 Subject: [PATCH 588/993] feat(api): api update (#446) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 23b30d6a7af9b83f6f54d44f717d8e5a9e28fafd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 23:24:43 +0000 Subject: [PATCH 589/993] feat(api): api update (#447) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 1b2edd8151b49b677586c77ac2622a04ea83eaad Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 00:08:58 +0000 Subject: [PATCH 590/993] feat(api): api update (#448) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 6f384d215bc90deeed7f2135d439efb1e91db489 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 00:37:48 +0000 Subject: [PATCH 591/993] feat(api): api update (#450) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From bca55a263059893639c8e52533b3a8b730d1aa8a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 04:15:57 +0000 Subject: [PATCH 592/993] feat(api): api update (#451) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 6d66c690cd3d6501dfabf8a71de44b26ca66861d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 04:24:42 +0000 Subject: [PATCH 593/993] feat(api): api update (#452) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 081ccd88c3c1bc41ef575e2616af54f53636a0a9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 07:21:30 +0000 Subject: [PATCH 594/993] chore(internal): codegen related update (#453) --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 0b8a33e85..53d2474b2 100644 --- a/README.md +++ b/README.md @@ -290,6 +290,16 @@ client.with_options(http_client=DefaultHttpxClient(...)) By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting. +```py +from runloop_api_client import Runloop + +with Runloop() as client: + # make requests here + ... + +# HTTP client is now closed +``` + ## Versioning This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions: From 639699b8f73052bdbd9edf66a5f4b4b8915ec704 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 07:22:16 +0000 Subject: [PATCH 595/993] chore(internal): codegen related update (#454) --- README.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/README.md b/README.md index 53d2474b2..0b8a33e85 100644 --- a/README.md +++ b/README.md @@ -290,16 +290,6 @@ client.with_options(http_client=DefaultHttpxClient(...)) By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting. -```py -from runloop_api_client import Runloop - -with Runloop() as client: - # make requests here - ... - -# HTTP client is now closed -``` - ## Versioning This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions: From 79582c7d430f994ed1b19e189537a5c3034031d6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 07:26:30 +0000 Subject: [PATCH 596/993] docs(readme): example snippet for client context manager (#455) --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 0b8a33e85..53d2474b2 100644 --- a/README.md +++ b/README.md @@ -290,6 +290,16 @@ client.with_options(http_client=DefaultHttpxClient(...)) By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting. +```py +from runloop_api_client import Runloop + +with Runloop() as client: + # make requests here + ... + +# HTTP client is now closed +``` + ## Versioning This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions: From f33c5d8b8102e08423dee0733a2103373e8ee51d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 16:25:47 +0000 Subject: [PATCH 597/993] feat(api): api update (#456) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From e6a6439ebe7bb11ca9751a9a5039225cccf80090 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 17:24:35 +0000 Subject: [PATCH 598/993] feat(api): api update (#457) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 18e44e96eb0501a6f6e8d762563e18a1e3eb2605 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 20:33:46 +0000 Subject: [PATCH 599/993] feat(api): api update (#458) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From e87082d87aa2d0ce0f2fb180e0399f69327ff3dd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 22:24:37 +0000 Subject: [PATCH 600/993] feat(api): api update (#459) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 3df7479f8e33e9d7571f62e9cf003404c4f6e562 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 07:13:47 +0000 Subject: [PATCH 601/993] chore(internal): fix some typos (#460) --- tests/test_client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index 022d2e8a8..fe175a8dd 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -364,11 +364,11 @@ def test_default_query_option(self) -> None: FinalRequestOptions( method="get", url="/foo", - params={"foo": "baz", "query_param": "overriden"}, + params={"foo": "baz", "query_param": "overridden"}, ) ) url = httpx.URL(request.url) - assert dict(url.params) == {"foo": "baz", "query_param": "overriden"} + assert dict(url.params) == {"foo": "baz", "query_param": "overridden"} def test_request_extra_json(self) -> None: request = self.client._build_request( @@ -1154,11 +1154,11 @@ def test_default_query_option(self) -> None: FinalRequestOptions( method="get", url="/foo", - params={"foo": "baz", "query_param": "overriden"}, + params={"foo": "baz", "query_param": "overridden"}, ) ) url = httpx.URL(request.url) - assert dict(url.params) == {"foo": "baz", "query_param": "overriden"} + assert dict(url.params) == {"foo": "baz", "query_param": "overridden"} def test_request_extra_json(self) -> None: request = self.client._build_request( From 882c2b99693d7f3e6309b6a0f27967df75e18a0c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 16:53:31 +0000 Subject: [PATCH 602/993] feat(api): api update (#461) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 93a4fd7959bf79a07aa9190437e6d3a4d3bcff93 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:24:34 +0000 Subject: [PATCH 603/993] feat(api): api update (#462) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 59530a497e83c2695e1ec02dc016096e7de8e76c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 18:29:47 +0000 Subject: [PATCH 604/993] feat(api): api update (#463) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 83361f4863574f79b07d00d24100670e71eeead7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 19:24:38 +0000 Subject: [PATCH 605/993] feat(api): api update (#464) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From b096d2bccc3c22484a574cf6c3d01d802122e3c2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 21:19:58 +0000 Subject: [PATCH 606/993] feat(api): api update (#465) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From 509db15192eaf7298b4fbc5966e3264c5b18d360 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 21:24:34 +0000 Subject: [PATCH 607/993] feat(api): api update (#466) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 8d08ce5df931866895ceee0fed313375cf174219 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 21:53:22 +0000 Subject: [PATCH 608/993] feat(api): api update (#467) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From cb633a897aee7a37b516b2de1273aa15e743c1d7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 22:24:14 +0000 Subject: [PATCH 609/993] feat(api): api update (#468) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From eec7139acaf9065589aa7f4d0c04b1ee96a7a66d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 17:20:00 +0000 Subject: [PATCH 610/993] feat(api): api update (#469) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From b5de8324c0fd6d2892cc5407788830679928670c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 17:24:47 +0000 Subject: [PATCH 611/993] feat(api): api update (#470) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From a04f9309c03ad3ce47399b44997c1509bb214729 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 18:34:07 +0000 Subject: [PATCH 612/993] feat(api): api update (#471) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From d315963719320c300091088b65683de7c5d07721 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 19:24:48 +0000 Subject: [PATCH 613/993] feat(api): api update (#472) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From 4ff0c87d2bb373bd1f4d6f0948f2c357914abf15 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Dec 2024 00:21:37 +0000 Subject: [PATCH 614/993] feat(api): api update (#473) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From a8c3997b4ac59c25f4f15e77a9819e27a6d946d3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Dec 2024 00:24:45 +0000 Subject: [PATCH 615/993] feat(api): api update (#474) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From bde1b87492818f567f4613620ca79d079707afb1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Dec 2024 04:53:37 +0000 Subject: [PATCH 616/993] feat(api): api update (#475) --- .stats.yml | 4 +- api.md | 82 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ 70 files changed, 4365 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..b458fc3c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml diff --git a/api.md b/api.md index 160665026..b051193ac 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) From c9d99ea98da9562ada4eaf0353c813cec3f89c25 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Dec 2024 05:24:32 +0000 Subject: [PATCH 617/993] feat(api): api update (#476) --- .stats.yml | 4 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- 70 files changed, 2 insertions(+), 4365 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index b458fc3c3..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a71d0205c834c186effd4995a795320d06d40b0078cd2ccfbbd1026730fb9a14.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index b051193ac..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) From ba2a1b32f7298e7a981498d1038d2df3aed4ca60 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 06:57:39 +0000 Subject: [PATCH 618/993] chore(internal): codegen related update (#477) --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 8c410d1e9..ca7f3a6d3 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2024 runloop +Copyright 2025 runloop Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: From 655ed49acccc87f4b9b3348b04bf292aaea69895 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Jan 2025 07:11:26 +0000 Subject: [PATCH 619/993] chore: add missing isclass check (#478) --- src/runloop_api_client/_models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index 7a547ce5c..d56ea1d9e 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -488,7 +488,11 @@ def construct_type(*, value: object, type_: object) -> object: _, items_type = get_args(type_) # Dict[_, items_type] return {key: construct_type(value=item, type_=items_type) for key, item in value.items()} - if not is_literal_type(type_) and (issubclass(origin, BaseModel) or issubclass(origin, GenericModel)): + if ( + not is_literal_type(type_) + and inspect.isclass(origin) + and (issubclass(origin, BaseModel) or issubclass(origin, GenericModel)) + ): if is_list(value): return [cast(Any, type_).construct(**entry) if is_mapping(entry) else entry for entry in value] From 64005584f5c11f669903066b2048d14de0614412 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Jan 2025 17:47:38 +0000 Subject: [PATCH 620/993] chore: updates (#479) --- .stats.yml | 4 +- api.md | 104 ++ src/runloop_api_client/_client.py | 10 +- src/runloop_api_client/resources/__init__.py | 14 + .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 32 + .../resources/devboxes/lsp.py | 1461 +++++++++++++++ .../resources/repositories.py | 528 ++++++ src/runloop_api_client/types/__init__.py | 6 + .../types/devboxes/__init__.py | 67 + .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 53 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../types/devboxes/l_sp_any_param.py | 9 + .../types/devboxes/location_param.py | 33 + .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + src/runloop_api_client/types/devboxes/u_ri.py | 7 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + .../types/repository_connection_list_view.py | 17 + .../types/repository_connection_view.py | 25 + .../types/repository_create_params.py | 15 + .../types/repository_list_params.py | 15 + .../types/repository_version_details.py | 44 + .../types/repository_version_list_view.py | 13 + tests/api_resources/devboxes/test_lsp.py | 1607 +++++++++++++++++ tests/api_resources/test_repositories.py | 388 ++++ 81 files changed, 5461 insertions(+), 3 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py create mode 100644 src/runloop_api_client/resources/repositories.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py create mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/u_ri.py create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py create mode 100644 src/runloop_api_client/types/repository_connection_list_view.py create mode 100644 src/runloop_api_client/types/repository_connection_view.py create mode 100644 src/runloop_api_client/types/repository_create_params.py create mode 100644 src/runloop_api_client/types/repository_list_params.py create mode 100644 src/runloop_api_client/types/repository_version_details.py create mode 100644 src/runloop_api_client/types/repository_version_list_view.py create mode 100644 tests/api_resources/devboxes/test_lsp.py create mode 100644 tests/api_resources/test_repositories.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..a4863f252 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 52 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8ae2b8efa48447d8566071937b2c38b2efe6440d13340229a8a3f80d71b97ecc.yml diff --git a/api.md b/api.md index 160665026..9c73c5563 100644 --- a/api.md +++ b/api.md @@ -80,6 +80,88 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +## Lsp + +Types: + +```python +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) +``` + +Methods: + +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str + ## Logs Types: @@ -101,6 +183,28 @@ Methods: - client.devboxes.executions.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.executions.kill(execution_id, \*, id) -> DevboxAsyncExecutionDetailView +# Repositories + +Types: + +```python +from runloop_api_client.types import ( + RepositoryConnectionListView, + RepositoryConnectionView, + RepositoryVersionDetails, + RepositoryVersionListView, + RepositoryDeleteResponse, +) +``` + +Methods: + +- client.repositories.create(\*\*params) -> RepositoryConnectionView +- client.repositories.retrieve(id) -> RepositoryConnectionView +- client.repositories.list(\*\*params) -> RepositoryConnectionListView +- client.repositories.delete(id) -> object +- client.repositories.versions(id) -> RepositoryVersionListView + # Functions Types: diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index fcafda610..2f0f58ab1 100644 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -24,7 +24,7 @@ get_async_library, ) from ._version import __version__ -from .resources import blueprints +from .resources import blueprints, repositories from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import RunloopError, APIStatusError from ._base_client import ( @@ -42,6 +42,7 @@ class Runloop(SyncAPIClient): blueprints: blueprints.BlueprintsResource devboxes: devboxes.DevboxesResource + repositories: repositories.RepositoriesResource functions: functions.FunctionsResource projects: projects.ProjectsResource with_raw_response: RunloopWithRawResponse @@ -103,6 +104,7 @@ def __init__( self.blueprints = blueprints.BlueprintsResource(self) self.devboxes = devboxes.DevboxesResource(self) + self.repositories = repositories.RepositoriesResource(self) self.functions = functions.FunctionsResource(self) self.projects = projects.ProjectsResource(self) self.with_raw_response = RunloopWithRawResponse(self) @@ -216,6 +218,7 @@ def _make_status_error( class AsyncRunloop(AsyncAPIClient): blueprints: blueprints.AsyncBlueprintsResource devboxes: devboxes.AsyncDevboxesResource + repositories: repositories.AsyncRepositoriesResource functions: functions.AsyncFunctionsResource projects: projects.AsyncProjectsResource with_raw_response: AsyncRunloopWithRawResponse @@ -277,6 +280,7 @@ def __init__( self.blueprints = blueprints.AsyncBlueprintsResource(self) self.devboxes = devboxes.AsyncDevboxesResource(self) + self.repositories = repositories.AsyncRepositoriesResource(self) self.functions = functions.AsyncFunctionsResource(self) self.projects = projects.AsyncProjectsResource(self) self.with_raw_response = AsyncRunloopWithRawResponse(self) @@ -391,6 +395,7 @@ class RunloopWithRawResponse: def __init__(self, client: Runloop) -> None: self.blueprints = blueprints.BlueprintsResourceWithRawResponse(client.blueprints) self.devboxes = devboxes.DevboxesResourceWithRawResponse(client.devboxes) + self.repositories = repositories.RepositoriesResourceWithRawResponse(client.repositories) self.functions = functions.FunctionsResourceWithRawResponse(client.functions) self.projects = projects.ProjectsResourceWithRawResponse(client.projects) @@ -399,6 +404,7 @@ class AsyncRunloopWithRawResponse: def __init__(self, client: AsyncRunloop) -> None: self.blueprints = blueprints.AsyncBlueprintsResourceWithRawResponse(client.blueprints) self.devboxes = devboxes.AsyncDevboxesResourceWithRawResponse(client.devboxes) + self.repositories = repositories.AsyncRepositoriesResourceWithRawResponse(client.repositories) self.functions = functions.AsyncFunctionsResourceWithRawResponse(client.functions) self.projects = projects.AsyncProjectsResourceWithRawResponse(client.projects) @@ -407,6 +413,7 @@ class RunloopWithStreamedResponse: def __init__(self, client: Runloop) -> None: self.blueprints = blueprints.BlueprintsResourceWithStreamingResponse(client.blueprints) self.devboxes = devboxes.DevboxesResourceWithStreamingResponse(client.devboxes) + self.repositories = repositories.RepositoriesResourceWithStreamingResponse(client.repositories) self.functions = functions.FunctionsResourceWithStreamingResponse(client.functions) self.projects = projects.ProjectsResourceWithStreamingResponse(client.projects) @@ -415,6 +422,7 @@ class AsyncRunloopWithStreamedResponse: def __init__(self, client: AsyncRunloop) -> None: self.blueprints = blueprints.AsyncBlueprintsResourceWithStreamingResponse(client.blueprints) self.devboxes = devboxes.AsyncDevboxesResourceWithStreamingResponse(client.devboxes) + self.repositories = repositories.AsyncRepositoriesResourceWithStreamingResponse(client.repositories) self.functions = functions.AsyncFunctionsResourceWithStreamingResponse(client.functions) self.projects = projects.AsyncProjectsResourceWithStreamingResponse(client.projects) diff --git a/src/runloop_api_client/resources/__init__.py b/src/runloop_api_client/resources/__init__.py index f36499829..97e83cd8e 100644 --- a/src/runloop_api_client/resources/__init__.py +++ b/src/runloop_api_client/resources/__init__.py @@ -32,6 +32,14 @@ BlueprintsResourceWithStreamingResponse, AsyncBlueprintsResourceWithStreamingResponse, ) +from .repositories import ( + RepositoriesResource, + AsyncRepositoriesResource, + RepositoriesResourceWithRawResponse, + AsyncRepositoriesResourceWithRawResponse, + RepositoriesResourceWithStreamingResponse, + AsyncRepositoriesResourceWithStreamingResponse, +) __all__ = [ "BlueprintsResource", @@ -46,6 +54,12 @@ "AsyncDevboxesResourceWithRawResponse", "DevboxesResourceWithStreamingResponse", "AsyncDevboxesResourceWithStreamingResponse", + "RepositoriesResource", + "AsyncRepositoriesResource", + "RepositoriesResourceWithRawResponse", + "AsyncRepositoriesResourceWithRawResponse", + "RepositoriesResourceWithStreamingResponse", + "AsyncRepositoriesResourceWithStreamingResponse", "FunctionsResource", "AsyncFunctionsResource", "FunctionsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..4edef1ace 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,6 +6,14 @@ import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -74,6 +82,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -834,6 +846,10 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1650,6 +1666,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1716,6 +1736,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1782,6 +1806,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1848,6 +1876,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..7d0c9fe4d --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1461 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/resources/repositories.py b/src/runloop_api_client/resources/repositories.py new file mode 100644 index 000000000..7c54adecb --- /dev/null +++ b/src/runloop_api_client/resources/repositories.py @@ -0,0 +1,528 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..types import repository_list_params, repository_create_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + maybe_transform, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.repository_connection_view import RepositoryConnectionView +from ..types.repository_version_list_view import RepositoryVersionListView +from ..types.repository_connection_list_view import RepositoryConnectionListView + +__all__ = ["RepositoriesResource", "AsyncRepositoriesResource"] + + +class RepositoriesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> RepositoriesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return RepositoriesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> RepositoriesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return RepositoriesResourceWithStreamingResponse(self) + + def create( + self, + *, + name: str, + owner: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RepositoryConnectionView: + """ + Create a connection a Repository with the specified configuration. + + Args: + name: Name of the repository. + + owner: Account owner of the repository. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._post( + "/v1/repositories", + body=maybe_transform( + { + "name": name, + "owner": owner, + }, + repository_create_params.RepositoryCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RepositoryConnectionView, + ) + + def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RepositoryConnectionView: + """ + Get repository connection details. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/repositories/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RepositoryConnectionView, + ) + + def list( + self, + *, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RepositoryConnectionListView: + """ + List all available repository connections. + + Args: + limit: Page Limit + + starting_after: Load the next page starting after the given token. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/v1/repositories", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + repository_list_params.RepositoryListParams, + ), + ), + cast_to=RepositoryConnectionListView, + ) + + def delete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Delete a repository connection. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/repositories/{id}/delete", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + def versions( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RepositoryVersionListView: + """ + List all analyzed versions of a repository connection. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/repositories/{id}/versions", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RepositoryVersionListView, + ) + + +class AsyncRepositoriesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncRepositoriesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncRepositoriesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRepositoriesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncRepositoriesResourceWithStreamingResponse(self) + + async def create( + self, + *, + name: str, + owner: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RepositoryConnectionView: + """ + Create a connection a Repository with the specified configuration. + + Args: + name: Name of the repository. + + owner: Account owner of the repository. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._post( + "/v1/repositories", + body=await async_maybe_transform( + { + "name": name, + "owner": owner, + }, + repository_create_params.RepositoryCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RepositoryConnectionView, + ) + + async def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RepositoryConnectionView: + """ + Get repository connection details. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/repositories/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RepositoryConnectionView, + ) + + async def list( + self, + *, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RepositoryConnectionListView: + """ + List all available repository connections. + + Args: + limit: Page Limit + + starting_after: Load the next page starting after the given token. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/v1/repositories", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + repository_list_params.RepositoryListParams, + ), + ), + cast_to=RepositoryConnectionListView, + ) + + async def delete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> object: + """ + Delete a repository connection. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/repositories/{id}/delete", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=object, + ) + + async def versions( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RepositoryVersionListView: + """ + List all analyzed versions of a repository connection. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/repositories/{id}/versions", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RepositoryVersionListView, + ) + + +class RepositoriesResourceWithRawResponse: + def __init__(self, repositories: RepositoriesResource) -> None: + self._repositories = repositories + + self.create = to_raw_response_wrapper( + repositories.create, + ) + self.retrieve = to_raw_response_wrapper( + repositories.retrieve, + ) + self.list = to_raw_response_wrapper( + repositories.list, + ) + self.delete = to_raw_response_wrapper( + repositories.delete, + ) + self.versions = to_raw_response_wrapper( + repositories.versions, + ) + + +class AsyncRepositoriesResourceWithRawResponse: + def __init__(self, repositories: AsyncRepositoriesResource) -> None: + self._repositories = repositories + + self.create = async_to_raw_response_wrapper( + repositories.create, + ) + self.retrieve = async_to_raw_response_wrapper( + repositories.retrieve, + ) + self.list = async_to_raw_response_wrapper( + repositories.list, + ) + self.delete = async_to_raw_response_wrapper( + repositories.delete, + ) + self.versions = async_to_raw_response_wrapper( + repositories.versions, + ) + + +class RepositoriesResourceWithStreamingResponse: + def __init__(self, repositories: RepositoriesResource) -> None: + self._repositories = repositories + + self.create = to_streamed_response_wrapper( + repositories.create, + ) + self.retrieve = to_streamed_response_wrapper( + repositories.retrieve, + ) + self.list = to_streamed_response_wrapper( + repositories.list, + ) + self.delete = to_streamed_response_wrapper( + repositories.delete, + ) + self.versions = to_streamed_response_wrapper( + repositories.versions, + ) + + +class AsyncRepositoriesResourceWithStreamingResponse: + def __init__(self, repositories: AsyncRepositoriesResource) -> None: + self._repositories = repositories + + self.create = async_to_streamed_response_wrapper( + repositories.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + repositories.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + repositories.list, + ) + self.delete = async_to_streamed_response_wrapper( + repositories.delete, + ) + self.versions = async_to_streamed_response_wrapper( + repositories.versions, + ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 1f6ecb59b..77d09aa94 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -22,13 +22,17 @@ from .blueprint_list_params import BlueprintListParams as BlueprintListParams from .code_mount_parameters import CodeMountParameters as CodeMountParameters from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView +from .repository_list_params import RepositoryListParams as RepositoryListParams from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams from .devbox_write_file_params import DevboxWriteFileParams as DevboxWriteFileParams +from .repository_create_params import RepositoryCreateParams as RepositoryCreateParams from .devbox_snapshot_list_view import DevboxSnapshotListView as DevboxSnapshotListView from .devbox_upload_file_params import DevboxUploadFileParams as DevboxUploadFileParams from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams +from .repository_connection_view import RepositoryConnectionView as RepositoryConnectionView +from .repository_version_details import RepositoryVersionDetails as RepositoryVersionDetails from .code_mount_parameters_param import CodeMountParametersParam as CodeMountParametersParam from .devbox_create_tunnel_params import DevboxCreateTunnelParams as DevboxCreateTunnelParams from .devbox_download_file_params import DevboxDownloadFileParams as DevboxDownloadFileParams @@ -38,8 +42,10 @@ from .devbox_disk_snapshots_params import DevboxDiskSnapshotsParams as DevboxDiskSnapshotsParams from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams +from .repository_version_list_view import RepositoryVersionListView as RepositoryVersionListView from .blueprint_build_logs_list_view import BlueprintBuildLogsListView as BlueprintBuildLogsListView from .devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse as DevboxCreateSSHKeyResponse +from .repository_connection_list_view import RepositoryConnectionListView as RepositoryConnectionListView from .devbox_read_file_contents_params import DevboxReadFileContentsParams as DevboxReadFileContentsParams from .devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView as DevboxAsyncExecutionDetailView from .devbox_read_file_contents_response import DevboxReadFileContentsResponse as DevboxReadFileContentsResponse diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,75 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..43b4e0a72 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .document_symbol import DocumentSymbol +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: DocumentSymbol + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py new file mode 100644 index 000000000..1fe0adec1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py new file mode 100644 index 000000000..132a3bd29 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/src/runloop_api_client/types/repository_connection_list_view.py b/src/runloop_api_client/types/repository_connection_list_view.py new file mode 100644 index 000000000..4ad5a10ec --- /dev/null +++ b/src/runloop_api_client/types/repository_connection_list_view.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .repository_connection_view import RepositoryConnectionView + +__all__ = ["RepositoryConnectionListView"] + + +class RepositoryConnectionListView(BaseModel): + has_more: bool + + repositories: List[RepositoryConnectionView] + """List of repositories matching filter.""" + + total_count: int diff --git a/src/runloop_api_client/types/repository_connection_view.py b/src/runloop_api_client/types/repository_connection_view.py new file mode 100644 index 000000000..fdc3fff3f --- /dev/null +++ b/src/runloop_api_client/types/repository_connection_view.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["RepositoryConnectionView"] + + +class RepositoryConnectionView(BaseModel): + id: str + """The id of the Repository.""" + + name: str + """The name of the Repository.""" + + owner: str + """The account owner of the Repository.""" + + status: Literal["pending", "failure", "active"] + """The current status of the Repository.""" + + failure_reason: Optional[str] = None + """Reason for failure, if any.""" diff --git a/src/runloop_api_client/types/repository_create_params.py b/src/runloop_api_client/types/repository_create_params.py new file mode 100644 index 000000000..06864a447 --- /dev/null +++ b/src/runloop_api_client/types/repository_create_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["RepositoryCreateParams"] + + +class RepositoryCreateParams(TypedDict, total=False): + name: Required[str] + """Name of the repository.""" + + owner: Required[str] + """Account owner of the repository.""" diff --git a/src/runloop_api_client/types/repository_list_params.py b/src/runloop_api_client/types/repository_list_params.py new file mode 100644 index 000000000..88c7993ba --- /dev/null +++ b/src/runloop_api_client/types/repository_list_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["RepositoryListParams"] + + +class RepositoryListParams(TypedDict, total=False): + limit: int + """Page Limit""" + + starting_after: str + """Load the next page starting after the given token.""" diff --git a/src/runloop_api_client/types/repository_version_details.py b/src/runloop_api_client/types/repository_version_details.py new file mode 100644 index 000000000..8d6d2b0d8 --- /dev/null +++ b/src/runloop_api_client/types/repository_version_details.py @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["RepositoryVersionDetails", "ExtractedTools", "RepositorySetupDetails"] + + +class ExtractedTools(BaseModel): + commands: Dict[str, str] + """The set of available commands on this repository such as building etc.""" + + package_manager: str + """What package manager this repository uses.""" + + +class RepositorySetupDetails(BaseModel): + blueprint_id: str + """The blueprint built that supports setting up this repository.""" + + env_initialization_command: str + """Command to initialize the env we need to run the commands for this repository.""" + + workspace_setup: List[str] + """Setup commands necessary to support repository i.e. apt install XXX.""" + + +class RepositoryVersionDetails(BaseModel): + analyzed_at: int + """Analyzed time of the Repository Version (Unix timestamp milliseconds).""" + + commit_sha: str + """The sha of the analyzed version of the Repository.""" + + extracted_tools: ExtractedTools + """Tools discovered during inspection.""" + + repository_setup_details: RepositorySetupDetails + """Commands required to set up repository environment.""" + + status: Literal["inspecting", "inspection_failed", "success"] + """The account owner of the Repository.""" diff --git a/src/runloop_api_client/types/repository_version_list_view.py b/src/runloop_api_client/types/repository_version_list_view.py new file mode 100644 index 000000000..6e4872663 --- /dev/null +++ b/src/runloop_api_client/types/repository_version_list_view.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .repository_version_details import RepositoryVersionDetails + +__all__ = ["RepositoryVersionListView"] + + +class RepositoryVersionListView(BaseModel): + analyzed_versions: List[RepositoryVersionDetails] + """List of analyzed versions of this repository.""" diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) diff --git a/tests/api_resources/test_repositories.py b/tests/api_resources/test_repositories.py new file mode 100644 index 000000000..5aec67a48 --- /dev/null +++ b/tests/api_resources/test_repositories.py @@ -0,0 +1,388 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types import ( + RepositoryConnectionView, + RepositoryVersionListView, + RepositoryConnectionListView, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestRepositories: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Runloop) -> None: + repository = client.repositories.create( + name="name", + owner="owner", + ) + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Runloop) -> None: + response = client.repositories.with_raw_response.create( + name="name", + owner="owner", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = response.parse() + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Runloop) -> None: + with client.repositories.with_streaming_response.create( + name="name", + owner="owner", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = response.parse() + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + repository = client.repositories.retrieve( + "id", + ) + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.repositories.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = response.parse() + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.repositories.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = response.parse() + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.repositories.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + repository = client.repositories.list() + assert_matches_type(RepositoryConnectionListView, repository, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + repository = client.repositories.list( + limit=0, + starting_after="starting_after", + ) + assert_matches_type(RepositoryConnectionListView, repository, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.repositories.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = response.parse() + assert_matches_type(RepositoryConnectionListView, repository, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.repositories.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = response.parse() + assert_matches_type(RepositoryConnectionListView, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_delete(self, client: Runloop) -> None: + repository = client.repositories.delete( + "id", + ) + assert_matches_type(object, repository, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Runloop) -> None: + response = client.repositories.with_raw_response.delete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = response.parse() + assert_matches_type(object, repository, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Runloop) -> None: + with client.repositories.with_streaming_response.delete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = response.parse() + assert_matches_type(object, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.repositories.with_raw_response.delete( + "", + ) + + @parametrize + def test_method_versions(self, client: Runloop) -> None: + repository = client.repositories.versions( + "id", + ) + assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + + @parametrize + def test_raw_response_versions(self, client: Runloop) -> None: + response = client.repositories.with_raw_response.versions( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = response.parse() + assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + + @parametrize + def test_streaming_response_versions(self, client: Runloop) -> None: + with client.repositories.with_streaming_response.versions( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = response.parse() + assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_versions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.repositories.with_raw_response.versions( + "", + ) + + +class TestAsyncRepositories: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncRunloop) -> None: + repository = await async_client.repositories.create( + name="name", + owner="owner", + ) + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: + response = await async_client.repositories.with_raw_response.create( + name="name", + owner="owner", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = await response.parse() + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: + async with async_client.repositories.with_streaming_response.create( + name="name", + owner="owner", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = await response.parse() + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + repository = await async_client.repositories.retrieve( + "id", + ) + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.repositories.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = await response.parse() + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.repositories.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = await response.parse() + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.repositories.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + repository = await async_client.repositories.list() + assert_matches_type(RepositoryConnectionListView, repository, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + repository = await async_client.repositories.list( + limit=0, + starting_after="starting_after", + ) + assert_matches_type(RepositoryConnectionListView, repository, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.repositories.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = await response.parse() + assert_matches_type(RepositoryConnectionListView, repository, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.repositories.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = await response.parse() + assert_matches_type(RepositoryConnectionListView, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete(self, async_client: AsyncRunloop) -> None: + repository = await async_client.repositories.delete( + "id", + ) + assert_matches_type(object, repository, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncRunloop) -> None: + response = await async_client.repositories.with_raw_response.delete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = await response.parse() + assert_matches_type(object, repository, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncRunloop) -> None: + async with async_client.repositories.with_streaming_response.delete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = await response.parse() + assert_matches_type(object, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.repositories.with_raw_response.delete( + "", + ) + + @parametrize + async def test_method_versions(self, async_client: AsyncRunloop) -> None: + repository = await async_client.repositories.versions( + "id", + ) + assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + + @parametrize + async def test_raw_response_versions(self, async_client: AsyncRunloop) -> None: + response = await async_client.repositories.with_raw_response.versions( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = await response.parse() + assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + + @parametrize + async def test_streaming_response_versions(self, async_client: AsyncRunloop) -> None: + async with async_client.repositories.with_streaming_response.versions( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = await response.parse() + assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_versions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.repositories.with_raw_response.versions( + "", + ) From 7e8a43ea3b05db0b9f0830d8a22022808d9f86cb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Jan 2025 17:53:50 +0000 Subject: [PATCH 621/993] chore(internal): version bump (#480) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f7014c353..a71305534 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.11.0" + ".": "0.12.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index df10a4876..80f56ba38 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.11.0" +version = "0.12.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index e4792147b..6520139ba 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.11.0" # x-release-please-version +__version__ = "0.12.0" # x-release-please-version From 59b9a8f6cae64a014665f96182b5418a644ea23d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Jan 2025 18:23:49 +0000 Subject: [PATCH 622/993] feat(api): api update (#481) --- .stats.yml | 4 +- api.md | 104 -- src/runloop_api_client/_client.py | 10 +- src/runloop_api_client/resources/__init__.py | 14 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 32 - .../resources/devboxes/lsp.py | 1461 --------------- .../resources/repositories.py | 528 ------ src/runloop_api_client/types/__init__.py | 6 - .../types/devboxes/__init__.py | 67 - .../types/devboxes/base_code_action.py | 21 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 13 - .../types/devboxes/base_markup_content.py | 12 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 24 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 34 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_description_param.py | 14 - .../devboxes/code_segment_info_response.py | 53 - .../types/devboxes/diagnostic_param.py | 65 - .../diagnostic_related_information_param.py | 17 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 17 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 33 - .../devboxes/lsp_apply_code_action_params.py | 21 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 27 - .../types/devboxes/position_param.py | 29 - .../types/devboxes/range.py | 15 - .../types/devboxes/range_param.py | 17 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 20 - .../types/devboxes/text_edit_param.py | 21 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 16 - .../types/repository_connection_list_view.py | 17 - .../types/repository_connection_view.py | 25 - .../types/repository_create_params.py | 15 - .../types/repository_list_params.py | 15 - .../types/repository_version_details.py | 44 - .../types/repository_version_list_view.py | 13 - tests/api_resources/devboxes/test_lsp.py | 1607 ----------------- tests/api_resources/test_repositories.py | 388 ---- 81 files changed, 3 insertions(+), 5461 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/resources/repositories.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 src/runloop_api_client/types/repository_connection_list_view.py delete mode 100644 src/runloop_api_client/types/repository_connection_view.py delete mode 100644 src/runloop_api_client/types/repository_create_params.py delete mode 100644 src/runloop_api_client/types/repository_list_params.py delete mode 100644 src/runloop_api_client/types/repository_version_details.py delete mode 100644 src/runloop_api_client/types/repository_version_list_view.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py delete mode 100644 tests/api_resources/test_repositories.py diff --git a/.stats.yml b/.stats.yml index a4863f252..b8bd20ffa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 52 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8ae2b8efa48447d8566071937b2c38b2efe6440d13340229a8a3f80d71b97ecc.yml +configured_endpoints: 33 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml diff --git a/api.md b/api.md index 9c73c5563..160665026 100644 --- a/api.md +++ b/api.md @@ -80,88 +80,6 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: @@ -183,28 +101,6 @@ Methods: - client.devboxes.executions.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.executions.kill(execution_id, \*, id) -> DevboxAsyncExecutionDetailView -# Repositories - -Types: - -```python -from runloop_api_client.types import ( - RepositoryConnectionListView, - RepositoryConnectionView, - RepositoryVersionDetails, - RepositoryVersionListView, - RepositoryDeleteResponse, -) -``` - -Methods: - -- client.repositories.create(\*\*params) -> RepositoryConnectionView -- client.repositories.retrieve(id) -> RepositoryConnectionView -- client.repositories.list(\*\*params) -> RepositoryConnectionListView -- client.repositories.delete(id) -> object -- client.repositories.versions(id) -> RepositoryVersionListView - # Functions Types: diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index 2f0f58ab1..fcafda610 100644 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -24,7 +24,7 @@ get_async_library, ) from ._version import __version__ -from .resources import blueprints, repositories +from .resources import blueprints from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import RunloopError, APIStatusError from ._base_client import ( @@ -42,7 +42,6 @@ class Runloop(SyncAPIClient): blueprints: blueprints.BlueprintsResource devboxes: devboxes.DevboxesResource - repositories: repositories.RepositoriesResource functions: functions.FunctionsResource projects: projects.ProjectsResource with_raw_response: RunloopWithRawResponse @@ -104,7 +103,6 @@ def __init__( self.blueprints = blueprints.BlueprintsResource(self) self.devboxes = devboxes.DevboxesResource(self) - self.repositories = repositories.RepositoriesResource(self) self.functions = functions.FunctionsResource(self) self.projects = projects.ProjectsResource(self) self.with_raw_response = RunloopWithRawResponse(self) @@ -218,7 +216,6 @@ def _make_status_error( class AsyncRunloop(AsyncAPIClient): blueprints: blueprints.AsyncBlueprintsResource devboxes: devboxes.AsyncDevboxesResource - repositories: repositories.AsyncRepositoriesResource functions: functions.AsyncFunctionsResource projects: projects.AsyncProjectsResource with_raw_response: AsyncRunloopWithRawResponse @@ -280,7 +277,6 @@ def __init__( self.blueprints = blueprints.AsyncBlueprintsResource(self) self.devboxes = devboxes.AsyncDevboxesResource(self) - self.repositories = repositories.AsyncRepositoriesResource(self) self.functions = functions.AsyncFunctionsResource(self) self.projects = projects.AsyncProjectsResource(self) self.with_raw_response = AsyncRunloopWithRawResponse(self) @@ -395,7 +391,6 @@ class RunloopWithRawResponse: def __init__(self, client: Runloop) -> None: self.blueprints = blueprints.BlueprintsResourceWithRawResponse(client.blueprints) self.devboxes = devboxes.DevboxesResourceWithRawResponse(client.devboxes) - self.repositories = repositories.RepositoriesResourceWithRawResponse(client.repositories) self.functions = functions.FunctionsResourceWithRawResponse(client.functions) self.projects = projects.ProjectsResourceWithRawResponse(client.projects) @@ -404,7 +399,6 @@ class AsyncRunloopWithRawResponse: def __init__(self, client: AsyncRunloop) -> None: self.blueprints = blueprints.AsyncBlueprintsResourceWithRawResponse(client.blueprints) self.devboxes = devboxes.AsyncDevboxesResourceWithRawResponse(client.devboxes) - self.repositories = repositories.AsyncRepositoriesResourceWithRawResponse(client.repositories) self.functions = functions.AsyncFunctionsResourceWithRawResponse(client.functions) self.projects = projects.AsyncProjectsResourceWithRawResponse(client.projects) @@ -413,7 +407,6 @@ class RunloopWithStreamedResponse: def __init__(self, client: Runloop) -> None: self.blueprints = blueprints.BlueprintsResourceWithStreamingResponse(client.blueprints) self.devboxes = devboxes.DevboxesResourceWithStreamingResponse(client.devboxes) - self.repositories = repositories.RepositoriesResourceWithStreamingResponse(client.repositories) self.functions = functions.FunctionsResourceWithStreamingResponse(client.functions) self.projects = projects.ProjectsResourceWithStreamingResponse(client.projects) @@ -422,7 +415,6 @@ class AsyncRunloopWithStreamedResponse: def __init__(self, client: AsyncRunloop) -> None: self.blueprints = blueprints.AsyncBlueprintsResourceWithStreamingResponse(client.blueprints) self.devboxes = devboxes.AsyncDevboxesResourceWithStreamingResponse(client.devboxes) - self.repositories = repositories.AsyncRepositoriesResourceWithStreamingResponse(client.repositories) self.functions = functions.AsyncFunctionsResourceWithStreamingResponse(client.functions) self.projects = projects.AsyncProjectsResourceWithStreamingResponse(client.projects) diff --git a/src/runloop_api_client/resources/__init__.py b/src/runloop_api_client/resources/__init__.py index 97e83cd8e..f36499829 100644 --- a/src/runloop_api_client/resources/__init__.py +++ b/src/runloop_api_client/resources/__init__.py @@ -32,14 +32,6 @@ BlueprintsResourceWithStreamingResponse, AsyncBlueprintsResourceWithStreamingResponse, ) -from .repositories import ( - RepositoriesResource, - AsyncRepositoriesResource, - RepositoriesResourceWithRawResponse, - AsyncRepositoriesResourceWithRawResponse, - RepositoriesResourceWithStreamingResponse, - AsyncRepositoriesResourceWithStreamingResponse, -) __all__ = [ "BlueprintsResource", @@ -54,12 +46,6 @@ "AsyncDevboxesResourceWithRawResponse", "DevboxesResourceWithStreamingResponse", "AsyncDevboxesResourceWithStreamingResponse", - "RepositoriesResource", - "AsyncRepositoriesResource", - "RepositoriesResourceWithRawResponse", - "AsyncRepositoriesResourceWithRawResponse", - "RepositoriesResourceWithStreamingResponse", - "AsyncRepositoriesResourceWithStreamingResponse", "FunctionsResource", "AsyncFunctionsResource", "FunctionsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..ec7c746ac 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -34,12 +26,6 @@ ) __all__ = [ - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4edef1ace..68ace3c32 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -6,14 +6,6 @@ import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -82,10 +74,6 @@ class DevboxesResource(SyncAPIResource): - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -846,10 +834,6 @@ def write_file( class AsyncDevboxesResource(AsyncAPIResource): - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1666,10 +1650,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1736,10 +1716,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1806,10 +1782,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1876,10 +1848,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file, ) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index 7d0c9fe4d..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1461 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/resources/repositories.py b/src/runloop_api_client/resources/repositories.py deleted file mode 100644 index 7c54adecb..000000000 --- a/src/runloop_api_client/resources/repositories.py +++ /dev/null @@ -1,528 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..types import repository_list_params, repository_create_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) -from .._compat import cached_property -from .._resource import SyncAPIResource, AsyncAPIResource -from .._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .._base_client import make_request_options -from ..types.repository_connection_view import RepositoryConnectionView -from ..types.repository_version_list_view import RepositoryVersionListView -from ..types.repository_connection_list_view import RepositoryConnectionListView - -__all__ = ["RepositoriesResource", "AsyncRepositoriesResource"] - - -class RepositoriesResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> RepositoriesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return RepositoriesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> RepositoriesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return RepositoriesResourceWithStreamingResponse(self) - - def create( - self, - *, - name: str, - owner: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RepositoryConnectionView: - """ - Create a connection a Repository with the specified configuration. - - Args: - name: Name of the repository. - - owner: Account owner of the repository. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._post( - "/v1/repositories", - body=maybe_transform( - { - "name": name, - "owner": owner, - }, - repository_create_params.RepositoryCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RepositoryConnectionView, - ) - - def retrieve( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RepositoryConnectionView: - """ - Get repository connection details. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/repositories/{id}", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RepositoryConnectionView, - ) - - def list( - self, - *, - limit: int | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RepositoryConnectionListView: - """ - List all available repository connections. - - Args: - limit: Page Limit - - starting_after: Load the next page starting after the given token. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get( - "/v1/repositories", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "limit": limit, - "starting_after": starting_after, - }, - repository_list_params.RepositoryListParams, - ), - ), - cast_to=RepositoryConnectionListView, - ) - - def delete( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Delete a repository connection. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/repositories/{id}/delete", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - def versions( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RepositoryVersionListView: - """ - List all analyzed versions of a repository connection. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/repositories/{id}/versions", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RepositoryVersionListView, - ) - - -class AsyncRepositoriesResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncRepositoriesResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncRepositoriesResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncRepositoriesResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncRepositoriesResourceWithStreamingResponse(self) - - async def create( - self, - *, - name: str, - owner: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RepositoryConnectionView: - """ - Create a connection a Repository with the specified configuration. - - Args: - name: Name of the repository. - - owner: Account owner of the repository. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return await self._post( - "/v1/repositories", - body=await async_maybe_transform( - { - "name": name, - "owner": owner, - }, - repository_create_params.RepositoryCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RepositoryConnectionView, - ) - - async def retrieve( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RepositoryConnectionView: - """ - Get repository connection details. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/repositories/{id}", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RepositoryConnectionView, - ) - - async def list( - self, - *, - limit: int | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RepositoryConnectionListView: - """ - List all available repository connections. - - Args: - limit: Page Limit - - starting_after: Load the next page starting after the given token. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return await self._get( - "/v1/repositories", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "limit": limit, - "starting_after": starting_after, - }, - repository_list_params.RepositoryListParams, - ), - ), - cast_to=RepositoryConnectionListView, - ) - - async def delete( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """ - Delete a repository connection. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/repositories/{id}/delete", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - async def versions( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RepositoryVersionListView: - """ - List all analyzed versions of a repository connection. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/repositories/{id}/versions", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=RepositoryVersionListView, - ) - - -class RepositoriesResourceWithRawResponse: - def __init__(self, repositories: RepositoriesResource) -> None: - self._repositories = repositories - - self.create = to_raw_response_wrapper( - repositories.create, - ) - self.retrieve = to_raw_response_wrapper( - repositories.retrieve, - ) - self.list = to_raw_response_wrapper( - repositories.list, - ) - self.delete = to_raw_response_wrapper( - repositories.delete, - ) - self.versions = to_raw_response_wrapper( - repositories.versions, - ) - - -class AsyncRepositoriesResourceWithRawResponse: - def __init__(self, repositories: AsyncRepositoriesResource) -> None: - self._repositories = repositories - - self.create = async_to_raw_response_wrapper( - repositories.create, - ) - self.retrieve = async_to_raw_response_wrapper( - repositories.retrieve, - ) - self.list = async_to_raw_response_wrapper( - repositories.list, - ) - self.delete = async_to_raw_response_wrapper( - repositories.delete, - ) - self.versions = async_to_raw_response_wrapper( - repositories.versions, - ) - - -class RepositoriesResourceWithStreamingResponse: - def __init__(self, repositories: RepositoriesResource) -> None: - self._repositories = repositories - - self.create = to_streamed_response_wrapper( - repositories.create, - ) - self.retrieve = to_streamed_response_wrapper( - repositories.retrieve, - ) - self.list = to_streamed_response_wrapper( - repositories.list, - ) - self.delete = to_streamed_response_wrapper( - repositories.delete, - ) - self.versions = to_streamed_response_wrapper( - repositories.versions, - ) - - -class AsyncRepositoriesResourceWithStreamingResponse: - def __init__(self, repositories: AsyncRepositoriesResource) -> None: - self._repositories = repositories - - self.create = async_to_streamed_response_wrapper( - repositories.create, - ) - self.retrieve = async_to_streamed_response_wrapper( - repositories.retrieve, - ) - self.list = async_to_streamed_response_wrapper( - repositories.list, - ) - self.delete = async_to_streamed_response_wrapper( - repositories.delete, - ) - self.versions = async_to_streamed_response_wrapper( - repositories.versions, - ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 77d09aa94..1f6ecb59b 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -22,17 +22,13 @@ from .blueprint_list_params import BlueprintListParams as BlueprintListParams from .code_mount_parameters import CodeMountParameters as CodeMountParameters from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView -from .repository_list_params import RepositoryListParams as RepositoryListParams from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams from .devbox_write_file_params import DevboxWriteFileParams as DevboxWriteFileParams -from .repository_create_params import RepositoryCreateParams as RepositoryCreateParams from .devbox_snapshot_list_view import DevboxSnapshotListView as DevboxSnapshotListView from .devbox_upload_file_params import DevboxUploadFileParams as DevboxUploadFileParams from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams -from .repository_connection_view import RepositoryConnectionView as RepositoryConnectionView -from .repository_version_details import RepositoryVersionDetails as RepositoryVersionDetails from .code_mount_parameters_param import CodeMountParametersParam as CodeMountParametersParam from .devbox_create_tunnel_params import DevboxCreateTunnelParams as DevboxCreateTunnelParams from .devbox_download_file_params import DevboxDownloadFileParams as DevboxDownloadFileParams @@ -42,10 +38,8 @@ from .devbox_disk_snapshots_params import DevboxDiskSnapshotsParams as DevboxDiskSnapshotsParams from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams -from .repository_version_list_view import RepositoryVersionListView as RepositoryVersionListView from .blueprint_build_logs_list_view import BlueprintBuildLogsListView as BlueprintBuildLogsListView from .devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse as DevboxCreateSSHKeyResponse -from .repository_connection_list_view import RepositoryConnectionListView as RepositoryConnectionListView from .devbox_read_file_contents_params import DevboxReadFileContentsParams as DevboxReadFileContentsParams from .devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView as DevboxAsyncExecutionDetailView from .devbox_read_file_contents_response import DevboxReadFileContentsResponse as DevboxReadFileContentsResponse diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..809acc5e1 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,75 +2,8 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index d74e9a0f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 3d83663f0..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index bd874488d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index 52e22338d..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index df6ee765f..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,34 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParam(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: List[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index 616f4446f..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParam(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 43b4e0a72..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,53 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .document_symbol import DocumentSymbol -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: DocumentSymbol - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index 4ec525ec8..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,65 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParam(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 9e902d731..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParam(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 0e58f87ed..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[DocumentSymbol]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index e5aa38d11..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index e2deae54b..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParam(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 1ab3b23d5..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 8ae66b6ad..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,27 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 0afee2ba3..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,29 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParam(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index c9eaf78a6..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 87a516655..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParam(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index e91fde3ff..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index 882a423c6..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParam(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 01884f8e8..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/src/runloop_api_client/types/repository_connection_list_view.py b/src/runloop_api_client/types/repository_connection_list_view.py deleted file mode 100644 index 4ad5a10ec..000000000 --- a/src/runloop_api_client/types/repository_connection_list_view.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from .._models import BaseModel -from .repository_connection_view import RepositoryConnectionView - -__all__ = ["RepositoryConnectionListView"] - - -class RepositoryConnectionListView(BaseModel): - has_more: bool - - repositories: List[RepositoryConnectionView] - """List of repositories matching filter.""" - - total_count: int diff --git a/src/runloop_api_client/types/repository_connection_view.py b/src/runloop_api_client/types/repository_connection_view.py deleted file mode 100644 index fdc3fff3f..000000000 --- a/src/runloop_api_client/types/repository_connection_view.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["RepositoryConnectionView"] - - -class RepositoryConnectionView(BaseModel): - id: str - """The id of the Repository.""" - - name: str - """The name of the Repository.""" - - owner: str - """The account owner of the Repository.""" - - status: Literal["pending", "failure", "active"] - """The current status of the Repository.""" - - failure_reason: Optional[str] = None - """Reason for failure, if any.""" diff --git a/src/runloop_api_client/types/repository_create_params.py b/src/runloop_api_client/types/repository_create_params.py deleted file mode 100644 index 06864a447..000000000 --- a/src/runloop_api_client/types/repository_create_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["RepositoryCreateParams"] - - -class RepositoryCreateParams(TypedDict, total=False): - name: Required[str] - """Name of the repository.""" - - owner: Required[str] - """Account owner of the repository.""" diff --git a/src/runloop_api_client/types/repository_list_params.py b/src/runloop_api_client/types/repository_list_params.py deleted file mode 100644 index 88c7993ba..000000000 --- a/src/runloop_api_client/types/repository_list_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["RepositoryListParams"] - - -class RepositoryListParams(TypedDict, total=False): - limit: int - """Page Limit""" - - starting_after: str - """Load the next page starting after the given token.""" diff --git a/src/runloop_api_client/types/repository_version_details.py b/src/runloop_api_client/types/repository_version_details.py deleted file mode 100644 index 8d6d2b0d8..000000000 --- a/src/runloop_api_client/types/repository_version_details.py +++ /dev/null @@ -1,44 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["RepositoryVersionDetails", "ExtractedTools", "RepositorySetupDetails"] - - -class ExtractedTools(BaseModel): - commands: Dict[str, str] - """The set of available commands on this repository such as building etc.""" - - package_manager: str - """What package manager this repository uses.""" - - -class RepositorySetupDetails(BaseModel): - blueprint_id: str - """The blueprint built that supports setting up this repository.""" - - env_initialization_command: str - """Command to initialize the env we need to run the commands for this repository.""" - - workspace_setup: List[str] - """Setup commands necessary to support repository i.e. apt install XXX.""" - - -class RepositoryVersionDetails(BaseModel): - analyzed_at: int - """Analyzed time of the Repository Version (Unix timestamp milliseconds).""" - - commit_sha: str - """The sha of the analyzed version of the Repository.""" - - extracted_tools: ExtractedTools - """Tools discovered during inspection.""" - - repository_setup_details: RepositorySetupDetails - """Commands required to set up repository environment.""" - - status: Literal["inspecting", "inspection_failed", "success"] - """The account owner of the Repository.""" diff --git a/src/runloop_api_client/types/repository_version_list_view.py b/src/runloop_api_client/types/repository_version_list_view.py deleted file mode 100644 index 6e4872663..000000000 --- a/src/runloop_api_client/types/repository_version_list_view.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from .._models import BaseModel -from .repository_version_details import RepositoryVersionDetails - -__all__ = ["RepositoryVersionListView"] - - -class RepositoryVersionListView(BaseModel): - analyzed_versions: List[RepositoryVersionDetails] - """List of analyzed versions of this repository.""" diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index 8f02db8d8..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1607 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "href"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "uri", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="uri", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="uri", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="uri", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="path", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="path", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="uri", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="uri", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="path", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="path", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="path", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="path", - ) diff --git a/tests/api_resources/test_repositories.py b/tests/api_resources/test_repositories.py deleted file mode 100644 index 5aec67a48..000000000 --- a/tests/api_resources/test_repositories.py +++ /dev/null @@ -1,388 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types import ( - RepositoryConnectionView, - RepositoryVersionListView, - RepositoryConnectionListView, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestRepositories: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_create(self, client: Runloop) -> None: - repository = client.repositories.create( - name="name", - owner="owner", - ) - assert_matches_type(RepositoryConnectionView, repository, path=["response"]) - - @parametrize - def test_raw_response_create(self, client: Runloop) -> None: - response = client.repositories.with_raw_response.create( - name="name", - owner="owner", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - repository = response.parse() - assert_matches_type(RepositoryConnectionView, repository, path=["response"]) - - @parametrize - def test_streaming_response_create(self, client: Runloop) -> None: - with client.repositories.with_streaming_response.create( - name="name", - owner="owner", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - repository = response.parse() - assert_matches_type(RepositoryConnectionView, repository, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_retrieve(self, client: Runloop) -> None: - repository = client.repositories.retrieve( - "id", - ) - assert_matches_type(RepositoryConnectionView, repository, path=["response"]) - - @parametrize - def test_raw_response_retrieve(self, client: Runloop) -> None: - response = client.repositories.with_raw_response.retrieve( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - repository = response.parse() - assert_matches_type(RepositoryConnectionView, repository, path=["response"]) - - @parametrize - def test_streaming_response_retrieve(self, client: Runloop) -> None: - with client.repositories.with_streaming_response.retrieve( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - repository = response.parse() - assert_matches_type(RepositoryConnectionView, repository, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_retrieve(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.repositories.with_raw_response.retrieve( - "", - ) - - @parametrize - def test_method_list(self, client: Runloop) -> None: - repository = client.repositories.list() - assert_matches_type(RepositoryConnectionListView, repository, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Runloop) -> None: - repository = client.repositories.list( - limit=0, - starting_after="starting_after", - ) - assert_matches_type(RepositoryConnectionListView, repository, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Runloop) -> None: - response = client.repositories.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - repository = response.parse() - assert_matches_type(RepositoryConnectionListView, repository, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Runloop) -> None: - with client.repositories.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - repository = response.parse() - assert_matches_type(RepositoryConnectionListView, repository, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_delete(self, client: Runloop) -> None: - repository = client.repositories.delete( - "id", - ) - assert_matches_type(object, repository, path=["response"]) - - @parametrize - def test_raw_response_delete(self, client: Runloop) -> None: - response = client.repositories.with_raw_response.delete( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - repository = response.parse() - assert_matches_type(object, repository, path=["response"]) - - @parametrize - def test_streaming_response_delete(self, client: Runloop) -> None: - with client.repositories.with_streaming_response.delete( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - repository = response.parse() - assert_matches_type(object, repository, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_delete(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.repositories.with_raw_response.delete( - "", - ) - - @parametrize - def test_method_versions(self, client: Runloop) -> None: - repository = client.repositories.versions( - "id", - ) - assert_matches_type(RepositoryVersionListView, repository, path=["response"]) - - @parametrize - def test_raw_response_versions(self, client: Runloop) -> None: - response = client.repositories.with_raw_response.versions( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - repository = response.parse() - assert_matches_type(RepositoryVersionListView, repository, path=["response"]) - - @parametrize - def test_streaming_response_versions(self, client: Runloop) -> None: - with client.repositories.with_streaming_response.versions( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - repository = response.parse() - assert_matches_type(RepositoryVersionListView, repository, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_versions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.repositories.with_raw_response.versions( - "", - ) - - -class TestAsyncRepositories: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_create(self, async_client: AsyncRunloop) -> None: - repository = await async_client.repositories.create( - name="name", - owner="owner", - ) - assert_matches_type(RepositoryConnectionView, repository, path=["response"]) - - @parametrize - async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: - response = await async_client.repositories.with_raw_response.create( - name="name", - owner="owner", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - repository = await response.parse() - assert_matches_type(RepositoryConnectionView, repository, path=["response"]) - - @parametrize - async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: - async with async_client.repositories.with_streaming_response.create( - name="name", - owner="owner", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - repository = await response.parse() - assert_matches_type(RepositoryConnectionView, repository, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: - repository = await async_client.repositories.retrieve( - "id", - ) - assert_matches_type(RepositoryConnectionView, repository, path=["response"]) - - @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: - response = await async_client.repositories.with_raw_response.retrieve( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - repository = await response.parse() - assert_matches_type(RepositoryConnectionView, repository, path=["response"]) - - @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: - async with async_client.repositories.with_streaming_response.retrieve( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - repository = await response.parse() - assert_matches_type(RepositoryConnectionView, repository, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.repositories.with_raw_response.retrieve( - "", - ) - - @parametrize - async def test_method_list(self, async_client: AsyncRunloop) -> None: - repository = await async_client.repositories.list() - assert_matches_type(RepositoryConnectionListView, repository, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: - repository = await async_client.repositories.list( - limit=0, - starting_after="starting_after", - ) - assert_matches_type(RepositoryConnectionListView, repository, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: - response = await async_client.repositories.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - repository = await response.parse() - assert_matches_type(RepositoryConnectionListView, repository, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: - async with async_client.repositories.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - repository = await response.parse() - assert_matches_type(RepositoryConnectionListView, repository, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_delete(self, async_client: AsyncRunloop) -> None: - repository = await async_client.repositories.delete( - "id", - ) - assert_matches_type(object, repository, path=["response"]) - - @parametrize - async def test_raw_response_delete(self, async_client: AsyncRunloop) -> None: - response = await async_client.repositories.with_raw_response.delete( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - repository = await response.parse() - assert_matches_type(object, repository, path=["response"]) - - @parametrize - async def test_streaming_response_delete(self, async_client: AsyncRunloop) -> None: - async with async_client.repositories.with_streaming_response.delete( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - repository = await response.parse() - assert_matches_type(object, repository, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_delete(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.repositories.with_raw_response.delete( - "", - ) - - @parametrize - async def test_method_versions(self, async_client: AsyncRunloop) -> None: - repository = await async_client.repositories.versions( - "id", - ) - assert_matches_type(RepositoryVersionListView, repository, path=["response"]) - - @parametrize - async def test_raw_response_versions(self, async_client: AsyncRunloop) -> None: - response = await async_client.repositories.with_raw_response.versions( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - repository = await response.parse() - assert_matches_type(RepositoryVersionListView, repository, path=["response"]) - - @parametrize - async def test_streaming_response_versions(self, async_client: AsyncRunloop) -> None: - async with async_client.repositories.with_streaming_response.versions( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - repository = await response.parse() - assert_matches_type(RepositoryVersionListView, repository, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_versions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.repositories.with_raw_response.versions( - "", - ) From 1216669ffd88938fe319da49288f5e585a58a831 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2025 06:55:18 +0000 Subject: [PATCH 623/993] chore(internal): bump httpx dependency (#483) --- pyproject.toml | 2 +- requirements-dev.lock | 5 ++--- requirements.lock | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 80f56ba38..2de294771 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,7 @@ dev-dependencies = [ "dirty-equals>=0.6.0", "importlib-metadata>=6.7.0", "rich>=13.7.1", - "nest_asyncio==1.6.0" + "nest_asyncio==1.6.0", ] [tool.rye.scripts] diff --git a/requirements-dev.lock b/requirements-dev.lock index 913a9ba6f..b09819940 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -35,7 +35,7 @@ h11==0.14.0 # via httpcore httpcore==1.0.2 # via httpx -httpx==0.25.2 +httpx==0.28.1 # via respx # via runloop-api-client idna==3.4 @@ -76,7 +76,7 @@ python-dateutil==2.8.2 # via time-machine pytz==2023.3.post1 # via dirty-equals -respx==0.20.2 +respx==0.22.0 rich==13.7.1 ruff==0.6.9 setuptools==68.2.2 @@ -85,7 +85,6 @@ six==1.16.0 # via python-dateutil sniffio==1.3.0 # via anyio - # via httpx # via runloop-api-client time-machine==2.9.0 tomli==2.0.2 diff --git a/requirements.lock b/requirements.lock index 56423d17c..3d1257561 100644 --- a/requirements.lock +++ b/requirements.lock @@ -25,7 +25,7 @@ h11==0.14.0 # via httpcore httpcore==1.0.2 # via httpx -httpx==0.25.2 +httpx==0.28.1 # via runloop-api-client idna==3.4 # via anyio @@ -36,7 +36,6 @@ pydantic-core==2.27.1 # via pydantic sniffio==1.3.0 # via anyio - # via httpx # via runloop-api-client typing-extensions==4.12.2 # via anyio From 1e1f79c4484081edc3f2ca89faecf6c71b93dc21 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2025 06:58:48 +0000 Subject: [PATCH 624/993] fix(client): only call .close() when needed (#484) --- src/runloop_api_client/_base_client.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index 7d7679e78..bd82fb93e 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -767,6 +767,9 @@ def __init__(self, **kwargs: Any) -> None: class SyncHttpxClientWrapper(DefaultHttpxClient): def __del__(self) -> None: + if self.is_closed: + return + try: self.close() except Exception: @@ -1334,6 +1337,9 @@ def __init__(self, **kwargs: Any) -> None: class AsyncHttpxClientWrapper(DefaultAsyncHttpxClient): def __del__(self) -> None: + if self.is_closed: + return + try: # TODO(someday): support non asyncio runtimes here asyncio.get_running_loop().create_task(self.aclose()) From c8180c4d5c6ec5c2b6dbd866524d270e1de497dc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2025 07:15:15 +0000 Subject: [PATCH 625/993] docs: fix typos (#487) --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 53d2474b2..1744f6ea4 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ except runloop_api_client.APIStatusError as e: print(e.response) ``` -Error codes are as followed: +Error codes are as follows: | Status Code | Error Type | | ----------- | -------------------------- | @@ -232,8 +232,7 @@ If you need to access undocumented endpoints, params, or response properties, th #### Undocumented endpoints To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other -http verbs. Options on the client will be respected (such as retries) will be respected when making this -request. +http verbs. Options on the client will be respected (such as retries) when making this request. ```py import httpx From 8e0f1cce8506a448fd404fe7460c70981a588722 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2025 07:16:50 +0000 Subject: [PATCH 626/993] chore(internal): codegen related update (#488) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1744f6ea4..5049176f0 100644 --- a/README.md +++ b/README.md @@ -304,7 +304,7 @@ with Runloop() as client: This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions: 1. Changes that only affect static types, without breaking runtime behavior. -2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_. +2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_ 3. Changes that we do not expect to impact the vast majority of users in practice. We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. From 552b033785f9c636855a446c0f4c35c15597db10 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Jan 2025 07:11:08 +0000 Subject: [PATCH 627/993] fix: correctly handle deserialising `cls` fields (#489) --- src/runloop_api_client/_models.py | 8 ++++---- tests/test_models.py | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index d56ea1d9e..9a918aabf 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -179,14 +179,14 @@ def __str__(self) -> str: @classmethod @override def construct( # pyright: ignore[reportIncompatibleMethodOverride] - cls: Type[ModelT], + __cls: Type[ModelT], _fields_set: set[str] | None = None, **values: object, ) -> ModelT: - m = cls.__new__(cls) + m = __cls.__new__(__cls) fields_values: dict[str, object] = {} - config = get_model_config(cls) + config = get_model_config(__cls) populate_by_name = ( config.allow_population_by_field_name if isinstance(config, _ConfigProtocol) @@ -196,7 +196,7 @@ def construct( # pyright: ignore[reportIncompatibleMethodOverride] if _fields_set is None: _fields_set = set() - model_fields = get_model_fields(cls) + model_fields = get_model_fields(__cls) for name, field in model_fields.items(): key = field.alias if key is None or (key not in values and populate_by_name): diff --git a/tests/test_models.py b/tests/test_models.py index 2dac47483..78b2d1141 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -844,3 +844,13 @@ class Model(BaseModel): assert m.alias == "foo" assert isinstance(m.union, str) assert m.union == "bar" + + +@pytest.mark.skipif(not PYDANTIC_V2, reason="TypeAliasType is not supported in Pydantic v1") +def test_field_named_cls() -> None: + class Model(BaseModel): + cls: str + + m = construct_type(value={"cls": "foo"}, type_=Model) + assert isinstance(m, Model) + assert isinstance(m.cls, str) From c102f92432bb5045820c828612ccda40d86f033d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 12 Jan 2025 22:23:39 +0000 Subject: [PATCH 628/993] feat(api): manual updates (#490) --- .stats.yml | 4 +- README.md | 63 + api.md | 154 +- src/runloop_api_client/_client.py | 32 +- src/runloop_api_client/pagination.py | 247 +++ src/runloop_api_client/resources/__init__.py | 42 +- .../resources/blueprints.py | 152 +- .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/devboxes.py | 994 +++++++--- .../resources/devboxes/executions.py | 280 +-- .../resources/devboxes/logs.py | 8 +- .../resources/devboxes/lsp.py | 1629 +++++++++++++++++ .../resources/functions/__init__.py | 33 - .../resources/functions/functions.py | 395 ---- .../resources/functions/invocations.py | 357 ---- .../resources/projects/__init__.py | 33 - .../resources/projects/logs.py | 163 -- .../resources/projects/projects.py | 175 -- .../resources/repositories.py | 566 ++++++ src/runloop_api_client/types/__init__.py | 20 +- .../types/blueprint_build_parameters.py | 2 +- .../types/blueprint_create_params.py | 14 +- .../types/blueprint_list_params.py | 4 +- .../types/blueprint_preview_params.py | 14 +- .../types/devbox_create_params.py | 44 +- .../types/devbox_create_ssh_key_response.py | 4 +- .../types/devbox_disk_snapshots_params.py | 15 - .../types/devbox_download_file_params.py | 5 +- .../types/devbox_execute_async_params.py | 16 +- .../types/devbox_execute_sync_params.py | 16 +- .../devbox_list_disk_snapshots_params.py | 18 + .../types/devbox_list_params.py | 10 +- .../types/devbox_read_file_contents_params.py | 5 +- .../types/devbox_remove_tunnel_params.py | 12 + .../types/devbox_snapshot_disk_params.py | 6 +- .../types/devbox_snapshot_view.py | 8 +- .../types/devbox_upload_file_params.py | 10 +- src/runloop_api_client/types/devbox_view.py | 31 +- .../devbox_write_file_contents_params.py | 18 + .../types/devbox_write_file_params.py | 15 - .../types/devboxes/__init__.py | 68 +- .../types/devboxes/base_code_action.py | 21 + .../types/devboxes/base_command.py | 15 + .../types/devboxes/base_command_param.py | 16 + .../types/devboxes/base_diagnostic.py | 22 + .../types/devboxes/base_diagnostic_param.py | 24 + .../types/devboxes/base_location.py | 13 + .../types/devboxes/base_markup_content.py | 12 + .../devboxes/base_parameter_information.py | 17 + .../types/devboxes/base_range.py | 24 + .../types/devboxes/base_range_param.py | 25 + .../types/devboxes/base_signature.py | 20 + .../types/devboxes/base_workspace_edit.py | 13 + .../devboxes/base_workspace_edit_param.py | 14 + .../code_action_application_result.py | 17 + .../devboxes/code_action_context_param.py | 34 + .../types/devboxes/code_action_kind.py | 7 + .../devboxes/code_action_trigger_kind.py | 7 + .../types/devboxes/code_description_param.py | 14 + .../devboxes/code_segment_info_response.py | 54 + .../types/devboxes/diagnostic_param.py | 65 + .../diagnostic_related_information_param.py | 17 + .../types/devboxes/diagnostic_severity.py | 7 + .../types/devboxes/diagnostic_tag.py | 7 + .../types/devboxes/diagnostics_response.py | 14 + .../types/devboxes/document_symbol.py | 58 + .../types/devboxes/document_uri.py | 7 + .../execution_execute_async_params.py | 16 +- .../devboxes/execution_execute_sync_params.py | 16 +- .../devboxes/execution_retrieve_params.py | 14 - .../types/devboxes/file_contents_response.py | 17 + .../types/devboxes/file_path.py | 7 + .../types/devboxes/file_uri.py | 7 + .../types/devboxes/health_status_response.py | 23 + .../types/devboxes/integer.py | 7 + .../l_sp_any_param.py} | 6 + .../types/devboxes/location_param.py | 33 + .../types/devboxes/log_list_params.py | 2 +- .../devboxes/lsp_apply_code_action_params.py | 21 + .../types/devboxes/lsp_code_actions_params.py | 40 + .../types/devboxes/lsp_diagnostics_params.py | 13 + .../devboxes/lsp_document_symbols_params.py | 13 + .../devboxes/lsp_file_definition_params.py | 15 + .../types/devboxes/lsp_file_params.py | 13 + .../types/devboxes/lsp_files_response.py | 10 + .../types/devboxes/lsp_formatting_params.py | 13 + ..._get_code_actions_for_diagnostic_params.py | 15 + ...et_code_actions_for_diagnostic_response.py | 10 + .../lsp_get_code_segment_info_params.py | 19 + .../devboxes/lsp_get_signature_help_params.py | 15 + .../types/devboxes/lsp_references_params.py | 15 + .../lsp_set_watch_directory_params.py | 13 + .../lsp_set_watch_directory_response.py | 7 + .../types/devboxes/position.py | 27 + .../types/devboxes/position_param.py | 29 + .../types/devboxes/range.py | 15 + .../types/devboxes/range_param.py | 17 + .../devboxes/record_string_text_edit_array.py | 10 + .../record_string_text_edit_array_param.py | 12 + .../types/devboxes/signature_help_response.py | 18 + .../types/devboxes/symbol_kind.py | 9 + .../types/devboxes/symbol_tag.py | 7 + .../types/devboxes/symbol_type.py | 7 + .../types/devboxes/text_edit.py | 20 + .../types/devboxes/text_edit_param.py | 21 + .../runloop_api_client/types/devboxes/u_ri.py | 6 + .../types/devboxes/uinteger.py | 7 + .../types/devboxes/watched_file_response.py | 16 + .../types/function_invoke_async_params.py | 23 - .../types/function_invoke_sync_params.py | 23 - .../types/function_list_view.py | 20 - .../types/functions/__init__.py | 6 - .../function_invocation_list_view.py | 47 - .../types/functions/invocation_list_params.py | 15 - .../types/project_list_view.py | 30 - .../types/repository_connection_list_view.py | 17 + .../types/repository_connection_view.py | 25 + .../types/repository_create_params.py | 15 + .../types/repository_list_params.py | 15 + .../types/repository_version_details.py | 44 + .../types/repository_version_list_view.py | 13 + .../types/shared/__init__.py | 5 +- .../{ => shared}/code_mount_parameters.py | 2 +- ...nction_invocation_execution_detail_view.py | 42 - .../types/shared/launch_parameters.py | 3 +- .../types/shared/project_logs_view.py | 22 - .../types/shared_params/__init__.py | 1 + .../code_mount_parameters.py} | 9 +- .../types/shared_params/launch_parameters.py | 15 +- .../api_resources/devboxes/test_executions.py | 210 --- tests/api_resources/devboxes/test_lsp.py | 1607 ++++++++++++++++ .../functions/test_invocations.py | 241 --- tests/api_resources/projects/__init__.py | 1 - tests/api_resources/projects/test_logs.py | 98 - tests/api_resources/test_blueprints.py | 18 +- tests/api_resources/test_devboxes.py | 298 ++- tests/api_resources/test_functions.py | 325 ---- tests/api_resources/test_projects.py | 72 - tests/api_resources/test_repositories.py | 388 ++++ tests/test_client.py | 54 + 140 files changed, 7386 insertions(+), 3159 deletions(-) create mode 100644 src/runloop_api_client/pagination.py create mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/resources/functions/__init__.py delete mode 100644 src/runloop_api_client/resources/functions/functions.py delete mode 100644 src/runloop_api_client/resources/functions/invocations.py delete mode 100644 src/runloop_api_client/resources/projects/__init__.py delete mode 100644 src/runloop_api_client/resources/projects/logs.py delete mode 100644 src/runloop_api_client/resources/projects/projects.py create mode 100644 src/runloop_api_client/resources/repositories.py delete mode 100644 src/runloop_api_client/types/devbox_disk_snapshots_params.py create mode 100644 src/runloop_api_client/types/devbox_list_disk_snapshots_params.py create mode 100644 src/runloop_api_client/types/devbox_remove_tunnel_params.py create mode 100644 src/runloop_api_client/types/devbox_write_file_contents_params.py delete mode 100644 src/runloop_api_client/types/devbox_write_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py create mode 100644 src/runloop_api_client/types/devboxes/base_command.py create mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py create mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_location.py create mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py create mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py create mode 100644 src/runloop_api_client/types/devboxes/base_range.py create mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py create mode 100644 src/runloop_api_client/types/devboxes/base_signature.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py create mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py create mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py create mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py create mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100755 src/runloop_api_client/types/devboxes/execution_retrieve_params.py create mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_path.py create mode 100644 src/runloop_api_client/types/devboxes/file_uri.py create mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py create mode 100644 src/runloop_api_client/types/devboxes/integer.py rename src/runloop_api_client/types/{projects/__init__.py => devboxes/l_sp_any_param.py} (54%) create mode 100644 src/runloop_api_client/types/devboxes/location_param.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py create mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py create mode 100644 src/runloop_api_client/types/devboxes/position.py create mode 100644 src/runloop_api_client/types/devboxes/position_param.py create mode 100644 src/runloop_api_client/types/devboxes/range.py create mode 100644 src/runloop_api_client/types/devboxes/range_param.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py create mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py create mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit.py create mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py rename tests/api_resources/functions/__init__.py => src/runloop_api_client/types/devboxes/u_ri.py (51%) create mode 100644 src/runloop_api_client/types/devboxes/uinteger.py create mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 src/runloop_api_client/types/function_invoke_async_params.py delete mode 100644 src/runloop_api_client/types/function_invoke_sync_params.py delete mode 100644 src/runloop_api_client/types/function_list_view.py delete mode 100644 src/runloop_api_client/types/functions/__init__.py delete mode 100644 src/runloop_api_client/types/functions/function_invocation_list_view.py delete mode 100644 src/runloop_api_client/types/functions/invocation_list_params.py delete mode 100644 src/runloop_api_client/types/project_list_view.py create mode 100644 src/runloop_api_client/types/repository_connection_list_view.py create mode 100644 src/runloop_api_client/types/repository_connection_view.py create mode 100644 src/runloop_api_client/types/repository_create_params.py create mode 100644 src/runloop_api_client/types/repository_list_params.py create mode 100644 src/runloop_api_client/types/repository_version_details.py create mode 100644 src/runloop_api_client/types/repository_version_list_view.py rename src/runloop_api_client/types/{ => shared}/code_mount_parameters.py (94%) delete mode 100644 src/runloop_api_client/types/shared/function_invocation_execution_detail_view.py delete mode 100644 src/runloop_api_client/types/shared/project_logs_view.py rename src/runloop_api_client/types/{code_mount_parameters_param.py => shared_params/code_mount_parameters.py} (74%) create mode 100644 tests/api_resources/devboxes/test_lsp.py delete mode 100644 tests/api_resources/functions/test_invocations.py delete mode 100644 tests/api_resources/projects/__init__.py delete mode 100644 tests/api_resources/projects/test_logs.py delete mode 100644 tests/api_resources/test_functions.py delete mode 100644 tests/api_resources/test_projects.py create mode 100644 tests/api_resources/test_repositories.py diff --git a/.stats.yml b/.stats.yml index b8bd20ffa..31759036f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 33 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb0f4c286298e89e0db9188a3f70bd5ef9c3ea84dd26f23c1fe3e9f4498d845e.yml +configured_endpoints: 44 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-15f23a9e2e014d2e5d4d72c39ee31c5556060fb37d1490f308ecce5aeb41d5c8.yml diff --git a/README.md b/README.md index 5049176f0..5954a9576 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,69 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`. +## Pagination + +List methods in the Runloop API are paginated. + +This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually: + +```python +from runloop_api_client import Runloop + +client = Runloop() + +all_devboxes = [] +# Automatically fetches more pages as needed. +for devbox in client.devboxes.list(): + # Do something with devbox here + all_devboxes.append(devbox) +print(all_devboxes) +``` + +Or, asynchronously: + +```python +import asyncio +from runloop_api_client import AsyncRunloop + +client = AsyncRunloop() + + +async def main() -> None: + all_devboxes = [] + # Iterate through items across all pages, issuing requests as needed. + async for devbox in client.devboxes.list(): + all_devboxes.append(devbox) + print(all_devboxes) + + +asyncio.run(main()) +``` + +Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get_next_page()` methods for more granular control working with pages: + +```python +first_page = await client.devboxes.list() +if first_page.has_next_page(): + print(f"will fetch next page using these details: {first_page.next_page_info()}") + next_page = await first_page.get_next_page() + print(f"number of items we just fetched: {len(next_page.devboxes)}") + +# Remove `await` for non-async usage. +``` + +Or just work directly with the returned data: + +```python +first_page = await client.devboxes.list() + +print(f"next page cursor: {first_page.starting_after}") # => "next page cursor: ..." +for devbox in first_page.devboxes: + print(devbox.id) + +# Remove `await` for non-async usage. +``` + ## Handling errors When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `runloop_api_client.APIConnectionError` is raised. diff --git a/api.md b/api.md index 160665026..00eb5ac7e 100644 --- a/api.md +++ b/api.md @@ -1,12 +1,7 @@ # Shared Types ```python -from runloop_api_client.types import ( - AfterIdle, - FunctionInvocationExecutionDetailView, - LaunchParameters, - ProjectLogsView, -) +from runloop_api_client.types import AfterIdle, CodeMountParameters, LaunchParameters ``` # Blueprints @@ -28,18 +23,10 @@ Methods: - client.blueprints.create(\*\*params) -> BlueprintView - client.blueprints.retrieve(id) -> BlueprintView -- client.blueprints.list(\*\*params) -> BlueprintListView +- client.blueprints.list(\*\*params) -> SyncBlueprintsCursorIDPage[BlueprintView] - client.blueprints.logs(id) -> BlueprintBuildLogsListView - client.blueprints.preview(\*\*params) -> BlueprintPreviewView -# Code - -Types: - -```python -from runloop_api_client.types import CodeMountParameters -``` - # Devboxes Types: @@ -54,6 +41,7 @@ from runloop_api_client.types import ( DevboxTunnelView, DevboxView, DevboxCreateSSHKeyResponse, + DevboxDeleteDiskSnapshotResponse, DevboxKeepAliveResponse, DevboxReadFileContentsResponse, DevboxUploadFileResponse, @@ -64,85 +52,143 @@ Methods: - client.devboxes.create(\*\*params) -> DevboxView - client.devboxes.retrieve(id) -> DevboxView -- client.devboxes.list(\*\*params) -> DevboxListView +- client.devboxes.list(\*\*params) -> SyncDevboxesCursorIDPage[DevboxView] - client.devboxes.create_ssh_key(id) -> DevboxCreateSSHKeyResponse - client.devboxes.create_tunnel(id, \*\*params) -> DevboxTunnelView -- client.devboxes.disk_snapshots(\*\*params) -> DevboxSnapshotListView +- client.devboxes.delete_disk_snapshot(id) -> object - client.devboxes.download_file(id, \*\*params) -> BinaryAPIResponse - client.devboxes.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.keep_alive(id) -> object +- client.devboxes.list_disk_snapshots(\*\*params) -> SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView] - client.devboxes.read_file_contents(id, \*\*params) -> str +- client.devboxes.remove_tunnel(id, \*\*params) -> DevboxTunnelView - client.devboxes.resume(id) -> DevboxView - client.devboxes.shutdown(id) -> DevboxView - client.devboxes.snapshot_disk(id, \*\*params) -> DevboxSnapshotView - client.devboxes.suspend(id) -> DevboxView - client.devboxes.upload_file(id, \*\*params) -> object -- client.devboxes.write_file(id, \*\*params) -> DevboxExecutionDetailView +- client.devboxes.write_file_contents(id, \*\*params) -> DevboxExecutionDetailView -## Logs +## Lsp Types: ```python -from runloop_api_client.types.devboxes import DevboxLogsListView +from runloop_api_client.types.devboxes import ( + BaseCodeAction, + BaseCommand, + BaseDiagnostic, + BaseLocation, + BaseMarkupContent, + BaseParameterInformation, + BaseRange, + BaseSignature, + BaseWorkspaceEdit, + CodeActionApplicationResult, + CodeActionContext, + CodeActionKind, + CodeActionsForDiagnosticRequestBody, + CodeActionsRequestBody, + CodeActionsResponse, + CodeActionTriggerKind, + CodeDescription, + CodeSegmentInfoRequestBody, + CodeSegmentInfoResponse, + Diagnostic, + DiagnosticRelatedInformation, + DiagnosticSeverity, + DiagnosticsResponse, + DiagnosticTag, + DocumentSymbol, + DocumentSymbolResponse, + DocumentUri, + FileContentsResponse, + FileDefinitionRequestBody, + FileDefinitionResponse, + FilePath, + FileRequestBody, + FileUri, + FormattingResponse, + HealthStatusResponse, + Integer, + Location, + LSpAny, + Position, + Range, + RecordStringTextEditArray, + ReferencesRequestBody, + ReferencesResponse, + SetWatchDirectoryRequestBody, + SignatureHelpRequestBody, + SignatureHelpResponse, + SymbolKind, + SymbolTag, + SymbolType, + TextEdit, + Uinteger, + URi, + WatchedFileResponse, + LspFilesResponse, + LspGetCodeActionsForDiagnosticResponse, + LspSetWatchDirectoryResponse, +) ``` Methods: -- client.devboxes.logs.list(id, \*\*params) -> DevboxLogsListView - -## Executions - -Methods: - -- client.devboxes.executions.retrieve(execution_id, \*, id, \*\*params) -> DevboxAsyncExecutionDetailView -- client.devboxes.executions.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView -- client.devboxes.executions.execute_sync(id, \*\*params) -> DevboxExecutionDetailView -- client.devboxes.executions.kill(execution_id, \*, id) -> DevboxAsyncExecutionDetailView +- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult +- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse +- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse +- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.files(id) -> LspFilesResponse +- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse +- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse +- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse +- client.devboxes.lsp.health(id) -> HealthStatusResponse +- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str -# Functions +## Logs Types: ```python -from runloop_api_client.types import FunctionListView +from runloop_api_client.types.devboxes import DevboxLogsListView ``` Methods: -- client.functions.list() -> FunctionListView -- client.functions.invoke_async(function_name, \*, project_name, \*\*params) -> FunctionInvocationExecutionDetailView -- client.functions.invoke_sync(function_name, \*, project_name, \*\*params) -> FunctionInvocationExecutionDetailView - -## Invocations - -Types: +- client.devboxes.logs.list(id, \*\*params) -> DevboxLogsListView -```python -from runloop_api_client.types.functions import FunctionInvocationListView, KillOperationResponse -``` +## Executions Methods: -- client.functions.invocations.retrieve(invocation_id) -> FunctionInvocationExecutionDetailView -- client.functions.invocations.list(\*\*params) -> FunctionInvocationListView -- client.functions.invocations.kill(invocation_id) -> object +- client.devboxes.executions.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView +- client.devboxes.executions.execute_sync(id, \*\*params) -> DevboxExecutionDetailView -# Projects +# Repositories Types: ```python -from runloop_api_client.types import ProjectListView +from runloop_api_client.types import ( + RepositoryConnectionListView, + RepositoryConnectionView, + RepositoryVersionDetails, + RepositoryVersionListView, + RepositoryDeleteResponse, +) ``` Methods: -- client.projects.list() -> ProjectListView - -## Logs - -Methods: - -- client.projects.logs.list(id) -> ProjectLogsView +- client.repositories.create(\*\*params) -> RepositoryConnectionView +- client.repositories.retrieve(id) -> RepositoryConnectionView +- client.repositories.list(\*\*params) -> SyncRepositoriesCursorIDPage[RepositoryConnectionView] +- client.repositories.delete(id) -> object +- client.repositories.versions(id) -> RepositoryVersionListView diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index fcafda610..2c254b387 100644 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -24,7 +24,7 @@ get_async_library, ) from ._version import __version__ -from .resources import blueprints +from .resources import blueprints, repositories from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import RunloopError, APIStatusError from ._base_client import ( @@ -33,8 +33,6 @@ AsyncAPIClient, ) from .resources.devboxes import devboxes -from .resources.projects import projects -from .resources.functions import functions __all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Runloop", "AsyncRunloop", "Client", "AsyncClient"] @@ -42,8 +40,7 @@ class Runloop(SyncAPIClient): blueprints: blueprints.BlueprintsResource devboxes: devboxes.DevboxesResource - functions: functions.FunctionsResource - projects: projects.ProjectsResource + repositories: repositories.RepositoriesResource with_raw_response: RunloopWithRawResponse with_streaming_response: RunloopWithStreamedResponse @@ -101,10 +98,11 @@ def __init__( _strict_response_validation=_strict_response_validation, ) + self._idempotency_header = "x-request-id" + self.blueprints = blueprints.BlueprintsResource(self) self.devboxes = devboxes.DevboxesResource(self) - self.functions = functions.FunctionsResource(self) - self.projects = projects.ProjectsResource(self) + self.repositories = repositories.RepositoriesResource(self) self.with_raw_response = RunloopWithRawResponse(self) self.with_streaming_response = RunloopWithStreamedResponse(self) @@ -216,8 +214,7 @@ def _make_status_error( class AsyncRunloop(AsyncAPIClient): blueprints: blueprints.AsyncBlueprintsResource devboxes: devboxes.AsyncDevboxesResource - functions: functions.AsyncFunctionsResource - projects: projects.AsyncProjectsResource + repositories: repositories.AsyncRepositoriesResource with_raw_response: AsyncRunloopWithRawResponse with_streaming_response: AsyncRunloopWithStreamedResponse @@ -275,10 +272,11 @@ def __init__( _strict_response_validation=_strict_response_validation, ) + self._idempotency_header = "x-request-id" + self.blueprints = blueprints.AsyncBlueprintsResource(self) self.devboxes = devboxes.AsyncDevboxesResource(self) - self.functions = functions.AsyncFunctionsResource(self) - self.projects = projects.AsyncProjectsResource(self) + self.repositories = repositories.AsyncRepositoriesResource(self) self.with_raw_response = AsyncRunloopWithRawResponse(self) self.with_streaming_response = AsyncRunloopWithStreamedResponse(self) @@ -391,32 +389,28 @@ class RunloopWithRawResponse: def __init__(self, client: Runloop) -> None: self.blueprints = blueprints.BlueprintsResourceWithRawResponse(client.blueprints) self.devboxes = devboxes.DevboxesResourceWithRawResponse(client.devboxes) - self.functions = functions.FunctionsResourceWithRawResponse(client.functions) - self.projects = projects.ProjectsResourceWithRawResponse(client.projects) + self.repositories = repositories.RepositoriesResourceWithRawResponse(client.repositories) class AsyncRunloopWithRawResponse: def __init__(self, client: AsyncRunloop) -> None: self.blueprints = blueprints.AsyncBlueprintsResourceWithRawResponse(client.blueprints) self.devboxes = devboxes.AsyncDevboxesResourceWithRawResponse(client.devboxes) - self.functions = functions.AsyncFunctionsResourceWithRawResponse(client.functions) - self.projects = projects.AsyncProjectsResourceWithRawResponse(client.projects) + self.repositories = repositories.AsyncRepositoriesResourceWithRawResponse(client.repositories) class RunloopWithStreamedResponse: def __init__(self, client: Runloop) -> None: self.blueprints = blueprints.BlueprintsResourceWithStreamingResponse(client.blueprints) self.devboxes = devboxes.DevboxesResourceWithStreamingResponse(client.devboxes) - self.functions = functions.FunctionsResourceWithStreamingResponse(client.functions) - self.projects = projects.ProjectsResourceWithStreamingResponse(client.projects) + self.repositories = repositories.RepositoriesResourceWithStreamingResponse(client.repositories) class AsyncRunloopWithStreamedResponse: def __init__(self, client: AsyncRunloop) -> None: self.blueprints = blueprints.AsyncBlueprintsResourceWithStreamingResponse(client.blueprints) self.devboxes = devboxes.AsyncDevboxesResourceWithStreamingResponse(client.devboxes) - self.functions = functions.AsyncFunctionsResourceWithStreamingResponse(client.functions) - self.projects = projects.AsyncProjectsResourceWithStreamingResponse(client.projects) + self.repositories = repositories.AsyncRepositoriesResourceWithStreamingResponse(client.repositories) Client = Runloop diff --git a/src/runloop_api_client/pagination.py b/src/runloop_api_client/pagination.py new file mode 100644 index 000000000..00f73e6a1 --- /dev/null +++ b/src/runloop_api_client/pagination.py @@ -0,0 +1,247 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Any, List, Generic, TypeVar, Optional, cast +from typing_extensions import Protocol, override, runtime_checkable + +from ._base_client import BasePage, PageInfo, BaseSyncPage, BaseAsyncPage + +__all__ = [ + "SyncBlueprintsCursorIDPage", + "AsyncBlueprintsCursorIDPage", + "SyncDevboxesCursorIDPage", + "AsyncDevboxesCursorIDPage", + "SyncRepositoriesCursorIDPage", + "AsyncRepositoriesCursorIDPage", + "SyncDiskSnapshotsCursorIDPage", + "AsyncDiskSnapshotsCursorIDPage", +] + +_T = TypeVar("_T") + + +@runtime_checkable +class BlueprintsCursorIDPageItem(Protocol): + id: str + + +@runtime_checkable +class DevboxesCursorIDPageItem(Protocol): + id: str + + +@runtime_checkable +class RepositoriesCursorIDPageItem(Protocol): + id: str + + +@runtime_checkable +class DiskSnapshotsCursorIDPageItem(Protocol): + id: str + + +class SyncBlueprintsCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + blueprints: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + blueprints = self.blueprints + if not blueprints: + return [] + return blueprints + + @override + def next_page_info(self) -> Optional[PageInfo]: + blueprints = self.blueprints + if not blueprints: + return None + + item = cast(Any, blueprints[-1]) + if not isinstance(item, BlueprintsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) + + +class AsyncBlueprintsCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + blueprints: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + blueprints = self.blueprints + if not blueprints: + return [] + return blueprints + + @override + def next_page_info(self) -> Optional[PageInfo]: + blueprints = self.blueprints + if not blueprints: + return None + + item = cast(Any, blueprints[-1]) + if not isinstance(item, BlueprintsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) + + +class SyncDevboxesCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + devboxes: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + devboxes = self.devboxes + if not devboxes: + return [] + return devboxes + + @override + def next_page_info(self) -> Optional[PageInfo]: + devboxes = self.devboxes + if not devboxes: + return None + + item = cast(Any, devboxes[-1]) + if not isinstance(item, DevboxesCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) + + +class AsyncDevboxesCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + devboxes: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + devboxes = self.devboxes + if not devboxes: + return [] + return devboxes + + @override + def next_page_info(self) -> Optional[PageInfo]: + devboxes = self.devboxes + if not devboxes: + return None + + item = cast(Any, devboxes[-1]) + if not isinstance(item, DevboxesCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) + + +class SyncRepositoriesCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + repositories: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + repositories = self.repositories + if not repositories: + return [] + return repositories + + @override + def next_page_info(self) -> Optional[PageInfo]: + repositories = self.repositories + if not repositories: + return None + + item = cast(Any, repositories[-1]) + if not isinstance(item, RepositoriesCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) + + +class AsyncRepositoriesCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + repositories: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + repositories = self.repositories + if not repositories: + return [] + return repositories + + @override + def next_page_info(self) -> Optional[PageInfo]: + repositories = self.repositories + if not repositories: + return None + + item = cast(Any, repositories[-1]) + if not isinstance(item, RepositoriesCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) + + +class SyncDiskSnapshotsCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + snapshots: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + snapshots = self.snapshots + if not snapshots: + return [] + return snapshots + + @override + def next_page_info(self) -> Optional[PageInfo]: + snapshots = self.snapshots + if not snapshots: + return None + + item = cast(Any, snapshots[-1]) + if not isinstance(item, DiskSnapshotsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) + + +class AsyncDiskSnapshotsCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + snapshots: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + snapshots = self.snapshots + if not snapshots: + return [] + return snapshots + + @override + def next_page_info(self) -> Optional[PageInfo]: + snapshots = self.snapshots + if not snapshots: + return None + + item = cast(Any, snapshots[-1]) + if not isinstance(item, DiskSnapshotsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) diff --git a/src/runloop_api_client/resources/__init__.py b/src/runloop_api_client/resources/__init__.py index f36499829..72fe76dc1 100644 --- a/src/runloop_api_client/resources/__init__.py +++ b/src/runloop_api_client/resources/__init__.py @@ -8,22 +8,6 @@ DevboxesResourceWithStreamingResponse, AsyncDevboxesResourceWithStreamingResponse, ) -from .projects import ( - ProjectsResource, - AsyncProjectsResource, - ProjectsResourceWithRawResponse, - AsyncProjectsResourceWithRawResponse, - ProjectsResourceWithStreamingResponse, - AsyncProjectsResourceWithStreamingResponse, -) -from .functions import ( - FunctionsResource, - AsyncFunctionsResource, - FunctionsResourceWithRawResponse, - AsyncFunctionsResourceWithRawResponse, - FunctionsResourceWithStreamingResponse, - AsyncFunctionsResourceWithStreamingResponse, -) from .blueprints import ( BlueprintsResource, AsyncBlueprintsResource, @@ -32,6 +16,14 @@ BlueprintsResourceWithStreamingResponse, AsyncBlueprintsResourceWithStreamingResponse, ) +from .repositories import ( + RepositoriesResource, + AsyncRepositoriesResource, + RepositoriesResourceWithRawResponse, + AsyncRepositoriesResourceWithRawResponse, + RepositoriesResourceWithStreamingResponse, + AsyncRepositoriesResourceWithStreamingResponse, +) __all__ = [ "BlueprintsResource", @@ -46,16 +38,10 @@ "AsyncDevboxesResourceWithRawResponse", "DevboxesResourceWithStreamingResponse", "AsyncDevboxesResourceWithStreamingResponse", - "FunctionsResource", - "AsyncFunctionsResource", - "FunctionsResourceWithRawResponse", - "AsyncFunctionsResourceWithRawResponse", - "FunctionsResourceWithStreamingResponse", - "AsyncFunctionsResourceWithStreamingResponse", - "ProjectsResource", - "AsyncProjectsResource", - "ProjectsResourceWithRawResponse", - "AsyncProjectsResourceWithRawResponse", - "ProjectsResourceWithStreamingResponse", - "AsyncProjectsResourceWithStreamingResponse", + "RepositoriesResource", + "AsyncRepositoriesResource", + "RepositoriesResourceWithRawResponse", + "AsyncRepositoriesResourceWithRawResponse", + "RepositoriesResourceWithStreamingResponse", + "AsyncRepositoriesResourceWithStreamingResponse", ] diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index 8acbd7631..78dae9d88 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Iterable +from typing import Dict, List, Iterable, Optional import httpx @@ -20,13 +20,13 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .._base_client import make_request_options +from ..pagination import SyncBlueprintsCursorIDPage, AsyncBlueprintsCursorIDPage +from .._base_client import AsyncPaginator, make_request_options from ..types.blueprint_view import BlueprintView -from ..types.blueprint_list_view import BlueprintListView from ..types.blueprint_preview_view import BlueprintPreviewView -from ..types.code_mount_parameters_param import CodeMountParametersParam from ..types.blueprint_build_logs_list_view import BlueprintBuildLogsListView from ..types.shared_params.launch_parameters import LaunchParameters +from ..types.shared_params.code_mount_parameters import CodeMountParameters __all__ = ["BlueprintsResource", "AsyncBlueprintsResource"] @@ -55,23 +55,25 @@ def create( self, *, name: str, - code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, - dockerfile: str | NotGiven = NOT_GIVEN, - file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, - system_setup_commands: List[str] | NotGiven = NOT_GIVEN, + code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, + dockerfile: Optional[str] | NotGiven = NOT_GIVEN, + file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, + system_setup_commands: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> BlueprintView: - """Build a Blueprint with the specified configuration. + """Starts build of custom defined container Blueprint. - The Blueprint will begin - building upon create, ' and will transition to 'building_complete' once it is - ready. + The Blueprint will begin in + the 'provisioning' step and transition to the 'building' step once it is + selected off the build queue., Upon build complete it will transition to + 'building_complete' if the build is successful. Args: name: Name of the Blueprint. @@ -93,6 +95,8 @@ def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return self._post( "/v1/blueprints", @@ -108,7 +112,11 @@ def create( blueprint_create_params.BlueprintCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=BlueprintView, ) @@ -125,7 +133,7 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> BlueprintView: """ - Get a previously built Blueprint. + Get the details of a previously created Blueprint including the build status. Args: extra_headers: Send extra headers @@ -158,18 +166,16 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BlueprintListView: - """List all blueprints or filter by name. - - If no status is provided, all blueprints - are returned. + ) -> SyncBlueprintsCursorIDPage[BlueprintView]: + """ + List all Blueprints or filter by name. Args: - limit: Page Limit + limit: The limit of items to return. Default is 20. name: Filter by name - starting_after: Load the next page starting after the given token. + starting_after: Load the next page of data starting after the item with the given ID. extra_headers: Send extra headers @@ -179,8 +185,9 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get( + return self._get_api_list( "/v1/blueprints", + page=SyncBlueprintsCursorIDPage[BlueprintView], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -195,7 +202,7 @@ def list( blueprint_list_params.BlueprintListParams, ), ), - cast_to=BlueprintListView, + model=BlueprintView, ) def logs( @@ -210,7 +217,7 @@ def logs( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> BlueprintBuildLogsListView: """ - Get Blueprint build logs. + Get all logs from the building of a Blueprint. Args: extra_headers: Send extra headers @@ -235,22 +242,23 @@ def preview( self, *, name: str, - code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, - dockerfile: str | NotGiven = NOT_GIVEN, - file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, - system_setup_commands: List[str] | NotGiven = NOT_GIVEN, + code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, + dockerfile: Optional[str] | NotGiven = NOT_GIVEN, + file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, + system_setup_commands: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> BlueprintPreviewView: """Preview building a Blueprint with the specified configuration. You can take the - resulting Dockerfile and test out your build. + resulting Dockerfile and test out your build using any local docker tooling. Args: name: Name of the Blueprint. @@ -272,6 +280,8 @@ def preview( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return self._post( "/v1/blueprints/preview", @@ -287,7 +297,11 @@ def preview( blueprint_preview_params.BlueprintPreviewParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=BlueprintPreviewView, ) @@ -317,23 +331,25 @@ async def create( self, *, name: str, - code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, - dockerfile: str | NotGiven = NOT_GIVEN, - file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, - system_setup_commands: List[str] | NotGiven = NOT_GIVEN, + code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, + dockerfile: Optional[str] | NotGiven = NOT_GIVEN, + file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, + system_setup_commands: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> BlueprintView: - """Build a Blueprint with the specified configuration. + """Starts build of custom defined container Blueprint. - The Blueprint will begin - building upon create, ' and will transition to 'building_complete' once it is - ready. + The Blueprint will begin in + the 'provisioning' step and transition to the 'building' step once it is + selected off the build queue., Upon build complete it will transition to + 'building_complete' if the build is successful. Args: name: Name of the Blueprint. @@ -355,6 +371,8 @@ async def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return await self._post( "/v1/blueprints", @@ -370,7 +388,11 @@ async def create( blueprint_create_params.BlueprintCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=BlueprintView, ) @@ -387,7 +409,7 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> BlueprintView: """ - Get a previously built Blueprint. + Get the details of a previously created Blueprint including the build status. Args: extra_headers: Send extra headers @@ -408,7 +430,7 @@ async def retrieve( cast_to=BlueprintView, ) - async def list( + def list( self, *, limit: int | NotGiven = NOT_GIVEN, @@ -420,18 +442,16 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BlueprintListView: - """List all blueprints or filter by name. - - If no status is provided, all blueprints - are returned. + ) -> AsyncPaginator[BlueprintView, AsyncBlueprintsCursorIDPage[BlueprintView]]: + """ + List all Blueprints or filter by name. Args: - limit: Page Limit + limit: The limit of items to return. Default is 20. name: Filter by name - starting_after: Load the next page starting after the given token. + starting_after: Load the next page of data starting after the item with the given ID. extra_headers: Send extra headers @@ -441,14 +461,15 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - return await self._get( + return self._get_api_list( "/v1/blueprints", + page=AsyncBlueprintsCursorIDPage[BlueprintView], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { "limit": limit, "name": name, @@ -457,7 +478,7 @@ async def list( blueprint_list_params.BlueprintListParams, ), ), - cast_to=BlueprintListView, + model=BlueprintView, ) async def logs( @@ -472,7 +493,7 @@ async def logs( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> BlueprintBuildLogsListView: """ - Get Blueprint build logs. + Get all logs from the building of a Blueprint. Args: extra_headers: Send extra headers @@ -497,22 +518,23 @@ async def preview( self, *, name: str, - code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, - dockerfile: str | NotGiven = NOT_GIVEN, - file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, - system_setup_commands: List[str] | NotGiven = NOT_GIVEN, + code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, + dockerfile: Optional[str] | NotGiven = NOT_GIVEN, + file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, + system_setup_commands: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> BlueprintPreviewView: """Preview building a Blueprint with the specified configuration. You can take the - resulting Dockerfile and test out your build. + resulting Dockerfile and test out your build using any local docker tooling. Args: name: Name of the Blueprint. @@ -534,6 +556,8 @@ async def preview( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return await self._post( "/v1/blueprints/preview", @@ -549,7 +573,11 @@ async def preview( blueprint_preview_params.BlueprintPreviewParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=BlueprintPreviewView, ) diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index ec7c746ac..d5378fb54 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -26,6 +34,12 @@ ) __all__ = [ + "LspResource", + "AsyncLspResource", + "LspResourceWithRawResponse", + "AsyncLspResourceWithRawResponse", + "LspResourceWithStreamingResponse", + "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 68ace3c32..a9e090118 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -2,10 +2,19 @@ from __future__ import annotations -from typing import Dict, Mapping, Iterable, cast +from typing import Dict, Mapping, Iterable, Optional, cast +from typing_extensions import Literal import httpx +from .lsp import ( + LspResource, + AsyncLspResource, + LspResourceWithRawResponse, + AsyncLspResourceWithRawResponse, + LspResourceWithStreamingResponse, + AsyncLspResourceWithStreamingResponse, +) from .logs import ( LogsResource, AsyncLogsResource, @@ -17,15 +26,16 @@ from ...types import ( devbox_list_params, devbox_create_params, - devbox_write_file_params, devbox_upload_file_params, devbox_execute_sync_params, devbox_create_tunnel_params, devbox_download_file_params, devbox_execute_async_params, + devbox_remove_tunnel_params, devbox_snapshot_disk_params, - devbox_disk_snapshots_params, devbox_read_file_contents_params, + devbox_list_disk_snapshots_params, + devbox_write_file_contents_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes from ..._utils import ( @@ -58,22 +68,30 @@ async_to_custom_raw_response_wrapper, async_to_custom_streamed_response_wrapper, ) -from ..._base_client import make_request_options +from ...pagination import ( + SyncDevboxesCursorIDPage, + AsyncDevboxesCursorIDPage, + SyncDiskSnapshotsCursorIDPage, + AsyncDiskSnapshotsCursorIDPage, +) +from ..._base_client import AsyncPaginator, make_request_options from ...types.devbox_view import DevboxView -from ...types.devbox_list_view import DevboxListView from ...types.devbox_tunnel_view import DevboxTunnelView from ...types.devbox_snapshot_view import DevboxSnapshotView -from ...types.devbox_snapshot_list_view import DevboxSnapshotListView -from ...types.code_mount_parameters_param import CodeMountParametersParam from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse from ...types.shared_params.launch_parameters import LaunchParameters from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView +from ...types.shared_params.code_mount_parameters import CodeMountParameters __all__ = ["DevboxesResource", "AsyncDevboxesResource"] class DevboxesResource(SyncAPIResource): + @cached_property + def lsp(self) -> LspResource: + return LspResource(self._client) + @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -104,35 +122,41 @@ def with_streaming_response(self) -> DevboxesResourceWithStreamingResponse: def create( self, *, - blueprint_id: str | NotGiven = NOT_GIVEN, - blueprint_name: str | NotGiven = NOT_GIVEN, - code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, - entrypoint: str | NotGiven = NOT_GIVEN, - environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, - file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, - metadata: Dict[str, str] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - prebuilt: str | NotGiven = NOT_GIVEN, - snapshot_id: str | NotGiven = NOT_GIVEN, + blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, + blueprint_name: Optional[str] | NotGiven = NOT_GIVEN, + code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, + entrypoint: Optional[str] | NotGiven = NOT_GIVEN, + environment_variables: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, + prebuilt: Optional[str] | NotGiven = NOT_GIVEN, + snapshot_id: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxView: - """Create a Devbox with the specified configuration. + """Create a Devbox and begin the boot process. - The Devbox will be created in - the 'pending' state and will transition to 'running' once it is ready. + The Devbox will initially launch in + the 'provisioning' state while Runloop allocates the necessary infrastructure. + It will transition to the 'initializing' state while the booted Devbox runs any + Runloop or user defined set up scripts. Finally, the Devbox will transition to + the 'running' state when it is ready for use. Args: - blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be - created with the default Runloop Devbox image. + blueprint_id: Blueprint ID to use for the Devbox. If none set, the Devbox will be created with + the default Runloop Devbox image. Only one of (Snapshot ID, Blueprint ID, + Blueprint name) should be specified. - blueprint_name: (Optional) Name of Blueprint to use for the Devbox. When set, this will load the - latest successfully built Blueprint with the given name. + blueprint_name: Name of Blueprint to use for the Devbox. When set, this will load the latest + successfully built Blueprint with the given name. Only one of (Snapshot ID, + Blueprint ID, Blueprint name) should be specified. code_mounts: A list of code mounts to be included in the Devbox. @@ -150,9 +174,11 @@ def create( name: (Optional) A user specified name to give the Devbox. - prebuilt: Reference to prebuilt Blueprint. + prebuilt: Reference to prebuilt Blueprint to create the Devbox from. Should not be used + together with (Snapshot ID, Blueprint ID, or Blueprint name). - snapshot_id: Snapshot ID to use for the Devbox. + snapshot_id: Snapshot ID to use for the Devbox. Only one of (Snapshot ID, Blueprint ID, + Blueprint name) should be specified. extra_headers: Send extra headers @@ -161,6 +187,8 @@ def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return self._post( "/v1/devboxes", @@ -181,7 +209,11 @@ def create( devbox_create_params.DevboxCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxView, ) @@ -197,9 +229,8 @@ def retrieve( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DevboxView: - """Get a devbox by id. - - If the devbox does not exist, a 404 is returned. + """ + Get the latest details and status of a Devbox. Args: extra_headers: Send extra headers @@ -225,23 +256,24 @@ def list( *, limit: int | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, - status: str | NotGiven = NOT_GIVEN, + status: Literal[ + "provisioning", "initializing", "running", "suspending", "suspended", "resuming", "failure", "shutdown" + ] + | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxListView: - """List all devboxes or filter by status. - - If no status is provided, all devboxes - are returned. + ) -> SyncDevboxesCursorIDPage[DevboxView]: + """ + List all Devboxes while optionally filtering by status. Args: - limit: Page Limit + limit: The limit of items to return. Default is 20. - starting_after: Load the next page starting after the given token. + starting_after: Load the next page of data starting after the item with the given ID. status: Filter by status @@ -253,8 +285,9 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get( + return self._get_api_list( "/v1/devboxes", + page=SyncDevboxesCursorIDPage[DevboxView], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -269,7 +302,7 @@ def list( devbox_list_params.DevboxListParams, ), ), - cast_to=DevboxListView, + model=DevboxView, ) def create_ssh_key( @@ -282,9 +315,10 @@ def create_ssh_key( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxCreateSSHKeyResponse: """ - Create an SSH key for a devbox by id. + Create an SSH key for a Devbox to enable remote access. Args: extra_headers: Send extra headers @@ -294,13 +328,19 @@ def create_ssh_key( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/create_ssh_key", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxCreateSSHKeyResponse, ) @@ -316,9 +356,13 @@ def create_tunnel( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxTunnelView: - """ - Create a tunnel to an available port on the Devbox. + """Create a live tunnel to an available port on the Devbox. + + Note the port must be + made available using Devbox.create.availablePorts. Otherwise, the tunnel will + not connect to any running processes on the Devbox. Args: port: Devbox port that tunnel will expose. @@ -330,6 +374,8 @@ def create_tunnel( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -337,31 +383,31 @@ def create_tunnel( f"/v1/devboxes/{id}/create_tunnel", body=maybe_transform({"port": port}, devbox_create_tunnel_params.DevboxCreateTunnelParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxTunnelView, ) - def disk_snapshots( + def delete_disk_snapshot( self, + id: str, *, - limit: int | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxSnapshotListView: + idempotency_key: str | None = None, + ) -> object: """ - List all snapshots of a devbox by id. + Delete a previously taken disk snapshot of a Devbox. Args: - limit: Page Limit - - starting_after: Load the next page starting after the given token. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -369,23 +415,21 @@ def disk_snapshots( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ - return self._get( - "/v1/devboxes/disk_snapshots", + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/disk_snapshots/{id}/delete", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform( - { - "limit": limit, - "starting_after": starting_after, - }, - devbox_disk_snapshots_params.DevboxDiskSnapshotsParams, - ), + idempotency_key=idempotency_key, ), - cast_to=DevboxSnapshotListView, + cast_to=object, ) def download_file( @@ -399,12 +443,15 @@ def download_file( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> BinaryAPIResponse: """ - Download file contents to a file at path on the Devbox. + Download file contents of any type (binary, text, etc) from a specified path on + the Devbox. Args: - path: The path on the devbox to read the file + path: The path on the Devbox filesystem to read the file from. Path is relative to + user home directory. extra_headers: Send extra headers @@ -413,6 +460,8 @@ def download_file( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -421,7 +470,11 @@ def download_file( f"/v1/devboxes/{id}/download_file", body=maybe_transform({"path": path}, devbox_download_file_params.DevboxDownloadFileParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=BinaryAPIResponse, ) @@ -431,21 +484,28 @@ def execute_async( id: str, *, command: str, - shell_name: str | NotGiven = NOT_GIVEN, + shell_name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxAsyncExecutionDetailView: """ - Asynchronously execute a command on a devbox + Execute the given command in the Devbox shell asynchronously and returns the + execution that can be used to track the command's progress. Args: - command: The command to execute on the Devbox. + command: The command to execute via the Devbox shell. By default, commands are run from + the user home directory unless shell_name is specified. If shell_name is + specified the command is run from the directory based on the recent state of the + persistent shell. - shell_name: Which named shell to run the command in. + shell_name: The name of the persistent shell to create or use if already created. When using + a persistent shell, the command will run from the directory at the end of the + previous command and environment variables will be preserved. extra_headers: Send extra headers @@ -454,6 +514,8 @@ def execute_async( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -467,7 +529,11 @@ def execute_async( devbox_execute_async_params.DevboxExecuteAsyncParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxAsyncExecutionDetailView, ) @@ -477,21 +543,28 @@ def execute_sync( id: str, *, command: str, - shell_name: str | NotGiven = NOT_GIVEN, + shell_name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxExecutionDetailView: """ - Synchronously execute a command on a devbox + Execute a bash command in the Devbox shell, await the command completion and + return the output. Args: - command: The command to execute on the Devbox. + command: The command to execute via the Devbox shell. By default, commands are run from + the user home directory unless shell_name is specified. If shell_name is + specified the command is run from the directory based on the recent state of the + persistent shell. - shell_name: Which named shell to run the command in. + shell_name: The name of the persistent shell to create or use if already created. When using + a persistent shell, the command will run from the directory at the end of the + previous command and environment variables will be preserved. extra_headers: Send extra headers @@ -500,6 +573,8 @@ def execute_sync( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -513,7 +588,11 @@ def execute_sync( devbox_execute_sync_params.DevboxExecuteSyncParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxExecutionDetailView, ) @@ -528,9 +607,11 @@ def keep_alive( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> object: """ - Keep alive a running devbox that is configured to shutdown on idle. + Send a 'Keep Alive' signal to a running Devbox that is configured to shutdown on + idle so the idle time resets. Args: extra_headers: Send extra headers @@ -540,17 +621,74 @@ def keep_alive( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/keep_alive", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=object, ) + def list_disk_snapshots( + self, + *, + devbox_id: str | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView]: + """ + List all snapshots of a Devbox while optionally filtering by Devbox ID. + + Args: + devbox_id: Devbox ID to filter by. + + limit: The limit of items to return. Default is 20. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/devboxes/disk_snapshots", + page=SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "devbox_id": devbox_id, + "limit": limit, + "starting_after": starting_after, + }, + devbox_list_disk_snapshots_params.DevboxListDiskSnapshotsParams, + ), + ), + model=DevboxSnapshotView, + ) + def read_file_contents( self, id: str, @@ -562,12 +700,17 @@ def read_file_contents( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> str: - """ - Read file contents from a file on given Devbox. + """Read file contents from a file on a Devbox as a UTF-8. + + Note 'downloadFile' + should be used for large files (greater than 100MB). Returns the file contents + as a UTF-8 string. Args: - file_path: The path of the file to read. + file_path: The path on the Devbox filesystem to read the file from. Path is relative to + user home directory. extra_headers: Send extra headers @@ -576,6 +719,8 @@ def read_file_contents( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -586,11 +731,59 @@ def read_file_contents( {"file_path": file_path}, devbox_read_file_contents_params.DevboxReadFileContentsParams ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=str, ) + def remove_tunnel( + self, + id: str, + *, + port: int, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> DevboxTunnelView: + """ + Remove a previously opened tunnel on the Devbox. + + Args: + port: Devbox port that tunnel will expose. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/remove_tunnel", + body=maybe_transform({"port": port}, devbox_remove_tunnel_params.DevboxRemoveTunnelParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=DevboxTunnelView, + ) + def resume( self, id: str, @@ -601,9 +794,13 @@ def resume( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxView: - """ - Resume a suspended devbox by id. + """Resume a suspended Devbox with the disk state captured as suspend time. + + Note + that any previously running processes or daemons will need to be restarted using + the Devbox shell tools. Args: extra_headers: Send extra headers @@ -613,13 +810,19 @@ def resume( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/resume", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxView, ) @@ -634,10 +837,13 @@ def shutdown( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxView: - """Shutdown a running devbox by id. + """Shutdown a running Devbox. - This will take the devbox out of service. + This will permanently stop the Devbox. If you want to + save the state of the Devbox, you should take a snapshot before shutting down or + should suspend the Devbox instead of shutting down. Args: extra_headers: Send extra headers @@ -647,13 +853,19 @@ def shutdown( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/shutdown", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxView, ) @@ -662,17 +874,19 @@ def snapshot_disk( self, id: str, *, - metadata: Dict[str, str] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxSnapshotView: """ - Create a filesystem snapshot of a devbox with the specified name and metadata. + Create a disk snapshot of a devbox with the specified name and metadata to + enable launching future Devboxes with the same disk state. Args: metadata: (Optional) Metadata used to describe the snapshot @@ -686,6 +900,8 @@ def snapshot_disk( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -699,7 +915,11 @@ def snapshot_disk( devbox_snapshot_disk_params.DevboxSnapshotDiskParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxSnapshotView, ) @@ -714,10 +934,12 @@ def suspend( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxView: - """Suspend a devbox by id. - - This will take the devbox out of service. + """ + Suspend a running Devbox and create a disk snapshot to enable resuming the + Devbox later with the same disk. Note this will not snapshot memory state such + as running processes. Args: extra_headers: Send extra headers @@ -727,13 +949,19 @@ def suspend( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/suspend", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxView, ) @@ -742,19 +970,26 @@ def upload_file( self, id: str, *, + path: str, file: FileTypes | NotGiven = NOT_GIVEN, - path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> object: - """ - Upload file contents to a file at path on the Devbox. + """Upload file contents of any type (binary, text, etc) to a Devbox. + + Note this API + is suitable for large files (larger than 100MB) and efficiently uploads files + via multipart form data. Args: + path: The path to write the file to on the Devbox. Path is relative to user home + directory. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -762,13 +997,15 @@ def upload_file( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") body = deepcopy_minimal( { - "file": file, "path": path, + "file": file, } ) files = extract_files(cast(Mapping[str, object], body), paths=[["file"]]) @@ -781,12 +1018,16 @@ def upload_file( body=maybe_transform(body, devbox_upload_file_params.DevboxUploadFileParams), files=files, options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=object, ) - def write_file( + def write_file_contents( self, id: str, *, @@ -798,14 +1039,18 @@ def write_file( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxExecutionDetailView: - """ - Write contents to a file at path on the Devbox. + """Write UTF-8 string contents to a file at path on the Devbox. + + Note for large + files (larger than 100MB), the upload_file endpoint must be used. Args: - contents: The contents to write to file. + contents: The UTF-8 string contents to write to the file. - file_path: The path of the file to write. + file_path: The path to write the file to on the Devbox. Path is relative to user home + directory. extra_headers: Send extra headers @@ -814,26 +1059,36 @@ def write_file( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( - f"/v1/devboxes/{id}/write_file", + f"/v1/devboxes/{id}/write_file_contents", body=maybe_transform( { "contents": contents, "file_path": file_path, }, - devbox_write_file_params.DevboxWriteFileParams, + devbox_write_file_contents_params.DevboxWriteFileContentsParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxExecutionDetailView, ) class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def lsp(self) -> AsyncLspResource: + return AsyncLspResource(self._client) + @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -864,35 +1119,41 @@ def with_streaming_response(self) -> AsyncDevboxesResourceWithStreamingResponse: async def create( self, *, - blueprint_id: str | NotGiven = NOT_GIVEN, - blueprint_name: str | NotGiven = NOT_GIVEN, - code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN, - entrypoint: str | NotGiven = NOT_GIVEN, - environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN, - file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN, - launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN, - metadata: Dict[str, str] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - prebuilt: str | NotGiven = NOT_GIVEN, - snapshot_id: str | NotGiven = NOT_GIVEN, + blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, + blueprint_name: Optional[str] | NotGiven = NOT_GIVEN, + code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, + entrypoint: Optional[str] | NotGiven = NOT_GIVEN, + environment_variables: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, + prebuilt: Optional[str] | NotGiven = NOT_GIVEN, + snapshot_id: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxView: - """Create a Devbox with the specified configuration. + """Create a Devbox and begin the boot process. - The Devbox will be created in - the 'pending' state and will transition to 'running' once it is ready. + The Devbox will initially launch in + the 'provisioning' state while Runloop allocates the necessary infrastructure. + It will transition to the 'initializing' state while the booted Devbox runs any + Runloop or user defined set up scripts. Finally, the Devbox will transition to + the 'running' state when it is ready for use. Args: - blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be - created with the default Runloop Devbox image. + blueprint_id: Blueprint ID to use for the Devbox. If none set, the Devbox will be created with + the default Runloop Devbox image. Only one of (Snapshot ID, Blueprint ID, + Blueprint name) should be specified. - blueprint_name: (Optional) Name of Blueprint to use for the Devbox. When set, this will load the - latest successfully built Blueprint with the given name. + blueprint_name: Name of Blueprint to use for the Devbox. When set, this will load the latest + successfully built Blueprint with the given name. Only one of (Snapshot ID, + Blueprint ID, Blueprint name) should be specified. code_mounts: A list of code mounts to be included in the Devbox. @@ -910,9 +1171,11 @@ async def create( name: (Optional) A user specified name to give the Devbox. - prebuilt: Reference to prebuilt Blueprint. + prebuilt: Reference to prebuilt Blueprint to create the Devbox from. Should not be used + together with (Snapshot ID, Blueprint ID, or Blueprint name). - snapshot_id: Snapshot ID to use for the Devbox. + snapshot_id: Snapshot ID to use for the Devbox. Only one of (Snapshot ID, Blueprint ID, + Blueprint name) should be specified. extra_headers: Send extra headers @@ -921,6 +1184,8 @@ async def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return await self._post( "/v1/devboxes", @@ -941,7 +1206,11 @@ async def create( devbox_create_params.DevboxCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxView, ) @@ -957,9 +1226,8 @@ async def retrieve( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DevboxView: - """Get a devbox by id. - - If the devbox does not exist, a 404 is returned. + """ + Get the latest details and status of a Devbox. Args: extra_headers: Send extra headers @@ -980,28 +1248,29 @@ async def retrieve( cast_to=DevboxView, ) - async def list( + def list( self, *, limit: int | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, - status: str | NotGiven = NOT_GIVEN, + status: Literal[ + "provisioning", "initializing", "running", "suspending", "suspended", "resuming", "failure", "shutdown" + ] + | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxListView: - """List all devboxes or filter by status. - - If no status is provided, all devboxes - are returned. + ) -> AsyncPaginator[DevboxView, AsyncDevboxesCursorIDPage[DevboxView]]: + """ + List all Devboxes while optionally filtering by status. Args: - limit: Page Limit + limit: The limit of items to return. Default is 20. - starting_after: Load the next page starting after the given token. + starting_after: Load the next page of data starting after the item with the given ID. status: Filter by status @@ -1013,14 +1282,15 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - return await self._get( + return self._get_api_list( "/v1/devboxes", + page=AsyncDevboxesCursorIDPage[DevboxView], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { "limit": limit, "starting_after": starting_after, @@ -1029,7 +1299,7 @@ async def list( devbox_list_params.DevboxListParams, ), ), - cast_to=DevboxListView, + model=DevboxView, ) async def create_ssh_key( @@ -1042,9 +1312,10 @@ async def create_ssh_key( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxCreateSSHKeyResponse: """ - Create an SSH key for a devbox by id. + Create an SSH key for a Devbox to enable remote access. Args: extra_headers: Send extra headers @@ -1054,13 +1325,19 @@ async def create_ssh_key( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( f"/v1/devboxes/{id}/create_ssh_key", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxCreateSSHKeyResponse, ) @@ -1076,9 +1353,13 @@ async def create_tunnel( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxTunnelView: - """ - Create a tunnel to an available port on the Devbox. + """Create a live tunnel to an available port on the Devbox. + + Note the port must be + made available using Devbox.create.availablePorts. Otherwise, the tunnel will + not connect to any running processes on the Devbox. Args: port: Devbox port that tunnel will expose. @@ -1090,6 +1371,8 @@ async def create_tunnel( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -1097,31 +1380,31 @@ async def create_tunnel( f"/v1/devboxes/{id}/create_tunnel", body=await async_maybe_transform({"port": port}, devbox_create_tunnel_params.DevboxCreateTunnelParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxTunnelView, ) - async def disk_snapshots( + async def delete_disk_snapshot( self, + id: str, *, - limit: int | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxSnapshotListView: + idempotency_key: str | None = None, + ) -> object: """ - List all snapshots of a devbox by id. + Delete a previously taken disk snapshot of a Devbox. Args: - limit: Page Limit - - starting_after: Load the next page starting after the given token. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1129,23 +1412,21 @@ async def disk_snapshots( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ - return await self._get( - "/v1/devboxes/disk_snapshots", + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/disk_snapshots/{id}/delete", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( - { - "limit": limit, - "starting_after": starting_after, - }, - devbox_disk_snapshots_params.DevboxDiskSnapshotsParams, - ), + idempotency_key=idempotency_key, ), - cast_to=DevboxSnapshotListView, + cast_to=object, ) async def download_file( @@ -1159,12 +1440,15 @@ async def download_file( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> AsyncBinaryAPIResponse: """ - Download file contents to a file at path on the Devbox. + Download file contents of any type (binary, text, etc) from a specified path on + the Devbox. Args: - path: The path on the devbox to read the file + path: The path on the Devbox filesystem to read the file from. Path is relative to + user home directory. extra_headers: Send extra headers @@ -1173,6 +1457,8 @@ async def download_file( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -1181,7 +1467,11 @@ async def download_file( f"/v1/devboxes/{id}/download_file", body=await async_maybe_transform({"path": path}, devbox_download_file_params.DevboxDownloadFileParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=AsyncBinaryAPIResponse, ) @@ -1191,21 +1481,28 @@ async def execute_async( id: str, *, command: str, - shell_name: str | NotGiven = NOT_GIVEN, + shell_name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxAsyncExecutionDetailView: """ - Asynchronously execute a command on a devbox + Execute the given command in the Devbox shell asynchronously and returns the + execution that can be used to track the command's progress. Args: - command: The command to execute on the Devbox. + command: The command to execute via the Devbox shell. By default, commands are run from + the user home directory unless shell_name is specified. If shell_name is + specified the command is run from the directory based on the recent state of the + persistent shell. - shell_name: Which named shell to run the command in. + shell_name: The name of the persistent shell to create or use if already created. When using + a persistent shell, the command will run from the directory at the end of the + previous command and environment variables will be preserved. extra_headers: Send extra headers @@ -1214,6 +1511,8 @@ async def execute_async( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -1227,7 +1526,11 @@ async def execute_async( devbox_execute_async_params.DevboxExecuteAsyncParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxAsyncExecutionDetailView, ) @@ -1237,21 +1540,28 @@ async def execute_sync( id: str, *, command: str, - shell_name: str | NotGiven = NOT_GIVEN, + shell_name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxExecutionDetailView: """ - Synchronously execute a command on a devbox + Execute a bash command in the Devbox shell, await the command completion and + return the output. Args: - command: The command to execute on the Devbox. + command: The command to execute via the Devbox shell. By default, commands are run from + the user home directory unless shell_name is specified. If shell_name is + specified the command is run from the directory based on the recent state of the + persistent shell. - shell_name: Which named shell to run the command in. + shell_name: The name of the persistent shell to create or use if already created. When using + a persistent shell, the command will run from the directory at the end of the + previous command and environment variables will be preserved. extra_headers: Send extra headers @@ -1260,6 +1570,8 @@ async def execute_sync( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -1273,7 +1585,11 @@ async def execute_sync( devbox_execute_sync_params.DevboxExecuteSyncParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxExecutionDetailView, ) @@ -1288,9 +1604,11 @@ async def keep_alive( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> object: """ - Keep alive a running devbox that is configured to shutdown on idle. + Send a 'Keep Alive' signal to a running Devbox that is configured to shutdown on + idle so the idle time resets. Args: extra_headers: Send extra headers @@ -1300,17 +1618,74 @@ async def keep_alive( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( f"/v1/devboxes/{id}/keep_alive", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=object, ) + def list_disk_snapshots( + self, + *, + devbox_id: str | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[DevboxSnapshotView, AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView]]: + """ + List all snapshots of a Devbox while optionally filtering by Devbox ID. + + Args: + devbox_id: Devbox ID to filter by. + + limit: The limit of items to return. Default is 20. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/devboxes/disk_snapshots", + page=AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "devbox_id": devbox_id, + "limit": limit, + "starting_after": starting_after, + }, + devbox_list_disk_snapshots_params.DevboxListDiskSnapshotsParams, + ), + ), + model=DevboxSnapshotView, + ) + async def read_file_contents( self, id: str, @@ -1322,12 +1697,17 @@ async def read_file_contents( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> str: - """ - Read file contents from a file on given Devbox. + """Read file contents from a file on a Devbox as a UTF-8. + + Note 'downloadFile' + should be used for large files (greater than 100MB). Returns the file contents + as a UTF-8 string. Args: - file_path: The path of the file to read. + file_path: The path on the Devbox filesystem to read the file from. Path is relative to + user home directory. extra_headers: Send extra headers @@ -1336,6 +1716,8 @@ async def read_file_contents( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -1346,11 +1728,59 @@ async def read_file_contents( {"file_path": file_path}, devbox_read_file_contents_params.DevboxReadFileContentsParams ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=str, ) + async def remove_tunnel( + self, + id: str, + *, + port: int, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> DevboxTunnelView: + """ + Remove a previously opened tunnel on the Devbox. + + Args: + port: Devbox port that tunnel will expose. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/remove_tunnel", + body=await async_maybe_transform({"port": port}, devbox_remove_tunnel_params.DevboxRemoveTunnelParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=DevboxTunnelView, + ) + async def resume( self, id: str, @@ -1361,9 +1791,13 @@ async def resume( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxView: - """ - Resume a suspended devbox by id. + """Resume a suspended Devbox with the disk state captured as suspend time. + + Note + that any previously running processes or daemons will need to be restarted using + the Devbox shell tools. Args: extra_headers: Send extra headers @@ -1373,13 +1807,19 @@ async def resume( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( f"/v1/devboxes/{id}/resume", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxView, ) @@ -1394,10 +1834,13 @@ async def shutdown( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxView: - """Shutdown a running devbox by id. + """Shutdown a running Devbox. - This will take the devbox out of service. + This will permanently stop the Devbox. If you want to + save the state of the Devbox, you should take a snapshot before shutting down or + should suspend the Devbox instead of shutting down. Args: extra_headers: Send extra headers @@ -1407,13 +1850,19 @@ async def shutdown( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( f"/v1/devboxes/{id}/shutdown", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxView, ) @@ -1422,17 +1871,19 @@ async def snapshot_disk( self, id: str, *, - metadata: Dict[str, str] | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxSnapshotView: """ - Create a filesystem snapshot of a devbox with the specified name and metadata. + Create a disk snapshot of a devbox with the specified name and metadata to + enable launching future Devboxes with the same disk state. Args: metadata: (Optional) Metadata used to describe the snapshot @@ -1446,6 +1897,8 @@ async def snapshot_disk( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -1459,7 +1912,11 @@ async def snapshot_disk( devbox_snapshot_disk_params.DevboxSnapshotDiskParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxSnapshotView, ) @@ -1474,10 +1931,12 @@ async def suspend( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxView: - """Suspend a devbox by id. - - This will take the devbox out of service. + """ + Suspend a running Devbox and create a disk snapshot to enable resuming the + Devbox later with the same disk. Note this will not snapshot memory state such + as running processes. Args: extra_headers: Send extra headers @@ -1487,13 +1946,19 @@ async def suspend( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( f"/v1/devboxes/{id}/suspend", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxView, ) @@ -1502,19 +1967,26 @@ async def upload_file( self, id: str, *, + path: str, file: FileTypes | NotGiven = NOT_GIVEN, - path: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> object: - """ - Upload file contents to a file at path on the Devbox. + """Upload file contents of any type (binary, text, etc) to a Devbox. + + Note this API + is suitable for large files (larger than 100MB) and efficiently uploads files + via multipart form data. Args: + path: The path to write the file to on the Devbox. Path is relative to user home + directory. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1522,13 +1994,15 @@ async def upload_file( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") body = deepcopy_minimal( { - "file": file, "path": path, + "file": file, } ) files = extract_files(cast(Mapping[str, object], body), paths=[["file"]]) @@ -1541,12 +2015,16 @@ async def upload_file( body=await async_maybe_transform(body, devbox_upload_file_params.DevboxUploadFileParams), files=files, options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=object, ) - async def write_file( + async def write_file_contents( self, id: str, *, @@ -1558,14 +2036,18 @@ async def write_file( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxExecutionDetailView: - """ - Write contents to a file at path on the Devbox. + """Write UTF-8 string contents to a file at path on the Devbox. + + Note for large + files (larger than 100MB), the upload_file endpoint must be used. Args: - contents: The contents to write to file. + contents: The UTF-8 string contents to write to the file. - file_path: The path of the file to write. + file_path: The path to write the file to on the Devbox. Path is relative to user home + directory. extra_headers: Send extra headers @@ -1574,20 +2056,26 @@ async def write_file( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( - f"/v1/devboxes/{id}/write_file", + f"/v1/devboxes/{id}/write_file_contents", body=await async_maybe_transform( { "contents": contents, "file_path": file_path, }, - devbox_write_file_params.DevboxWriteFileParams, + devbox_write_file_contents_params.DevboxWriteFileContentsParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxExecutionDetailView, ) @@ -1612,8 +2100,8 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.create_tunnel = to_raw_response_wrapper( devboxes.create_tunnel, ) - self.disk_snapshots = to_raw_response_wrapper( - devboxes.disk_snapshots, + self.delete_disk_snapshot = to_raw_response_wrapper( + devboxes.delete_disk_snapshot, ) self.download_file = to_custom_raw_response_wrapper( devboxes.download_file, @@ -1628,9 +2116,15 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.keep_alive = to_raw_response_wrapper( devboxes.keep_alive, ) + self.list_disk_snapshots = to_raw_response_wrapper( + devboxes.list_disk_snapshots, + ) self.read_file_contents = to_raw_response_wrapper( devboxes.read_file_contents, ) + self.remove_tunnel = to_raw_response_wrapper( + devboxes.remove_tunnel, + ) self.resume = to_raw_response_wrapper( devboxes.resume, ) @@ -1646,10 +2140,14 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.upload_file = to_raw_response_wrapper( devboxes.upload_file, ) - self.write_file = to_raw_response_wrapper( - devboxes.write_file, + self.write_file_contents = to_raw_response_wrapper( + devboxes.write_file_contents, ) + @cached_property + def lsp(self) -> LspResourceWithRawResponse: + return LspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -1678,8 +2176,8 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.create_tunnel = async_to_raw_response_wrapper( devboxes.create_tunnel, ) - self.disk_snapshots = async_to_raw_response_wrapper( - devboxes.disk_snapshots, + self.delete_disk_snapshot = async_to_raw_response_wrapper( + devboxes.delete_disk_snapshot, ) self.download_file = async_to_custom_raw_response_wrapper( devboxes.download_file, @@ -1694,9 +2192,15 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.keep_alive = async_to_raw_response_wrapper( devboxes.keep_alive, ) + self.list_disk_snapshots = async_to_raw_response_wrapper( + devboxes.list_disk_snapshots, + ) self.read_file_contents = async_to_raw_response_wrapper( devboxes.read_file_contents, ) + self.remove_tunnel = async_to_raw_response_wrapper( + devboxes.remove_tunnel, + ) self.resume = async_to_raw_response_wrapper( devboxes.resume, ) @@ -1712,10 +2216,14 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.upload_file = async_to_raw_response_wrapper( devboxes.upload_file, ) - self.write_file = async_to_raw_response_wrapper( - devboxes.write_file, + self.write_file_contents = async_to_raw_response_wrapper( + devboxes.write_file_contents, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithRawResponse: + return AsyncLspResourceWithRawResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -1744,8 +2252,8 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.create_tunnel = to_streamed_response_wrapper( devboxes.create_tunnel, ) - self.disk_snapshots = to_streamed_response_wrapper( - devboxes.disk_snapshots, + self.delete_disk_snapshot = to_streamed_response_wrapper( + devboxes.delete_disk_snapshot, ) self.download_file = to_custom_streamed_response_wrapper( devboxes.download_file, @@ -1760,9 +2268,15 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.keep_alive = to_streamed_response_wrapper( devboxes.keep_alive, ) + self.list_disk_snapshots = to_streamed_response_wrapper( + devboxes.list_disk_snapshots, + ) self.read_file_contents = to_streamed_response_wrapper( devboxes.read_file_contents, ) + self.remove_tunnel = to_streamed_response_wrapper( + devboxes.remove_tunnel, + ) self.resume = to_streamed_response_wrapper( devboxes.resume, ) @@ -1778,10 +2292,14 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.upload_file = to_streamed_response_wrapper( devboxes.upload_file, ) - self.write_file = to_streamed_response_wrapper( - devboxes.write_file, + self.write_file_contents = to_streamed_response_wrapper( + devboxes.write_file_contents, ) + @cached_property + def lsp(self) -> LspResourceWithStreamingResponse: + return LspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -1810,8 +2328,8 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.create_tunnel = async_to_streamed_response_wrapper( devboxes.create_tunnel, ) - self.disk_snapshots = async_to_streamed_response_wrapper( - devboxes.disk_snapshots, + self.delete_disk_snapshot = async_to_streamed_response_wrapper( + devboxes.delete_disk_snapshot, ) self.download_file = async_to_custom_streamed_response_wrapper( devboxes.download_file, @@ -1826,9 +2344,15 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.keep_alive = async_to_streamed_response_wrapper( devboxes.keep_alive, ) + self.list_disk_snapshots = async_to_streamed_response_wrapper( + devboxes.list_disk_snapshots, + ) self.read_file_contents = async_to_streamed_response_wrapper( devboxes.read_file_contents, ) + self.remove_tunnel = async_to_streamed_response_wrapper( + devboxes.remove_tunnel, + ) self.resume = async_to_streamed_response_wrapper( devboxes.resume, ) @@ -1844,10 +2368,14 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.upload_file = async_to_streamed_response_wrapper( devboxes.upload_file, ) - self.write_file = async_to_streamed_response_wrapper( - devboxes.write_file, + self.write_file_contents = async_to_streamed_response_wrapper( + devboxes.write_file_contents, ) + @cached_property + def lsp(self) -> AsyncLspResourceWithStreamingResponse: + return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) + @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index c265dcd45..b8cc6fbf3 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing import Optional + import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven @@ -18,7 +20,7 @@ async_to_streamed_response_wrapper, ) from ..._base_client import make_request_options -from ...types.devboxes import execution_retrieve_params, execution_execute_sync_params, execution_execute_async_params +from ...types.devboxes import execution_execute_sync_params, execution_execute_async_params from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView @@ -45,69 +47,33 @@ def with_streaming_response(self) -> ExecutionsResourceWithStreamingResponse: """ return ExecutionsResourceWithStreamingResponse(self) - def retrieve( - self, - execution_id: str, - *, - id: str, - last_n: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxAsyncExecutionDetailView: - """ - Get status of an execution on a devbox. - - Args: - last_n: Last n lines of standard error / standard out to return - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - if not execution_id: - raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") - return self._get( - f"/v1/devboxes/{id}/executions/{execution_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform({"last_n": last_n}, execution_retrieve_params.ExecutionRetrieveParams), - ), - cast_to=DevboxAsyncExecutionDetailView, - ) - def execute_async( self, id: str, *, command: str, - shell_name: str | NotGiven = NOT_GIVEN, + shell_name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxAsyncExecutionDetailView: """ - Asynchronously execute a command on a devbox + Execute the given command in the Devbox shell asynchronously and returns the + execution that can be used to track the command's progress. Args: - command: The command to execute on the Devbox. + command: The command to execute via the Devbox shell. By default, commands are run from + the user home directory unless shell_name is specified. If shell_name is + specified the command is run from the directory based on the recent state of the + persistent shell. - shell_name: Which named shell to run the command in. + shell_name: The name of the persistent shell to create or use if already created. When using + a persistent shell, the command will run from the directory at the end of the + previous command and environment variables will be preserved. extra_headers: Send extra headers @@ -116,6 +82,8 @@ def execute_async( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -129,7 +97,11 @@ def execute_async( execution_execute_async_params.ExecutionExecuteAsyncParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxAsyncExecutionDetailView, ) @@ -139,21 +111,28 @@ def execute_sync( id: str, *, command: str, - shell_name: str | NotGiven = NOT_GIVEN, + shell_name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxExecutionDetailView: """ - Synchronously execute a command on a devbox + Execute a bash command in the Devbox shell, await the command completion and + return the output. Args: - command: The command to execute on the Devbox. + command: The command to execute via the Devbox shell. By default, commands are run from + the user home directory unless shell_name is specified. If shell_name is + specified the command is run from the directory based on the recent state of the + persistent shell. - shell_name: Which named shell to run the command in. + shell_name: The name of the persistent shell to create or use if already created. When using + a persistent shell, the command will run from the directory at the end of the + previous command and environment variables will be preserved. extra_headers: Send extra headers @@ -162,6 +141,8 @@ def execute_sync( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -175,47 +156,15 @@ def execute_sync( execution_execute_sync_params.ExecutionExecuteSyncParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxExecutionDetailView, ) - def kill( - self, - execution_id: str, - *, - id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxAsyncExecutionDetailView: - """ - Kill an asynchronous execution currently running on a devbox - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - if not execution_id: - raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") - return self._post( - f"/v1/devboxes/{id}/executions/{execution_id}/kill", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DevboxAsyncExecutionDetailView, - ) - class AsyncExecutionsResource(AsyncAPIResource): @cached_property @@ -237,71 +186,33 @@ def with_streaming_response(self) -> AsyncExecutionsResourceWithStreamingRespons """ return AsyncExecutionsResourceWithStreamingResponse(self) - async def retrieve( - self, - execution_id: str, - *, - id: str, - last_n: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxAsyncExecutionDetailView: - """ - Get status of an execution on a devbox. - - Args: - last_n: Last n lines of standard error / standard out to return - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - if not execution_id: - raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") - return await self._get( - f"/v1/devboxes/{id}/executions/{execution_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - {"last_n": last_n}, execution_retrieve_params.ExecutionRetrieveParams - ), - ), - cast_to=DevboxAsyncExecutionDetailView, - ) - async def execute_async( self, id: str, *, command: str, - shell_name: str | NotGiven = NOT_GIVEN, + shell_name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxAsyncExecutionDetailView: """ - Asynchronously execute a command on a devbox + Execute the given command in the Devbox shell asynchronously and returns the + execution that can be used to track the command's progress. Args: - command: The command to execute on the Devbox. + command: The command to execute via the Devbox shell. By default, commands are run from + the user home directory unless shell_name is specified. If shell_name is + specified the command is run from the directory based on the recent state of the + persistent shell. - shell_name: Which named shell to run the command in. + shell_name: The name of the persistent shell to create or use if already created. When using + a persistent shell, the command will run from the directory at the end of the + previous command and environment variables will be preserved. extra_headers: Send extra headers @@ -310,6 +221,8 @@ async def execute_async( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -323,7 +236,11 @@ async def execute_async( execution_execute_async_params.ExecutionExecuteAsyncParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxAsyncExecutionDetailView, ) @@ -333,21 +250,28 @@ async def execute_sync( id: str, *, command: str, - shell_name: str | NotGiven = NOT_GIVEN, + shell_name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, ) -> DevboxExecutionDetailView: """ - Synchronously execute a command on a devbox + Execute a bash command in the Devbox shell, await the command completion and + return the output. Args: - command: The command to execute on the Devbox. + command: The command to execute via the Devbox shell. By default, commands are run from + the user home directory unless shell_name is specified. If shell_name is + specified the command is run from the directory based on the recent state of the + persistent shell. - shell_name: Which named shell to run the command in. + shell_name: The name of the persistent shell to create or use if already created. When using + a persistent shell, the command will run from the directory at the end of the + previous command and environment variables will be preserved. extra_headers: Send extra headers @@ -356,6 +280,8 @@ async def execute_sync( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -369,115 +295,59 @@ async def execute_sync( execution_execute_sync_params.ExecutionExecuteSyncParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DevboxExecutionDetailView, ) - async def kill( - self, - execution_id: str, - *, - id: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> DevboxAsyncExecutionDetailView: - """ - Kill an asynchronous execution currently running on a devbox - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - if not execution_id: - raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") - return await self._post( - f"/v1/devboxes/{id}/executions/{execution_id}/kill", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=DevboxAsyncExecutionDetailView, - ) - class ExecutionsResourceWithRawResponse: def __init__(self, executions: ExecutionsResource) -> None: self._executions = executions - self.retrieve = to_raw_response_wrapper( - executions.retrieve, - ) self.execute_async = to_raw_response_wrapper( executions.execute_async, ) self.execute_sync = to_raw_response_wrapper( executions.execute_sync, ) - self.kill = to_raw_response_wrapper( - executions.kill, - ) class AsyncExecutionsResourceWithRawResponse: def __init__(self, executions: AsyncExecutionsResource) -> None: self._executions = executions - self.retrieve = async_to_raw_response_wrapper( - executions.retrieve, - ) self.execute_async = async_to_raw_response_wrapper( executions.execute_async, ) self.execute_sync = async_to_raw_response_wrapper( executions.execute_sync, ) - self.kill = async_to_raw_response_wrapper( - executions.kill, - ) class ExecutionsResourceWithStreamingResponse: def __init__(self, executions: ExecutionsResource) -> None: self._executions = executions - self.retrieve = to_streamed_response_wrapper( - executions.retrieve, - ) self.execute_async = to_streamed_response_wrapper( executions.execute_async, ) self.execute_sync = to_streamed_response_wrapper( executions.execute_sync, ) - self.kill = to_streamed_response_wrapper( - executions.kill, - ) class AsyncExecutionsResourceWithStreamingResponse: def __init__(self, executions: AsyncExecutionsResource) -> None: self._executions = executions - self.retrieve = async_to_streamed_response_wrapper( - executions.retrieve, - ) self.execute_async = async_to_streamed_response_wrapper( executions.execute_async, ) self.execute_sync = async_to_streamed_response_wrapper( executions.execute_sync, ) - self.kill = async_to_streamed_response_wrapper( - executions.kill, - ) diff --git a/src/runloop_api_client/resources/devboxes/logs.py b/src/runloop_api_client/resources/devboxes/logs.py index ce320d7bb..a9fa13101 100644 --- a/src/runloop_api_client/resources/devboxes/logs.py +++ b/src/runloop_api_client/resources/devboxes/logs.py @@ -58,10 +58,10 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DevboxLogsListView: """ - Get all logs from a Devbox by id. + Get all logs from a running or completed Devbox. Args: - execution_id: Id of execution to filter logs by. + execution_id: ID of execution to filter logs by. shell_name: Shell Name to filter logs by. @@ -128,10 +128,10 @@ async def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> DevboxLogsListView: """ - Get all logs from a Devbox by id. + Get all logs from a running or completed Devbox. Args: - execution_id: Id of execution to filter logs by. + execution_id: ID of execution to filter logs by. shell_name: Shell Name to filter logs by. diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py new file mode 100644 index 000000000..86835a9b0 --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -0,0 +1,1629 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + FileUri, + FilePath, + SymbolType, + lsp_file_params, + lsp_formatting_params, + lsp_references_params, + lsp_diagnostics_params, + lsp_code_actions_params, + lsp_file_definition_params, + lsp_document_symbols_params, + lsp_apply_code_action_params, + lsp_get_signature_help_params, + lsp_set_watch_directory_params, + lsp_get_code_segment_info_params, + lsp_get_code_actions_for_diagnostic_params, +) +from ...types.devboxes.file_uri import FileUri +from ...types.devboxes.file_path import FilePath +from ...types.devboxes.range_param import RangeParam +from ...types.devboxes.symbol_type import SymbolType +from ...types.devboxes.base_command_param import BaseCommandParam +from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.diagnostics_response import DiagnosticsResponse +from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.file_contents_response import FileContentsResponse +from ...types.devboxes.health_status_response import HealthStatusResponse +from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam +from ...types.devboxes.code_action_context_param import CodeActionContextParam +from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse + +__all__ = ["LspResource", "AsyncLspResource"] + + +class LspResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> LspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return LspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> LspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return LspResourceWithStreamingResponse(self) + + def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=CodeActionApplicationResult, + ) + + def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=object, + ) + + def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=DiagnosticsResponse, + ) + + def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=object, + ) + + def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file", + body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=FileContentsResponse, + ) + + def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=object, + ) + + def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=object, + ) + + def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=CodeSegmentInfoResponse, + ) + + def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=SignatureHelpResponse, + ) + + def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/references", + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=object, + ) + + def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=str, + ) + + +class AsyncLspResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncLspResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncLspResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncLspResourceWithStreamingResponse(self) + + async def apply_code_action( + self, + id: str, + *, + title: str, + command: BaseCommandParam | NotGiven = NOT_GIVEN, + edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, + is_preferred: bool | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> CodeActionApplicationResult: + """ + Apply a code action to a given code segment not all code actions are supported + yet + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/apply-code-action", + body=await async_maybe_transform( + { + "title": title, + "command": command, + "edit": edit, + "is_preferred": is_preferred, + }, + lsp_apply_code_action_params.LspApplyCodeActionParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=CodeActionApplicationResult, + ) + + async def code_actions( + self, + id: str, + *, + uri: str, + context: CodeActionContextParam | NotGiven = NOT_GIVEN, + range: RangeParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> object: + """Get code actions for a part of a document. + + This method calls the + `getCodeActions` method of the `LanguageService` class, which in turn + communicates with the TypeScript language server to retrieve code actions for a + given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction + + Args: + context: Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + + range: A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/code-actions", + body=await async_maybe_transform( + { + "uri": uri, + "context": context, + "range": range, + }, + lsp_code_actions_params.LspCodeActionsParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=object, + ) + + async def diagnostics( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> DiagnosticsResponse: + """ + Get diagnostics for a given file URI from the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/diagnostics", + body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=DiagnosticsResponse, + ) + + async def document_symbols( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> object: + """ + Get document symbols for a given document. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/document-symbols", + body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=object, + ) + + async def file( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> FileContentsResponse: + """ + Get the contents of a file at a given path relative to the root directory + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file", + body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=FileContentsResponse, + ) + + async def file_definition( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> object: + """ + Get the definition of a symbol at a given position in a file + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/file-definition", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=object, + ) + + async def files( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LspFilesResponse: + """ + Get a list of all files being watched by the language server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/files", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LspFilesResponse, + ) + + async def formatting( + self, + id: str, + *, + uri: FileUri, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> object: + """ + Get formatting changes for a given document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/formatting", + body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=object, + ) + + async def get_code_actions_for_diagnostic( + self, + id: str, + *, + diagnostic: BaseDiagnosticParam, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> LspGetCodeActionsForDiagnosticResponse: + """ + Get a list of code actions for a given diagnostic + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", + body=await async_maybe_transform( + { + "diagnostic": diagnostic, + "uri": uri, + }, + lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=LspGetCodeActionsForDiagnosticResponse, + ) + + async def get_code_segment_info( + self, + id: str, + *, + symbol_name: str, + uri: FileUri, + symbol_type: SymbolType | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> CodeSegmentInfoResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-code-segment-info", + body=await async_maybe_transform( + { + "symbol_name": symbol_name, + "uri": uri, + "symbol_type": symbol_type, + }, + lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=CodeSegmentInfoResponse, + ) + + async def get_signature_help( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> SignatureHelpResponse: + """ + Get the symbol, reference, and diagnostic information for a given code segment + in a file at a given depth + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/get-signature-help", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=SignatureHelpResponse, + ) + + async def health( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> HealthStatusResponse: + """ + This method provides a health check for the language server, including its + status, uptime, the directory being watched, and the name of the module. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/lsp/health", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=HealthStatusResponse, + ) + + async def references( + self, + id: str, + *, + character: float, + line: float, + uri: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> object: + """Get references for a given symbol. + + This method calls the `getReferences` method + of the `LanguageService` class, which in turn communicates with the TypeScript + language server to retrieve references for a given symbol in the document. + https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/references", + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=object, + ) + + async def set_watch_directory( + self, + id: str, + *, + path: FilePath, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> str: + """ + Set the watch directory for the language server to a new path and restart the + server + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/lsp/set-watch-directory", + body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=str, + ) + + +class LspResourceWithRawResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = to_raw_response_wrapper( + lsp.files, + ) + self.formatting = to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_raw_response_wrapper( + lsp.health, + ) + self.references = to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithRawResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_raw_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_raw_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_raw_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_raw_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_raw_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_raw_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_raw_response_wrapper( + lsp.files, + ) + self.formatting = async_to_raw_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_raw_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_raw_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_raw_response_wrapper( + lsp.health, + ) + self.references = async_to_raw_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_raw_response_wrapper( + lsp.set_watch_directory, + ) + + +class LspResourceWithStreamingResponse: + def __init__(self, lsp: LspResource) -> None: + self._lsp = lsp + + self.apply_code_action = to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = to_streamed_response_wrapper( + lsp.health, + ) + self.references = to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = to_streamed_response_wrapper( + lsp.set_watch_directory, + ) + + +class AsyncLspResourceWithStreamingResponse: + def __init__(self, lsp: AsyncLspResource) -> None: + self._lsp = lsp + + self.apply_code_action = async_to_streamed_response_wrapper( + lsp.apply_code_action, + ) + self.code_actions = async_to_streamed_response_wrapper( + lsp.code_actions, + ) + self.diagnostics = async_to_streamed_response_wrapper( + lsp.diagnostics, + ) + self.document_symbols = async_to_streamed_response_wrapper( + lsp.document_symbols, + ) + self.file = async_to_streamed_response_wrapper( + lsp.file, + ) + self.file_definition = async_to_streamed_response_wrapper( + lsp.file_definition, + ) + self.files = async_to_streamed_response_wrapper( + lsp.files, + ) + self.formatting = async_to_streamed_response_wrapper( + lsp.formatting, + ) + self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( + lsp.get_code_actions_for_diagnostic, + ) + self.get_code_segment_info = async_to_streamed_response_wrapper( + lsp.get_code_segment_info, + ) + self.get_signature_help = async_to_streamed_response_wrapper( + lsp.get_signature_help, + ) + self.health = async_to_streamed_response_wrapper( + lsp.health, + ) + self.references = async_to_streamed_response_wrapper( + lsp.references, + ) + self.set_watch_directory = async_to_streamed_response_wrapper( + lsp.set_watch_directory, + ) diff --git a/src/runloop_api_client/resources/functions/__init__.py b/src/runloop_api_client/resources/functions/__init__.py deleted file mode 100644 index b33636e15..000000000 --- a/src/runloop_api_client/resources/functions/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .functions import ( - FunctionsResource, - AsyncFunctionsResource, - FunctionsResourceWithRawResponse, - AsyncFunctionsResourceWithRawResponse, - FunctionsResourceWithStreamingResponse, - AsyncFunctionsResourceWithStreamingResponse, -) -from .invocations import ( - InvocationsResource, - AsyncInvocationsResource, - InvocationsResourceWithRawResponse, - AsyncInvocationsResourceWithRawResponse, - InvocationsResourceWithStreamingResponse, - AsyncInvocationsResourceWithStreamingResponse, -) - -__all__ = [ - "InvocationsResource", - "AsyncInvocationsResource", - "InvocationsResourceWithRawResponse", - "AsyncInvocationsResourceWithRawResponse", - "InvocationsResourceWithStreamingResponse", - "AsyncInvocationsResourceWithStreamingResponse", - "FunctionsResource", - "AsyncFunctionsResource", - "FunctionsResourceWithRawResponse", - "AsyncFunctionsResourceWithRawResponse", - "FunctionsResourceWithStreamingResponse", - "AsyncFunctionsResourceWithStreamingResponse", -] diff --git a/src/runloop_api_client/resources/functions/functions.py b/src/runloop_api_client/resources/functions/functions.py deleted file mode 100644 index 5c771a8c9..000000000 --- a/src/runloop_api_client/resources/functions/functions.py +++ /dev/null @@ -1,395 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ...types import function_invoke_sync_params, function_invoke_async_params -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from .invocations import ( - InvocationsResource, - AsyncInvocationsResource, - InvocationsResourceWithRawResponse, - AsyncInvocationsResourceWithRawResponse, - InvocationsResourceWithStreamingResponse, - AsyncInvocationsResourceWithStreamingResponse, -) -from ..._base_client import make_request_options -from ...types.function_list_view import FunctionListView -from ...types.shared.function_invocation_execution_detail_view import FunctionInvocationExecutionDetailView - -__all__ = ["FunctionsResource", "AsyncFunctionsResource"] - - -class FunctionsResource(SyncAPIResource): - @cached_property - def invocations(self) -> InvocationsResource: - return InvocationsResource(self._client) - - @cached_property - def with_raw_response(self) -> FunctionsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return FunctionsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> FunctionsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return FunctionsResourceWithStreamingResponse(self) - - def list( - self, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionListView: - """List the functions that are available for invocation.""" - return self._get( - "/v1/functions", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FunctionListView, - ) - - def invoke_async( - self, - function_name: str, - *, - project_name: str, - request: object, - runloop_meta: function_invoke_async_params.RunloopMeta | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvocationExecutionDetailView: - """Invoke the remote function asynchronously. - - This will return a job id that can be - used to query the status of the function invocation. - - Args: - request: Json of the request - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not project_name: - raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}") - if not function_name: - raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}") - return self._post( - f"/v1/functions/{project_name}/{function_name}/invoke_async", - body=maybe_transform( - { - "request": request, - "runloop_meta": runloop_meta, - }, - function_invoke_async_params.FunctionInvokeAsyncParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FunctionInvocationExecutionDetailView, - ) - - def invoke_sync( - self, - function_name: str, - *, - project_name: str, - request: object, - runloop_meta: function_invoke_sync_params.RunloopMeta | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvocationExecutionDetailView: - """Invoke the remote function synchronously. - - This will block until the function - completes and return the result. If the function call takes too long, the - request will timeout. - - Args: - request: Json of the request - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not project_name: - raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}") - if not function_name: - raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}") - return self._post( - f"/v1/functions/{project_name}/{function_name}/invoke_sync", - body=maybe_transform( - { - "request": request, - "runloop_meta": runloop_meta, - }, - function_invoke_sync_params.FunctionInvokeSyncParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FunctionInvocationExecutionDetailView, - ) - - -class AsyncFunctionsResource(AsyncAPIResource): - @cached_property - def invocations(self) -> AsyncInvocationsResource: - return AsyncInvocationsResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncFunctionsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncFunctionsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncFunctionsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncFunctionsResourceWithStreamingResponse(self) - - async def list( - self, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionListView: - """List the functions that are available for invocation.""" - return await self._get( - "/v1/functions", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FunctionListView, - ) - - async def invoke_async( - self, - function_name: str, - *, - project_name: str, - request: object, - runloop_meta: function_invoke_async_params.RunloopMeta | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvocationExecutionDetailView: - """Invoke the remote function asynchronously. - - This will return a job id that can be - used to query the status of the function invocation. - - Args: - request: Json of the request - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not project_name: - raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}") - if not function_name: - raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}") - return await self._post( - f"/v1/functions/{project_name}/{function_name}/invoke_async", - body=await async_maybe_transform( - { - "request": request, - "runloop_meta": runloop_meta, - }, - function_invoke_async_params.FunctionInvokeAsyncParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FunctionInvocationExecutionDetailView, - ) - - async def invoke_sync( - self, - function_name: str, - *, - project_name: str, - request: object, - runloop_meta: function_invoke_sync_params.RunloopMeta | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvocationExecutionDetailView: - """Invoke the remote function synchronously. - - This will block until the function - completes and return the result. If the function call takes too long, the - request will timeout. - - Args: - request: Json of the request - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not project_name: - raise ValueError(f"Expected a non-empty value for `project_name` but received {project_name!r}") - if not function_name: - raise ValueError(f"Expected a non-empty value for `function_name` but received {function_name!r}") - return await self._post( - f"/v1/functions/{project_name}/{function_name}/invoke_sync", - body=await async_maybe_transform( - { - "request": request, - "runloop_meta": runloop_meta, - }, - function_invoke_sync_params.FunctionInvokeSyncParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FunctionInvocationExecutionDetailView, - ) - - -class FunctionsResourceWithRawResponse: - def __init__(self, functions: FunctionsResource) -> None: - self._functions = functions - - self.list = to_raw_response_wrapper( - functions.list, - ) - self.invoke_async = to_raw_response_wrapper( - functions.invoke_async, - ) - self.invoke_sync = to_raw_response_wrapper( - functions.invoke_sync, - ) - - @cached_property - def invocations(self) -> InvocationsResourceWithRawResponse: - return InvocationsResourceWithRawResponse(self._functions.invocations) - - -class AsyncFunctionsResourceWithRawResponse: - def __init__(self, functions: AsyncFunctionsResource) -> None: - self._functions = functions - - self.list = async_to_raw_response_wrapper( - functions.list, - ) - self.invoke_async = async_to_raw_response_wrapper( - functions.invoke_async, - ) - self.invoke_sync = async_to_raw_response_wrapper( - functions.invoke_sync, - ) - - @cached_property - def invocations(self) -> AsyncInvocationsResourceWithRawResponse: - return AsyncInvocationsResourceWithRawResponse(self._functions.invocations) - - -class FunctionsResourceWithStreamingResponse: - def __init__(self, functions: FunctionsResource) -> None: - self._functions = functions - - self.list = to_streamed_response_wrapper( - functions.list, - ) - self.invoke_async = to_streamed_response_wrapper( - functions.invoke_async, - ) - self.invoke_sync = to_streamed_response_wrapper( - functions.invoke_sync, - ) - - @cached_property - def invocations(self) -> InvocationsResourceWithStreamingResponse: - return InvocationsResourceWithStreamingResponse(self._functions.invocations) - - -class AsyncFunctionsResourceWithStreamingResponse: - def __init__(self, functions: AsyncFunctionsResource) -> None: - self._functions = functions - - self.list = async_to_streamed_response_wrapper( - functions.list, - ) - self.invoke_async = async_to_streamed_response_wrapper( - functions.invoke_async, - ) - self.invoke_sync = async_to_streamed_response_wrapper( - functions.invoke_sync, - ) - - @cached_property - def invocations(self) -> AsyncInvocationsResourceWithStreamingResponse: - return AsyncInvocationsResourceWithStreamingResponse(self._functions.invocations) diff --git a/src/runloop_api_client/resources/functions/invocations.py b/src/runloop_api_client/resources/functions/invocations.py deleted file mode 100644 index d9a72c12e..000000000 --- a/src/runloop_api_client/resources/functions/invocations.py +++ /dev/null @@ -1,357 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.functions import invocation_list_params -from ...types.functions.function_invocation_list_view import FunctionInvocationListView -from ...types.shared.function_invocation_execution_detail_view import FunctionInvocationExecutionDetailView - -__all__ = ["InvocationsResource", "AsyncInvocationsResource"] - - -class InvocationsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> InvocationsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return InvocationsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> InvocationsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return InvocationsResourceWithStreamingResponse(self) - - def retrieve( - self, - invocation_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvocationExecutionDetailView: - """Get the details of a function invocation. - - This includes the status, response, - and error message. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not invocation_id: - raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}") - return self._get( - f"/v1/functions/invocations/{invocation_id}", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FunctionInvocationExecutionDetailView, - ) - - def list( - self, - *, - limit: int | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvocationListView: - """ - List the functions invocations that are available for invocation. - - Args: - limit: Page Limit - - starting_after: Load the next page starting after the given token. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get( - "/v1/functions/invocations", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "limit": limit, - "starting_after": starting_after, - }, - invocation_list_params.InvocationListParams, - ), - ), - cast_to=FunctionInvocationListView, - ) - - def kill( - self, - invocation_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Kill the invocation with the given ID. - - This will stop the function execution. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not invocation_id: - raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}") - return self._post( - f"/v1/functions/invocations/{invocation_id}/kill", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - -class AsyncInvocationsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncInvocationsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncInvocationsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncInvocationsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncInvocationsResourceWithStreamingResponse(self) - - async def retrieve( - self, - invocation_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvocationExecutionDetailView: - """Get the details of a function invocation. - - This includes the status, response, - and error message. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not invocation_id: - raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}") - return await self._get( - f"/v1/functions/invocations/{invocation_id}", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=FunctionInvocationExecutionDetailView, - ) - - async def list( - self, - *, - limit: int | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FunctionInvocationListView: - """ - List the functions invocations that are available for invocation. - - Args: - limit: Page Limit - - starting_after: Load the next page starting after the given token. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return await self._get( - "/v1/functions/invocations", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=await async_maybe_transform( - { - "limit": limit, - "starting_after": starting_after, - }, - invocation_list_params.InvocationListParams, - ), - ), - cast_to=FunctionInvocationListView, - ) - - async def kill( - self, - invocation_id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> object: - """Kill the invocation with the given ID. - - This will stop the function execution. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not invocation_id: - raise ValueError(f"Expected a non-empty value for `invocation_id` but received {invocation_id!r}") - return await self._post( - f"/v1/functions/invocations/{invocation_id}/kill", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=object, - ) - - -class InvocationsResourceWithRawResponse: - def __init__(self, invocations: InvocationsResource) -> None: - self._invocations = invocations - - self.retrieve = to_raw_response_wrapper( - invocations.retrieve, - ) - self.list = to_raw_response_wrapper( - invocations.list, - ) - self.kill = to_raw_response_wrapper( - invocations.kill, - ) - - -class AsyncInvocationsResourceWithRawResponse: - def __init__(self, invocations: AsyncInvocationsResource) -> None: - self._invocations = invocations - - self.retrieve = async_to_raw_response_wrapper( - invocations.retrieve, - ) - self.list = async_to_raw_response_wrapper( - invocations.list, - ) - self.kill = async_to_raw_response_wrapper( - invocations.kill, - ) - - -class InvocationsResourceWithStreamingResponse: - def __init__(self, invocations: InvocationsResource) -> None: - self._invocations = invocations - - self.retrieve = to_streamed_response_wrapper( - invocations.retrieve, - ) - self.list = to_streamed_response_wrapper( - invocations.list, - ) - self.kill = to_streamed_response_wrapper( - invocations.kill, - ) - - -class AsyncInvocationsResourceWithStreamingResponse: - def __init__(self, invocations: AsyncInvocationsResource) -> None: - self._invocations = invocations - - self.retrieve = async_to_streamed_response_wrapper( - invocations.retrieve, - ) - self.list = async_to_streamed_response_wrapper( - invocations.list, - ) - self.kill = async_to_streamed_response_wrapper( - invocations.kill, - ) diff --git a/src/runloop_api_client/resources/projects/__init__.py b/src/runloop_api_client/resources/projects/__init__.py deleted file mode 100644 index a6513e74d..000000000 --- a/src/runloop_api_client/resources/projects/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .logs import ( - LogsResource, - AsyncLogsResource, - LogsResourceWithRawResponse, - AsyncLogsResourceWithRawResponse, - LogsResourceWithStreamingResponse, - AsyncLogsResourceWithStreamingResponse, -) -from .projects import ( - ProjectsResource, - AsyncProjectsResource, - ProjectsResourceWithRawResponse, - AsyncProjectsResourceWithRawResponse, - ProjectsResourceWithStreamingResponse, - AsyncProjectsResourceWithStreamingResponse, -) - -__all__ = [ - "LogsResource", - "AsyncLogsResource", - "LogsResourceWithRawResponse", - "AsyncLogsResourceWithRawResponse", - "LogsResourceWithStreamingResponse", - "AsyncLogsResourceWithStreamingResponse", - "ProjectsResource", - "AsyncProjectsResource", - "ProjectsResourceWithRawResponse", - "AsyncProjectsResourceWithRawResponse", - "ProjectsResourceWithStreamingResponse", - "AsyncProjectsResourceWithStreamingResponse", -] diff --git a/src/runloop_api_client/resources/projects/logs.py b/src/runloop_api_client/resources/projects/logs.py deleted file mode 100644 index 8925b3025..000000000 --- a/src/runloop_api_client/resources/projects/logs.py +++ /dev/null @@ -1,163 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.shared.project_logs_view import ProjectLogsView - -__all__ = ["LogsResource", "AsyncLogsResource"] - - -class LogsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LogsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LogsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LogsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LogsResourceWithStreamingResponse(self) - - def list( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectLogsView: - """ - Get list of all logs from a project. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/projects/{id}/logs", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=ProjectLogsView, - ) - - -class AsyncLogsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLogsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLogsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLogsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLogsResourceWithStreamingResponse(self) - - async def list( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectLogsView: - """ - Get list of all logs from a project. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/projects/{id}/logs", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=ProjectLogsView, - ) - - -class LogsResourceWithRawResponse: - def __init__(self, logs: LogsResource) -> None: - self._logs = logs - - self.list = to_raw_response_wrapper( - logs.list, - ) - - -class AsyncLogsResourceWithRawResponse: - def __init__(self, logs: AsyncLogsResource) -> None: - self._logs = logs - - self.list = async_to_raw_response_wrapper( - logs.list, - ) - - -class LogsResourceWithStreamingResponse: - def __init__(self, logs: LogsResource) -> None: - self._logs = logs - - self.list = to_streamed_response_wrapper( - logs.list, - ) - - -class AsyncLogsResourceWithStreamingResponse: - def __init__(self, logs: AsyncLogsResource) -> None: - self._logs = logs - - self.list = async_to_streamed_response_wrapper( - logs.list, - ) diff --git a/src/runloop_api_client/resources/projects/projects.py b/src/runloop_api_client/resources/projects/projects.py deleted file mode 100644 index 259b2c10a..000000000 --- a/src/runloop_api_client/resources/projects/projects.py +++ /dev/null @@ -1,175 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from .logs import ( - LogsResource, - AsyncLogsResource, - LogsResourceWithRawResponse, - AsyncLogsResourceWithRawResponse, - LogsResourceWithStreamingResponse, - AsyncLogsResourceWithStreamingResponse, -) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.project_list_view import ProjectListView - -__all__ = ["ProjectsResource", "AsyncProjectsResource"] - - -class ProjectsResource(SyncAPIResource): - @cached_property - def logs(self) -> LogsResource: - return LogsResource(self._client) - - @cached_property - def with_raw_response(self) -> ProjectsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return ProjectsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> ProjectsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return ProjectsResourceWithStreamingResponse(self) - - def list( - self, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectListView: - """Get list of all projects for the authenticated user. - - This includes all projects - that the user has access to. - """ - return self._get( - "/v1/projects", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=ProjectListView, - ) - - -class AsyncProjectsResource(AsyncAPIResource): - @cached_property - def logs(self) -> AsyncLogsResource: - return AsyncLogsResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncProjectsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return the - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncProjectsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncProjectsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncProjectsResourceWithStreamingResponse(self) - - async def list( - self, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ProjectListView: - """Get list of all projects for the authenticated user. - - This includes all projects - that the user has access to. - """ - return await self._get( - "/v1/projects", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=ProjectListView, - ) - - -class ProjectsResourceWithRawResponse: - def __init__(self, projects: ProjectsResource) -> None: - self._projects = projects - - self.list = to_raw_response_wrapper( - projects.list, - ) - - @cached_property - def logs(self) -> LogsResourceWithRawResponse: - return LogsResourceWithRawResponse(self._projects.logs) - - -class AsyncProjectsResourceWithRawResponse: - def __init__(self, projects: AsyncProjectsResource) -> None: - self._projects = projects - - self.list = async_to_raw_response_wrapper( - projects.list, - ) - - @cached_property - def logs(self) -> AsyncLogsResourceWithRawResponse: - return AsyncLogsResourceWithRawResponse(self._projects.logs) - - -class ProjectsResourceWithStreamingResponse: - def __init__(self, projects: ProjectsResource) -> None: - self._projects = projects - - self.list = to_streamed_response_wrapper( - projects.list, - ) - - @cached_property - def logs(self) -> LogsResourceWithStreamingResponse: - return LogsResourceWithStreamingResponse(self._projects.logs) - - -class AsyncProjectsResourceWithStreamingResponse: - def __init__(self, projects: AsyncProjectsResource) -> None: - self._projects = projects - - self.list = async_to_streamed_response_wrapper( - projects.list, - ) - - @cached_property - def logs(self) -> AsyncLogsResourceWithStreamingResponse: - return AsyncLogsResourceWithStreamingResponse(self._projects.logs) diff --git a/src/runloop_api_client/resources/repositories.py b/src/runloop_api_client/resources/repositories.py new file mode 100644 index 000000000..c65b4133b --- /dev/null +++ b/src/runloop_api_client/resources/repositories.py @@ -0,0 +1,566 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..types import repository_list_params, repository_create_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import ( + maybe_transform, + async_maybe_transform, +) +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..pagination import SyncRepositoriesCursorIDPage, AsyncRepositoriesCursorIDPage +from .._base_client import AsyncPaginator, make_request_options +from ..types.repository_connection_view import RepositoryConnectionView +from ..types.repository_version_list_view import RepositoryVersionListView + +__all__ = ["RepositoriesResource", "AsyncRepositoriesResource"] + + +class RepositoriesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> RepositoriesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return RepositoriesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> RepositoriesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return RepositoriesResourceWithStreamingResponse(self) + + def create( + self, + *, + name: str, + owner: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> RepositoryConnectionView: + """ + Create a connection to a Github Repository and trigger an initial inspection of + the repo's technical stack and developer environment requirements. + + Args: + name: Name of the repository. + + owner: Account owner of the repository. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/v1/repositories", + body=maybe_transform( + { + "name": name, + "owner": owner, + }, + repository_create_params.RepositoryCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=RepositoryConnectionView, + ) + + def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RepositoryConnectionView: + """ + Get Repository Connection details including latest inspection status and + generated respository insights. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/repositories/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RepositoryConnectionView, + ) + + def list( + self, + *, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncRepositoriesCursorIDPage[RepositoryConnectionView]: + """ + List all available repository connections. + + Args: + limit: The limit of items to return. Default is 20. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/repositories", + page=SyncRepositoriesCursorIDPage[RepositoryConnectionView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + repository_list_params.RepositoryListParams, + ), + ), + model=RepositoryConnectionView, + ) + + def delete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> object: + """ + Permanently Delete a Repository Connection including any automatically generated + inspection insights. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/repositories/{id}/delete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=object, + ) + + def versions( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RepositoryVersionListView: + """ + List all analyzed versions of a repository connection including automatically + generated insights for each version. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/repositories/{id}/versions", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RepositoryVersionListView, + ) + + +class AsyncRepositoriesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncRepositoriesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return the + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncRepositoriesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRepositoriesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncRepositoriesResourceWithStreamingResponse(self) + + async def create( + self, + *, + name: str, + owner: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> RepositoryConnectionView: + """ + Create a connection to a Github Repository and trigger an initial inspection of + the repo's technical stack and developer environment requirements. + + Args: + name: Name of the repository. + + owner: Account owner of the repository. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/v1/repositories", + body=await async_maybe_transform( + { + "name": name, + "owner": owner, + }, + repository_create_params.RepositoryCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=RepositoryConnectionView, + ) + + async def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RepositoryConnectionView: + """ + Get Repository Connection details including latest inspection status and + generated respository insights. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/repositories/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RepositoryConnectionView, + ) + + def list( + self, + *, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[RepositoryConnectionView, AsyncRepositoriesCursorIDPage[RepositoryConnectionView]]: + """ + List all available repository connections. + + Args: + limit: The limit of items to return. Default is 20. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/repositories", + page=AsyncRepositoriesCursorIDPage[RepositoryConnectionView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + repository_list_params.RepositoryListParams, + ), + ), + model=RepositoryConnectionView, + ) + + async def delete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> object: + """ + Permanently Delete a Repository Connection including any automatically generated + inspection insights. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/repositories/{id}/delete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=object, + ) + + async def versions( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RepositoryVersionListView: + """ + List all analyzed versions of a repository connection including automatically + generated insights for each version. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/repositories/{id}/versions", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RepositoryVersionListView, + ) + + +class RepositoriesResourceWithRawResponse: + def __init__(self, repositories: RepositoriesResource) -> None: + self._repositories = repositories + + self.create = to_raw_response_wrapper( + repositories.create, + ) + self.retrieve = to_raw_response_wrapper( + repositories.retrieve, + ) + self.list = to_raw_response_wrapper( + repositories.list, + ) + self.delete = to_raw_response_wrapper( + repositories.delete, + ) + self.versions = to_raw_response_wrapper( + repositories.versions, + ) + + +class AsyncRepositoriesResourceWithRawResponse: + def __init__(self, repositories: AsyncRepositoriesResource) -> None: + self._repositories = repositories + + self.create = async_to_raw_response_wrapper( + repositories.create, + ) + self.retrieve = async_to_raw_response_wrapper( + repositories.retrieve, + ) + self.list = async_to_raw_response_wrapper( + repositories.list, + ) + self.delete = async_to_raw_response_wrapper( + repositories.delete, + ) + self.versions = async_to_raw_response_wrapper( + repositories.versions, + ) + + +class RepositoriesResourceWithStreamingResponse: + def __init__(self, repositories: RepositoriesResource) -> None: + self._repositories = repositories + + self.create = to_streamed_response_wrapper( + repositories.create, + ) + self.retrieve = to_streamed_response_wrapper( + repositories.retrieve, + ) + self.list = to_streamed_response_wrapper( + repositories.list, + ) + self.delete = to_streamed_response_wrapper( + repositories.delete, + ) + self.versions = to_streamed_response_wrapper( + repositories.versions, + ) + + +class AsyncRepositoriesResourceWithStreamingResponse: + def __init__(self, repositories: AsyncRepositoriesResource) -> None: + self._repositories = repositories + + self.create = async_to_streamed_response_wrapper( + repositories.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + repositories.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + repositories.list, + ) + self.delete = async_to_streamed_response_wrapper( + repositories.delete, + ) + self.versions = async_to_streamed_response_wrapper( + repositories.versions, + ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 1f6ecb59b..d5c58545b 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -4,42 +4,42 @@ from .shared import ( AfterIdle as AfterIdle, - ProjectLogsView as ProjectLogsView, LaunchParameters as LaunchParameters, - FunctionInvocationExecutionDetailView as FunctionInvocationExecutionDetailView, + CodeMountParameters as CodeMountParameters, ) from .devbox_view import DevboxView as DevboxView from .blueprint_view import BlueprintView as BlueprintView from .devbox_list_view import DevboxListView as DevboxListView -from .project_list_view import ProjectListView as ProjectListView from .devbox_list_params import DevboxListParams as DevboxListParams from .devbox_tunnel_view import DevboxTunnelView as DevboxTunnelView -from .function_list_view import FunctionListView as FunctionListView from .blueprint_build_log import BlueprintBuildLog as BlueprintBuildLog from .blueprint_list_view import BlueprintListView as BlueprintListView from .devbox_create_params import DevboxCreateParams as DevboxCreateParams from .devbox_snapshot_view import DevboxSnapshotView as DevboxSnapshotView from .blueprint_list_params import BlueprintListParams as BlueprintListParams -from .code_mount_parameters import CodeMountParameters as CodeMountParameters from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView +from .repository_list_params import RepositoryListParams as RepositoryListParams from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams -from .devbox_write_file_params import DevboxWriteFileParams as DevboxWriteFileParams +from .repository_create_params import RepositoryCreateParams as RepositoryCreateParams from .devbox_snapshot_list_view import DevboxSnapshotListView as DevboxSnapshotListView from .devbox_upload_file_params import DevboxUploadFileParams as DevboxUploadFileParams from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams -from .code_mount_parameters_param import CodeMountParametersParam as CodeMountParametersParam +from .repository_connection_view import RepositoryConnectionView as RepositoryConnectionView +from .repository_version_details import RepositoryVersionDetails as RepositoryVersionDetails from .devbox_create_tunnel_params import DevboxCreateTunnelParams as DevboxCreateTunnelParams from .devbox_download_file_params import DevboxDownloadFileParams as DevboxDownloadFileParams from .devbox_execute_async_params import DevboxExecuteAsyncParams as DevboxExecuteAsyncParams +from .devbox_remove_tunnel_params import DevboxRemoveTunnelParams as DevboxRemoveTunnelParams from .devbox_snapshot_disk_params import DevboxSnapshotDiskParams as DevboxSnapshotDiskParams -from .function_invoke_sync_params import FunctionInvokeSyncParams as FunctionInvokeSyncParams -from .devbox_disk_snapshots_params import DevboxDiskSnapshotsParams as DevboxDiskSnapshotsParams from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView -from .function_invoke_async_params import FunctionInvokeAsyncParams as FunctionInvokeAsyncParams +from .repository_version_list_view import RepositoryVersionListView as RepositoryVersionListView from .blueprint_build_logs_list_view import BlueprintBuildLogsListView as BlueprintBuildLogsListView from .devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse as DevboxCreateSSHKeyResponse +from .repository_connection_list_view import RepositoryConnectionListView as RepositoryConnectionListView from .devbox_read_file_contents_params import DevboxReadFileContentsParams as DevboxReadFileContentsParams +from .devbox_list_disk_snapshots_params import DevboxListDiskSnapshotsParams as DevboxListDiskSnapshotsParams +from .devbox_write_file_contents_params import DevboxWriteFileContentsParams as DevboxWriteFileContentsParams from .devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView as DevboxAsyncExecutionDetailView from .devbox_read_file_contents_response import DevboxReadFileContentsResponse as DevboxReadFileContentsResponse diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index cbd1f4fab..2ce8c69bd 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -3,8 +3,8 @@ from typing import Dict, List, Optional from .._models import BaseModel -from .code_mount_parameters import CodeMountParameters from .shared.launch_parameters import LaunchParameters +from .shared.code_mount_parameters import CodeMountParameters __all__ = ["BlueprintBuildParameters"] diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index f5468a881..b851ecdd4 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import Dict, List, Iterable +from typing import Dict, List, Iterable, Optional from typing_extensions import Required, TypedDict -from .code_mount_parameters_param import CodeMountParametersParam from .shared_params.launch_parameters import LaunchParameters +from .shared_params.code_mount_parameters import CodeMountParameters __all__ = ["BlueprintCreateParams"] @@ -15,17 +15,17 @@ class BlueprintCreateParams(TypedDict, total=False): name: Required[str] """Name of the Blueprint.""" - code_mounts: Iterable[CodeMountParametersParam] + code_mounts: Optional[Iterable[CodeMountParameters]] """A list of code mounts to be included in the Blueprint.""" - dockerfile: str + dockerfile: Optional[str] """Dockerfile contents to be used to build the Blueprint.""" - file_mounts: Dict[str, str] + file_mounts: Optional[Dict[str, str]] """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: LaunchParameters + launch_parameters: Optional[LaunchParameters] """Parameters to configure your Devbox at launch time.""" - system_setup_commands: List[str] + system_setup_commands: Optional[List[str]] """A list of commands to run to set up your system.""" diff --git a/src/runloop_api_client/types/blueprint_list_params.py b/src/runloop_api_client/types/blueprint_list_params.py index 20bb215cf..b0a3ade62 100644 --- a/src/runloop_api_client/types/blueprint_list_params.py +++ b/src/runloop_api_client/types/blueprint_list_params.py @@ -9,10 +9,10 @@ class BlueprintListParams(TypedDict, total=False): limit: int - """Page Limit""" + """The limit of items to return. Default is 20.""" name: str """Filter by name""" starting_after: str - """Load the next page starting after the given token.""" + """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index 5093e1549..20d1bcd17 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -2,11 +2,11 @@ from __future__ import annotations -from typing import Dict, List, Iterable +from typing import Dict, List, Iterable, Optional from typing_extensions import Required, TypedDict -from .code_mount_parameters_param import CodeMountParametersParam from .shared_params.launch_parameters import LaunchParameters +from .shared_params.code_mount_parameters import CodeMountParameters __all__ = ["BlueprintPreviewParams"] @@ -15,17 +15,17 @@ class BlueprintPreviewParams(TypedDict, total=False): name: Required[str] """Name of the Blueprint.""" - code_mounts: Iterable[CodeMountParametersParam] + code_mounts: Optional[Iterable[CodeMountParameters]] """A list of code mounts to be included in the Blueprint.""" - dockerfile: str + dockerfile: Optional[str] """Dockerfile contents to be used to build the Blueprint.""" - file_mounts: Dict[str, str] + file_mounts: Optional[Dict[str, str]] """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: LaunchParameters + launch_parameters: Optional[LaunchParameters] """Parameters to configure your Devbox at launch time.""" - system_setup_commands: List[str] + system_setup_commands: Optional[List[str]] """A list of commands to run to set up your system.""" diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 68ffc9bba..51f405ed5 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -2,56 +2,64 @@ from __future__ import annotations -from typing import Dict, Iterable +from typing import Dict, Iterable, Optional from typing_extensions import TypedDict -from .code_mount_parameters_param import CodeMountParametersParam from .shared_params.launch_parameters import LaunchParameters +from .shared_params.code_mount_parameters import CodeMountParameters __all__ = ["DevboxCreateParams"] class DevboxCreateParams(TypedDict, total=False): - blueprint_id: str - """(Optional) Blueprint to use for the Devbox. + blueprint_id: Optional[str] + """Blueprint ID to use for the Devbox. If none set, the Devbox will be created with the default Runloop Devbox image. + Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified. """ - blueprint_name: str - """(Optional) Name of Blueprint to use for the Devbox. + blueprint_name: Optional[str] + """Name of Blueprint to use for the Devbox. When set, this will load the latest successfully built Blueprint with the given - name. + name. Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be + specified. """ - code_mounts: Iterable[CodeMountParametersParam] + code_mounts: Optional[Iterable[CodeMountParameters]] """A list of code mounts to be included in the Devbox.""" - entrypoint: str + entrypoint: Optional[str] """ (Optional) When specified, the Devbox will run this script as its main executable. The devbox lifecycle will be bound to entrypoint, shutting down when the process is complete. """ - environment_variables: Dict[str, str] + environment_variables: Optional[Dict[str, str]] """(Optional) Environment variables used to configure your Devbox.""" - file_mounts: Dict[str, str] + file_mounts: Optional[Dict[str, str]] """(Optional) Map of paths and file contents to write before setup..""" - launch_parameters: LaunchParameters + launch_parameters: Optional[LaunchParameters] """Parameters to configure the resources and launch time behavior of the Devbox.""" - metadata: Dict[str, str] + metadata: Optional[Dict[str, str]] """User defined metadata to attach to the devbox for organization.""" - name: str + name: Optional[str] """(Optional) A user specified name to give the Devbox.""" - prebuilt: str - """Reference to prebuilt Blueprint.""" + prebuilt: Optional[str] + """Reference to prebuilt Blueprint to create the Devbox from. - snapshot_id: str - """Snapshot ID to use for the Devbox.""" + Should not be used together with (Snapshot ID, Blueprint ID, or Blueprint name). + """ + + snapshot_id: Optional[str] + """Snapshot ID to use for the Devbox. + + Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified. + """ diff --git a/src/runloop_api_client/types/devbox_create_ssh_key_response.py b/src/runloop_api_client/types/devbox_create_ssh_key_response.py index 584ce6029..90746ab31 100755 --- a/src/runloop_api_client/types/devbox_create_ssh_key_response.py +++ b/src/runloop_api_client/types/devbox_create_ssh_key_response.py @@ -8,10 +8,10 @@ class DevboxCreateSSHKeyResponse(BaseModel): id: str - """The id of the Devbox.""" + """The ID of the Devbox.""" ssh_private_key: str """The ssh private key, in PEM format.""" url: str - """The url of the Devbox.""" + """The host url of the Devbox that can be used for SSH.""" diff --git a/src/runloop_api_client/types/devbox_disk_snapshots_params.py b/src/runloop_api_client/types/devbox_disk_snapshots_params.py deleted file mode 100644 index adb37cc8d..000000000 --- a/src/runloop_api_client/types/devbox_disk_snapshots_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["DevboxDiskSnapshotsParams"] - - -class DevboxDiskSnapshotsParams(TypedDict, total=False): - limit: int - """Page Limit""" - - starting_after: str - """Load the next page starting after the given token.""" diff --git a/src/runloop_api_client/types/devbox_download_file_params.py b/src/runloop_api_client/types/devbox_download_file_params.py index f5fa7409a..fb0566329 100644 --- a/src/runloop_api_client/types/devbox_download_file_params.py +++ b/src/runloop_api_client/types/devbox_download_file_params.py @@ -9,4 +9,7 @@ class DevboxDownloadFileParams(TypedDict, total=False): path: Required[str] - """The path on the devbox to read the file""" + """The path on the Devbox filesystem to read the file from. + + Path is relative to user home directory. + """ diff --git a/src/runloop_api_client/types/devbox_execute_async_params.py b/src/runloop_api_client/types/devbox_execute_async_params.py index bae2d77b1..f4d0280b8 100644 --- a/src/runloop_api_client/types/devbox_execute_async_params.py +++ b/src/runloop_api_client/types/devbox_execute_async_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, TypedDict __all__ = ["DevboxExecuteAsyncParams"] @@ -9,7 +10,16 @@ class DevboxExecuteAsyncParams(TypedDict, total=False): command: Required[str] - """The command to execute on the Devbox.""" + """The command to execute via the Devbox shell. - shell_name: str - """Which named shell to run the command in.""" + By default, commands are run from the user home directory unless shell_name is + specified. If shell_name is specified the command is run from the directory + based on the recent state of the persistent shell. + """ + + shell_name: Optional[str] + """The name of the persistent shell to create or use if already created. + + When using a persistent shell, the command will run from the directory at the + end of the previous command and environment variables will be preserved. + """ diff --git a/src/runloop_api_client/types/devbox_execute_sync_params.py b/src/runloop_api_client/types/devbox_execute_sync_params.py index e64d50965..1a873032c 100644 --- a/src/runloop_api_client/types/devbox_execute_sync_params.py +++ b/src/runloop_api_client/types/devbox_execute_sync_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, TypedDict __all__ = ["DevboxExecuteSyncParams"] @@ -9,7 +10,16 @@ class DevboxExecuteSyncParams(TypedDict, total=False): command: Required[str] - """The command to execute on the Devbox.""" + """The command to execute via the Devbox shell. - shell_name: str - """Which named shell to run the command in.""" + By default, commands are run from the user home directory unless shell_name is + specified. If shell_name is specified the command is run from the directory + based on the recent state of the persistent shell. + """ + + shell_name: Optional[str] + """The name of the persistent shell to create or use if already created. + + When using a persistent shell, the command will run from the directory at the + end of the previous command and environment variables will be preserved. + """ diff --git a/src/runloop_api_client/types/devbox_list_disk_snapshots_params.py b/src/runloop_api_client/types/devbox_list_disk_snapshots_params.py new file mode 100644 index 000000000..7676c1de9 --- /dev/null +++ b/src/runloop_api_client/types/devbox_list_disk_snapshots_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["DevboxListDiskSnapshotsParams"] + + +class DevboxListDiskSnapshotsParams(TypedDict, total=False): + devbox_id: str + """Devbox ID to filter by.""" + + limit: int + """The limit of items to return. Default is 20.""" + + starting_after: str + """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/devbox_list_params.py b/src/runloop_api_client/types/devbox_list_params.py index b39d3a795..066b2ed85 100644 --- a/src/runloop_api_client/types/devbox_list_params.py +++ b/src/runloop_api_client/types/devbox_list_params.py @@ -2,17 +2,19 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Literal, TypedDict __all__ = ["DevboxListParams"] class DevboxListParams(TypedDict, total=False): limit: int - """Page Limit""" + """The limit of items to return. Default is 20.""" starting_after: str - """Load the next page starting after the given token.""" + """Load the next page of data starting after the item with the given ID.""" - status: str + status: Literal[ + "provisioning", "initializing", "running", "suspending", "suspended", "resuming", "failure", "shutdown" + ] """Filter by status""" diff --git a/src/runloop_api_client/types/devbox_read_file_contents_params.py b/src/runloop_api_client/types/devbox_read_file_contents_params.py index 9405fc4a7..04d364fa3 100644 --- a/src/runloop_api_client/types/devbox_read_file_contents_params.py +++ b/src/runloop_api_client/types/devbox_read_file_contents_params.py @@ -9,4 +9,7 @@ class DevboxReadFileContentsParams(TypedDict, total=False): file_path: Required[str] - """The path of the file to read.""" + """The path on the Devbox filesystem to read the file from. + + Path is relative to user home directory. + """ diff --git a/src/runloop_api_client/types/devbox_remove_tunnel_params.py b/src/runloop_api_client/types/devbox_remove_tunnel_params.py new file mode 100644 index 000000000..eb58e2702 --- /dev/null +++ b/src/runloop_api_client/types/devbox_remove_tunnel_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["DevboxRemoveTunnelParams"] + + +class DevboxRemoveTunnelParams(TypedDict, total=False): + port: Required[int] + """Devbox port that tunnel will expose.""" diff --git a/src/runloop_api_client/types/devbox_snapshot_disk_params.py b/src/runloop_api_client/types/devbox_snapshot_disk_params.py index ed30fa14d..67bf5ec9d 100644 --- a/src/runloop_api_client/types/devbox_snapshot_disk_params.py +++ b/src/runloop_api_client/types/devbox_snapshot_disk_params.py @@ -2,15 +2,15 @@ from __future__ import annotations -from typing import Dict +from typing import Dict, Optional from typing_extensions import TypedDict __all__ = ["DevboxSnapshotDiskParams"] class DevboxSnapshotDiskParams(TypedDict, total=False): - metadata: Dict[str, str] + metadata: Optional[Dict[str, str]] """(Optional) Metadata used to describe the snapshot""" - name: str + name: Optional[str] """(Optional) A user specified name to give the snapshot""" diff --git a/src/runloop_api_client/types/devbox_snapshot_view.py b/src/runloop_api_client/types/devbox_snapshot_view.py index 48f9a67ff..115fe72e9 100644 --- a/src/runloop_api_client/types/devbox_snapshot_view.py +++ b/src/runloop_api_client/types/devbox_snapshot_view.py @@ -2,8 +2,6 @@ from typing import Dict, Optional -from pydantic import Field as FieldInfo - from .._models import BaseModel __all__ = ["DevboxSnapshotView"] @@ -17,10 +15,10 @@ class DevboxSnapshotView(BaseModel): """Creation time of the Snapshot (Unix timestamp milliseconds).""" metadata: Dict[str, str] - """metadata associated with the snapshot.""" + """User defined metadata associated with the snapshot.""" - source_devbox_id: str = FieldInfo(alias="sourceDevboxId") - """The source devbox identifier.""" + source_devbox_id: str + """The source Devbox ID this snapshot was created from.""" name: Optional[str] = None """(Optional) The custom name of the snapshot.""" diff --git a/src/runloop_api_client/types/devbox_upload_file_params.py b/src/runloop_api_client/types/devbox_upload_file_params.py index 606a0b2b4..9e83fa318 100644 --- a/src/runloop_api_client/types/devbox_upload_file_params.py +++ b/src/runloop_api_client/types/devbox_upload_file_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from .._types import FileTypes @@ -10,6 +10,10 @@ class DevboxUploadFileParams(TypedDict, total=False): - file: FileTypes + path: Required[str] + """The path to write the file to on the Devbox. + + Path is relative to user home directory. + """ - path: str + file: FileTypes diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index ebe9f5048..838a5ea75 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -11,17 +11,11 @@ class DevboxView(BaseModel): id: str - """The id of the Devbox.""" + """The ID of the Devbox.""" create_time_ms: int """Creation time of the Devbox (Unix timestamp milliseconds).""" - initiator_id: str - """The initiator ID of the devbox.""" - - initiator_type: Literal["unknown", "api", "invocation"] - """The initiator of the devbox.""" - launch_parameters: LaunchParameters """The launch parameters used to create the Devbox.""" @@ -34,13 +28,19 @@ class DevboxView(BaseModel): """The current status of the Devbox.""" blueprint_id: Optional[str] = None - """The Blueprint ID used in creation of the Devbox, if any.""" + """ + The Blueprint ID used in creation of the Devbox, if the devbox was created from + a Blueprint. + """ end_time_ms: Optional[int] = None - """The time the Devbox finished execution (Unix timestamp milliseconds).""" + """The time the Devbox finished execution (Unix timestamp milliseconds). + + Present if the Devbox is in a terminal state. + """ failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "execution_failed"]] = None - """The failure reason if the Devbox failed, if any.""" + """The failure reason if the Devbox failed, if the Devbox has a 'failure' status.""" name: Optional[str] = None """The name of the Devbox.""" @@ -48,4 +48,13 @@ class DevboxView(BaseModel): shutdown_reason: Optional[ Literal["api_shutdown", "keep_alive_timeout", "entrypoint_exit", "idle", "lambda_lifecycle"] ] = None - """The shutdown reason if the Devbox shutdown, if any.""" + """ + The shutdown reason if the Devbox shutdown, if the Devbox has a 'shutdown' + status. + """ + + snapshot_id: Optional[str] = None + """ + The Snapshot ID used in creation of the Devbox, if the devbox was created from a + Snapshot. + """ diff --git a/src/runloop_api_client/types/devbox_write_file_contents_params.py b/src/runloop_api_client/types/devbox_write_file_contents_params.py new file mode 100644 index 000000000..f47a73839 --- /dev/null +++ b/src/runloop_api_client/types/devbox_write_file_contents_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["DevboxWriteFileContentsParams"] + + +class DevboxWriteFileContentsParams(TypedDict, total=False): + contents: Required[str] + """The UTF-8 string contents to write to the file.""" + + file_path: Required[str] + """The path to write the file to on the Devbox. + + Path is relative to user home directory. + """ diff --git a/src/runloop_api_client/types/devbox_write_file_params.py b/src/runloop_api_client/types/devbox_write_file_params.py deleted file mode 100644 index af2abad06..000000000 --- a/src/runloop_api_client/types/devbox_write_file_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["DevboxWriteFileParams"] - - -class DevboxWriteFileParams(TypedDict, total=False): - contents: Required[str] - """The contents to write to file.""" - - file_path: Required[str] - """The path of the file to write.""" diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 809acc5e1..f2f7c0765 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,8 +2,74 @@ from __future__ import annotations +from .u_ri import URi as URi +from .range import Range as Range +from .integer import Integer as Integer +from .file_uri import FileUri as FileUri +from .position import Position as Position +from .uinteger import Uinteger as Uinteger +from .file_path import FilePath as FilePath +from .text_edit import TextEdit as TextEdit +from .base_range import BaseRange as BaseRange +from .symbol_tag import SymbolTag as SymbolTag +from .range_param import RangeParam as RangeParam +from .symbol_kind import SymbolKind as SymbolKind +from .symbol_type import SymbolType as SymbolType +from .base_command import BaseCommand as BaseCommand +from .document_uri import DocumentUri as DocumentUri +from .base_location import BaseLocation as BaseLocation +from .base_signature import BaseSignature as BaseSignature +from .diagnostic_tag import DiagnosticTag as DiagnosticTag +from .l_sp_any_param import LSpAnyParam as LSpAnyParam +from .location_param import LocationParam as LocationParam +from .position_param import PositionParam as PositionParam +from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams +from .lsp_file_params import LspFileParams as LspFileParams +from .text_edit_param import TextEditParam as TextEditParam +from .base_code_action import BaseCodeAction as BaseCodeAction +from .base_range_param import BaseRangeParam as BaseRangeParam +from .code_action_kind import CodeActionKind as CodeActionKind +from .diagnostic_param import DiagnosticParam as DiagnosticParam +from .base_command_param import BaseCommandParam as BaseCommandParam +from .lsp_files_response import LspFilesResponse as LspFilesResponse +from .base_markup_content import BaseMarkupContent as BaseMarkupContent +from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit +from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse +from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView -from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams +from .lsp_formatting_params import LspFormattingParams as LspFormattingParams +from .lsp_references_params import LspReferencesParams as LspReferencesParams +from .watched_file_response import WatchedFileResponse as WatchedFileResponse +from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .file_contents_response import FileContentsResponse as FileContentsResponse +from .health_status_response import HealthStatusResponse as HealthStatusResponse +from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams +from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams +from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse +from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam +from .code_action_context_param import CodeActionContextParam as CodeActionContextParam +from .base_parameter_information import BaseParameterInformation as BaseParameterInformation +from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse +from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams +from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams +from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams +from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams +from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams +from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .lsp_get_code_actions_for_diagnostic_params import ( + LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, +) +from .lsp_get_code_actions_for_diagnostic_response import ( + LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, +) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py new file mode 100644 index 000000000..d74e9a0f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_command import BaseCommand +from .base_workspace_edit import BaseWorkspaceEdit + +__all__ = ["BaseCodeAction"] + + +class BaseCodeAction(BaseModel): + title: str + + command: Optional[BaseCommand] = None + + edit: Optional[BaseWorkspaceEdit] = None + + is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py new file mode 100644 index 000000000..7defd0e9a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["BaseCommand"] + + +class BaseCommand(BaseModel): + command: str + + title: str + + arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py new file mode 100644 index 000000000..fe17f38f6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_command_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +__all__ = ["BaseCommandParam"] + + +class BaseCommandParam(TypedDict, total=False): + command: Required[str] + + title: Required[str] + + arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py new file mode 100644 index 000000000..83249c034 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional + +from ..._models import BaseModel +from .base_range import BaseRange +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnostic"] + + +class BaseDiagnostic(BaseModel): + message: str + + range: BaseRange + + code: Union[float, str, None] = None + + severity: Optional[DiagnosticSeverity] = None + """The diagnostic's severity.""" + + source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py new file mode 100644 index 000000000..b74f7435e --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import Required, TypedDict + +from .base_range_param import BaseRangeParam +from .diagnostic_severity import DiagnosticSeverity + +__all__ = ["BaseDiagnosticParam"] + + +class BaseDiagnosticParam(TypedDict, total=False): + message: Required[str] + + range: Required[BaseRangeParam] + + code: Union[float, str] + + severity: DiagnosticSeverity + """The diagnostic's severity.""" + + source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py new file mode 100644 index 000000000..3d83663f0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from .base_range import BaseRange + +__all__ = ["BaseLocation"] + + +class BaseLocation(BaseModel): + range: BaseRange + + uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py new file mode 100644 index 000000000..bd874488d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseMarkupContent"] + + +class BaseMarkupContent(BaseModel): + kind: str + + value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py new file mode 100644 index 000000000..0075870f3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_parameter_information.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent + +__all__ = ["BaseParameterInformation", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseParameterInformation(BaseModel): + label: str + + documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py new file mode 100644 index 000000000..52e22338d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["BaseRange", "End", "Start"] + + +class End(BaseModel): + character: float + + line: float + + +class Start(BaseModel): + character: float + + line: float + + +class BaseRange(BaseModel): + end: End + + start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py new file mode 100644 index 000000000..d97e7fdee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_range_param.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["BaseRangeParam", "End", "Start"] + + +class End(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class Start(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + +class BaseRangeParam(TypedDict, total=False): + end: Required[End] + + start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py new file mode 100644 index 000000000..7c1df775f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_signature.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import TypeAlias + +from ..._models import BaseModel +from .base_markup_content import BaseMarkupContent +from .base_parameter_information import BaseParameterInformation + +__all__ = ["BaseSignature", "Documentation"] + +Documentation: TypeAlias = Union[str, BaseMarkupContent] + + +class BaseSignature(BaseModel): + label: str + + documentation: Optional[Documentation] = None + + parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py new file mode 100644 index 000000000..db5a77fa4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from .record_string_text_edit_array import RecordStringTextEditArray + +__all__ = ["BaseWorkspaceEdit"] + + +class BaseWorkspaceEdit(BaseModel): + changes: Optional[RecordStringTextEditArray] = None + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py new file mode 100644 index 000000000..89a933497 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +from .record_string_text_edit_array_param import RecordStringTextEditArrayParam + +__all__ = ["BaseWorkspaceEditParam"] + + +class BaseWorkspaceEditParam(TypedDict, total=False): + changes: RecordStringTextEditArrayParam + """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py new file mode 100644 index 000000000..49a2ad557 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_application_result.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["CodeActionApplicationResult"] + + +class CodeActionApplicationResult(BaseModel): + success: bool + + error: Optional[str] = None + + files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py new file mode 100644 index 000000000..df6ee765f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .code_action_kind import CodeActionKind +from .diagnostic_param import DiagnosticParam +from .code_action_trigger_kind import CodeActionTriggerKind + +__all__ = ["CodeActionContextParam"] + + +class CodeActionContextParam(TypedDict, total=False): + diagnostics: Required[Iterable[DiagnosticParam]] + """ + An array of diagnostics known on the client side overlapping the range provided + to the `textDocument/codeAction` request. They are provided so that the server + knows which errors are currently presented to the user for the given range. + There is no guarantee that these accurately reflect the error state of the + resource. The primary parameter to compute code actions is the provided range. + """ + + only: List[CodeActionKind] + """Requested kind of actions to return. + + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. + """ + + trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] + """The reason why code actions were requested.""" diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py new file mode 100644 index 000000000..2878d6335 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["CodeActionKind"] + +CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py new file mode 100644 index 000000000..f365d75f8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["CodeActionTriggerKind"] + +CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py new file mode 100644 index 000000000..616f4446f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .u_ri import URi + +__all__ = ["CodeDescriptionParam"] + + +class CodeDescriptionParam(TypedDict, total=False): + href: Required[URi] + """An URI to open with more information about the diagnostic error.""" diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py new file mode 100644 index 000000000..aa0641872 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -0,0 +1,54 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .base_range import BaseRange +from .base_location import BaseLocation +from .base_diagnostic import BaseDiagnostic +from .base_code_action import BaseCodeAction +from .signature_help_response import SignatureHelpResponse + +__all__ = ["CodeSegmentInfoResponse", "Hover"] + + +class Hover(BaseModel): + contents: object + + range: Optional[BaseRange] = None + + +class CodeSegmentInfoResponse(BaseModel): + actions: List[BaseCodeAction] + + diagnostics: List[BaseDiagnostic] + + references: List[BaseLocation] + + symbol: "DocumentSymbol" + """ + Represents programming constructs like variables, classes, interfaces etc. that + appear in a document. Document symbols can be hierarchical and they have two + ranges: one that encloses its definition and one that points to its most + interesting range, e.g. the range of an identifier. + """ + + uri: FileUri + + hover: Optional[Hover] = None + + signature: Optional[SignatureHelpResponse] = None + + +from .document_symbol import DocumentSymbol + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py new file mode 100644 index 000000000..4ec525ec8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Required, Annotated, TypedDict + +from .integer import Integer +from ..._utils import PropertyInfo +from .range_param import RangeParam +from .diagnostic_tag import DiagnosticTag +from .l_sp_any_param import LSpAnyParam +from .diagnostic_severity import DiagnosticSeverity +from .code_description_param import CodeDescriptionParam +from .diagnostic_related_information_param import DiagnosticRelatedInformationParam + +__all__ = ["DiagnosticParam"] + + +class DiagnosticParam(TypedDict, total=False): + message: Required[str] + """The diagnostic's message. It usually appears in the user interface""" + + range: Required[RangeParam] + """The range at which the message applies""" + + code: Union[Integer, str] + """The diagnostic's code, which usually appear in the user interface.""" + + code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] + """ + An optional property to describe the error code. Requires the code field (above) + to be present/not null. + """ + + data: LSpAnyParam + """ + A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. + """ + + related_information: Annotated[ + Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") + ] + """An array of related diagnostic information, e.g. + + when symbol-names within a scope collide all definitions can be marked via this + property. + """ + + severity: DiagnosticSeverity + """The diagnostic's severity. + + Can be omitted. If omitted it is up to the client to interpret diagnostics as + error, warning, info or hint. + """ + + source: str + """A human-readable string describing the source of this diagnostic, e.g. + + 'typescript' or 'super lint'. It usually appears in the user interface. + """ + + tags: Iterable[DiagnosticTag] + """Additional metadata about the diagnostic.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py new file mode 100644 index 000000000..9e902d731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .location_param import LocationParam + +__all__ = ["DiagnosticRelatedInformationParam"] + + +class DiagnosticRelatedInformationParam(TypedDict, total=False): + location: Required[LocationParam] + """The location of this related diagnostic information.""" + + message: Required[str] + """The message of this related diagnostic information.""" diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py new file mode 100644 index 000000000..34bb1dfe6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_severity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticSeverity"] + +DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py new file mode 100644 index 000000000..693d4f6e4 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostic_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["DiagnosticTag"] + +DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py new file mode 100644 index 000000000..1b75b2741 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/diagnostics_response.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from .base_diagnostic import BaseDiagnostic + +__all__ = ["DiagnosticsResponse"] + + +class DiagnosticsResponse(BaseModel): + diagnostics: List[BaseDiagnostic] + + uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..0e58f87ed --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[DocumentSymbol]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py new file mode 100644 index 000000000..0b7ae87a3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["DocumentUri"] + +DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/execution_execute_async_params.py b/src/runloop_api_client/types/devboxes/execution_execute_async_params.py index 8d9f92088..22a5292c9 100644 --- a/src/runloop_api_client/types/devboxes/execution_execute_async_params.py +++ b/src/runloop_api_client/types/devboxes/execution_execute_async_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, TypedDict __all__ = ["ExecutionExecuteAsyncParams"] @@ -9,7 +10,16 @@ class ExecutionExecuteAsyncParams(TypedDict, total=False): command: Required[str] - """The command to execute on the Devbox.""" + """The command to execute via the Devbox shell. - shell_name: str - """Which named shell to run the command in.""" + By default, commands are run from the user home directory unless shell_name is + specified. If shell_name is specified the command is run from the directory + based on the recent state of the persistent shell. + """ + + shell_name: Optional[str] + """The name of the persistent shell to create or use if already created. + + When using a persistent shell, the command will run from the directory at the + end of the previous command and environment variables will be preserved. + """ diff --git a/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py b/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py index 9537ed816..a900f3e4b 100755 --- a/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py +++ b/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, TypedDict __all__ = ["ExecutionExecuteSyncParams"] @@ -9,7 +10,16 @@ class ExecutionExecuteSyncParams(TypedDict, total=False): command: Required[str] - """The command to execute on the Devbox.""" + """The command to execute via the Devbox shell. - shell_name: str - """Which named shell to run the command in.""" + By default, commands are run from the user home directory unless shell_name is + specified. If shell_name is specified the command is run from the directory + based on the recent state of the persistent shell. + """ + + shell_name: Optional[str] + """The name of the persistent shell to create or use if already created. + + When using a persistent shell, the command will run from the directory at the + end of the previous command and environment variables will be preserved. + """ diff --git a/src/runloop_api_client/types/devboxes/execution_retrieve_params.py b/src/runloop_api_client/types/devboxes/execution_retrieve_params.py deleted file mode 100755 index 3df3dd4a2..000000000 --- a/src/runloop_api_client/types/devboxes/execution_retrieve_params.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["ExecutionRetrieveParams"] - - -class ExecutionRetrieveParams(TypedDict, total=False): - id: Required[str] - - last_n: str - """Last n lines of standard error / standard out to return""" diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py new file mode 100644 index 000000000..e5aa38d11 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .file_path import FilePath + +__all__ = ["FileContentsResponse"] + + +class FileContentsResponse(BaseModel): + contents: str + + full_path: str = FieldInfo(alias="fullPath") + + path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py new file mode 100644 index 000000000..008c01f66 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_path.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FilePath"] + +FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py new file mode 100644 index 000000000..293323d00 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_uri.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["FileUri"] + +FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py new file mode 100644 index 000000000..5b02dd9af --- /dev/null +++ b/src/runloop_api_client/types/devboxes/health_status_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["HealthStatusResponse"] + + +class HealthStatusResponse(BaseModel): + dirty_files: List[str] = FieldInfo(alias="dirtyFiles") + + module_name: str = FieldInfo(alias="moduleName") + + pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") + + status: str + + uptime: str + + watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py new file mode 100644 index 000000000..2ff55a8c7 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/integer.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Integer"] + +Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/projects/__init__.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py similarity index 54% rename from src/runloop_api_client/types/projects/__init__.py rename to src/runloop_api_client/types/devboxes/l_sp_any_param.py index f8ee8b14b..1fe0adec1 100644 --- a/src/runloop_api_client/types/projects/__init__.py +++ b/src/runloop_api_client/types/devboxes/l_sp_any_param.py @@ -1,3 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations + +from typing_extensions import TypeAlias + +__all__ = ["LSpAnyParam"] + +LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py new file mode 100644 index 000000000..e2deae54b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .document_uri import DocumentUri + +__all__ = ["LocationParam"] + + +class LocationParam(TypedDict, total=False): + range: Required[RangeParam] + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ + + uri: Required[DocumentUri] + """A tagging type for string properties that are actually document URIs.""" diff --git a/src/runloop_api_client/types/devboxes/log_list_params.py b/src/runloop_api_client/types/devboxes/log_list_params.py index 88dfa1683..be52499b2 100644 --- a/src/runloop_api_client/types/devboxes/log_list_params.py +++ b/src/runloop_api_client/types/devboxes/log_list_params.py @@ -9,7 +9,7 @@ class LogListParams(TypedDict, total=False): execution_id: str - """Id of execution to filter logs by.""" + """ID of execution to filter logs by.""" shell_name: str """Shell Name to filter logs by.""" diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py new file mode 100644 index 000000000..1ab3b23d5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .base_command_param import BaseCommandParam +from .base_workspace_edit_param import BaseWorkspaceEditParam + +__all__ = ["LspApplyCodeActionParams"] + + +class LspApplyCodeActionParams(TypedDict, total=False): + title: Required[str] + + command: BaseCommandParam + + edit: BaseWorkspaceEditParam + + is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py new file mode 100644 index 000000000..f59f19457 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .range_param import RangeParam +from .code_action_context_param import CodeActionContextParam + +__all__ = ["LspCodeActionsParams"] + + +class LspCodeActionsParams(TypedDict, total=False): + uri: Required[str] + + context: CodeActionContextParam + """ + Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext + namespace provides helper functions to work with {@link CodeActionContext} + literals. + """ + + range: RangeParam + """A range in a text document expressed as (zero-based) start and end positions. + + If you want to specify a range that contains a line including the line ending + character(s) then use an end position denoting the start of the next line. For + example: + + ```ts + { + start: { line: 5, character: 23 } + end : { line 6, character : 0 } + } + ``` + + The Range namespace provides helper functions to work with {@link Range} + literals. + """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py new file mode 100644 index 000000000..103f7c1c1 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDiagnosticsParams"] + + +class LspDiagnosticsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py new file mode 100644 index 000000000..f1c85e223 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspDocumentSymbolsParams"] + + +class LspDocumentSymbolsParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py new file mode 100644 index 000000000..ea8b647cc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspFileDefinitionParams"] + + +class LspFileDefinitionParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py new file mode 100644 index 000000000..f3caba3d8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_file_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspFileParams"] + + +class LspFileParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py new file mode 100644 index 000000000..699491a0a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_files_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .watched_file_response import WatchedFileResponse + +__all__ = ["LspFilesResponse"] + +LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py new file mode 100644 index 000000000..4ffecaee8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_uri import FileUri + +__all__ = ["LspFormattingParams"] + + +class LspFormattingParams(TypedDict, total=False): + uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py new file mode 100644 index 000000000..03d24fa27 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .base_diagnostic_param import BaseDiagnosticParam + +__all__ = ["LspGetCodeActionsForDiagnosticParams"] + + +class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): + diagnostic: Required[BaseDiagnosticParam] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py new file mode 100644 index 000000000..fac1c53a8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_code_action import BaseCodeAction + +__all__ = ["LspGetCodeActionsForDiagnosticResponse"] + +LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py new file mode 100644 index 000000000..d26cafc31 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_uri import FileUri +from .symbol_type import SymbolType + +__all__ = ["LspGetCodeSegmentInfoParams"] + + +class LspGetCodeSegmentInfoParams(TypedDict, total=False): + symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] + + uri: Required[FileUri] + + symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py new file mode 100644 index 000000000..c15382de0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspGetSignatureHelpParams"] + + +class LspGetSignatureHelpParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py new file mode 100644 index 000000000..f84058b8b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LspReferencesParams"] + + +class LspReferencesParams(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py new file mode 100644 index 000000000..88abae178 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .file_path import FilePath + +__all__ = ["LspSetWatchDirectoryParams"] + + +class LspSetWatchDirectoryParams(TypedDict, total=False): + path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py new file mode 100644 index 000000000..575252b7f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["LspSetWatchDirectoryResponse"] + +LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py new file mode 100644 index 000000000..8ae66b6ad --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .uinteger import Uinteger +from ..._models import BaseModel + +__all__ = ["Position"] + + +class Position(BaseModel): + character: Uinteger + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Uinteger + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py new file mode 100644 index 000000000..0afee2ba3 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .uinteger import Uinteger + +__all__ = ["PositionParam"] + + +class PositionParam(TypedDict, total=False): + character: Required[Uinteger] + """Character offset on a line in a document (zero-based). + + The meaning of this offset is determined by the negotiated + `PositionEncodingKind`. + + If the character value is greater than the line length it defaults back to the + line length. + """ + + line: Required[Uinteger] + """Line position in a document (zero-based). + + If a line number is greater than the number of lines in a document, it defaults + back to the number of lines in the document. If a line number is negative, it + defaults to 0. + """ diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py new file mode 100644 index 000000000..c9eaf78a6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .position import Position +from ..._models import BaseModel + +__all__ = ["Range"] + + +class Range(BaseModel): + end: Position + """The range's end position.""" + + start: Position + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py new file mode 100644 index 000000000..87a516655 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from .position_param import PositionParam + +__all__ = ["RangeParam"] + + +class RangeParam(TypedDict, total=False): + end: Required[PositionParam] + """The range's end position.""" + + start: Required[PositionParam] + """The range's start position.""" diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py new file mode 100644 index 000000000..84efd3ea0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["RecordStringTextEditArray"] + +RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py new file mode 100644 index 000000000..19e7cf731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Iterable +from typing_extensions import TypeAlias + +from .text_edit_param import TextEditParam + +__all__ = ["RecordStringTextEditArrayParam"] + +RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py new file mode 100644 index 000000000..1cf0ac4cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_signature import BaseSignature + +__all__ = ["SignatureHelpResponse"] + + +class SignatureHelpResponse(BaseModel): + signatures: List[BaseSignature] + + active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) + + active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py new file mode 100644 index 000000000..d21c01515 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_kind.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolKind"] + +SymbolKind: TypeAlias = Literal[ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 +] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py new file mode 100644 index 000000000..0779efce5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_tag.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolTag"] + +SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py new file mode 100644 index 000000000..1623bacf2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/symbol_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["SymbolType"] + +SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py new file mode 100644 index 000000000..e91fde3ff --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._models import BaseModel + +__all__ = ["TextEdit"] + + +class TextEdit(BaseModel): + new_text: str = FieldInfo(alias="newText") + """The string to be inserted. For delete operations use an empty string.""" + + range: Range + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py new file mode 100644 index 000000000..882a423c6 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .range_param import RangeParam + +__all__ = ["TextEditParam"] + + +class TextEditParam(TypedDict, total=False): + new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] + """The string to be inserted. For delete operations use an empty string.""" + + range: Required[RangeParam] + """The range of the text document to be manipulated. + + To insert text into a document create a range where start === end. + """ diff --git a/tests/api_resources/functions/__init__.py b/src/runloop_api_client/types/devboxes/u_ri.py similarity index 51% rename from tests/api_resources/functions/__init__.py rename to src/runloop_api_client/types/devboxes/u_ri.py index fd8019a9a..132a3bd29 100644 --- a/tests/api_resources/functions/__init__.py +++ b/src/runloop_api_client/types/devboxes/u_ri.py @@ -1 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["URi"] + +URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py new file mode 100644 index 000000000..b1f8376cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/uinteger.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["Uinteger"] + +Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py new file mode 100644 index 000000000..01884f8e8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["WatchedFileResponse"] + + +class WatchedFileResponse(BaseModel): + filename: str + + full_path: str = FieldInfo(alias="fullPath") + + path: str diff --git a/src/runloop_api_client/types/function_invoke_async_params.py b/src/runloop_api_client/types/function_invoke_async_params.py deleted file mode 100644 index ffd4821a0..000000000 --- a/src/runloop_api_client/types/function_invoke_async_params.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["FunctionInvokeAsyncParams", "RunloopMeta"] - - -class FunctionInvokeAsyncParams(TypedDict, total=False): - project_name: Required[str] - - request: Required[object] - """Json of the request""" - - runloop_meta: Annotated[RunloopMeta, PropertyInfo(alias="runloopMeta")] - - -class RunloopMeta(TypedDict, total=False): - session_id: str - """Json of the request""" diff --git a/src/runloop_api_client/types/function_invoke_sync_params.py b/src/runloop_api_client/types/function_invoke_sync_params.py deleted file mode 100644 index 616a7fe32..000000000 --- a/src/runloop_api_client/types/function_invoke_sync_params.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from .._utils import PropertyInfo - -__all__ = ["FunctionInvokeSyncParams", "RunloopMeta"] - - -class FunctionInvokeSyncParams(TypedDict, total=False): - project_name: Required[str] - - request: Required[object] - """Json of the request""" - - runloop_meta: Annotated[RunloopMeta, PropertyInfo(alias="runloopMeta")] - - -class RunloopMeta(TypedDict, total=False): - session_id: str - """Json of the request""" diff --git a/src/runloop_api_client/types/function_list_view.py b/src/runloop_api_client/types/function_list_view.py deleted file mode 100644 index f31f58245..000000000 --- a/src/runloop_api_client/types/function_list_view.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from .._models import BaseModel - -__all__ = ["FunctionListView", "Function"] - - -class Function(BaseModel): - name: Optional[str] = None - """Unique name of the function.""" - - project_name: Optional[str] = None - """Unique name of the project.""" - - -class FunctionListView(BaseModel): - functions: Optional[List[Function]] = None - """List of functions matching given query.""" diff --git a/src/runloop_api_client/types/functions/__init__.py b/src/runloop_api_client/types/functions/__init__.py deleted file mode 100644 index 65762ab89..000000000 --- a/src/runloop_api_client/types/functions/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .invocation_list_params import InvocationListParams as InvocationListParams -from .function_invocation_list_view import FunctionInvocationListView as FunctionInvocationListView diff --git a/src/runloop_api_client/types/functions/function_invocation_list_view.py b/src/runloop_api_client/types/functions/function_invocation_list_view.py deleted file mode 100644 index 98920ba7e..000000000 --- a/src/runloop_api_client/types/functions/function_invocation_list_view.py +++ /dev/null @@ -1,47 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["FunctionInvocationListView", "Invocation"] - - -class Invocation(BaseModel): - id: Optional[str] = None - """Unique ID of the invocation.""" - - end_time_ms: Optional[int] = None - """End time of the invocation.""" - - error: Optional[str] = None - - function_name: Optional[str] = None - """Unique name of the function.""" - - gh_commit_sha: Optional[str] = None - """The Git sha of the project this invocation used.""" - - gh_owner: Optional[str] = None - """The Github Owner of the Project.""" - - linked_devboxes: Optional[List[str]] = None - """The Devboxes created and used by this invocation.""" - - project_name: Optional[str] = None - """Unique name of the project associated with function.""" - - start_time_ms: Optional[int] = None - """Start time of the invocation.""" - - status: Optional[Literal["created", "running", "success", "failure", "canceled", "suspended"]] = None - - -class FunctionInvocationListView(BaseModel): - has_more: Optional[bool] = None - - invocations: Optional[List[Invocation]] = None - """List of functions matching given query.""" - - total_count: Optional[int] = None diff --git a/src/runloop_api_client/types/functions/invocation_list_params.py b/src/runloop_api_client/types/functions/invocation_list_params.py deleted file mode 100644 index 5ad136ee1..000000000 --- a/src/runloop_api_client/types/functions/invocation_list_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["InvocationListParams"] - - -class InvocationListParams(TypedDict, total=False): - limit: int - """Page Limit""" - - starting_after: str - """Load the next page starting after the given token.""" diff --git a/src/runloop_api_client/types/project_list_view.py b/src/runloop_api_client/types/project_list_view.py deleted file mode 100644 index e31248361..000000000 --- a/src/runloop_api_client/types/project_list_view.py +++ /dev/null @@ -1,30 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from .._models import BaseModel - -__all__ = ["ProjectListView", "Installation", "Project"] - - -class Installation(BaseModel): - status: str - """Status of the installation (installed | uninstalled | never_installed).""" - - -class Project(BaseModel): - id: str - """Unique id of Project.""" - - gh_owner: str - """Owner of the project in Github""" - - name: str - """Project display name.""" - - -class ProjectListView(BaseModel): - installation: Installation - - projects: List[Project] - """List of projects matching given query.""" diff --git a/src/runloop_api_client/types/repository_connection_list_view.py b/src/runloop_api_client/types/repository_connection_list_view.py new file mode 100644 index 000000000..4ad5a10ec --- /dev/null +++ b/src/runloop_api_client/types/repository_connection_list_view.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .repository_connection_view import RepositoryConnectionView + +__all__ = ["RepositoryConnectionListView"] + + +class RepositoryConnectionListView(BaseModel): + has_more: bool + + repositories: List[RepositoryConnectionView] + """List of repositories matching filter.""" + + total_count: int diff --git a/src/runloop_api_client/types/repository_connection_view.py b/src/runloop_api_client/types/repository_connection_view.py new file mode 100644 index 000000000..f0c81ecd3 --- /dev/null +++ b/src/runloop_api_client/types/repository_connection_view.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["RepositoryConnectionView"] + + +class RepositoryConnectionView(BaseModel): + id: str + """The ID of the Repository.""" + + name: str + """The name of the Repository.""" + + owner: str + """The account owner of the Repository.""" + + status: Literal["pending", "failure", "active"] + """The current status of the Repository.""" + + failure_reason: Optional[str] = None + """Reason for failure, if the status is 'failure'.""" diff --git a/src/runloop_api_client/types/repository_create_params.py b/src/runloop_api_client/types/repository_create_params.py new file mode 100644 index 000000000..06864a447 --- /dev/null +++ b/src/runloop_api_client/types/repository_create_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["RepositoryCreateParams"] + + +class RepositoryCreateParams(TypedDict, total=False): + name: Required[str] + """Name of the repository.""" + + owner: Required[str] + """Account owner of the repository.""" diff --git a/src/runloop_api_client/types/repository_list_params.py b/src/runloop_api_client/types/repository_list_params.py new file mode 100644 index 000000000..363c4ec2b --- /dev/null +++ b/src/runloop_api_client/types/repository_list_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["RepositoryListParams"] + + +class RepositoryListParams(TypedDict, total=False): + limit: int + """The limit of items to return. Default is 20.""" + + starting_after: str + """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/repository_version_details.py b/src/runloop_api_client/types/repository_version_details.py new file mode 100644 index 000000000..8d6d2b0d8 --- /dev/null +++ b/src/runloop_api_client/types/repository_version_details.py @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["RepositoryVersionDetails", "ExtractedTools", "RepositorySetupDetails"] + + +class ExtractedTools(BaseModel): + commands: Dict[str, str] + """The set of available commands on this repository such as building etc.""" + + package_manager: str + """What package manager this repository uses.""" + + +class RepositorySetupDetails(BaseModel): + blueprint_id: str + """The blueprint built that supports setting up this repository.""" + + env_initialization_command: str + """Command to initialize the env we need to run the commands for this repository.""" + + workspace_setup: List[str] + """Setup commands necessary to support repository i.e. apt install XXX.""" + + +class RepositoryVersionDetails(BaseModel): + analyzed_at: int + """Analyzed time of the Repository Version (Unix timestamp milliseconds).""" + + commit_sha: str + """The sha of the analyzed version of the Repository.""" + + extracted_tools: ExtractedTools + """Tools discovered during inspection.""" + + repository_setup_details: RepositorySetupDetails + """Commands required to set up repository environment.""" + + status: Literal["inspecting", "inspection_failed", "success"] + """The account owner of the Repository.""" diff --git a/src/runloop_api_client/types/repository_version_list_view.py b/src/runloop_api_client/types/repository_version_list_view.py new file mode 100644 index 000000000..6e4872663 --- /dev/null +++ b/src/runloop_api_client/types/repository_version_list_view.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .repository_version_details import RepositoryVersionDetails + +__all__ = ["RepositoryVersionListView"] + + +class RepositoryVersionListView(BaseModel): + analyzed_versions: List[RepositoryVersionDetails] + """List of analyzed versions of this repository.""" diff --git a/src/runloop_api_client/types/shared/__init__.py b/src/runloop_api_client/types/shared/__init__.py index fe8f6f15d..bc4b7503e 100644 --- a/src/runloop_api_client/types/shared/__init__.py +++ b/src/runloop_api_client/types/shared/__init__.py @@ -2,7 +2,4 @@ from .after_idle import AfterIdle as AfterIdle from .launch_parameters import LaunchParameters as LaunchParameters -from .project_logs_view import ProjectLogsView as ProjectLogsView -from .function_invocation_execution_detail_view import ( - FunctionInvocationExecutionDetailView as FunctionInvocationExecutionDetailView, -) +from .code_mount_parameters import CodeMountParameters as CodeMountParameters diff --git a/src/runloop_api_client/types/code_mount_parameters.py b/src/runloop_api_client/types/shared/code_mount_parameters.py similarity index 94% rename from src/runloop_api_client/types/code_mount_parameters.py rename to src/runloop_api_client/types/shared/code_mount_parameters.py index 65abf51ba..b430f1513 100644 --- a/src/runloop_api_client/types/code_mount_parameters.py +++ b/src/runloop_api_client/types/shared/code_mount_parameters.py @@ -2,7 +2,7 @@ from typing import Optional -from .._models import BaseModel +from ..._models import BaseModel __all__ = ["CodeMountParameters"] diff --git a/src/runloop_api_client/types/shared/function_invocation_execution_detail_view.py b/src/runloop_api_client/types/shared/function_invocation_execution_detail_view.py deleted file mode 100644 index f9b0b5d5f..000000000 --- a/src/runloop_api_client/types/shared/function_invocation_execution_detail_view.py +++ /dev/null @@ -1,42 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["FunctionInvocationExecutionDetailView"] - - -class FunctionInvocationExecutionDetailView(BaseModel): - id: Optional[str] = None - """Unique ID of the invocation.""" - - end_time_ms: Optional[int] = None - """End time of the invocation.""" - - error: Optional[str] = None - - function_name: Optional[str] = None - """Unique name of the function.""" - - gh_commit_sha: Optional[str] = None - """The Git sha of the project this invocation used..""" - - gh_owner: Optional[str] = None - """The Github Owner of the Project.""" - - linked_devboxes: Optional[List[str]] = None - """The Devboxes created and used by this invocation.""" - - project_name: Optional[str] = None - """Unique name of the project associated with function.""" - - request: Optional[object] = None - - result: Optional[object] = None - - start_time_ms: Optional[int] = None - """Start time of the invocation.""" - - status: Optional[Literal["created", "running", "success", "failure", "canceled", "suspended"]] = None diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index ba7397a86..5113a18a0 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -19,7 +19,8 @@ class LaunchParameters(BaseModel): available_ports: Optional[List[int]] = None """A list of ports to make available on the Devbox. - Call createTunnel to open a tunnel to the port. + Only ports made available will be surfaced to create tunnels via the + 'createTunnel' API. """ keep_alive_time_seconds: Optional[int] = None diff --git a/src/runloop_api_client/types/shared/project_logs_view.py b/src/runloop_api_client/types/shared/project_logs_view.py deleted file mode 100644 index 4137cd73f..000000000 --- a/src/runloop_api_client/types/shared/project_logs_view.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel - -__all__ = ["ProjectLogsView", "Log"] - - -class Log(BaseModel): - level: str - - message: str - - source: str - - timestamp: str - - -class ProjectLogsView(BaseModel): - logs: List[Log] - """List of logs for the given project.""" diff --git a/src/runloop_api_client/types/shared_params/__init__.py b/src/runloop_api_client/types/shared_params/__init__.py index 6f0cc271b..bc4b7503e 100644 --- a/src/runloop_api_client/types/shared_params/__init__.py +++ b/src/runloop_api_client/types/shared_params/__init__.py @@ -2,3 +2,4 @@ from .after_idle import AfterIdle as AfterIdle from .launch_parameters import LaunchParameters as LaunchParameters +from .code_mount_parameters import CodeMountParameters as CodeMountParameters diff --git a/src/runloop_api_client/types/code_mount_parameters_param.py b/src/runloop_api_client/types/shared_params/code_mount_parameters.py similarity index 74% rename from src/runloop_api_client/types/code_mount_parameters_param.py rename to src/runloop_api_client/types/shared_params/code_mount_parameters.py index 976471a76..5afa72523 100644 --- a/src/runloop_api_client/types/code_mount_parameters_param.py +++ b/src/runloop_api_client/types/shared_params/code_mount_parameters.py @@ -2,12 +2,13 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, TypedDict -__all__ = ["CodeMountParametersParam"] +__all__ = ["CodeMountParameters"] -class CodeMountParametersParam(TypedDict, total=False): +class CodeMountParameters(TypedDict, total=False): repo_name: Required[str] """The name of the repo to mount. @@ -17,8 +18,8 @@ class CodeMountParametersParam(TypedDict, total=False): repo_owner: Required[str] """The owner of the repo.""" - token: str + token: Optional[str] """The authentication token necessary to pull repo.""" - install_command: str + install_command: Optional[str] """Installation command to install and setup repository.""" diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index bff83f41a..320fa92d1 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Iterable +from typing import List, Iterable, Optional from typing_extensions import Literal, TypedDict from .after_idle import AfterIdle @@ -11,26 +11,27 @@ class LaunchParameters(TypedDict, total=False): - after_idle: AfterIdle + after_idle: Optional[AfterIdle] """Configure Devbox lifecycle based on idle activity. If after_idle is set, Devbox will ignore keep_alive_time_seconds. """ - available_ports: Iterable[int] + available_ports: Optional[Iterable[int]] """A list of ports to make available on the Devbox. - Call createTunnel to open a tunnel to the port. + Only ports made available will be surfaced to create tunnels via the + 'createTunnel' API. """ - keep_alive_time_seconds: int + keep_alive_time_seconds: Optional[int] """Time in seconds after which Devbox will automatically shutdown. Default is 1 hour. """ - launch_commands: List[str] + launch_commands: Optional[List[str]] """Set of commands to be run at launch time, before the entrypoint process is run.""" - resource_size_request: Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "XX_LARGE", "CUSTOM_SIZE"] + resource_size_request: Optional[Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "XX_LARGE", "CUSTOM_SIZE"]] """Manual resource configuration for Devbox. If not set, defaults will be used.""" diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index d2e37de0e..0b17d6067 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -17,63 +17,6 @@ class TestExecutions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @parametrize - def test_method_retrieve(self, client: Runloop) -> None: - execution = client.devboxes.executions.retrieve( - execution_id="execution_id", - id="id", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - def test_method_retrieve_with_all_params(self, client: Runloop) -> None: - execution = client.devboxes.executions.retrieve( - execution_id="execution_id", - id="id", - last_n="last_n", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - def test_raw_response_retrieve(self, client: Runloop) -> None: - response = client.devboxes.executions.with_raw_response.retrieve( - execution_id="execution_id", - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - execution = response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - def test_streaming_response_retrieve(self, client: Runloop) -> None: - with client.devboxes.executions.with_streaming_response.retrieve( - execution_id="execution_id", - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - execution = response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_retrieve(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.executions.with_raw_response.retrieve( - execution_id="execution_id", - id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): - client.devboxes.executions.with_raw_response.retrieve( - execution_id="", - id="id", - ) - @parametrize def test_method_execute_async(self, client: Runloop) -> None: execution = client.devboxes.executions.execute_async( @@ -176,115 +119,10 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: command="command", ) - @parametrize - def test_method_kill(self, client: Runloop) -> None: - execution = client.devboxes.executions.kill( - execution_id="execution_id", - id="id", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - def test_raw_response_kill(self, client: Runloop) -> None: - response = client.devboxes.executions.with_raw_response.kill( - execution_id="execution_id", - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - execution = response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - def test_streaming_response_kill(self, client: Runloop) -> None: - with client.devboxes.executions.with_streaming_response.kill( - execution_id="execution_id", - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - execution = response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_kill(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.executions.with_raw_response.kill( - execution_id="execution_id", - id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): - client.devboxes.executions.with_raw_response.kill( - execution_id="", - id="id", - ) - class TestAsyncExecutions: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - @parametrize - async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: - execution = await async_client.devboxes.executions.retrieve( - execution_id="execution_id", - id="id", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - async def test_method_retrieve_with_all_params(self, async_client: AsyncRunloop) -> None: - execution = await async_client.devboxes.executions.retrieve( - execution_id="execution_id", - id="id", - last_n="last_n", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.executions.with_raw_response.retrieve( - execution_id="execution_id", - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - execution = await response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.executions.with_streaming_response.retrieve( - execution_id="execution_id", - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - execution = await response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.executions.with_raw_response.retrieve( - execution_id="execution_id", - id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): - await async_client.devboxes.executions.with_raw_response.retrieve( - execution_id="", - id="id", - ) - @parametrize async def test_method_execute_async(self, async_client: AsyncRunloop) -> None: execution = await async_client.devboxes.executions.execute_async( @@ -386,51 +224,3 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non id="", command="command", ) - - @parametrize - async def test_method_kill(self, async_client: AsyncRunloop) -> None: - execution = await async_client.devboxes.executions.kill( - execution_id="execution_id", - id="id", - ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - async def test_raw_response_kill(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.executions.with_raw_response.kill( - execution_id="execution_id", - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - execution = await response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - @parametrize - async def test_streaming_response_kill(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.executions.with_streaming_response.kill( - execution_id="execution_id", - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - execution = await response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_kill(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.executions.with_raw_response.kill( - execution_id="execution_id", - id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): - await async_client.devboxes.executions.with_raw_response.kill( - execution_id="", - id="id", - ) diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py new file mode 100644 index 000000000..8f02db8d8 --- /dev/null +++ b/tests/api_resources/devboxes/test_lsp.py @@ -0,0 +1,1607 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + LspFilesResponse, + DiagnosticsResponse, + FileContentsResponse, + HealthStatusResponse, + SignatureHelpResponse, + CodeSegmentInfoResponse, + CodeActionApplicationResult, + LspGetCodeActionsForDiagnosticResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestLsp: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_apply_code_action(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_raw_response_apply_code_action(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + def test_streaming_response_apply_code_action(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_apply_code_action(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + def test_method_code_actions(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_method_code_actions_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_code_actions(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_code_actions(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_code_actions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + def test_method_diagnostics(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_diagnostics(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_diagnostics(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_diagnostics(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + def test_method_document_symbols(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_document_symbols(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_document_symbols(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_document_symbols(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + def test_method_file(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_file(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + def test_method_file_definition(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_file_definition(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_file_definition(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_file_definition(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_files(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_files(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_files(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_files(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + def test_method_formatting(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_formatting(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_formatting(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_formatting(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + def test_method_get_code_segment_info(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_code_segment_info(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + def test_method_get_signature_help(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_get_signature_help(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_get_signature_help(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get_signature_help(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_health(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_raw_response_health(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + def test_streaming_response_health(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_health(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + def test_method_references(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_raw_response_references(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + def test_streaming_response_references(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_references(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + def test_method_set_watch_directory(self, client: Runloop) -> None: + lsp = client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_raw_response_set_watch_directory(self, client: Runloop) -> None: + response = client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: + with client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_set_watch_directory(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) + + +class TestAsyncLsp: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.apply_code_action( + id="id", + title="title", + command={ + "command": "command", + "title": "title", + "arguments": [{}], + }, + edit={ + "changes": { + "foo": [ + { + "new_text": "newText", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + } + ] + } + }, + is_preferred=True, + ) + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="id", + title="title", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( + id="id", + title="title", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.apply_code_action( + id="", + title="title", + ) + + @parametrize + async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.code_actions( + id="id", + uri="uri", + context={ + "diagnostics": [ + { + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "code_description": {"href": "href"}, + "data": {}, + "related_information": [ + { + "location": { + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "uri": "uri", + }, + "message": "message", + } + ], + "severity": 1, + "source": "source", + "tags": [1], + } + ], + "only": ["string"], + "trigger_kind": 1, + }, + range={ + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.code_actions( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.code_actions( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.code_actions( + id="", + uri="uri", + ) + + @parametrize + async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.diagnostics( + id="id", + uri="uri", + ) + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.diagnostics( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.diagnostics( + id="", + uri="uri", + ) + + @parametrize + async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.document_symbols( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.document_symbols( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.document_symbols( + id="", + uri="uri", + ) + + @parametrize + async def test_method_file(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file( + id="id", + path="path", + ) + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(FileContentsResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file( + id="", + path="path", + ) + + @parametrize + async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.file_definition( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.file_definition( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_files(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.files( + "id", + ) + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.files( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.files( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspFilesResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_files(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.files( + "", + ) + + @parametrize + async def test_method_formatting(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.formatting( + id="id", + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.formatting( + id="id", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.formatting( + id="id", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.formatting( + id="", + uri="uri", + ) + + @parametrize + async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + "code": 0, + "severity": 1, + "source": "source", + }, + uri="uri", + ) + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( + id="id", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( + id="", + diagnostic={ + "message": "message", + "range": { + "end": { + "character": 0, + "line": 0, + }, + "start": { + "character": 0, + "line": 0, + }, + }, + }, + uri="uri", + ) + + @parametrize + async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + symbol_type="function", + ) + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( + id="id", + symbol_name="symbolName", + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( + id="", + symbol_name="symbolName", + uri="uri", + ) + + @parametrize + async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.get_signature_help( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_health(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.health( + "id", + ) + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.health( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.health( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(HealthStatusResponse, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_health(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.health( + "", + ) + + @parametrize + async def test_method_references(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.references( + id="id", + character=0, + line=0, + uri="uri", + ) + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.references( + id="id", + character=0, + line=0, + uri="uri", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(object, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_references(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.references( + id="", + character=0, + line=0, + uri="uri", + ) + + @parametrize + async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: + lsp = await async_client.devboxes.lsp.set_watch_directory( + id="id", + path="path", + ) + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="id", + path="path", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + @parametrize + async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( + id="id", + path="path", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + lsp = await response.parse() + assert_matches_type(str, lsp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.lsp.with_raw_response.set_watch_directory( + id="", + path="path", + ) diff --git a/tests/api_resources/functions/test_invocations.py b/tests/api_resources/functions/test_invocations.py deleted file mode 100644 index 726e5843c..000000000 --- a/tests/api_resources/functions/test_invocations.py +++ /dev/null @@ -1,241 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.shared import FunctionInvocationExecutionDetailView -from runloop_api_client.types.functions import FunctionInvocationListView - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestInvocations: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_retrieve(self, client: Runloop) -> None: - invocation = client.functions.invocations.retrieve( - "invocationId", - ) - assert_matches_type(FunctionInvocationExecutionDetailView, invocation, path=["response"]) - - @parametrize - def test_raw_response_retrieve(self, client: Runloop) -> None: - response = client.functions.invocations.with_raw_response.retrieve( - "invocationId", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - invocation = response.parse() - assert_matches_type(FunctionInvocationExecutionDetailView, invocation, path=["response"]) - - @parametrize - def test_streaming_response_retrieve(self, client: Runloop) -> None: - with client.functions.invocations.with_streaming_response.retrieve( - "invocationId", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - invocation = response.parse() - assert_matches_type(FunctionInvocationExecutionDetailView, invocation, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_retrieve(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `invocation_id` but received ''"): - client.functions.invocations.with_raw_response.retrieve( - "", - ) - - @parametrize - def test_method_list(self, client: Runloop) -> None: - invocation = client.functions.invocations.list() - assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Runloop) -> None: - invocation = client.functions.invocations.list( - limit=0, - starting_after="starting_after", - ) - assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Runloop) -> None: - response = client.functions.invocations.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - invocation = response.parse() - assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Runloop) -> None: - with client.functions.invocations.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - invocation = response.parse() - assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_kill(self, client: Runloop) -> None: - invocation = client.functions.invocations.kill( - "invocationId", - ) - assert_matches_type(object, invocation, path=["response"]) - - @parametrize - def test_raw_response_kill(self, client: Runloop) -> None: - response = client.functions.invocations.with_raw_response.kill( - "invocationId", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - invocation = response.parse() - assert_matches_type(object, invocation, path=["response"]) - - @parametrize - def test_streaming_response_kill(self, client: Runloop) -> None: - with client.functions.invocations.with_streaming_response.kill( - "invocationId", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - invocation = response.parse() - assert_matches_type(object, invocation, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_kill(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `invocation_id` but received ''"): - client.functions.invocations.with_raw_response.kill( - "", - ) - - -class TestAsyncInvocations: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: - invocation = await async_client.functions.invocations.retrieve( - "invocationId", - ) - assert_matches_type(FunctionInvocationExecutionDetailView, invocation, path=["response"]) - - @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: - response = await async_client.functions.invocations.with_raw_response.retrieve( - "invocationId", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - invocation = await response.parse() - assert_matches_type(FunctionInvocationExecutionDetailView, invocation, path=["response"]) - - @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: - async with async_client.functions.invocations.with_streaming_response.retrieve( - "invocationId", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - invocation = await response.parse() - assert_matches_type(FunctionInvocationExecutionDetailView, invocation, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `invocation_id` but received ''"): - await async_client.functions.invocations.with_raw_response.retrieve( - "", - ) - - @parametrize - async def test_method_list(self, async_client: AsyncRunloop) -> None: - invocation = await async_client.functions.invocations.list() - assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: - invocation = await async_client.functions.invocations.list( - limit=0, - starting_after="starting_after", - ) - assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: - response = await async_client.functions.invocations.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - invocation = await response.parse() - assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: - async with async_client.functions.invocations.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - invocation = await response.parse() - assert_matches_type(FunctionInvocationListView, invocation, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_kill(self, async_client: AsyncRunloop) -> None: - invocation = await async_client.functions.invocations.kill( - "invocationId", - ) - assert_matches_type(object, invocation, path=["response"]) - - @parametrize - async def test_raw_response_kill(self, async_client: AsyncRunloop) -> None: - response = await async_client.functions.invocations.with_raw_response.kill( - "invocationId", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - invocation = await response.parse() - assert_matches_type(object, invocation, path=["response"]) - - @parametrize - async def test_streaming_response_kill(self, async_client: AsyncRunloop) -> None: - async with async_client.functions.invocations.with_streaming_response.kill( - "invocationId", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - invocation = await response.parse() - assert_matches_type(object, invocation, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_kill(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `invocation_id` but received ''"): - await async_client.functions.invocations.with_raw_response.kill( - "", - ) diff --git a/tests/api_resources/projects/__init__.py b/tests/api_resources/projects/__init__.py deleted file mode 100644 index fd8019a9a..000000000 --- a/tests/api_resources/projects/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/projects/test_logs.py b/tests/api_resources/projects/test_logs.py deleted file mode 100644 index d907ef5ad..000000000 --- a/tests/api_resources/projects/test_logs.py +++ /dev/null @@ -1,98 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.shared import ProjectLogsView - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLogs: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_list(self, client: Runloop) -> None: - log = client.projects.logs.list( - "id", - ) - assert_matches_type(ProjectLogsView, log, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Runloop) -> None: - response = client.projects.logs.with_raw_response.list( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - log = response.parse() - assert_matches_type(ProjectLogsView, log, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Runloop) -> None: - with client.projects.logs.with_streaming_response.list( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - log = response.parse() - assert_matches_type(ProjectLogsView, log, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.projects.logs.with_raw_response.list( - "", - ) - - -class TestAsyncLogs: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_list(self, async_client: AsyncRunloop) -> None: - log = await async_client.projects.logs.list( - "id", - ) - assert_matches_type(ProjectLogsView, log, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: - response = await async_client.projects.logs.with_raw_response.list( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - log = await response.parse() - assert_matches_type(ProjectLogsView, log, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: - async with async_client.projects.logs.with_streaming_response.list( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - log = await response.parse() - assert_matches_type(ProjectLogsView, log, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.projects.logs.with_raw_response.list( - "", - ) diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index f0f4fc6ba..0fc433dba 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -11,10 +11,10 @@ from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types import ( BlueprintView, - BlueprintListView, BlueprintPreviewView, BlueprintBuildLogsListView, ) +from runloop_api_client.pagination import SyncBlueprintsCursorIDPage, AsyncBlueprintsCursorIDPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -122,7 +122,7 @@ def test_path_params_retrieve(self, client: Runloop) -> None: @parametrize def test_method_list(self, client: Runloop) -> None: blueprint = client.blueprints.list() - assert_matches_type(BlueprintListView, blueprint, path=["response"]) + assert_matches_type(SyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: @@ -131,7 +131,7 @@ def test_method_list_with_all_params(self, client: Runloop) -> None: name="name", starting_after="starting_after", ) - assert_matches_type(BlueprintListView, blueprint, path=["response"]) + assert_matches_type(SyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -140,7 +140,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" blueprint = response.parse() - assert_matches_type(BlueprintListView, blueprint, path=["response"]) + assert_matches_type(SyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -149,7 +149,7 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" blueprint = response.parse() - assert_matches_type(BlueprintListView, blueprint, path=["response"]) + assert_matches_type(SyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"]) assert cast(Any, response.is_closed) is True @@ -354,7 +354,7 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.list() - assert_matches_type(BlueprintListView, blueprint, path=["response"]) + assert_matches_type(AsyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -363,7 +363,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> name="name", starting_after="starting_after", ) - assert_matches_type(BlueprintListView, blueprint, path=["response"]) + assert_matches_type(AsyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -372,7 +372,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" blueprint = await response.parse() - assert_matches_type(BlueprintListView, blueprint, path=["response"]) + assert_matches_type(AsyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -381,7 +381,7 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" blueprint = await response.parse() - assert_matches_type(BlueprintListView, blueprint, path=["response"]) + assert_matches_type(AsyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 33b7bf481..843c1b21d 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -13,10 +13,8 @@ from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types import ( DevboxView, - DevboxListView, DevboxTunnelView, DevboxSnapshotView, - DevboxSnapshotListView, DevboxExecutionDetailView, DevboxCreateSSHKeyResponse, DevboxAsyncExecutionDetailView, @@ -27,6 +25,12 @@ StreamedBinaryAPIResponse, AsyncStreamedBinaryAPIResponse, ) +from runloop_api_client.pagination import ( + SyncDevboxesCursorIDPage, + AsyncDevboxesCursorIDPage, + SyncDiskSnapshotsCursorIDPage, + AsyncDiskSnapshotsCursorIDPage, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -133,16 +137,16 @@ def test_path_params_retrieve(self, client: Runloop) -> None: @parametrize def test_method_list(self, client: Runloop) -> None: devbox = client.devboxes.list() - assert_matches_type(DevboxListView, devbox, path=["response"]) + assert_matches_type(SyncDevboxesCursorIDPage[DevboxView], devbox, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.list( limit=0, starting_after="starting_after", - status="status", + status="provisioning", ) - assert_matches_type(DevboxListView, devbox, path=["response"]) + assert_matches_type(SyncDevboxesCursorIDPage[DevboxView], devbox, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -151,7 +155,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert_matches_type(DevboxListView, devbox, path=["response"]) + assert_matches_type(SyncDevboxesCursorIDPage[DevboxView], devbox, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -160,7 +164,7 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert_matches_type(DevboxListView, devbox, path=["response"]) + assert_matches_type(SyncDevboxesCursorIDPage[DevboxView], devbox, path=["response"]) assert cast(Any, response.is_closed) is True @@ -245,38 +249,43 @@ def test_path_params_create_tunnel(self, client: Runloop) -> None: ) @parametrize - def test_method_disk_snapshots(self, client: Runloop) -> None: - devbox = client.devboxes.disk_snapshots() - assert_matches_type(DevboxSnapshotListView, devbox, path=["response"]) - - @parametrize - def test_method_disk_snapshots_with_all_params(self, client: Runloop) -> None: - devbox = client.devboxes.disk_snapshots( - limit=0, - starting_after="starting_after", + def test_method_delete_disk_snapshot(self, client: Runloop) -> None: + devbox = client.devboxes.delete_disk_snapshot( + "id", ) - assert_matches_type(DevboxSnapshotListView, devbox, path=["response"]) + assert_matches_type(object, devbox, path=["response"]) @parametrize - def test_raw_response_disk_snapshots(self, client: Runloop) -> None: - response = client.devboxes.with_raw_response.disk_snapshots() + def test_raw_response_delete_disk_snapshot(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.delete_disk_snapshot( + "id", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert_matches_type(DevboxSnapshotListView, devbox, path=["response"]) + assert_matches_type(object, devbox, path=["response"]) @parametrize - def test_streaming_response_disk_snapshots(self, client: Runloop) -> None: - with client.devboxes.with_streaming_response.disk_snapshots() as response: + def test_streaming_response_delete_disk_snapshot(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.delete_disk_snapshot( + "id", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert_matches_type(DevboxSnapshotListView, devbox, path=["response"]) + assert_matches_type(object, devbox, path=["response"]) assert cast(Any, response.is_closed) is True + @parametrize + def test_path_params_delete_disk_snapshot(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.delete_disk_snapshot( + "", + ) + @pytest.mark.skip(reason="prism can't support octet") @parametrize @pytest.mark.respx(base_url=base_url) @@ -475,6 +484,40 @@ def test_path_params_keep_alive(self, client: Runloop) -> None: "", ) + @parametrize + def test_method_list_disk_snapshots(self, client: Runloop) -> None: + devbox = client.devboxes.list_disk_snapshots() + assert_matches_type(SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], devbox, path=["response"]) + + @parametrize + def test_method_list_disk_snapshots_with_all_params(self, client: Runloop) -> None: + devbox = client.devboxes.list_disk_snapshots( + devbox_id="devbox_id", + limit=0, + starting_after="starting_after", + ) + assert_matches_type(SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], devbox, path=["response"]) + + @parametrize + def test_raw_response_list_disk_snapshots(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.list_disk_snapshots() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], devbox, path=["response"]) + + @parametrize + def test_streaming_response_list_disk_snapshots(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.list_disk_snapshots() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_read_file_contents(self, client: Runloop) -> None: devbox = client.devboxes.read_file_contents( @@ -517,6 +560,48 @@ def test_path_params_read_file_contents(self, client: Runloop) -> None: file_path="file_path", ) + @parametrize + def test_method_remove_tunnel(self, client: Runloop) -> None: + devbox = client.devboxes.remove_tunnel( + id="id", + port=0, + ) + assert_matches_type(DevboxTunnelView, devbox, path=["response"]) + + @parametrize + def test_raw_response_remove_tunnel(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.remove_tunnel( + id="id", + port=0, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(DevboxTunnelView, devbox, path=["response"]) + + @parametrize + def test_streaming_response_remove_tunnel(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.remove_tunnel( + id="id", + port=0, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(DevboxTunnelView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_remove_tunnel(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.remove_tunnel( + id="", + port=0, + ) + @parametrize def test_method_resume(self, client: Runloop) -> None: devbox = client.devboxes.resume( @@ -682,6 +767,7 @@ def test_path_params_suspend(self, client: Runloop) -> None: def test_method_upload_file(self, client: Runloop) -> None: devbox = client.devboxes.upload_file( id="id", + path="path", ) assert_matches_type(object, devbox, path=["response"]) @@ -689,8 +775,8 @@ def test_method_upload_file(self, client: Runloop) -> None: def test_method_upload_file_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.upload_file( id="id", - file=b"raw file contents", path="path", + file=b"raw file contents", ) assert_matches_type(object, devbox, path=["response"]) @@ -698,6 +784,7 @@ def test_method_upload_file_with_all_params(self, client: Runloop) -> None: def test_raw_response_upload_file(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.upload_file( id="id", + path="path", ) assert response.is_closed is True @@ -709,6 +796,7 @@ def test_raw_response_upload_file(self, client: Runloop) -> None: def test_streaming_response_upload_file(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.upload_file( id="id", + path="path", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -723,11 +811,12 @@ def test_path_params_upload_file(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.with_raw_response.upload_file( id="", + path="path", ) @parametrize - def test_method_write_file(self, client: Runloop) -> None: - devbox = client.devboxes.write_file( + def test_method_write_file_contents(self, client: Runloop) -> None: + devbox = client.devboxes.write_file_contents( id="id", contents="contents", file_path="file_path", @@ -735,8 +824,8 @@ def test_method_write_file(self, client: Runloop) -> None: assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize - def test_raw_response_write_file(self, client: Runloop) -> None: - response = client.devboxes.with_raw_response.write_file( + def test_raw_response_write_file_contents(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.write_file_contents( id="id", contents="contents", file_path="file_path", @@ -748,8 +837,8 @@ def test_raw_response_write_file(self, client: Runloop) -> None: assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize - def test_streaming_response_write_file(self, client: Runloop) -> None: - with client.devboxes.with_streaming_response.write_file( + def test_streaming_response_write_file_contents(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.write_file_contents( id="id", contents="contents", file_path="file_path", @@ -763,9 +852,9 @@ def test_streaming_response_write_file(self, client: Runloop) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_write_file(self, client: Runloop) -> None: + def test_path_params_write_file_contents(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.with_raw_response.write_file( + client.devboxes.with_raw_response.write_file_contents( id="", contents="contents", file_path="file_path", @@ -874,16 +963,16 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.list() - assert_matches_type(DevboxListView, devbox, path=["response"]) + assert_matches_type(AsyncDevboxesCursorIDPage[DevboxView], devbox, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.list( limit=0, starting_after="starting_after", - status="status", + status="provisioning", ) - assert_matches_type(DevboxListView, devbox, path=["response"]) + assert_matches_type(AsyncDevboxesCursorIDPage[DevboxView], devbox, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -892,7 +981,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert_matches_type(DevboxListView, devbox, path=["response"]) + assert_matches_type(AsyncDevboxesCursorIDPage[DevboxView], devbox, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -901,7 +990,7 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert_matches_type(DevboxListView, devbox, path=["response"]) + assert_matches_type(AsyncDevboxesCursorIDPage[DevboxView], devbox, path=["response"]) assert cast(Any, response.is_closed) is True @@ -986,38 +1075,43 @@ async def test_path_params_create_tunnel(self, async_client: AsyncRunloop) -> No ) @parametrize - async def test_method_disk_snapshots(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.disk_snapshots() - assert_matches_type(DevboxSnapshotListView, devbox, path=["response"]) - - @parametrize - async def test_method_disk_snapshots_with_all_params(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.disk_snapshots( - limit=0, - starting_after="starting_after", + async def test_method_delete_disk_snapshot(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.delete_disk_snapshot( + "id", ) - assert_matches_type(DevboxSnapshotListView, devbox, path=["response"]) + assert_matches_type(object, devbox, path=["response"]) @parametrize - async def test_raw_response_disk_snapshots(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.with_raw_response.disk_snapshots() + async def test_raw_response_delete_disk_snapshot(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.delete_disk_snapshot( + "id", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert_matches_type(DevboxSnapshotListView, devbox, path=["response"]) + assert_matches_type(object, devbox, path=["response"]) @parametrize - async def test_streaming_response_disk_snapshots(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.with_streaming_response.disk_snapshots() as response: + async def test_streaming_response_delete_disk_snapshot(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.delete_disk_snapshot( + "id", + ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert_matches_type(DevboxSnapshotListView, devbox, path=["response"]) + assert_matches_type(object, devbox, path=["response"]) assert cast(Any, response.is_closed) is True + @parametrize + async def test_path_params_delete_disk_snapshot(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.delete_disk_snapshot( + "", + ) + @pytest.mark.skip(reason="prism can't support octet") @parametrize @pytest.mark.respx(base_url=base_url) @@ -1216,6 +1310,40 @@ async def test_path_params_keep_alive(self, async_client: AsyncRunloop) -> None: "", ) + @parametrize + async def test_method_list_disk_snapshots(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.list_disk_snapshots() + assert_matches_type(AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], devbox, path=["response"]) + + @parametrize + async def test_method_list_disk_snapshots_with_all_params(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.list_disk_snapshots( + devbox_id="devbox_id", + limit=0, + starting_after="starting_after", + ) + assert_matches_type(AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], devbox, path=["response"]) + + @parametrize + async def test_raw_response_list_disk_snapshots(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.list_disk_snapshots() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], devbox, path=["response"]) + + @parametrize + async def test_streaming_response_list_disk_snapshots(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.list_disk_snapshots() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_read_file_contents(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.read_file_contents( @@ -1258,6 +1386,48 @@ async def test_path_params_read_file_contents(self, async_client: AsyncRunloop) file_path="file_path", ) + @parametrize + async def test_method_remove_tunnel(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.remove_tunnel( + id="id", + port=0, + ) + assert_matches_type(DevboxTunnelView, devbox, path=["response"]) + + @parametrize + async def test_raw_response_remove_tunnel(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.remove_tunnel( + id="id", + port=0, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(DevboxTunnelView, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_remove_tunnel(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.remove_tunnel( + id="id", + port=0, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(DevboxTunnelView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_remove_tunnel(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.remove_tunnel( + id="", + port=0, + ) + @parametrize async def test_method_resume(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.resume( @@ -1423,6 +1593,7 @@ async def test_path_params_suspend(self, async_client: AsyncRunloop) -> None: async def test_method_upload_file(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.upload_file( id="id", + path="path", ) assert_matches_type(object, devbox, path=["response"]) @@ -1430,8 +1601,8 @@ async def test_method_upload_file(self, async_client: AsyncRunloop) -> None: async def test_method_upload_file_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.upload_file( id="id", - file=b"raw file contents", path="path", + file=b"raw file contents", ) assert_matches_type(object, devbox, path=["response"]) @@ -1439,6 +1610,7 @@ async def test_method_upload_file_with_all_params(self, async_client: AsyncRunlo async def test_raw_response_upload_file(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.upload_file( id="id", + path="path", ) assert response.is_closed is True @@ -1450,6 +1622,7 @@ async def test_raw_response_upload_file(self, async_client: AsyncRunloop) -> Non async def test_streaming_response_upload_file(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.upload_file( id="id", + path="path", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1464,11 +1637,12 @@ async def test_path_params_upload_file(self, async_client: AsyncRunloop) -> None with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.with_raw_response.upload_file( id="", + path="path", ) @parametrize - async def test_method_write_file(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.write_file( + async def test_method_write_file_contents(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.write_file_contents( id="id", contents="contents", file_path="file_path", @@ -1476,8 +1650,8 @@ async def test_method_write_file(self, async_client: AsyncRunloop) -> None: assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize - async def test_raw_response_write_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.with_raw_response.write_file( + async def test_raw_response_write_file_contents(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.write_file_contents( id="id", contents="contents", file_path="file_path", @@ -1489,8 +1663,8 @@ async def test_raw_response_write_file(self, async_client: AsyncRunloop) -> None assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize - async def test_streaming_response_write_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.with_streaming_response.write_file( + async def test_streaming_response_write_file_contents(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.write_file_contents( id="id", contents="contents", file_path="file_path", @@ -1504,9 +1678,9 @@ async def test_streaming_response_write_file(self, async_client: AsyncRunloop) - assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_write_file(self, async_client: AsyncRunloop) -> None: + async def test_path_params_write_file_contents(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.with_raw_response.write_file( + await async_client.devboxes.with_raw_response.write_file_contents( id="", contents="contents", file_path="file_path", diff --git a/tests/api_resources/test_functions.py b/tests/api_resources/test_functions.py deleted file mode 100644 index e168b5de1..000000000 --- a/tests/api_resources/test_functions.py +++ /dev/null @@ -1,325 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types import FunctionListView -from runloop_api_client.types.shared import FunctionInvocationExecutionDetailView - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestFunctions: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_list(self, client: Runloop) -> None: - function = client.functions.list() - assert_matches_type(FunctionListView, function, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Runloop) -> None: - response = client.functions.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - function = response.parse() - assert_matches_type(FunctionListView, function, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Runloop) -> None: - with client.functions.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - function = response.parse() - assert_matches_type(FunctionListView, function, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_invoke_async(self, client: Runloop) -> None: - function = client.functions.invoke_async( - function_name="function_name", - project_name="project_name", - request={}, - ) - assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) - - @parametrize - def test_method_invoke_async_with_all_params(self, client: Runloop) -> None: - function = client.functions.invoke_async( - function_name="function_name", - project_name="project_name", - request={}, - runloop_meta={"session_id": "session_id"}, - ) - assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) - - @parametrize - def test_raw_response_invoke_async(self, client: Runloop) -> None: - response = client.functions.with_raw_response.invoke_async( - function_name="function_name", - project_name="project_name", - request={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - function = response.parse() - assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) - - @parametrize - def test_streaming_response_invoke_async(self, client: Runloop) -> None: - with client.functions.with_streaming_response.invoke_async( - function_name="function_name", - project_name="project_name", - request={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - function = response.parse() - assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_invoke_async(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): - client.functions.with_raw_response.invoke_async( - function_name="function_name", - project_name="", - request={}, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): - client.functions.with_raw_response.invoke_async( - function_name="", - project_name="project_name", - request={}, - ) - - @parametrize - def test_method_invoke_sync(self, client: Runloop) -> None: - function = client.functions.invoke_sync( - function_name="function_name", - project_name="project_name", - request={}, - ) - assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) - - @parametrize - def test_method_invoke_sync_with_all_params(self, client: Runloop) -> None: - function = client.functions.invoke_sync( - function_name="function_name", - project_name="project_name", - request={}, - runloop_meta={"session_id": "session_id"}, - ) - assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) - - @parametrize - def test_raw_response_invoke_sync(self, client: Runloop) -> None: - response = client.functions.with_raw_response.invoke_sync( - function_name="function_name", - project_name="project_name", - request={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - function = response.parse() - assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) - - @parametrize - def test_streaming_response_invoke_sync(self, client: Runloop) -> None: - with client.functions.with_streaming_response.invoke_sync( - function_name="function_name", - project_name="project_name", - request={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - function = response.parse() - assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_invoke_sync(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): - client.functions.with_raw_response.invoke_sync( - function_name="function_name", - project_name="", - request={}, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): - client.functions.with_raw_response.invoke_sync( - function_name="", - project_name="project_name", - request={}, - ) - - -class TestAsyncFunctions: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_list(self, async_client: AsyncRunloop) -> None: - function = await async_client.functions.list() - assert_matches_type(FunctionListView, function, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: - response = await async_client.functions.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - function = await response.parse() - assert_matches_type(FunctionListView, function, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: - async with async_client.functions.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - function = await response.parse() - assert_matches_type(FunctionListView, function, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_invoke_async(self, async_client: AsyncRunloop) -> None: - function = await async_client.functions.invoke_async( - function_name="function_name", - project_name="project_name", - request={}, - ) - assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) - - @parametrize - async def test_method_invoke_async_with_all_params(self, async_client: AsyncRunloop) -> None: - function = await async_client.functions.invoke_async( - function_name="function_name", - project_name="project_name", - request={}, - runloop_meta={"session_id": "session_id"}, - ) - assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) - - @parametrize - async def test_raw_response_invoke_async(self, async_client: AsyncRunloop) -> None: - response = await async_client.functions.with_raw_response.invoke_async( - function_name="function_name", - project_name="project_name", - request={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - function = await response.parse() - assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) - - @parametrize - async def test_streaming_response_invoke_async(self, async_client: AsyncRunloop) -> None: - async with async_client.functions.with_streaming_response.invoke_async( - function_name="function_name", - project_name="project_name", - request={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - function = await response.parse() - assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_invoke_async(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): - await async_client.functions.with_raw_response.invoke_async( - function_name="function_name", - project_name="", - request={}, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): - await async_client.functions.with_raw_response.invoke_async( - function_name="", - project_name="project_name", - request={}, - ) - - @parametrize - async def test_method_invoke_sync(self, async_client: AsyncRunloop) -> None: - function = await async_client.functions.invoke_sync( - function_name="function_name", - project_name="project_name", - request={}, - ) - assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) - - @parametrize - async def test_method_invoke_sync_with_all_params(self, async_client: AsyncRunloop) -> None: - function = await async_client.functions.invoke_sync( - function_name="function_name", - project_name="project_name", - request={}, - runloop_meta={"session_id": "session_id"}, - ) - assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) - - @parametrize - async def test_raw_response_invoke_sync(self, async_client: AsyncRunloop) -> None: - response = await async_client.functions.with_raw_response.invoke_sync( - function_name="function_name", - project_name="project_name", - request={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - function = await response.parse() - assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) - - @parametrize - async def test_streaming_response_invoke_sync(self, async_client: AsyncRunloop) -> None: - async with async_client.functions.with_streaming_response.invoke_sync( - function_name="function_name", - project_name="project_name", - request={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - function = await response.parse() - assert_matches_type(FunctionInvocationExecutionDetailView, function, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_invoke_sync(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `project_name` but received ''"): - await async_client.functions.with_raw_response.invoke_sync( - function_name="function_name", - project_name="", - request={}, - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `function_name` but received ''"): - await async_client.functions.with_raw_response.invoke_sync( - function_name="", - project_name="project_name", - request={}, - ) diff --git a/tests/api_resources/test_projects.py b/tests/api_resources/test_projects.py deleted file mode 100644 index 7ba7ea501..000000000 --- a/tests/api_resources/test_projects.py +++ /dev/null @@ -1,72 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types import ProjectListView - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestProjects: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_list(self, client: Runloop) -> None: - project = client.projects.list() - assert_matches_type(ProjectListView, project, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Runloop) -> None: - response = client.projects.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - project = response.parse() - assert_matches_type(ProjectListView, project, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Runloop) -> None: - with client.projects.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - project = response.parse() - assert_matches_type(ProjectListView, project, path=["response"]) - - assert cast(Any, response.is_closed) is True - - -class TestAsyncProjects: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - async def test_method_list(self, async_client: AsyncRunloop) -> None: - project = await async_client.projects.list() - assert_matches_type(ProjectListView, project, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: - response = await async_client.projects.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - project = await response.parse() - assert_matches_type(ProjectListView, project, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: - async with async_client.projects.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - project = await response.parse() - assert_matches_type(ProjectListView, project, path=["response"]) - - assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_repositories.py b/tests/api_resources/test_repositories.py new file mode 100644 index 000000000..6107fe5f9 --- /dev/null +++ b/tests/api_resources/test_repositories.py @@ -0,0 +1,388 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types import ( + RepositoryConnectionView, + RepositoryVersionListView, +) +from runloop_api_client.pagination import SyncRepositoriesCursorIDPage, AsyncRepositoriesCursorIDPage + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestRepositories: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Runloop) -> None: + repository = client.repositories.create( + name="name", + owner="owner", + ) + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Runloop) -> None: + response = client.repositories.with_raw_response.create( + name="name", + owner="owner", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = response.parse() + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Runloop) -> None: + with client.repositories.with_streaming_response.create( + name="name", + owner="owner", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = response.parse() + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + repository = client.repositories.retrieve( + "id", + ) + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.repositories.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = response.parse() + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.repositories.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = response.parse() + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.repositories.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + repository = client.repositories.list() + assert_matches_type(SyncRepositoriesCursorIDPage[RepositoryConnectionView], repository, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + repository = client.repositories.list( + limit=0, + starting_after="starting_after", + ) + assert_matches_type(SyncRepositoriesCursorIDPage[RepositoryConnectionView], repository, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.repositories.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = response.parse() + assert_matches_type(SyncRepositoriesCursorIDPage[RepositoryConnectionView], repository, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.repositories.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = response.parse() + assert_matches_type(SyncRepositoriesCursorIDPage[RepositoryConnectionView], repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_delete(self, client: Runloop) -> None: + repository = client.repositories.delete( + "id", + ) + assert_matches_type(object, repository, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Runloop) -> None: + response = client.repositories.with_raw_response.delete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = response.parse() + assert_matches_type(object, repository, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Runloop) -> None: + with client.repositories.with_streaming_response.delete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = response.parse() + assert_matches_type(object, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.repositories.with_raw_response.delete( + "", + ) + + @parametrize + def test_method_versions(self, client: Runloop) -> None: + repository = client.repositories.versions( + "id", + ) + assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + + @parametrize + def test_raw_response_versions(self, client: Runloop) -> None: + response = client.repositories.with_raw_response.versions( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = response.parse() + assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + + @parametrize + def test_streaming_response_versions(self, client: Runloop) -> None: + with client.repositories.with_streaming_response.versions( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = response.parse() + assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_versions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.repositories.with_raw_response.versions( + "", + ) + + +class TestAsyncRepositories: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncRunloop) -> None: + repository = await async_client.repositories.create( + name="name", + owner="owner", + ) + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: + response = await async_client.repositories.with_raw_response.create( + name="name", + owner="owner", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = await response.parse() + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: + async with async_client.repositories.with_streaming_response.create( + name="name", + owner="owner", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = await response.parse() + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + repository = await async_client.repositories.retrieve( + "id", + ) + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.repositories.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = await response.parse() + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.repositories.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = await response.parse() + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.repositories.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + repository = await async_client.repositories.list() + assert_matches_type(AsyncRepositoriesCursorIDPage[RepositoryConnectionView], repository, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + repository = await async_client.repositories.list( + limit=0, + starting_after="starting_after", + ) + assert_matches_type(AsyncRepositoriesCursorIDPage[RepositoryConnectionView], repository, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.repositories.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = await response.parse() + assert_matches_type(AsyncRepositoriesCursorIDPage[RepositoryConnectionView], repository, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.repositories.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = await response.parse() + assert_matches_type(AsyncRepositoriesCursorIDPage[RepositoryConnectionView], repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete(self, async_client: AsyncRunloop) -> None: + repository = await async_client.repositories.delete( + "id", + ) + assert_matches_type(object, repository, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncRunloop) -> None: + response = await async_client.repositories.with_raw_response.delete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = await response.parse() + assert_matches_type(object, repository, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncRunloop) -> None: + async with async_client.repositories.with_streaming_response.delete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = await response.parse() + assert_matches_type(object, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.repositories.with_raw_response.delete( + "", + ) + + @parametrize + async def test_method_versions(self, async_client: AsyncRunloop) -> None: + repository = await async_client.repositories.versions( + "id", + ) + assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + + @parametrize + async def test_raw_response_versions(self, async_client: AsyncRunloop) -> None: + response = await async_client.repositories.with_raw_response.versions( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = await response.parse() + assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + + @parametrize + async def test_streaming_response_versions(self, async_client: AsyncRunloop) -> None: + async with async_client.repositories.with_streaming_response.versions( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = await response.parse() + assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_versions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.repositories.with_raw_response.versions( + "", + ) diff --git a/tests/test_client.py b/tests/test_client.py index fe175a8dd..befb5ec6a 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -553,6 +553,33 @@ class Model(BaseModel): assert isinstance(response, Model) assert response.foo == 2 + @pytest.mark.respx(base_url=base_url) + def test_idempotency_header_options(self, respx_mock: MockRouter) -> None: + respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={})) + + response = self.client.post("/foo", cast_to=httpx.Response) + + header = response.request.headers.get("x-request-id") + assert header is not None + assert header.startswith("stainless-python-retry") + + # explicit header + response = self.client.post( + "/foo", cast_to=httpx.Response, options=make_request_options(extra_headers={"x-request-id": "custom-key"}) + ) + assert response.request.headers.get("x-request-id") == "custom-key" + + response = self.client.post( + "/foo", cast_to=httpx.Response, options=make_request_options(extra_headers={"x-request-id": "custom-key"}) + ) + assert response.request.headers.get("x-request-id") == "custom-key" + + # custom argument + response = self.client.post( + "/foo", cast_to=httpx.Response, options=make_request_options(idempotency_key="custom-key") + ) + assert response.request.headers.get("x-request-id") == "custom-key" + def test_base_url_setter(self) -> None: client = Runloop( base_url="https://example.com/from_init", bearer_token=bearer_token, _strict_response_validation=True @@ -1343,6 +1370,33 @@ class Model(BaseModel): assert isinstance(response, Model) assert response.foo == 2 + @pytest.mark.respx(base_url=base_url) + async def test_idempotency_header_options(self, respx_mock: MockRouter) -> None: + respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={})) + + response = await self.client.post("/foo", cast_to=httpx.Response) + + header = response.request.headers.get("x-request-id") + assert header is not None + assert header.startswith("stainless-python-retry") + + # explicit header + response = await self.client.post( + "/foo", cast_to=httpx.Response, options=make_request_options(extra_headers={"x-request-id": "custom-key"}) + ) + assert response.request.headers.get("x-request-id") == "custom-key" + + response = await self.client.post( + "/foo", cast_to=httpx.Response, options=make_request_options(extra_headers={"x-request-id": "custom-key"}) + ) + assert response.request.headers.get("x-request-id") == "custom-key" + + # custom argument + response = await self.client.post( + "/foo", cast_to=httpx.Response, options=make_request_options(idempotency_key="custom-key") + ) + assert response.request.headers.get("x-request-id") == "custom-key" + def test_base_url_setter(self) -> None: client = AsyncRunloop( base_url="https://example.com/from_init", bearer_token=bearer_token, _strict_response_validation=True From 412cf422967a5b1afb371122eac4ae33ce3bdbb8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 12 Jan 2025 22:59:38 +0000 Subject: [PATCH 629/993] feat(api): manual updates (#492) --- .stats.yml | 2 +- api.md | 2 + .../resources/devboxes/executions.py | 204 ++++++++++++++++- .../types/devboxes/__init__.py | 1 + .../devboxes/execution_retrieve_params.py | 14 ++ .../api_resources/devboxes/test_executions.py | 210 ++++++++++++++++++ 6 files changed, 431 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/types/devboxes/execution_retrieve_params.py diff --git a/.stats.yml b/.stats.yml index 31759036f..311ea3267 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 44 +configured_endpoints: 46 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-15f23a9e2e014d2e5d4d72c39ee31c5556060fb37d1490f308ecce5aeb41d5c8.yml diff --git a/api.md b/api.md index 00eb5ac7e..be9c20e21 100644 --- a/api.md +++ b/api.md @@ -168,8 +168,10 @@ Methods: Methods: +- client.devboxes.executions.retrieve(execution_id, \*, devbox_id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.execute_sync(id, \*\*params) -> DevboxExecutionDetailView +- client.devboxes.executions.kill(execution_id, \*, devbox_id) -> DevboxAsyncExecutionDetailView # Repositories diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index b8cc6fbf3..6d8184e0a 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -20,7 +20,7 @@ async_to_streamed_response_wrapper, ) from ..._base_client import make_request_options -from ...types.devboxes import execution_execute_sync_params, execution_execute_async_params +from ...types.devboxes import execution_retrieve_params, execution_execute_sync_params, execution_execute_async_params from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView @@ -47,6 +47,50 @@ def with_streaming_response(self) -> ExecutionsResourceWithStreamingResponse: """ return ExecutionsResourceWithStreamingResponse(self) + def retrieve( + self, + execution_id: str, + *, + devbox_id: str, + last_n: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Get the latest status of a previously launched asynchronous execuction including + stdout/error and the exit code if complete. + + Args: + last_n: Last n lines of standard error / standard out to return + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not devbox_id: + raise ValueError(f"Expected a non-empty value for `devbox_id` but received {devbox_id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + return self._get( + f"/v1/devboxes/{devbox_id}/executions/{execution_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"last_n": last_n}, execution_retrieve_params.ExecutionRetrieveParams), + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + def execute_async( self, id: str, @@ -165,6 +209,50 @@ def execute_sync( cast_to=DevboxExecutionDetailView, ) + def kill( + self, + execution_id: str, + *, + devbox_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> DevboxAsyncExecutionDetailView: + """ + Kill a previously launched asynchronous execution if it is still running by + killing the launched process. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not devbox_id: + raise ValueError(f"Expected a non-empty value for `devbox_id` but received {devbox_id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + return self._post( + f"/v1/devboxes/{devbox_id}/executions/{execution_id}/kill", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + class AsyncExecutionsResource(AsyncAPIResource): @cached_property @@ -186,6 +274,52 @@ def with_streaming_response(self) -> AsyncExecutionsResourceWithStreamingRespons """ return AsyncExecutionsResourceWithStreamingResponse(self) + async def retrieve( + self, + execution_id: str, + *, + devbox_id: str, + last_n: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxAsyncExecutionDetailView: + """ + Get the latest status of a previously launched asynchronous execuction including + stdout/error and the exit code if complete. + + Args: + last_n: Last n lines of standard error / standard out to return + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not devbox_id: + raise ValueError(f"Expected a non-empty value for `devbox_id` but received {devbox_id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + return await self._get( + f"/v1/devboxes/{devbox_id}/executions/{execution_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + {"last_n": last_n}, execution_retrieve_params.ExecutionRetrieveParams + ), + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + async def execute_async( self, id: str, @@ -304,50 +438,118 @@ async def execute_sync( cast_to=DevboxExecutionDetailView, ) + async def kill( + self, + execution_id: str, + *, + devbox_id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> DevboxAsyncExecutionDetailView: + """ + Kill a previously launched asynchronous execution if it is still running by + killing the launched process. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not devbox_id: + raise ValueError(f"Expected a non-empty value for `devbox_id` but received {devbox_id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + return await self._post( + f"/v1/devboxes/{devbox_id}/executions/{execution_id}/kill", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + class ExecutionsResourceWithRawResponse: def __init__(self, executions: ExecutionsResource) -> None: self._executions = executions + self.retrieve = to_raw_response_wrapper( + executions.retrieve, + ) self.execute_async = to_raw_response_wrapper( executions.execute_async, ) self.execute_sync = to_raw_response_wrapper( executions.execute_sync, ) + self.kill = to_raw_response_wrapper( + executions.kill, + ) class AsyncExecutionsResourceWithRawResponse: def __init__(self, executions: AsyncExecutionsResource) -> None: self._executions = executions + self.retrieve = async_to_raw_response_wrapper( + executions.retrieve, + ) self.execute_async = async_to_raw_response_wrapper( executions.execute_async, ) self.execute_sync = async_to_raw_response_wrapper( executions.execute_sync, ) + self.kill = async_to_raw_response_wrapper( + executions.kill, + ) class ExecutionsResourceWithStreamingResponse: def __init__(self, executions: ExecutionsResource) -> None: self._executions = executions + self.retrieve = to_streamed_response_wrapper( + executions.retrieve, + ) self.execute_async = to_streamed_response_wrapper( executions.execute_async, ) self.execute_sync = to_streamed_response_wrapper( executions.execute_sync, ) + self.kill = to_streamed_response_wrapper( + executions.kill, + ) class AsyncExecutionsResourceWithStreamingResponse: def __init__(self, executions: AsyncExecutionsResource) -> None: self._executions = executions + self.retrieve = async_to_streamed_response_wrapper( + executions.retrieve, + ) self.execute_async = async_to_streamed_response_wrapper( executions.execute_async, ) self.execute_sync = async_to_streamed_response_wrapper( executions.execute_sync, ) + self.kill = async_to_streamed_response_wrapper( + executions.kill, + ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index f2f7c0765..30d13b0fb 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -52,6 +52,7 @@ from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam from .code_action_context_param import CodeActionContextParam as CodeActionContextParam +from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams from .base_parameter_information import BaseParameterInformation as BaseParameterInformation from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams diff --git a/src/runloop_api_client/types/devboxes/execution_retrieve_params.py b/src/runloop_api_client/types/devboxes/execution_retrieve_params.py new file mode 100644 index 000000000..96e8bc24b --- /dev/null +++ b/src/runloop_api_client/types/devboxes/execution_retrieve_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["ExecutionRetrieveParams"] + + +class ExecutionRetrieveParams(TypedDict, total=False): + devbox_id: Required[str] + + last_n: str + """Last n lines of standard error / standard out to return""" diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index 0b17d6067..a1a7b8b58 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -17,6 +17,63 @@ class TestExecutions: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + execution = client.devboxes.executions.retrieve( + execution_id="execution_id", + devbox_id="devbox_id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_method_retrieve_with_all_params(self, client: Runloop) -> None: + execution = client.devboxes.executions.retrieve( + execution_id="execution_id", + devbox_id="devbox_id", + last_n="last_n", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.devboxes.executions.with_raw_response.retrieve( + execution_id="execution_id", + devbox_id="devbox_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.devboxes.executions.with_streaming_response.retrieve( + execution_id="execution_id", + devbox_id="devbox_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `devbox_id` but received ''"): + client.devboxes.executions.with_raw_response.retrieve( + execution_id="execution_id", + devbox_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + client.devboxes.executions.with_raw_response.retrieve( + execution_id="", + devbox_id="devbox_id", + ) + @parametrize def test_method_execute_async(self, client: Runloop) -> None: execution = client.devboxes.executions.execute_async( @@ -119,10 +176,115 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: command="command", ) + @parametrize + def test_method_kill(self, client: Runloop) -> None: + execution = client.devboxes.executions.kill( + execution_id="execution_id", + devbox_id="devbox_id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_raw_response_kill(self, client: Runloop) -> None: + response = client.devboxes.executions.with_raw_response.kill( + execution_id="execution_id", + devbox_id="devbox_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_streaming_response_kill(self, client: Runloop) -> None: + with client.devboxes.executions.with_streaming_response.kill( + execution_id="execution_id", + devbox_id="devbox_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_kill(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `devbox_id` but received ''"): + client.devboxes.executions.with_raw_response.kill( + execution_id="execution_id", + devbox_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + client.devboxes.executions.with_raw_response.kill( + execution_id="", + devbox_id="devbox_id", + ) + class TestAsyncExecutions: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.retrieve( + execution_id="execution_id", + devbox_id="devbox_id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_method_retrieve_with_all_params(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.retrieve( + execution_id="execution_id", + devbox_id="devbox_id", + last_n="last_n", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.executions.with_raw_response.retrieve( + execution_id="execution_id", + devbox_id="devbox_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.executions.with_streaming_response.retrieve( + execution_id="execution_id", + devbox_id="devbox_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `devbox_id` but received ''"): + await async_client.devboxes.executions.with_raw_response.retrieve( + execution_id="execution_id", + devbox_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + await async_client.devboxes.executions.with_raw_response.retrieve( + execution_id="", + devbox_id="devbox_id", + ) + @parametrize async def test_method_execute_async(self, async_client: AsyncRunloop) -> None: execution = await async_client.devboxes.executions.execute_async( @@ -224,3 +386,51 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non id="", command="command", ) + + @parametrize + async def test_method_kill(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.kill( + execution_id="execution_id", + devbox_id="devbox_id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_raw_response_kill(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.executions.with_raw_response.kill( + execution_id="execution_id", + devbox_id="devbox_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_streaming_response_kill(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.executions.with_streaming_response.kill( + execution_id="execution_id", + devbox_id="devbox_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_kill(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `devbox_id` but received ''"): + await async_client.devboxes.executions.with_raw_response.kill( + execution_id="execution_id", + devbox_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + await async_client.devboxes.executions.with_raw_response.kill( + execution_id="", + devbox_id="devbox_id", + ) From 11840975800206d7bac1a2b706434189ef73749d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 15 Jan 2025 00:19:06 +0000 Subject: [PATCH 630/993] chore(internal): version bump (#496) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a71305534..d52d2b974 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.12.0" + ".": "0.13.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 2de294771..bca77395d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.12.0" +version = "0.13.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 6520139ba..f053467f5 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.12.0" # x-release-please-version +__version__ = "0.13.0" # x-release-please-version From 9733b075099f01792c5e7c0fc206a0e16633c4f4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Jan 2025 06:55:54 +0000 Subject: [PATCH 631/993] chore(internal): codegen related update (#497) --- mypy.ini | 2 +- requirements-dev.lock | 4 +- src/runloop_api_client/_response.py | 8 +- .../types/devboxes/document_symbol.py | 2 +- tests/api_resources/devboxes/test_lsp.py | 108 +++++++++--------- 5 files changed, 65 insertions(+), 59 deletions(-) diff --git a/mypy.ini b/mypy.ini index f2a97a0a9..0a62aa9d6 100644 --- a/mypy.ini +++ b/mypy.ini @@ -41,7 +41,7 @@ cache_fine_grained = True # ``` # Changing this codegen to make mypy happy would increase complexity # and would not be worth it. -disable_error_code = func-returns-value +disable_error_code = func-returns-value,overload-cannot-match # https://github.com/python/mypy/issues/12162 [mypy.overrides] diff --git a/requirements-dev.lock b/requirements-dev.lock index b09819940..af145651b 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -48,7 +48,7 @@ markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py -mypy==1.13.0 +mypy==1.14.1 mypy-extensions==1.0.0 # via mypy nest-asyncio==1.6.0 @@ -68,7 +68,7 @@ pydantic-core==2.27.1 # via pydantic pygments==2.18.0 # via rich -pyright==1.1.390 +pyright==1.1.392.post0 pytest==8.3.3 # via pytest-asyncio pytest-asyncio==0.24.0 diff --git a/src/runloop_api_client/_response.py b/src/runloop_api_client/_response.py index 1d55ca296..d765ed407 100644 --- a/src/runloop_api_client/_response.py +++ b/src/runloop_api_client/_response.py @@ -210,7 +210,13 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: raise ValueError(f"Subclasses of httpx.Response cannot be passed to `cast_to`") return cast(R, response) - if inspect.isclass(origin) and not issubclass(origin, BaseModel) and issubclass(origin, pydantic.BaseModel): + if ( + inspect.isclass( + origin # pyright: ignore[reportUnknownArgumentType] + ) + and not issubclass(origin, BaseModel) + and issubclass(origin, pydantic.BaseModel) + ): raise TypeError( "Pydantic models must subclass our base model type, e.g. `from runloop_api_client import BaseModel`" ) diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py index 0e58f87ed..06f8db905 100644 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -39,7 +39,7 @@ class DocumentSymbol(BaseModel): e.g the name of a function. Must be contained by the `range`. """ - children: Optional[List[DocumentSymbol]] = None + children: Optional[List["DocumentSymbol"]] = None """Children of this symbol, e.g. properties of a class.""" deprecated: Optional[bool] = None diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py index 8f02db8d8..05e7f4b2c 100644 --- a/tests/api_resources/devboxes/test_lsp.py +++ b/tests/api_resources/devboxes/test_lsp.py @@ -129,7 +129,7 @@ def test_method_code_actions_with_all_params(self, client: Runloop) -> None: }, }, "code": 0, - "code_description": {"href": "href"}, + "code_description": {"href": "string"}, "data": {}, "related_information": [ { @@ -144,7 +144,7 @@ def test_method_code_actions_with_all_params(self, client: Runloop) -> None: "line": 0, }, }, - "uri": "uri", + "uri": "string", }, "message": "message", } @@ -208,7 +208,7 @@ def test_path_params_code_actions(self, client: Runloop) -> None: def test_method_diagnostics(self, client: Runloop) -> None: lsp = client.devboxes.lsp.diagnostics( id="id", - uri="uri", + uri="string", ) assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) @@ -216,7 +216,7 @@ def test_method_diagnostics(self, client: Runloop) -> None: def test_raw_response_diagnostics(self, client: Runloop) -> None: response = client.devboxes.lsp.with_raw_response.diagnostics( id="id", - uri="uri", + uri="string", ) assert response.is_closed is True @@ -228,7 +228,7 @@ def test_raw_response_diagnostics(self, client: Runloop) -> None: def test_streaming_response_diagnostics(self, client: Runloop) -> None: with client.devboxes.lsp.with_streaming_response.diagnostics( id="id", - uri="uri", + uri="string", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -243,14 +243,14 @@ def test_path_params_diagnostics(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.lsp.with_raw_response.diagnostics( id="", - uri="uri", + uri="string", ) @parametrize def test_method_document_symbols(self, client: Runloop) -> None: lsp = client.devboxes.lsp.document_symbols( id="id", - uri="uri", + uri="string", ) assert_matches_type(object, lsp, path=["response"]) @@ -258,7 +258,7 @@ def test_method_document_symbols(self, client: Runloop) -> None: def test_raw_response_document_symbols(self, client: Runloop) -> None: response = client.devboxes.lsp.with_raw_response.document_symbols( id="id", - uri="uri", + uri="string", ) assert response.is_closed is True @@ -270,7 +270,7 @@ def test_raw_response_document_symbols(self, client: Runloop) -> None: def test_streaming_response_document_symbols(self, client: Runloop) -> None: with client.devboxes.lsp.with_streaming_response.document_symbols( id="id", - uri="uri", + uri="string", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -285,14 +285,14 @@ def test_path_params_document_symbols(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.lsp.with_raw_response.document_symbols( id="", - uri="uri", + uri="string", ) @parametrize def test_method_file(self, client: Runloop) -> None: lsp = client.devboxes.lsp.file( id="id", - path="path", + path="string", ) assert_matches_type(FileContentsResponse, lsp, path=["response"]) @@ -300,7 +300,7 @@ def test_method_file(self, client: Runloop) -> None: def test_raw_response_file(self, client: Runloop) -> None: response = client.devboxes.lsp.with_raw_response.file( id="id", - path="path", + path="string", ) assert response.is_closed is True @@ -312,7 +312,7 @@ def test_raw_response_file(self, client: Runloop) -> None: def test_streaming_response_file(self, client: Runloop) -> None: with client.devboxes.lsp.with_streaming_response.file( id="id", - path="path", + path="string", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -327,7 +327,7 @@ def test_path_params_file(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.lsp.with_raw_response.file( id="", - path="path", + path="string", ) @parametrize @@ -422,7 +422,7 @@ def test_path_params_files(self, client: Runloop) -> None: def test_method_formatting(self, client: Runloop) -> None: lsp = client.devboxes.lsp.formatting( id="id", - uri="uri", + uri="string", ) assert_matches_type(object, lsp, path=["response"]) @@ -430,7 +430,7 @@ def test_method_formatting(self, client: Runloop) -> None: def test_raw_response_formatting(self, client: Runloop) -> None: response = client.devboxes.lsp.with_raw_response.formatting( id="id", - uri="uri", + uri="string", ) assert response.is_closed is True @@ -442,7 +442,7 @@ def test_raw_response_formatting(self, client: Runloop) -> None: def test_streaming_response_formatting(self, client: Runloop) -> None: with client.devboxes.lsp.with_streaming_response.formatting( id="id", - uri="uri", + uri="string", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -457,7 +457,7 @@ def test_path_params_formatting(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.lsp.with_raw_response.formatting( id="", - uri="uri", + uri="string", ) @parametrize @@ -583,7 +583,7 @@ def test_method_get_code_segment_info(self, client: Runloop) -> None: lsp = client.devboxes.lsp.get_code_segment_info( id="id", symbol_name="symbolName", - uri="uri", + uri="string", ) assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) @@ -592,7 +592,7 @@ def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> lsp = client.devboxes.lsp.get_code_segment_info( id="id", symbol_name="symbolName", - uri="uri", + uri="string", symbol_type="function", ) assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) @@ -602,7 +602,7 @@ def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: response = client.devboxes.lsp.with_raw_response.get_code_segment_info( id="id", symbol_name="symbolName", - uri="uri", + uri="string", ) assert response.is_closed is True @@ -615,7 +615,7 @@ def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None with client.devboxes.lsp.with_streaming_response.get_code_segment_info( id="id", symbol_name="symbolName", - uri="uri", + uri="string", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -631,7 +631,7 @@ def test_path_params_get_code_segment_info(self, client: Runloop) -> None: client.devboxes.lsp.with_raw_response.get_code_segment_info( id="", symbol_name="symbolName", - uri="uri", + uri="string", ) @parametrize @@ -776,7 +776,7 @@ def test_path_params_references(self, client: Runloop) -> None: def test_method_set_watch_directory(self, client: Runloop) -> None: lsp = client.devboxes.lsp.set_watch_directory( id="id", - path="path", + path="string", ) assert_matches_type(str, lsp, path=["response"]) @@ -784,7 +784,7 @@ def test_method_set_watch_directory(self, client: Runloop) -> None: def test_raw_response_set_watch_directory(self, client: Runloop) -> None: response = client.devboxes.lsp.with_raw_response.set_watch_directory( id="id", - path="path", + path="string", ) assert response.is_closed is True @@ -796,7 +796,7 @@ def test_raw_response_set_watch_directory(self, client: Runloop) -> None: def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: with client.devboxes.lsp.with_streaming_response.set_watch_directory( id="id", - path="path", + path="string", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -811,7 +811,7 @@ def test_path_params_set_watch_directory(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.lsp.with_raw_response.set_watch_directory( id="", - path="path", + path="string", ) @@ -921,7 +921,7 @@ async def test_method_code_actions_with_all_params(self, async_client: AsyncRunl }, }, "code": 0, - "code_description": {"href": "href"}, + "code_description": {"href": "string"}, "data": {}, "related_information": [ { @@ -936,7 +936,7 @@ async def test_method_code_actions_with_all_params(self, async_client: AsyncRunl "line": 0, }, }, - "uri": "uri", + "uri": "string", }, "message": "message", } @@ -1000,7 +1000,7 @@ async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> Non async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: lsp = await async_client.devboxes.lsp.diagnostics( id="id", - uri="uri", + uri="string", ) assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) @@ -1008,7 +1008,7 @@ async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.lsp.with_raw_response.diagnostics( id="id", - uri="uri", + uri="string", ) assert response.is_closed is True @@ -1020,7 +1020,7 @@ async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> Non async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.lsp.with_streaming_response.diagnostics( id="id", - uri="uri", + uri="string", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1035,14 +1035,14 @@ async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.lsp.with_raw_response.diagnostics( id="", - uri="uri", + uri="string", ) @parametrize async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: lsp = await async_client.devboxes.lsp.document_symbols( id="id", - uri="uri", + uri="string", ) assert_matches_type(object, lsp, path=["response"]) @@ -1050,7 +1050,7 @@ async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.lsp.with_raw_response.document_symbols( id="id", - uri="uri", + uri="string", ) assert response.is_closed is True @@ -1062,7 +1062,7 @@ async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.lsp.with_streaming_response.document_symbols( id="id", - uri="uri", + uri="string", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1077,14 +1077,14 @@ async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.lsp.with_raw_response.document_symbols( id="", - uri="uri", + uri="string", ) @parametrize async def test_method_file(self, async_client: AsyncRunloop) -> None: lsp = await async_client.devboxes.lsp.file( id="id", - path="path", + path="string", ) assert_matches_type(FileContentsResponse, lsp, path=["response"]) @@ -1092,7 +1092,7 @@ async def test_method_file(self, async_client: AsyncRunloop) -> None: async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.lsp.with_raw_response.file( id="id", - path="path", + path="string", ) assert response.is_closed is True @@ -1104,7 +1104,7 @@ async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.lsp.with_streaming_response.file( id="id", - path="path", + path="string", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1119,7 +1119,7 @@ async def test_path_params_file(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.lsp.with_raw_response.file( id="", - path="path", + path="string", ) @parametrize @@ -1214,7 +1214,7 @@ async def test_path_params_files(self, async_client: AsyncRunloop) -> None: async def test_method_formatting(self, async_client: AsyncRunloop) -> None: lsp = await async_client.devboxes.lsp.formatting( id="id", - uri="uri", + uri="string", ) assert_matches_type(object, lsp, path=["response"]) @@ -1222,7 +1222,7 @@ async def test_method_formatting(self, async_client: AsyncRunloop) -> None: async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.lsp.with_raw_response.formatting( id="id", - uri="uri", + uri="string", ) assert response.is_closed is True @@ -1234,7 +1234,7 @@ async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.lsp.with_streaming_response.formatting( id="id", - uri="uri", + uri="string", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1249,7 +1249,7 @@ async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.lsp.with_raw_response.formatting( id="", - uri="uri", + uri="string", ) @parametrize @@ -1375,7 +1375,7 @@ async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> lsp = await async_client.devboxes.lsp.get_code_segment_info( id="id", symbol_name="symbolName", - uri="uri", + uri="string", ) assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) @@ -1384,7 +1384,7 @@ async def test_method_get_code_segment_info_with_all_params(self, async_client: lsp = await async_client.devboxes.lsp.get_code_segment_info( id="id", symbol_name="symbolName", - uri="uri", + uri="string", symbol_type="function", ) assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) @@ -1394,7 +1394,7 @@ async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunlo response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( id="id", symbol_name="symbolName", - uri="uri", + uri="string", ) assert response.is_closed is True @@ -1407,7 +1407,7 @@ async def test_streaming_response_get_code_segment_info(self, async_client: Asyn async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( id="id", symbol_name="symbolName", - uri="uri", + uri="string", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1423,7 +1423,7 @@ async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloo await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( id="", symbol_name="symbolName", - uri="uri", + uri="string", ) @parametrize @@ -1568,7 +1568,7 @@ async def test_path_params_references(self, async_client: AsyncRunloop) -> None: async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: lsp = await async_client.devboxes.lsp.set_watch_directory( id="id", - path="path", + path="string", ) assert_matches_type(str, lsp, path=["response"]) @@ -1576,7 +1576,7 @@ async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> N async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( id="id", - path="path", + path="string", ) assert response.is_closed is True @@ -1588,7 +1588,7 @@ async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( id="id", - path="path", + path="string", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1603,5 +1603,5 @@ async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.lsp.with_raw_response.set_watch_directory( id="", - path="path", + path="string", ) From d9080bf49233b23ca381c582b95ba532ad80c85b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 07:05:35 +0000 Subject: [PATCH 632/993] docs(raw responses): fix duplicate `the` (#499) --- src/runloop_api_client/resources/blueprints.py | 4 ++-- src/runloop_api_client/resources/devboxes/devboxes.py | 4 ++-- src/runloop_api_client/resources/devboxes/executions.py | 4 ++-- src/runloop_api_client/resources/devboxes/logs.py | 4 ++-- src/runloop_api_client/resources/devboxes/lsp.py | 4 ++-- src/runloop_api_client/resources/repositories.py | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index 78dae9d88..124f0a139 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -35,7 +35,7 @@ class BlueprintsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> BlueprintsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers @@ -311,7 +311,7 @@ class AsyncBlueprintsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncBlueprintsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index a9e090118..cc4ae9c04 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -103,7 +103,7 @@ def executions(self) -> ExecutionsResource: @cached_property def with_raw_response(self) -> DevboxesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers @@ -1100,7 +1100,7 @@ def executions(self) -> AsyncExecutionsResource: @cached_property def with_raw_response(self) -> AsyncDevboxesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index 6d8184e0a..091d7857e 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -31,7 +31,7 @@ class ExecutionsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> ExecutionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers @@ -258,7 +258,7 @@ class AsyncExecutionsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncExecutionsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers diff --git a/src/runloop_api_client/resources/devboxes/logs.py b/src/runloop_api_client/resources/devboxes/logs.py index a9fa13101..05b80f362 100644 --- a/src/runloop_api_client/resources/devboxes/logs.py +++ b/src/runloop_api_client/resources/devboxes/logs.py @@ -28,7 +28,7 @@ class LogsResource(SyncAPIResource): @cached_property def with_raw_response(self) -> LogsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers @@ -98,7 +98,7 @@ class AsyncLogsResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncLogsResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py index 86835a9b0..76cdccc74 100644 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -59,7 +59,7 @@ class LspResource(SyncAPIResource): @cached_property def with_raw_response(self) -> LspResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers @@ -750,7 +750,7 @@ class AsyncLspResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncLspResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers diff --git a/src/runloop_api_client/resources/repositories.py b/src/runloop_api_client/resources/repositories.py index c65b4133b..115ed94a4 100644 --- a/src/runloop_api_client/resources/repositories.py +++ b/src/runloop_api_client/resources/repositories.py @@ -30,7 +30,7 @@ class RepositoriesResource(SyncAPIResource): @cached_property def with_raw_response(self) -> RepositoriesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers @@ -258,7 +258,7 @@ class AsyncRepositoriesResource(AsyncAPIResource): @cached_property def with_raw_response(self) -> AsyncRepositoriesResourceWithRawResponse: """ - This property can be used as a prefix for any HTTP method call to return the + This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers From 8ccddfab205e2485ae171f4df170e4a5cb783a14 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 07:06:07 +0000 Subject: [PATCH 633/993] fix(tests): make test_get_platform less flaky (#500) --- tests/test_client.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index befb5ec6a..81c247f78 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -6,6 +6,7 @@ import os import sys import json +import time import asyncio import inspect import subprocess @@ -1721,10 +1722,20 @@ async def test_main() -> None: [sys.executable, "-c", test_code], text=True, ) as process: - try: - process.wait(2) - if process.returncode: - raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code") - except subprocess.TimeoutExpired as e: - process.kill() - raise AssertionError("calling get_platform using asyncify resulted in a hung process") from e + timeout = 10 # seconds + + start_time = time.monotonic() + while True: + return_code = process.poll() + if return_code is not None: + if return_code != 0: + raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code") + + # success + break + + if time.monotonic() - start_time > timeout: + process.kill() + raise AssertionError("calling get_platform using asyncify resulted in a hung process") + + time.sleep(0.1) From adb7e3a13b2924118049d4a924a27bb00d9f266f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 18:30:14 +0000 Subject: [PATCH 634/993] feat(api): api update (#501) --- .stats.yml | 4 +- api.md | 73 +++ src/runloop_api_client/_client.py | 18 + src/runloop_api_client/resources/__init__.py | 28 + .../resources/benchmarks/__init__.py | 33 + .../resources/benchmarks/benchmarks.py | 532 ++++++++++++++++ .../resources/benchmarks/runs.py | 365 +++++++++++ .../resources/scenarios/__init__.py | 33 + .../resources/scenarios/runs.py | 457 ++++++++++++++ .../resources/scenarios/scenarios.py | 567 ++++++++++++++++++ src/runloop_api_client/types/__init__.py | 25 + .../types/benchmark_create_params.py | 16 + .../types/benchmark_list_params.py | 15 + .../types/benchmark_list_view.py | 17 + .../types/benchmark_run_view.py | 22 + .../types/benchmark_start_run_params.py | 16 + .../types/benchmark_view.py | 20 + .../types/benchmarks/__init__.py | 6 + .../types/benchmarks/run_list_params.py | 15 + .../types/benchmarks/run_list_response.py | 17 + .../types/input_context_parameters.py | 11 + .../types/input_context_parameters_param.py | 12 + .../types/scenario_create_params.py | 26 + .../types/scenario_environment_parameters.py | 18 + .../scenario_environment_parameters_param.py | 19 + .../types/scenario_list_params.py | 15 + .../types/scenario_list_view.py | 17 + .../types/scenario_run_list_view.py | 17 + .../types/scenario_run_view.py | 32 + .../types/scenario_start_run_params.py | 19 + src/runloop_api_client/types/scenario_view.py | 27 + .../types/scenarios/__init__.py | 5 + .../types/scenarios/run_list_params.py | 15 + .../types/scoring_contract_parameters.py | 13 + .../scoring_contract_parameters_param.py | 15 + .../types/scoring_contract_result_view.py | 16 + .../types/scoring_function_parameters.py | 25 + .../scoring_function_parameters_param.py | 26 + .../types/scoring_function_result_view.py | 17 + tests/api_resources/benchmarks/__init__.py | 1 + tests/api_resources/benchmarks/test_runs.py | 241 ++++++++ tests/api_resources/scenarios/__init__.py | 1 + tests/api_resources/scenarios/test_runs.py | 316 ++++++++++ tests/api_resources/test_benchmarks.py | 324 ++++++++++ tests/api_resources/test_scenarios.py | 408 +++++++++++++ 45 files changed, 3913 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/resources/benchmarks/__init__.py create mode 100644 src/runloop_api_client/resources/benchmarks/benchmarks.py create mode 100644 src/runloop_api_client/resources/benchmarks/runs.py create mode 100644 src/runloop_api_client/resources/scenarios/__init__.py create mode 100644 src/runloop_api_client/resources/scenarios/runs.py create mode 100644 src/runloop_api_client/resources/scenarios/scenarios.py create mode 100644 src/runloop_api_client/types/benchmark_create_params.py create mode 100644 src/runloop_api_client/types/benchmark_list_params.py create mode 100644 src/runloop_api_client/types/benchmark_list_view.py create mode 100644 src/runloop_api_client/types/benchmark_run_view.py create mode 100644 src/runloop_api_client/types/benchmark_start_run_params.py create mode 100644 src/runloop_api_client/types/benchmark_view.py create mode 100644 src/runloop_api_client/types/benchmarks/__init__.py create mode 100644 src/runloop_api_client/types/benchmarks/run_list_params.py create mode 100644 src/runloop_api_client/types/benchmarks/run_list_response.py create mode 100644 src/runloop_api_client/types/input_context_parameters.py create mode 100644 src/runloop_api_client/types/input_context_parameters_param.py create mode 100644 src/runloop_api_client/types/scenario_create_params.py create mode 100644 src/runloop_api_client/types/scenario_environment_parameters.py create mode 100644 src/runloop_api_client/types/scenario_environment_parameters_param.py create mode 100644 src/runloop_api_client/types/scenario_list_params.py create mode 100644 src/runloop_api_client/types/scenario_list_view.py create mode 100644 src/runloop_api_client/types/scenario_run_list_view.py create mode 100644 src/runloop_api_client/types/scenario_run_view.py create mode 100644 src/runloop_api_client/types/scenario_start_run_params.py create mode 100644 src/runloop_api_client/types/scenario_view.py create mode 100644 src/runloop_api_client/types/scenarios/__init__.py create mode 100644 src/runloop_api_client/types/scenarios/run_list_params.py create mode 100644 src/runloop_api_client/types/scoring_contract_parameters.py create mode 100644 src/runloop_api_client/types/scoring_contract_parameters_param.py create mode 100644 src/runloop_api_client/types/scoring_contract_result_view.py create mode 100644 src/runloop_api_client/types/scoring_function_parameters.py create mode 100644 src/runloop_api_client/types/scoring_function_parameters_param.py create mode 100644 src/runloop_api_client/types/scoring_function_result_view.py create mode 100644 tests/api_resources/benchmarks/__init__.py create mode 100644 tests/api_resources/benchmarks/test_runs.py create mode 100644 tests/api_resources/scenarios/__init__.py create mode 100644 tests/api_resources/scenarios/test_runs.py create mode 100644 tests/api_resources/test_benchmarks.py create mode 100644 tests/api_resources/test_scenarios.py diff --git a/.stats.yml b/.stats.yml index 311ea3267..4a526b1c8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 46 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-15f23a9e2e014d2e5d4d72c39ee31c5556060fb37d1490f308ecce5aeb41d5c8.yml +configured_endpoints: 61 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f4e55467750a460852376c0f037c34548a9b72d438b3484b9db0fa62c2573f03.yml diff --git a/api.md b/api.md index be9c20e21..0723b7e19 100644 --- a/api.md +++ b/api.md @@ -4,6 +4,41 @@ from runloop_api_client.types import AfterIdle, CodeMountParameters, LaunchParameters ``` +# Benchmarks + +Types: + +```python +from runloop_api_client.types import ( + BenchmarkCreateParameters, + BenchmarkListView, + BenchmarkRunView, + BenchmarkView, + StartBenchmarkRunParameters, +) +``` + +Methods: + +- client.benchmarks.create(\*\*params) -> BenchmarkView +- client.benchmarks.retrieve(id) -> BenchmarkView +- client.benchmarks.list(\*\*params) -> BenchmarkListView +- client.benchmarks.start_run(\*\*params) -> BenchmarkRunView + +## Runs + +Types: + +```python +from runloop_api_client.types.benchmarks import RunListResponse +``` + +Methods: + +- client.benchmarks.runs.retrieve(id) -> BenchmarkRunView +- client.benchmarks.runs.list(\*\*params) -> RunListResponse +- client.benchmarks.runs.complete(id) -> BenchmarkRunView + # Blueprints Types: @@ -173,6 +208,44 @@ Methods: - client.devboxes.executions.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.executions.kill(execution_id, \*, devbox_id) -> DevboxAsyncExecutionDetailView +# Scenarios + +Types: + +```python +from runloop_api_client.types import ( + InputContextParameters, + RepositoryConnectionListView, + ScenarioCreateParameters, + ScenarioEnvironmentParameters, + ScenarioListView, + ScenarioRunListView, + ScenarioRunView, + ScenarioView, + ScoringContractParameters, + ScoringContractResultView, + ScoringFunctionParameters, + ScoringFunctionResultView, + StartScenarioRunParameters, +) +``` + +Methods: + +- client.scenarios.create(\*\*params) -> ScenarioView +- client.scenarios.retrieve(id) -> ScenarioView +- client.scenarios.list(\*\*params) -> ScenarioListView +- client.scenarios.start_run(\*\*params) -> ScenarioRunView + +## Runs + +Methods: + +- client.scenarios.runs.retrieve(id) -> ScenarioRunView +- client.scenarios.runs.list(\*\*params) -> ScenarioRunListView +- client.scenarios.runs.complete(id) -> ScenarioRunView +- client.scenarios.runs.score(id) -> ScenarioRunView + # Repositories Types: diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index 2c254b387..8fc0cb6f8 100644 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -33,13 +33,17 @@ AsyncAPIClient, ) from .resources.devboxes import devboxes +from .resources.scenarios import scenarios +from .resources.benchmarks import benchmarks __all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Runloop", "AsyncRunloop", "Client", "AsyncClient"] class Runloop(SyncAPIClient): + benchmarks: benchmarks.BenchmarksResource blueprints: blueprints.BlueprintsResource devboxes: devboxes.DevboxesResource + scenarios: scenarios.ScenariosResource repositories: repositories.RepositoriesResource with_raw_response: RunloopWithRawResponse with_streaming_response: RunloopWithStreamedResponse @@ -100,8 +104,10 @@ def __init__( self._idempotency_header = "x-request-id" + self.benchmarks = benchmarks.BenchmarksResource(self) self.blueprints = blueprints.BlueprintsResource(self) self.devboxes = devboxes.DevboxesResource(self) + self.scenarios = scenarios.ScenariosResource(self) self.repositories = repositories.RepositoriesResource(self) self.with_raw_response = RunloopWithRawResponse(self) self.with_streaming_response = RunloopWithStreamedResponse(self) @@ -212,8 +218,10 @@ def _make_status_error( class AsyncRunloop(AsyncAPIClient): + benchmarks: benchmarks.AsyncBenchmarksResource blueprints: blueprints.AsyncBlueprintsResource devboxes: devboxes.AsyncDevboxesResource + scenarios: scenarios.AsyncScenariosResource repositories: repositories.AsyncRepositoriesResource with_raw_response: AsyncRunloopWithRawResponse with_streaming_response: AsyncRunloopWithStreamedResponse @@ -274,8 +282,10 @@ def __init__( self._idempotency_header = "x-request-id" + self.benchmarks = benchmarks.AsyncBenchmarksResource(self) self.blueprints = blueprints.AsyncBlueprintsResource(self) self.devboxes = devboxes.AsyncDevboxesResource(self) + self.scenarios = scenarios.AsyncScenariosResource(self) self.repositories = repositories.AsyncRepositoriesResource(self) self.with_raw_response = AsyncRunloopWithRawResponse(self) self.with_streaming_response = AsyncRunloopWithStreamedResponse(self) @@ -387,29 +397,37 @@ def _make_status_error( class RunloopWithRawResponse: def __init__(self, client: Runloop) -> None: + self.benchmarks = benchmarks.BenchmarksResourceWithRawResponse(client.benchmarks) self.blueprints = blueprints.BlueprintsResourceWithRawResponse(client.blueprints) self.devboxes = devboxes.DevboxesResourceWithRawResponse(client.devboxes) + self.scenarios = scenarios.ScenariosResourceWithRawResponse(client.scenarios) self.repositories = repositories.RepositoriesResourceWithRawResponse(client.repositories) class AsyncRunloopWithRawResponse: def __init__(self, client: AsyncRunloop) -> None: + self.benchmarks = benchmarks.AsyncBenchmarksResourceWithRawResponse(client.benchmarks) self.blueprints = blueprints.AsyncBlueprintsResourceWithRawResponse(client.blueprints) self.devboxes = devboxes.AsyncDevboxesResourceWithRawResponse(client.devboxes) + self.scenarios = scenarios.AsyncScenariosResourceWithRawResponse(client.scenarios) self.repositories = repositories.AsyncRepositoriesResourceWithRawResponse(client.repositories) class RunloopWithStreamedResponse: def __init__(self, client: Runloop) -> None: + self.benchmarks = benchmarks.BenchmarksResourceWithStreamingResponse(client.benchmarks) self.blueprints = blueprints.BlueprintsResourceWithStreamingResponse(client.blueprints) self.devboxes = devboxes.DevboxesResourceWithStreamingResponse(client.devboxes) + self.scenarios = scenarios.ScenariosResourceWithStreamingResponse(client.scenarios) self.repositories = repositories.RepositoriesResourceWithStreamingResponse(client.repositories) class AsyncRunloopWithStreamedResponse: def __init__(self, client: AsyncRunloop) -> None: + self.benchmarks = benchmarks.AsyncBenchmarksResourceWithStreamingResponse(client.benchmarks) self.blueprints = blueprints.AsyncBlueprintsResourceWithStreamingResponse(client.blueprints) self.devboxes = devboxes.AsyncDevboxesResourceWithStreamingResponse(client.devboxes) + self.scenarios = scenarios.AsyncScenariosResourceWithStreamingResponse(client.scenarios) self.repositories = repositories.AsyncRepositoriesResourceWithStreamingResponse(client.repositories) diff --git a/src/runloop_api_client/resources/__init__.py b/src/runloop_api_client/resources/__init__.py index 72fe76dc1..2c103b15e 100644 --- a/src/runloop_api_client/resources/__init__.py +++ b/src/runloop_api_client/resources/__init__.py @@ -8,6 +8,22 @@ DevboxesResourceWithStreamingResponse, AsyncDevboxesResourceWithStreamingResponse, ) +from .scenarios import ( + ScenariosResource, + AsyncScenariosResource, + ScenariosResourceWithRawResponse, + AsyncScenariosResourceWithRawResponse, + ScenariosResourceWithStreamingResponse, + AsyncScenariosResourceWithStreamingResponse, +) +from .benchmarks import ( + BenchmarksResource, + AsyncBenchmarksResource, + BenchmarksResourceWithRawResponse, + AsyncBenchmarksResourceWithRawResponse, + BenchmarksResourceWithStreamingResponse, + AsyncBenchmarksResourceWithStreamingResponse, +) from .blueprints import ( BlueprintsResource, AsyncBlueprintsResource, @@ -26,6 +42,12 @@ ) __all__ = [ + "BenchmarksResource", + "AsyncBenchmarksResource", + "BenchmarksResourceWithRawResponse", + "AsyncBenchmarksResourceWithRawResponse", + "BenchmarksResourceWithStreamingResponse", + "AsyncBenchmarksResourceWithStreamingResponse", "BlueprintsResource", "AsyncBlueprintsResource", "BlueprintsResourceWithRawResponse", @@ -38,6 +60,12 @@ "AsyncDevboxesResourceWithRawResponse", "DevboxesResourceWithStreamingResponse", "AsyncDevboxesResourceWithStreamingResponse", + "ScenariosResource", + "AsyncScenariosResource", + "ScenariosResourceWithRawResponse", + "AsyncScenariosResourceWithRawResponse", + "ScenariosResourceWithStreamingResponse", + "AsyncScenariosResourceWithStreamingResponse", "RepositoriesResource", "AsyncRepositoriesResource", "RepositoriesResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/benchmarks/__init__.py b/src/runloop_api_client/resources/benchmarks/__init__.py new file mode 100644 index 000000000..f34bcd900 --- /dev/null +++ b/src/runloop_api_client/resources/benchmarks/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .runs import ( + RunsResource, + AsyncRunsResource, + RunsResourceWithRawResponse, + AsyncRunsResourceWithRawResponse, + RunsResourceWithStreamingResponse, + AsyncRunsResourceWithStreamingResponse, +) +from .benchmarks import ( + BenchmarksResource, + AsyncBenchmarksResource, + BenchmarksResourceWithRawResponse, + AsyncBenchmarksResourceWithRawResponse, + BenchmarksResourceWithStreamingResponse, + AsyncBenchmarksResourceWithStreamingResponse, +) + +__all__ = [ + "RunsResource", + "AsyncRunsResource", + "RunsResourceWithRawResponse", + "AsyncRunsResourceWithRawResponse", + "RunsResourceWithStreamingResponse", + "AsyncRunsResourceWithStreamingResponse", + "BenchmarksResource", + "AsyncBenchmarksResource", + "BenchmarksResourceWithRawResponse", + "AsyncBenchmarksResourceWithRawResponse", + "BenchmarksResourceWithStreamingResponse", + "AsyncBenchmarksResourceWithStreamingResponse", +] diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py new file mode 100644 index 000000000..9b016c684 --- /dev/null +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -0,0 +1,532 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional + +import httpx + +from .runs import ( + RunsResource, + AsyncRunsResource, + RunsResourceWithRawResponse, + AsyncRunsResourceWithRawResponse, + RunsResourceWithStreamingResponse, + AsyncRunsResourceWithStreamingResponse, +) +from ...types import benchmark_list_params, benchmark_create_params, benchmark_start_run_params +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.benchmark_view import BenchmarkView +from ...types.benchmark_run_view import BenchmarkRunView +from ...types.benchmark_list_view import BenchmarkListView + +__all__ = ["BenchmarksResource", "AsyncBenchmarksResource"] + + +class BenchmarksResource(SyncAPIResource): + @cached_property + def runs(self) -> RunsResource: + return RunsResource(self._client) + + @cached_property + def with_raw_response(self) -> BenchmarksResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return BenchmarksResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> BenchmarksResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return BenchmarksResourceWithStreamingResponse(self) + + def create( + self, + *, + name: str, + scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> BenchmarkView: + """ + Create a Benchmark with a set of Scenarios. + + Args: + name: The name of the Benchmark. + + scenario_ids: The Scenario IDs that make up the Benchmark. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/v1/benchmarks", + body=maybe_transform( + { + "name": name, + "scenario_ids": scenario_ids, + }, + benchmark_create_params.BenchmarkCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BenchmarkView, + ) + + def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BenchmarkView: + """ + Get a previously created Benchmark. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/benchmarks/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BenchmarkView, + ) + + def list( + self, + *, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BenchmarkListView: + """ + List all Benchmarks matching filter. + + Args: + limit: The limit of items to return. Default is 20. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/v1/benchmarks", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + benchmark_list_params.BenchmarkListParams, + ), + ), + cast_to=BenchmarkListView, + ) + + def start_run( + self, + *, + benchmark_id: str, + run_name: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> BenchmarkRunView: + """ + Start a new BenchmarkRun based on the provided Benchmark. + + Args: + benchmark_id: ID of the Benchmark to run. + + run_name: Display name of the run. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/v1/benchmarks/start_run", + body=maybe_transform( + { + "benchmark_id": benchmark_id, + "run_name": run_name, + }, + benchmark_start_run_params.BenchmarkStartRunParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BenchmarkRunView, + ) + + +class AsyncBenchmarksResource(AsyncAPIResource): + @cached_property + def runs(self) -> AsyncRunsResource: + return AsyncRunsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncBenchmarksResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncBenchmarksResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncBenchmarksResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncBenchmarksResourceWithStreamingResponse(self) + + async def create( + self, + *, + name: str, + scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> BenchmarkView: + """ + Create a Benchmark with a set of Scenarios. + + Args: + name: The name of the Benchmark. + + scenario_ids: The Scenario IDs that make up the Benchmark. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/v1/benchmarks", + body=await async_maybe_transform( + { + "name": name, + "scenario_ids": scenario_ids, + }, + benchmark_create_params.BenchmarkCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BenchmarkView, + ) + + async def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BenchmarkView: + """ + Get a previously created Benchmark. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/benchmarks/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BenchmarkView, + ) + + async def list( + self, + *, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BenchmarkListView: + """ + List all Benchmarks matching filter. + + Args: + limit: The limit of items to return. Default is 20. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/v1/benchmarks", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + benchmark_list_params.BenchmarkListParams, + ), + ), + cast_to=BenchmarkListView, + ) + + async def start_run( + self, + *, + benchmark_id: str, + run_name: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> BenchmarkRunView: + """ + Start a new BenchmarkRun based on the provided Benchmark. + + Args: + benchmark_id: ID of the Benchmark to run. + + run_name: Display name of the run. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/v1/benchmarks/start_run", + body=await async_maybe_transform( + { + "benchmark_id": benchmark_id, + "run_name": run_name, + }, + benchmark_start_run_params.BenchmarkStartRunParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BenchmarkRunView, + ) + + +class BenchmarksResourceWithRawResponse: + def __init__(self, benchmarks: BenchmarksResource) -> None: + self._benchmarks = benchmarks + + self.create = to_raw_response_wrapper( + benchmarks.create, + ) + self.retrieve = to_raw_response_wrapper( + benchmarks.retrieve, + ) + self.list = to_raw_response_wrapper( + benchmarks.list, + ) + self.start_run = to_raw_response_wrapper( + benchmarks.start_run, + ) + + @cached_property + def runs(self) -> RunsResourceWithRawResponse: + return RunsResourceWithRawResponse(self._benchmarks.runs) + + +class AsyncBenchmarksResourceWithRawResponse: + def __init__(self, benchmarks: AsyncBenchmarksResource) -> None: + self._benchmarks = benchmarks + + self.create = async_to_raw_response_wrapper( + benchmarks.create, + ) + self.retrieve = async_to_raw_response_wrapper( + benchmarks.retrieve, + ) + self.list = async_to_raw_response_wrapper( + benchmarks.list, + ) + self.start_run = async_to_raw_response_wrapper( + benchmarks.start_run, + ) + + @cached_property + def runs(self) -> AsyncRunsResourceWithRawResponse: + return AsyncRunsResourceWithRawResponse(self._benchmarks.runs) + + +class BenchmarksResourceWithStreamingResponse: + def __init__(self, benchmarks: BenchmarksResource) -> None: + self._benchmarks = benchmarks + + self.create = to_streamed_response_wrapper( + benchmarks.create, + ) + self.retrieve = to_streamed_response_wrapper( + benchmarks.retrieve, + ) + self.list = to_streamed_response_wrapper( + benchmarks.list, + ) + self.start_run = to_streamed_response_wrapper( + benchmarks.start_run, + ) + + @cached_property + def runs(self) -> RunsResourceWithStreamingResponse: + return RunsResourceWithStreamingResponse(self._benchmarks.runs) + + +class AsyncBenchmarksResourceWithStreamingResponse: + def __init__(self, benchmarks: AsyncBenchmarksResource) -> None: + self._benchmarks = benchmarks + + self.create = async_to_streamed_response_wrapper( + benchmarks.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + benchmarks.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + benchmarks.list, + ) + self.start_run = async_to_streamed_response_wrapper( + benchmarks.start_run, + ) + + @cached_property + def runs(self) -> AsyncRunsResourceWithStreamingResponse: + return AsyncRunsResourceWithStreamingResponse(self._benchmarks.runs) diff --git a/src/runloop_api_client/resources/benchmarks/runs.py b/src/runloop_api_client/resources/benchmarks/runs.py new file mode 100644 index 000000000..0124ba1b0 --- /dev/null +++ b/src/runloop_api_client/resources/benchmarks/runs.py @@ -0,0 +1,365 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.benchmarks import run_list_params +from ...types.benchmark_run_view import BenchmarkRunView +from ...types.benchmarks.run_list_response import RunListResponse + +__all__ = ["RunsResource", "AsyncRunsResource"] + + +class RunsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> RunsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return RunsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> RunsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return RunsResourceWithStreamingResponse(self) + + def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BenchmarkRunView: + """ + Get a BenchmarkRun given ID. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/benchmarks/runs/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BenchmarkRunView, + ) + + def list( + self, + *, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunListResponse: + """ + List all BenchmarkRuns matching filter. + + Args: + limit: The limit of items to return. Default is 20. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/v1/benchmarks/runs", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + run_list_params.RunListParams, + ), + ), + cast_to=RunListResponse, + ) + + def complete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> BenchmarkRunView: + """ + Complete a currently running BenchmarkRun. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/benchmarks/runs/{id}/complete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BenchmarkRunView, + ) + + +class AsyncRunsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncRunsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncRunsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRunsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncRunsResourceWithStreamingResponse(self) + + async def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BenchmarkRunView: + """ + Get a BenchmarkRun given ID. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/benchmarks/runs/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BenchmarkRunView, + ) + + async def list( + self, + *, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> RunListResponse: + """ + List all BenchmarkRuns matching filter. + + Args: + limit: The limit of items to return. Default is 20. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/v1/benchmarks/runs", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + run_list_params.RunListParams, + ), + ), + cast_to=RunListResponse, + ) + + async def complete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> BenchmarkRunView: + """ + Complete a currently running BenchmarkRun. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/benchmarks/runs/{id}/complete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BenchmarkRunView, + ) + + +class RunsResourceWithRawResponse: + def __init__(self, runs: RunsResource) -> None: + self._runs = runs + + self.retrieve = to_raw_response_wrapper( + runs.retrieve, + ) + self.list = to_raw_response_wrapper( + runs.list, + ) + self.complete = to_raw_response_wrapper( + runs.complete, + ) + + +class AsyncRunsResourceWithRawResponse: + def __init__(self, runs: AsyncRunsResource) -> None: + self._runs = runs + + self.retrieve = async_to_raw_response_wrapper( + runs.retrieve, + ) + self.list = async_to_raw_response_wrapper( + runs.list, + ) + self.complete = async_to_raw_response_wrapper( + runs.complete, + ) + + +class RunsResourceWithStreamingResponse: + def __init__(self, runs: RunsResource) -> None: + self._runs = runs + + self.retrieve = to_streamed_response_wrapper( + runs.retrieve, + ) + self.list = to_streamed_response_wrapper( + runs.list, + ) + self.complete = to_streamed_response_wrapper( + runs.complete, + ) + + +class AsyncRunsResourceWithStreamingResponse: + def __init__(self, runs: AsyncRunsResource) -> None: + self._runs = runs + + self.retrieve = async_to_streamed_response_wrapper( + runs.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + runs.list, + ) + self.complete = async_to_streamed_response_wrapper( + runs.complete, + ) diff --git a/src/runloop_api_client/resources/scenarios/__init__.py b/src/runloop_api_client/resources/scenarios/__init__.py new file mode 100644 index 000000000..88b900e36 --- /dev/null +++ b/src/runloop_api_client/resources/scenarios/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .runs import ( + RunsResource, + AsyncRunsResource, + RunsResourceWithRawResponse, + AsyncRunsResourceWithRawResponse, + RunsResourceWithStreamingResponse, + AsyncRunsResourceWithStreamingResponse, +) +from .scenarios import ( + ScenariosResource, + AsyncScenariosResource, + ScenariosResourceWithRawResponse, + AsyncScenariosResourceWithRawResponse, + ScenariosResourceWithStreamingResponse, + AsyncScenariosResourceWithStreamingResponse, +) + +__all__ = [ + "RunsResource", + "AsyncRunsResource", + "RunsResourceWithRawResponse", + "AsyncRunsResourceWithRawResponse", + "RunsResourceWithStreamingResponse", + "AsyncRunsResourceWithStreamingResponse", + "ScenariosResource", + "AsyncScenariosResource", + "ScenariosResourceWithRawResponse", + "AsyncScenariosResourceWithRawResponse", + "ScenariosResourceWithStreamingResponse", + "AsyncScenariosResourceWithStreamingResponse", +] diff --git a/src/runloop_api_client/resources/scenarios/runs.py b/src/runloop_api_client/resources/scenarios/runs.py new file mode 100644 index 000000000..cec293027 --- /dev/null +++ b/src/runloop_api_client/resources/scenarios/runs.py @@ -0,0 +1,457 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.scenarios import run_list_params +from ...types.scenario_run_view import ScenarioRunView +from ...types.scenario_run_list_view import ScenarioRunListView + +__all__ = ["RunsResource", "AsyncRunsResource"] + + +class RunsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> RunsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return RunsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> RunsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return RunsResourceWithStreamingResponse(self) + + def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScenarioRunView: + """ + Get a ScenarioRun given ID. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/scenarios/runs/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScenarioRunView, + ) + + def list( + self, + *, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScenarioRunListView: + """ + List all ScenarioRuns matching filter. + + Args: + limit: The limit of items to return. Default is 20. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/v1/scenarios/runs", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + run_list_params.RunListParams, + ), + ), + cast_to=ScenarioRunListView, + ) + + def complete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ScenarioRunView: + """ + Complete a currently running ScenarioRun. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/scenarios/runs/{id}/complete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ScenarioRunView, + ) + + def score( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ScenarioRunView: + """ + Score a currently running ScenarioRun. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/scenarios/runs/{id}/score", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ScenarioRunView, + ) + + +class AsyncRunsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncRunsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncRunsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRunsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncRunsResourceWithStreamingResponse(self) + + async def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScenarioRunView: + """ + Get a ScenarioRun given ID. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/scenarios/runs/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScenarioRunView, + ) + + async def list( + self, + *, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScenarioRunListView: + """ + List all ScenarioRuns matching filter. + + Args: + limit: The limit of items to return. Default is 20. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/v1/scenarios/runs", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + run_list_params.RunListParams, + ), + ), + cast_to=ScenarioRunListView, + ) + + async def complete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ScenarioRunView: + """ + Complete a currently running ScenarioRun. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/scenarios/runs/{id}/complete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ScenarioRunView, + ) + + async def score( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ScenarioRunView: + """ + Score a currently running ScenarioRun. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/scenarios/runs/{id}/score", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ScenarioRunView, + ) + + +class RunsResourceWithRawResponse: + def __init__(self, runs: RunsResource) -> None: + self._runs = runs + + self.retrieve = to_raw_response_wrapper( + runs.retrieve, + ) + self.list = to_raw_response_wrapper( + runs.list, + ) + self.complete = to_raw_response_wrapper( + runs.complete, + ) + self.score = to_raw_response_wrapper( + runs.score, + ) + + +class AsyncRunsResourceWithRawResponse: + def __init__(self, runs: AsyncRunsResource) -> None: + self._runs = runs + + self.retrieve = async_to_raw_response_wrapper( + runs.retrieve, + ) + self.list = async_to_raw_response_wrapper( + runs.list, + ) + self.complete = async_to_raw_response_wrapper( + runs.complete, + ) + self.score = async_to_raw_response_wrapper( + runs.score, + ) + + +class RunsResourceWithStreamingResponse: + def __init__(self, runs: RunsResource) -> None: + self._runs = runs + + self.retrieve = to_streamed_response_wrapper( + runs.retrieve, + ) + self.list = to_streamed_response_wrapper( + runs.list, + ) + self.complete = to_streamed_response_wrapper( + runs.complete, + ) + self.score = to_streamed_response_wrapper( + runs.score, + ) + + +class AsyncRunsResourceWithStreamingResponse: + def __init__(self, runs: AsyncRunsResource) -> None: + self._runs = runs + + self.retrieve = async_to_streamed_response_wrapper( + runs.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + runs.list, + ) + self.complete = async_to_streamed_response_wrapper( + runs.complete, + ) + self.score = async_to_streamed_response_wrapper( + runs.score, + ) diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py new file mode 100644 index 000000000..ec2a73dcc --- /dev/null +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -0,0 +1,567 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +import httpx + +from .runs import ( + RunsResource, + AsyncRunsResource, + RunsResourceWithRawResponse, + AsyncRunsResourceWithRawResponse, + RunsResourceWithStreamingResponse, + AsyncRunsResourceWithStreamingResponse, +) +from ...types import ( + scenario_list_params, + scenario_create_params, + scenario_start_run_params, +) +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.scenario_view import ScenarioView +from ...types.scenario_run_view import ScenarioRunView +from ...types.scenario_list_view import ScenarioListView +from ...types.input_context_parameters_param import InputContextParametersParam +from ...types.scoring_contract_parameters_param import ScoringContractParametersParam +from ...types.scenario_environment_parameters_param import ScenarioEnvironmentParametersParam + +__all__ = ["ScenariosResource", "AsyncScenariosResource"] + + +class ScenariosResource(SyncAPIResource): + @cached_property + def runs(self) -> RunsResource: + return RunsResource(self._client) + + @cached_property + def with_raw_response(self) -> ScenariosResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return ScenariosResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ScenariosResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return ScenariosResourceWithStreamingResponse(self) + + def create( + self, + *, + input_context: InputContextParametersParam, + name: str, + scoring_contract: ScoringContractParametersParam, + environment_parameters: Optional[ScenarioEnvironmentParametersParam] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ScenarioView: + """ + Create a Scenario, a repeatable AI coding evaluation test that defines the + starting environment as well as evaluation success criteria. + + Args: + input_context: The input context for the Scenario. + + name: Name of the scenario. + + scoring_contract: The scoring contract for the Scenario. + + environment_parameters: The Environment in which the Scenario will run. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/v1/scenarios", + body=maybe_transform( + { + "input_context": input_context, + "name": name, + "scoring_contract": scoring_contract, + "environment_parameters": environment_parameters, + }, + scenario_create_params.ScenarioCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ScenarioView, + ) + + def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScenarioView: + """ + Get a previously created scenario. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/scenarios/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScenarioView, + ) + + def list( + self, + *, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScenarioListView: + """List all Scenarios matching filter. + + Args: + limit: The limit of items to return. + + Default is 20. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/v1/scenarios", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + scenario_list_params.ScenarioListParams, + ), + ), + cast_to=ScenarioListView, + ) + + def start_run( + self, + *, + scenario_id: str, + benchmark_run_id: Optional[str] | NotGiven = NOT_GIVEN, + run_name: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ScenarioRunView: + """ + Start a new ScenarioRun based on the provided Scenario. + + Args: + scenario_id: ID of the Scenario to run. + + benchmark_run_id: Benchmark to associate the run. + + run_name: Display name of the run. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/v1/scenarios/start_run", + body=maybe_transform( + { + "scenario_id": scenario_id, + "benchmark_run_id": benchmark_run_id, + "run_name": run_name, + }, + scenario_start_run_params.ScenarioStartRunParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ScenarioRunView, + ) + + +class AsyncScenariosResource(AsyncAPIResource): + @cached_property + def runs(self) -> AsyncRunsResource: + return AsyncRunsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncScenariosResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncScenariosResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncScenariosResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncScenariosResourceWithStreamingResponse(self) + + async def create( + self, + *, + input_context: InputContextParametersParam, + name: str, + scoring_contract: ScoringContractParametersParam, + environment_parameters: Optional[ScenarioEnvironmentParametersParam] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ScenarioView: + """ + Create a Scenario, a repeatable AI coding evaluation test that defines the + starting environment as well as evaluation success criteria. + + Args: + input_context: The input context for the Scenario. + + name: Name of the scenario. + + scoring_contract: The scoring contract for the Scenario. + + environment_parameters: The Environment in which the Scenario will run. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/v1/scenarios", + body=await async_maybe_transform( + { + "input_context": input_context, + "name": name, + "scoring_contract": scoring_contract, + "environment_parameters": environment_parameters, + }, + scenario_create_params.ScenarioCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ScenarioView, + ) + + async def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScenarioView: + """ + Get a previously created scenario. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/scenarios/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScenarioView, + ) + + async def list( + self, + *, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScenarioListView: + """List all Scenarios matching filter. + + Args: + limit: The limit of items to return. + + Default is 20. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/v1/scenarios", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + scenario_list_params.ScenarioListParams, + ), + ), + cast_to=ScenarioListView, + ) + + async def start_run( + self, + *, + scenario_id: str, + benchmark_run_id: Optional[str] | NotGiven = NOT_GIVEN, + run_name: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ScenarioRunView: + """ + Start a new ScenarioRun based on the provided Scenario. + + Args: + scenario_id: ID of the Scenario to run. + + benchmark_run_id: Benchmark to associate the run. + + run_name: Display name of the run. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/v1/scenarios/start_run", + body=await async_maybe_transform( + { + "scenario_id": scenario_id, + "benchmark_run_id": benchmark_run_id, + "run_name": run_name, + }, + scenario_start_run_params.ScenarioStartRunParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ScenarioRunView, + ) + + +class ScenariosResourceWithRawResponse: + def __init__(self, scenarios: ScenariosResource) -> None: + self._scenarios = scenarios + + self.create = to_raw_response_wrapper( + scenarios.create, + ) + self.retrieve = to_raw_response_wrapper( + scenarios.retrieve, + ) + self.list = to_raw_response_wrapper( + scenarios.list, + ) + self.start_run = to_raw_response_wrapper( + scenarios.start_run, + ) + + @cached_property + def runs(self) -> RunsResourceWithRawResponse: + return RunsResourceWithRawResponse(self._scenarios.runs) + + +class AsyncScenariosResourceWithRawResponse: + def __init__(self, scenarios: AsyncScenariosResource) -> None: + self._scenarios = scenarios + + self.create = async_to_raw_response_wrapper( + scenarios.create, + ) + self.retrieve = async_to_raw_response_wrapper( + scenarios.retrieve, + ) + self.list = async_to_raw_response_wrapper( + scenarios.list, + ) + self.start_run = async_to_raw_response_wrapper( + scenarios.start_run, + ) + + @cached_property + def runs(self) -> AsyncRunsResourceWithRawResponse: + return AsyncRunsResourceWithRawResponse(self._scenarios.runs) + + +class ScenariosResourceWithStreamingResponse: + def __init__(self, scenarios: ScenariosResource) -> None: + self._scenarios = scenarios + + self.create = to_streamed_response_wrapper( + scenarios.create, + ) + self.retrieve = to_streamed_response_wrapper( + scenarios.retrieve, + ) + self.list = to_streamed_response_wrapper( + scenarios.list, + ) + self.start_run = to_streamed_response_wrapper( + scenarios.start_run, + ) + + @cached_property + def runs(self) -> RunsResourceWithStreamingResponse: + return RunsResourceWithStreamingResponse(self._scenarios.runs) + + +class AsyncScenariosResourceWithStreamingResponse: + def __init__(self, scenarios: AsyncScenariosResource) -> None: + self._scenarios = scenarios + + self.create = async_to_streamed_response_wrapper( + scenarios.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + scenarios.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + scenarios.list, + ) + self.start_run = async_to_streamed_response_wrapper( + scenarios.start_run, + ) + + @cached_property + def runs(self) -> AsyncRunsResourceWithStreamingResponse: + return AsyncRunsResourceWithStreamingResponse(self._scenarios.runs) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index d5c58545b..ec078e815 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -8,22 +8,36 @@ CodeMountParameters as CodeMountParameters, ) from .devbox_view import DevboxView as DevboxView +from .scenario_view import ScenarioView as ScenarioView +from .benchmark_view import BenchmarkView as BenchmarkView from .blueprint_view import BlueprintView as BlueprintView from .devbox_list_view import DevboxListView as DevboxListView +from .scenario_run_view import ScenarioRunView as ScenarioRunView +from .benchmark_run_view import BenchmarkRunView as BenchmarkRunView from .devbox_list_params import DevboxListParams as DevboxListParams from .devbox_tunnel_view import DevboxTunnelView as DevboxTunnelView +from .scenario_list_view import ScenarioListView as ScenarioListView +from .benchmark_list_view import BenchmarkListView as BenchmarkListView from .blueprint_build_log import BlueprintBuildLog as BlueprintBuildLog from .blueprint_list_view import BlueprintListView as BlueprintListView from .devbox_create_params import DevboxCreateParams as DevboxCreateParams from .devbox_snapshot_view import DevboxSnapshotView as DevboxSnapshotView +from .scenario_list_params import ScenarioListParams as ScenarioListParams +from .benchmark_list_params import BenchmarkListParams as BenchmarkListParams from .blueprint_list_params import BlueprintListParams as BlueprintListParams from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView from .repository_list_params import RepositoryListParams as RepositoryListParams +from .scenario_create_params import ScenarioCreateParams as ScenarioCreateParams +from .scenario_run_list_view import ScenarioRunListView as ScenarioRunListView +from .benchmark_create_params import BenchmarkCreateParams as BenchmarkCreateParams from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams +from .input_context_parameters import InputContextParameters as InputContextParameters from .repository_create_params import RepositoryCreateParams as RepositoryCreateParams from .devbox_snapshot_list_view import DevboxSnapshotListView as DevboxSnapshotListView from .devbox_upload_file_params import DevboxUploadFileParams as DevboxUploadFileParams +from .scenario_start_run_params import ScenarioStartRunParams as ScenarioStartRunParams +from .benchmark_start_run_params import BenchmarkStartRunParams as BenchmarkStartRunParams from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams from .repository_connection_view import RepositoryConnectionView as RepositoryConnectionView @@ -33,13 +47,24 @@ from .devbox_execute_async_params import DevboxExecuteAsyncParams as DevboxExecuteAsyncParams from .devbox_remove_tunnel_params import DevboxRemoveTunnelParams as DevboxRemoveTunnelParams from .devbox_snapshot_disk_params import DevboxSnapshotDiskParams as DevboxSnapshotDiskParams +from .scoring_contract_parameters import ScoringContractParameters as ScoringContractParameters +from .scoring_function_parameters import ScoringFunctionParameters as ScoringFunctionParameters from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView from .repository_version_list_view import RepositoryVersionListView as RepositoryVersionListView +from .scoring_contract_result_view import ScoringContractResultView as ScoringContractResultView +from .scoring_function_result_view import ScoringFunctionResultView as ScoringFunctionResultView from .blueprint_build_logs_list_view import BlueprintBuildLogsListView as BlueprintBuildLogsListView from .devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse as DevboxCreateSSHKeyResponse +from .input_context_parameters_param import InputContextParametersParam as InputContextParametersParam from .repository_connection_list_view import RepositoryConnectionListView as RepositoryConnectionListView +from .scenario_environment_parameters import ScenarioEnvironmentParameters as ScenarioEnvironmentParameters from .devbox_read_file_contents_params import DevboxReadFileContentsParams as DevboxReadFileContentsParams from .devbox_list_disk_snapshots_params import DevboxListDiskSnapshotsParams as DevboxListDiskSnapshotsParams from .devbox_write_file_contents_params import DevboxWriteFileContentsParams as DevboxWriteFileContentsParams +from .scoring_contract_parameters_param import ScoringContractParametersParam as ScoringContractParametersParam +from .scoring_function_parameters_param import ScoringFunctionParametersParam as ScoringFunctionParametersParam from .devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView as DevboxAsyncExecutionDetailView from .devbox_read_file_contents_response import DevboxReadFileContentsResponse as DevboxReadFileContentsResponse +from .scenario_environment_parameters_param import ( + ScenarioEnvironmentParametersParam as ScenarioEnvironmentParametersParam, +) diff --git a/src/runloop_api_client/types/benchmark_create_params.py b/src/runloop_api_client/types/benchmark_create_params.py new file mode 100644 index 000000000..3fea3d2a0 --- /dev/null +++ b/src/runloop_api_client/types/benchmark_create_params.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import Required, TypedDict + +__all__ = ["BenchmarkCreateParams"] + + +class BenchmarkCreateParams(TypedDict, total=False): + name: Required[str] + """The name of the Benchmark.""" + + scenario_ids: Optional[List[str]] + """The Scenario IDs that make up the Benchmark.""" diff --git a/src/runloop_api_client/types/benchmark_list_params.py b/src/runloop_api_client/types/benchmark_list_params.py new file mode 100644 index 000000000..51b2b1320 --- /dev/null +++ b/src/runloop_api_client/types/benchmark_list_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["BenchmarkListParams"] + + +class BenchmarkListParams(TypedDict, total=False): + limit: int + """The limit of items to return. Default is 20.""" + + starting_after: str + """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/benchmark_list_view.py b/src/runloop_api_client/types/benchmark_list_view.py new file mode 100644 index 000000000..40ebd65dd --- /dev/null +++ b/src/runloop_api_client/types/benchmark_list_view.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .benchmark_view import BenchmarkView + +__all__ = ["BenchmarkListView"] + + +class BenchmarkListView(BaseModel): + benchmarks: List[BenchmarkView] + """List of Benchmarks matching filter.""" + + has_more: bool + + total_count: int diff --git a/src/runloop_api_client/types/benchmark_run_view.py b/src/runloop_api_client/types/benchmark_run_view.py new file mode 100644 index 000000000..08507340e --- /dev/null +++ b/src/runloop_api_client/types/benchmark_run_view.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["BenchmarkRunView"] + + +class BenchmarkRunView(BaseModel): + id: str + """The ID of the BenchmarkRun.""" + + benchmark_id: str + """The ID of the Benchmark.""" + + state: Literal["running", "completed"] + """The state of the BenchmarkRun.""" + + name: Optional[str] = None + """The name of the BenchmarkRun.""" diff --git a/src/runloop_api_client/types/benchmark_start_run_params.py b/src/runloop_api_client/types/benchmark_start_run_params.py new file mode 100644 index 000000000..39d618669 --- /dev/null +++ b/src/runloop_api_client/types/benchmark_start_run_params.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +__all__ = ["BenchmarkStartRunParams"] + + +class BenchmarkStartRunParams(TypedDict, total=False): + benchmark_id: Required[str] + """ID of the Benchmark to run.""" + + run_name: Optional[str] + """Display name of the run.""" diff --git a/src/runloop_api_client/types/benchmark_view.py b/src/runloop_api_client/types/benchmark_view.py new file mode 100644 index 000000000..071415151 --- /dev/null +++ b/src/runloop_api_client/types/benchmark_view.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["BenchmarkView"] + + +class BenchmarkView(BaseModel): + id: str + """The ID of the Benchmark.""" + + name: str + """The name of the Benchmark.""" + + scenario_ids: List[str] = FieldInfo(alias="scenarioIds") + """List of Scenario IDs that make up the benchmark.""" diff --git a/src/runloop_api_client/types/benchmarks/__init__.py b/src/runloop_api_client/types/benchmarks/__init__.py new file mode 100644 index 000000000..3331e3806 --- /dev/null +++ b/src/runloop_api_client/types/benchmarks/__init__.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .run_list_params import RunListParams as RunListParams +from .run_list_response import RunListResponse as RunListResponse diff --git a/src/runloop_api_client/types/benchmarks/run_list_params.py b/src/runloop_api_client/types/benchmarks/run_list_params.py new file mode 100644 index 000000000..a8be85a7f --- /dev/null +++ b/src/runloop_api_client/types/benchmarks/run_list_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["RunListParams"] + + +class RunListParams(TypedDict, total=False): + limit: int + """The limit of items to return. Default is 20.""" + + starting_after: str + """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/benchmarks/run_list_response.py b/src/runloop_api_client/types/benchmarks/run_list_response.py new file mode 100644 index 000000000..0d2b4b43b --- /dev/null +++ b/src/runloop_api_client/types/benchmarks/run_list_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ..._models import BaseModel +from ..benchmark_run_view import BenchmarkRunView + +__all__ = ["RunListResponse"] + + +class RunListResponse(BaseModel): + has_more: bool + + runs: List[BenchmarkRunView] + """List of BenchmarkRuns matching filter.""" + + total_count: int diff --git a/src/runloop_api_client/types/input_context_parameters.py b/src/runloop_api_client/types/input_context_parameters.py new file mode 100644 index 000000000..85f6f3649 --- /dev/null +++ b/src/runloop_api_client/types/input_context_parameters.py @@ -0,0 +1,11 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .._models import BaseModel + +__all__ = ["InputContextParameters"] + + +class InputContextParameters(BaseModel): + problem_statement: str + """The problem statement for the Scenario.""" diff --git a/src/runloop_api_client/types/input_context_parameters_param.py b/src/runloop_api_client/types/input_context_parameters_param.py new file mode 100644 index 000000000..20df18dc2 --- /dev/null +++ b/src/runloop_api_client/types/input_context_parameters_param.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["InputContextParametersParam"] + + +class InputContextParametersParam(TypedDict, total=False): + problem_statement: Required[str] + """The problem statement for the Scenario.""" diff --git a/src/runloop_api_client/types/scenario_create_params.py b/src/runloop_api_client/types/scenario_create_params.py new file mode 100644 index 000000000..5d1311da7 --- /dev/null +++ b/src/runloop_api_client/types/scenario_create_params.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +from .input_context_parameters_param import InputContextParametersParam +from .scoring_contract_parameters_param import ScoringContractParametersParam +from .scenario_environment_parameters_param import ScenarioEnvironmentParametersParam + +__all__ = ["ScenarioCreateParams"] + + +class ScenarioCreateParams(TypedDict, total=False): + input_context: Required[InputContextParametersParam] + """The input context for the Scenario.""" + + name: Required[str] + """Name of the scenario.""" + + scoring_contract: Required[ScoringContractParametersParam] + """The scoring contract for the Scenario.""" + + environment_parameters: Optional[ScenarioEnvironmentParametersParam] + """The Environment in which the Scenario will run.""" diff --git a/src/runloop_api_client/types/scenario_environment_parameters.py b/src/runloop_api_client/types/scenario_environment_parameters.py new file mode 100644 index 000000000..0aede40b8 --- /dev/null +++ b/src/runloop_api_client/types/scenario_environment_parameters.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["ScenarioEnvironmentParameters"] + + +class ScenarioEnvironmentParameters(BaseModel): + blueprint_id: Optional[str] = None + """Use the blueprint with matching ID.""" + + prebuilt_id: Optional[str] = None + """Use the prebuilt with matching ID.""" + + snapshot_id: Optional[str] = None + """Use the snapshot with matching ID.""" diff --git a/src/runloop_api_client/types/scenario_environment_parameters_param.py b/src/runloop_api_client/types/scenario_environment_parameters_param.py new file mode 100644 index 000000000..457834cb2 --- /dev/null +++ b/src/runloop_api_client/types/scenario_environment_parameters_param.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import TypedDict + +__all__ = ["ScenarioEnvironmentParametersParam"] + + +class ScenarioEnvironmentParametersParam(TypedDict, total=False): + blueprint_id: Optional[str] + """Use the blueprint with matching ID.""" + + prebuilt_id: Optional[str] + """Use the prebuilt with matching ID.""" + + snapshot_id: Optional[str] + """Use the snapshot with matching ID.""" diff --git a/src/runloop_api_client/types/scenario_list_params.py b/src/runloop_api_client/types/scenario_list_params.py new file mode 100644 index 000000000..01dac999b --- /dev/null +++ b/src/runloop_api_client/types/scenario_list_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["ScenarioListParams"] + + +class ScenarioListParams(TypedDict, total=False): + limit: int + """The limit of items to return. Default is 20.""" + + starting_after: str + """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/scenario_list_view.py b/src/runloop_api_client/types/scenario_list_view.py new file mode 100644 index 000000000..9afe534cf --- /dev/null +++ b/src/runloop_api_client/types/scenario_list_view.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .scenario_view import ScenarioView + +__all__ = ["ScenarioListView"] + + +class ScenarioListView(BaseModel): + has_more: bool + + scenarios: List[ScenarioView] + """List of Scenarios matching filter.""" + + total_count: int diff --git a/src/runloop_api_client/types/scenario_run_list_view.py b/src/runloop_api_client/types/scenario_run_list_view.py new file mode 100644 index 000000000..73494f84c --- /dev/null +++ b/src/runloop_api_client/types/scenario_run_list_view.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .scenario_run_view import ScenarioRunView + +__all__ = ["ScenarioRunListView"] + + +class ScenarioRunListView(BaseModel): + has_more: bool + + runs: List[ScenarioRunView] + """List of ScenarioRuns matching filter.""" + + total_count: int diff --git a/src/runloop_api_client/types/scenario_run_view.py b/src/runloop_api_client/types/scenario_run_view.py new file mode 100644 index 000000000..33c18100f --- /dev/null +++ b/src/runloop_api_client/types/scenario_run_view.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from .._models import BaseModel +from .scoring_contract_result_view import ScoringContractResultView + +__all__ = ["ScenarioRunView"] + + +class ScenarioRunView(BaseModel): + id: str + """ID of the ScenarioRun.""" + + devbox_id: str + """ID of the Devbox on which the Scenario is running.""" + + scenario_id: str + """ID of the Scenario that has been run.""" + + state: Literal["running", "scoring", "completed", "canceled", "timeout", "failed"] + """The state of the ScenarioRun.""" + + benchmark_run_id: Optional[str] = None + """ID of the BenchmarkRun that this Scenario is associated with, if any.""" + + duration_ms: Optional[int] = None + """Duration scenario took to run.""" + + scoring_contract_result: Optional[ScoringContractResultView] = None + """The input context for the Scenario.""" diff --git a/src/runloop_api_client/types/scenario_start_run_params.py b/src/runloop_api_client/types/scenario_start_run_params.py new file mode 100644 index 000000000..6704db386 --- /dev/null +++ b/src/runloop_api_client/types/scenario_start_run_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +__all__ = ["ScenarioStartRunParams"] + + +class ScenarioStartRunParams(TypedDict, total=False): + scenario_id: Required[str] + """ID of the Scenario to run.""" + + benchmark_run_id: Optional[str] + """Benchmark to associate the run.""" + + run_name: Optional[str] + """Display name of the run.""" diff --git a/src/runloop_api_client/types/scenario_view.py b/src/runloop_api_client/types/scenario_view.py new file mode 100644 index 000000000..30f075ec2 --- /dev/null +++ b/src/runloop_api_client/types/scenario_view.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel +from .input_context_parameters import InputContextParameters +from .scoring_contract_parameters import ScoringContractParameters +from .scenario_environment_parameters import ScenarioEnvironmentParameters + +__all__ = ["ScenarioView"] + + +class ScenarioView(BaseModel): + id: str + """The ID of the Scenario.""" + + input_context: InputContextParameters + """The input context for the Scenario.""" + + name: str + """The name of the Scenario.""" + + scoring_contract: ScoringContractParameters + """The scoring contract for the Scenario.""" + + environment: Optional[ScenarioEnvironmentParameters] = None + """The Environment in which the Scenario is run.""" diff --git a/src/runloop_api_client/types/scenarios/__init__.py b/src/runloop_api_client/types/scenarios/__init__.py new file mode 100644 index 000000000..4bc4e1112 --- /dev/null +++ b/src/runloop_api_client/types/scenarios/__init__.py @@ -0,0 +1,5 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .run_list_params import RunListParams as RunListParams diff --git a/src/runloop_api_client/types/scenarios/run_list_params.py b/src/runloop_api_client/types/scenarios/run_list_params.py new file mode 100644 index 000000000..a8be85a7f --- /dev/null +++ b/src/runloop_api_client/types/scenarios/run_list_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["RunListParams"] + + +class RunListParams(TypedDict, total=False): + limit: int + """The limit of items to return. Default is 20.""" + + starting_after: str + """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/scoring_contract_parameters.py b/src/runloop_api_client/types/scoring_contract_parameters.py new file mode 100644 index 000000000..5d59d1b64 --- /dev/null +++ b/src/runloop_api_client/types/scoring_contract_parameters.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .scoring_function_parameters import ScoringFunctionParameters + +__all__ = ["ScoringContractParameters"] + + +class ScoringContractParameters(BaseModel): + scoring_function_parameters: List[ScoringFunctionParameters] + """A list of scoring functions used to evaluate the Scenario.""" diff --git a/src/runloop_api_client/types/scoring_contract_parameters_param.py b/src/runloop_api_client/types/scoring_contract_parameters_param.py new file mode 100644 index 000000000..a28a34b4e --- /dev/null +++ b/src/runloop_api_client/types/scoring_contract_parameters_param.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +from .scoring_function_parameters_param import ScoringFunctionParametersParam + +__all__ = ["ScoringContractParametersParam"] + + +class ScoringContractParametersParam(TypedDict, total=False): + scoring_function_parameters: Required[Iterable[ScoringFunctionParametersParam]] + """A list of scoring functions used to evaluate the Scenario.""" diff --git a/src/runloop_api_client/types/scoring_contract_result_view.py b/src/runloop_api_client/types/scoring_contract_result_view.py new file mode 100644 index 000000000..823de83c4 --- /dev/null +++ b/src/runloop_api_client/types/scoring_contract_result_view.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .scoring_function_result_view import ScoringFunctionResultView + +__all__ = ["ScoringContractResultView"] + + +class ScoringContractResultView(BaseModel): + score: float + """Total score for all scoring contracts. This will be a value between 0 and 1.""" + + scoring_function_results: List[ScoringFunctionResultView] + """List of all individual scoring function results.""" diff --git a/src/runloop_api_client/types/scoring_function_parameters.py b/src/runloop_api_client/types/scoring_function_parameters.py new file mode 100644 index 000000000..815d88e6a --- /dev/null +++ b/src/runloop_api_client/types/scoring_function_parameters.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["ScoringFunctionParameters"] + + +class ScoringFunctionParameters(BaseModel): + name: str + """Name of scoring function.""" + + weight: float + """Wight to apply to scoring function score. + + Weights of all scoring functions should sum to 1.0. + """ + + bash_script: Optional[str] = None + """ + A single bash script that sets up the environment, scores, and prints the final + score to standard out. Score should be an integer between 0 and 100, and look + like "score=[0..100]. + """ diff --git a/src/runloop_api_client/types/scoring_function_parameters_param.py b/src/runloop_api_client/types/scoring_function_parameters_param.py new file mode 100644 index 000000000..594760fd1 --- /dev/null +++ b/src/runloop_api_client/types/scoring_function_parameters_param.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +__all__ = ["ScoringFunctionParametersParam"] + + +class ScoringFunctionParametersParam(TypedDict, total=False): + name: Required[str] + """Name of scoring function.""" + + weight: Required[float] + """Wight to apply to scoring function score. + + Weights of all scoring functions should sum to 1.0. + """ + + bash_script: Optional[str] + """ + A single bash script that sets up the environment, scores, and prints the final + score to standard out. Score should be an integer between 0 and 100, and look + like "score=[0..100]. + """ diff --git a/src/runloop_api_client/types/scoring_function_result_view.py b/src/runloop_api_client/types/scoring_function_result_view.py new file mode 100644 index 000000000..7fcbcd50c --- /dev/null +++ b/src/runloop_api_client/types/scoring_function_result_view.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from .._models import BaseModel + +__all__ = ["ScoringFunctionResultView"] + + +class ScoringFunctionResultView(BaseModel): + output: str + """Log output of the scoring function.""" + + score: float + """Final score for the given scoring function.""" + + scoring_function_name: str + """Scoring function name that ran.""" diff --git a/tests/api_resources/benchmarks/__init__.py b/tests/api_resources/benchmarks/__init__.py new file mode 100644 index 000000000..fd8019a9a --- /dev/null +++ b/tests/api_resources/benchmarks/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/benchmarks/test_runs.py b/tests/api_resources/benchmarks/test_runs.py new file mode 100644 index 000000000..cd0eac6c5 --- /dev/null +++ b/tests/api_resources/benchmarks/test_runs.py @@ -0,0 +1,241 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types import BenchmarkRunView +from runloop_api_client.types.benchmarks import RunListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestRuns: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + run = client.benchmarks.runs.retrieve( + "id", + ) + assert_matches_type(BenchmarkRunView, run, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.benchmarks.runs.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + run = response.parse() + assert_matches_type(BenchmarkRunView, run, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.benchmarks.runs.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + run = response.parse() + assert_matches_type(BenchmarkRunView, run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.benchmarks.runs.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + run = client.benchmarks.runs.list() + assert_matches_type(RunListResponse, run, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + run = client.benchmarks.runs.list( + limit=0, + starting_after="starting_after", + ) + assert_matches_type(RunListResponse, run, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.benchmarks.runs.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + run = response.parse() + assert_matches_type(RunListResponse, run, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.benchmarks.runs.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + run = response.parse() + assert_matches_type(RunListResponse, run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_complete(self, client: Runloop) -> None: + run = client.benchmarks.runs.complete( + "id", + ) + assert_matches_type(BenchmarkRunView, run, path=["response"]) + + @parametrize + def test_raw_response_complete(self, client: Runloop) -> None: + response = client.benchmarks.runs.with_raw_response.complete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + run = response.parse() + assert_matches_type(BenchmarkRunView, run, path=["response"]) + + @parametrize + def test_streaming_response_complete(self, client: Runloop) -> None: + with client.benchmarks.runs.with_streaming_response.complete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + run = response.parse() + assert_matches_type(BenchmarkRunView, run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_complete(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.benchmarks.runs.with_raw_response.complete( + "", + ) + + +class TestAsyncRuns: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + run = await async_client.benchmarks.runs.retrieve( + "id", + ) + assert_matches_type(BenchmarkRunView, run, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.benchmarks.runs.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + run = await response.parse() + assert_matches_type(BenchmarkRunView, run, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.benchmarks.runs.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + run = await response.parse() + assert_matches_type(BenchmarkRunView, run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.benchmarks.runs.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + run = await async_client.benchmarks.runs.list() + assert_matches_type(RunListResponse, run, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + run = await async_client.benchmarks.runs.list( + limit=0, + starting_after="starting_after", + ) + assert_matches_type(RunListResponse, run, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.benchmarks.runs.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + run = await response.parse() + assert_matches_type(RunListResponse, run, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.benchmarks.runs.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + run = await response.parse() + assert_matches_type(RunListResponse, run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_complete(self, async_client: AsyncRunloop) -> None: + run = await async_client.benchmarks.runs.complete( + "id", + ) + assert_matches_type(BenchmarkRunView, run, path=["response"]) + + @parametrize + async def test_raw_response_complete(self, async_client: AsyncRunloop) -> None: + response = await async_client.benchmarks.runs.with_raw_response.complete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + run = await response.parse() + assert_matches_type(BenchmarkRunView, run, path=["response"]) + + @parametrize + async def test_streaming_response_complete(self, async_client: AsyncRunloop) -> None: + async with async_client.benchmarks.runs.with_streaming_response.complete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + run = await response.parse() + assert_matches_type(BenchmarkRunView, run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_complete(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.benchmarks.runs.with_raw_response.complete( + "", + ) diff --git a/tests/api_resources/scenarios/__init__.py b/tests/api_resources/scenarios/__init__.py new file mode 100644 index 000000000..fd8019a9a --- /dev/null +++ b/tests/api_resources/scenarios/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/scenarios/test_runs.py b/tests/api_resources/scenarios/test_runs.py new file mode 100644 index 000000000..0fa9873eb --- /dev/null +++ b/tests/api_resources/scenarios/test_runs.py @@ -0,0 +1,316 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types import ScenarioRunView, ScenarioRunListView + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestRuns: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + run = client.scenarios.runs.retrieve( + "id", + ) + assert_matches_type(ScenarioRunView, run, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.scenarios.runs.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + run = response.parse() + assert_matches_type(ScenarioRunView, run, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.scenarios.runs.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + run = response.parse() + assert_matches_type(ScenarioRunView, run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.scenarios.runs.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + run = client.scenarios.runs.list() + assert_matches_type(ScenarioRunListView, run, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + run = client.scenarios.runs.list( + limit=0, + starting_after="starting_after", + ) + assert_matches_type(ScenarioRunListView, run, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.scenarios.runs.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + run = response.parse() + assert_matches_type(ScenarioRunListView, run, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.scenarios.runs.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + run = response.parse() + assert_matches_type(ScenarioRunListView, run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_complete(self, client: Runloop) -> None: + run = client.scenarios.runs.complete( + "id", + ) + assert_matches_type(ScenarioRunView, run, path=["response"]) + + @parametrize + def test_raw_response_complete(self, client: Runloop) -> None: + response = client.scenarios.runs.with_raw_response.complete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + run = response.parse() + assert_matches_type(ScenarioRunView, run, path=["response"]) + + @parametrize + def test_streaming_response_complete(self, client: Runloop) -> None: + with client.scenarios.runs.with_streaming_response.complete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + run = response.parse() + assert_matches_type(ScenarioRunView, run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_complete(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.scenarios.runs.with_raw_response.complete( + "", + ) + + @parametrize + def test_method_score(self, client: Runloop) -> None: + run = client.scenarios.runs.score( + "id", + ) + assert_matches_type(ScenarioRunView, run, path=["response"]) + + @parametrize + def test_raw_response_score(self, client: Runloop) -> None: + response = client.scenarios.runs.with_raw_response.score( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + run = response.parse() + assert_matches_type(ScenarioRunView, run, path=["response"]) + + @parametrize + def test_streaming_response_score(self, client: Runloop) -> None: + with client.scenarios.runs.with_streaming_response.score( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + run = response.parse() + assert_matches_type(ScenarioRunView, run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_score(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.scenarios.runs.with_raw_response.score( + "", + ) + + +class TestAsyncRuns: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + run = await async_client.scenarios.runs.retrieve( + "id", + ) + assert_matches_type(ScenarioRunView, run, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.scenarios.runs.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + run = await response.parse() + assert_matches_type(ScenarioRunView, run, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.scenarios.runs.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + run = await response.parse() + assert_matches_type(ScenarioRunView, run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.scenarios.runs.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + run = await async_client.scenarios.runs.list() + assert_matches_type(ScenarioRunListView, run, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + run = await async_client.scenarios.runs.list( + limit=0, + starting_after="starting_after", + ) + assert_matches_type(ScenarioRunListView, run, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.scenarios.runs.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + run = await response.parse() + assert_matches_type(ScenarioRunListView, run, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.scenarios.runs.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + run = await response.parse() + assert_matches_type(ScenarioRunListView, run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_complete(self, async_client: AsyncRunloop) -> None: + run = await async_client.scenarios.runs.complete( + "id", + ) + assert_matches_type(ScenarioRunView, run, path=["response"]) + + @parametrize + async def test_raw_response_complete(self, async_client: AsyncRunloop) -> None: + response = await async_client.scenarios.runs.with_raw_response.complete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + run = await response.parse() + assert_matches_type(ScenarioRunView, run, path=["response"]) + + @parametrize + async def test_streaming_response_complete(self, async_client: AsyncRunloop) -> None: + async with async_client.scenarios.runs.with_streaming_response.complete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + run = await response.parse() + assert_matches_type(ScenarioRunView, run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_complete(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.scenarios.runs.with_raw_response.complete( + "", + ) + + @parametrize + async def test_method_score(self, async_client: AsyncRunloop) -> None: + run = await async_client.scenarios.runs.score( + "id", + ) + assert_matches_type(ScenarioRunView, run, path=["response"]) + + @parametrize + async def test_raw_response_score(self, async_client: AsyncRunloop) -> None: + response = await async_client.scenarios.runs.with_raw_response.score( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + run = await response.parse() + assert_matches_type(ScenarioRunView, run, path=["response"]) + + @parametrize + async def test_streaming_response_score(self, async_client: AsyncRunloop) -> None: + async with async_client.scenarios.runs.with_streaming_response.score( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + run = await response.parse() + assert_matches_type(ScenarioRunView, run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_score(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.scenarios.runs.with_raw_response.score( + "", + ) diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py new file mode 100644 index 000000000..0e1735e07 --- /dev/null +++ b/tests/api_resources/test_benchmarks.py @@ -0,0 +1,324 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types import ( + BenchmarkView, + BenchmarkRunView, + BenchmarkListView, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestBenchmarks: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Runloop) -> None: + benchmark = client.benchmarks.create( + name="name", + ) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Runloop) -> None: + benchmark = client.benchmarks.create( + name="name", + scenario_ids=["string"], + ) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Runloop) -> None: + response = client.benchmarks.with_raw_response.create( + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark = response.parse() + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Runloop) -> None: + with client.benchmarks.with_streaming_response.create( + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark = response.parse() + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + benchmark = client.benchmarks.retrieve( + "id", + ) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.benchmarks.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark = response.parse() + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.benchmarks.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark = response.parse() + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.benchmarks.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + benchmark = client.benchmarks.list() + assert_matches_type(BenchmarkListView, benchmark, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + benchmark = client.benchmarks.list( + limit=0, + starting_after="starting_after", + ) + assert_matches_type(BenchmarkListView, benchmark, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.benchmarks.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark = response.parse() + assert_matches_type(BenchmarkListView, benchmark, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.benchmarks.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark = response.parse() + assert_matches_type(BenchmarkListView, benchmark, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_start_run(self, client: Runloop) -> None: + benchmark = client.benchmarks.start_run( + benchmark_id="benchmark_id", + ) + assert_matches_type(BenchmarkRunView, benchmark, path=["response"]) + + @parametrize + def test_method_start_run_with_all_params(self, client: Runloop) -> None: + benchmark = client.benchmarks.start_run( + benchmark_id="benchmark_id", + run_name="run_name", + ) + assert_matches_type(BenchmarkRunView, benchmark, path=["response"]) + + @parametrize + def test_raw_response_start_run(self, client: Runloop) -> None: + response = client.benchmarks.with_raw_response.start_run( + benchmark_id="benchmark_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark = response.parse() + assert_matches_type(BenchmarkRunView, benchmark, path=["response"]) + + @parametrize + def test_streaming_response_start_run(self, client: Runloop) -> None: + with client.benchmarks.with_streaming_response.start_run( + benchmark_id="benchmark_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark = response.parse() + assert_matches_type(BenchmarkRunView, benchmark, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncBenchmarks: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncRunloop) -> None: + benchmark = await async_client.benchmarks.create( + name="name", + ) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: + benchmark = await async_client.benchmarks.create( + name="name", + scenario_ids=["string"], + ) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: + response = await async_client.benchmarks.with_raw_response.create( + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark = await response.parse() + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: + async with async_client.benchmarks.with_streaming_response.create( + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark = await response.parse() + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + benchmark = await async_client.benchmarks.retrieve( + "id", + ) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.benchmarks.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark = await response.parse() + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.benchmarks.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark = await response.parse() + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.benchmarks.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + benchmark = await async_client.benchmarks.list() + assert_matches_type(BenchmarkListView, benchmark, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + benchmark = await async_client.benchmarks.list( + limit=0, + starting_after="starting_after", + ) + assert_matches_type(BenchmarkListView, benchmark, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.benchmarks.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark = await response.parse() + assert_matches_type(BenchmarkListView, benchmark, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.benchmarks.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark = await response.parse() + assert_matches_type(BenchmarkListView, benchmark, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_start_run(self, async_client: AsyncRunloop) -> None: + benchmark = await async_client.benchmarks.start_run( + benchmark_id="benchmark_id", + ) + assert_matches_type(BenchmarkRunView, benchmark, path=["response"]) + + @parametrize + async def test_method_start_run_with_all_params(self, async_client: AsyncRunloop) -> None: + benchmark = await async_client.benchmarks.start_run( + benchmark_id="benchmark_id", + run_name="run_name", + ) + assert_matches_type(BenchmarkRunView, benchmark, path=["response"]) + + @parametrize + async def test_raw_response_start_run(self, async_client: AsyncRunloop) -> None: + response = await async_client.benchmarks.with_raw_response.start_run( + benchmark_id="benchmark_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark = await response.parse() + assert_matches_type(BenchmarkRunView, benchmark, path=["response"]) + + @parametrize + async def test_streaming_response_start_run(self, async_client: AsyncRunloop) -> None: + async with async_client.benchmarks.with_streaming_response.start_run( + benchmark_id="benchmark_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark = await response.parse() + assert_matches_type(BenchmarkRunView, benchmark, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py new file mode 100644 index 000000000..509542559 --- /dev/null +++ b/tests/api_resources/test_scenarios.py @@ -0,0 +1,408 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types import ( + ScenarioView, + ScenarioRunView, + ScenarioListView, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestScenarios: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Runloop) -> None: + scenario = client.scenarios.create( + input_context={"problem_statement": "problem_statement"}, + name="name", + scoring_contract={ + "scoring_function_parameters": [ + { + "name": "name", + "weight": 0, + } + ] + }, + ) + assert_matches_type(ScenarioView, scenario, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Runloop) -> None: + scenario = client.scenarios.create( + input_context={"problem_statement": "problem_statement"}, + name="name", + scoring_contract={ + "scoring_function_parameters": [ + { + "name": "name", + "weight": 0, + "bash_script": "bash_script", + } + ] + }, + environment_parameters={ + "blueprint_id": "blueprint_id", + "prebuilt_id": "prebuilt_id", + "snapshot_id": "snapshot_id", + }, + ) + assert_matches_type(ScenarioView, scenario, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Runloop) -> None: + response = client.scenarios.with_raw_response.create( + input_context={"problem_statement": "problem_statement"}, + name="name", + scoring_contract={ + "scoring_function_parameters": [ + { + "name": "name", + "weight": 0, + } + ] + }, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scenario = response.parse() + assert_matches_type(ScenarioView, scenario, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Runloop) -> None: + with client.scenarios.with_streaming_response.create( + input_context={"problem_statement": "problem_statement"}, + name="name", + scoring_contract={ + "scoring_function_parameters": [ + { + "name": "name", + "weight": 0, + } + ] + }, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scenario = response.parse() + assert_matches_type(ScenarioView, scenario, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + scenario = client.scenarios.retrieve( + "id", + ) + assert_matches_type(ScenarioView, scenario, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.scenarios.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scenario = response.parse() + assert_matches_type(ScenarioView, scenario, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.scenarios.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scenario = response.parse() + assert_matches_type(ScenarioView, scenario, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.scenarios.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + scenario = client.scenarios.list() + assert_matches_type(ScenarioListView, scenario, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + scenario = client.scenarios.list( + limit=0, + starting_after="starting_after", + ) + assert_matches_type(ScenarioListView, scenario, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.scenarios.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scenario = response.parse() + assert_matches_type(ScenarioListView, scenario, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.scenarios.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scenario = response.parse() + assert_matches_type(ScenarioListView, scenario, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_start_run(self, client: Runloop) -> None: + scenario = client.scenarios.start_run( + scenario_id="scenario_id", + ) + assert_matches_type(ScenarioRunView, scenario, path=["response"]) + + @parametrize + def test_method_start_run_with_all_params(self, client: Runloop) -> None: + scenario = client.scenarios.start_run( + scenario_id="scenario_id", + benchmark_run_id="benchmark_run_id", + run_name="run_name", + ) + assert_matches_type(ScenarioRunView, scenario, path=["response"]) + + @parametrize + def test_raw_response_start_run(self, client: Runloop) -> None: + response = client.scenarios.with_raw_response.start_run( + scenario_id="scenario_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scenario = response.parse() + assert_matches_type(ScenarioRunView, scenario, path=["response"]) + + @parametrize + def test_streaming_response_start_run(self, client: Runloop) -> None: + with client.scenarios.with_streaming_response.start_run( + scenario_id="scenario_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scenario = response.parse() + assert_matches_type(ScenarioRunView, scenario, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncScenarios: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncRunloop) -> None: + scenario = await async_client.scenarios.create( + input_context={"problem_statement": "problem_statement"}, + name="name", + scoring_contract={ + "scoring_function_parameters": [ + { + "name": "name", + "weight": 0, + } + ] + }, + ) + assert_matches_type(ScenarioView, scenario, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: + scenario = await async_client.scenarios.create( + input_context={"problem_statement": "problem_statement"}, + name="name", + scoring_contract={ + "scoring_function_parameters": [ + { + "name": "name", + "weight": 0, + "bash_script": "bash_script", + } + ] + }, + environment_parameters={ + "blueprint_id": "blueprint_id", + "prebuilt_id": "prebuilt_id", + "snapshot_id": "snapshot_id", + }, + ) + assert_matches_type(ScenarioView, scenario, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: + response = await async_client.scenarios.with_raw_response.create( + input_context={"problem_statement": "problem_statement"}, + name="name", + scoring_contract={ + "scoring_function_parameters": [ + { + "name": "name", + "weight": 0, + } + ] + }, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scenario = await response.parse() + assert_matches_type(ScenarioView, scenario, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: + async with async_client.scenarios.with_streaming_response.create( + input_context={"problem_statement": "problem_statement"}, + name="name", + scoring_contract={ + "scoring_function_parameters": [ + { + "name": "name", + "weight": 0, + } + ] + }, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scenario = await response.parse() + assert_matches_type(ScenarioView, scenario, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + scenario = await async_client.scenarios.retrieve( + "id", + ) + assert_matches_type(ScenarioView, scenario, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.scenarios.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scenario = await response.parse() + assert_matches_type(ScenarioView, scenario, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.scenarios.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scenario = await response.parse() + assert_matches_type(ScenarioView, scenario, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.scenarios.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + scenario = await async_client.scenarios.list() + assert_matches_type(ScenarioListView, scenario, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + scenario = await async_client.scenarios.list( + limit=0, + starting_after="starting_after", + ) + assert_matches_type(ScenarioListView, scenario, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.scenarios.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scenario = await response.parse() + assert_matches_type(ScenarioListView, scenario, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.scenarios.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scenario = await response.parse() + assert_matches_type(ScenarioListView, scenario, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_start_run(self, async_client: AsyncRunloop) -> None: + scenario = await async_client.scenarios.start_run( + scenario_id="scenario_id", + ) + assert_matches_type(ScenarioRunView, scenario, path=["response"]) + + @parametrize + async def test_method_start_run_with_all_params(self, async_client: AsyncRunloop) -> None: + scenario = await async_client.scenarios.start_run( + scenario_id="scenario_id", + benchmark_run_id="benchmark_run_id", + run_name="run_name", + ) + assert_matches_type(ScenarioRunView, scenario, path=["response"]) + + @parametrize + async def test_raw_response_start_run(self, async_client: AsyncRunloop) -> None: + response = await async_client.scenarios.with_raw_response.start_run( + scenario_id="scenario_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scenario = await response.parse() + assert_matches_type(ScenarioRunView, scenario, path=["response"]) + + @parametrize + async def test_streaming_response_start_run(self, async_client: AsyncRunloop) -> None: + async with async_client.scenarios.with_streaming_response.start_run( + scenario_id="scenario_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scenario = await response.parse() + assert_matches_type(ScenarioRunView, scenario, path=["response"]) + + assert cast(Any, response.is_closed) is True From 20f44eeff117013de01b8f6a282642d661683d20 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 18:48:31 +0000 Subject: [PATCH 635/993] feat(api): api update (#502) --- .stats.yml | 2 +- api.md | 10 ++-------- .../resources/benchmarks/runs.py | 10 +++++----- src/runloop_api_client/types/__init__.py | 1 + ...response.py => benchmark_run_list_view.py} | 8 ++++---- .../types/benchmarks/__init__.py | 1 - tests/api_resources/benchmarks/test_runs.py | 19 +++++++++---------- 7 files changed, 22 insertions(+), 29 deletions(-) rename src/runloop_api_client/types/{benchmarks/run_list_response.py => benchmark_run_list_view.py} (60%) diff --git a/.stats.yml b/.stats.yml index 4a526b1c8..16278e6a4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 61 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f4e55467750a460852376c0f037c34548a9b72d438b3484b9db0fa62c2573f03.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-9644e0fb22c7f4f55c131356129c4da627ec8aa3a46f5305893e601b961fe1fc.yml diff --git a/api.md b/api.md index 0723b7e19..2af2e46fa 100644 --- a/api.md +++ b/api.md @@ -12,6 +12,7 @@ Types: from runloop_api_client.types import ( BenchmarkCreateParameters, BenchmarkListView, + BenchmarkRunListView, BenchmarkRunView, BenchmarkView, StartBenchmarkRunParameters, @@ -27,16 +28,10 @@ Methods: ## Runs -Types: - -```python -from runloop_api_client.types.benchmarks import RunListResponse -``` - Methods: - client.benchmarks.runs.retrieve(id) -> BenchmarkRunView -- client.benchmarks.runs.list(\*\*params) -> RunListResponse +- client.benchmarks.runs.list(\*\*params) -> BenchmarkRunListView - client.benchmarks.runs.complete(id) -> BenchmarkRunView # Blueprints @@ -215,7 +210,6 @@ Types: ```python from runloop_api_client.types import ( InputContextParameters, - RepositoryConnectionListView, ScenarioCreateParameters, ScenarioEnvironmentParameters, ScenarioListView, diff --git a/src/runloop_api_client/resources/benchmarks/runs.py b/src/runloop_api_client/resources/benchmarks/runs.py index 0124ba1b0..3a5527345 100644 --- a/src/runloop_api_client/resources/benchmarks/runs.py +++ b/src/runloop_api_client/resources/benchmarks/runs.py @@ -20,7 +20,7 @@ from ..._base_client import make_request_options from ...types.benchmarks import run_list_params from ...types.benchmark_run_view import BenchmarkRunView -from ...types.benchmarks.run_list_response import RunListResponse +from ...types.benchmark_run_list_view import BenchmarkRunListView __all__ = ["RunsResource", "AsyncRunsResource"] @@ -89,7 +89,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunListResponse: + ) -> BenchmarkRunListView: """ List all BenchmarkRuns matching filter. @@ -121,7 +121,7 @@ def list( run_list_params.RunListParams, ), ), - cast_to=RunListResponse, + cast_to=BenchmarkRunListView, ) def complete( @@ -229,7 +229,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RunListResponse: + ) -> BenchmarkRunListView: """ List all BenchmarkRuns matching filter. @@ -261,7 +261,7 @@ async def list( run_list_params.RunListParams, ), ), - cast_to=RunListResponse, + cast_to=BenchmarkRunListView, ) async def complete( diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index ec078e815..58f1cf7af 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -30,6 +30,7 @@ from .scenario_create_params import ScenarioCreateParams as ScenarioCreateParams from .scenario_run_list_view import ScenarioRunListView as ScenarioRunListView from .benchmark_create_params import BenchmarkCreateParams as BenchmarkCreateParams +from .benchmark_run_list_view import BenchmarkRunListView as BenchmarkRunListView from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams from .input_context_parameters import InputContextParameters as InputContextParameters diff --git a/src/runloop_api_client/types/benchmarks/run_list_response.py b/src/runloop_api_client/types/benchmark_run_list_view.py similarity index 60% rename from src/runloop_api_client/types/benchmarks/run_list_response.py rename to src/runloop_api_client/types/benchmark_run_list_view.py index 0d2b4b43b..4a8a1fda0 100644 --- a/src/runloop_api_client/types/benchmarks/run_list_response.py +++ b/src/runloop_api_client/types/benchmark_run_list_view.py @@ -2,13 +2,13 @@ from typing import List -from ..._models import BaseModel -from ..benchmark_run_view import BenchmarkRunView +from .._models import BaseModel +from .benchmark_run_view import BenchmarkRunView -__all__ = ["RunListResponse"] +__all__ = ["BenchmarkRunListView"] -class RunListResponse(BaseModel): +class BenchmarkRunListView(BaseModel): has_more: bool runs: List[BenchmarkRunView] diff --git a/src/runloop_api_client/types/benchmarks/__init__.py b/src/runloop_api_client/types/benchmarks/__init__.py index 3331e3806..4bc4e1112 100644 --- a/src/runloop_api_client/types/benchmarks/__init__.py +++ b/src/runloop_api_client/types/benchmarks/__init__.py @@ -3,4 +3,3 @@ from __future__ import annotations from .run_list_params import RunListParams as RunListParams -from .run_list_response import RunListResponse as RunListResponse diff --git a/tests/api_resources/benchmarks/test_runs.py b/tests/api_resources/benchmarks/test_runs.py index cd0eac6c5..6f7ac0b8d 100644 --- a/tests/api_resources/benchmarks/test_runs.py +++ b/tests/api_resources/benchmarks/test_runs.py @@ -9,8 +9,7 @@ from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types import BenchmarkRunView -from runloop_api_client.types.benchmarks import RunListResponse +from runloop_api_client.types import BenchmarkRunView, BenchmarkRunListView base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -59,7 +58,7 @@ def test_path_params_retrieve(self, client: Runloop) -> None: @parametrize def test_method_list(self, client: Runloop) -> None: run = client.benchmarks.runs.list() - assert_matches_type(RunListResponse, run, path=["response"]) + assert_matches_type(BenchmarkRunListView, run, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: @@ -67,7 +66,7 @@ def test_method_list_with_all_params(self, client: Runloop) -> None: limit=0, starting_after="starting_after", ) - assert_matches_type(RunListResponse, run, path=["response"]) + assert_matches_type(BenchmarkRunListView, run, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -76,7 +75,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" run = response.parse() - assert_matches_type(RunListResponse, run, path=["response"]) + assert_matches_type(BenchmarkRunListView, run, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -85,7 +84,7 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" run = response.parse() - assert_matches_type(RunListResponse, run, path=["response"]) + assert_matches_type(BenchmarkRunListView, run, path=["response"]) assert cast(Any, response.is_closed) is True @@ -172,7 +171,7 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: run = await async_client.benchmarks.runs.list() - assert_matches_type(RunListResponse, run, path=["response"]) + assert_matches_type(BenchmarkRunListView, run, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -180,7 +179,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> limit=0, starting_after="starting_after", ) - assert_matches_type(RunListResponse, run, path=["response"]) + assert_matches_type(BenchmarkRunListView, run, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -189,7 +188,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" run = await response.parse() - assert_matches_type(RunListResponse, run, path=["response"]) + assert_matches_type(BenchmarkRunListView, run, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -198,7 +197,7 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" run = await response.parse() - assert_matches_type(RunListResponse, run, path=["response"]) + assert_matches_type(BenchmarkRunListView, run, path=["response"]) assert cast(Any, response.is_closed) is True From 042aec1669d486261aecd82831c2f21250c4769b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 18:51:02 +0000 Subject: [PATCH 636/993] chore(internal): version bump (#503) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d52d2b974..a26ebfc1e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.13.0" + ".": "0.14.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index bca77395d..525fc8fbd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.13.0" +version = "0.14.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index f053467f5..9ac0bb875 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.13.0" # x-release-please-version +__version__ = "0.14.0" # x-release-please-version From d43dce320f7268df5b9a3b1f35e1df3a633e0e1a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 19:18:53 +0000 Subject: [PATCH 637/993] feat(api): api update (#504) --- .stats.yml | 2 +- api.md | 3 -- .../resources/scenarios/scenarios.py | 10 ++-- src/runloop_api_client/types/__init__.py | 8 --- .../types/scenario_create_params.py | 49 ++++++++++++++++--- .../types/scenario_environment_parameters.py | 18 ------- .../scenario_environment_parameters_param.py | 19 ------- src/runloop_api_client/types/scenario_view.py | 44 ++++++++++++++--- .../types/scoring_contract_parameters.py | 13 ----- .../scoring_contract_parameters_param.py | 15 ------ .../types/scoring_function_parameters.py | 25 ---------- .../scoring_function_parameters_param.py | 26 ---------- 12 files changed, 86 insertions(+), 146 deletions(-) delete mode 100644 src/runloop_api_client/types/scenario_environment_parameters.py delete mode 100644 src/runloop_api_client/types/scenario_environment_parameters_param.py delete mode 100644 src/runloop_api_client/types/scoring_contract_parameters.py delete mode 100644 src/runloop_api_client/types/scoring_contract_parameters_param.py delete mode 100644 src/runloop_api_client/types/scoring_function_parameters.py delete mode 100644 src/runloop_api_client/types/scoring_function_parameters_param.py diff --git a/.stats.yml b/.stats.yml index 16278e6a4..d282e8e97 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 61 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-9644e0fb22c7f4f55c131356129c4da627ec8aa3a46f5305893e601b961fe1fc.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a83fc2e1d2bb32a13a5049f905d63fd919b852ac0a4510c7ac06ddd4e86d3b22.yml diff --git a/api.md b/api.md index 2af2e46fa..96bd00086 100644 --- a/api.md +++ b/api.md @@ -211,14 +211,11 @@ Types: from runloop_api_client.types import ( InputContextParameters, ScenarioCreateParameters, - ScenarioEnvironmentParameters, ScenarioListView, ScenarioRunListView, ScenarioRunView, ScenarioView, - ScoringContractParameters, ScoringContractResultView, - ScoringFunctionParameters, ScoringFunctionResultView, StartScenarioRunParameters, ) diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index ec2a73dcc..66f679ce1 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -37,8 +37,6 @@ from ...types.scenario_run_view import ScenarioRunView from ...types.scenario_list_view import ScenarioListView from ...types.input_context_parameters_param import InputContextParametersParam -from ...types.scoring_contract_parameters_param import ScoringContractParametersParam -from ...types.scenario_environment_parameters_param import ScenarioEnvironmentParametersParam __all__ = ["ScenariosResource", "AsyncScenariosResource"] @@ -72,8 +70,8 @@ def create( *, input_context: InputContextParametersParam, name: str, - scoring_contract: ScoringContractParametersParam, - environment_parameters: Optional[ScenarioEnvironmentParametersParam] | NotGiven = NOT_GIVEN, + scoring_contract: scenario_create_params.ScoringContract, + environment_parameters: Optional[scenario_create_params.EnvironmentParameters] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -290,8 +288,8 @@ async def create( *, input_context: InputContextParametersParam, name: str, - scoring_contract: ScoringContractParametersParam, - environment_parameters: Optional[ScenarioEnvironmentParametersParam] | NotGiven = NOT_GIVEN, + scoring_contract: scenario_create_params.ScoringContract, + environment_parameters: Optional[scenario_create_params.EnvironmentParameters] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 58f1cf7af..309a38d5b 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -48,8 +48,6 @@ from .devbox_execute_async_params import DevboxExecuteAsyncParams as DevboxExecuteAsyncParams from .devbox_remove_tunnel_params import DevboxRemoveTunnelParams as DevboxRemoveTunnelParams from .devbox_snapshot_disk_params import DevboxSnapshotDiskParams as DevboxSnapshotDiskParams -from .scoring_contract_parameters import ScoringContractParameters as ScoringContractParameters -from .scoring_function_parameters import ScoringFunctionParameters as ScoringFunctionParameters from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView from .repository_version_list_view import RepositoryVersionListView as RepositoryVersionListView from .scoring_contract_result_view import ScoringContractResultView as ScoringContractResultView @@ -58,14 +56,8 @@ from .devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse as DevboxCreateSSHKeyResponse from .input_context_parameters_param import InputContextParametersParam as InputContextParametersParam from .repository_connection_list_view import RepositoryConnectionListView as RepositoryConnectionListView -from .scenario_environment_parameters import ScenarioEnvironmentParameters as ScenarioEnvironmentParameters from .devbox_read_file_contents_params import DevboxReadFileContentsParams as DevboxReadFileContentsParams from .devbox_list_disk_snapshots_params import DevboxListDiskSnapshotsParams as DevboxListDiskSnapshotsParams from .devbox_write_file_contents_params import DevboxWriteFileContentsParams as DevboxWriteFileContentsParams -from .scoring_contract_parameters_param import ScoringContractParametersParam as ScoringContractParametersParam -from .scoring_function_parameters_param import ScoringFunctionParametersParam as ScoringFunctionParametersParam from .devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView as DevboxAsyncExecutionDetailView from .devbox_read_file_contents_response import DevboxReadFileContentsResponse as DevboxReadFileContentsResponse -from .scenario_environment_parameters_param import ( - ScenarioEnvironmentParametersParam as ScenarioEnvironmentParametersParam, -) diff --git a/src/runloop_api_client/types/scenario_create_params.py b/src/runloop_api_client/types/scenario_create_params.py index 5d1311da7..f03ab8fe3 100644 --- a/src/runloop_api_client/types/scenario_create_params.py +++ b/src/runloop_api_client/types/scenario_create_params.py @@ -2,14 +2,17 @@ from __future__ import annotations -from typing import Optional +from typing import Iterable, Optional from typing_extensions import Required, TypedDict from .input_context_parameters_param import InputContextParametersParam -from .scoring_contract_parameters_param import ScoringContractParametersParam -from .scenario_environment_parameters_param import ScenarioEnvironmentParametersParam -__all__ = ["ScenarioCreateParams"] +__all__ = [ + "ScenarioCreateParams", + "ScoringContract", + "ScoringContractScoringFunctionParameter", + "EnvironmentParameters", +] class ScenarioCreateParams(TypedDict, total=False): @@ -19,8 +22,42 @@ class ScenarioCreateParams(TypedDict, total=False): name: Required[str] """Name of the scenario.""" - scoring_contract: Required[ScoringContractParametersParam] + scoring_contract: Required[ScoringContract] """The scoring contract for the Scenario.""" - environment_parameters: Optional[ScenarioEnvironmentParametersParam] + environment_parameters: Optional[EnvironmentParameters] """The Environment in which the Scenario will run.""" + + +class ScoringContractScoringFunctionParameter(TypedDict, total=False): + name: Required[str] + """Name of scoring function.""" + + weight: Required[float] + """Wight to apply to scoring function score. + + Weights of all scoring functions should sum to 1.0. + """ + + bash_script: Optional[str] + """ + A single bash script that sets up the environment, scores, and prints the final + score to standard out. Score should be an integer between 0 and 100, and look + like "score=[0..100]. + """ + + +class ScoringContract(TypedDict, total=False): + scoring_function_parameters: Required[Iterable[ScoringContractScoringFunctionParameter]] + """A list of scoring functions used to evaluate the Scenario.""" + + +class EnvironmentParameters(TypedDict, total=False): + blueprint_id: Optional[str] + """Use the blueprint with matching ID.""" + + prebuilt_id: Optional[str] + """Use the prebuilt with matching ID.""" + + snapshot_id: Optional[str] + """Use the snapshot with matching ID.""" diff --git a/src/runloop_api_client/types/scenario_environment_parameters.py b/src/runloop_api_client/types/scenario_environment_parameters.py deleted file mode 100644 index 0aede40b8..000000000 --- a/src/runloop_api_client/types/scenario_environment_parameters.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from .._models import BaseModel - -__all__ = ["ScenarioEnvironmentParameters"] - - -class ScenarioEnvironmentParameters(BaseModel): - blueprint_id: Optional[str] = None - """Use the blueprint with matching ID.""" - - prebuilt_id: Optional[str] = None - """Use the prebuilt with matching ID.""" - - snapshot_id: Optional[str] = None - """Use the snapshot with matching ID.""" diff --git a/src/runloop_api_client/types/scenario_environment_parameters_param.py b/src/runloop_api_client/types/scenario_environment_parameters_param.py deleted file mode 100644 index 457834cb2..000000000 --- a/src/runloop_api_client/types/scenario_environment_parameters_param.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Optional -from typing_extensions import TypedDict - -__all__ = ["ScenarioEnvironmentParametersParam"] - - -class ScenarioEnvironmentParametersParam(TypedDict, total=False): - blueprint_id: Optional[str] - """Use the blueprint with matching ID.""" - - prebuilt_id: Optional[str] - """Use the prebuilt with matching ID.""" - - snapshot_id: Optional[str] - """Use the snapshot with matching ID.""" diff --git a/src/runloop_api_client/types/scenario_view.py b/src/runloop_api_client/types/scenario_view.py index 30f075ec2..be1aa8450 100644 --- a/src/runloop_api_client/types/scenario_view.py +++ b/src/runloop_api_client/types/scenario_view.py @@ -1,13 +1,45 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from .._models import BaseModel from .input_context_parameters import InputContextParameters -from .scoring_contract_parameters import ScoringContractParameters -from .scenario_environment_parameters import ScenarioEnvironmentParameters -__all__ = ["ScenarioView"] +__all__ = ["ScenarioView", "ScoringContract", "ScoringContractScoringFunctionParameter", "Environment"] + + +class ScoringContractScoringFunctionParameter(BaseModel): + name: str + """Name of scoring function.""" + + weight: float + """Wight to apply to scoring function score. + + Weights of all scoring functions should sum to 1.0. + """ + + bash_script: Optional[str] = None + """ + A single bash script that sets up the environment, scores, and prints the final + score to standard out. Score should be an integer between 0 and 100, and look + like "score=[0..100]. + """ + + +class ScoringContract(BaseModel): + scoring_function_parameters: List[ScoringContractScoringFunctionParameter] + """A list of scoring functions used to evaluate the Scenario.""" + + +class Environment(BaseModel): + blueprint_id: Optional[str] = None + """Use the blueprint with matching ID.""" + + prebuilt_id: Optional[str] = None + """Use the prebuilt with matching ID.""" + + snapshot_id: Optional[str] = None + """Use the snapshot with matching ID.""" class ScenarioView(BaseModel): @@ -20,8 +52,8 @@ class ScenarioView(BaseModel): name: str """The name of the Scenario.""" - scoring_contract: ScoringContractParameters + scoring_contract: ScoringContract """The scoring contract for the Scenario.""" - environment: Optional[ScenarioEnvironmentParameters] = None + environment: Optional[Environment] = None """The Environment in which the Scenario is run.""" diff --git a/src/runloop_api_client/types/scoring_contract_parameters.py b/src/runloop_api_client/types/scoring_contract_parameters.py deleted file mode 100644 index 5d59d1b64..000000000 --- a/src/runloop_api_client/types/scoring_contract_parameters.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from .._models import BaseModel -from .scoring_function_parameters import ScoringFunctionParameters - -__all__ = ["ScoringContractParameters"] - - -class ScoringContractParameters(BaseModel): - scoring_function_parameters: List[ScoringFunctionParameters] - """A list of scoring functions used to evaluate the Scenario.""" diff --git a/src/runloop_api_client/types/scoring_contract_parameters_param.py b/src/runloop_api_client/types/scoring_contract_parameters_param.py deleted file mode 100644 index a28a34b4e..000000000 --- a/src/runloop_api_client/types/scoring_contract_parameters_param.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -from .scoring_function_parameters_param import ScoringFunctionParametersParam - -__all__ = ["ScoringContractParametersParam"] - - -class ScoringContractParametersParam(TypedDict, total=False): - scoring_function_parameters: Required[Iterable[ScoringFunctionParametersParam]] - """A list of scoring functions used to evaluate the Scenario.""" diff --git a/src/runloop_api_client/types/scoring_function_parameters.py b/src/runloop_api_client/types/scoring_function_parameters.py deleted file mode 100644 index 815d88e6a..000000000 --- a/src/runloop_api_client/types/scoring_function_parameters.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from .._models import BaseModel - -__all__ = ["ScoringFunctionParameters"] - - -class ScoringFunctionParameters(BaseModel): - name: str - """Name of scoring function.""" - - weight: float - """Wight to apply to scoring function score. - - Weights of all scoring functions should sum to 1.0. - """ - - bash_script: Optional[str] = None - """ - A single bash script that sets up the environment, scores, and prints the final - score to standard out. Score should be an integer between 0 and 100, and look - like "score=[0..100]. - """ diff --git a/src/runloop_api_client/types/scoring_function_parameters_param.py b/src/runloop_api_client/types/scoring_function_parameters_param.py deleted file mode 100644 index 594760fd1..000000000 --- a/src/runloop_api_client/types/scoring_function_parameters_param.py +++ /dev/null @@ -1,26 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Optional -from typing_extensions import Required, TypedDict - -__all__ = ["ScoringFunctionParametersParam"] - - -class ScoringFunctionParametersParam(TypedDict, total=False): - name: Required[str] - """Name of scoring function.""" - - weight: Required[float] - """Wight to apply to scoring function score. - - Weights of all scoring functions should sum to 1.0. - """ - - bash_script: Optional[str] - """ - A single bash script that sets up the environment, scores, and prints the final - score to standard out. Score should be an integer between 0 and 100, and look - like "score=[0..100]. - """ From 4b6b568c4815658e54e2723cd1adf5a75111dc25 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 19:29:32 +0000 Subject: [PATCH 638/993] feat(api): api update (#506) --- .stats.yml | 2 +- api.md | 5 +- .../resources/scenarios/scenarios.py | 16 +++--- src/runloop_api_client/types/__init__.py | 10 +++- ...context_parameters.py => input_context.py} | 4 +- ...meters_param.py => input_context_param.py} | 4 +- .../types/scenario_create_params.py | 53 +++---------------- .../types/scenario_environment.py | 18 +++++++ .../types/scenario_environment_param.py | 19 +++++++ src/runloop_api_client/types/scenario_view.py | 46 +++------------- .../types/scoring_contract.py | 13 +++++ .../types/scoring_contract_param.py | 15 ++++++ .../types/scoring_function.py | 25 +++++++++ .../types/scoring_function_param.py | 26 +++++++++ 14 files changed, 157 insertions(+), 99 deletions(-) rename src/runloop_api_client/types/{input_context_parameters.py => input_context.py} (71%) rename src/runloop_api_client/types/{input_context_parameters_param.py => input_context_param.py} (72%) create mode 100644 src/runloop_api_client/types/scenario_environment.py create mode 100644 src/runloop_api_client/types/scenario_environment_param.py create mode 100644 src/runloop_api_client/types/scoring_contract.py create mode 100644 src/runloop_api_client/types/scoring_contract_param.py create mode 100644 src/runloop_api_client/types/scoring_function.py create mode 100644 src/runloop_api_client/types/scoring_function_param.py diff --git a/.stats.yml b/.stats.yml index d282e8e97..45bcc8138 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 61 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a83fc2e1d2bb32a13a5049f905d63fd919b852ac0a4510c7ac06ddd4e86d3b22.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2d76871c6215358c176295dc168fa7f571f81df1f8df37ecbd1e4e06e7220d67.yml diff --git a/api.md b/api.md index 96bd00086..46135d100 100644 --- a/api.md +++ b/api.md @@ -209,13 +209,16 @@ Types: ```python from runloop_api_client.types import ( - InputContextParameters, + InputContext, ScenarioCreateParameters, + ScenarioEnvironment, ScenarioListView, ScenarioRunListView, ScenarioRunView, ScenarioView, + ScoringContract, ScoringContractResultView, + ScoringFunction, ScoringFunctionResultView, StartScenarioRunParameters, ) diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index 66f679ce1..bd698f6c9 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -36,7 +36,9 @@ from ...types.scenario_view import ScenarioView from ...types.scenario_run_view import ScenarioRunView from ...types.scenario_list_view import ScenarioListView -from ...types.input_context_parameters_param import InputContextParametersParam +from ...types.input_context_param import InputContextParam +from ...types.scoring_contract_param import ScoringContractParam +from ...types.scenario_environment_param import ScenarioEnvironmentParam __all__ = ["ScenariosResource", "AsyncScenariosResource"] @@ -68,10 +70,10 @@ def with_streaming_response(self) -> ScenariosResourceWithStreamingResponse: def create( self, *, - input_context: InputContextParametersParam, + input_context: InputContextParam, name: str, - scoring_contract: scenario_create_params.ScoringContract, - environment_parameters: Optional[scenario_create_params.EnvironmentParameters] | NotGiven = NOT_GIVEN, + scoring_contract: ScoringContractParam, + environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -286,10 +288,10 @@ def with_streaming_response(self) -> AsyncScenariosResourceWithStreamingResponse async def create( self, *, - input_context: InputContextParametersParam, + input_context: InputContextParam, name: str, - scoring_contract: scenario_create_params.ScoringContract, - environment_parameters: Optional[scenario_create_params.EnvironmentParameters] | NotGiven = NOT_GIVEN, + scoring_contract: ScoringContractParam, + environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 309a38d5b..d8cd7881a 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -8,10 +8,13 @@ CodeMountParameters as CodeMountParameters, ) from .devbox_view import DevboxView as DevboxView +from .input_context import InputContext as InputContext from .scenario_view import ScenarioView as ScenarioView from .benchmark_view import BenchmarkView as BenchmarkView from .blueprint_view import BlueprintView as BlueprintView from .devbox_list_view import DevboxListView as DevboxListView +from .scoring_contract import ScoringContract as ScoringContract +from .scoring_function import ScoringFunction as ScoringFunction from .scenario_run_view import ScenarioRunView as ScenarioRunView from .benchmark_run_view import BenchmarkRunView as BenchmarkRunView from .devbox_list_params import DevboxListParams as DevboxListParams @@ -20,8 +23,10 @@ from .benchmark_list_view import BenchmarkListView as BenchmarkListView from .blueprint_build_log import BlueprintBuildLog as BlueprintBuildLog from .blueprint_list_view import BlueprintListView as BlueprintListView +from .input_context_param import InputContextParam as InputContextParam from .devbox_create_params import DevboxCreateParams as DevboxCreateParams from .devbox_snapshot_view import DevboxSnapshotView as DevboxSnapshotView +from .scenario_environment import ScenarioEnvironment as ScenarioEnvironment from .scenario_list_params import ScenarioListParams as ScenarioListParams from .benchmark_list_params import BenchmarkListParams as BenchmarkListParams from .blueprint_list_params import BlueprintListParams as BlueprintListParams @@ -29,11 +34,12 @@ from .repository_list_params import RepositoryListParams as RepositoryListParams from .scenario_create_params import ScenarioCreateParams as ScenarioCreateParams from .scenario_run_list_view import ScenarioRunListView as ScenarioRunListView +from .scoring_contract_param import ScoringContractParam as ScoringContractParam +from .scoring_function_param import ScoringFunctionParam as ScoringFunctionParam from .benchmark_create_params import BenchmarkCreateParams as BenchmarkCreateParams from .benchmark_run_list_view import BenchmarkRunListView as BenchmarkRunListView from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams -from .input_context_parameters import InputContextParameters as InputContextParameters from .repository_create_params import RepositoryCreateParams as RepositoryCreateParams from .devbox_snapshot_list_view import DevboxSnapshotListView as DevboxSnapshotListView from .devbox_upload_file_params import DevboxUploadFileParams as DevboxUploadFileParams @@ -43,6 +49,7 @@ from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams from .repository_connection_view import RepositoryConnectionView as RepositoryConnectionView from .repository_version_details import RepositoryVersionDetails as RepositoryVersionDetails +from .scenario_environment_param import ScenarioEnvironmentParam as ScenarioEnvironmentParam from .devbox_create_tunnel_params import DevboxCreateTunnelParams as DevboxCreateTunnelParams from .devbox_download_file_params import DevboxDownloadFileParams as DevboxDownloadFileParams from .devbox_execute_async_params import DevboxExecuteAsyncParams as DevboxExecuteAsyncParams @@ -54,7 +61,6 @@ from .scoring_function_result_view import ScoringFunctionResultView as ScoringFunctionResultView from .blueprint_build_logs_list_view import BlueprintBuildLogsListView as BlueprintBuildLogsListView from .devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse as DevboxCreateSSHKeyResponse -from .input_context_parameters_param import InputContextParametersParam as InputContextParametersParam from .repository_connection_list_view import RepositoryConnectionListView as RepositoryConnectionListView from .devbox_read_file_contents_params import DevboxReadFileContentsParams as DevboxReadFileContentsParams from .devbox_list_disk_snapshots_params import DevboxListDiskSnapshotsParams as DevboxListDiskSnapshotsParams diff --git a/src/runloop_api_client/types/input_context_parameters.py b/src/runloop_api_client/types/input_context.py similarity index 71% rename from src/runloop_api_client/types/input_context_parameters.py rename to src/runloop_api_client/types/input_context.py index 85f6f3649..0ca7afafb 100644 --- a/src/runloop_api_client/types/input_context_parameters.py +++ b/src/runloop_api_client/types/input_context.py @@ -3,9 +3,9 @@ from .._models import BaseModel -__all__ = ["InputContextParameters"] +__all__ = ["InputContext"] -class InputContextParameters(BaseModel): +class InputContext(BaseModel): problem_statement: str """The problem statement for the Scenario.""" diff --git a/src/runloop_api_client/types/input_context_parameters_param.py b/src/runloop_api_client/types/input_context_param.py similarity index 72% rename from src/runloop_api_client/types/input_context_parameters_param.py rename to src/runloop_api_client/types/input_context_param.py index 20df18dc2..dcea87fa2 100644 --- a/src/runloop_api_client/types/input_context_parameters_param.py +++ b/src/runloop_api_client/types/input_context_param.py @@ -4,9 +4,9 @@ from typing_extensions import Required, TypedDict -__all__ = ["InputContextParametersParam"] +__all__ = ["InputContextParam"] -class InputContextParametersParam(TypedDict, total=False): +class InputContextParam(TypedDict, total=False): problem_statement: Required[str] """The problem statement for the Scenario.""" diff --git a/src/runloop_api_client/types/scenario_create_params.py b/src/runloop_api_client/types/scenario_create_params.py index f03ab8fe3..87a48b457 100644 --- a/src/runloop_api_client/types/scenario_create_params.py +++ b/src/runloop_api_client/types/scenario_create_params.py @@ -2,62 +2,25 @@ from __future__ import annotations -from typing import Iterable, Optional +from typing import Optional from typing_extensions import Required, TypedDict -from .input_context_parameters_param import InputContextParametersParam +from .input_context_param import InputContextParam +from .scoring_contract_param import ScoringContractParam +from .scenario_environment_param import ScenarioEnvironmentParam -__all__ = [ - "ScenarioCreateParams", - "ScoringContract", - "ScoringContractScoringFunctionParameter", - "EnvironmentParameters", -] +__all__ = ["ScenarioCreateParams"] class ScenarioCreateParams(TypedDict, total=False): - input_context: Required[InputContextParametersParam] + input_context: Required[InputContextParam] """The input context for the Scenario.""" name: Required[str] """Name of the scenario.""" - scoring_contract: Required[ScoringContract] + scoring_contract: Required[ScoringContractParam] """The scoring contract for the Scenario.""" - environment_parameters: Optional[EnvironmentParameters] + environment_parameters: Optional[ScenarioEnvironmentParam] """The Environment in which the Scenario will run.""" - - -class ScoringContractScoringFunctionParameter(TypedDict, total=False): - name: Required[str] - """Name of scoring function.""" - - weight: Required[float] - """Wight to apply to scoring function score. - - Weights of all scoring functions should sum to 1.0. - """ - - bash_script: Optional[str] - """ - A single bash script that sets up the environment, scores, and prints the final - score to standard out. Score should be an integer between 0 and 100, and look - like "score=[0..100]. - """ - - -class ScoringContract(TypedDict, total=False): - scoring_function_parameters: Required[Iterable[ScoringContractScoringFunctionParameter]] - """A list of scoring functions used to evaluate the Scenario.""" - - -class EnvironmentParameters(TypedDict, total=False): - blueprint_id: Optional[str] - """Use the blueprint with matching ID.""" - - prebuilt_id: Optional[str] - """Use the prebuilt with matching ID.""" - - snapshot_id: Optional[str] - """Use the snapshot with matching ID.""" diff --git a/src/runloop_api_client/types/scenario_environment.py b/src/runloop_api_client/types/scenario_environment.py new file mode 100644 index 000000000..756ab33e1 --- /dev/null +++ b/src/runloop_api_client/types/scenario_environment.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["ScenarioEnvironment"] + + +class ScenarioEnvironment(BaseModel): + blueprint_id: Optional[str] = None + """Use the blueprint with matching ID.""" + + prebuilt_id: Optional[str] = None + """Use the prebuilt with matching ID.""" + + snapshot_id: Optional[str] = None + """Use the snapshot with matching ID.""" diff --git a/src/runloop_api_client/types/scenario_environment_param.py b/src/runloop_api_client/types/scenario_environment_param.py new file mode 100644 index 000000000..a59c8b8b1 --- /dev/null +++ b/src/runloop_api_client/types/scenario_environment_param.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import TypedDict + +__all__ = ["ScenarioEnvironmentParam"] + + +class ScenarioEnvironmentParam(TypedDict, total=False): + blueprint_id: Optional[str] + """Use the blueprint with matching ID.""" + + prebuilt_id: Optional[str] + """Use the prebuilt with matching ID.""" + + snapshot_id: Optional[str] + """Use the snapshot with matching ID.""" diff --git a/src/runloop_api_client/types/scenario_view.py b/src/runloop_api_client/types/scenario_view.py index be1aa8450..d69c792b4 100644 --- a/src/runloop_api_client/types/scenario_view.py +++ b/src/runloop_api_client/types/scenario_view.py @@ -1,52 +1,20 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from .._models import BaseModel -from .input_context_parameters import InputContextParameters +from .input_context import InputContext +from .scoring_contract import ScoringContract +from .scenario_environment import ScenarioEnvironment -__all__ = ["ScenarioView", "ScoringContract", "ScoringContractScoringFunctionParameter", "Environment"] - - -class ScoringContractScoringFunctionParameter(BaseModel): - name: str - """Name of scoring function.""" - - weight: float - """Wight to apply to scoring function score. - - Weights of all scoring functions should sum to 1.0. - """ - - bash_script: Optional[str] = None - """ - A single bash script that sets up the environment, scores, and prints the final - score to standard out. Score should be an integer between 0 and 100, and look - like "score=[0..100]. - """ - - -class ScoringContract(BaseModel): - scoring_function_parameters: List[ScoringContractScoringFunctionParameter] - """A list of scoring functions used to evaluate the Scenario.""" - - -class Environment(BaseModel): - blueprint_id: Optional[str] = None - """Use the blueprint with matching ID.""" - - prebuilt_id: Optional[str] = None - """Use the prebuilt with matching ID.""" - - snapshot_id: Optional[str] = None - """Use the snapshot with matching ID.""" +__all__ = ["ScenarioView"] class ScenarioView(BaseModel): id: str """The ID of the Scenario.""" - input_context: InputContextParameters + input_context: InputContext """The input context for the Scenario.""" name: str @@ -55,5 +23,5 @@ class ScenarioView(BaseModel): scoring_contract: ScoringContract """The scoring contract for the Scenario.""" - environment: Optional[Environment] = None + environment: Optional[ScenarioEnvironment] = None """The Environment in which the Scenario is run.""" diff --git a/src/runloop_api_client/types/scoring_contract.py b/src/runloop_api_client/types/scoring_contract.py new file mode 100644 index 000000000..f19f5aa54 --- /dev/null +++ b/src/runloop_api_client/types/scoring_contract.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .scoring_function import ScoringFunction + +__all__ = ["ScoringContract"] + + +class ScoringContract(BaseModel): + scoring_function_parameters: List[ScoringFunction] + """A list of scoring functions used to evaluate the Scenario.""" diff --git a/src/runloop_api_client/types/scoring_contract_param.py b/src/runloop_api_client/types/scoring_contract_param.py new file mode 100644 index 000000000..4a68abb93 --- /dev/null +++ b/src/runloop_api_client/types/scoring_contract_param.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable +from typing_extensions import Required, TypedDict + +from .scoring_function_param import ScoringFunctionParam + +__all__ = ["ScoringContractParam"] + + +class ScoringContractParam(TypedDict, total=False): + scoring_function_parameters: Required[Iterable[ScoringFunctionParam]] + """A list of scoring functions used to evaluate the Scenario.""" diff --git a/src/runloop_api_client/types/scoring_function.py b/src/runloop_api_client/types/scoring_function.py new file mode 100644 index 000000000..2ed26f677 --- /dev/null +++ b/src/runloop_api_client/types/scoring_function.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["ScoringFunction"] + + +class ScoringFunction(BaseModel): + name: str + """Name of scoring function.""" + + weight: float + """Wight to apply to scoring function score. + + Weights of all scoring functions should sum to 1.0. + """ + + bash_script: Optional[str] = None + """ + A single bash script that sets up the environment, scores, and prints the final + score to standard out. Score should be an integer between 0 and 100, and look + like "score=[0..100]. + """ diff --git a/src/runloop_api_client/types/scoring_function_param.py b/src/runloop_api_client/types/scoring_function_param.py new file mode 100644 index 000000000..ba42923cc --- /dev/null +++ b/src/runloop_api_client/types/scoring_function_param.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +__all__ = ["ScoringFunctionParam"] + + +class ScoringFunctionParam(TypedDict, total=False): + name: Required[str] + """Name of scoring function.""" + + weight: Required[float] + """Wight to apply to scoring function score. + + Weights of all scoring functions should sum to 1.0. + """ + + bash_script: Optional[str] + """ + A single bash script that sets up the environment, scores, and prints the final + score to standard out. Score should be an integer between 0 and 100, and look + like "score=[0..100]. + """ From c8a4c83f5b472bc48c5d37c9a554421c75d7b56d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 19:38:44 +0000 Subject: [PATCH 639/993] chore(internal): version bump (#507) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a26ebfc1e..8f3e0a494 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.14.0" + ".": "0.15.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 525fc8fbd..87f3f45c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.14.0" +version = "0.15.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 9ac0bb875..c75e8e65d 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.14.0" # x-release-please-version +__version__ = "0.15.0" # x-release-please-version From 81c8a960d59f45a14d7b60030677fb8e84ffe26e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Jan 2025 03:23:33 +0000 Subject: [PATCH 640/993] chore(internal): codegen related update (#508) --- .github/workflows/ci.yml | 3 +-- pyproject.toml | 1 + scripts/bootstrap | 2 +- scripts/lint | 1 - src/runloop_api_client/_response.py | 4 ++-- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40293964f..c8a8a4f72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,6 @@ jobs: lint: name: lint runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 @@ -30,6 +29,7 @@ jobs: - name: Run lints run: ./scripts/lint + test: name: test runs-on: ubuntu-latest @@ -50,4 +50,3 @@ jobs: - name: Run tests run: ./scripts/test - diff --git a/pyproject.toml b/pyproject.toml index 87f3f45c5..8d099a5c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -129,6 +129,7 @@ testpaths = ["tests"] addopts = "--tb=short" xfail_strict = true asyncio_mode = "auto" +asyncio_default_fixture_loop_scope = "session" filterwarnings = [ "error" ] diff --git a/scripts/bootstrap b/scripts/bootstrap index 8c5c60eba..e84fe62c3 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,7 +4,7 @@ set -e cd "$(dirname "$0")/.." -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then +if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then brew bundle check >/dev/null 2>&1 || { echo "==> Installing Homebrew dependencies…" brew bundle diff --git a/scripts/lint b/scripts/lint index e43753789..6736f5cfd 100755 --- a/scripts/lint +++ b/scripts/lint @@ -9,4 +9,3 @@ rye run lint echo "==> Making sure it imports" rye run python -c 'import runloop_api_client' - diff --git a/src/runloop_api_client/_response.py b/src/runloop_api_client/_response.py index d765ed407..1e0ab213e 100644 --- a/src/runloop_api_client/_response.py +++ b/src/runloop_api_client/_response.py @@ -136,6 +136,8 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: if cast_to and is_annotated_type(cast_to): cast_to = extract_type_arg(cast_to, 0) + origin = get_origin(cast_to) or cast_to + if self._is_sse_stream: if to: if not is_stream_class_type(to): @@ -195,8 +197,6 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: if cast_to == bool: return cast(R, response.text.lower() == "true") - origin = get_origin(cast_to) or cast_to - if origin == APIResponse: raise RuntimeError("Unexpected state - cast_to is `APIResponse`") From fc8819ea5863423c2fd0fe63fc341050af9564a1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 02:25:24 +0000 Subject: [PATCH 641/993] feat(api): api update (#510) --- .stats.yml | 4 +- api.md | 32 + .../resources/benchmarks/benchmarks.py | 10 + .../resources/benchmarks/runs.py | 8 + .../resources/devboxes/__init__.py | 28 + .../resources/devboxes/browsers.py | 155 +++++ .../resources/devboxes/computers.py | 559 ++++++++++++++++++ .../resources/devboxes/devboxes.py | 64 ++ .../resources/scenarios/runs.py | 8 + .../types/benchmark_list_params.py | 6 + .../types/benchmark_run_view.py | 6 + .../types/benchmarks/run_list_params.py | 3 + src/runloop_api_client/types/devbox_view.py | 9 +- .../types/devboxes/__init__.py | 11 + .../types/devboxes/browser_view.py | 24 + .../types/devboxes/computer_create_params.py | 21 + .../computer_keyboard_interaction_params.py | 16 + .../computer_keyboard_interaction_response.py | 15 + .../computer_mouse_interaction_params.py | 30 + .../computer_mouse_interaction_response.py | 15 + .../computer_screen_interaction_params.py | 12 + .../computer_screen_interaction_response.py | 15 + .../types/devboxes/computer_view.py | 15 + .../types/scenario_run_view.py | 5 +- .../types/scenarios/run_list_params.py | 3 + tests/api_resources/benchmarks/test_runs.py | 2 + tests/api_resources/devboxes/test_browsers.py | 72 +++ .../api_resources/devboxes/test_computers.py | 391 ++++++++++++ tests/api_resources/scenarios/test_runs.py | 2 + tests/api_resources/test_benchmarks.py | 2 + 30 files changed, 1539 insertions(+), 4 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/browsers.py create mode 100644 src/runloop_api_client/resources/devboxes/computers.py create mode 100644 src/runloop_api_client/types/devboxes/browser_view.py create mode 100644 src/runloop_api_client/types/devboxes/computer_create_params.py create mode 100644 src/runloop_api_client/types/devboxes/computer_keyboard_interaction_params.py create mode 100644 src/runloop_api_client/types/devboxes/computer_keyboard_interaction_response.py create mode 100644 src/runloop_api_client/types/devboxes/computer_mouse_interaction_params.py create mode 100644 src/runloop_api_client/types/devboxes/computer_mouse_interaction_response.py create mode 100644 src/runloop_api_client/types/devboxes/computer_screen_interaction_params.py create mode 100644 src/runloop_api_client/types/devboxes/computer_screen_interaction_response.py create mode 100644 src/runloop_api_client/types/devboxes/computer_view.py create mode 100644 tests/api_resources/devboxes/test_browsers.py create mode 100644 tests/api_resources/devboxes/test_computers.py diff --git a/.stats.yml b/.stats.yml index 45bcc8138..c981a627f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 61 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2d76871c6215358c176295dc168fa7f571f81df1f8df37ecbd1e4e06e7220d67.yml +configured_endpoints: 66 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-5d84d2732400f196ddbe4b4e7c0e98b3f02bab9ce2ed750e69d399d898e496d1.yml diff --git a/api.md b/api.md index 46135d100..8967b08eb 100644 --- a/api.md +++ b/api.md @@ -100,6 +100,38 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file_contents(id, \*\*params) -> DevboxExecutionDetailView +## Browsers + +Types: + +```python +from runloop_api_client.types.devboxes import BrowserView +``` + +Methods: + +- client.devboxes.browsers.create() -> BrowserView + +## Computers + +Types: + +```python +from runloop_api_client.types.devboxes import ( + ComputerView, + ComputerKeyboardInteractionResponse, + ComputerMouseInteractionResponse, + ComputerScreenInteractionResponse, +) +``` + +Methods: + +- client.devboxes.computers.create(\*\*params) -> ComputerView +- client.devboxes.computers.keyboard_interaction(id, \*\*params) -> ComputerKeyboardInteractionResponse +- client.devboxes.computers.mouse_interaction(id, \*\*params) -> ComputerMouseInteractionResponse +- client.devboxes.computers.screen_interaction(id, \*\*params) -> ComputerScreenInteractionResponse + ## Lsp Types: diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py index 9b016c684..650494753 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -147,6 +147,7 @@ def list( self, *, limit: int | NotGiven = NOT_GIVEN, + public: bool | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -161,6 +162,9 @@ def list( Args: limit: The limit of items to return. Default is 20. + public: List public benchmarks, e.g. SWE-bench. Defaults to false, i.e. only + user-defined benchmarks are listed. + starting_after: Load the next page of data starting after the item with the given ID. extra_headers: Send extra headers @@ -181,6 +185,7 @@ def list( query=maybe_transform( { "limit": limit, + "public": public, "starting_after": starting_after, }, benchmark_list_params.BenchmarkListParams, @@ -351,6 +356,7 @@ async def list( self, *, limit: int | NotGiven = NOT_GIVEN, + public: bool | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -365,6 +371,9 @@ async def list( Args: limit: The limit of items to return. Default is 20. + public: List public benchmarks, e.g. SWE-bench. Defaults to false, i.e. only + user-defined benchmarks are listed. + starting_after: Load the next page of data starting after the item with the given ID. extra_headers: Send extra headers @@ -385,6 +394,7 @@ async def list( query=await async_maybe_transform( { "limit": limit, + "public": public, "starting_after": starting_after, }, benchmark_list_params.BenchmarkListParams, diff --git a/src/runloop_api_client/resources/benchmarks/runs.py b/src/runloop_api_client/resources/benchmarks/runs.py index 3a5527345..3866eb99a 100644 --- a/src/runloop_api_client/resources/benchmarks/runs.py +++ b/src/runloop_api_client/resources/benchmarks/runs.py @@ -81,6 +81,7 @@ def retrieve( def list( self, *, + benchmark_id: str | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -94,6 +95,8 @@ def list( List all BenchmarkRuns matching filter. Args: + benchmark_id: The Benchmark ID to filter by. + limit: The limit of items to return. Default is 20. starting_after: Load the next page of data starting after the item with the given ID. @@ -115,6 +118,7 @@ def list( timeout=timeout, query=maybe_transform( { + "benchmark_id": benchmark_id, "limit": limit, "starting_after": starting_after, }, @@ -221,6 +225,7 @@ async def retrieve( async def list( self, *, + benchmark_id: str | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -234,6 +239,8 @@ async def list( List all BenchmarkRuns matching filter. Args: + benchmark_id: The Benchmark ID to filter by. + limit: The limit of items to return. Default is 20. starting_after: Load the next page of data starting after the item with the given ID. @@ -255,6 +262,7 @@ async def list( timeout=timeout, query=await async_maybe_transform( { + "benchmark_id": benchmark_id, "limit": limit, "starting_after": starting_after, }, diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index d5378fb54..1e09245d6 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -16,6 +16,14 @@ LogsResourceWithStreamingResponse, AsyncLogsResourceWithStreamingResponse, ) +from .browsers import ( + BrowsersResource, + AsyncBrowsersResource, + BrowsersResourceWithRawResponse, + AsyncBrowsersResourceWithRawResponse, + BrowsersResourceWithStreamingResponse, + AsyncBrowsersResourceWithStreamingResponse, +) from .devboxes import ( DevboxesResource, AsyncDevboxesResource, @@ -24,6 +32,14 @@ DevboxesResourceWithStreamingResponse, AsyncDevboxesResourceWithStreamingResponse, ) +from .computers import ( + ComputersResource, + AsyncComputersResource, + ComputersResourceWithRawResponse, + AsyncComputersResourceWithRawResponse, + ComputersResourceWithStreamingResponse, + AsyncComputersResourceWithStreamingResponse, +) from .executions import ( ExecutionsResource, AsyncExecutionsResource, @@ -34,6 +50,18 @@ ) __all__ = [ + "BrowsersResource", + "AsyncBrowsersResource", + "BrowsersResourceWithRawResponse", + "AsyncBrowsersResourceWithRawResponse", + "BrowsersResourceWithStreamingResponse", + "AsyncBrowsersResourceWithStreamingResponse", + "ComputersResource", + "AsyncComputersResource", + "ComputersResourceWithRawResponse", + "AsyncComputersResourceWithRawResponse", + "ComputersResourceWithStreamingResponse", + "AsyncComputersResourceWithStreamingResponse", "LspResource", "AsyncLspResource", "LspResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/browsers.py b/src/runloop_api_client/resources/devboxes/browsers.py new file mode 100644 index 000000000..59d264bcc --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/browsers.py @@ -0,0 +1,155 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes.browser_view import BrowserView + +__all__ = ["BrowsersResource", "AsyncBrowsersResource"] + + +class BrowsersResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> BrowsersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return BrowsersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> BrowsersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return BrowsersResourceWithStreamingResponse(self) + + def create( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> BrowserView: + """Create a Devbox that has a managed Browser and begin the boot process. + + As part + of booting the Devbox, the browser will automatically be started with connection + utilities activated. + """ + return self._post( + "/v1/devboxes/browsers", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BrowserView, + ) + + +class AsyncBrowsersResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncBrowsersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncBrowsersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncBrowsersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncBrowsersResourceWithStreamingResponse(self) + + async def create( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> BrowserView: + """Create a Devbox that has a managed Browser and begin the boot process. + + As part + of booting the Devbox, the browser will automatically be started with connection + utilities activated. + """ + return await self._post( + "/v1/devboxes/browsers", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BrowserView, + ) + + +class BrowsersResourceWithRawResponse: + def __init__(self, browsers: BrowsersResource) -> None: + self._browsers = browsers + + self.create = to_raw_response_wrapper( + browsers.create, + ) + + +class AsyncBrowsersResourceWithRawResponse: + def __init__(self, browsers: AsyncBrowsersResource) -> None: + self._browsers = browsers + + self.create = async_to_raw_response_wrapper( + browsers.create, + ) + + +class BrowsersResourceWithStreamingResponse: + def __init__(self, browsers: BrowsersResource) -> None: + self._browsers = browsers + + self.create = to_streamed_response_wrapper( + browsers.create, + ) + + +class AsyncBrowsersResourceWithStreamingResponse: + def __init__(self, browsers: AsyncBrowsersResource) -> None: + self._browsers = browsers + + self.create = async_to_streamed_response_wrapper( + browsers.create, + ) diff --git a/src/runloop_api_client/resources/devboxes/computers.py b/src/runloop_api_client/resources/devboxes/computers.py new file mode 100644 index 000000000..c10791302 --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/computers.py @@ -0,0 +1,559 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._base_client import make_request_options +from ...types.devboxes import ( + computer_create_params, + computer_mouse_interaction_params, + computer_screen_interaction_params, + computer_keyboard_interaction_params, +) +from ...types.devboxes.computer_view import ComputerView +from ...types.devboxes.computer_mouse_interaction_response import ComputerMouseInteractionResponse +from ...types.devboxes.computer_screen_interaction_response import ComputerScreenInteractionResponse +from ...types.devboxes.computer_keyboard_interaction_response import ComputerKeyboardInteractionResponse + +__all__ = ["ComputersResource", "AsyncComputersResource"] + + +class ComputersResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ComputersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return ComputersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ComputersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return ComputersResourceWithStreamingResponse(self) + + def create( + self, + *, + display_dimensions: Optional[computer_create_params.DisplayDimensions] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ComputerView: + """Create a Computer and begin the boot process. + + The Computer will initially launch + in the 'provisioning' state while Runloop allocates the necessary + infrastructure. It will transition to the 'initializing' state while the booted + Computer runs any Runloop or user defined set up scripts. Finally, the Computer + will transition to the 'running' state when it is ready for use. + + Args: + display_dimensions: Customize the dimensions of the computer display. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/v1/devboxes/computers", + body=maybe_transform( + {"display_dimensions": display_dimensions}, computer_create_params.ComputerCreateParams + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ComputerView, + ) + + def keyboard_interaction( + self, + id: str, + *, + action: Literal["key", "type"], + text: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ComputerKeyboardInteractionResponse: + """ + Perform the specified keyboard interaction on the Computer identified by the + given ID. + + Args: + action: The keyboard action to perform. + + text: The text to type or the key (with optional modifier) to press. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/computers/{id}/keyboard_interaction", + body=maybe_transform( + { + "action": action, + "text": text, + }, + computer_keyboard_interaction_params.ComputerKeyboardInteractionParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ComputerKeyboardInteractionResponse, + ) + + def mouse_interaction( + self, + id: str, + *, + action: Literal["mouse_move", "left_click", "left_click_drag", "right_click", "middle_click", "double_click"], + coordinate: Optional[computer_mouse_interaction_params.Coordinate] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ComputerMouseInteractionResponse: + """ + Perform the specified mouse interaction on the Computer identified by the given + ID. + + Args: + action: The mouse action to perform. + + coordinate: The x (pixels from the left) and y (pixels from the top) coordinates for the + mouse to move or click-drag. Required only by `action=mouse_move` or + `action=left_click_drag` + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/computers/{id}/mouse_interaction", + body=maybe_transform( + { + "action": action, + "coordinate": coordinate, + }, + computer_mouse_interaction_params.ComputerMouseInteractionParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ComputerMouseInteractionResponse, + ) + + def screen_interaction( + self, + id: str, + *, + action: Literal["screenshot", "cursor_position"], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ComputerScreenInteractionResponse: + """ + Perform the specified screen interaction on the Computer identified by the given + ID. + + Args: + action: The screen action to perform. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/computers/{id}/screen_interaction", + body=maybe_transform( + {"action": action}, computer_screen_interaction_params.ComputerScreenInteractionParams + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ComputerScreenInteractionResponse, + ) + + +class AsyncComputersResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncComputersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncComputersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncComputersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncComputersResourceWithStreamingResponse(self) + + async def create( + self, + *, + display_dimensions: Optional[computer_create_params.DisplayDimensions] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ComputerView: + """Create a Computer and begin the boot process. + + The Computer will initially launch + in the 'provisioning' state while Runloop allocates the necessary + infrastructure. It will transition to the 'initializing' state while the booted + Computer runs any Runloop or user defined set up scripts. Finally, the Computer + will transition to the 'running' state when it is ready for use. + + Args: + display_dimensions: Customize the dimensions of the computer display. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/v1/devboxes/computers", + body=await async_maybe_transform( + {"display_dimensions": display_dimensions}, computer_create_params.ComputerCreateParams + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ComputerView, + ) + + async def keyboard_interaction( + self, + id: str, + *, + action: Literal["key", "type"], + text: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ComputerKeyboardInteractionResponse: + """ + Perform the specified keyboard interaction on the Computer identified by the + given ID. + + Args: + action: The keyboard action to perform. + + text: The text to type or the key (with optional modifier) to press. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/computers/{id}/keyboard_interaction", + body=await async_maybe_transform( + { + "action": action, + "text": text, + }, + computer_keyboard_interaction_params.ComputerKeyboardInteractionParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ComputerKeyboardInteractionResponse, + ) + + async def mouse_interaction( + self, + id: str, + *, + action: Literal["mouse_move", "left_click", "left_click_drag", "right_click", "middle_click", "double_click"], + coordinate: Optional[computer_mouse_interaction_params.Coordinate] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ComputerMouseInteractionResponse: + """ + Perform the specified mouse interaction on the Computer identified by the given + ID. + + Args: + action: The mouse action to perform. + + coordinate: The x (pixels from the left) and y (pixels from the top) coordinates for the + mouse to move or click-drag. Required only by `action=mouse_move` or + `action=left_click_drag` + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/computers/{id}/mouse_interaction", + body=await async_maybe_transform( + { + "action": action, + "coordinate": coordinate, + }, + computer_mouse_interaction_params.ComputerMouseInteractionParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ComputerMouseInteractionResponse, + ) + + async def screen_interaction( + self, + id: str, + *, + action: Literal["screenshot", "cursor_position"], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ComputerScreenInteractionResponse: + """ + Perform the specified screen interaction on the Computer identified by the given + ID. + + Args: + action: The screen action to perform. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/computers/{id}/screen_interaction", + body=await async_maybe_transform( + {"action": action}, computer_screen_interaction_params.ComputerScreenInteractionParams + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ComputerScreenInteractionResponse, + ) + + +class ComputersResourceWithRawResponse: + def __init__(self, computers: ComputersResource) -> None: + self._computers = computers + + self.create = to_raw_response_wrapper( + computers.create, + ) + self.keyboard_interaction = to_raw_response_wrapper( + computers.keyboard_interaction, + ) + self.mouse_interaction = to_raw_response_wrapper( + computers.mouse_interaction, + ) + self.screen_interaction = to_raw_response_wrapper( + computers.screen_interaction, + ) + + +class AsyncComputersResourceWithRawResponse: + def __init__(self, computers: AsyncComputersResource) -> None: + self._computers = computers + + self.create = async_to_raw_response_wrapper( + computers.create, + ) + self.keyboard_interaction = async_to_raw_response_wrapper( + computers.keyboard_interaction, + ) + self.mouse_interaction = async_to_raw_response_wrapper( + computers.mouse_interaction, + ) + self.screen_interaction = async_to_raw_response_wrapper( + computers.screen_interaction, + ) + + +class ComputersResourceWithStreamingResponse: + def __init__(self, computers: ComputersResource) -> None: + self._computers = computers + + self.create = to_streamed_response_wrapper( + computers.create, + ) + self.keyboard_interaction = to_streamed_response_wrapper( + computers.keyboard_interaction, + ) + self.mouse_interaction = to_streamed_response_wrapper( + computers.mouse_interaction, + ) + self.screen_interaction = to_streamed_response_wrapper( + computers.screen_interaction, + ) + + +class AsyncComputersResourceWithStreamingResponse: + def __init__(self, computers: AsyncComputersResource) -> None: + self._computers = computers + + self.create = async_to_streamed_response_wrapper( + computers.create, + ) + self.keyboard_interaction = async_to_streamed_response_wrapper( + computers.keyboard_interaction, + ) + self.mouse_interaction = async_to_streamed_response_wrapper( + computers.mouse_interaction, + ) + self.screen_interaction = async_to_streamed_response_wrapper( + computers.screen_interaction, + ) diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index cc4ae9c04..f3be79cdf 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -44,7 +44,23 @@ deepcopy_minimal, async_maybe_transform, ) +from .browsers import ( + BrowsersResource, + AsyncBrowsersResource, + BrowsersResourceWithRawResponse, + AsyncBrowsersResourceWithRawResponse, + BrowsersResourceWithStreamingResponse, + AsyncBrowsersResourceWithStreamingResponse, +) from ..._compat import cached_property +from .computers import ( + ComputersResource, + AsyncComputersResource, + ComputersResourceWithRawResponse, + AsyncComputersResourceWithRawResponse, + ComputersResourceWithStreamingResponse, + AsyncComputersResourceWithStreamingResponse, +) from .executions import ( ExecutionsResource, AsyncExecutionsResource, @@ -88,6 +104,14 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def browsers(self) -> BrowsersResource: + return BrowsersResource(self._client) + + @cached_property + def computers(self) -> ComputersResource: + return ComputersResource(self._client) + @cached_property def lsp(self) -> LspResource: return LspResource(self._client) @@ -1085,6 +1109,14 @@ def write_file_contents( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def browsers(self) -> AsyncBrowsersResource: + return AsyncBrowsersResource(self._client) + + @cached_property + def computers(self) -> AsyncComputersResource: + return AsyncComputersResource(self._client) + @cached_property def lsp(self) -> AsyncLspResource: return AsyncLspResource(self._client) @@ -2144,6 +2176,14 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file_contents, ) + @cached_property + def browsers(self) -> BrowsersResourceWithRawResponse: + return BrowsersResourceWithRawResponse(self._devboxes.browsers) + + @cached_property + def computers(self) -> ComputersResourceWithRawResponse: + return ComputersResourceWithRawResponse(self._devboxes.computers) + @cached_property def lsp(self) -> LspResourceWithRawResponse: return LspResourceWithRawResponse(self._devboxes.lsp) @@ -2220,6 +2260,14 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file_contents, ) + @cached_property + def browsers(self) -> AsyncBrowsersResourceWithRawResponse: + return AsyncBrowsersResourceWithRawResponse(self._devboxes.browsers) + + @cached_property + def computers(self) -> AsyncComputersResourceWithRawResponse: + return AsyncComputersResourceWithRawResponse(self._devboxes.computers) + @cached_property def lsp(self) -> AsyncLspResourceWithRawResponse: return AsyncLspResourceWithRawResponse(self._devboxes.lsp) @@ -2296,6 +2344,14 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file_contents, ) + @cached_property + def browsers(self) -> BrowsersResourceWithStreamingResponse: + return BrowsersResourceWithStreamingResponse(self._devboxes.browsers) + + @cached_property + def computers(self) -> ComputersResourceWithStreamingResponse: + return ComputersResourceWithStreamingResponse(self._devboxes.computers) + @cached_property def lsp(self) -> LspResourceWithStreamingResponse: return LspResourceWithStreamingResponse(self._devboxes.lsp) @@ -2372,6 +2428,14 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file_contents, ) + @cached_property + def browsers(self) -> AsyncBrowsersResourceWithStreamingResponse: + return AsyncBrowsersResourceWithStreamingResponse(self._devboxes.browsers) + + @cached_property + def computers(self) -> AsyncComputersResourceWithStreamingResponse: + return AsyncComputersResourceWithStreamingResponse(self._devboxes.computers) + @cached_property def lsp(self) -> AsyncLspResourceWithStreamingResponse: return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) diff --git a/src/runloop_api_client/resources/scenarios/runs.py b/src/runloop_api_client/resources/scenarios/runs.py index cec293027..2226123ae 100644 --- a/src/runloop_api_client/resources/scenarios/runs.py +++ b/src/runloop_api_client/resources/scenarios/runs.py @@ -82,6 +82,7 @@ def list( self, *, limit: int | NotGiven = NOT_GIVEN, + scenario_id: bool | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -96,6 +97,8 @@ def list( Args: limit: The limit of items to return. Default is 20. + scenario_id: Filter runs associated to Scenario given ID + starting_after: Load the next page of data starting after the item with the given ID. extra_headers: Send extra headers @@ -116,6 +119,7 @@ def list( query=maybe_transform( { "limit": limit, + "scenario_id": scenario_id, "starting_after": starting_after, }, run_list_params.RunListParams, @@ -262,6 +266,7 @@ async def list( self, *, limit: int | NotGiven = NOT_GIVEN, + scenario_id: bool | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -276,6 +281,8 @@ async def list( Args: limit: The limit of items to return. Default is 20. + scenario_id: Filter runs associated to Scenario given ID + starting_after: Load the next page of data starting after the item with the given ID. extra_headers: Send extra headers @@ -296,6 +303,7 @@ async def list( query=await async_maybe_transform( { "limit": limit, + "scenario_id": scenario_id, "starting_after": starting_after, }, run_list_params.RunListParams, diff --git a/src/runloop_api_client/types/benchmark_list_params.py b/src/runloop_api_client/types/benchmark_list_params.py index 51b2b1320..3eef4e030 100644 --- a/src/runloop_api_client/types/benchmark_list_params.py +++ b/src/runloop_api_client/types/benchmark_list_params.py @@ -11,5 +11,11 @@ class BenchmarkListParams(TypedDict, total=False): limit: int """The limit of items to return. Default is 20.""" + public: bool + """List public benchmarks, e.g. + + SWE-bench. Defaults to false, i.e. only user-defined benchmarks are listed. + """ + starting_after: str """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/benchmark_run_view.py b/src/runloop_api_client/types/benchmark_run_view.py index 08507340e..bce32b0ce 100644 --- a/src/runloop_api_client/types/benchmark_run_view.py +++ b/src/runloop_api_client/types/benchmark_run_view.py @@ -20,3 +20,9 @@ class BenchmarkRunView(BaseModel): name: Optional[str] = None """The name of the BenchmarkRun.""" + + score: Optional[float] = None + """The final score across the BenchmarkRun, present once completed. + + Calculated as sum of scenario scores / number of scenario runs. + """ diff --git a/src/runloop_api_client/types/benchmarks/run_list_params.py b/src/runloop_api_client/types/benchmarks/run_list_params.py index a8be85a7f..f93695b2a 100644 --- a/src/runloop_api_client/types/benchmarks/run_list_params.py +++ b/src/runloop_api_client/types/benchmarks/run_list_params.py @@ -8,6 +8,9 @@ class RunListParams(TypedDict, total=False): + benchmark_id: str + """The Benchmark ID to filter by.""" + limit: int """The limit of items to return. Default is 20.""" diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 838a5ea75..f645afde6 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Optional +from typing import Dict, List, Optional from typing_extensions import Literal from .._models import BaseModel @@ -13,6 +13,13 @@ class DevboxView(BaseModel): id: str """The ID of the Devbox.""" + capabilities: List[Literal["unknown", "computer_usage", "browser_usage"]] + """A list of capability groups this devbox has access to. + + This allows devboxes to be compatible with certain tools sets like computer + usage APIs. + """ + create_time_ms: int """Creation time of the Devbox (Unix timestamp milliseconds).""" diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 30d13b0fb..92ea981de 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -16,8 +16,10 @@ from .symbol_kind import SymbolKind as SymbolKind from .symbol_type import SymbolType as SymbolType from .base_command import BaseCommand as BaseCommand +from .browser_view import BrowserView as BrowserView from .document_uri import DocumentUri as DocumentUri from .base_location import BaseLocation as BaseLocation +from .computer_view import ComputerView as ComputerView from .base_signature import BaseSignature as BaseSignature from .diagnostic_tag import DiagnosticTag as DiagnosticTag from .l_sp_any_param import LSpAnyParam as LSpAnyParam @@ -44,6 +46,7 @@ from .lsp_references_params import LspReferencesParams as LspReferencesParams from .watched_file_response import WatchedFileResponse as WatchedFileResponse from .code_description_param import CodeDescriptionParam as CodeDescriptionParam +from .computer_create_params import ComputerCreateParams as ComputerCreateParams from .file_contents_response import FileContentsResponse as FileContentsResponse from .health_status_response import HealthStatusResponse as HealthStatusResponse from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams @@ -66,8 +69,16 @@ from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse +from .computer_mouse_interaction_params import ComputerMouseInteractionParams as ComputerMouseInteractionParams +from .computer_screen_interaction_params import ComputerScreenInteractionParams as ComputerScreenInteractionParams +from .computer_mouse_interaction_response import ComputerMouseInteractionResponse as ComputerMouseInteractionResponse from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam +from .computer_keyboard_interaction_params import ComputerKeyboardInteractionParams as ComputerKeyboardInteractionParams +from .computer_screen_interaction_response import ComputerScreenInteractionResponse as ComputerScreenInteractionResponse from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam +from .computer_keyboard_interaction_response import ( + ComputerKeyboardInteractionResponse as ComputerKeyboardInteractionResponse, +) from .lsp_get_code_actions_for_diagnostic_params import ( LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, ) diff --git a/src/runloop_api_client/types/devboxes/browser_view.py b/src/runloop_api_client/types/devboxes/browser_view.py new file mode 100644 index 000000000..ef9303f0f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/browser_view.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from ..devbox_view import DevboxView + +__all__ = ["BrowserView"] + + +class BrowserView(BaseModel): + connection_url: str + """ + The url to enable remote connection from browser automation tools like + playwright. + """ + + devbox: DevboxView + """The underlying devbox the browser setup is running on.""" + + live_view_url: str + """ + The url to view the browser window and enable user interactions via their own + browser. + """ diff --git a/src/runloop_api_client/types/devboxes/computer_create_params.py b/src/runloop_api_client/types/devboxes/computer_create_params.py new file mode 100644 index 000000000..15c00cff0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/computer_create_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +__all__ = ["ComputerCreateParams", "DisplayDimensions"] + + +class ComputerCreateParams(TypedDict, total=False): + display_dimensions: Optional[DisplayDimensions] + """Customize the dimensions of the computer display.""" + + +class DisplayDimensions(TypedDict, total=False): + display_height_px: Required[int] + """The height of the display being controlled by the model in pixels.""" + + display_width_px: Required[int] + """The width of the display being controlled by the model in pixels.""" diff --git a/src/runloop_api_client/types/devboxes/computer_keyboard_interaction_params.py b/src/runloop_api_client/types/devboxes/computer_keyboard_interaction_params.py new file mode 100644 index 000000000..c7c2a8f36 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/computer_keyboard_interaction_params.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ComputerKeyboardInteractionParams"] + + +class ComputerKeyboardInteractionParams(TypedDict, total=False): + action: Required[Literal["key", "type"]] + """The keyboard action to perform.""" + + text: Optional[str] + """The text to type or the key (with optional modifier) to press.""" diff --git a/src/runloop_api_client/types/devboxes/computer_keyboard_interaction_response.py b/src/runloop_api_client/types/devboxes/computer_keyboard_interaction_response.py new file mode 100644 index 000000000..6990bc74a --- /dev/null +++ b/src/runloop_api_client/types/devboxes/computer_keyboard_interaction_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["ComputerKeyboardInteractionResponse"] + + +class ComputerKeyboardInteractionResponse(BaseModel): + error: Optional[str] = None + + latest_screenshot_base64_img: Optional[str] = None + + output: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/computer_mouse_interaction_params.py b/src/runloop_api_client/types/devboxes/computer_mouse_interaction_params.py new file mode 100644 index 000000000..b28a0723f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/computer_mouse_interaction_params.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ComputerMouseInteractionParams", "Coordinate"] + + +class ComputerMouseInteractionParams(TypedDict, total=False): + action: Required[ + Literal["mouse_move", "left_click", "left_click_drag", "right_click", "middle_click", "double_click"] + ] + """The mouse action to perform.""" + + coordinate: Optional[Coordinate] + """ + The x (pixels from the left) and y (pixels from the top) coordinates for the + mouse to move or click-drag. Required only by `action=mouse_move` or + `action=left_click_drag` + """ + + +class Coordinate(TypedDict, total=False): + x: Required[int] + """The x coordinate (pixels from the left) for the mouse to move or click-drag.""" + + y: Required[int] + """The y coordinate (pixels from the top) for the mouse to move or click-drag.""" diff --git a/src/runloop_api_client/types/devboxes/computer_mouse_interaction_response.py b/src/runloop_api_client/types/devboxes/computer_mouse_interaction_response.py new file mode 100644 index 000000000..cbaab9dca --- /dev/null +++ b/src/runloop_api_client/types/devboxes/computer_mouse_interaction_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["ComputerMouseInteractionResponse"] + + +class ComputerMouseInteractionResponse(BaseModel): + error: Optional[str] = None + + latest_screenshot_base64_img: Optional[str] = None + + output: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/computer_screen_interaction_params.py b/src/runloop_api_client/types/devboxes/computer_screen_interaction_params.py new file mode 100644 index 000000000..8423249b9 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/computer_screen_interaction_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ComputerScreenInteractionParams"] + + +class ComputerScreenInteractionParams(TypedDict, total=False): + action: Required[Literal["screenshot", "cursor_position"]] + """The screen action to perform.""" diff --git a/src/runloop_api_client/types/devboxes/computer_screen_interaction_response.py b/src/runloop_api_client/types/devboxes/computer_screen_interaction_response.py new file mode 100644 index 000000000..3ad4cb5cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/computer_screen_interaction_response.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["ComputerScreenInteractionResponse"] + + +class ComputerScreenInteractionResponse(BaseModel): + error: Optional[str] = None + + latest_screenshot_base64_img: Optional[str] = None + + output: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/computer_view.py b/src/runloop_api_client/types/devboxes/computer_view.py new file mode 100644 index 000000000..858aa27a2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/computer_view.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel +from ..devbox_view import DevboxView + +__all__ = ["ComputerView"] + + +class ComputerView(BaseModel): + devbox: DevboxView + """The underlying devbox the computer setup is running on.""" + + live_screen_url: str + """The http tunnel to connect and view the live screen of the computer.""" diff --git a/src/runloop_api_client/types/scenario_run_view.py b/src/runloop_api_client/types/scenario_run_view.py index 33c18100f..33da17227 100644 --- a/src/runloop_api_client/types/scenario_run_view.py +++ b/src/runloop_api_client/types/scenario_run_view.py @@ -19,7 +19,7 @@ class ScenarioRunView(BaseModel): scenario_id: str """ID of the Scenario that has been run.""" - state: Literal["running", "scoring", "completed", "canceled", "timeout", "failed"] + state: Literal["running", "scoring", "scored", "completed", "canceled", "timeout", "failed"] """The state of the ScenarioRun.""" benchmark_run_id: Optional[str] = None @@ -28,5 +28,8 @@ class ScenarioRunView(BaseModel): duration_ms: Optional[int] = None """Duration scenario took to run.""" + name: Optional[str] = None + """Optional name of ScenarioRun.""" + scoring_contract_result: Optional[ScoringContractResultView] = None """The input context for the Scenario.""" diff --git a/src/runloop_api_client/types/scenarios/run_list_params.py b/src/runloop_api_client/types/scenarios/run_list_params.py index a8be85a7f..86a3b1efd 100644 --- a/src/runloop_api_client/types/scenarios/run_list_params.py +++ b/src/runloop_api_client/types/scenarios/run_list_params.py @@ -11,5 +11,8 @@ class RunListParams(TypedDict, total=False): limit: int """The limit of items to return. Default is 20.""" + scenario_id: bool + """Filter runs associated to Scenario given ID""" + starting_after: str """Load the next page of data starting after the item with the given ID.""" diff --git a/tests/api_resources/benchmarks/test_runs.py b/tests/api_resources/benchmarks/test_runs.py index 6f7ac0b8d..31ca76fed 100644 --- a/tests/api_resources/benchmarks/test_runs.py +++ b/tests/api_resources/benchmarks/test_runs.py @@ -63,6 +63,7 @@ def test_method_list(self, client: Runloop) -> None: @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: run = client.benchmarks.runs.list( + benchmark_id="benchmark_id", limit=0, starting_after="starting_after", ) @@ -176,6 +177,7 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: run = await async_client.benchmarks.runs.list( + benchmark_id="benchmark_id", limit=0, starting_after="starting_after", ) diff --git a/tests/api_resources/devboxes/test_browsers.py b/tests/api_resources/devboxes/test_browsers.py new file mode 100644 index 000000000..9b1a51a2b --- /dev/null +++ b/tests/api_resources/devboxes/test_browsers.py @@ -0,0 +1,72 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import BrowserView + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestBrowsers: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Runloop) -> None: + browser = client.devboxes.browsers.create() + assert_matches_type(BrowserView, browser, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Runloop) -> None: + response = client.devboxes.browsers.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + browser = response.parse() + assert_matches_type(BrowserView, browser, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Runloop) -> None: + with client.devboxes.browsers.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + browser = response.parse() + assert_matches_type(BrowserView, browser, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncBrowsers: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncRunloop) -> None: + browser = await async_client.devboxes.browsers.create() + assert_matches_type(BrowserView, browser, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.browsers.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + browser = await response.parse() + assert_matches_type(BrowserView, browser, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.browsers.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + browser = await response.parse() + assert_matches_type(BrowserView, browser, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/devboxes/test_computers.py b/tests/api_resources/devboxes/test_computers.py new file mode 100644 index 000000000..09b08358a --- /dev/null +++ b/tests/api_resources/devboxes/test_computers.py @@ -0,0 +1,391 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types.devboxes import ( + ComputerView, + ComputerMouseInteractionResponse, + ComputerScreenInteractionResponse, + ComputerKeyboardInteractionResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestComputers: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Runloop) -> None: + computer = client.devboxes.computers.create() + assert_matches_type(ComputerView, computer, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Runloop) -> None: + computer = client.devboxes.computers.create( + display_dimensions={ + "display_height_px": 0, + "display_width_px": 0, + }, + ) + assert_matches_type(ComputerView, computer, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Runloop) -> None: + response = client.devboxes.computers.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + computer = response.parse() + assert_matches_type(ComputerView, computer, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Runloop) -> None: + with client.devboxes.computers.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + computer = response.parse() + assert_matches_type(ComputerView, computer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_keyboard_interaction(self, client: Runloop) -> None: + computer = client.devboxes.computers.keyboard_interaction( + id="id", + action="key", + ) + assert_matches_type(ComputerKeyboardInteractionResponse, computer, path=["response"]) + + @parametrize + def test_method_keyboard_interaction_with_all_params(self, client: Runloop) -> None: + computer = client.devboxes.computers.keyboard_interaction( + id="id", + action="key", + text="text", + ) + assert_matches_type(ComputerKeyboardInteractionResponse, computer, path=["response"]) + + @parametrize + def test_raw_response_keyboard_interaction(self, client: Runloop) -> None: + response = client.devboxes.computers.with_raw_response.keyboard_interaction( + id="id", + action="key", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + computer = response.parse() + assert_matches_type(ComputerKeyboardInteractionResponse, computer, path=["response"]) + + @parametrize + def test_streaming_response_keyboard_interaction(self, client: Runloop) -> None: + with client.devboxes.computers.with_streaming_response.keyboard_interaction( + id="id", + action="key", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + computer = response.parse() + assert_matches_type(ComputerKeyboardInteractionResponse, computer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_keyboard_interaction(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.computers.with_raw_response.keyboard_interaction( + id="", + action="key", + ) + + @parametrize + def test_method_mouse_interaction(self, client: Runloop) -> None: + computer = client.devboxes.computers.mouse_interaction( + id="id", + action="mouse_move", + ) + assert_matches_type(ComputerMouseInteractionResponse, computer, path=["response"]) + + @parametrize + def test_method_mouse_interaction_with_all_params(self, client: Runloop) -> None: + computer = client.devboxes.computers.mouse_interaction( + id="id", + action="mouse_move", + coordinate={ + "x": 0, + "y": 0, + }, + ) + assert_matches_type(ComputerMouseInteractionResponse, computer, path=["response"]) + + @parametrize + def test_raw_response_mouse_interaction(self, client: Runloop) -> None: + response = client.devboxes.computers.with_raw_response.mouse_interaction( + id="id", + action="mouse_move", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + computer = response.parse() + assert_matches_type(ComputerMouseInteractionResponse, computer, path=["response"]) + + @parametrize + def test_streaming_response_mouse_interaction(self, client: Runloop) -> None: + with client.devboxes.computers.with_streaming_response.mouse_interaction( + id="id", + action="mouse_move", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + computer = response.parse() + assert_matches_type(ComputerMouseInteractionResponse, computer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_mouse_interaction(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.computers.with_raw_response.mouse_interaction( + id="", + action="mouse_move", + ) + + @parametrize + def test_method_screen_interaction(self, client: Runloop) -> None: + computer = client.devboxes.computers.screen_interaction( + id="id", + action="screenshot", + ) + assert_matches_type(ComputerScreenInteractionResponse, computer, path=["response"]) + + @parametrize + def test_raw_response_screen_interaction(self, client: Runloop) -> None: + response = client.devboxes.computers.with_raw_response.screen_interaction( + id="id", + action="screenshot", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + computer = response.parse() + assert_matches_type(ComputerScreenInteractionResponse, computer, path=["response"]) + + @parametrize + def test_streaming_response_screen_interaction(self, client: Runloop) -> None: + with client.devboxes.computers.with_streaming_response.screen_interaction( + id="id", + action="screenshot", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + computer = response.parse() + assert_matches_type(ComputerScreenInteractionResponse, computer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_screen_interaction(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.computers.with_raw_response.screen_interaction( + id="", + action="screenshot", + ) + + +class TestAsyncComputers: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncRunloop) -> None: + computer = await async_client.devboxes.computers.create() + assert_matches_type(ComputerView, computer, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: + computer = await async_client.devboxes.computers.create( + display_dimensions={ + "display_height_px": 0, + "display_width_px": 0, + }, + ) + assert_matches_type(ComputerView, computer, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.computers.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + computer = await response.parse() + assert_matches_type(ComputerView, computer, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.computers.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + computer = await response.parse() + assert_matches_type(ComputerView, computer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_keyboard_interaction(self, async_client: AsyncRunloop) -> None: + computer = await async_client.devboxes.computers.keyboard_interaction( + id="id", + action="key", + ) + assert_matches_type(ComputerKeyboardInteractionResponse, computer, path=["response"]) + + @parametrize + async def test_method_keyboard_interaction_with_all_params(self, async_client: AsyncRunloop) -> None: + computer = await async_client.devboxes.computers.keyboard_interaction( + id="id", + action="key", + text="text", + ) + assert_matches_type(ComputerKeyboardInteractionResponse, computer, path=["response"]) + + @parametrize + async def test_raw_response_keyboard_interaction(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.computers.with_raw_response.keyboard_interaction( + id="id", + action="key", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + computer = await response.parse() + assert_matches_type(ComputerKeyboardInteractionResponse, computer, path=["response"]) + + @parametrize + async def test_streaming_response_keyboard_interaction(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.computers.with_streaming_response.keyboard_interaction( + id="id", + action="key", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + computer = await response.parse() + assert_matches_type(ComputerKeyboardInteractionResponse, computer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_keyboard_interaction(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.computers.with_raw_response.keyboard_interaction( + id="", + action="key", + ) + + @parametrize + async def test_method_mouse_interaction(self, async_client: AsyncRunloop) -> None: + computer = await async_client.devboxes.computers.mouse_interaction( + id="id", + action="mouse_move", + ) + assert_matches_type(ComputerMouseInteractionResponse, computer, path=["response"]) + + @parametrize + async def test_method_mouse_interaction_with_all_params(self, async_client: AsyncRunloop) -> None: + computer = await async_client.devboxes.computers.mouse_interaction( + id="id", + action="mouse_move", + coordinate={ + "x": 0, + "y": 0, + }, + ) + assert_matches_type(ComputerMouseInteractionResponse, computer, path=["response"]) + + @parametrize + async def test_raw_response_mouse_interaction(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.computers.with_raw_response.mouse_interaction( + id="id", + action="mouse_move", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + computer = await response.parse() + assert_matches_type(ComputerMouseInteractionResponse, computer, path=["response"]) + + @parametrize + async def test_streaming_response_mouse_interaction(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.computers.with_streaming_response.mouse_interaction( + id="id", + action="mouse_move", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + computer = await response.parse() + assert_matches_type(ComputerMouseInteractionResponse, computer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_mouse_interaction(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.computers.with_raw_response.mouse_interaction( + id="", + action="mouse_move", + ) + + @parametrize + async def test_method_screen_interaction(self, async_client: AsyncRunloop) -> None: + computer = await async_client.devboxes.computers.screen_interaction( + id="id", + action="screenshot", + ) + assert_matches_type(ComputerScreenInteractionResponse, computer, path=["response"]) + + @parametrize + async def test_raw_response_screen_interaction(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.computers.with_raw_response.screen_interaction( + id="id", + action="screenshot", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + computer = await response.parse() + assert_matches_type(ComputerScreenInteractionResponse, computer, path=["response"]) + + @parametrize + async def test_streaming_response_screen_interaction(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.computers.with_streaming_response.screen_interaction( + id="id", + action="screenshot", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + computer = await response.parse() + assert_matches_type(ComputerScreenInteractionResponse, computer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_screen_interaction(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.computers.with_raw_response.screen_interaction( + id="", + action="screenshot", + ) diff --git a/tests/api_resources/scenarios/test_runs.py b/tests/api_resources/scenarios/test_runs.py index 0fa9873eb..8a83be2ce 100644 --- a/tests/api_resources/scenarios/test_runs.py +++ b/tests/api_resources/scenarios/test_runs.py @@ -64,6 +64,7 @@ def test_method_list(self, client: Runloop) -> None: def test_method_list_with_all_params(self, client: Runloop) -> None: run = client.scenarios.runs.list( limit=0, + scenario_id=True, starting_after="starting_after", ) assert_matches_type(ScenarioRunListView, run, path=["response"]) @@ -215,6 +216,7 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: run = await async_client.scenarios.runs.list( limit=0, + scenario_id=True, starting_after="starting_after", ) assert_matches_type(ScenarioRunListView, run, path=["response"]) diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py index 0e1735e07..b3ac18fc7 100644 --- a/tests/api_resources/test_benchmarks.py +++ b/tests/api_resources/test_benchmarks.py @@ -107,6 +107,7 @@ def test_method_list(self, client: Runloop) -> None: def test_method_list_with_all_params(self, client: Runloop) -> None: benchmark = client.benchmarks.list( limit=0, + public=True, starting_after="starting_after", ) assert_matches_type(BenchmarkListView, benchmark, path=["response"]) @@ -260,6 +261,7 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.list( limit=0, + public=True, starting_after="starting_after", ) assert_matches_type(BenchmarkListView, benchmark, path=["response"]) From 52fe03160b48c5f18f0438b86e5830f030e236eb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 02:30:08 +0000 Subject: [PATCH 642/993] chore(internal): version bump (#511) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8f3e0a494..b4e9013ba 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.15.0" + ".": "0.16.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 8d099a5c0..f02034ee6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.15.0" +version = "0.16.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index c75e8e65d..e302279f7 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.15.0" # x-release-please-version +__version__ = "0.16.0" # x-release-please-version From a6f55e258898781b60f71a4d850c0321314fd43d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 23:35:58 +0000 Subject: [PATCH 643/993] feat(api): api update (#512) --- .stats.yml | 2 +- .../resources/repositories.py | 30 +++++++++++++++++-- .../resources/scenarios/runs.py | 4 +-- .../types/benchmark_run_view.py | 6 ++++ .../types/repository_create_params.py | 4 +++ .../types/repository_list_params.py | 6 ++++ .../types/scenario_run_view.py | 3 ++ .../types/scenarios/run_list_params.py | 2 +- tests/api_resources/scenarios/test_runs.py | 4 +-- tests/api_resources/test_repositories.py | 22 ++++++++++++++ 10 files changed, 75 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index c981a627f..c25634d0b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 66 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-5d84d2732400f196ddbe4b4e7c0e98b3f02bab9ce2ed750e69d399d898e496d1.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bf4f1f241c2a3a425dc7d12b7b7e415133bb696682d1a285836d1a36b7bd6160.yml diff --git a/src/runloop_api_client/resources/repositories.py b/src/runloop_api_client/resources/repositories.py index 115ed94a4..5ebca0116 100644 --- a/src/runloop_api_client/resources/repositories.py +++ b/src/runloop_api_client/resources/repositories.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing import Optional + import httpx from ..types import repository_list_params, repository_create_params @@ -51,6 +53,7 @@ def create( *, name: str, owner: str, + blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -68,6 +71,8 @@ def create( owner: Account owner of the repository. + blueprint_id: ID of blueprint to use as base for resulting RepositoryVersion blueprint. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -84,6 +89,7 @@ def create( { "name": name, "owner": owner, + "blueprint_id": blueprint_id, }, repository_create_params.RepositoryCreateParams, ), @@ -110,7 +116,7 @@ def retrieve( ) -> RepositoryConnectionView: """ Get Repository Connection details including latest inspection status and - generated respository insights. + generated repository insights. Args: extra_headers: Send extra headers @@ -135,6 +141,8 @@ def list( self, *, limit: int | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + owner: str | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -149,6 +157,10 @@ def list( Args: limit: The limit of items to return. Default is 20. + name: Filter by repository name + + owner: Filter by repository owner + starting_after: Load the next page of data starting after the item with the given ID. extra_headers: Send extra headers @@ -170,6 +182,8 @@ def list( query=maybe_transform( { "limit": limit, + "name": name, + "owner": owner, "starting_after": starting_after, }, repository_list_params.RepositoryListParams, @@ -279,6 +293,7 @@ async def create( *, name: str, owner: str, + blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -296,6 +311,8 @@ async def create( owner: Account owner of the repository. + blueprint_id: ID of blueprint to use as base for resulting RepositoryVersion blueprint. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -312,6 +329,7 @@ async def create( { "name": name, "owner": owner, + "blueprint_id": blueprint_id, }, repository_create_params.RepositoryCreateParams, ), @@ -338,7 +356,7 @@ async def retrieve( ) -> RepositoryConnectionView: """ Get Repository Connection details including latest inspection status and - generated respository insights. + generated repository insights. Args: extra_headers: Send extra headers @@ -363,6 +381,8 @@ def list( self, *, limit: int | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + owner: str | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -377,6 +397,10 @@ def list( Args: limit: The limit of items to return. Default is 20. + name: Filter by repository name + + owner: Filter by repository owner + starting_after: Load the next page of data starting after the item with the given ID. extra_headers: Send extra headers @@ -398,6 +422,8 @@ def list( query=maybe_transform( { "limit": limit, + "name": name, + "owner": owner, "starting_after": starting_after, }, repository_list_params.RepositoryListParams, diff --git a/src/runloop_api_client/resources/scenarios/runs.py b/src/runloop_api_client/resources/scenarios/runs.py index 2226123ae..53549a00a 100644 --- a/src/runloop_api_client/resources/scenarios/runs.py +++ b/src/runloop_api_client/resources/scenarios/runs.py @@ -82,7 +82,7 @@ def list( self, *, limit: int | NotGiven = NOT_GIVEN, - scenario_id: bool | NotGiven = NOT_GIVEN, + scenario_id: str | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -266,7 +266,7 @@ async def list( self, *, limit: int | NotGiven = NOT_GIVEN, - scenario_id: bool | NotGiven = NOT_GIVEN, + scenario_id: str | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/runloop_api_client/types/benchmark_run_view.py b/src/runloop_api_client/types/benchmark_run_view.py index bce32b0ce..cf46d855c 100644 --- a/src/runloop_api_client/types/benchmark_run_view.py +++ b/src/runloop_api_client/types/benchmark_run_view.py @@ -15,9 +15,15 @@ class BenchmarkRunView(BaseModel): benchmark_id: str """The ID of the Benchmark.""" + start_time_ms: int + """The time the benchmark run execution started (Unix timestamp milliseconds).""" + state: Literal["running", "completed"] """The state of the BenchmarkRun.""" + duration_ms: Optional[int] = None + """The duration for the BenchmarkRun to complete.""" + name: Optional[str] = None """The name of the BenchmarkRun.""" diff --git a/src/runloop_api_client/types/repository_create_params.py b/src/runloop_api_client/types/repository_create_params.py index 06864a447..78e31175e 100644 --- a/src/runloop_api_client/types/repository_create_params.py +++ b/src/runloop_api_client/types/repository_create_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, TypedDict __all__ = ["RepositoryCreateParams"] @@ -13,3 +14,6 @@ class RepositoryCreateParams(TypedDict, total=False): owner: Required[str] """Account owner of the repository.""" + + blueprint_id: Optional[str] + """ID of blueprint to use as base for resulting RepositoryVersion blueprint.""" diff --git a/src/runloop_api_client/types/repository_list_params.py b/src/runloop_api_client/types/repository_list_params.py index 363c4ec2b..91fd7f352 100644 --- a/src/runloop_api_client/types/repository_list_params.py +++ b/src/runloop_api_client/types/repository_list_params.py @@ -11,5 +11,11 @@ class RepositoryListParams(TypedDict, total=False): limit: int """The limit of items to return. Default is 20.""" + name: str + """Filter by repository name""" + + owner: str + """Filter by repository owner""" + starting_after: str """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/scenario_run_view.py b/src/runloop_api_client/types/scenario_run_view.py index 33da17227..89d64dfd1 100644 --- a/src/runloop_api_client/types/scenario_run_view.py +++ b/src/runloop_api_client/types/scenario_run_view.py @@ -33,3 +33,6 @@ class ScenarioRunView(BaseModel): scoring_contract_result: Optional[ScoringContractResultView] = None """The input context for the Scenario.""" + + start_time_ms: Optional[int] = None + """The time that the scenario started""" diff --git a/src/runloop_api_client/types/scenarios/run_list_params.py b/src/runloop_api_client/types/scenarios/run_list_params.py index 86a3b1efd..17a2715c4 100644 --- a/src/runloop_api_client/types/scenarios/run_list_params.py +++ b/src/runloop_api_client/types/scenarios/run_list_params.py @@ -11,7 +11,7 @@ class RunListParams(TypedDict, total=False): limit: int """The limit of items to return. Default is 20.""" - scenario_id: bool + scenario_id: str """Filter runs associated to Scenario given ID""" starting_after: str diff --git a/tests/api_resources/scenarios/test_runs.py b/tests/api_resources/scenarios/test_runs.py index 8a83be2ce..d375cb45e 100644 --- a/tests/api_resources/scenarios/test_runs.py +++ b/tests/api_resources/scenarios/test_runs.py @@ -64,7 +64,7 @@ def test_method_list(self, client: Runloop) -> None: def test_method_list_with_all_params(self, client: Runloop) -> None: run = client.scenarios.runs.list( limit=0, - scenario_id=True, + scenario_id="scenario_id", starting_after="starting_after", ) assert_matches_type(ScenarioRunListView, run, path=["response"]) @@ -216,7 +216,7 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: run = await async_client.scenarios.runs.list( limit=0, - scenario_id=True, + scenario_id="scenario_id", starting_after="starting_after", ) assert_matches_type(ScenarioRunListView, run, path=["response"]) diff --git a/tests/api_resources/test_repositories.py b/tests/api_resources/test_repositories.py index 6107fe5f9..47e0798c8 100644 --- a/tests/api_resources/test_repositories.py +++ b/tests/api_resources/test_repositories.py @@ -29,6 +29,15 @@ def test_method_create(self, client: Runloop) -> None: ) assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + @parametrize + def test_method_create_with_all_params(self, client: Runloop) -> None: + repository = client.repositories.create( + name="name", + owner="owner", + blueprint_id="blueprint_id", + ) + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + @parametrize def test_raw_response_create(self, client: Runloop) -> None: response = client.repositories.with_raw_response.create( @@ -102,6 +111,8 @@ def test_method_list(self, client: Runloop) -> None: def test_method_list_with_all_params(self, client: Runloop) -> None: repository = client.repositories.list( limit=0, + name="name", + owner="owner", starting_after="starting_after", ) assert_matches_type(SyncRepositoriesCursorIDPage[RepositoryConnectionView], repository, path=["response"]) @@ -214,6 +225,15 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: ) assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: + repository = await async_client.repositories.create( + name="name", + owner="owner", + blueprint_id="blueprint_id", + ) + assert_matches_type(RepositoryConnectionView, repository, path=["response"]) + @parametrize async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: response = await async_client.repositories.with_raw_response.create( @@ -287,6 +307,8 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: repository = await async_client.repositories.list( limit=0, + name="name", + owner="owner", starting_after="starting_after", ) assert_matches_type(AsyncRepositoriesCursorIDPage[RepositoryConnectionView], repository, path=["response"]) From 396946088995392145f002b1dad1d04b10de6fc0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 1 Feb 2025 00:24:49 +0000 Subject: [PATCH 644/993] chore(internal): version bump (#514) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b4e9013ba..6db19b956 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.16.0" + ".": "0.17.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index f02034ee6..5e7d26ec3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.16.0" +version = "0.17.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index e302279f7..d2dd301f2 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.16.0" # x-release-please-version +__version__ = "0.17.0" # x-release-please-version From 5dc1ef12157ab6035e226aab597c7dcf2aa8d503 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 1 Feb 2025 01:07:09 +0000 Subject: [PATCH 645/993] feat(api): api update (#515) --- .stats.yml | 2 +- api.md | 8 +- src/runloop_api_client/pagination.py | 236 ++++++++++++++++++ .../resources/benchmarks/benchmarks.py | 22 +- .../resources/benchmarks/runs.py | 27 +- .../resources/scenarios/runs.py | 27 +- .../resources/scenarios/scenarios.py | 30 ++- .../types/scenario_list_params.py | 3 + tests/api_resources/benchmarks/test_runs.py | 19 +- tests/api_resources/scenarios/test_runs.py | 19 +- tests/api_resources/test_benchmarks.py | 18 +- tests/api_resources/test_scenarios.py | 20 +- 12 files changed, 342 insertions(+), 89 deletions(-) diff --git a/.stats.yml b/.stats.yml index c25634d0b..c015e59e5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 66 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bf4f1f241c2a3a425dc7d12b7b7e415133bb696682d1a285836d1a36b7bd6160.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8030b5a782144e97b4c813649da362416bd258f9a0bdd5d43b507c474d7f0bc0.yml diff --git a/api.md b/api.md index 8967b08eb..07c9163b5 100644 --- a/api.md +++ b/api.md @@ -23,7 +23,7 @@ Methods: - client.benchmarks.create(\*\*params) -> BenchmarkView - client.benchmarks.retrieve(id) -> BenchmarkView -- client.benchmarks.list(\*\*params) -> BenchmarkListView +- client.benchmarks.list(\*\*params) -> SyncBenchmarksCursorIDPage[BenchmarkView] - client.benchmarks.start_run(\*\*params) -> BenchmarkRunView ## Runs @@ -31,7 +31,7 @@ Methods: Methods: - client.benchmarks.runs.retrieve(id) -> BenchmarkRunView -- client.benchmarks.runs.list(\*\*params) -> BenchmarkRunListView +- client.benchmarks.runs.list(\*\*params) -> SyncBenchmarkRunsCursorIDPage[BenchmarkRunView] - client.benchmarks.runs.complete(id) -> BenchmarkRunView # Blueprints @@ -260,7 +260,7 @@ Methods: - client.scenarios.create(\*\*params) -> ScenarioView - client.scenarios.retrieve(id) -> ScenarioView -- client.scenarios.list(\*\*params) -> ScenarioListView +- client.scenarios.list(\*\*params) -> SyncScenariosCursorIDPage[ScenarioView] - client.scenarios.start_run(\*\*params) -> ScenarioRunView ## Runs @@ -268,7 +268,7 @@ Methods: Methods: - client.scenarios.runs.retrieve(id) -> ScenarioRunView -- client.scenarios.runs.list(\*\*params) -> ScenarioRunListView +- client.scenarios.runs.list(\*\*params) -> SyncBenchmarkRunsCursorIDPage[ScenarioRunView] - client.scenarios.runs.complete(id) -> ScenarioRunView - client.scenarios.runs.score(id) -> ScenarioRunView diff --git a/src/runloop_api_client/pagination.py b/src/runloop_api_client/pagination.py index 00f73e6a1..355e8e364 100644 --- a/src/runloop_api_client/pagination.py +++ b/src/runloop_api_client/pagination.py @@ -14,6 +14,14 @@ "AsyncRepositoriesCursorIDPage", "SyncDiskSnapshotsCursorIDPage", "AsyncDiskSnapshotsCursorIDPage", + "SyncBenchmarksCursorIDPage", + "AsyncBenchmarksCursorIDPage", + "SyncBenchmarkRunsCursorIDPage", + "AsyncBenchmarkRunsCursorIDPage", + "SyncScenariosCursorIDPage", + "AsyncScenariosCursorIDPage", + "SyncScenarioRunsCursorIDPage", + "AsyncScenarioRunsCursorIDPage", ] _T = TypeVar("_T") @@ -39,6 +47,26 @@ class DiskSnapshotsCursorIDPageItem(Protocol): id: str +@runtime_checkable +class BenchmarksCursorIDPageItem(Protocol): + id: str + + +@runtime_checkable +class BenchmarkRunsCursorIDPageItem(Protocol): + id: str + + +@runtime_checkable +class ScenariosCursorIDPageItem(Protocol): + id: str + + +@runtime_checkable +class ScenarioRunsCursorIDPageItem(Protocol): + id: str + + class SyncBlueprintsCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): blueprints: List[_T] has_more: Optional[bool] = None @@ -245,3 +273,211 @@ def next_page_info(self) -> Optional[PageInfo]: return None return PageInfo(params={"starting_after": item.id}) + + +class SyncBenchmarksCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + benchmarks: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + benchmarks = self.benchmarks + if not benchmarks: + return [] + return benchmarks + + @override + def next_page_info(self) -> Optional[PageInfo]: + benchmarks = self.benchmarks + if not benchmarks: + return None + + item = cast(Any, benchmarks[-1]) + if not isinstance(item, BenchmarksCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) + + +class AsyncBenchmarksCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + benchmarks: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + benchmarks = self.benchmarks + if not benchmarks: + return [] + return benchmarks + + @override + def next_page_info(self) -> Optional[PageInfo]: + benchmarks = self.benchmarks + if not benchmarks: + return None + + item = cast(Any, benchmarks[-1]) + if not isinstance(item, BenchmarksCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) + + +class SyncBenchmarkRunsCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + runs: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + runs = self.runs + if not runs: + return [] + return runs + + @override + def next_page_info(self) -> Optional[PageInfo]: + runs = self.runs + if not runs: + return None + + item = cast(Any, runs[-1]) + if not isinstance(item, BenchmarkRunsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) + + +class AsyncBenchmarkRunsCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + runs: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + runs = self.runs + if not runs: + return [] + return runs + + @override + def next_page_info(self) -> Optional[PageInfo]: + runs = self.runs + if not runs: + return None + + item = cast(Any, runs[-1]) + if not isinstance(item, BenchmarkRunsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) + + +class SyncScenariosCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + scenarios: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + scenarios = self.scenarios + if not scenarios: + return [] + return scenarios + + @override + def next_page_info(self) -> Optional[PageInfo]: + scenarios = self.scenarios + if not scenarios: + return None + + item = cast(Any, scenarios[-1]) + if not isinstance(item, ScenariosCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) + + +class AsyncScenariosCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + scenarios: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + scenarios = self.scenarios + if not scenarios: + return [] + return scenarios + + @override + def next_page_info(self) -> Optional[PageInfo]: + scenarios = self.scenarios + if not scenarios: + return None + + item = cast(Any, scenarios[-1]) + if not isinstance(item, ScenariosCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) + + +class SyncScenarioRunsCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + runs: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + runs = self.runs + if not runs: + return [] + return runs + + @override + def next_page_info(self) -> Optional[PageInfo]: + runs = self.runs + if not runs: + return None + + item = cast(Any, runs[-1]) + if not isinstance(item, ScenarioRunsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) + + +class AsyncScenarioRunsCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + runs: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + runs = self.runs + if not runs: + return [] + return runs + + @override + def next_page_info(self) -> Optional[PageInfo]: + runs = self.runs + if not runs: + return None + + item = cast(Any, runs[-1]) + if not isinstance(item, ScenarioRunsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py index 650494753..b35432509 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -28,10 +28,10 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._base_client import make_request_options +from ...pagination import SyncBenchmarksCursorIDPage, AsyncBenchmarksCursorIDPage +from ..._base_client import AsyncPaginator, make_request_options from ...types.benchmark_view import BenchmarkView from ...types.benchmark_run_view import BenchmarkRunView -from ...types.benchmark_list_view import BenchmarkListView __all__ = ["BenchmarksResource", "AsyncBenchmarksResource"] @@ -155,7 +155,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BenchmarkListView: + ) -> SyncBenchmarksCursorIDPage[BenchmarkView]: """ List all Benchmarks matching filter. @@ -175,8 +175,9 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get( + return self._get_api_list( "/v1/benchmarks", + page=SyncBenchmarksCursorIDPage[BenchmarkView], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -191,7 +192,7 @@ def list( benchmark_list_params.BenchmarkListParams, ), ), - cast_to=BenchmarkListView, + model=BenchmarkView, ) def start_run( @@ -352,7 +353,7 @@ async def retrieve( cast_to=BenchmarkView, ) - async def list( + def list( self, *, limit: int | NotGiven = NOT_GIVEN, @@ -364,7 +365,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BenchmarkListView: + ) -> AsyncPaginator[BenchmarkView, AsyncBenchmarksCursorIDPage[BenchmarkView]]: """ List all Benchmarks matching filter. @@ -384,14 +385,15 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - return await self._get( + return self._get_api_list( "/v1/benchmarks", + page=AsyncBenchmarksCursorIDPage[BenchmarkView], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { "limit": limit, "public": public, @@ -400,7 +402,7 @@ async def list( benchmark_list_params.BenchmarkListParams, ), ), - cast_to=BenchmarkListView, + model=BenchmarkView, ) async def start_run( diff --git a/src/runloop_api_client/resources/benchmarks/runs.py b/src/runloop_api_client/resources/benchmarks/runs.py index 3866eb99a..7f84c5da5 100644 --- a/src/runloop_api_client/resources/benchmarks/runs.py +++ b/src/runloop_api_client/resources/benchmarks/runs.py @@ -5,10 +5,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -17,10 +14,10 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._base_client import make_request_options +from ...pagination import SyncBenchmarkRunsCursorIDPage, AsyncBenchmarkRunsCursorIDPage +from ..._base_client import AsyncPaginator, make_request_options from ...types.benchmarks import run_list_params from ...types.benchmark_run_view import BenchmarkRunView -from ...types.benchmark_run_list_view import BenchmarkRunListView __all__ = ["RunsResource", "AsyncRunsResource"] @@ -90,7 +87,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BenchmarkRunListView: + ) -> SyncBenchmarkRunsCursorIDPage[BenchmarkRunView]: """ List all BenchmarkRuns matching filter. @@ -109,8 +106,9 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get( + return self._get_api_list( "/v1/benchmarks/runs", + page=SyncBenchmarkRunsCursorIDPage[BenchmarkRunView], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -125,7 +123,7 @@ def list( run_list_params.RunListParams, ), ), - cast_to=BenchmarkRunListView, + model=BenchmarkRunView, ) def complete( @@ -222,7 +220,7 @@ async def retrieve( cast_to=BenchmarkRunView, ) - async def list( + def list( self, *, benchmark_id: str | NotGiven = NOT_GIVEN, @@ -234,7 +232,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BenchmarkRunListView: + ) -> AsyncPaginator[BenchmarkRunView, AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView]]: """ List all BenchmarkRuns matching filter. @@ -253,14 +251,15 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - return await self._get( + return self._get_api_list( "/v1/benchmarks/runs", + page=AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { "benchmark_id": benchmark_id, "limit": limit, @@ -269,7 +268,7 @@ async def list( run_list_params.RunListParams, ), ), - cast_to=BenchmarkRunListView, + model=BenchmarkRunView, ) async def complete( diff --git a/src/runloop_api_client/resources/scenarios/runs.py b/src/runloop_api_client/resources/scenarios/runs.py index 53549a00a..94b450a36 100644 --- a/src/runloop_api_client/resources/scenarios/runs.py +++ b/src/runloop_api_client/resources/scenarios/runs.py @@ -5,10 +5,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -17,10 +14,10 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._base_client import make_request_options +from ...pagination import SyncBenchmarkRunsCursorIDPage, AsyncBenchmarkRunsCursorIDPage +from ..._base_client import AsyncPaginator, make_request_options from ...types.scenarios import run_list_params from ...types.scenario_run_view import ScenarioRunView -from ...types.scenario_run_list_view import ScenarioRunListView __all__ = ["RunsResource", "AsyncRunsResource"] @@ -90,7 +87,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScenarioRunListView: + ) -> SyncBenchmarkRunsCursorIDPage[ScenarioRunView]: """ List all ScenarioRuns matching filter. @@ -109,8 +106,9 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get( + return self._get_api_list( "/v1/scenarios/runs", + page=SyncBenchmarkRunsCursorIDPage[ScenarioRunView], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -125,7 +123,7 @@ def list( run_list_params.RunListParams, ), ), - cast_to=ScenarioRunListView, + model=ScenarioRunView, ) def complete( @@ -262,7 +260,7 @@ async def retrieve( cast_to=ScenarioRunView, ) - async def list( + def list( self, *, limit: int | NotGiven = NOT_GIVEN, @@ -274,7 +272,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScenarioRunListView: + ) -> AsyncPaginator[ScenarioRunView, AsyncBenchmarkRunsCursorIDPage[ScenarioRunView]]: """ List all ScenarioRuns matching filter. @@ -293,14 +291,15 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - return await self._get( + return self._get_api_list( "/v1/scenarios/runs", + page=AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { "limit": limit, "scenario_id": scenario_id, @@ -309,7 +308,7 @@ async def list( run_list_params.RunListParams, ), ), - cast_to=ScenarioRunListView, + model=ScenarioRunView, ) async def complete( diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index bd698f6c9..af64a4b0e 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -32,10 +32,10 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ..._base_client import make_request_options +from ...pagination import SyncScenariosCursorIDPage, AsyncScenariosCursorIDPage +from ..._base_client import AsyncPaginator, make_request_options from ...types.scenario_view import ScenarioView from ...types.scenario_run_view import ScenarioRunView -from ...types.scenario_list_view import ScenarioListView from ...types.input_context_param import InputContextParam from ...types.scoring_contract_param import ScoringContractParam from ...types.scenario_environment_param import ScenarioEnvironmentParam @@ -163,6 +163,7 @@ def list( self, *, limit: int | NotGiven = NOT_GIVEN, + name: int | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -170,7 +171,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScenarioListView: + ) -> SyncScenariosCursorIDPage[ScenarioView]: """List all Scenarios matching filter. Args: @@ -178,6 +179,8 @@ def list( Default is 20. + name: Query for Scenarios with a given name. + starting_after: Load the next page of data starting after the item with the given ID. extra_headers: Send extra headers @@ -188,8 +191,9 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get( + return self._get_api_list( "/v1/scenarios", + page=SyncScenariosCursorIDPage[ScenarioView], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -198,12 +202,13 @@ def list( query=maybe_transform( { "limit": limit, + "name": name, "starting_after": starting_after, }, scenario_list_params.ScenarioListParams, ), ), - cast_to=ScenarioListView, + model=ScenarioView, ) def start_run( @@ -377,10 +382,11 @@ async def retrieve( cast_to=ScenarioView, ) - async def list( + def list( self, *, limit: int | NotGiven = NOT_GIVEN, + name: int | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -388,7 +394,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScenarioListView: + ) -> AsyncPaginator[ScenarioView, AsyncScenariosCursorIDPage[ScenarioView]]: """List all Scenarios matching filter. Args: @@ -396,6 +402,8 @@ async def list( Default is 20. + name: Query for Scenarios with a given name. + starting_after: Load the next page of data starting after the item with the given ID. extra_headers: Send extra headers @@ -406,22 +414,24 @@ async def list( timeout: Override the client-level default timeout for this request, in seconds """ - return await self._get( + return self._get_api_list( "/v1/scenarios", + page=AsyncScenariosCursorIDPage[ScenarioView], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( + query=maybe_transform( { "limit": limit, + "name": name, "starting_after": starting_after, }, scenario_list_params.ScenarioListParams, ), ), - cast_to=ScenarioListView, + model=ScenarioView, ) async def start_run( diff --git a/src/runloop_api_client/types/scenario_list_params.py b/src/runloop_api_client/types/scenario_list_params.py index 01dac999b..76ad9bd10 100644 --- a/src/runloop_api_client/types/scenario_list_params.py +++ b/src/runloop_api_client/types/scenario_list_params.py @@ -11,5 +11,8 @@ class ScenarioListParams(TypedDict, total=False): limit: int """The limit of items to return. Default is 20.""" + name: int + """Query for Scenarios with a given name.""" + starting_after: str """Load the next page of data starting after the item with the given ID.""" diff --git a/tests/api_resources/benchmarks/test_runs.py b/tests/api_resources/benchmarks/test_runs.py index 31ca76fed..e6acbebad 100644 --- a/tests/api_resources/benchmarks/test_runs.py +++ b/tests/api_resources/benchmarks/test_runs.py @@ -9,7 +9,8 @@ from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types import BenchmarkRunView, BenchmarkRunListView +from runloop_api_client.types import BenchmarkRunView +from runloop_api_client.pagination import SyncBenchmarkRunsCursorIDPage, AsyncBenchmarkRunsCursorIDPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -58,7 +59,7 @@ def test_path_params_retrieve(self, client: Runloop) -> None: @parametrize def test_method_list(self, client: Runloop) -> None: run = client.benchmarks.runs.list() - assert_matches_type(BenchmarkRunListView, run, path=["response"]) + assert_matches_type(SyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: @@ -67,7 +68,7 @@ def test_method_list_with_all_params(self, client: Runloop) -> None: limit=0, starting_after="starting_after", ) - assert_matches_type(BenchmarkRunListView, run, path=["response"]) + assert_matches_type(SyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -76,7 +77,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" run = response.parse() - assert_matches_type(BenchmarkRunListView, run, path=["response"]) + assert_matches_type(SyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -85,7 +86,7 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" run = response.parse() - assert_matches_type(BenchmarkRunListView, run, path=["response"]) + assert_matches_type(SyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) assert cast(Any, response.is_closed) is True @@ -172,7 +173,7 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: run = await async_client.benchmarks.runs.list() - assert_matches_type(BenchmarkRunListView, run, path=["response"]) + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -181,7 +182,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> limit=0, starting_after="starting_after", ) - assert_matches_type(BenchmarkRunListView, run, path=["response"]) + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -190,7 +191,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" run = await response.parse() - assert_matches_type(BenchmarkRunListView, run, path=["response"]) + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -199,7 +200,7 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" run = await response.parse() - assert_matches_type(BenchmarkRunListView, run, path=["response"]) + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/scenarios/test_runs.py b/tests/api_resources/scenarios/test_runs.py index d375cb45e..35b2e5141 100644 --- a/tests/api_resources/scenarios/test_runs.py +++ b/tests/api_resources/scenarios/test_runs.py @@ -9,7 +9,8 @@ from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types import ScenarioRunView, ScenarioRunListView +from runloop_api_client.types import ScenarioRunView +from runloop_api_client.pagination import SyncBenchmarkRunsCursorIDPage, AsyncBenchmarkRunsCursorIDPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -58,7 +59,7 @@ def test_path_params_retrieve(self, client: Runloop) -> None: @parametrize def test_method_list(self, client: Runloop) -> None: run = client.scenarios.runs.list() - assert_matches_type(ScenarioRunListView, run, path=["response"]) + assert_matches_type(SyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: @@ -67,7 +68,7 @@ def test_method_list_with_all_params(self, client: Runloop) -> None: scenario_id="scenario_id", starting_after="starting_after", ) - assert_matches_type(ScenarioRunListView, run, path=["response"]) + assert_matches_type(SyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -76,7 +77,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" run = response.parse() - assert_matches_type(ScenarioRunListView, run, path=["response"]) + assert_matches_type(SyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -85,7 +86,7 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" run = response.parse() - assert_matches_type(ScenarioRunListView, run, path=["response"]) + assert_matches_type(SyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) assert cast(Any, response.is_closed) is True @@ -210,7 +211,7 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: run = await async_client.scenarios.runs.list() - assert_matches_type(ScenarioRunListView, run, path=["response"]) + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -219,7 +220,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> scenario_id="scenario_id", starting_after="starting_after", ) - assert_matches_type(ScenarioRunListView, run, path=["response"]) + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -228,7 +229,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" run = await response.parse() - assert_matches_type(ScenarioRunListView, run, path=["response"]) + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -237,7 +238,7 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" run = await response.parse() - assert_matches_type(ScenarioRunListView, run, path=["response"]) + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py index b3ac18fc7..17b592147 100644 --- a/tests/api_resources/test_benchmarks.py +++ b/tests/api_resources/test_benchmarks.py @@ -12,8 +12,8 @@ from runloop_api_client.types import ( BenchmarkView, BenchmarkRunView, - BenchmarkListView, ) +from runloop_api_client.pagination import SyncBenchmarksCursorIDPage, AsyncBenchmarksCursorIDPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -101,7 +101,7 @@ def test_path_params_retrieve(self, client: Runloop) -> None: @parametrize def test_method_list(self, client: Runloop) -> None: benchmark = client.benchmarks.list() - assert_matches_type(BenchmarkListView, benchmark, path=["response"]) + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: @@ -110,7 +110,7 @@ def test_method_list_with_all_params(self, client: Runloop) -> None: public=True, starting_after="starting_after", ) - assert_matches_type(BenchmarkListView, benchmark, path=["response"]) + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -119,7 +119,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = response.parse() - assert_matches_type(BenchmarkListView, benchmark, path=["response"]) + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -128,7 +128,7 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = response.parse() - assert_matches_type(BenchmarkListView, benchmark, path=["response"]) + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) assert cast(Any, response.is_closed) is True @@ -255,7 +255,7 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.list() - assert_matches_type(BenchmarkListView, benchmark, path=["response"]) + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -264,7 +264,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> public=True, starting_after="starting_after", ) - assert_matches_type(BenchmarkListView, benchmark, path=["response"]) + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -273,7 +273,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = await response.parse() - assert_matches_type(BenchmarkListView, benchmark, path=["response"]) + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -282,7 +282,7 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = await response.parse() - assert_matches_type(BenchmarkListView, benchmark, path=["response"]) + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index 509542559..71ba64dfd 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -12,8 +12,8 @@ from runloop_api_client.types import ( ScenarioView, ScenarioRunView, - ScenarioListView, ) +from runloop_api_client.pagination import SyncScenariosCursorIDPage, AsyncScenariosCursorIDPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -142,15 +142,16 @@ def test_path_params_retrieve(self, client: Runloop) -> None: @parametrize def test_method_list(self, client: Runloop) -> None: scenario = client.scenarios.list() - assert_matches_type(ScenarioListView, scenario, path=["response"]) + assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: scenario = client.scenarios.list( limit=0, + name=0, starting_after="starting_after", ) - assert_matches_type(ScenarioListView, scenario, path=["response"]) + assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -159,7 +160,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = response.parse() - assert_matches_type(ScenarioListView, scenario, path=["response"]) + assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -168,7 +169,7 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = response.parse() - assert_matches_type(ScenarioListView, scenario, path=["response"]) + assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) assert cast(Any, response.is_closed) is True @@ -337,15 +338,16 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: scenario = await async_client.scenarios.list() - assert_matches_type(ScenarioListView, scenario, path=["response"]) + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: scenario = await async_client.scenarios.list( limit=0, + name=0, starting_after="starting_after", ) - assert_matches_type(ScenarioListView, scenario, path=["response"]) + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -354,7 +356,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = await response.parse() - assert_matches_type(ScenarioListView, scenario, path=["response"]) + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -363,7 +365,7 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = await response.parse() - assert_matches_type(ScenarioListView, scenario, path=["response"]) + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) assert cast(Any, response.is_closed) is True From a4fc4d2348a2d7a6d899d04132491e8fe64929e3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 1 Feb 2025 01:09:18 +0000 Subject: [PATCH 646/993] chore(internal): version bump (#517) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6db19b956..4ad3fef33 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.17.0" + ".": "0.18.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 5e7d26ec3..b384ff7ab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.17.0" +version = "0.18.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index d2dd301f2..3c71c53af 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.17.0" # x-release-please-version +__version__ = "0.18.0" # x-release-please-version From be105f3d34b591742831d54a1e9e0822229218f6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 22:48:24 +0000 Subject: [PATCH 647/993] feat(api): api update (#520) --- .stats.yml | 4 +- api.md | 2 + .../resources/benchmarks/benchmarks.py | 123 ++++++++++++++++-- .../resources/scenarios/scenarios.py | 119 ++++++++++++++++- src/runloop_api_client/types/__init__.py | 2 + .../types/benchmark_list_params.py | 6 - .../types/benchmark_list_public_params.py | 15 +++ .../types/benchmark_run_view.py | 5 +- .../types/scenario_list_params.py | 2 +- .../types/scenario_list_public_params.py | 18 +++ tests/api_resources/test_benchmarks.py | 68 +++++++++- tests/api_resources/test_scenarios.py | 72 +++++++++- 12 files changed, 409 insertions(+), 27 deletions(-) create mode 100644 src/runloop_api_client/types/benchmark_list_public_params.py create mode 100644 src/runloop_api_client/types/scenario_list_public_params.py diff --git a/.stats.yml b/.stats.yml index c015e59e5..54cc74dc4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 66 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8030b5a782144e97b4c813649da362416bd258f9a0bdd5d43b507c474d7f0bc0.yml +configured_endpoints: 68 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ad83f8f9f6d60b6ef468111bde705c475948948951ff9ec80c54c2df76ff5596.yml diff --git a/api.md b/api.md index 07c9163b5..923bfcfd5 100644 --- a/api.md +++ b/api.md @@ -24,6 +24,7 @@ Methods: - client.benchmarks.create(\*\*params) -> BenchmarkView - client.benchmarks.retrieve(id) -> BenchmarkView - client.benchmarks.list(\*\*params) -> SyncBenchmarksCursorIDPage[BenchmarkView] +- client.benchmarks.list_public(\*\*params) -> SyncBenchmarksCursorIDPage[BenchmarkView] - client.benchmarks.start_run(\*\*params) -> BenchmarkRunView ## Runs @@ -261,6 +262,7 @@ Methods: - client.scenarios.create(\*\*params) -> ScenarioView - client.scenarios.retrieve(id) -> ScenarioView - client.scenarios.list(\*\*params) -> SyncScenariosCursorIDPage[ScenarioView] +- client.scenarios.list_public(\*\*params) -> SyncScenariosCursorIDPage[ScenarioView] - client.scenarios.start_run(\*\*params) -> ScenarioRunView ## Runs diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py index b35432509..f1ea0ffe7 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -14,7 +14,12 @@ RunsResourceWithStreamingResponse, AsyncRunsResourceWithStreamingResponse, ) -from ...types import benchmark_list_params, benchmark_create_params, benchmark_start_run_params +from ...types import ( + benchmark_list_params, + benchmark_create_params, + benchmark_start_run_params, + benchmark_list_public_params, +) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( maybe_transform, @@ -147,7 +152,6 @@ def list( self, *, limit: int | NotGiven = NOT_GIVEN, - public: bool | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -162,9 +166,6 @@ def list( Args: limit: The limit of items to return. Default is 20. - public: List public benchmarks, e.g. SWE-bench. Defaults to false, i.e. only - user-defined benchmarks are listed. - starting_after: Load the next page of data starting after the item with the given ID. extra_headers: Send extra headers @@ -186,7 +187,6 @@ def list( query=maybe_transform( { "limit": limit, - "public": public, "starting_after": starting_after, }, benchmark_list_params.BenchmarkListParams, @@ -195,6 +195,53 @@ def list( model=BenchmarkView, ) + def list_public( + self, + *, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncBenchmarksCursorIDPage[BenchmarkView]: + """ + List all public benchmarks matching filter. + + Args: + limit: The limit of items to return. Default is 20. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/benchmarks/list_public", + page=SyncBenchmarksCursorIDPage[BenchmarkView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + benchmark_list_public_params.BenchmarkListPublicParams, + ), + ), + model=BenchmarkView, + ) + def start_run( self, *, @@ -357,7 +404,6 @@ def list( self, *, limit: int | NotGiven = NOT_GIVEN, - public: bool | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -372,9 +418,6 @@ def list( Args: limit: The limit of items to return. Default is 20. - public: List public benchmarks, e.g. SWE-bench. Defaults to false, i.e. only - user-defined benchmarks are listed. - starting_after: Load the next page of data starting after the item with the given ID. extra_headers: Send extra headers @@ -396,7 +439,6 @@ def list( query=maybe_transform( { "limit": limit, - "public": public, "starting_after": starting_after, }, benchmark_list_params.BenchmarkListParams, @@ -405,6 +447,53 @@ def list( model=BenchmarkView, ) + def list_public( + self, + *, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[BenchmarkView, AsyncBenchmarksCursorIDPage[BenchmarkView]]: + """ + List all public benchmarks matching filter. + + Args: + limit: The limit of items to return. Default is 20. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/benchmarks/list_public", + page=AsyncBenchmarksCursorIDPage[BenchmarkView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + benchmark_list_public_params.BenchmarkListPublicParams, + ), + ), + model=BenchmarkView, + ) + async def start_run( self, *, @@ -469,6 +558,9 @@ def __init__(self, benchmarks: BenchmarksResource) -> None: self.list = to_raw_response_wrapper( benchmarks.list, ) + self.list_public = to_raw_response_wrapper( + benchmarks.list_public, + ) self.start_run = to_raw_response_wrapper( benchmarks.start_run, ) @@ -491,6 +583,9 @@ def __init__(self, benchmarks: AsyncBenchmarksResource) -> None: self.list = async_to_raw_response_wrapper( benchmarks.list, ) + self.list_public = async_to_raw_response_wrapper( + benchmarks.list_public, + ) self.start_run = async_to_raw_response_wrapper( benchmarks.start_run, ) @@ -513,6 +608,9 @@ def __init__(self, benchmarks: BenchmarksResource) -> None: self.list = to_streamed_response_wrapper( benchmarks.list, ) + self.list_public = to_streamed_response_wrapper( + benchmarks.list_public, + ) self.start_run = to_streamed_response_wrapper( benchmarks.start_run, ) @@ -535,6 +633,9 @@ def __init__(self, benchmarks: AsyncBenchmarksResource) -> None: self.list = async_to_streamed_response_wrapper( benchmarks.list, ) + self.list_public = async_to_streamed_response_wrapper( + benchmarks.list_public, + ) self.start_run = async_to_streamed_response_wrapper( benchmarks.start_run, ) diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index af64a4b0e..2501f4986 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -18,6 +18,7 @@ scenario_list_params, scenario_create_params, scenario_start_run_params, + scenario_list_public_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( @@ -163,7 +164,7 @@ def list( self, *, limit: int | NotGiven = NOT_GIVEN, - name: int | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -211,6 +212,57 @@ def list( model=ScenarioView, ) + def list_public( + self, + *, + limit: int | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncScenariosCursorIDPage[ScenarioView]: + """ + List all public scenarios matching filter. + + Args: + limit: The limit of items to return. Default is 20. + + name: Query for Scenarios with a given name. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/scenarios/list_public", + page=SyncScenariosCursorIDPage[ScenarioView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "name": name, + "starting_after": starting_after, + }, + scenario_list_public_params.ScenarioListPublicParams, + ), + ), + model=ScenarioView, + ) + def start_run( self, *, @@ -386,7 +438,7 @@ def list( self, *, limit: int | NotGiven = NOT_GIVEN, - name: int | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -434,6 +486,57 @@ def list( model=ScenarioView, ) + def list_public( + self, + *, + limit: int | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[ScenarioView, AsyncScenariosCursorIDPage[ScenarioView]]: + """ + List all public scenarios matching filter. + + Args: + limit: The limit of items to return. Default is 20. + + name: Query for Scenarios with a given name. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/scenarios/list_public", + page=AsyncScenariosCursorIDPage[ScenarioView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "name": name, + "starting_after": starting_after, + }, + scenario_list_public_params.ScenarioListPublicParams, + ), + ), + model=ScenarioView, + ) + async def start_run( self, *, @@ -502,6 +605,9 @@ def __init__(self, scenarios: ScenariosResource) -> None: self.list = to_raw_response_wrapper( scenarios.list, ) + self.list_public = to_raw_response_wrapper( + scenarios.list_public, + ) self.start_run = to_raw_response_wrapper( scenarios.start_run, ) @@ -524,6 +630,9 @@ def __init__(self, scenarios: AsyncScenariosResource) -> None: self.list = async_to_raw_response_wrapper( scenarios.list, ) + self.list_public = async_to_raw_response_wrapper( + scenarios.list_public, + ) self.start_run = async_to_raw_response_wrapper( scenarios.start_run, ) @@ -546,6 +655,9 @@ def __init__(self, scenarios: ScenariosResource) -> None: self.list = to_streamed_response_wrapper( scenarios.list, ) + self.list_public = to_streamed_response_wrapper( + scenarios.list_public, + ) self.start_run = to_streamed_response_wrapper( scenarios.start_run, ) @@ -568,6 +680,9 @@ def __init__(self, scenarios: AsyncScenariosResource) -> None: self.list = async_to_streamed_response_wrapper( scenarios.list, ) + self.list_public = async_to_streamed_response_wrapper( + scenarios.list_public, + ) self.start_run = async_to_streamed_response_wrapper( scenarios.start_run, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index d8cd7881a..f8e0dbe8d 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -55,6 +55,8 @@ from .devbox_execute_async_params import DevboxExecuteAsyncParams as DevboxExecuteAsyncParams from .devbox_remove_tunnel_params import DevboxRemoveTunnelParams as DevboxRemoveTunnelParams from .devbox_snapshot_disk_params import DevboxSnapshotDiskParams as DevboxSnapshotDiskParams +from .scenario_list_public_params import ScenarioListPublicParams as ScenarioListPublicParams +from .benchmark_list_public_params import BenchmarkListPublicParams as BenchmarkListPublicParams from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView from .repository_version_list_view import RepositoryVersionListView as RepositoryVersionListView from .scoring_contract_result_view import ScoringContractResultView as ScoringContractResultView diff --git a/src/runloop_api_client/types/benchmark_list_params.py b/src/runloop_api_client/types/benchmark_list_params.py index 3eef4e030..51b2b1320 100644 --- a/src/runloop_api_client/types/benchmark_list_params.py +++ b/src/runloop_api_client/types/benchmark_list_params.py @@ -11,11 +11,5 @@ class BenchmarkListParams(TypedDict, total=False): limit: int """The limit of items to return. Default is 20.""" - public: bool - """List public benchmarks, e.g. - - SWE-bench. Defaults to false, i.e. only user-defined benchmarks are listed. - """ - starting_after: str """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/benchmark_list_public_params.py b/src/runloop_api_client/types/benchmark_list_public_params.py new file mode 100644 index 000000000..c5081922d --- /dev/null +++ b/src/runloop_api_client/types/benchmark_list_public_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["BenchmarkListPublicParams"] + + +class BenchmarkListPublicParams(TypedDict, total=False): + limit: int + """The limit of items to return. Default is 20.""" + + starting_after: str + """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/benchmark_run_view.py b/src/runloop_api_client/types/benchmark_run_view.py index cf46d855c..51af18a0f 100644 --- a/src/runloop_api_client/types/benchmark_run_view.py +++ b/src/runloop_api_client/types/benchmark_run_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from typing_extensions import Literal from .._models import BaseModel @@ -27,6 +27,9 @@ class BenchmarkRunView(BaseModel): name: Optional[str] = None """The name of the BenchmarkRun.""" + pending_scenarios: Optional[List[str]] = None + """List of Scenarios that need to be completed before benchmark can be completed.""" + score: Optional[float] = None """The final score across the BenchmarkRun, present once completed. diff --git a/src/runloop_api_client/types/scenario_list_params.py b/src/runloop_api_client/types/scenario_list_params.py index 76ad9bd10..26c4b5c79 100644 --- a/src/runloop_api_client/types/scenario_list_params.py +++ b/src/runloop_api_client/types/scenario_list_params.py @@ -11,7 +11,7 @@ class ScenarioListParams(TypedDict, total=False): limit: int """The limit of items to return. Default is 20.""" - name: int + name: str """Query for Scenarios with a given name.""" starting_after: str diff --git a/src/runloop_api_client/types/scenario_list_public_params.py b/src/runloop_api_client/types/scenario_list_public_params.py new file mode 100644 index 000000000..7f413a517 --- /dev/null +++ b/src/runloop_api_client/types/scenario_list_public_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["ScenarioListPublicParams"] + + +class ScenarioListPublicParams(TypedDict, total=False): + limit: int + """The limit of items to return. Default is 20.""" + + name: str + """Query for Scenarios with a given name.""" + + starting_after: str + """Load the next page of data starting after the item with the given ID.""" diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py index 17b592147..82ed0bfa1 100644 --- a/tests/api_resources/test_benchmarks.py +++ b/tests/api_resources/test_benchmarks.py @@ -107,7 +107,6 @@ def test_method_list(self, client: Runloop) -> None: def test_method_list_with_all_params(self, client: Runloop) -> None: benchmark = client.benchmarks.list( limit=0, - public=True, starting_after="starting_after", ) assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) @@ -132,6 +131,39 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_list_public(self, client: Runloop) -> None: + benchmark = client.benchmarks.list_public() + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + + @parametrize + def test_method_list_public_with_all_params(self, client: Runloop) -> None: + benchmark = client.benchmarks.list_public( + limit=0, + starting_after="starting_after", + ) + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + + @parametrize + def test_raw_response_list_public(self, client: Runloop) -> None: + response = client.benchmarks.with_raw_response.list_public() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark = response.parse() + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + + @parametrize + def test_streaming_response_list_public(self, client: Runloop) -> None: + with client.benchmarks.with_streaming_response.list_public() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark = response.parse() + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_start_run(self, client: Runloop) -> None: benchmark = client.benchmarks.start_run( @@ -261,7 +293,6 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.list( limit=0, - public=True, starting_after="starting_after", ) assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) @@ -286,6 +317,39 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_list_public(self, async_client: AsyncRunloop) -> None: + benchmark = await async_client.benchmarks.list_public() + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + + @parametrize + async def test_method_list_public_with_all_params(self, async_client: AsyncRunloop) -> None: + benchmark = await async_client.benchmarks.list_public( + limit=0, + starting_after="starting_after", + ) + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + + @parametrize + async def test_raw_response_list_public(self, async_client: AsyncRunloop) -> None: + response = await async_client.benchmarks.with_raw_response.list_public() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark = await response.parse() + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + + @parametrize + async def test_streaming_response_list_public(self, async_client: AsyncRunloop) -> None: + async with async_client.benchmarks.with_streaming_response.list_public() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark = await response.parse() + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_start_run(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.start_run( diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index 71ba64dfd..e204eb126 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -148,7 +148,7 @@ def test_method_list(self, client: Runloop) -> None: def test_method_list_with_all_params(self, client: Runloop) -> None: scenario = client.scenarios.list( limit=0, - name=0, + name="name", starting_after="starting_after", ) assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) @@ -173,6 +173,40 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_list_public(self, client: Runloop) -> None: + scenario = client.scenarios.list_public() + assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + + @parametrize + def test_method_list_public_with_all_params(self, client: Runloop) -> None: + scenario = client.scenarios.list_public( + limit=0, + name="name", + starting_after="starting_after", + ) + assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + + @parametrize + def test_raw_response_list_public(self, client: Runloop) -> None: + response = client.scenarios.with_raw_response.list_public() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scenario = response.parse() + assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + + @parametrize + def test_streaming_response_list_public(self, client: Runloop) -> None: + with client.scenarios.with_streaming_response.list_public() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scenario = response.parse() + assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_start_run(self, client: Runloop) -> None: scenario = client.scenarios.start_run( @@ -344,7 +378,7 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: scenario = await async_client.scenarios.list( limit=0, - name=0, + name="name", starting_after="starting_after", ) assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) @@ -369,6 +403,40 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_list_public(self, async_client: AsyncRunloop) -> None: + scenario = await async_client.scenarios.list_public() + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + + @parametrize + async def test_method_list_public_with_all_params(self, async_client: AsyncRunloop) -> None: + scenario = await async_client.scenarios.list_public( + limit=0, + name="name", + starting_after="starting_after", + ) + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + + @parametrize + async def test_raw_response_list_public(self, async_client: AsyncRunloop) -> None: + response = await async_client.scenarios.with_raw_response.list_public() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scenario = await response.parse() + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + + @parametrize + async def test_streaming_response_list_public(self, async_client: AsyncRunloop) -> None: + async with async_client.scenarios.with_streaming_response.list_public() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scenario = await response.parse() + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_start_run(self, async_client: AsyncRunloop) -> None: scenario = await async_client.scenarios.start_run( From 08b4dceb10f5c35dbdb4394fd4b828bf778d3b0a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 22:56:01 +0000 Subject: [PATCH 648/993] chore(internal): version bump (#521) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4ad3fef33..e75629345 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.18.0" + ".": "0.19.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index b384ff7ab..af9e0071a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.18.0" +version = "0.19.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 3c71c53af..5b3613c63 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.18.0" # x-release-please-version +__version__ = "0.19.0" # x-release-please-version From e4c284010beda82a780ee336f3a19212433c3fc6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 03:26:15 +0000 Subject: [PATCH 649/993] chore(internal): change default timeout to an int (#524) --- src/runloop_api_client/_constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runloop_api_client/_constants.py b/src/runloop_api_client/_constants.py index a2ac3b6f3..6ddf2c717 100644 --- a/src/runloop_api_client/_constants.py +++ b/src/runloop_api_client/_constants.py @@ -6,7 +6,7 @@ OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to" # default timeout is 1 minute -DEFAULT_TIMEOUT = httpx.Timeout(timeout=60.0, connect=5.0) +DEFAULT_TIMEOUT = httpx.Timeout(timeout=60, connect=5.0) DEFAULT_MAX_RETRIES = 2 DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20) From e14ce5a993c6146302958ed30815ca3ef6925d58 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 03:27:47 +0000 Subject: [PATCH 650/993] chore(internal): bummp ruff dependency (#525) --- pyproject.toml | 2 +- requirements-dev.lock | 2 +- scripts/utils/ruffen-docs.py | 4 ++-- src/runloop_api_client/_models.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index af9e0071a..fd789f00c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -177,7 +177,7 @@ select = [ "T201", "T203", # misuse of typing.TYPE_CHECKING - "TCH004", + "TC004", # import rules "TID251", ] diff --git a/requirements-dev.lock b/requirements-dev.lock index af145651b..054d61875 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -78,7 +78,7 @@ pytz==2023.3.post1 # via dirty-equals respx==0.22.0 rich==13.7.1 -ruff==0.6.9 +ruff==0.9.4 setuptools==68.2.2 # via nodeenv six==1.16.0 diff --git a/scripts/utils/ruffen-docs.py b/scripts/utils/ruffen-docs.py index 37b3d94f0..0cf2bd2fd 100644 --- a/scripts/utils/ruffen-docs.py +++ b/scripts/utils/ruffen-docs.py @@ -47,7 +47,7 @@ def _md_match(match: Match[str]) -> str: with _collect_error(match): code = format_code_block(code) code = textwrap.indent(code, match["indent"]) - return f'{match["before"]}{code}{match["after"]}' + return f"{match['before']}{code}{match['after']}" def _pycon_match(match: Match[str]) -> str: code = "" @@ -97,7 +97,7 @@ def finish_fragment() -> None: def _md_pycon_match(match: Match[str]) -> str: code = _pycon_match(match) code = textwrap.indent(code, match["indent"]) - return f'{match["before"]}{code}{match["after"]}' + return f"{match['before']}{code}{match['after']}" src = MD_RE.sub(_md_match, src) src = MD_PYCON_RE.sub(_md_pycon_match, src) diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index 9a918aabf..12c34b7d1 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -172,7 +172,7 @@ def to_json( @override def __str__(self) -> str: # mypy complains about an invalid self arg - return f'{self.__repr_name__()}({self.__repr_str__(", ")})' # type: ignore[misc] + return f"{self.__repr_name__()}({self.__repr_str__(', ')})" # type: ignore[misc] # Override the 'construct' method in a way that supports recursive parsing without validation. # Based on https://github.com/samuelcolvin/pydantic/issues/1168#issuecomment-817742836. From fe5d286dfd05449024d913d460d0c826e333d8b1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 18:31:56 +0000 Subject: [PATCH 651/993] feat(api): api update (#526) --- .stats.yml | 4 +- api.md | 22 + src/runloop_api_client/pagination.py | 59 ++ .../resources/scenarios/__init__.py | 14 + .../resources/scenarios/scenarios.py | 32 + .../resources/scenarios/scorers.py | 632 ++++++++++++++++++ src/runloop_api_client/types/input_context.py | 4 + .../types/input_context_param.py | 4 + .../types/scenarios/__init__.py | 9 + .../types/scenarios/scorer_create_params.py | 18 + .../types/scenarios/scorer_create_response.py | 17 + .../types/scenarios/scorer_list_params.py | 15 + .../types/scenarios/scorer_list_response.py | 17 + .../scenarios/scorer_retrieve_response.py | 17 + .../types/scenarios/scorer_update_params.py | 18 + .../types/scenarios/scorer_update_response.py | 17 + .../types/scenarios/scorer_validate_params.py | 17 + .../scenarios/scorer_validate_response.py | 23 + tests/api_resources/scenarios/test_scorers.py | 441 ++++++++++++ tests/api_resources/test_scenarios.py | 10 +- 20 files changed, 1386 insertions(+), 4 deletions(-) create mode 100644 src/runloop_api_client/resources/scenarios/scorers.py create mode 100644 src/runloop_api_client/types/scenarios/scorer_create_params.py create mode 100644 src/runloop_api_client/types/scenarios/scorer_create_response.py create mode 100644 src/runloop_api_client/types/scenarios/scorer_list_params.py create mode 100644 src/runloop_api_client/types/scenarios/scorer_list_response.py create mode 100644 src/runloop_api_client/types/scenarios/scorer_retrieve_response.py create mode 100644 src/runloop_api_client/types/scenarios/scorer_update_params.py create mode 100644 src/runloop_api_client/types/scenarios/scorer_update_response.py create mode 100644 src/runloop_api_client/types/scenarios/scorer_validate_params.py create mode 100644 src/runloop_api_client/types/scenarios/scorer_validate_response.py create mode 100644 tests/api_resources/scenarios/test_scorers.py diff --git a/.stats.yml b/.stats.yml index 54cc74dc4..2b147e2ad 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 68 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ad83f8f9f6d60b6ef468111bde705c475948948951ff9ec80c54c2df76ff5596.yml +configured_endpoints: 73 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-00234fd425f75dd0ac33cdfd2b9e806a7fa29638ffc4ed4b91d5042a17ff5cfd.yml diff --git a/api.md b/api.md index 923bfcfd5..d06a2dbf7 100644 --- a/api.md +++ b/api.md @@ -274,6 +274,28 @@ Methods: - client.scenarios.runs.complete(id) -> ScenarioRunView - client.scenarios.runs.score(id) -> ScenarioRunView +## Scorers + +Types: + +```python +from runloop_api_client.types.scenarios import ( + ScorerCreateResponse, + ScorerRetrieveResponse, + ScorerUpdateResponse, + ScorerListResponse, + ScorerValidateResponse, +) +``` + +Methods: + +- client.scenarios.scorers.create(\*\*params) -> ScorerCreateResponse +- client.scenarios.scorers.retrieve(id) -> ScorerRetrieveResponse +- client.scenarios.scorers.update(id, \*\*params) -> ScorerUpdateResponse +- client.scenarios.scorers.list(\*\*params) -> SyncScenarioScorersCursorIDPage[ScorerListResponse] +- client.scenarios.scorers.validate(id, \*\*params) -> ScorerValidateResponse + # Repositories Types: diff --git a/src/runloop_api_client/pagination.py b/src/runloop_api_client/pagination.py index 355e8e364..f2b918ab9 100644 --- a/src/runloop_api_client/pagination.py +++ b/src/runloop_api_client/pagination.py @@ -22,6 +22,8 @@ "AsyncScenariosCursorIDPage", "SyncScenarioRunsCursorIDPage", "AsyncScenarioRunsCursorIDPage", + "SyncScenarioScorersCursorIDPage", + "AsyncScenarioScorersCursorIDPage", ] _T = TypeVar("_T") @@ -67,6 +69,11 @@ class ScenarioRunsCursorIDPageItem(Protocol): id: str +@runtime_checkable +class ScenarioScorersCursorIDPageItem(Protocol): + id: str + + class SyncBlueprintsCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): blueprints: List[_T] has_more: Optional[bool] = None @@ -481,3 +488,55 @@ def next_page_info(self) -> Optional[PageInfo]: return None return PageInfo(params={"starting_after": item.id}) + + +class SyncScenarioScorersCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + scorers: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + scorers = self.scorers + if not scorers: + return [] + return scorers + + @override + def next_page_info(self) -> Optional[PageInfo]: + scorers = self.scorers + if not scorers: + return None + + item = cast(Any, scorers[-1]) + if not isinstance(item, ScenarioScorersCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) + + +class AsyncScenarioScorersCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + scorers: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + scorers = self.scorers + if not scorers: + return [] + return scorers + + @override + def next_page_info(self) -> Optional[PageInfo]: + scorers = self.scorers + if not scorers: + return None + + item = cast(Any, scorers[-1]) + if not isinstance(item, ScenarioScorersCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) diff --git a/src/runloop_api_client/resources/scenarios/__init__.py b/src/runloop_api_client/resources/scenarios/__init__.py index 88b900e36..4d6bc16cf 100644 --- a/src/runloop_api_client/resources/scenarios/__init__.py +++ b/src/runloop_api_client/resources/scenarios/__init__.py @@ -8,6 +8,14 @@ RunsResourceWithStreamingResponse, AsyncRunsResourceWithStreamingResponse, ) +from .scorers import ( + ScorersResource, + AsyncScorersResource, + ScorersResourceWithRawResponse, + AsyncScorersResourceWithRawResponse, + ScorersResourceWithStreamingResponse, + AsyncScorersResourceWithStreamingResponse, +) from .scenarios import ( ScenariosResource, AsyncScenariosResource, @@ -24,6 +32,12 @@ "AsyncRunsResourceWithRawResponse", "RunsResourceWithStreamingResponse", "AsyncRunsResourceWithStreamingResponse", + "ScorersResource", + "AsyncScorersResource", + "ScorersResourceWithRawResponse", + "AsyncScorersResourceWithRawResponse", + "ScorersResourceWithStreamingResponse", + "AsyncScorersResourceWithStreamingResponse", "ScenariosResource", "AsyncScenariosResource", "ScenariosResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index 2501f4986..117eb39a4 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -20,6 +20,14 @@ scenario_start_run_params, scenario_list_public_params, ) +from .scorers import ( + ScorersResource, + AsyncScorersResource, + ScorersResourceWithRawResponse, + AsyncScorersResourceWithRawResponse, + ScorersResourceWithStreamingResponse, + AsyncScorersResourceWithStreamingResponse, +) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven from ..._utils import ( maybe_transform, @@ -49,6 +57,10 @@ class ScenariosResource(SyncAPIResource): def runs(self) -> RunsResource: return RunsResource(self._client) + @cached_property + def scorers(self) -> ScorersResource: + return ScorersResource(self._client) + @cached_property def with_raw_response(self) -> ScenariosResourceWithRawResponse: """ @@ -323,6 +335,10 @@ class AsyncScenariosResource(AsyncAPIResource): def runs(self) -> AsyncRunsResource: return AsyncRunsResource(self._client) + @cached_property + def scorers(self) -> AsyncScorersResource: + return AsyncScorersResource(self._client) + @cached_property def with_raw_response(self) -> AsyncScenariosResourceWithRawResponse: """ @@ -616,6 +632,10 @@ def __init__(self, scenarios: ScenariosResource) -> None: def runs(self) -> RunsResourceWithRawResponse: return RunsResourceWithRawResponse(self._scenarios.runs) + @cached_property + def scorers(self) -> ScorersResourceWithRawResponse: + return ScorersResourceWithRawResponse(self._scenarios.scorers) + class AsyncScenariosResourceWithRawResponse: def __init__(self, scenarios: AsyncScenariosResource) -> None: @@ -641,6 +661,10 @@ def __init__(self, scenarios: AsyncScenariosResource) -> None: def runs(self) -> AsyncRunsResourceWithRawResponse: return AsyncRunsResourceWithRawResponse(self._scenarios.runs) + @cached_property + def scorers(self) -> AsyncScorersResourceWithRawResponse: + return AsyncScorersResourceWithRawResponse(self._scenarios.scorers) + class ScenariosResourceWithStreamingResponse: def __init__(self, scenarios: ScenariosResource) -> None: @@ -666,6 +690,10 @@ def __init__(self, scenarios: ScenariosResource) -> None: def runs(self) -> RunsResourceWithStreamingResponse: return RunsResourceWithStreamingResponse(self._scenarios.runs) + @cached_property + def scorers(self) -> ScorersResourceWithStreamingResponse: + return ScorersResourceWithStreamingResponse(self._scenarios.scorers) + class AsyncScenariosResourceWithStreamingResponse: def __init__(self, scenarios: AsyncScenariosResource) -> None: @@ -690,3 +718,7 @@ def __init__(self, scenarios: AsyncScenariosResource) -> None: @cached_property def runs(self) -> AsyncRunsResourceWithStreamingResponse: return AsyncRunsResourceWithStreamingResponse(self._scenarios.runs) + + @cached_property + def scorers(self) -> AsyncScorersResourceWithStreamingResponse: + return AsyncScorersResourceWithStreamingResponse(self._scenarios.scorers) diff --git a/src/runloop_api_client/resources/scenarios/scorers.py b/src/runloop_api_client/resources/scenarios/scorers.py new file mode 100644 index 000000000..5d2ee5b58 --- /dev/null +++ b/src/runloop_api_client/resources/scenarios/scorers.py @@ -0,0 +1,632 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...pagination import SyncScenarioScorersCursorIDPage, AsyncScenarioScorersCursorIDPage +from ..._base_client import AsyncPaginator, make_request_options +from ...types.scenarios import scorer_list_params, scorer_create_params, scorer_update_params, scorer_validate_params +from ...types.scenario_environment_param import ScenarioEnvironmentParam +from ...types.scenarios.scorer_list_response import ScorerListResponse +from ...types.scenarios.scorer_create_response import ScorerCreateResponse +from ...types.scenarios.scorer_update_response import ScorerUpdateResponse +from ...types.scenarios.scorer_retrieve_response import ScorerRetrieveResponse +from ...types.scenarios.scorer_validate_response import ScorerValidateResponse + +__all__ = ["ScorersResource", "AsyncScorersResource"] + + +class ScorersResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ScorersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return ScorersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ScorersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return ScorersResourceWithStreamingResponse(self) + + def create( + self, + *, + bash_script: str, + name: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ScorerCreateResponse: + """ + Create a custom scenario scorer. + + Args: + bash_script: Bash script for the custom scorer taking context as a json object + $RL_TEST_CONTEXT. + + name: Name of the custom scorer. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/v1/scenarios/scorers", + body=maybe_transform( + { + "bash_script": bash_script, + "name": name, + }, + scorer_create_params.ScorerCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ScorerCreateResponse, + ) + + def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScorerRetrieveResponse: + """ + Retrieve Scenario Scorer. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/scenarios/scorers/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScorerRetrieveResponse, + ) + + def update( + self, + id: str, + *, + bash_script: str, + name: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ScorerUpdateResponse: + """ + Update a scenario scorer. + + Args: + bash_script: Bash script for the custom scorer taking context as a json object + $RL_TEST_CONTEXT. + + name: Name of the custom scorer. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/scenarios/scorers/{id}", + body=maybe_transform( + { + "bash_script": bash_script, + "name": name, + }, + scorer_update_params.ScorerUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ScorerUpdateResponse, + ) + + def list( + self, + *, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncScenarioScorersCursorIDPage[ScorerListResponse]: + """ + List all Scenario Scorers matching filter. + + Args: + limit: The limit of items to return. Default is 20. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/scenarios/scorers", + page=SyncScenarioScorersCursorIDPage[ScorerListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + scorer_list_params.ScorerListParams, + ), + ), + model=ScorerListResponse, + ) + + def validate( + self, + id: str, + *, + scoring_context: object, + environment_parameters: ScenarioEnvironmentParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ScorerValidateResponse: + """ + Validate a scenario scorer. + + Args: + scoring_context: Json context that gets passed to the custom scorer + + environment_parameters: The Environment in which the Scenario will run. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/scenarios/scorers/{id}/validate", + body=maybe_transform( + { + "scoring_context": scoring_context, + "environment_parameters": environment_parameters, + }, + scorer_validate_params.ScorerValidateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ScorerValidateResponse, + ) + + +class AsyncScorersResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncScorersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncScorersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncScorersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncScorersResourceWithStreamingResponse(self) + + async def create( + self, + *, + bash_script: str, + name: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ScorerCreateResponse: + """ + Create a custom scenario scorer. + + Args: + bash_script: Bash script for the custom scorer taking context as a json object + $RL_TEST_CONTEXT. + + name: Name of the custom scorer. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/v1/scenarios/scorers", + body=await async_maybe_transform( + { + "bash_script": bash_script, + "name": name, + }, + scorer_create_params.ScorerCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ScorerCreateResponse, + ) + + async def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScorerRetrieveResponse: + """ + Retrieve Scenario Scorer. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/scenarios/scorers/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ScorerRetrieveResponse, + ) + + async def update( + self, + id: str, + *, + bash_script: str, + name: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ScorerUpdateResponse: + """ + Update a scenario scorer. + + Args: + bash_script: Bash script for the custom scorer taking context as a json object + $RL_TEST_CONTEXT. + + name: Name of the custom scorer. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/scenarios/scorers/{id}", + body=await async_maybe_transform( + { + "bash_script": bash_script, + "name": name, + }, + scorer_update_params.ScorerUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ScorerUpdateResponse, + ) + + def list( + self, + *, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[ScorerListResponse, AsyncScenarioScorersCursorIDPage[ScorerListResponse]]: + """ + List all Scenario Scorers matching filter. + + Args: + limit: The limit of items to return. Default is 20. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/scenarios/scorers", + page=AsyncScenarioScorersCursorIDPage[ScorerListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + scorer_list_params.ScorerListParams, + ), + ), + model=ScorerListResponse, + ) + + async def validate( + self, + id: str, + *, + scoring_context: object, + environment_parameters: ScenarioEnvironmentParam | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ScorerValidateResponse: + """ + Validate a scenario scorer. + + Args: + scoring_context: Json context that gets passed to the custom scorer + + environment_parameters: The Environment in which the Scenario will run. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/scenarios/scorers/{id}/validate", + body=await async_maybe_transform( + { + "scoring_context": scoring_context, + "environment_parameters": environment_parameters, + }, + scorer_validate_params.ScorerValidateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ScorerValidateResponse, + ) + + +class ScorersResourceWithRawResponse: + def __init__(self, scorers: ScorersResource) -> None: + self._scorers = scorers + + self.create = to_raw_response_wrapper( + scorers.create, + ) + self.retrieve = to_raw_response_wrapper( + scorers.retrieve, + ) + self.update = to_raw_response_wrapper( + scorers.update, + ) + self.list = to_raw_response_wrapper( + scorers.list, + ) + self.validate = to_raw_response_wrapper( + scorers.validate, + ) + + +class AsyncScorersResourceWithRawResponse: + def __init__(self, scorers: AsyncScorersResource) -> None: + self._scorers = scorers + + self.create = async_to_raw_response_wrapper( + scorers.create, + ) + self.retrieve = async_to_raw_response_wrapper( + scorers.retrieve, + ) + self.update = async_to_raw_response_wrapper( + scorers.update, + ) + self.list = async_to_raw_response_wrapper( + scorers.list, + ) + self.validate = async_to_raw_response_wrapper( + scorers.validate, + ) + + +class ScorersResourceWithStreamingResponse: + def __init__(self, scorers: ScorersResource) -> None: + self._scorers = scorers + + self.create = to_streamed_response_wrapper( + scorers.create, + ) + self.retrieve = to_streamed_response_wrapper( + scorers.retrieve, + ) + self.update = to_streamed_response_wrapper( + scorers.update, + ) + self.list = to_streamed_response_wrapper( + scorers.list, + ) + self.validate = to_streamed_response_wrapper( + scorers.validate, + ) + + +class AsyncScorersResourceWithStreamingResponse: + def __init__(self, scorers: AsyncScorersResource) -> None: + self._scorers = scorers + + self.create = async_to_streamed_response_wrapper( + scorers.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + scorers.retrieve, + ) + self.update = async_to_streamed_response_wrapper( + scorers.update, + ) + self.list = async_to_streamed_response_wrapper( + scorers.list, + ) + self.validate = async_to_streamed_response_wrapper( + scorers.validate, + ) diff --git a/src/runloop_api_client/types/input_context.py b/src/runloop_api_client/types/input_context.py index 0ca7afafb..5cc697db9 100644 --- a/src/runloop_api_client/types/input_context.py +++ b/src/runloop_api_client/types/input_context.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Optional from .._models import BaseModel @@ -9,3 +10,6 @@ class InputContext(BaseModel): problem_statement: str """The problem statement for the Scenario.""" + + additional_context: Optional[object] = None + """Additional JSON structured input context.""" diff --git a/src/runloop_api_client/types/input_context_param.py b/src/runloop_api_client/types/input_context_param.py index dcea87fa2..7f977ad65 100644 --- a/src/runloop_api_client/types/input_context_param.py +++ b/src/runloop_api_client/types/input_context_param.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, TypedDict __all__ = ["InputContextParam"] @@ -10,3 +11,6 @@ class InputContextParam(TypedDict, total=False): problem_statement: Required[str] """The problem statement for the Scenario.""" + + additional_context: Optional[object] + """Additional JSON structured input context.""" diff --git a/src/runloop_api_client/types/scenarios/__init__.py b/src/runloop_api_client/types/scenarios/__init__.py index 4bc4e1112..d25c85c4e 100644 --- a/src/runloop_api_client/types/scenarios/__init__.py +++ b/src/runloop_api_client/types/scenarios/__init__.py @@ -3,3 +3,12 @@ from __future__ import annotations from .run_list_params import RunListParams as RunListParams +from .scorer_list_params import ScorerListParams as ScorerListParams +from .scorer_create_params import ScorerCreateParams as ScorerCreateParams +from .scorer_list_response import ScorerListResponse as ScorerListResponse +from .scorer_update_params import ScorerUpdateParams as ScorerUpdateParams +from .scorer_create_response import ScorerCreateResponse as ScorerCreateResponse +from .scorer_update_response import ScorerUpdateResponse as ScorerUpdateResponse +from .scorer_validate_params import ScorerValidateParams as ScorerValidateParams +from .scorer_retrieve_response import ScorerRetrieveResponse as ScorerRetrieveResponse +from .scorer_validate_response import ScorerValidateResponse as ScorerValidateResponse diff --git a/src/runloop_api_client/types/scenarios/scorer_create_params.py b/src/runloop_api_client/types/scenarios/scorer_create_params.py new file mode 100644 index 000000000..8261dff54 --- /dev/null +++ b/src/runloop_api_client/types/scenarios/scorer_create_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["ScorerCreateParams"] + + +class ScorerCreateParams(TypedDict, total=False): + bash_script: Required[str] + """ + Bash script for the custom scorer taking context as a json object + $RL_TEST_CONTEXT. + """ + + name: Required[str] + """Name of the custom scorer.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_create_response.py b/src/runloop_api_client/types/scenarios/scorer_create_response.py new file mode 100644 index 000000000..8c9adf293 --- /dev/null +++ b/src/runloop_api_client/types/scenarios/scorer_create_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["ScorerCreateResponse"] + + +class ScorerCreateResponse(BaseModel): + id: str + """ID for the scenario scorer.""" + + bash_script: str + """Bash script that takes in $RL_TEST_CONTEXT as env variable and runs scoring.""" + + name: str + """Name of the scenario scorer.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_list_params.py b/src/runloop_api_client/types/scenarios/scorer_list_params.py new file mode 100644 index 000000000..0577a327e --- /dev/null +++ b/src/runloop_api_client/types/scenarios/scorer_list_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["ScorerListParams"] + + +class ScorerListParams(TypedDict, total=False): + limit: int + """The limit of items to return. Default is 20.""" + + starting_after: str + """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_list_response.py b/src/runloop_api_client/types/scenarios/scorer_list_response.py new file mode 100644 index 000000000..59f7adc40 --- /dev/null +++ b/src/runloop_api_client/types/scenarios/scorer_list_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["ScorerListResponse"] + + +class ScorerListResponse(BaseModel): + id: str + """ID for the scenario scorer.""" + + bash_script: str + """Bash script that takes in $RL_TEST_CONTEXT as env variable and runs scoring.""" + + name: str + """Name of the scenario scorer.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_retrieve_response.py b/src/runloop_api_client/types/scenarios/scorer_retrieve_response.py new file mode 100644 index 000000000..25ab5b1d6 --- /dev/null +++ b/src/runloop_api_client/types/scenarios/scorer_retrieve_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["ScorerRetrieveResponse"] + + +class ScorerRetrieveResponse(BaseModel): + id: str + """ID for the scenario scorer.""" + + bash_script: str + """Bash script that takes in $RL_TEST_CONTEXT as env variable and runs scoring.""" + + name: str + """Name of the scenario scorer.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_update_params.py b/src/runloop_api_client/types/scenarios/scorer_update_params.py new file mode 100644 index 000000000..bff2e81c0 --- /dev/null +++ b/src/runloop_api_client/types/scenarios/scorer_update_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["ScorerUpdateParams"] + + +class ScorerUpdateParams(TypedDict, total=False): + bash_script: Required[str] + """ + Bash script for the custom scorer taking context as a json object + $RL_TEST_CONTEXT. + """ + + name: Required[str] + """Name of the custom scorer.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_update_response.py b/src/runloop_api_client/types/scenarios/scorer_update_response.py new file mode 100644 index 000000000..72c6dce78 --- /dev/null +++ b/src/runloop_api_client/types/scenarios/scorer_update_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + + +from ..._models import BaseModel + +__all__ = ["ScorerUpdateResponse"] + + +class ScorerUpdateResponse(BaseModel): + id: str + """ID for the scenario scorer.""" + + bash_script: str + """Bash script that takes in $RL_TEST_CONTEXT as env variable and runs scoring.""" + + name: str + """Name of the scenario scorer.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_validate_params.py b/src/runloop_api_client/types/scenarios/scorer_validate_params.py new file mode 100644 index 000000000..41215ea2d --- /dev/null +++ b/src/runloop_api_client/types/scenarios/scorer_validate_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from ..scenario_environment_param import ScenarioEnvironmentParam + +__all__ = ["ScorerValidateParams"] + + +class ScorerValidateParams(TypedDict, total=False): + scoring_context: Required[object] + """Json context that gets passed to the custom scorer""" + + environment_parameters: ScenarioEnvironmentParam + """The Environment in which the Scenario will run.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_validate_response.py b/src/runloop_api_client/types/scenarios/scorer_validate_response.py new file mode 100644 index 000000000..6c2755e6c --- /dev/null +++ b/src/runloop_api_client/types/scenarios/scorer_validate_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel +from ..scenario_environment import ScenarioEnvironment +from ..scoring_function_result_view import ScoringFunctionResultView + +__all__ = ["ScorerValidateResponse"] + + +class ScorerValidateResponse(BaseModel): + name: str + """Name of the custom scorer.""" + + scoring_context: object + """Json context that gets passed to the custom scorer""" + + scoring_result: ScoringFunctionResultView + """Result of the scoring function.""" + + environment_parameters: Optional[ScenarioEnvironment] = None + """The Environment in which the Scenario will run.""" diff --git a/tests/api_resources/scenarios/test_scorers.py b/tests/api_resources/scenarios/test_scorers.py new file mode 100644 index 000000000..aa0d641e3 --- /dev/null +++ b/tests/api_resources/scenarios/test_scorers.py @@ -0,0 +1,441 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.pagination import SyncScenarioScorersCursorIDPage, AsyncScenarioScorersCursorIDPage +from runloop_api_client.types.scenarios import ( + ScorerListResponse, + ScorerCreateResponse, + ScorerUpdateResponse, + ScorerRetrieveResponse, + ScorerValidateResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestScorers: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Runloop) -> None: + scorer = client.scenarios.scorers.create( + bash_script="bash_script", + name="name", + ) + assert_matches_type(ScorerCreateResponse, scorer, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Runloop) -> None: + response = client.scenarios.scorers.with_raw_response.create( + bash_script="bash_script", + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scorer = response.parse() + assert_matches_type(ScorerCreateResponse, scorer, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Runloop) -> None: + with client.scenarios.scorers.with_streaming_response.create( + bash_script="bash_script", + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scorer = response.parse() + assert_matches_type(ScorerCreateResponse, scorer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + scorer = client.scenarios.scorers.retrieve( + "id", + ) + assert_matches_type(ScorerRetrieveResponse, scorer, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.scenarios.scorers.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scorer = response.parse() + assert_matches_type(ScorerRetrieveResponse, scorer, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.scenarios.scorers.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scorer = response.parse() + assert_matches_type(ScorerRetrieveResponse, scorer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.scenarios.scorers.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_update(self, client: Runloop) -> None: + scorer = client.scenarios.scorers.update( + id="id", + bash_script="bash_script", + name="name", + ) + assert_matches_type(ScorerUpdateResponse, scorer, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Runloop) -> None: + response = client.scenarios.scorers.with_raw_response.update( + id="id", + bash_script="bash_script", + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scorer = response.parse() + assert_matches_type(ScorerUpdateResponse, scorer, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Runloop) -> None: + with client.scenarios.scorers.with_streaming_response.update( + id="id", + bash_script="bash_script", + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scorer = response.parse() + assert_matches_type(ScorerUpdateResponse, scorer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.scenarios.scorers.with_raw_response.update( + id="", + bash_script="bash_script", + name="name", + ) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + scorer = client.scenarios.scorers.list() + assert_matches_type(SyncScenarioScorersCursorIDPage[ScorerListResponse], scorer, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + scorer = client.scenarios.scorers.list( + limit=0, + starting_after="starting_after", + ) + assert_matches_type(SyncScenarioScorersCursorIDPage[ScorerListResponse], scorer, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.scenarios.scorers.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scorer = response.parse() + assert_matches_type(SyncScenarioScorersCursorIDPage[ScorerListResponse], scorer, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.scenarios.scorers.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scorer = response.parse() + assert_matches_type(SyncScenarioScorersCursorIDPage[ScorerListResponse], scorer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_validate(self, client: Runloop) -> None: + scorer = client.scenarios.scorers.validate( + id="id", + scoring_context={}, + ) + assert_matches_type(ScorerValidateResponse, scorer, path=["response"]) + + @parametrize + def test_method_validate_with_all_params(self, client: Runloop) -> None: + scorer = client.scenarios.scorers.validate( + id="id", + scoring_context={}, + environment_parameters={ + "blueprint_id": "blueprint_id", + "prebuilt_id": "prebuilt_id", + "snapshot_id": "snapshot_id", + }, + ) + assert_matches_type(ScorerValidateResponse, scorer, path=["response"]) + + @parametrize + def test_raw_response_validate(self, client: Runloop) -> None: + response = client.scenarios.scorers.with_raw_response.validate( + id="id", + scoring_context={}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scorer = response.parse() + assert_matches_type(ScorerValidateResponse, scorer, path=["response"]) + + @parametrize + def test_streaming_response_validate(self, client: Runloop) -> None: + with client.scenarios.scorers.with_streaming_response.validate( + id="id", + scoring_context={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scorer = response.parse() + assert_matches_type(ScorerValidateResponse, scorer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_validate(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.scenarios.scorers.with_raw_response.validate( + id="", + scoring_context={}, + ) + + +class TestAsyncScorers: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncRunloop) -> None: + scorer = await async_client.scenarios.scorers.create( + bash_script="bash_script", + name="name", + ) + assert_matches_type(ScorerCreateResponse, scorer, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: + response = await async_client.scenarios.scorers.with_raw_response.create( + bash_script="bash_script", + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scorer = await response.parse() + assert_matches_type(ScorerCreateResponse, scorer, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: + async with async_client.scenarios.scorers.with_streaming_response.create( + bash_script="bash_script", + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scorer = await response.parse() + assert_matches_type(ScorerCreateResponse, scorer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + scorer = await async_client.scenarios.scorers.retrieve( + "id", + ) + assert_matches_type(ScorerRetrieveResponse, scorer, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.scenarios.scorers.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scorer = await response.parse() + assert_matches_type(ScorerRetrieveResponse, scorer, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.scenarios.scorers.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scorer = await response.parse() + assert_matches_type(ScorerRetrieveResponse, scorer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.scenarios.scorers.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_update(self, async_client: AsyncRunloop) -> None: + scorer = await async_client.scenarios.scorers.update( + id="id", + bash_script="bash_script", + name="name", + ) + assert_matches_type(ScorerUpdateResponse, scorer, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: + response = await async_client.scenarios.scorers.with_raw_response.update( + id="id", + bash_script="bash_script", + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scorer = await response.parse() + assert_matches_type(ScorerUpdateResponse, scorer, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncRunloop) -> None: + async with async_client.scenarios.scorers.with_streaming_response.update( + id="id", + bash_script="bash_script", + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scorer = await response.parse() + assert_matches_type(ScorerUpdateResponse, scorer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.scenarios.scorers.with_raw_response.update( + id="", + bash_script="bash_script", + name="name", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + scorer = await async_client.scenarios.scorers.list() + assert_matches_type(AsyncScenarioScorersCursorIDPage[ScorerListResponse], scorer, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + scorer = await async_client.scenarios.scorers.list( + limit=0, + starting_after="starting_after", + ) + assert_matches_type(AsyncScenarioScorersCursorIDPage[ScorerListResponse], scorer, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.scenarios.scorers.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scorer = await response.parse() + assert_matches_type(AsyncScenarioScorersCursorIDPage[ScorerListResponse], scorer, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.scenarios.scorers.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scorer = await response.parse() + assert_matches_type(AsyncScenarioScorersCursorIDPage[ScorerListResponse], scorer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_validate(self, async_client: AsyncRunloop) -> None: + scorer = await async_client.scenarios.scorers.validate( + id="id", + scoring_context={}, + ) + assert_matches_type(ScorerValidateResponse, scorer, path=["response"]) + + @parametrize + async def test_method_validate_with_all_params(self, async_client: AsyncRunloop) -> None: + scorer = await async_client.scenarios.scorers.validate( + id="id", + scoring_context={}, + environment_parameters={ + "blueprint_id": "blueprint_id", + "prebuilt_id": "prebuilt_id", + "snapshot_id": "snapshot_id", + }, + ) + assert_matches_type(ScorerValidateResponse, scorer, path=["response"]) + + @parametrize + async def test_raw_response_validate(self, async_client: AsyncRunloop) -> None: + response = await async_client.scenarios.scorers.with_raw_response.validate( + id="id", + scoring_context={}, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scorer = await response.parse() + assert_matches_type(ScorerValidateResponse, scorer, path=["response"]) + + @parametrize + async def test_streaming_response_validate(self, async_client: AsyncRunloop) -> None: + async with async_client.scenarios.scorers.with_streaming_response.validate( + id="id", + scoring_context={}, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scorer = await response.parse() + assert_matches_type(ScorerValidateResponse, scorer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_validate(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.scenarios.scorers.with_raw_response.validate( + id="", + scoring_context={}, + ) diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index e204eb126..64ae41c99 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -40,7 +40,10 @@ def test_method_create(self, client: Runloop) -> None: @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: scenario = client.scenarios.create( - input_context={"problem_statement": "problem_statement"}, + input_context={ + "problem_statement": "problem_statement", + "additional_context": {}, + }, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -270,7 +273,10 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: scenario = await async_client.scenarios.create( - input_context={"problem_statement": "problem_statement"}, + input_context={ + "problem_statement": "problem_statement", + "additional_context": {}, + }, name="name", scoring_contract={ "scoring_function_parameters": [ From b62eadd637327ce733abba1a06a567be56ab237c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 18:35:24 +0000 Subject: [PATCH 652/993] chore(internal): version bump (#527) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e75629345..0c2ecec68 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.19.0" + ".": "0.20.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index fd789f00c..84809bd4b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.19.0" +version = "0.20.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 5b3613c63..8ec13f75d 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.19.0" # x-release-please-version +__version__ = "0.20.0" # x-release-please-version From 2213819c4e341a70c72f0d1f590c7e65314e003f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 20:58:41 +0000 Subject: [PATCH 653/993] feat(api): api update (#528) --- .stats.yml | 2 +- api.md | 10 +-- .../resources/devboxes/lsp.py | 49 +++++++------ .../types/devboxes/__init__.py | 5 ++ .../types/devboxes/base_code_action.py | 2 + .../devboxes/code_action_context_param.py | 9 ++- .../types/devboxes/code_actions_response.py | 13 ++++ .../types/devboxes/code_description_param.py | 8 ++- .../types/devboxes/diagnostic_param.py | 9 ++- .../diagnostic_related_information_param.py | 8 ++- .../types/devboxes/document_symbol.py | 8 ++- .../devboxes/document_symbol_response.py | 26 +++++++ .../devboxes/file_definition_response.py | 10 +++ .../types/devboxes/formatting_response.py | 10 +++ .../types/devboxes/location_param.py | 8 ++- .../devboxes/lsp_apply_code_action_params.py | 2 + .../types/devboxes/position.py | 7 ++ .../types/devboxes/position_param.py | 8 ++- .../types/devboxes/range.py | 7 ++ .../types/devboxes/range_param.py | 8 ++- .../types/devboxes/references_response.py | 10 +++ .../types/devboxes/text_edit.py | 7 ++ .../types/devboxes/text_edit_param.py | 8 ++- tests/api_resources/devboxes/test_lsp.py | 71 ++++++++++--------- 24 files changed, 228 insertions(+), 77 deletions(-) create mode 100644 src/runloop_api_client/types/devboxes/code_actions_response.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol_response.py create mode 100644 src/runloop_api_client/types/devboxes/file_definition_response.py create mode 100644 src/runloop_api_client/types/devboxes/formatting_response.py create mode 100644 src/runloop_api_client/types/devboxes/references_response.py diff --git a/.stats.yml b/.stats.yml index 2b147e2ad..9d22ea0fc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 73 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-00234fd425f75dd0ac33cdfd2b9e806a7fa29638ffc4ed4b91d5042a17ff5cfd.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-76f469266d2a329a84074f63a1e53c27bb78eb39c0585fe7790b082e1758c0c5.yml diff --git a/api.md b/api.md index d06a2dbf7..18f2b224d 100644 --- a/api.md +++ b/api.md @@ -201,18 +201,18 @@ from runloop_api_client.types.devboxes import ( Methods: - client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> object +- client.devboxes.lsp.code_actions(id, \*\*params) -> CodeActionsResponse - client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> object +- client.devboxes.lsp.document_symbols(id, \*\*params) -> DocumentSymbolResponse - client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> object +- client.devboxes.lsp.file_definition(id, \*\*params) -> FileDefinitionResponse - client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> object +- client.devboxes.lsp.formatting(id, \*\*params) -> FormattingResponse - client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse - client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse - client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse - client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> object +- client.devboxes.lsp.references(id, \*\*params) -> ReferencesResponse - client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str ## Logs diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py index 76cdccc74..d1601f207 100644 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -41,11 +41,16 @@ from ...types.devboxes.symbol_type import SymbolType from ...types.devboxes.base_command_param import BaseCommandParam from ...types.devboxes.lsp_files_response import LspFilesResponse +from ...types.devboxes.formatting_response import FormattingResponse +from ...types.devboxes.references_response import ReferencesResponse from ...types.devboxes.diagnostics_response import DiagnosticsResponse from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam +from ...types.devboxes.code_actions_response import CodeActionsResponse from ...types.devboxes.file_contents_response import FileContentsResponse from ...types.devboxes.health_status_response import HealthStatusResponse from ...types.devboxes.signature_help_response import SignatureHelpResponse +from ...types.devboxes.document_symbol_response import DocumentSymbolResponse +from ...types.devboxes.file_definition_response import FileDefinitionResponse from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam from ...types.devboxes.code_action_context_param import CodeActionContextParam from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse @@ -83,6 +88,7 @@ def apply_code_action( command: BaseCommandParam | NotGiven = NOT_GIVEN, edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, is_preferred: bool | NotGiven = NOT_GIVEN, + kind: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -116,6 +122,7 @@ def apply_code_action( "command": command, "edit": edit, "is_preferred": is_preferred, + "kind": kind, }, lsp_apply_code_action_params.LspApplyCodeActionParams, ), @@ -143,7 +150,7 @@ def code_actions( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> object: + ) -> CodeActionsResponse: """Get code actions for a part of a document. This method calls the @@ -203,7 +210,7 @@ def code_actions( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=object, + cast_to=CodeActionsResponse, ) def diagnostics( @@ -260,7 +267,7 @@ def document_symbols( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> object: + ) -> DocumentSymbolResponse: """ Get document symbols for a given document. @@ -287,7 +294,7 @@ def document_symbols( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=object, + cast_to=DocumentSymbolResponse, ) def file( @@ -346,7 +353,7 @@ def file_definition( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> object: + ) -> FileDefinitionResponse: """ Get the definition of a symbol at a given position in a file https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition @@ -381,7 +388,7 @@ def file_definition( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=object, + cast_to=FileDefinitionResponse, ) def files( @@ -429,7 +436,7 @@ def formatting( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> object: + ) -> FormattingResponse: """ Get formatting changes for a given document. https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting @@ -457,7 +464,7 @@ def formatting( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=object, + cast_to=FormattingResponse, ) def get_code_actions_for_diagnostic( @@ -661,7 +668,7 @@ def references( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> object: + ) -> ReferencesResponse: """Get references for a given symbol. This method calls the `getReferences` method @@ -699,7 +706,7 @@ def references( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=object, + cast_to=ReferencesResponse, ) def set_watch_directory( @@ -774,6 +781,7 @@ async def apply_code_action( command: BaseCommandParam | NotGiven = NOT_GIVEN, edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, is_preferred: bool | NotGiven = NOT_GIVEN, + kind: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -807,6 +815,7 @@ async def apply_code_action( "command": command, "edit": edit, "is_preferred": is_preferred, + "kind": kind, }, lsp_apply_code_action_params.LspApplyCodeActionParams, ), @@ -834,7 +843,7 @@ async def code_actions( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> object: + ) -> CodeActionsResponse: """Get code actions for a part of a document. This method calls the @@ -894,7 +903,7 @@ async def code_actions( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=object, + cast_to=CodeActionsResponse, ) async def diagnostics( @@ -951,7 +960,7 @@ async def document_symbols( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> object: + ) -> DocumentSymbolResponse: """ Get document symbols for a given document. @@ -978,7 +987,7 @@ async def document_symbols( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=object, + cast_to=DocumentSymbolResponse, ) async def file( @@ -1037,7 +1046,7 @@ async def file_definition( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> object: + ) -> FileDefinitionResponse: """ Get the definition of a symbol at a given position in a file https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition @@ -1072,7 +1081,7 @@ async def file_definition( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=object, + cast_to=FileDefinitionResponse, ) async def files( @@ -1120,7 +1129,7 @@ async def formatting( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> object: + ) -> FormattingResponse: """ Get formatting changes for a given document. https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting @@ -1148,7 +1157,7 @@ async def formatting( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=object, + cast_to=FormattingResponse, ) async def get_code_actions_for_diagnostic( @@ -1352,7 +1361,7 @@ async def references( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> object: + ) -> ReferencesResponse: """Get references for a given symbol. This method calls the `getReferences` method @@ -1390,7 +1399,7 @@ async def references( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=object, + cast_to=ReferencesResponse, ) async def set_watch_directory( diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 92ea981de..eadbfb1b5 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -39,8 +39,11 @@ from .base_markup_content import BaseMarkupContent as BaseMarkupContent from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity +from .formatting_response import FormattingResponse as FormattingResponse +from .references_response import ReferencesResponse as ReferencesResponse from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam +from .code_actions_response import CodeActionsResponse as CodeActionsResponse from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView from .lsp_formatting_params import LspFormattingParams as LspFormattingParams from .lsp_references_params import LspReferencesParams as LspReferencesParams @@ -53,6 +56,8 @@ from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind +from .document_symbol_response import DocumentSymbolResponse as DocumentSymbolResponse +from .file_definition_response import FileDefinitionResponse as FileDefinitionResponse from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py index d74e9a0f6..163ac4822 100644 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ b/src/runloop_api_client/types/devboxes/base_code_action.py @@ -19,3 +19,5 @@ class BaseCodeAction(BaseModel): edit: Optional[BaseWorkspaceEdit] = None is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) + + kind: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py index df6ee765f..118601394 100644 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -2,8 +2,8 @@ from __future__ import annotations -from typing import List, Iterable -from typing_extensions import Required, Annotated, TypedDict +from typing import Dict, List, Union, Iterable +from typing_extensions import Required, Annotated, TypeAlias, TypedDict from ..._utils import PropertyInfo from .code_action_kind import CodeActionKind @@ -13,7 +13,7 @@ __all__ = ["CodeActionContextParam"] -class CodeActionContextParam(TypedDict, total=False): +class CodeActionContextParamTyped(TypedDict, total=False): diagnostics: Required[Iterable[DiagnosticParam]] """ An array of diagnostics known on the client side overlapping the range provided @@ -32,3 +32,6 @@ class CodeActionContextParam(TypedDict, total=False): trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] """The reason why code actions were requested.""" + + +CodeActionContextParam: TypeAlias = Union[CodeActionContextParamTyped, Dict[str, object]] diff --git a/src/runloop_api_client/types/devboxes/code_actions_response.py b/src/runloop_api_client/types/devboxes/code_actions_response.py new file mode 100644 index 000000000..97aabe75f --- /dev/null +++ b/src/runloop_api_client/types/devboxes/code_actions_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union +from typing_extensions import TypeAlias + +from .base_command import BaseCommand +from .base_code_action import BaseCodeAction + +__all__ = ["CodeActionsResponse", "CodeActionsResponseItem"] + +CodeActionsResponseItem: TypeAlias = Union[BaseCodeAction, BaseCommand] + +CodeActionsResponse: TypeAlias = List[CodeActionsResponseItem] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py index 616f4446f..f41c8f514 100644 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ b/src/runloop_api_client/types/devboxes/code_description_param.py @@ -2,13 +2,17 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing import Dict, Union +from typing_extensions import Required, TypeAlias, TypedDict from .u_ri import URi __all__ = ["CodeDescriptionParam"] -class CodeDescriptionParam(TypedDict, total=False): +class CodeDescriptionParamTyped(TypedDict, total=False): href: Required[URi] """An URI to open with more information about the diagnostic error.""" + + +CodeDescriptionParam: TypeAlias = Union[CodeDescriptionParamTyped, Dict[str, object]] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py index 4ec525ec8..e163b5c83 100644 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ b/src/runloop_api_client/types/devboxes/diagnostic_param.py @@ -2,8 +2,8 @@ from __future__ import annotations -from typing import Union, Iterable -from typing_extensions import Required, Annotated, TypedDict +from typing import Dict, Union, Iterable +from typing_extensions import Required, Annotated, TypeAlias, TypedDict from .integer import Integer from ..._utils import PropertyInfo @@ -17,7 +17,7 @@ __all__ = ["DiagnosticParam"] -class DiagnosticParam(TypedDict, total=False): +class DiagnosticParamTyped(TypedDict, total=False): message: Required[str] """The diagnostic's message. It usually appears in the user interface""" @@ -63,3 +63,6 @@ class DiagnosticParam(TypedDict, total=False): tags: Iterable[DiagnosticTag] """Additional metadata about the diagnostic.""" + + +DiagnosticParam: TypeAlias = Union[DiagnosticParamTyped, Dict[str, object]] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py index 9e902d731..8f654af15 100644 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py @@ -2,16 +2,20 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing import Dict, Union +from typing_extensions import Required, TypeAlias, TypedDict from .location_param import LocationParam __all__ = ["DiagnosticRelatedInformationParam"] -class DiagnosticRelatedInformationParam(TypedDict, total=False): +class DiagnosticRelatedInformationParamTyped(TypedDict, total=False): location: Required[LocationParam] """The location of this related diagnostic information.""" message: Required[str] """The message of this related diagnostic information.""" + + +DiagnosticRelatedInformationParam: TypeAlias = Union[DiagnosticRelatedInformationParamTyped, Dict[str, object]] diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py index 06f8db905..30ca96d6d 100644 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Optional +from typing import TYPE_CHECKING, List, Optional from pydantic import Field as FieldInfo @@ -51,6 +51,12 @@ class DocumentSymbol(BaseModel): tags: Optional[List[SymbolTag]] = None """Tags for this document symbol.""" + if TYPE_CHECKING: + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + if PYDANTIC_V2: DocumentSymbol.model_rebuild() diff --git a/src/runloop_api_client/types/devboxes/document_symbol_response.py b/src/runloop_api_client/types/devboxes/document_symbol_response.py new file mode 100644 index 000000000..afb469589 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol_response.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel +from .base_range import BaseRange +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbolResponse", "DocumentSymbolResponseItem"] + + +class DocumentSymbolResponseItem(BaseModel): + kind: SymbolKind + """A symbol kind.""" + + name: str + + range: BaseRange + + selection_range: BaseRange = FieldInfo(alias="selectionRange") + + +DocumentSymbolResponse: TypeAlias = List[DocumentSymbolResponseItem] diff --git a/src/runloop_api_client/types/devboxes/file_definition_response.py b/src/runloop_api_client/types/devboxes/file_definition_response.py new file mode 100644 index 000000000..11d40a035 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_definition_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_location import BaseLocation + +__all__ = ["FileDefinitionResponse"] + +FileDefinitionResponse: TypeAlias = List[BaseLocation] diff --git a/src/runloop_api_client/types/devboxes/formatting_response.py b/src/runloop_api_client/types/devboxes/formatting_response.py new file mode 100644 index 000000000..4802ebcc2 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/formatting_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .text_edit import TextEdit + +__all__ = ["FormattingResponse"] + +FormattingResponse: TypeAlias = List[TextEdit] diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py index e2deae54b..22443458e 100644 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ b/src/runloop_api_client/types/devboxes/location_param.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing import Dict, Union +from typing_extensions import Required, TypeAlias, TypedDict from .range_param import RangeParam from .document_uri import DocumentUri @@ -10,7 +11,7 @@ __all__ = ["LocationParam"] -class LocationParam(TypedDict, total=False): +class LocationParamTyped(TypedDict, total=False): range: Required[RangeParam] """A range in a text document expressed as (zero-based) start and end positions. @@ -31,3 +32,6 @@ class LocationParam(TypedDict, total=False): uri: Required[DocumentUri] """A tagging type for string properties that are actually document URIs.""" + + +LocationParam: TypeAlias = Union[LocationParamTyped, Dict[str, object]] diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py index 1ab3b23d5..533006b14 100644 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py @@ -19,3 +19,5 @@ class LspApplyCodeActionParams(TypedDict, total=False): edit: BaseWorkspaceEditParam is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] + + kind: str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py index 8ae66b6ad..411f291c1 100644 --- a/src/runloop_api_client/types/devboxes/position.py +++ b/src/runloop_api_client/types/devboxes/position.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import TYPE_CHECKING from .uinteger import Uinteger from ..._models import BaseModel @@ -25,3 +26,9 @@ class Position(BaseModel): back to the number of lines in the document. If a line number is negative, it defaults to 0. """ + + if TYPE_CHECKING: + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py index 0afee2ba3..65432122a 100644 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ b/src/runloop_api_client/types/devboxes/position_param.py @@ -2,14 +2,15 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing import Dict, Union +from typing_extensions import Required, TypeAlias, TypedDict from .uinteger import Uinteger __all__ = ["PositionParam"] -class PositionParam(TypedDict, total=False): +class PositionParamTyped(TypedDict, total=False): character: Required[Uinteger] """Character offset on a line in a document (zero-based). @@ -27,3 +28,6 @@ class PositionParam(TypedDict, total=False): back to the number of lines in the document. If a line number is negative, it defaults to 0. """ + + +PositionParam: TypeAlias = Union[PositionParamTyped, Dict[str, object]] diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py index c9eaf78a6..9be6adb56 100644 --- a/src/runloop_api_client/types/devboxes/range.py +++ b/src/runloop_api_client/types/devboxes/range.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import TYPE_CHECKING from .position import Position from ..._models import BaseModel @@ -13,3 +14,9 @@ class Range(BaseModel): start: Position """The range's start position.""" + + if TYPE_CHECKING: + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py index 87a516655..2f267a048 100644 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ b/src/runloop_api_client/types/devboxes/range_param.py @@ -2,16 +2,20 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing import Dict, Union +from typing_extensions import Required, TypeAlias, TypedDict from .position_param import PositionParam __all__ = ["RangeParam"] -class RangeParam(TypedDict, total=False): +class RangeParamTyped(TypedDict, total=False): end: Required[PositionParam] """The range's end position.""" start: Required[PositionParam] """The range's start position.""" + + +RangeParam: TypeAlias = Union[RangeParamTyped, Dict[str, object]] diff --git a/src/runloop_api_client/types/devboxes/references_response.py b/src/runloop_api_client/types/devboxes/references_response.py new file mode 100644 index 000000000..59fc2d3de --- /dev/null +++ b/src/runloop_api_client/types/devboxes/references_response.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .base_location import BaseLocation + +__all__ = ["ReferencesResponse"] + +ReferencesResponse: TypeAlias = List[BaseLocation] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py index e91fde3ff..30826edbc 100644 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import TYPE_CHECKING from pydantic import Field as FieldInfo @@ -18,3 +19,9 @@ class TextEdit(BaseModel): To insert text into a document create a range where start === end. """ + + if TYPE_CHECKING: + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py index 882a423c6..f0d710195 100644 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ b/src/runloop_api_client/types/devboxes/text_edit_param.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing_extensions import Required, Annotated, TypedDict +from typing import Dict, Union +from typing_extensions import Required, Annotated, TypeAlias, TypedDict from ..._utils import PropertyInfo from .range_param import RangeParam @@ -10,7 +11,7 @@ __all__ = ["TextEditParam"] -class TextEditParam(TypedDict, total=False): +class TextEditParamTyped(TypedDict, total=False): new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] """The string to be inserted. For delete operations use an empty string.""" @@ -19,3 +20,6 @@ class TextEditParam(TypedDict, total=False): To insert text into a document create a range where start === end. """ + + +TextEditParam: TypeAlias = Union[TextEditParamTyped, Dict[str, object]] diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py index 05e7f4b2c..c23afde06 100644 --- a/tests/api_resources/devboxes/test_lsp.py +++ b/tests/api_resources/devboxes/test_lsp.py @@ -11,10 +11,15 @@ from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types.devboxes import ( LspFilesResponse, + FormattingResponse, + ReferencesResponse, + CodeActionsResponse, DiagnosticsResponse, FileContentsResponse, HealthStatusResponse, SignatureHelpResponse, + DocumentSymbolResponse, + FileDefinitionResponse, CodeSegmentInfoResponse, CodeActionApplicationResult, LspGetCodeActionsForDiagnosticResponse, @@ -64,6 +69,7 @@ def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None } }, is_preferred=True, + kind="kind", ) assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) @@ -107,7 +113,7 @@ def test_method_code_actions(self, client: Runloop) -> None: id="id", uri="uri", ) - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(CodeActionsResponse, lsp, path=["response"]) @parametrize def test_method_code_actions_with_all_params(self, client: Runloop) -> None: @@ -168,7 +174,7 @@ def test_method_code_actions_with_all_params(self, client: Runloop) -> None: }, }, ) - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(CodeActionsResponse, lsp, path=["response"]) @parametrize def test_raw_response_code_actions(self, client: Runloop) -> None: @@ -180,7 +186,7 @@ def test_raw_response_code_actions(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(CodeActionsResponse, lsp, path=["response"]) @parametrize def test_streaming_response_code_actions(self, client: Runloop) -> None: @@ -192,7 +198,7 @@ def test_streaming_response_code_actions(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(CodeActionsResponse, lsp, path=["response"]) assert cast(Any, response.is_closed) is True @@ -252,7 +258,7 @@ def test_method_document_symbols(self, client: Runloop) -> None: id="id", uri="string", ) - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(DocumentSymbolResponse, lsp, path=["response"]) @parametrize def test_raw_response_document_symbols(self, client: Runloop) -> None: @@ -264,7 +270,7 @@ def test_raw_response_document_symbols(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(DocumentSymbolResponse, lsp, path=["response"]) @parametrize def test_streaming_response_document_symbols(self, client: Runloop) -> None: @@ -276,7 +282,7 @@ def test_streaming_response_document_symbols(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(DocumentSymbolResponse, lsp, path=["response"]) assert cast(Any, response.is_closed) is True @@ -338,7 +344,7 @@ def test_method_file_definition(self, client: Runloop) -> None: line=0, uri="uri", ) - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(FileDefinitionResponse, lsp, path=["response"]) @parametrize def test_raw_response_file_definition(self, client: Runloop) -> None: @@ -352,7 +358,7 @@ def test_raw_response_file_definition(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(FileDefinitionResponse, lsp, path=["response"]) @parametrize def test_streaming_response_file_definition(self, client: Runloop) -> None: @@ -366,7 +372,7 @@ def test_streaming_response_file_definition(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(FileDefinitionResponse, lsp, path=["response"]) assert cast(Any, response.is_closed) is True @@ -424,7 +430,7 @@ def test_method_formatting(self, client: Runloop) -> None: id="id", uri="string", ) - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(FormattingResponse, lsp, path=["response"]) @parametrize def test_raw_response_formatting(self, client: Runloop) -> None: @@ -436,7 +442,7 @@ def test_raw_response_formatting(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(FormattingResponse, lsp, path=["response"]) @parametrize def test_streaming_response_formatting(self, client: Runloop) -> None: @@ -448,7 +454,7 @@ def test_streaming_response_formatting(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(FormattingResponse, lsp, path=["response"]) assert cast(Any, response.is_closed) is True @@ -730,7 +736,7 @@ def test_method_references(self, client: Runloop) -> None: line=0, uri="uri", ) - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(ReferencesResponse, lsp, path=["response"]) @parametrize def test_raw_response_references(self, client: Runloop) -> None: @@ -744,7 +750,7 @@ def test_raw_response_references(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(ReferencesResponse, lsp, path=["response"]) @parametrize def test_streaming_response_references(self, client: Runloop) -> None: @@ -758,7 +764,7 @@ def test_streaming_response_references(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" lsp = response.parse() - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(ReferencesResponse, lsp, path=["response"]) assert cast(Any, response.is_closed) is True @@ -856,6 +862,7 @@ async def test_method_apply_code_action_with_all_params(self, async_client: Asyn } }, is_preferred=True, + kind="kind", ) assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) @@ -899,7 +906,7 @@ async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: id="id", uri="uri", ) - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(CodeActionsResponse, lsp, path=["response"]) @parametrize async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -960,7 +967,7 @@ async def test_method_code_actions_with_all_params(self, async_client: AsyncRunl }, }, ) - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(CodeActionsResponse, lsp, path=["response"]) @parametrize async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: @@ -972,7 +979,7 @@ async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> No assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(CodeActionsResponse, lsp, path=["response"]) @parametrize async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: @@ -984,7 +991,7 @@ async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) assert response.http_request.headers.get("X-Stainless-Lang") == "python" lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(CodeActionsResponse, lsp, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1044,7 +1051,7 @@ async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None id="id", uri="string", ) - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(DocumentSymbolResponse, lsp, path=["response"]) @parametrize async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: @@ -1056,7 +1063,7 @@ async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) - assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(DocumentSymbolResponse, lsp, path=["response"]) @parametrize async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: @@ -1068,7 +1075,7 @@ async def test_streaming_response_document_symbols(self, async_client: AsyncRunl assert response.http_request.headers.get("X-Stainless-Lang") == "python" lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(DocumentSymbolResponse, lsp, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1130,7 +1137,7 @@ async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: line=0, uri="uri", ) - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(FileDefinitionResponse, lsp, path=["response"]) @parametrize async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: @@ -1144,7 +1151,7 @@ async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(FileDefinitionResponse, lsp, path=["response"]) @parametrize async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: @@ -1158,7 +1165,7 @@ async def test_streaming_response_file_definition(self, async_client: AsyncRunlo assert response.http_request.headers.get("X-Stainless-Lang") == "python" lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(FileDefinitionResponse, lsp, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1216,7 +1223,7 @@ async def test_method_formatting(self, async_client: AsyncRunloop) -> None: id="id", uri="string", ) - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(FormattingResponse, lsp, path=["response"]) @parametrize async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: @@ -1228,7 +1235,7 @@ async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(FormattingResponse, lsp, path=["response"]) @parametrize async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: @@ -1240,7 +1247,7 @@ async def test_streaming_response_formatting(self, async_client: AsyncRunloop) - assert response.http_request.headers.get("X-Stainless-Lang") == "python" lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(FormattingResponse, lsp, path=["response"]) assert cast(Any, response.is_closed) is True @@ -1522,7 +1529,7 @@ async def test_method_references(self, async_client: AsyncRunloop) -> None: line=0, uri="uri", ) - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(ReferencesResponse, lsp, path=["response"]) @parametrize async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: @@ -1536,7 +1543,7 @@ async def test_raw_response_references(self, async_client: AsyncRunloop) -> None assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(ReferencesResponse, lsp, path=["response"]) @parametrize async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: @@ -1550,7 +1557,7 @@ async def test_streaming_response_references(self, async_client: AsyncRunloop) - assert response.http_request.headers.get("X-Stainless-Lang") == "python" lsp = await response.parse() - assert_matches_type(object, lsp, path=["response"]) + assert_matches_type(ReferencesResponse, lsp, path=["response"]) assert cast(Any, response.is_closed) is True From 9615a7c080ce7808bc4d4fea69819656a2ce8441 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 21:15:04 +0000 Subject: [PATCH 654/993] chore(internal): version bump (#530) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0c2ecec68..86b0e83d7 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.20.0" + ".": "0.21.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 84809bd4b..e42d7d556 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.20.0" +version = "0.21.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 8ec13f75d..bd2ebaed5 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.20.0" # x-release-please-version +__version__ = "0.21.0" # x-release-please-version From 07cf01b532941e436a6b1d9cb67a91a61cd3b7ad Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 21:53:40 +0000 Subject: [PATCH 655/993] feat(api): api update (#531) --- .stats.yml | 2 +- api.md | 2 +- .../resources/devboxes/browsers.py | 37 +++++++++++++++++++ .../resources/devboxes/computers.py | 18 ++++++++- src/runloop_api_client/types/devbox_view.py | 2 +- .../types/devboxes/__init__.py | 1 + .../types/devboxes/browser_create_params.py | 13 +++++++ .../types/devboxes/computer_create_params.py | 3 ++ tests/api_resources/devboxes/test_browsers.py | 14 +++++++ .../api_resources/devboxes/test_computers.py | 2 + 10 files changed, 89 insertions(+), 5 deletions(-) create mode 100644 src/runloop_api_client/types/devboxes/browser_create_params.py diff --git a/.stats.yml b/.stats.yml index 9d22ea0fc..abd9dea86 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 73 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-76f469266d2a329a84074f63a1e53c27bb78eb39c0585fe7790b082e1758c0c5.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a6925284ea7678ed801dbaf6b5c60676b97ab7a16191c1b2ff8ef6a468e89f3b.yml diff --git a/api.md b/api.md index 18f2b224d..0595502d6 100644 --- a/api.md +++ b/api.md @@ -111,7 +111,7 @@ from runloop_api_client.types.devboxes import BrowserView Methods: -- client.devboxes.browsers.create() -> BrowserView +- client.devboxes.browsers.create(\*\*params) -> BrowserView ## Computers diff --git a/src/runloop_api_client/resources/devboxes/browsers.py b/src/runloop_api_client/resources/devboxes/browsers.py index 59d264bcc..d59cbcd4d 100644 --- a/src/runloop_api_client/resources/devboxes/browsers.py +++ b/src/runloop_api_client/resources/devboxes/browsers.py @@ -2,9 +2,15 @@ from __future__ import annotations +from typing import Optional + import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -14,6 +20,7 @@ async_to_streamed_response_wrapper, ) from ..._base_client import make_request_options +from ...types.devboxes import browser_create_params from ...types.devboxes.browser_view import BrowserView __all__ = ["BrowsersResource", "AsyncBrowsersResource"] @@ -42,6 +49,7 @@ def with_streaming_response(self) -> BrowsersResourceWithStreamingResponse: def create( self, *, + name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -55,9 +63,23 @@ def create( As part of booting the Devbox, the browser will automatically be started with connection utilities activated. + + Args: + name: The name to use for the created Devbox with a Browser. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return self._post( "/v1/devboxes/browsers", + body=maybe_transform({"name": name}, browser_create_params.BrowserCreateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -92,6 +114,7 @@ def with_streaming_response(self) -> AsyncBrowsersResourceWithStreamingResponse: async def create( self, *, + name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -105,9 +128,23 @@ async def create( As part of booting the Devbox, the browser will automatically be started with connection utilities activated. + + Args: + name: The name to use for the created Devbox with a Browser. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return await self._post( "/v1/devboxes/browsers", + body=await async_maybe_transform({"name": name}, browser_create_params.BrowserCreateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/runloop_api_client/resources/devboxes/computers.py b/src/runloop_api_client/resources/devboxes/computers.py index c10791302..b34697390 100644 --- a/src/runloop_api_client/resources/devboxes/computers.py +++ b/src/runloop_api_client/resources/devboxes/computers.py @@ -59,6 +59,7 @@ def create( self, *, display_dimensions: Optional[computer_create_params.DisplayDimensions] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -78,6 +79,8 @@ def create( Args: display_dimensions: Customize the dimensions of the computer display. + name: The name to use for the created computer. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -91,7 +94,11 @@ def create( return self._post( "/v1/devboxes/computers", body=maybe_transform( - {"display_dimensions": display_dimensions}, computer_create_params.ComputerCreateParams + { + "display_dimensions": display_dimensions, + "name": name, + }, + computer_create_params.ComputerCreateParams, ), options=make_request_options( extra_headers=extra_headers, @@ -285,6 +292,7 @@ async def create( self, *, display_dimensions: Optional[computer_create_params.DisplayDimensions] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -304,6 +312,8 @@ async def create( Args: display_dimensions: Customize the dimensions of the computer display. + name: The name to use for the created computer. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -317,7 +327,11 @@ async def create( return await self._post( "/v1/devboxes/computers", body=await async_maybe_transform( - {"display_dimensions": display_dimensions}, computer_create_params.ComputerCreateParams + { + "display_dimensions": display_dimensions, + "name": name, + }, + computer_create_params.ComputerCreateParams, ), options=make_request_options( extra_headers=extra_headers, diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index f645afde6..0a056748e 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -13,7 +13,7 @@ class DevboxView(BaseModel): id: str """The ID of the Devbox.""" - capabilities: List[Literal["unknown", "computer_usage", "browser_usage"]] + capabilities: List[Literal["unknown", "computer_usage", "browser_usage", "language_server"]] """A list of capability groups this devbox has access to. This allows devboxes to be compatible with certain tools sets like computer diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index eadbfb1b5..6ec9bf85f 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -43,6 +43,7 @@ from .references_response import ReferencesResponse as ReferencesResponse from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam +from .browser_create_params import BrowserCreateParams as BrowserCreateParams from .code_actions_response import CodeActionsResponse as CodeActionsResponse from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView from .lsp_formatting_params import LspFormattingParams as LspFormattingParams diff --git a/src/runloop_api_client/types/devboxes/browser_create_params.py b/src/runloop_api_client/types/devboxes/browser_create_params.py new file mode 100644 index 000000000..523b03be0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/browser_create_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import TypedDict + +__all__ = ["BrowserCreateParams"] + + +class BrowserCreateParams(TypedDict, total=False): + name: Optional[str] + """The name to use for the created Devbox with a Browser.""" diff --git a/src/runloop_api_client/types/devboxes/computer_create_params.py b/src/runloop_api_client/types/devboxes/computer_create_params.py index 15c00cff0..febd5aef5 100644 --- a/src/runloop_api_client/types/devboxes/computer_create_params.py +++ b/src/runloop_api_client/types/devboxes/computer_create_params.py @@ -12,6 +12,9 @@ class ComputerCreateParams(TypedDict, total=False): display_dimensions: Optional[DisplayDimensions] """Customize the dimensions of the computer display.""" + name: Optional[str] + """The name to use for the created computer.""" + class DisplayDimensions(TypedDict, total=False): display_height_px: Required[int] diff --git a/tests/api_resources/devboxes/test_browsers.py b/tests/api_resources/devboxes/test_browsers.py index 9b1a51a2b..2bdbd823a 100644 --- a/tests/api_resources/devboxes/test_browsers.py +++ b/tests/api_resources/devboxes/test_browsers.py @@ -22,6 +22,13 @@ def test_method_create(self, client: Runloop) -> None: browser = client.devboxes.browsers.create() assert_matches_type(BrowserView, browser, path=["response"]) + @parametrize + def test_method_create_with_all_params(self, client: Runloop) -> None: + browser = client.devboxes.browsers.create( + name="name", + ) + assert_matches_type(BrowserView, browser, path=["response"]) + @parametrize def test_raw_response_create(self, client: Runloop) -> None: response = client.devboxes.browsers.with_raw_response.create() @@ -51,6 +58,13 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: browser = await async_client.devboxes.browsers.create() assert_matches_type(BrowserView, browser, path=["response"]) + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: + browser = await async_client.devboxes.browsers.create( + name="name", + ) + assert_matches_type(BrowserView, browser, path=["response"]) + @parametrize async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.browsers.with_raw_response.create() diff --git a/tests/api_resources/devboxes/test_computers.py b/tests/api_resources/devboxes/test_computers.py index 09b08358a..a388926b6 100644 --- a/tests/api_resources/devboxes/test_computers.py +++ b/tests/api_resources/devboxes/test_computers.py @@ -34,6 +34,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "display_height_px": 0, "display_width_px": 0, }, + name="name", ) assert_matches_type(ComputerView, computer, path=["response"]) @@ -220,6 +221,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "display_height_px": 0, "display_width_px": 0, }, + name="name", ) assert_matches_type(ComputerView, computer, path=["response"]) From 882d6872de2fc3c243808860787aa8e36f88a233 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 22:35:16 +0000 Subject: [PATCH 656/993] chore(internal): version bump (#533) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 86b0e83d7..cb9d2541c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.21.0" + ".": "0.22.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index e42d7d556..369c275c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.21.0" +version = "0.22.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index bd2ebaed5..c524a520b 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.21.0" # x-release-please-version +__version__ = "0.22.0" # x-release-please-version From 5739708346e2381d01d130f3f38b7fccc31781a3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 21:10:56 +0000 Subject: [PATCH 657/993] fix(api): remove recursive model for now (#534) --- api.md | 1 - .../types/devboxes/__init__.py | 1 - .../devboxes/code_segment_info_response.py | 65 ++++++++++++++----- .../types/devboxes/document_symbol.py | 64 ------------------ 4 files changed, 50 insertions(+), 81 deletions(-) delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py diff --git a/api.md b/api.md index 0595502d6..286bbffde 100644 --- a/api.md +++ b/api.md @@ -163,7 +163,6 @@ from runloop_api_client.types.devboxes import ( DiagnosticSeverity, DiagnosticsResponse, DiagnosticTag, - DocumentSymbol, DocumentSymbolResponse, DocumentUri, FileContentsResponse, diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 6ec9bf85f..66e9530ef 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -26,7 +26,6 @@ from .location_param import LocationParam as LocationParam from .position_param import PositionParam as PositionParam from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams from .lsp_file_params import LspFileParams as LspFileParams from .text_edit_param import TextEditParam as TextEditParam diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py index aa0641872..dbc01bdf3 100644 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -1,19 +1,64 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from __future__ import annotations +from typing import TYPE_CHECKING, List, Optional -from typing import List, Optional +from pydantic import Field as FieldInfo +from .range import Range from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 from ..._models import BaseModel from .base_range import BaseRange +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind from .base_location import BaseLocation from .base_diagnostic import BaseDiagnostic from .base_code_action import BaseCodeAction from .signature_help_response import SignatureHelpResponse -__all__ = ["CodeSegmentInfoResponse", "Hover"] +__all__ = ["CodeSegmentInfoResponse", "Symbol", "Hover"] + + +class Symbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List[object]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + if TYPE_CHECKING: + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... class Hover(BaseModel): @@ -29,7 +74,7 @@ class CodeSegmentInfoResponse(BaseModel): references: List[BaseLocation] - symbol: "DocumentSymbol" + symbol: Symbol """ Represents programming constructs like variables, classes, interfaces etc. that appear in a document. Document symbols can be hierarchical and they have two @@ -42,13 +87,3 @@ class CodeSegmentInfoResponse(BaseModel): hover: Optional[Hover] = None signature: Optional[SignatureHelpResponse] = None - - -from .document_symbol import DocumentSymbol - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 30ca96d6d..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,64 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import TYPE_CHECKING, List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._compat import PYDANTIC_V2 -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List["DocumentSymbol"]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - if TYPE_CHECKING: - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore From 9335f65ce772903674ebcc3d86de0cc7c022a239 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 03:49:33 +0000 Subject: [PATCH 658/993] feat(client): send `X-Stainless-Read-Timeout` header (#536) --- src/runloop_api_client/_base_client.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index bd82fb93e..22e3bc630 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -418,10 +418,17 @@ def _build_headers(self, options: FinalRequestOptions, *, retries_taken: int = 0 if idempotency_header and options.method.lower() != "get" and idempotency_header not in headers: headers[idempotency_header] = options.idempotency_key or self._idempotency_key() - # Don't set the retry count header if it was already set or removed by the caller. We check + # Don't set these headers if they were already set or removed by the caller. We check # `custom_headers`, which can contain `Omit()`, instead of `headers` to account for the removal case. - if "x-stainless-retry-count" not in (header.lower() for header in custom_headers): + lower_custom_headers = [header.lower() for header in custom_headers] + if "x-stainless-retry-count" not in lower_custom_headers: headers["x-stainless-retry-count"] = str(retries_taken) + if "x-stainless-read-timeout" not in lower_custom_headers: + timeout = self.timeout if isinstance(options.timeout, NotGiven) else options.timeout + if isinstance(timeout, Timeout): + timeout = timeout.read + if timeout is not None: + headers["x-stainless-read-timeout"] = str(timeout) return headers From 954b89ed60f15398d7e70421f3a7744fddfb72a3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2025 03:33:33 +0000 Subject: [PATCH 659/993] chore(internal): fix type traversing dictionary params (#537) --- src/runloop_api_client/_utils/_transform.py | 12 +++++++++++- tests/test_transform.py | 11 ++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/runloop_api_client/_utils/_transform.py b/src/runloop_api_client/_utils/_transform.py index a6b62cad0..18afd9d8b 100644 --- a/src/runloop_api_client/_utils/_transform.py +++ b/src/runloop_api_client/_utils/_transform.py @@ -25,7 +25,7 @@ is_annotated_type, strip_annotated_type, ) -from .._compat import model_dump, is_typeddict +from .._compat import get_origin, model_dump, is_typeddict _T = TypeVar("_T") @@ -164,9 +164,14 @@ def _transform_recursive( inner_type = annotation stripped_type = strip_annotated_type(inner_type) + origin = get_origin(stripped_type) or stripped_type if is_typeddict(stripped_type) and is_mapping(data): return _transform_typeddict(data, stripped_type) + if origin == dict and is_mapping(data): + items_type = get_args(stripped_type)[1] + return {key: _transform_recursive(value, annotation=items_type) for key, value in data.items()} + if ( # List[T] (is_list_type(stripped_type) and is_list(data)) @@ -307,9 +312,14 @@ async def _async_transform_recursive( inner_type = annotation stripped_type = strip_annotated_type(inner_type) + origin = get_origin(stripped_type) or stripped_type if is_typeddict(stripped_type) and is_mapping(data): return await _async_transform_typeddict(data, stripped_type) + if origin == dict and is_mapping(data): + items_type = get_args(stripped_type)[1] + return {key: _transform_recursive(value, annotation=items_type) for key, value in data.items()} + if ( # List[T] (is_list_type(stripped_type) and is_list(data)) diff --git a/tests/test_transform.py b/tests/test_transform.py index 839b59a76..f30ab41ee 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -2,7 +2,7 @@ import io import pathlib -from typing import Any, List, Union, TypeVar, Iterable, Optional, cast +from typing import Any, Dict, List, Union, TypeVar, Iterable, Optional, cast from datetime import date, datetime from typing_extensions import Required, Annotated, TypedDict @@ -388,6 +388,15 @@ def my_iter() -> Iterable[Baz8]: } +@parametrize +@pytest.mark.asyncio +async def test_dictionary_items(use_async: bool) -> None: + class DictItems(TypedDict): + foo_baz: Annotated[str, PropertyInfo(alias="fooBaz")] + + assert await transform({"foo": {"foo_baz": "bar"}}, Dict[str, DictItems], use_async) == {"foo": {"fooBaz": "bar"}} + + class TypedDictIterableUnionStr(TypedDict): foo: Annotated[Union[str, Iterable[Baz8]], PropertyInfo(alias="FOO")] From 6e253f06e355038e92e501bbabb7836f4ca37e15 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2025 03:35:32 +0000 Subject: [PATCH 660/993] chore(internal): codegen related update (#538) --- src/runloop_api_client/pagination.py | 144 +++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) diff --git a/src/runloop_api_client/pagination.py b/src/runloop_api_client/pagination.py index f2b918ab9..eb5d5653f 100644 --- a/src/runloop_api_client/pagination.py +++ b/src/runloop_api_client/pagination.py @@ -86,6 +86,14 @@ def _get_page_items(self) -> List[_T]: return [] return blueprints + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + @override def next_page_info(self) -> Optional[PageInfo]: blueprints = self.blueprints @@ -112,6 +120,14 @@ def _get_page_items(self) -> List[_T]: return [] return blueprints + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + @override def next_page_info(self) -> Optional[PageInfo]: blueprints = self.blueprints @@ -138,6 +154,14 @@ def _get_page_items(self) -> List[_T]: return [] return devboxes + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + @override def next_page_info(self) -> Optional[PageInfo]: devboxes = self.devboxes @@ -164,6 +188,14 @@ def _get_page_items(self) -> List[_T]: return [] return devboxes + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + @override def next_page_info(self) -> Optional[PageInfo]: devboxes = self.devboxes @@ -190,6 +222,14 @@ def _get_page_items(self) -> List[_T]: return [] return repositories + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + @override def next_page_info(self) -> Optional[PageInfo]: repositories = self.repositories @@ -216,6 +256,14 @@ def _get_page_items(self) -> List[_T]: return [] return repositories + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + @override def next_page_info(self) -> Optional[PageInfo]: repositories = self.repositories @@ -242,6 +290,14 @@ def _get_page_items(self) -> List[_T]: return [] return snapshots + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + @override def next_page_info(self) -> Optional[PageInfo]: snapshots = self.snapshots @@ -268,6 +324,14 @@ def _get_page_items(self) -> List[_T]: return [] return snapshots + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + @override def next_page_info(self) -> Optional[PageInfo]: snapshots = self.snapshots @@ -294,6 +358,14 @@ def _get_page_items(self) -> List[_T]: return [] return benchmarks + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + @override def next_page_info(self) -> Optional[PageInfo]: benchmarks = self.benchmarks @@ -320,6 +392,14 @@ def _get_page_items(self) -> List[_T]: return [] return benchmarks + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + @override def next_page_info(self) -> Optional[PageInfo]: benchmarks = self.benchmarks @@ -346,6 +426,14 @@ def _get_page_items(self) -> List[_T]: return [] return runs + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + @override def next_page_info(self) -> Optional[PageInfo]: runs = self.runs @@ -372,6 +460,14 @@ def _get_page_items(self) -> List[_T]: return [] return runs + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + @override def next_page_info(self) -> Optional[PageInfo]: runs = self.runs @@ -398,6 +494,14 @@ def _get_page_items(self) -> List[_T]: return [] return scenarios + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + @override def next_page_info(self) -> Optional[PageInfo]: scenarios = self.scenarios @@ -424,6 +528,14 @@ def _get_page_items(self) -> List[_T]: return [] return scenarios + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + @override def next_page_info(self) -> Optional[PageInfo]: scenarios = self.scenarios @@ -450,6 +562,14 @@ def _get_page_items(self) -> List[_T]: return [] return runs + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + @override def next_page_info(self) -> Optional[PageInfo]: runs = self.runs @@ -476,6 +596,14 @@ def _get_page_items(self) -> List[_T]: return [] return runs + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + @override def next_page_info(self) -> Optional[PageInfo]: runs = self.runs @@ -502,6 +630,14 @@ def _get_page_items(self) -> List[_T]: return [] return scorers + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + @override def next_page_info(self) -> Optional[PageInfo]: scorers = self.scorers @@ -528,6 +664,14 @@ def _get_page_items(self) -> List[_T]: return [] return scorers + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + @override def next_page_info(self) -> Optional[PageInfo]: scorers = self.scorers From e8f2e4d0e6e42c6c45dac9ac64a18b39a2f35820 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2025 03:36:42 +0000 Subject: [PATCH 661/993] chore(internal): minor type handling changes (#539) --- src/runloop_api_client/_models.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index 12c34b7d1..c4401ff86 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -426,10 +426,16 @@ def construct_type(*, value: object, type_: object) -> object: If the given value does not match the expected type then it is returned as-is. """ + + # store a reference to the original type we were given before we extract any inner + # types so that we can properly resolve forward references in `TypeAliasType` annotations + original_type = None + # we allow `object` as the input type because otherwise, passing things like # `Literal['value']` will be reported as a type error by type checkers type_ = cast("type[object]", type_) if is_type_alias_type(type_): + original_type = type_ # type: ignore[unreachable] type_ = type_.__value__ # type: ignore[unreachable] # unwrap `Annotated[T, ...]` -> `T` @@ -446,7 +452,7 @@ def construct_type(*, value: object, type_: object) -> object: if is_union(origin): try: - return validate_type(type_=cast("type[object]", type_), value=value) + return validate_type(type_=cast("type[object]", original_type or type_), value=value) except Exception: pass From b6256003f17461252d49aba50e84d530fdfefcd1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 18:42:35 +0000 Subject: [PATCH 662/993] feat(api): api update (#540) --- .stats.yml | 4 +- README.md | 2 +- api.md | 18 + src/runloop_api_client/_constants.py | 6 +- .../resources/devboxes/__init__.py | 14 + .../resources/devboxes/browsers.py | 78 ++++ .../resources/devboxes/computers.py | 78 ++++ .../resources/devboxes/devboxes.py | 153 +++++++ .../resources/devboxes/disk_snapshots.py | 421 ++++++++++++++++++ .../resources/scenarios/scorers.py | 24 +- src/runloop_api_client/types/__init__.py | 1 + .../types/devbox_update_params.py | 16 + .../types/devboxes/__init__.py | 3 + .../types/devboxes/browser_view.py | 4 +- .../devboxes/code_segment_info_response.py | 65 +-- .../types/devboxes/computer_view.py | 7 +- .../devboxes/disk_snapshot_list_params.py | 18 + .../devboxes/disk_snapshot_update_params.py | 16 + .../types/devboxes/document_symbol.py | 64 +++ .../types/scenarios/scorer_create_params.py | 4 +- .../types/scenarios/scorer_create_response.py | 4 +- .../types/scenarios/scorer_list_response.py | 4 +- .../scenarios/scorer_retrieve_response.py | 4 +- .../types/scenarios/scorer_update_params.py | 4 +- .../types/scenarios/scorer_update_response.py | 4 +- .../types/scoring_function.py | 9 + .../types/scoring_function_param.py | 9 + tests/api_resources/devboxes/test_browsers.py | 76 ++++ .../api_resources/devboxes/test_computers.py | 76 ++++ .../devboxes/test_disk_snapshots.py | 261 +++++++++++ tests/api_resources/scenarios/test_scorers.py | 28 +- tests/api_resources/test_devboxes.py | 94 ++++ tests/api_resources/test_scenarios.py | 10 + tests/test_client.py | 56 +-- 34 files changed, 1511 insertions(+), 124 deletions(-) create mode 100644 src/runloop_api_client/resources/devboxes/disk_snapshots.py create mode 100644 src/runloop_api_client/types/devbox_update_params.py create mode 100644 src/runloop_api_client/types/devboxes/disk_snapshot_list_params.py create mode 100644 src/runloop_api_client/types/devboxes/disk_snapshot_update_params.py create mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py create mode 100644 tests/api_resources/devboxes/test_disk_snapshots.py diff --git a/.stats.yml b/.stats.yml index abd9dea86..fb43e6c65 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 73 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a6925284ea7678ed801dbaf6b5c60676b97ab7a16191c1b2ff8ef6a468e89f3b.yml +configured_endpoints: 77 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a3d91c690527ff6a9040ade46943ba56916987f1f7d1fb45a9974546770ffe97.yml diff --git a/README.md b/README.md index 5954a9576..f480d2d45 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,7 @@ Error codes are as follows: ### Retries -Certain errors are automatically retried 2 times by default, with a short exponential backoff. +Certain errors are automatically retried 0 times by default, with a short exponential backoff. Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors are all retried by default. diff --git a/api.md b/api.md index 286bbffde..90c237349 100644 --- a/api.md +++ b/api.md @@ -83,6 +83,7 @@ Methods: - client.devboxes.create(\*\*params) -> DevboxView - client.devboxes.retrieve(id) -> DevboxView +- client.devboxes.update(id, \*\*params) -> DevboxView - client.devboxes.list(\*\*params) -> SyncDevboxesCursorIDPage[DevboxView] - client.devboxes.create_ssh_key(id) -> DevboxCreateSSHKeyResponse - client.devboxes.create_tunnel(id, \*\*params) -> DevboxTunnelView @@ -101,6 +102,20 @@ Methods: - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file_contents(id, \*\*params) -> DevboxExecutionDetailView +## DiskSnapshots + +Types: + +```python +from runloop_api_client.types.devboxes import DiskSnapshotDeleteResponse +``` + +Methods: + +- client.devboxes.disk_snapshots.update(id, \*\*params) -> DevboxSnapshotView +- client.devboxes.disk_snapshots.list(\*\*params) -> SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView] +- client.devboxes.disk_snapshots.delete(id) -> object + ## Browsers Types: @@ -112,6 +127,7 @@ from runloop_api_client.types.devboxes import BrowserView Methods: - client.devboxes.browsers.create(\*\*params) -> BrowserView +- client.devboxes.browsers.retrieve(id) -> BrowserView ## Computers @@ -129,6 +145,7 @@ from runloop_api_client.types.devboxes import ( Methods: - client.devboxes.computers.create(\*\*params) -> ComputerView +- client.devboxes.computers.retrieve(id) -> ComputerView - client.devboxes.computers.keyboard_interaction(id, \*\*params) -> ComputerKeyboardInteractionResponse - client.devboxes.computers.mouse_interaction(id, \*\*params) -> ComputerMouseInteractionResponse - client.devboxes.computers.screen_interaction(id, \*\*params) -> ComputerScreenInteractionResponse @@ -163,6 +180,7 @@ from runloop_api_client.types.devboxes import ( DiagnosticSeverity, DiagnosticsResponse, DiagnosticTag, + DocumentSymbol, DocumentSymbolResponse, DocumentUri, FileContentsResponse, diff --git a/src/runloop_api_client/_constants.py b/src/runloop_api_client/_constants.py index 6ddf2c717..6be0f5e04 100644 --- a/src/runloop_api_client/_constants.py +++ b/src/runloop_api_client/_constants.py @@ -7,8 +7,8 @@ # default timeout is 1 minute DEFAULT_TIMEOUT = httpx.Timeout(timeout=60, connect=5.0) -DEFAULT_MAX_RETRIES = 2 +DEFAULT_MAX_RETRIES = 0 DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20) -INITIAL_RETRY_DELAY = 0.5 -MAX_RETRY_DELAY = 8.0 +INITIAL_RETRY_DELAY = 1.0 +MAX_RETRY_DELAY = 10.0 diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index 1e09245d6..acdd589f0 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -48,8 +48,22 @@ ExecutionsResourceWithStreamingResponse, AsyncExecutionsResourceWithStreamingResponse, ) +from .disk_snapshots import ( + DiskSnapshotsResource, + AsyncDiskSnapshotsResource, + DiskSnapshotsResourceWithRawResponse, + AsyncDiskSnapshotsResourceWithRawResponse, + DiskSnapshotsResourceWithStreamingResponse, + AsyncDiskSnapshotsResourceWithStreamingResponse, +) __all__ = [ + "DiskSnapshotsResource", + "AsyncDiskSnapshotsResource", + "DiskSnapshotsResourceWithRawResponse", + "AsyncDiskSnapshotsResourceWithRawResponse", + "DiskSnapshotsResourceWithStreamingResponse", + "AsyncDiskSnapshotsResourceWithStreamingResponse", "BrowsersResource", "AsyncBrowsersResource", "BrowsersResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/browsers.py b/src/runloop_api_client/resources/devboxes/browsers.py index d59cbcd4d..799b58aef 100644 --- a/src/runloop_api_client/resources/devboxes/browsers.py +++ b/src/runloop_api_client/resources/devboxes/browsers.py @@ -90,6 +90,39 @@ def create( cast_to=BrowserView, ) + def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BrowserView: + """ + Get Browser Details. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/browsers/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BrowserView, + ) + class AsyncBrowsersResource(AsyncAPIResource): @cached_property @@ -155,6 +188,39 @@ async def create( cast_to=BrowserView, ) + async def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> BrowserView: + """ + Get Browser Details. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/browsers/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BrowserView, + ) + class BrowsersResourceWithRawResponse: def __init__(self, browsers: BrowsersResource) -> None: @@ -163,6 +229,9 @@ def __init__(self, browsers: BrowsersResource) -> None: self.create = to_raw_response_wrapper( browsers.create, ) + self.retrieve = to_raw_response_wrapper( + browsers.retrieve, + ) class AsyncBrowsersResourceWithRawResponse: @@ -172,6 +241,9 @@ def __init__(self, browsers: AsyncBrowsersResource) -> None: self.create = async_to_raw_response_wrapper( browsers.create, ) + self.retrieve = async_to_raw_response_wrapper( + browsers.retrieve, + ) class BrowsersResourceWithStreamingResponse: @@ -181,6 +253,9 @@ def __init__(self, browsers: BrowsersResource) -> None: self.create = to_streamed_response_wrapper( browsers.create, ) + self.retrieve = to_streamed_response_wrapper( + browsers.retrieve, + ) class AsyncBrowsersResourceWithStreamingResponse: @@ -190,3 +265,6 @@ def __init__(self, browsers: AsyncBrowsersResource) -> None: self.create = async_to_streamed_response_wrapper( browsers.create, ) + self.retrieve = async_to_streamed_response_wrapper( + browsers.retrieve, + ) diff --git a/src/runloop_api_client/resources/devboxes/computers.py b/src/runloop_api_client/resources/devboxes/computers.py index b34697390..fea63c395 100644 --- a/src/runloop_api_client/resources/devboxes/computers.py +++ b/src/runloop_api_client/resources/devboxes/computers.py @@ -110,6 +110,39 @@ def create( cast_to=ComputerView, ) + def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ComputerView: + """ + Get Computer Details. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/computers/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ComputerView, + ) + def keyboard_interaction( self, id: str, @@ -343,6 +376,39 @@ async def create( cast_to=ComputerView, ) + async def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ComputerView: + """ + Get Computer Details. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/computers/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ComputerView, + ) + async def keyboard_interaction( self, id: str, @@ -508,6 +574,9 @@ def __init__(self, computers: ComputersResource) -> None: self.create = to_raw_response_wrapper( computers.create, ) + self.retrieve = to_raw_response_wrapper( + computers.retrieve, + ) self.keyboard_interaction = to_raw_response_wrapper( computers.keyboard_interaction, ) @@ -526,6 +595,9 @@ def __init__(self, computers: AsyncComputersResource) -> None: self.create = async_to_raw_response_wrapper( computers.create, ) + self.retrieve = async_to_raw_response_wrapper( + computers.retrieve, + ) self.keyboard_interaction = async_to_raw_response_wrapper( computers.keyboard_interaction, ) @@ -544,6 +616,9 @@ def __init__(self, computers: ComputersResource) -> None: self.create = to_streamed_response_wrapper( computers.create, ) + self.retrieve = to_streamed_response_wrapper( + computers.retrieve, + ) self.keyboard_interaction = to_streamed_response_wrapper( computers.keyboard_interaction, ) @@ -562,6 +637,9 @@ def __init__(self, computers: AsyncComputersResource) -> None: self.create = async_to_streamed_response_wrapper( computers.create, ) + self.retrieve = async_to_streamed_response_wrapper( + computers.retrieve, + ) self.keyboard_interaction = async_to_streamed_response_wrapper( computers.keyboard_interaction, ) diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index f3be79cdf..7c9253108 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -26,6 +26,7 @@ from ...types import ( devbox_list_params, devbox_create_params, + devbox_update_params, devbox_upload_file_params, devbox_execute_sync_params, devbox_create_tunnel_params, @@ -91,6 +92,14 @@ AsyncDiskSnapshotsCursorIDPage, ) from ..._base_client import AsyncPaginator, make_request_options +from .disk_snapshots import ( + DiskSnapshotsResource, + AsyncDiskSnapshotsResource, + DiskSnapshotsResourceWithRawResponse, + AsyncDiskSnapshotsResourceWithRawResponse, + DiskSnapshotsResourceWithStreamingResponse, + AsyncDiskSnapshotsResourceWithStreamingResponse, +) from ...types.devbox_view import DevboxView from ...types.devbox_tunnel_view import DevboxTunnelView from ...types.devbox_snapshot_view import DevboxSnapshotView @@ -104,6 +113,10 @@ class DevboxesResource(SyncAPIResource): + @cached_property + def disk_snapshots(self) -> DiskSnapshotsResource: + return DiskSnapshotsResource(self._client) + @cached_property def browsers(self) -> BrowsersResource: return BrowsersResource(self._client) @@ -275,6 +288,60 @@ def retrieve( cast_to=DevboxView, ) + def update( + self, + id: str, + *, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> DevboxView: + """ + Updates a devbox by doing a complete update the existing name,metadata fields. + It does not patch partial values. + + Args: + metadata: User defined metadata to attach to the devbox for organization. + + name: (Optional) A user specified name to give the Devbox. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}", + body=maybe_transform( + { + "metadata": metadata, + "name": name, + }, + devbox_update_params.DevboxUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=DevboxView, + ) + def list( self, *, @@ -1109,6 +1176,10 @@ def write_file_contents( class AsyncDevboxesResource(AsyncAPIResource): + @cached_property + def disk_snapshots(self) -> AsyncDiskSnapshotsResource: + return AsyncDiskSnapshotsResource(self._client) + @cached_property def browsers(self) -> AsyncBrowsersResource: return AsyncBrowsersResource(self._client) @@ -1280,6 +1351,60 @@ async def retrieve( cast_to=DevboxView, ) + async def update( + self, + id: str, + *, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> DevboxView: + """ + Updates a devbox by doing a complete update the existing name,metadata fields. + It does not patch partial values. + + Args: + metadata: User defined metadata to attach to the devbox for organization. + + name: (Optional) A user specified name to give the Devbox. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}", + body=await async_maybe_transform( + { + "metadata": metadata, + "name": name, + }, + devbox_update_params.DevboxUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=DevboxView, + ) + def list( self, *, @@ -2123,6 +2248,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.retrieve = to_raw_response_wrapper( devboxes.retrieve, ) + self.update = to_raw_response_wrapper( + devboxes.update, + ) self.list = to_raw_response_wrapper( devboxes.list, ) @@ -2176,6 +2304,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file_contents, ) + @cached_property + def disk_snapshots(self) -> DiskSnapshotsResourceWithRawResponse: + return DiskSnapshotsResourceWithRawResponse(self._devboxes.disk_snapshots) + @cached_property def browsers(self) -> BrowsersResourceWithRawResponse: return BrowsersResourceWithRawResponse(self._devboxes.browsers) @@ -2207,6 +2339,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.retrieve = async_to_raw_response_wrapper( devboxes.retrieve, ) + self.update = async_to_raw_response_wrapper( + devboxes.update, + ) self.list = async_to_raw_response_wrapper( devboxes.list, ) @@ -2260,6 +2395,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file_contents, ) + @cached_property + def disk_snapshots(self) -> AsyncDiskSnapshotsResourceWithRawResponse: + return AsyncDiskSnapshotsResourceWithRawResponse(self._devboxes.disk_snapshots) + @cached_property def browsers(self) -> AsyncBrowsersResourceWithRawResponse: return AsyncBrowsersResourceWithRawResponse(self._devboxes.browsers) @@ -2291,6 +2430,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.retrieve = to_streamed_response_wrapper( devboxes.retrieve, ) + self.update = to_streamed_response_wrapper( + devboxes.update, + ) self.list = to_streamed_response_wrapper( devboxes.list, ) @@ -2344,6 +2486,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.write_file_contents, ) + @cached_property + def disk_snapshots(self) -> DiskSnapshotsResourceWithStreamingResponse: + return DiskSnapshotsResourceWithStreamingResponse(self._devboxes.disk_snapshots) + @cached_property def browsers(self) -> BrowsersResourceWithStreamingResponse: return BrowsersResourceWithStreamingResponse(self._devboxes.browsers) @@ -2375,6 +2521,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.retrieve = async_to_streamed_response_wrapper( devboxes.retrieve, ) + self.update = async_to_streamed_response_wrapper( + devboxes.update, + ) self.list = async_to_streamed_response_wrapper( devboxes.list, ) @@ -2428,6 +2577,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.write_file_contents, ) + @cached_property + def disk_snapshots(self) -> AsyncDiskSnapshotsResourceWithStreamingResponse: + return AsyncDiskSnapshotsResourceWithStreamingResponse(self._devboxes.disk_snapshots) + @cached_property def browsers(self) -> AsyncBrowsersResourceWithStreamingResponse: return AsyncBrowsersResourceWithStreamingResponse(self._devboxes.browsers) diff --git a/src/runloop_api_client/resources/devboxes/disk_snapshots.py b/src/runloop_api_client/resources/devboxes/disk_snapshots.py new file mode 100644 index 000000000..9d23416f1 --- /dev/null +++ b/src/runloop_api_client/resources/devboxes/disk_snapshots.py @@ -0,0 +1,421 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Optional + +import httpx + +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._utils import ( + maybe_transform, + async_maybe_transform, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...pagination import SyncDiskSnapshotsCursorIDPage, AsyncDiskSnapshotsCursorIDPage +from ..._base_client import AsyncPaginator, make_request_options +from ...types.devboxes import disk_snapshot_list_params, disk_snapshot_update_params +from ...types.devbox_snapshot_view import DevboxSnapshotView + +__all__ = ["DiskSnapshotsResource", "AsyncDiskSnapshotsResource"] + + +class DiskSnapshotsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> DiskSnapshotsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return DiskSnapshotsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> DiskSnapshotsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return DiskSnapshotsResourceWithStreamingResponse(self) + + def update( + self, + id: str, + *, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> DevboxSnapshotView: + """Updates disk snapshot metadata via update vs patch. + + The entire metadata will be + replaced. + + Args: + metadata: (Optional) Metadata used to describe the snapshot + + name: (Optional) A user specified name to give the snapshot + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/disk_snapshots/{id}", + body=maybe_transform( + { + "metadata": metadata, + "name": name, + }, + disk_snapshot_update_params.DiskSnapshotUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=DevboxSnapshotView, + ) + + def list( + self, + *, + devbox_id: str | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView]: + """ + List all snapshots of a Devbox while optionally filtering by Devbox ID. + + Args: + devbox_id: Devbox ID to filter by. + + limit: The limit of items to return. Default is 20. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/devboxes/disk_snapshots", + page=SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "devbox_id": devbox_id, + "limit": limit, + "starting_after": starting_after, + }, + disk_snapshot_list_params.DiskSnapshotListParams, + ), + ), + model=DevboxSnapshotView, + ) + + def delete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> object: + """ + Delete a previously taken disk snapshot of a Devbox. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/disk_snapshots/{id}/delete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=object, + ) + + +class AsyncDiskSnapshotsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncDiskSnapshotsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncDiskSnapshotsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncDiskSnapshotsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncDiskSnapshotsResourceWithStreamingResponse(self) + + async def update( + self, + id: str, + *, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> DevboxSnapshotView: + """Updates disk snapshot metadata via update vs patch. + + The entire metadata will be + replaced. + + Args: + metadata: (Optional) Metadata used to describe the snapshot + + name: (Optional) A user specified name to give the snapshot + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/disk_snapshots/{id}", + body=await async_maybe_transform( + { + "metadata": metadata, + "name": name, + }, + disk_snapshot_update_params.DiskSnapshotUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=DevboxSnapshotView, + ) + + def list( + self, + *, + devbox_id: str | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[DevboxSnapshotView, AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView]]: + """ + List all snapshots of a Devbox while optionally filtering by Devbox ID. + + Args: + devbox_id: Devbox ID to filter by. + + limit: The limit of items to return. Default is 20. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/devboxes/disk_snapshots", + page=AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "devbox_id": devbox_id, + "limit": limit, + "starting_after": starting_after, + }, + disk_snapshot_list_params.DiskSnapshotListParams, + ), + ), + model=DevboxSnapshotView, + ) + + async def delete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> object: + """ + Delete a previously taken disk snapshot of a Devbox. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/disk_snapshots/{id}/delete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=object, + ) + + +class DiskSnapshotsResourceWithRawResponse: + def __init__(self, disk_snapshots: DiskSnapshotsResource) -> None: + self._disk_snapshots = disk_snapshots + + self.update = to_raw_response_wrapper( + disk_snapshots.update, + ) + self.list = to_raw_response_wrapper( + disk_snapshots.list, + ) + self.delete = to_raw_response_wrapper( + disk_snapshots.delete, + ) + + +class AsyncDiskSnapshotsResourceWithRawResponse: + def __init__(self, disk_snapshots: AsyncDiskSnapshotsResource) -> None: + self._disk_snapshots = disk_snapshots + + self.update = async_to_raw_response_wrapper( + disk_snapshots.update, + ) + self.list = async_to_raw_response_wrapper( + disk_snapshots.list, + ) + self.delete = async_to_raw_response_wrapper( + disk_snapshots.delete, + ) + + +class DiskSnapshotsResourceWithStreamingResponse: + def __init__(self, disk_snapshots: DiskSnapshotsResource) -> None: + self._disk_snapshots = disk_snapshots + + self.update = to_streamed_response_wrapper( + disk_snapshots.update, + ) + self.list = to_streamed_response_wrapper( + disk_snapshots.list, + ) + self.delete = to_streamed_response_wrapper( + disk_snapshots.delete, + ) + + +class AsyncDiskSnapshotsResourceWithStreamingResponse: + def __init__(self, disk_snapshots: AsyncDiskSnapshotsResource) -> None: + self._disk_snapshots = disk_snapshots + + self.update = async_to_streamed_response_wrapper( + disk_snapshots.update, + ) + self.list = async_to_streamed_response_wrapper( + disk_snapshots.list, + ) + self.delete = async_to_streamed_response_wrapper( + disk_snapshots.delete, + ) diff --git a/src/runloop_api_client/resources/scenarios/scorers.py b/src/runloop_api_client/resources/scenarios/scorers.py index 5d2ee5b58..77f9393d6 100644 --- a/src/runloop_api_client/resources/scenarios/scorers.py +++ b/src/runloop_api_client/resources/scenarios/scorers.py @@ -54,7 +54,7 @@ def create( self, *, bash_script: str, - name: str, + type: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -70,7 +70,7 @@ def create( bash_script: Bash script for the custom scorer taking context as a json object $RL_TEST_CONTEXT. - name: Name of the custom scorer. + type: Name of the type of custom scorer. extra_headers: Send extra headers @@ -87,7 +87,7 @@ def create( body=maybe_transform( { "bash_script": bash_script, - "name": name, + "type": type, }, scorer_create_params.ScorerCreateParams, ), @@ -139,7 +139,7 @@ def update( id: str, *, bash_script: str, - name: str, + type: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -155,7 +155,7 @@ def update( bash_script: Bash script for the custom scorer taking context as a json object $RL_TEST_CONTEXT. - name: Name of the custom scorer. + type: Name of the type of custom scorer. extra_headers: Send extra headers @@ -174,7 +174,7 @@ def update( body=maybe_transform( { "bash_script": bash_script, - "name": name, + "type": type, }, scorer_update_params.ScorerUpdateParams, ), @@ -313,7 +313,7 @@ async def create( self, *, bash_script: str, - name: str, + type: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -329,7 +329,7 @@ async def create( bash_script: Bash script for the custom scorer taking context as a json object $RL_TEST_CONTEXT. - name: Name of the custom scorer. + type: Name of the type of custom scorer. extra_headers: Send extra headers @@ -346,7 +346,7 @@ async def create( body=await async_maybe_transform( { "bash_script": bash_script, - "name": name, + "type": type, }, scorer_create_params.ScorerCreateParams, ), @@ -398,7 +398,7 @@ async def update( id: str, *, bash_script: str, - name: str, + type: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -414,7 +414,7 @@ async def update( bash_script: Bash script for the custom scorer taking context as a json object $RL_TEST_CONTEXT. - name: Name of the custom scorer. + type: Name of the type of custom scorer. extra_headers: Send extra headers @@ -433,7 +433,7 @@ async def update( body=await async_maybe_transform( { "bash_script": bash_script, - "name": name, + "type": type, }, scorer_update_params.ScorerUpdateParams, ), diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index f8e0dbe8d..62b6d30e3 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -26,6 +26,7 @@ from .input_context_param import InputContextParam as InputContextParam from .devbox_create_params import DevboxCreateParams as DevboxCreateParams from .devbox_snapshot_view import DevboxSnapshotView as DevboxSnapshotView +from .devbox_update_params import DevboxUpdateParams as DevboxUpdateParams from .scenario_environment import ScenarioEnvironment as ScenarioEnvironment from .scenario_list_params import ScenarioListParams as ScenarioListParams from .benchmark_list_params import BenchmarkListParams as BenchmarkListParams diff --git a/src/runloop_api_client/types/devbox_update_params.py b/src/runloop_api_client/types/devbox_update_params.py new file mode 100644 index 000000000..2fbdae310 --- /dev/null +++ b/src/runloop_api_client/types/devbox_update_params.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Optional +from typing_extensions import TypedDict + +__all__ = ["DevboxUpdateParams"] + + +class DevboxUpdateParams(TypedDict, total=False): + metadata: Optional[Dict[str, str]] + """User defined metadata to attach to the devbox for organization.""" + + name: Optional[str] + """(Optional) A user specified name to give the Devbox.""" diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 66e9530ef..ebfdc7800 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -26,6 +26,7 @@ from .location_param import LocationParam as LocationParam from .position_param import PositionParam as PositionParam from .base_diagnostic import BaseDiagnostic as BaseDiagnostic +from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams from .lsp_file_params import LspFileParams as LspFileParams from .text_edit_param import TextEditParam as TextEditParam @@ -60,10 +61,12 @@ from .file_definition_response import FileDefinitionResponse as FileDefinitionResponse from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam from .code_action_context_param import CodeActionContextParam as CodeActionContextParam +from .disk_snapshot_list_params import DiskSnapshotListParams as DiskSnapshotListParams from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams from .base_parameter_information import BaseParameterInformation as BaseParameterInformation from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams +from .disk_snapshot_update_params import DiskSnapshotUpdateParams as DiskSnapshotUpdateParams from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams diff --git a/src/runloop_api_client/types/devboxes/browser_view.py b/src/runloop_api_client/types/devboxes/browser_view.py index ef9303f0f..84341e301 100644 --- a/src/runloop_api_client/types/devboxes/browser_view.py +++ b/src/runloop_api_client/types/devboxes/browser_view.py @@ -20,5 +20,7 @@ class BrowserView(BaseModel): live_view_url: str """ The url to view the browser window and enable user interactions via their own - browser. + browser. You can control the interactivity of the browser by adding or removing + 'view_only' query parameter. view_only=1 will allow interaction and view_only=0 + will disable interaction. """ diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py index dbc01bdf3..aa0641872 100644 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -1,64 +1,19 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import TYPE_CHECKING, List, Optional +from __future__ import annotations -from pydantic import Field as FieldInfo +from typing import List, Optional -from .range import Range from .file_uri import FileUri +from ..._compat import PYDANTIC_V2 from ..._models import BaseModel from .base_range import BaseRange -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind from .base_location import BaseLocation from .base_diagnostic import BaseDiagnostic from .base_code_action import BaseCodeAction from .signature_help_response import SignatureHelpResponse -__all__ = ["CodeSegmentInfoResponse", "Symbol", "Hover"] - - -class Symbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List[object]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - if TYPE_CHECKING: - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... +__all__ = ["CodeSegmentInfoResponse", "Hover"] class Hover(BaseModel): @@ -74,7 +29,7 @@ class CodeSegmentInfoResponse(BaseModel): references: List[BaseLocation] - symbol: Symbol + symbol: "DocumentSymbol" """ Represents programming constructs like variables, classes, interfaces etc. that appear in a document. Document symbols can be hierarchical and they have two @@ -87,3 +42,13 @@ class CodeSegmentInfoResponse(BaseModel): hover: Optional[Hover] = None signature: Optional[SignatureHelpResponse] = None + + +from .document_symbol import DocumentSymbol + +if PYDANTIC_V2: + CodeSegmentInfoResponse.model_rebuild() + Hover.model_rebuild() +else: + CodeSegmentInfoResponse.update_forward_refs() # type: ignore + Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/computer_view.py b/src/runloop_api_client/types/devboxes/computer_view.py index 858aa27a2..f401845cc 100644 --- a/src/runloop_api_client/types/devboxes/computer_view.py +++ b/src/runloop_api_client/types/devboxes/computer_view.py @@ -12,4 +12,9 @@ class ComputerView(BaseModel): """The underlying devbox the computer setup is running on.""" live_screen_url: str - """The http tunnel to connect and view the live screen of the computer.""" + """The http tunnel to connect and view the live screen of the computer. + + You can control the interactivity of the browser by adding or removing + 'view_only' query parameter. view_only=1 will allow interaction and view_only=0 + will disable interaction. + """ diff --git a/src/runloop_api_client/types/devboxes/disk_snapshot_list_params.py b/src/runloop_api_client/types/devboxes/disk_snapshot_list_params.py new file mode 100644 index 000000000..82cd12731 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/disk_snapshot_list_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["DiskSnapshotListParams"] + + +class DiskSnapshotListParams(TypedDict, total=False): + devbox_id: str + """Devbox ID to filter by.""" + + limit: int + """The limit of items to return. Default is 20.""" + + starting_after: str + """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/devboxes/disk_snapshot_update_params.py b/src/runloop_api_client/types/devboxes/disk_snapshot_update_params.py new file mode 100644 index 000000000..6b4d276c5 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/disk_snapshot_update_params.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Optional +from typing_extensions import TypedDict + +__all__ = ["DiskSnapshotUpdateParams"] + + +class DiskSnapshotUpdateParams(TypedDict, total=False): + metadata: Optional[Dict[str, str]] + """(Optional) Metadata used to describe the snapshot""" + + name: Optional[str] + """(Optional) A user specified name to give the snapshot""" diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py new file mode 100644 index 000000000..30ca96d6d --- /dev/null +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -0,0 +1,64 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import TYPE_CHECKING, List, Optional + +from pydantic import Field as FieldInfo + +from .range import Range +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel +from .symbol_tag import SymbolTag +from .symbol_kind import SymbolKind + +__all__ = ["DocumentSymbol"] + + +class DocumentSymbol(BaseModel): + kind: SymbolKind + """The kind of this symbol.""" + + name: str + """The name of this symbol. + + Will be displayed in the user interface and therefore must not be an empty + string or a string only consisting of white spaces. + """ + + range: Range + """ + The range enclosing this symbol not including leading/trailing whitespace but + everything else like comments. This information is typically used to determine + if the clients cursor is inside the symbol to reveal in the symbol in the UI. + """ + + selection_range: Range = FieldInfo(alias="selectionRange") + """ + The range that should be selected and revealed when this symbol is being picked, + e.g the name of a function. Must be contained by the `range`. + """ + + children: Optional[List["DocumentSymbol"]] = None + """Children of this symbol, e.g. properties of a class.""" + + deprecated: Optional[bool] = None + """Indicates if this symbol is deprecated.""" + + detail: Optional[str] = None + """More detail for this symbol, e.g the signature of a function.""" + + tags: Optional[List[SymbolTag]] = None + """Tags for this document symbol.""" + + if TYPE_CHECKING: + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> object: ... + + +if PYDANTIC_V2: + DocumentSymbol.model_rebuild() +else: + DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/scenarios/scorer_create_params.py b/src/runloop_api_client/types/scenarios/scorer_create_params.py index 8261dff54..4ba0d6d4d 100644 --- a/src/runloop_api_client/types/scenarios/scorer_create_params.py +++ b/src/runloop_api_client/types/scenarios/scorer_create_params.py @@ -14,5 +14,5 @@ class ScorerCreateParams(TypedDict, total=False): $RL_TEST_CONTEXT. """ - name: Required[str] - """Name of the custom scorer.""" + type: Required[str] + """Name of the type of custom scorer.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_create_response.py b/src/runloop_api_client/types/scenarios/scorer_create_response.py index 8c9adf293..49b614e0d 100644 --- a/src/runloop_api_client/types/scenarios/scorer_create_response.py +++ b/src/runloop_api_client/types/scenarios/scorer_create_response.py @@ -13,5 +13,5 @@ class ScorerCreateResponse(BaseModel): bash_script: str """Bash script that takes in $RL_TEST_CONTEXT as env variable and runs scoring.""" - name: str - """Name of the scenario scorer.""" + type: str + """Name of the type of scenario scorer.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_list_response.py b/src/runloop_api_client/types/scenarios/scorer_list_response.py index 59f7adc40..d24bfd87e 100644 --- a/src/runloop_api_client/types/scenarios/scorer_list_response.py +++ b/src/runloop_api_client/types/scenarios/scorer_list_response.py @@ -13,5 +13,5 @@ class ScorerListResponse(BaseModel): bash_script: str """Bash script that takes in $RL_TEST_CONTEXT as env variable and runs scoring.""" - name: str - """Name of the scenario scorer.""" + type: str + """Name of the type of scenario scorer.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_retrieve_response.py b/src/runloop_api_client/types/scenarios/scorer_retrieve_response.py index 25ab5b1d6..d72dd5778 100644 --- a/src/runloop_api_client/types/scenarios/scorer_retrieve_response.py +++ b/src/runloop_api_client/types/scenarios/scorer_retrieve_response.py @@ -13,5 +13,5 @@ class ScorerRetrieveResponse(BaseModel): bash_script: str """Bash script that takes in $RL_TEST_CONTEXT as env variable and runs scoring.""" - name: str - """Name of the scenario scorer.""" + type: str + """Name of the type of scenario scorer.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_update_params.py b/src/runloop_api_client/types/scenarios/scorer_update_params.py index bff2e81c0..3637f4b05 100644 --- a/src/runloop_api_client/types/scenarios/scorer_update_params.py +++ b/src/runloop_api_client/types/scenarios/scorer_update_params.py @@ -14,5 +14,5 @@ class ScorerUpdateParams(TypedDict, total=False): $RL_TEST_CONTEXT. """ - name: Required[str] - """Name of the custom scorer.""" + type: Required[str] + """Name of the type of custom scorer.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_update_response.py b/src/runloop_api_client/types/scenarios/scorer_update_response.py index 72c6dce78..ef77f37e6 100644 --- a/src/runloop_api_client/types/scenarios/scorer_update_response.py +++ b/src/runloop_api_client/types/scenarios/scorer_update_response.py @@ -13,5 +13,5 @@ class ScorerUpdateResponse(BaseModel): bash_script: str """Bash script that takes in $RL_TEST_CONTEXT as env variable and runs scoring.""" - name: str - """Name of the scenario scorer.""" + type: str + """Name of the type of scenario scorer.""" diff --git a/src/runloop_api_client/types/scoring_function.py b/src/runloop_api_client/types/scoring_function.py index 2ed26f677..a5adc2b75 100644 --- a/src/runloop_api_client/types/scoring_function.py +++ b/src/runloop_api_client/types/scoring_function.py @@ -11,6 +11,9 @@ class ScoringFunction(BaseModel): name: str """Name of scoring function.""" + type: str + """Type of the scoring function. Defaults to bash script.""" + weight: float """Wight to apply to scoring function score. @@ -23,3 +26,9 @@ class ScoringFunction(BaseModel): score to standard out. Score should be an integer between 0 and 100, and look like "score=[0..100]. """ + + scorer_params: Optional[object] = None + """ + Additional JSON structured context to pass to the scoring function if using + custom scorer. + """ diff --git a/src/runloop_api_client/types/scoring_function_param.py b/src/runloop_api_client/types/scoring_function_param.py index ba42923cc..1f101bad2 100644 --- a/src/runloop_api_client/types/scoring_function_param.py +++ b/src/runloop_api_client/types/scoring_function_param.py @@ -12,6 +12,9 @@ class ScoringFunctionParam(TypedDict, total=False): name: Required[str] """Name of scoring function.""" + type: Required[str] + """Type of the scoring function. Defaults to bash script.""" + weight: Required[float] """Wight to apply to scoring function score. @@ -24,3 +27,9 @@ class ScoringFunctionParam(TypedDict, total=False): score to standard out. Score should be an integer between 0 and 100, and look like "score=[0..100]. """ + + scorer_params: Optional[object] + """ + Additional JSON structured context to pass to the scoring function if using + custom scorer. + """ diff --git a/tests/api_resources/devboxes/test_browsers.py b/tests/api_resources/devboxes/test_browsers.py index 2bdbd823a..5fa04afc0 100644 --- a/tests/api_resources/devboxes/test_browsers.py +++ b/tests/api_resources/devboxes/test_browsers.py @@ -49,6 +49,44 @@ def test_streaming_response_create(self, client: Runloop) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + browser = client.devboxes.browsers.retrieve( + "id", + ) + assert_matches_type(BrowserView, browser, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.devboxes.browsers.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + browser = response.parse() + assert_matches_type(BrowserView, browser, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.devboxes.browsers.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + browser = response.parse() + assert_matches_type(BrowserView, browser, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.browsers.with_raw_response.retrieve( + "", + ) + class TestAsyncBrowsers: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -84,3 +122,41 @@ async def test_streaming_response_create(self, async_client: AsyncRunloop) -> No assert_matches_type(BrowserView, browser, path=["response"]) assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + browser = await async_client.devboxes.browsers.retrieve( + "id", + ) + assert_matches_type(BrowserView, browser, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.browsers.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + browser = await response.parse() + assert_matches_type(BrowserView, browser, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.browsers.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + browser = await response.parse() + assert_matches_type(BrowserView, browser, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.browsers.with_raw_response.retrieve( + "", + ) diff --git a/tests/api_resources/devboxes/test_computers.py b/tests/api_resources/devboxes/test_computers.py index a388926b6..8671cf96c 100644 --- a/tests/api_resources/devboxes/test_computers.py +++ b/tests/api_resources/devboxes/test_computers.py @@ -58,6 +58,44 @@ def test_streaming_response_create(self, client: Runloop) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + computer = client.devboxes.computers.retrieve( + "id", + ) + assert_matches_type(ComputerView, computer, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.devboxes.computers.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + computer = response.parse() + assert_matches_type(ComputerView, computer, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.devboxes.computers.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + computer = response.parse() + assert_matches_type(ComputerView, computer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.computers.with_raw_response.retrieve( + "", + ) + @parametrize def test_method_keyboard_interaction(self, client: Runloop) -> None: computer = client.devboxes.computers.keyboard_interaction( @@ -245,6 +283,44 @@ async def test_streaming_response_create(self, async_client: AsyncRunloop) -> No assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + computer = await async_client.devboxes.computers.retrieve( + "id", + ) + assert_matches_type(ComputerView, computer, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.computers.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + computer = await response.parse() + assert_matches_type(ComputerView, computer, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.computers.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + computer = await response.parse() + assert_matches_type(ComputerView, computer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.computers.with_raw_response.retrieve( + "", + ) + @parametrize async def test_method_keyboard_interaction(self, async_client: AsyncRunloop) -> None: computer = await async_client.devboxes.computers.keyboard_interaction( diff --git a/tests/api_resources/devboxes/test_disk_snapshots.py b/tests/api_resources/devboxes/test_disk_snapshots.py new file mode 100644 index 000000000..dbbefa079 --- /dev/null +++ b/tests/api_resources/devboxes/test_disk_snapshots.py @@ -0,0 +1,261 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types import DevboxSnapshotView +from runloop_api_client.pagination import SyncDiskSnapshotsCursorIDPage, AsyncDiskSnapshotsCursorIDPage + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestDiskSnapshots: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_update(self, client: Runloop) -> None: + disk_snapshot = client.devboxes.disk_snapshots.update( + id="id", + ) + assert_matches_type(DevboxSnapshotView, disk_snapshot, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Runloop) -> None: + disk_snapshot = client.devboxes.disk_snapshots.update( + id="id", + metadata={"foo": "string"}, + name="name", + ) + assert_matches_type(DevboxSnapshotView, disk_snapshot, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Runloop) -> None: + response = client.devboxes.disk_snapshots.with_raw_response.update( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + disk_snapshot = response.parse() + assert_matches_type(DevboxSnapshotView, disk_snapshot, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Runloop) -> None: + with client.devboxes.disk_snapshots.with_streaming_response.update( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + disk_snapshot = response.parse() + assert_matches_type(DevboxSnapshotView, disk_snapshot, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.disk_snapshots.with_raw_response.update( + id="", + ) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + disk_snapshot = client.devboxes.disk_snapshots.list() + assert_matches_type(SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], disk_snapshot, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + disk_snapshot = client.devboxes.disk_snapshots.list( + devbox_id="devbox_id", + limit=0, + starting_after="starting_after", + ) + assert_matches_type(SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], disk_snapshot, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.devboxes.disk_snapshots.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + disk_snapshot = response.parse() + assert_matches_type(SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], disk_snapshot, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.devboxes.disk_snapshots.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + disk_snapshot = response.parse() + assert_matches_type(SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], disk_snapshot, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_delete(self, client: Runloop) -> None: + disk_snapshot = client.devboxes.disk_snapshots.delete( + "id", + ) + assert_matches_type(object, disk_snapshot, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Runloop) -> None: + response = client.devboxes.disk_snapshots.with_raw_response.delete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + disk_snapshot = response.parse() + assert_matches_type(object, disk_snapshot, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Runloop) -> None: + with client.devboxes.disk_snapshots.with_streaming_response.delete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + disk_snapshot = response.parse() + assert_matches_type(object, disk_snapshot, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.disk_snapshots.with_raw_response.delete( + "", + ) + + +class TestAsyncDiskSnapshots: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_update(self, async_client: AsyncRunloop) -> None: + disk_snapshot = await async_client.devboxes.disk_snapshots.update( + id="id", + ) + assert_matches_type(DevboxSnapshotView, disk_snapshot, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncRunloop) -> None: + disk_snapshot = await async_client.devboxes.disk_snapshots.update( + id="id", + metadata={"foo": "string"}, + name="name", + ) + assert_matches_type(DevboxSnapshotView, disk_snapshot, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.disk_snapshots.with_raw_response.update( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + disk_snapshot = await response.parse() + assert_matches_type(DevboxSnapshotView, disk_snapshot, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.disk_snapshots.with_streaming_response.update( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + disk_snapshot = await response.parse() + assert_matches_type(DevboxSnapshotView, disk_snapshot, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.disk_snapshots.with_raw_response.update( + id="", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + disk_snapshot = await async_client.devboxes.disk_snapshots.list() + assert_matches_type(AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], disk_snapshot, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + disk_snapshot = await async_client.devboxes.disk_snapshots.list( + devbox_id="devbox_id", + limit=0, + starting_after="starting_after", + ) + assert_matches_type(AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], disk_snapshot, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.disk_snapshots.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + disk_snapshot = await response.parse() + assert_matches_type(AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], disk_snapshot, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.disk_snapshots.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + disk_snapshot = await response.parse() + assert_matches_type(AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], disk_snapshot, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete(self, async_client: AsyncRunloop) -> None: + disk_snapshot = await async_client.devboxes.disk_snapshots.delete( + "id", + ) + assert_matches_type(object, disk_snapshot, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.disk_snapshots.with_raw_response.delete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + disk_snapshot = await response.parse() + assert_matches_type(object, disk_snapshot, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.disk_snapshots.with_streaming_response.delete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + disk_snapshot = await response.parse() + assert_matches_type(object, disk_snapshot, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.disk_snapshots.with_raw_response.delete( + "", + ) diff --git a/tests/api_resources/scenarios/test_scorers.py b/tests/api_resources/scenarios/test_scorers.py index aa0d641e3..f3cc6cb50 100644 --- a/tests/api_resources/scenarios/test_scorers.py +++ b/tests/api_resources/scenarios/test_scorers.py @@ -28,7 +28,7 @@ class TestScorers: def test_method_create(self, client: Runloop) -> None: scorer = client.scenarios.scorers.create( bash_script="bash_script", - name="name", + type="type", ) assert_matches_type(ScorerCreateResponse, scorer, path=["response"]) @@ -36,7 +36,7 @@ def test_method_create(self, client: Runloop) -> None: def test_raw_response_create(self, client: Runloop) -> None: response = client.scenarios.scorers.with_raw_response.create( bash_script="bash_script", - name="name", + type="type", ) assert response.is_closed is True @@ -48,7 +48,7 @@ def test_raw_response_create(self, client: Runloop) -> None: def test_streaming_response_create(self, client: Runloop) -> None: with client.scenarios.scorers.with_streaming_response.create( bash_script="bash_script", - name="name", + type="type", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -101,7 +101,7 @@ def test_method_update(self, client: Runloop) -> None: scorer = client.scenarios.scorers.update( id="id", bash_script="bash_script", - name="name", + type="type", ) assert_matches_type(ScorerUpdateResponse, scorer, path=["response"]) @@ -110,7 +110,7 @@ def test_raw_response_update(self, client: Runloop) -> None: response = client.scenarios.scorers.with_raw_response.update( id="id", bash_script="bash_script", - name="name", + type="type", ) assert response.is_closed is True @@ -123,7 +123,7 @@ def test_streaming_response_update(self, client: Runloop) -> None: with client.scenarios.scorers.with_streaming_response.update( id="id", bash_script="bash_script", - name="name", + type="type", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -139,7 +139,7 @@ def test_path_params_update(self, client: Runloop) -> None: client.scenarios.scorers.with_raw_response.update( id="", bash_script="bash_script", - name="name", + type="type", ) @parametrize @@ -238,7 +238,7 @@ class TestAsyncScorers: async def test_method_create(self, async_client: AsyncRunloop) -> None: scorer = await async_client.scenarios.scorers.create( bash_script="bash_script", - name="name", + type="type", ) assert_matches_type(ScorerCreateResponse, scorer, path=["response"]) @@ -246,7 +246,7 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: response = await async_client.scenarios.scorers.with_raw_response.create( bash_script="bash_script", - name="name", + type="type", ) assert response.is_closed is True @@ -258,7 +258,7 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: async with async_client.scenarios.scorers.with_streaming_response.create( bash_script="bash_script", - name="name", + type="type", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -311,7 +311,7 @@ async def test_method_update(self, async_client: AsyncRunloop) -> None: scorer = await async_client.scenarios.scorers.update( id="id", bash_script="bash_script", - name="name", + type="type", ) assert_matches_type(ScorerUpdateResponse, scorer, path=["response"]) @@ -320,7 +320,7 @@ async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: response = await async_client.scenarios.scorers.with_raw_response.update( id="id", bash_script="bash_script", - name="name", + type="type", ) assert response.is_closed is True @@ -333,7 +333,7 @@ async def test_streaming_response_update(self, async_client: AsyncRunloop) -> No async with async_client.scenarios.scorers.with_streaming_response.update( id="id", bash_script="bash_script", - name="name", + type="type", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -349,7 +349,7 @@ async def test_path_params_update(self, async_client: AsyncRunloop) -> None: await async_client.scenarios.scorers.with_raw_response.update( id="", bash_script="bash_script", - name="name", + type="type", ) @parametrize diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 843c1b21d..e3faa298a 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -134,6 +134,53 @@ def test_path_params_retrieve(self, client: Runloop) -> None: "", ) + @parametrize + def test_method_update(self, client: Runloop) -> None: + devbox = client.devboxes.update( + id="id", + ) + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Runloop) -> None: + devbox = client.devboxes.update( + id="id", + metadata={"foo": "string"}, + name="name", + ) + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.update( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.update( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.update( + id="", + ) + @parametrize def test_method_list(self, client: Runloop) -> None: devbox = client.devboxes.list() @@ -960,6 +1007,53 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: "", ) + @parametrize + async def test_method_update(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.update( + id="id", + ) + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.update( + id="id", + metadata={"foo": "string"}, + name="name", + ) + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.update( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.update( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.update( + id="", + ) + @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.list() diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index 64ae41c99..78b3cebc2 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -30,6 +30,7 @@ def test_method_create(self, client: Runloop) -> None: "scoring_function_parameters": [ { "name": "name", + "type": "type", "weight": 0, } ] @@ -49,8 +50,10 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "scoring_function_parameters": [ { "name": "name", + "type": "type", "weight": 0, "bash_script": "bash_script", + "scorer_params": {}, } ] }, @@ -71,6 +74,7 @@ def test_raw_response_create(self, client: Runloop) -> None: "scoring_function_parameters": [ { "name": "name", + "type": "type", "weight": 0, } ] @@ -91,6 +95,7 @@ def test_streaming_response_create(self, client: Runloop) -> None: "scoring_function_parameters": [ { "name": "name", + "type": "type", "weight": 0, } ] @@ -263,6 +268,7 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: "scoring_function_parameters": [ { "name": "name", + "type": "type", "weight": 0, } ] @@ -282,8 +288,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "scoring_function_parameters": [ { "name": "name", + "type": "type", "weight": 0, "bash_script": "bash_script", + "scorer_params": {}, } ] }, @@ -304,6 +312,7 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: "scoring_function_parameters": [ { "name": "name", + "type": "type", "weight": 0, } ] @@ -324,6 +333,7 @@ async def test_streaming_response_create(self, async_client: AsyncRunloop) -> No "scoring_function_parameters": [ { "name": "name", + "type": "type", "weight": 0, } ] diff --git a/tests/test_client.py b/tests/test_client.py index 81c247f78..4e2d14a39 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -92,7 +92,7 @@ def test_copy_default_options(self) -> None: # options that have a default are overridden correctly copied = self.client.copy(max_retries=7) assert copied.max_retries == 7 - assert self.client.max_retries == 2 + assert self.client.max_retries == 0 copied2 = copied.copy(max_retries=6) assert copied2.max_retries == 6 @@ -738,21 +738,21 @@ class Model(BaseModel): "remaining_retries,retry_after,timeout", [ [3, "20", 20], - [3, "0", 0.5], - [3, "-10", 0.5], + [3, "0", 1], + [3, "-10", 1], [3, "60", 60], - [3, "61", 0.5], + [3, "61", 1], [3, "Fri, 29 Sep 2023 16:26:57 GMT", 20], - [3, "Fri, 29 Sep 2023 16:26:37 GMT", 0.5], - [3, "Fri, 29 Sep 2023 16:26:27 GMT", 0.5], + [3, "Fri, 29 Sep 2023 16:26:37 GMT", 1], + [3, "Fri, 29 Sep 2023 16:26:27 GMT", 1], [3, "Fri, 29 Sep 2023 16:27:37 GMT", 60], - [3, "Fri, 29 Sep 2023 16:27:38 GMT", 0.5], - [3, "99999999999999999999999999999999999", 0.5], - [3, "Zun, 29 Sep 2023 16:26:27 GMT", 0.5], - [3, "", 0.5], - [2, "", 0.5 * 2.0], - [1, "", 0.5 * 4.0], - [-1100, "", 8], # test large number potentially overflowing + [3, "Fri, 29 Sep 2023 16:27:38 GMT", 1], + [3, "99999999999999999999999999999999999", 1], + [3, "Zun, 29 Sep 2023 16:26:27 GMT", 1], + [3, "", 1], + [2, "", 1 * 2.0], + [1, "", 1 * 4.0], + [-1100, "", 10], # test large number potentially overflowing ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) @@ -762,7 +762,7 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) calculated = client._calculate_retry_timeout(remaining_retries, options, headers) - assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] + assert calculated == pytest.approx(timeout, 1 * 0.875) # pyright: ignore[reportUnknownMemberType] @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) @@ -909,7 +909,7 @@ def test_copy_default_options(self) -> None: # options that have a default are overridden correctly copied = self.client.copy(max_retries=7) assert copied.max_retries == 7 - assert self.client.max_retries == 2 + assert self.client.max_retries == 0 copied2 = copied.copy(max_retries=6) assert copied2.max_retries == 6 @@ -1558,21 +1558,21 @@ class Model(BaseModel): "remaining_retries,retry_after,timeout", [ [3, "20", 20], - [3, "0", 0.5], - [3, "-10", 0.5], + [3, "0", 1], + [3, "-10", 1], [3, "60", 60], - [3, "61", 0.5], + [3, "61", 1], [3, "Fri, 29 Sep 2023 16:26:57 GMT", 20], - [3, "Fri, 29 Sep 2023 16:26:37 GMT", 0.5], - [3, "Fri, 29 Sep 2023 16:26:27 GMT", 0.5], + [3, "Fri, 29 Sep 2023 16:26:37 GMT", 1], + [3, "Fri, 29 Sep 2023 16:26:27 GMT", 1], [3, "Fri, 29 Sep 2023 16:27:37 GMT", 60], - [3, "Fri, 29 Sep 2023 16:27:38 GMT", 0.5], - [3, "99999999999999999999999999999999999", 0.5], - [3, "Zun, 29 Sep 2023 16:26:27 GMT", 0.5], - [3, "", 0.5], - [2, "", 0.5 * 2.0], - [1, "", 0.5 * 4.0], - [-1100, "", 8], # test large number potentially overflowing + [3, "Fri, 29 Sep 2023 16:27:38 GMT", 1], + [3, "99999999999999999999999999999999999", 1], + [3, "Zun, 29 Sep 2023 16:26:27 GMT", 1], + [3, "", 1], + [2, "", 1 * 2.0], + [1, "", 1 * 4.0], + [-1100, "", 10], # test large number potentially overflowing ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) @@ -1583,7 +1583,7 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) calculated = client._calculate_retry_timeout(remaining_retries, options, headers) - assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType] + assert calculated == pytest.approx(timeout, 1 * 0.875) # pyright: ignore[reportUnknownMemberType] @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) From 0b0a65193c77cb6a9b3abc2370b4a5931019ef80 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 20:32:43 +0000 Subject: [PATCH 663/993] chore(internal): version bump (#542) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index cb9d2541c..7f3f5c846 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.22.0" + ".": "0.23.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 369c275c3..0d8b9c708 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.22.0" +version = "0.23.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index c524a520b..83f733319 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.22.0" # x-release-please-version +__version__ = "0.23.0" # x-release-please-version From fb339a23faf7c622c3b5279ba3f079f24820b2b1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 04:28:46 +0000 Subject: [PATCH 664/993] chore(internal): codegen related update (#543) --- .../resources/devboxes/lsp.py | 77 ++----- .../types/devboxes/__init__.py | 3 + .../file_definition_request_body_param.py | 15 ++ .../devboxes/lsp_file_definition_params.py | 13 +- .../devboxes/lsp_get_signature_help_params.py | 13 +- .../types/devboxes/lsp_references_params.py | 13 +- .../devboxes/references_request_body_param.py | 15 ++ .../signature_help_request_body_param.py | 15 ++ tests/api_resources/devboxes/test_lsp.py | 192 +++++++++++------- 9 files changed, 204 insertions(+), 152 deletions(-) create mode 100644 src/runloop_api_client/types/devboxes/file_definition_request_body_param.py create mode 100644 src/runloop_api_client/types/devboxes/references_request_body_param.py create mode 100644 src/runloop_api_client/types/devboxes/signature_help_request_body_param.py diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py index d1601f207..197c15424 100644 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -54,7 +54,10 @@ from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam from ...types.devboxes.code_action_context_param import CodeActionContextParam from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse +from ...types.devboxes.references_request_body_param import ReferencesRequestBodyParam from ...types.devboxes.code_action_application_result import CodeActionApplicationResult +from ...types.devboxes.signature_help_request_body_param import SignatureHelpRequestBodyParam +from ...types.devboxes.file_definition_request_body_param import FileDefinitionRequestBodyParam from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse __all__ = ["LspResource", "AsyncLspResource"] @@ -343,9 +346,7 @@ def file_definition( self, id: str, *, - character: float, - line: float, - uri: str, + file_definition_request_body: FileDefinitionRequestBodyParam, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -373,14 +374,7 @@ def file_definition( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), + body=maybe_transform(file_definition_request_body, lsp_file_definition_params.LspFileDefinitionParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -572,9 +566,7 @@ def get_signature_help( self, id: str, *, - character: float, - line: float, - uri: str, + signature_help_request_body: SignatureHelpRequestBodyParam, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -602,14 +594,7 @@ def get_signature_help( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), + body=maybe_transform(signature_help_request_body, lsp_get_signature_help_params.LspGetSignatureHelpParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -658,9 +643,7 @@ def references( self, id: str, *, - character: float, - line: float, - uri: str, + references_request_body: ReferencesRequestBodyParam, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -691,14 +674,7 @@ def references( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), + body=maybe_transform(references_request_body, lsp_references_params.LspReferencesParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -1036,9 +1012,7 @@ async def file_definition( self, id: str, *, - character: float, - line: float, - uri: str, + file_definition_request_body: FileDefinitionRequestBodyParam, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1067,12 +1041,7 @@ async def file_definition( return await self._post( f"/v1/devboxes/{id}/lsp/file-definition", body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, + file_definition_request_body, lsp_file_definition_params.LspFileDefinitionParams ), options=make_request_options( extra_headers=extra_headers, @@ -1265,9 +1234,7 @@ async def get_signature_help( self, id: str, *, - character: float, - line: float, - uri: str, + signature_help_request_body: SignatureHelpRequestBodyParam, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1296,12 +1263,7 @@ async def get_signature_help( return await self._post( f"/v1/devboxes/{id}/lsp/get-signature-help", body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, + signature_help_request_body, lsp_get_signature_help_params.LspGetSignatureHelpParams ), options=make_request_options( extra_headers=extra_headers, @@ -1351,9 +1313,7 @@ async def references( self, id: str, *, - character: float, - line: float, - uri: str, + references_request_body: ReferencesRequestBodyParam, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1384,14 +1344,7 @@ async def references( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), + body=await async_maybe_transform(references_request_body, lsp_references_params.LspReferencesParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index ebfdc7800..1033b55a9 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -72,13 +72,16 @@ from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray +from .references_request_body_param import ReferencesRequestBodyParam as ReferencesRequestBodyParam from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse from .computer_mouse_interaction_params import ComputerMouseInteractionParams as ComputerMouseInteractionParams +from .signature_help_request_body_param import SignatureHelpRequestBodyParam as SignatureHelpRequestBodyParam from .computer_screen_interaction_params import ComputerScreenInteractionParams as ComputerScreenInteractionParams +from .file_definition_request_body_param import FileDefinitionRequestBodyParam as FileDefinitionRequestBodyParam from .computer_mouse_interaction_response import ComputerMouseInteractionResponse as ComputerMouseInteractionResponse from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam from .computer_keyboard_interaction_params import ComputerKeyboardInteractionParams as ComputerKeyboardInteractionParams diff --git a/src/runloop_api_client/types/devboxes/file_definition_request_body_param.py b/src/runloop_api_client/types/devboxes/file_definition_request_body_param.py new file mode 100644 index 000000000..13388d6db --- /dev/null +++ b/src/runloop_api_client/types/devboxes/file_definition_request_body_param.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["FileDefinitionRequestBodyParam"] + + +class FileDefinitionRequestBodyParam(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py index ea8b647cc..90801737c 100644 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -2,14 +2,15 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .file_definition_request_body_param import FileDefinitionRequestBodyParam __all__ = ["LspFileDefinitionParams"] class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] + file_definition_request_body: Required[ + Annotated[FileDefinitionRequestBodyParam, PropertyInfo(alias="fileDefinitionRequestBody")] + ] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py index c15382de0..03cb33470 100644 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -2,14 +2,15 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .signature_help_request_body_param import SignatureHelpRequestBodyParam __all__ = ["LspGetSignatureHelpParams"] class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] + signature_help_request_body: Required[ + Annotated[SignatureHelpRequestBodyParam, PropertyInfo(alias="signatureHelpRequestBody")] + ] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py index f84058b8b..2d001aeee 100644 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -2,14 +2,15 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo +from .references_request_body_param import ReferencesRequestBodyParam __all__ = ["LspReferencesParams"] class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] + references_request_body: Required[ + Annotated[ReferencesRequestBodyParam, PropertyInfo(alias="referencesRequestBody")] + ] diff --git a/src/runloop_api_client/types/devboxes/references_request_body_param.py b/src/runloop_api_client/types/devboxes/references_request_body_param.py new file mode 100644 index 000000000..bf38fabe8 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/references_request_body_param.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["ReferencesRequestBodyParam"] + + +class ReferencesRequestBodyParam(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/signature_help_request_body_param.py b/src/runloop_api_client/types/devboxes/signature_help_request_body_param.py new file mode 100644 index 000000000..4dd323d05 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/signature_help_request_body_param.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["SignatureHelpRequestBodyParam"] + + +class SignatureHelpRequestBodyParam(TypedDict, total=False): + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py index c23afde06..5d8d51561 100644 --- a/tests/api_resources/devboxes/test_lsp.py +++ b/tests/api_resources/devboxes/test_lsp.py @@ -340,9 +340,11 @@ def test_path_params_file(self, client: Runloop) -> None: def test_method_file_definition(self, client: Runloop) -> None: lsp = client.devboxes.lsp.file_definition( id="id", - character=0, - line=0, - uri="uri", + file_definition_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) assert_matches_type(FileDefinitionResponse, lsp, path=["response"]) @@ -350,9 +352,11 @@ def test_method_file_definition(self, client: Runloop) -> None: def test_raw_response_file_definition(self, client: Runloop) -> None: response = client.devboxes.lsp.with_raw_response.file_definition( id="id", - character=0, - line=0, - uri="uri", + file_definition_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) assert response.is_closed is True @@ -364,9 +368,11 @@ def test_raw_response_file_definition(self, client: Runloop) -> None: def test_streaming_response_file_definition(self, client: Runloop) -> None: with client.devboxes.lsp.with_streaming_response.file_definition( id="id", - character=0, - line=0, - uri="uri", + file_definition_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -381,9 +387,11 @@ def test_path_params_file_definition(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.lsp.with_raw_response.file_definition( id="", - character=0, - line=0, - uri="uri", + file_definition_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) @parametrize @@ -644,9 +652,11 @@ def test_path_params_get_code_segment_info(self, client: Runloop) -> None: def test_method_get_signature_help(self, client: Runloop) -> None: lsp = client.devboxes.lsp.get_signature_help( id="id", - character=0, - line=0, - uri="uri", + signature_help_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) @@ -654,9 +664,11 @@ def test_method_get_signature_help(self, client: Runloop) -> None: def test_raw_response_get_signature_help(self, client: Runloop) -> None: response = client.devboxes.lsp.with_raw_response.get_signature_help( id="id", - character=0, - line=0, - uri="uri", + signature_help_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) assert response.is_closed is True @@ -668,9 +680,11 @@ def test_raw_response_get_signature_help(self, client: Runloop) -> None: def test_streaming_response_get_signature_help(self, client: Runloop) -> None: with client.devboxes.lsp.with_streaming_response.get_signature_help( id="id", - character=0, - line=0, - uri="uri", + signature_help_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -685,9 +699,11 @@ def test_path_params_get_signature_help(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.lsp.with_raw_response.get_signature_help( id="", - character=0, - line=0, - uri="uri", + signature_help_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) @parametrize @@ -732,9 +748,11 @@ def test_path_params_health(self, client: Runloop) -> None: def test_method_references(self, client: Runloop) -> None: lsp = client.devboxes.lsp.references( id="id", - character=0, - line=0, - uri="uri", + references_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) assert_matches_type(ReferencesResponse, lsp, path=["response"]) @@ -742,9 +760,11 @@ def test_method_references(self, client: Runloop) -> None: def test_raw_response_references(self, client: Runloop) -> None: response = client.devboxes.lsp.with_raw_response.references( id="id", - character=0, - line=0, - uri="uri", + references_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) assert response.is_closed is True @@ -756,9 +776,11 @@ def test_raw_response_references(self, client: Runloop) -> None: def test_streaming_response_references(self, client: Runloop) -> None: with client.devboxes.lsp.with_streaming_response.references( id="id", - character=0, - line=0, - uri="uri", + references_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -773,9 +795,11 @@ def test_path_params_references(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.lsp.with_raw_response.references( id="", - character=0, - line=0, - uri="uri", + references_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) @parametrize @@ -1133,9 +1157,11 @@ async def test_path_params_file(self, async_client: AsyncRunloop) -> None: async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: lsp = await async_client.devboxes.lsp.file_definition( id="id", - character=0, - line=0, - uri="uri", + file_definition_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) assert_matches_type(FileDefinitionResponse, lsp, path=["response"]) @@ -1143,9 +1169,11 @@ async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.lsp.with_raw_response.file_definition( id="id", - character=0, - line=0, - uri="uri", + file_definition_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) assert response.is_closed is True @@ -1157,9 +1185,11 @@ async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.lsp.with_streaming_response.file_definition( id="id", - character=0, - line=0, - uri="uri", + file_definition_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1174,9 +1204,11 @@ async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.lsp.with_raw_response.file_definition( id="", - character=0, - line=0, - uri="uri", + file_definition_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) @parametrize @@ -1437,9 +1469,11 @@ async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloo async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: lsp = await async_client.devboxes.lsp.get_signature_help( id="id", - character=0, - line=0, - uri="uri", + signature_help_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) @@ -1447,9 +1481,11 @@ async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> No async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( id="id", - character=0, - line=0, - uri="uri", + signature_help_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) assert response.is_closed is True @@ -1461,9 +1497,11 @@ async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( id="id", - character=0, - line=0, - uri="uri", + signature_help_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1478,9 +1516,11 @@ async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.lsp.with_raw_response.get_signature_help( id="", - character=0, - line=0, - uri="uri", + signature_help_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) @parametrize @@ -1525,9 +1565,11 @@ async def test_path_params_health(self, async_client: AsyncRunloop) -> None: async def test_method_references(self, async_client: AsyncRunloop) -> None: lsp = await async_client.devboxes.lsp.references( id="id", - character=0, - line=0, - uri="uri", + references_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) assert_matches_type(ReferencesResponse, lsp, path=["response"]) @@ -1535,9 +1577,11 @@ async def test_method_references(self, async_client: AsyncRunloop) -> None: async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.lsp.with_raw_response.references( id="id", - character=0, - line=0, - uri="uri", + references_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) assert response.is_closed is True @@ -1549,9 +1593,11 @@ async def test_raw_response_references(self, async_client: AsyncRunloop) -> None async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.lsp.with_streaming_response.references( id="id", - character=0, - line=0, - uri="uri", + references_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1566,9 +1612,11 @@ async def test_path_params_references(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.lsp.with_raw_response.references( id="", - character=0, - line=0, - uri="uri", + references_request_body={ + "character": 0, + "line": 0, + "uri": "uri", + }, ) @parametrize From 6f547ce7136a91376d2447ff5d06fa8c9dc0efd8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 04:38:38 +0000 Subject: [PATCH 665/993] chore(internal): update client tests (#545) --- tests/test_client.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index 4e2d14a39..cbe09ddc9 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -23,6 +23,7 @@ from runloop_api_client import Runloop, AsyncRunloop, APIResponseValidationError from runloop_api_client._types import Omit +from runloop_api_client._utils import maybe_transform from runloop_api_client._models import BaseModel, FinalRequestOptions from runloop_api_client._constants import RAW_RESPONSE_HEADER from runloop_api_client._exceptions import RunloopError, APIStatusError, APITimeoutError, APIResponseValidationError @@ -32,6 +33,7 @@ BaseClient, make_request_options, ) +from runloop_api_client.types.devbox_create_params import DevboxCreateParams from .utils import update_env @@ -772,7 +774,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No with pytest.raises(APITimeoutError): self.client.post( "/v1/devboxes", - body=cast(object, dict()), + body=cast(object, maybe_transform(dict(), DevboxCreateParams)), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, ) @@ -787,7 +789,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non with pytest.raises(APIStatusError): self.client.post( "/v1/devboxes", - body=cast(object, dict()), + body=cast(object, maybe_transform(dict(), DevboxCreateParams)), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, ) @@ -1593,7 +1595,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) with pytest.raises(APITimeoutError): await self.client.post( "/v1/devboxes", - body=cast(object, dict()), + body=cast(object, maybe_transform(dict(), DevboxCreateParams)), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, ) @@ -1608,7 +1610,7 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) with pytest.raises(APIStatusError): await self.client.post( "/v1/devboxes", - body=cast(object, dict()), + body=cast(object, maybe_transform(dict(), DevboxCreateParams)), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, ) From 5143126fc0ee28edd9928843b6ecd3998860946a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 04:43:21 +0000 Subject: [PATCH 666/993] chore(internal): codegen related update (#546) --- .../resources/devboxes/lsp.py | 77 +++++-- .../types/devboxes/__init__.py | 3 - .../file_definition_request_body_param.py | 15 -- .../devboxes/lsp_file_definition_params.py | 13 +- .../devboxes/lsp_get_signature_help_params.py | 13 +- .../types/devboxes/lsp_references_params.py | 13 +- .../devboxes/references_request_body_param.py | 15 -- .../signature_help_request_body_param.py | 15 -- tests/api_resources/devboxes/test_lsp.py | 192 +++++++----------- 9 files changed, 152 insertions(+), 204 deletions(-) delete mode 100644 src/runloop_api_client/types/devboxes/file_definition_request_body_param.py delete mode 100644 src/runloop_api_client/types/devboxes/references_request_body_param.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_request_body_param.py diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py index 197c15424..d1601f207 100644 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -54,10 +54,7 @@ from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam from ...types.devboxes.code_action_context_param import CodeActionContextParam from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.references_request_body_param import ReferencesRequestBodyParam from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.signature_help_request_body_param import SignatureHelpRequestBodyParam -from ...types.devboxes.file_definition_request_body_param import FileDefinitionRequestBodyParam from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse __all__ = ["LspResource", "AsyncLspResource"] @@ -346,7 +343,9 @@ def file_definition( self, id: str, *, - file_definition_request_body: FileDefinitionRequestBodyParam, + character: float, + line: float, + uri: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -374,7 +373,14 @@ def file_definition( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform(file_definition_request_body, lsp_file_definition_params.LspFileDefinitionParams), + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -566,7 +572,9 @@ def get_signature_help( self, id: str, *, - signature_help_request_body: SignatureHelpRequestBodyParam, + character: float, + line: float, + uri: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -594,7 +602,14 @@ def get_signature_help( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform(signature_help_request_body, lsp_get_signature_help_params.LspGetSignatureHelpParams), + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -643,7 +658,9 @@ def references( self, id: str, *, - references_request_body: ReferencesRequestBodyParam, + character: float, + line: float, + uri: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -674,7 +691,14 @@ def references( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform(references_request_body, lsp_references_params.LspReferencesParams), + body=maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -1012,7 +1036,9 @@ async def file_definition( self, id: str, *, - file_definition_request_body: FileDefinitionRequestBodyParam, + character: float, + line: float, + uri: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1041,7 +1067,12 @@ async def file_definition( return await self._post( f"/v1/devboxes/{id}/lsp/file-definition", body=await async_maybe_transform( - file_definition_request_body, lsp_file_definition_params.LspFileDefinitionParams + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_file_definition_params.LspFileDefinitionParams, ), options=make_request_options( extra_headers=extra_headers, @@ -1234,7 +1265,9 @@ async def get_signature_help( self, id: str, *, - signature_help_request_body: SignatureHelpRequestBodyParam, + character: float, + line: float, + uri: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1263,7 +1296,12 @@ async def get_signature_help( return await self._post( f"/v1/devboxes/{id}/lsp/get-signature-help", body=await async_maybe_transform( - signature_help_request_body, lsp_get_signature_help_params.LspGetSignatureHelpParams + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_get_signature_help_params.LspGetSignatureHelpParams, ), options=make_request_options( extra_headers=extra_headers, @@ -1313,7 +1351,9 @@ async def references( self, id: str, *, - references_request_body: ReferencesRequestBodyParam, + character: float, + line: float, + uri: str, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1344,7 +1384,14 @@ async def references( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform(references_request_body, lsp_references_params.LspReferencesParams), + body=await async_maybe_transform( + { + "character": character, + "line": line, + "uri": uri, + }, + lsp_references_params.LspReferencesParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 1033b55a9..ebfdc7800 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -72,16 +72,13 @@ from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .references_request_body_param import ReferencesRequestBodyParam as ReferencesRequestBodyParam from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse from .computer_mouse_interaction_params import ComputerMouseInteractionParams as ComputerMouseInteractionParams -from .signature_help_request_body_param import SignatureHelpRequestBodyParam as SignatureHelpRequestBodyParam from .computer_screen_interaction_params import ComputerScreenInteractionParams as ComputerScreenInteractionParams -from .file_definition_request_body_param import FileDefinitionRequestBodyParam as FileDefinitionRequestBodyParam from .computer_mouse_interaction_response import ComputerMouseInteractionResponse as ComputerMouseInteractionResponse from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam from .computer_keyboard_interaction_params import ComputerKeyboardInteractionParams as ComputerKeyboardInteractionParams diff --git a/src/runloop_api_client/types/devboxes/file_definition_request_body_param.py b/src/runloop_api_client/types/devboxes/file_definition_request_body_param.py deleted file mode 100644 index 13388d6db..000000000 --- a/src/runloop_api_client/types/devboxes/file_definition_request_body_param.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["FileDefinitionRequestBodyParam"] - - -class FileDefinitionRequestBodyParam(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py index 90801737c..ea8b647cc 100644 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py @@ -2,15 +2,14 @@ from __future__ import annotations -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_definition_request_body_param import FileDefinitionRequestBodyParam +from typing_extensions import Required, TypedDict __all__ = ["LspFileDefinitionParams"] class LspFileDefinitionParams(TypedDict, total=False): - file_definition_request_body: Required[ - Annotated[FileDefinitionRequestBodyParam, PropertyInfo(alias="fileDefinitionRequestBody")] - ] + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py index 03cb33470..c15382de0 100644 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py @@ -2,15 +2,14 @@ from __future__ import annotations -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .signature_help_request_body_param import SignatureHelpRequestBodyParam +from typing_extensions import Required, TypedDict __all__ = ["LspGetSignatureHelpParams"] class LspGetSignatureHelpParams(TypedDict, total=False): - signature_help_request_body: Required[ - Annotated[SignatureHelpRequestBodyParam, PropertyInfo(alias="signatureHelpRequestBody")] - ] + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py index 2d001aeee..f84058b8b 100644 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ b/src/runloop_api_client/types/devboxes/lsp_references_params.py @@ -2,15 +2,14 @@ from __future__ import annotations -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .references_request_body_param import ReferencesRequestBodyParam +from typing_extensions import Required, TypedDict __all__ = ["LspReferencesParams"] class LspReferencesParams(TypedDict, total=False): - references_request_body: Required[ - Annotated[ReferencesRequestBodyParam, PropertyInfo(alias="referencesRequestBody")] - ] + character: Required[float] + + line: Required[float] + + uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/references_request_body_param.py b/src/runloop_api_client/types/devboxes/references_request_body_param.py deleted file mode 100644 index bf38fabe8..000000000 --- a/src/runloop_api_client/types/devboxes/references_request_body_param.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["ReferencesRequestBodyParam"] - - -class ReferencesRequestBodyParam(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/signature_help_request_body_param.py b/src/runloop_api_client/types/devboxes/signature_help_request_body_param.py deleted file mode 100644 index 4dd323d05..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_request_body_param.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["SignatureHelpRequestBodyParam"] - - -class SignatureHelpRequestBodyParam(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py index 5d8d51561..c23afde06 100644 --- a/tests/api_resources/devboxes/test_lsp.py +++ b/tests/api_resources/devboxes/test_lsp.py @@ -340,11 +340,9 @@ def test_path_params_file(self, client: Runloop) -> None: def test_method_file_definition(self, client: Runloop) -> None: lsp = client.devboxes.lsp.file_definition( id="id", - file_definition_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) assert_matches_type(FileDefinitionResponse, lsp, path=["response"]) @@ -352,11 +350,9 @@ def test_method_file_definition(self, client: Runloop) -> None: def test_raw_response_file_definition(self, client: Runloop) -> None: response = client.devboxes.lsp.with_raw_response.file_definition( id="id", - file_definition_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) assert response.is_closed is True @@ -368,11 +364,9 @@ def test_raw_response_file_definition(self, client: Runloop) -> None: def test_streaming_response_file_definition(self, client: Runloop) -> None: with client.devboxes.lsp.with_streaming_response.file_definition( id="id", - file_definition_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -387,11 +381,9 @@ def test_path_params_file_definition(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.lsp.with_raw_response.file_definition( id="", - file_definition_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) @parametrize @@ -652,11 +644,9 @@ def test_path_params_get_code_segment_info(self, client: Runloop) -> None: def test_method_get_signature_help(self, client: Runloop) -> None: lsp = client.devboxes.lsp.get_signature_help( id="id", - signature_help_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) @@ -664,11 +654,9 @@ def test_method_get_signature_help(self, client: Runloop) -> None: def test_raw_response_get_signature_help(self, client: Runloop) -> None: response = client.devboxes.lsp.with_raw_response.get_signature_help( id="id", - signature_help_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) assert response.is_closed is True @@ -680,11 +668,9 @@ def test_raw_response_get_signature_help(self, client: Runloop) -> None: def test_streaming_response_get_signature_help(self, client: Runloop) -> None: with client.devboxes.lsp.with_streaming_response.get_signature_help( id="id", - signature_help_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -699,11 +685,9 @@ def test_path_params_get_signature_help(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.lsp.with_raw_response.get_signature_help( id="", - signature_help_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) @parametrize @@ -748,11 +732,9 @@ def test_path_params_health(self, client: Runloop) -> None: def test_method_references(self, client: Runloop) -> None: lsp = client.devboxes.lsp.references( id="id", - references_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) assert_matches_type(ReferencesResponse, lsp, path=["response"]) @@ -760,11 +742,9 @@ def test_method_references(self, client: Runloop) -> None: def test_raw_response_references(self, client: Runloop) -> None: response = client.devboxes.lsp.with_raw_response.references( id="id", - references_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) assert response.is_closed is True @@ -776,11 +756,9 @@ def test_raw_response_references(self, client: Runloop) -> None: def test_streaming_response_references(self, client: Runloop) -> None: with client.devboxes.lsp.with_streaming_response.references( id="id", - references_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -795,11 +773,9 @@ def test_path_params_references(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.lsp.with_raw_response.references( id="", - references_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) @parametrize @@ -1157,11 +1133,9 @@ async def test_path_params_file(self, async_client: AsyncRunloop) -> None: async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: lsp = await async_client.devboxes.lsp.file_definition( id="id", - file_definition_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) assert_matches_type(FileDefinitionResponse, lsp, path=["response"]) @@ -1169,11 +1143,9 @@ async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.lsp.with_raw_response.file_definition( id="id", - file_definition_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) assert response.is_closed is True @@ -1185,11 +1157,9 @@ async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.lsp.with_streaming_response.file_definition( id="id", - file_definition_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1204,11 +1174,9 @@ async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.lsp.with_raw_response.file_definition( id="", - file_definition_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) @parametrize @@ -1469,11 +1437,9 @@ async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloo async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: lsp = await async_client.devboxes.lsp.get_signature_help( id="id", - signature_help_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) @@ -1481,11 +1447,9 @@ async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> No async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( id="id", - signature_help_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) assert response.is_closed is True @@ -1497,11 +1461,9 @@ async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( id="id", - signature_help_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1516,11 +1478,9 @@ async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.lsp.with_raw_response.get_signature_help( id="", - signature_help_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) @parametrize @@ -1565,11 +1525,9 @@ async def test_path_params_health(self, async_client: AsyncRunloop) -> None: async def test_method_references(self, async_client: AsyncRunloop) -> None: lsp = await async_client.devboxes.lsp.references( id="id", - references_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) assert_matches_type(ReferencesResponse, lsp, path=["response"]) @@ -1577,11 +1535,9 @@ async def test_method_references(self, async_client: AsyncRunloop) -> None: async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.lsp.with_raw_response.references( id="id", - references_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) assert response.is_closed is True @@ -1593,11 +1549,9 @@ async def test_raw_response_references(self, async_client: AsyncRunloop) -> None async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.lsp.with_streaming_response.references( id="id", - references_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1612,11 +1566,9 @@ async def test_path_params_references(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.lsp.with_raw_response.references( id="", - references_request_body={ - "character": 0, - "line": 0, - "uri": "uri", - }, + character=0, + line=0, + uri="uri", ) @parametrize From f3c401a9e844d4a5be3fb155977df3ac2f77a8a6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 04:15:35 +0000 Subject: [PATCH 667/993] fix: asyncify on non-asyncio runtimes (#547) --- src/runloop_api_client/_utils/_sync.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/runloop_api_client/_utils/_sync.py b/src/runloop_api_client/_utils/_sync.py index 8b3aaf2b5..ad7ec71b7 100644 --- a/src/runloop_api_client/_utils/_sync.py +++ b/src/runloop_api_client/_utils/_sync.py @@ -7,16 +7,20 @@ from typing import Any, TypeVar, Callable, Awaitable from typing_extensions import ParamSpec +import anyio +import sniffio +import anyio.to_thread + T_Retval = TypeVar("T_Retval") T_ParamSpec = ParamSpec("T_ParamSpec") if sys.version_info >= (3, 9): - to_thread = asyncio.to_thread + _asyncio_to_thread = asyncio.to_thread else: # backport of https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread # for Python 3.8 support - async def to_thread( + async def _asyncio_to_thread( func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs ) -> Any: """Asynchronously run function *func* in a separate thread. @@ -34,6 +38,17 @@ async def to_thread( return await loop.run_in_executor(None, func_call) +async def to_thread( + func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs +) -> T_Retval: + if sniffio.current_async_library() == "asyncio": + return await _asyncio_to_thread(func, *args, **kwargs) + + return await anyio.to_thread.run_sync( + functools.partial(func, *args, **kwargs), + ) + + # inspired by `asyncer`, https://github.com/tiangolo/asyncer def asyncify(function: Callable[T_ParamSpec, T_Retval]) -> Callable[T_ParamSpec, Awaitable[T_Retval]]: """ From 5b7ee452fe2088a53fcc9c0291b5b977e6d51d83 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 04:18:02 +0000 Subject: [PATCH 668/993] chore(internal): update client tests (#548) --- tests/test_client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index cbe09ddc9..638f65a36 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -774,7 +774,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No with pytest.raises(APITimeoutError): self.client.post( "/v1/devboxes", - body=cast(object, maybe_transform(dict(), DevboxCreateParams)), + body=cast(object, maybe_transform({}, DevboxCreateParams)), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, ) @@ -789,7 +789,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non with pytest.raises(APIStatusError): self.client.post( "/v1/devboxes", - body=cast(object, maybe_transform(dict(), DevboxCreateParams)), + body=cast(object, maybe_transform({}, DevboxCreateParams)), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, ) @@ -1595,7 +1595,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) with pytest.raises(APITimeoutError): await self.client.post( "/v1/devboxes", - body=cast(object, maybe_transform(dict(), DevboxCreateParams)), + body=cast(object, maybe_transform({}, DevboxCreateParams)), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, ) @@ -1610,7 +1610,7 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) with pytest.raises(APIStatusError): await self.client.post( "/v1/devboxes", - body=cast(object, maybe_transform(dict(), DevboxCreateParams)), + body=cast(object, maybe_transform({}, DevboxCreateParams)), cast_to=httpx.Response, options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, ) From cdd34799ec0feeed8442666e77e2431709c8caf1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 01:03:44 +0000 Subject: [PATCH 669/993] feat(api): api update (#549) --- .stats.yml | 2 +- .../resources/benchmarks/benchmarks.py | 18 ++++++++++- .../resources/scenarios/scenarios.py | 30 ++++++++++++++++++- .../types/benchmark_create_params.py | 5 +++- .../types/benchmark_run_view.py | 11 ++++--- .../types/benchmark_start_run_params.py | 5 +++- .../types/benchmark_view.py | 5 +++- .../types/scenario_create_params.py | 12 +++++++- .../types/scenario_environment.py | 10 +++++++ .../types/scenario_environment_param.py | 11 +++++++ .../types/scenario_run_view.py | 5 +++- .../types/scenario_start_run_params.py | 5 +++- src/runloop_api_client/types/scenario_view.py | 12 +++++++- .../types/scoring_function.py | 13 +++++--- .../types/scoring_function_param.py | 13 +++++--- .../types/scoring_function_result_view.py | 4 +++ tests/api_resources/scenarios/test_scorers.py | 22 ++++++++++++++ tests/api_resources/test_benchmarks.py | 4 +++ tests/api_resources/test_scenarios.py | 28 +++++++++++++++++ 19 files changed, 193 insertions(+), 22 deletions(-) diff --git a/.stats.yml b/.stats.yml index fb43e6c65..89dc8775e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 77 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a3d91c690527ff6a9040ade46943ba56916987f1f7d1fb45a9974546770ffe97.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-cb8add05a7b418d6f8a5624be8477564853da49e8bf9671ae89b8ce49a04b6cd.yml diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py index f1ea0ffe7..54501bfa3 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Optional +from typing import Dict, List, Optional import httpx @@ -69,6 +69,7 @@ def create( self, *, name: str, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -84,6 +85,8 @@ def create( Args: name: The name of the Benchmark. + metadata: User defined metadata to attach to the benchmark for organization. + scenario_ids: The Scenario IDs that make up the Benchmark. extra_headers: Send extra headers @@ -101,6 +104,7 @@ def create( body=maybe_transform( { "name": name, + "metadata": metadata, "scenario_ids": scenario_ids, }, benchmark_create_params.BenchmarkCreateParams, @@ -246,6 +250,7 @@ def start_run( self, *, benchmark_id: str, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, run_name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -261,6 +266,8 @@ def start_run( Args: benchmark_id: ID of the Benchmark to run. + metadata: User defined metadata to attach to the benchmark run for organization. + run_name: Display name of the run. extra_headers: Send extra headers @@ -278,6 +285,7 @@ def start_run( body=maybe_transform( { "benchmark_id": benchmark_id, + "metadata": metadata, "run_name": run_name, }, benchmark_start_run_params.BenchmarkStartRunParams, @@ -321,6 +329,7 @@ async def create( self, *, name: str, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -336,6 +345,8 @@ async def create( Args: name: The name of the Benchmark. + metadata: User defined metadata to attach to the benchmark for organization. + scenario_ids: The Scenario IDs that make up the Benchmark. extra_headers: Send extra headers @@ -353,6 +364,7 @@ async def create( body=await async_maybe_transform( { "name": name, + "metadata": metadata, "scenario_ids": scenario_ids, }, benchmark_create_params.BenchmarkCreateParams, @@ -498,6 +510,7 @@ async def start_run( self, *, benchmark_id: str, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, run_name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -513,6 +526,8 @@ async def start_run( Args: benchmark_id: ID of the Benchmark to run. + metadata: User defined metadata to attach to the benchmark run for organization. + run_name: Display name of the run. extra_headers: Send extra headers @@ -530,6 +545,7 @@ async def start_run( body=await async_maybe_transform( { "benchmark_id": benchmark_id, + "metadata": metadata, "run_name": run_name, }, benchmark_start_run_params.BenchmarkStartRunParams, diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index 117eb39a4..927028016 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Optional +from typing import Dict, Optional import httpx @@ -87,6 +87,8 @@ def create( name: str, scoring_contract: ScoringContractParam, environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + reference_output: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -108,6 +110,12 @@ def create( environment_parameters: The Environment in which the Scenario will run. + metadata: User defined metadata to attach to the scenario for organization. + + reference_output: A string representation of the reference output to solve the scenario. Commonly + can be the result of a git diff or a sequence of command actions to apply to the + environment. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -126,6 +134,8 @@ def create( "name": name, "scoring_contract": scoring_contract, "environment_parameters": environment_parameters, + "metadata": metadata, + "reference_output": reference_output, }, scenario_create_params.ScenarioCreateParams, ), @@ -280,6 +290,7 @@ def start_run( *, scenario_id: str, benchmark_run_id: Optional[str] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, run_name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -297,6 +308,8 @@ def start_run( benchmark_run_id: Benchmark to associate the run. + metadata: User defined metadata to attach to the run for organization. + run_name: Display name of the run. extra_headers: Send extra headers @@ -315,6 +328,7 @@ def start_run( { "scenario_id": scenario_id, "benchmark_run_id": benchmark_run_id, + "metadata": metadata, "run_name": run_name, }, scenario_start_run_params.ScenarioStartRunParams, @@ -365,6 +379,8 @@ async def create( name: str, scoring_contract: ScoringContractParam, environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + reference_output: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -386,6 +402,12 @@ async def create( environment_parameters: The Environment in which the Scenario will run. + metadata: User defined metadata to attach to the scenario for organization. + + reference_output: A string representation of the reference output to solve the scenario. Commonly + can be the result of a git diff or a sequence of command actions to apply to the + environment. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -404,6 +426,8 @@ async def create( "name": name, "scoring_contract": scoring_contract, "environment_parameters": environment_parameters, + "metadata": metadata, + "reference_output": reference_output, }, scenario_create_params.ScenarioCreateParams, ), @@ -558,6 +582,7 @@ async def start_run( *, scenario_id: str, benchmark_run_id: Optional[str] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, run_name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -575,6 +600,8 @@ async def start_run( benchmark_run_id: Benchmark to associate the run. + metadata: User defined metadata to attach to the run for organization. + run_name: Display name of the run. extra_headers: Send extra headers @@ -593,6 +620,7 @@ async def start_run( { "scenario_id": scenario_id, "benchmark_run_id": benchmark_run_id, + "metadata": metadata, "run_name": run_name, }, scenario_start_run_params.ScenarioStartRunParams, diff --git a/src/runloop_api_client/types/benchmark_create_params.py b/src/runloop_api_client/types/benchmark_create_params.py index 3fea3d2a0..1597e3768 100644 --- a/src/runloop_api_client/types/benchmark_create_params.py +++ b/src/runloop_api_client/types/benchmark_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Optional +from typing import Dict, List, Optional from typing_extensions import Required, TypedDict __all__ = ["BenchmarkCreateParams"] @@ -12,5 +12,8 @@ class BenchmarkCreateParams(TypedDict, total=False): name: Required[str] """The name of the Benchmark.""" + metadata: Optional[Dict[str, str]] + """User defined metadata to attach to the benchmark for organization.""" + scenario_ids: Optional[List[str]] """The Scenario IDs that make up the Benchmark.""" diff --git a/src/runloop_api_client/types/benchmark_run_view.py b/src/runloop_api_client/types/benchmark_run_view.py index 51af18a0f..9bfbd3858 100644 --- a/src/runloop_api_client/types/benchmark_run_view.py +++ b/src/runloop_api_client/types/benchmark_run_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Dict, List, Optional from typing_extensions import Literal from .._models import BaseModel @@ -15,6 +15,12 @@ class BenchmarkRunView(BaseModel): benchmark_id: str """The ID of the Benchmark.""" + metadata: Dict[str, str] + """User defined metadata to attach to the benchmark run for organization.""" + + pending_scenarios: List[str] + """List of Scenarios that need to be completed before benchmark can be completed.""" + start_time_ms: int """The time the benchmark run execution started (Unix timestamp milliseconds).""" @@ -27,9 +33,6 @@ class BenchmarkRunView(BaseModel): name: Optional[str] = None """The name of the BenchmarkRun.""" - pending_scenarios: Optional[List[str]] = None - """List of Scenarios that need to be completed before benchmark can be completed.""" - score: Optional[float] = None """The final score across the BenchmarkRun, present once completed. diff --git a/src/runloop_api_client/types/benchmark_start_run_params.py b/src/runloop_api_client/types/benchmark_start_run_params.py index 39d618669..9a0a70057 100644 --- a/src/runloop_api_client/types/benchmark_start_run_params.py +++ b/src/runloop_api_client/types/benchmark_start_run_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Optional +from typing import Dict, Optional from typing_extensions import Required, TypedDict __all__ = ["BenchmarkStartRunParams"] @@ -12,5 +12,8 @@ class BenchmarkStartRunParams(TypedDict, total=False): benchmark_id: Required[str] """ID of the Benchmark to run.""" + metadata: Optional[Dict[str, str]] + """User defined metadata to attach to the benchmark run for organization.""" + run_name: Optional[str] """Display name of the run.""" diff --git a/src/runloop_api_client/types/benchmark_view.py b/src/runloop_api_client/types/benchmark_view.py index 071415151..7f2f1e1e3 100644 --- a/src/runloop_api_client/types/benchmark_view.py +++ b/src/runloop_api_client/types/benchmark_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import Dict, List from pydantic import Field as FieldInfo @@ -13,6 +13,9 @@ class BenchmarkView(BaseModel): id: str """The ID of the Benchmark.""" + metadata: Dict[str, str] + """User defined metadata to attach to the benchmark for organization.""" + name: str """The name of the Benchmark.""" diff --git a/src/runloop_api_client/types/scenario_create_params.py b/src/runloop_api_client/types/scenario_create_params.py index 87a48b457..5bd2f3d90 100644 --- a/src/runloop_api_client/types/scenario_create_params.py +++ b/src/runloop_api_client/types/scenario_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Optional +from typing import Dict, Optional from typing_extensions import Required, TypedDict from .input_context_param import InputContextParam @@ -24,3 +24,13 @@ class ScenarioCreateParams(TypedDict, total=False): environment_parameters: Optional[ScenarioEnvironmentParam] """The Environment in which the Scenario will run.""" + + metadata: Optional[Dict[str, str]] + """User defined metadata to attach to the scenario for organization.""" + + reference_output: Optional[str] + """A string representation of the reference output to solve the scenario. + + Commonly can be the result of a git diff or a sequence of command actions to + apply to the environment. + """ diff --git a/src/runloop_api_client/types/scenario_environment.py b/src/runloop_api_client/types/scenario_environment.py index 756ab33e1..97c2977fc 100644 --- a/src/runloop_api_client/types/scenario_environment.py +++ b/src/runloop_api_client/types/scenario_environment.py @@ -3,6 +3,7 @@ from typing import Optional from .._models import BaseModel +from .shared.launch_parameters import LaunchParameters __all__ = ["ScenarioEnvironment"] @@ -11,8 +12,17 @@ class ScenarioEnvironment(BaseModel): blueprint_id: Optional[str] = None """Use the blueprint with matching ID.""" + launch_parameters: Optional[LaunchParameters] = None + """Optional launch parameters to apply to the devbox environment at launch.""" + prebuilt_id: Optional[str] = None """Use the prebuilt with matching ID.""" snapshot_id: Optional[str] = None """Use the snapshot with matching ID.""" + + working_directory: Optional[str] = None + """The working directory where the agent is expected to fulfill the scenario. + + Scoring functions also run from the working directory. + """ diff --git a/src/runloop_api_client/types/scenario_environment_param.py b/src/runloop_api_client/types/scenario_environment_param.py index a59c8b8b1..3b749bb76 100644 --- a/src/runloop_api_client/types/scenario_environment_param.py +++ b/src/runloop_api_client/types/scenario_environment_param.py @@ -5,6 +5,8 @@ from typing import Optional from typing_extensions import TypedDict +from .shared_params.launch_parameters import LaunchParameters + __all__ = ["ScenarioEnvironmentParam"] @@ -12,8 +14,17 @@ class ScenarioEnvironmentParam(TypedDict, total=False): blueprint_id: Optional[str] """Use the blueprint with matching ID.""" + launch_parameters: Optional[LaunchParameters] + """Optional launch parameters to apply to the devbox environment at launch.""" + prebuilt_id: Optional[str] """Use the prebuilt with matching ID.""" snapshot_id: Optional[str] """Use the snapshot with matching ID.""" + + working_directory: Optional[str] + """The working directory where the agent is expected to fulfill the scenario. + + Scoring functions also run from the working directory. + """ diff --git a/src/runloop_api_client/types/scenario_run_view.py b/src/runloop_api_client/types/scenario_run_view.py index 89d64dfd1..893279409 100644 --- a/src/runloop_api_client/types/scenario_run_view.py +++ b/src/runloop_api_client/types/scenario_run_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import Dict, Optional from typing_extensions import Literal from .._models import BaseModel @@ -16,6 +16,9 @@ class ScenarioRunView(BaseModel): devbox_id: str """ID of the Devbox on which the Scenario is running.""" + metadata: Dict[str, str] + """User defined metadata to attach to the scenario run for organization.""" + scenario_id: str """ID of the Scenario that has been run.""" diff --git a/src/runloop_api_client/types/scenario_start_run_params.py b/src/runloop_api_client/types/scenario_start_run_params.py index 6704db386..f9161aa2f 100644 --- a/src/runloop_api_client/types/scenario_start_run_params.py +++ b/src/runloop_api_client/types/scenario_start_run_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Optional +from typing import Dict, Optional from typing_extensions import Required, TypedDict __all__ = ["ScenarioStartRunParams"] @@ -15,5 +15,8 @@ class ScenarioStartRunParams(TypedDict, total=False): benchmark_run_id: Optional[str] """Benchmark to associate the run.""" + metadata: Optional[Dict[str, str]] + """User defined metadata to attach to the run for organization.""" + run_name: Optional[str] """Display name of the run.""" diff --git a/src/runloop_api_client/types/scenario_view.py b/src/runloop_api_client/types/scenario_view.py index d69c792b4..4ba20d9c9 100644 --- a/src/runloop_api_client/types/scenario_view.py +++ b/src/runloop_api_client/types/scenario_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import Dict, Optional from .._models import BaseModel from .input_context import InputContext @@ -17,6 +17,9 @@ class ScenarioView(BaseModel): input_context: InputContext """The input context for the Scenario.""" + metadata: Dict[str, str] + """User defined metadata to attach to the scenario for organization.""" + name: str """The name of the Scenario.""" @@ -25,3 +28,10 @@ class ScenarioView(BaseModel): environment: Optional[ScenarioEnvironment] = None """The Environment in which the Scenario is run.""" + + reference_output: Optional[str] = None + """A string representation of the reference output to solve the scenario. + + Commonly can be the result of a git diff or a sequence of command actions to + apply to the environment. + """ diff --git a/src/runloop_api_client/types/scoring_function.py b/src/runloop_api_client/types/scoring_function.py index a5adc2b75..bef775eca 100644 --- a/src/runloop_api_client/types/scoring_function.py +++ b/src/runloop_api_client/types/scoring_function.py @@ -9,10 +9,15 @@ class ScoringFunction(BaseModel): name: str - """Name of scoring function.""" + """Name of scoring function. Names must only contain [a-zA-Z0-9_-].""" type: str - """Type of the scoring function. Defaults to bash script.""" + """Type of the scoring function. + + Use 'bash' as type and fill out 'bash_script' field for scoring via custom bash + scripts. Otherwise use a type corresponding to a custom scorer function or a + public Runloop scorer type. + """ weight: float """Wight to apply to scoring function score. @@ -23,8 +28,8 @@ class ScoringFunction(BaseModel): bash_script: Optional[str] = None """ A single bash script that sets up the environment, scores, and prints the final - score to standard out. Score should be an integer between 0 and 100, and look - like "score=[0..100]. + score to standard out. Score should be a float between 0.0 and 1.0, and look + like "score=[0.0..1.0]. """ scorer_params: Optional[object] = None diff --git a/src/runloop_api_client/types/scoring_function_param.py b/src/runloop_api_client/types/scoring_function_param.py index 1f101bad2..0caa61468 100644 --- a/src/runloop_api_client/types/scoring_function_param.py +++ b/src/runloop_api_client/types/scoring_function_param.py @@ -10,10 +10,15 @@ class ScoringFunctionParam(TypedDict, total=False): name: Required[str] - """Name of scoring function.""" + """Name of scoring function. Names must only contain [a-zA-Z0-9_-].""" type: Required[str] - """Type of the scoring function. Defaults to bash script.""" + """Type of the scoring function. + + Use 'bash' as type and fill out 'bash_script' field for scoring via custom bash + scripts. Otherwise use a type corresponding to a custom scorer function or a + public Runloop scorer type. + """ weight: Required[float] """Wight to apply to scoring function score. @@ -24,8 +29,8 @@ class ScoringFunctionParam(TypedDict, total=False): bash_script: Optional[str] """ A single bash script that sets up the environment, scores, and prints the final - score to standard out. Score should be an integer between 0 and 100, and look - like "score=[0..100]. + score to standard out. Score should be a float between 0.0 and 1.0, and look + like "score=[0.0..1.0]. """ scorer_params: Optional[object] diff --git a/src/runloop_api_client/types/scoring_function_result_view.py b/src/runloop_api_client/types/scoring_function_result_view.py index 7fcbcd50c..8f782df11 100644 --- a/src/runloop_api_client/types/scoring_function_result_view.py +++ b/src/runloop_api_client/types/scoring_function_result_view.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing_extensions import Literal from .._models import BaseModel @@ -15,3 +16,6 @@ class ScoringFunctionResultView(BaseModel): scoring_function_name: str """Scoring function name that ran.""" + + state: Literal["unknown", "complete", "error"] + """The state of the scoring function application.""" diff --git a/tests/api_resources/scenarios/test_scorers.py b/tests/api_resources/scenarios/test_scorers.py index f3cc6cb50..4c04211da 100644 --- a/tests/api_resources/scenarios/test_scorers.py +++ b/tests/api_resources/scenarios/test_scorers.py @@ -190,8 +190,19 @@ def test_method_validate_with_all_params(self, client: Runloop) -> None: scoring_context={}, environment_parameters={ "blueprint_id": "blueprint_id", + "launch_parameters": { + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "shutdown", + }, + "available_ports": [0], + "keep_alive_time_seconds": 0, + "launch_commands": ["string"], + "resource_size_request": "SMALL", + }, "prebuilt_id": "prebuilt_id", "snapshot_id": "snapshot_id", + "working_directory": "working_directory", }, ) assert_matches_type(ScorerValidateResponse, scorer, path=["response"]) @@ -400,8 +411,19 @@ async def test_method_validate_with_all_params(self, async_client: AsyncRunloop) scoring_context={}, environment_parameters={ "blueprint_id": "blueprint_id", + "launch_parameters": { + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "shutdown", + }, + "available_ports": [0], + "keep_alive_time_seconds": 0, + "launch_commands": ["string"], + "resource_size_request": "SMALL", + }, "prebuilt_id": "prebuilt_id", "snapshot_id": "snapshot_id", + "working_directory": "working_directory", }, ) assert_matches_type(ScorerValidateResponse, scorer, path=["response"]) diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py index 82ed0bfa1..087dffb1e 100644 --- a/tests/api_resources/test_benchmarks.py +++ b/tests/api_resources/test_benchmarks.py @@ -32,6 +32,7 @@ def test_method_create(self, client: Runloop) -> None: def test_method_create_with_all_params(self, client: Runloop) -> None: benchmark = client.benchmarks.create( name="name", + metadata={"foo": "string"}, scenario_ids=["string"], ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -175,6 +176,7 @@ def test_method_start_run(self, client: Runloop) -> None: def test_method_start_run_with_all_params(self, client: Runloop) -> None: benchmark = client.benchmarks.start_run( benchmark_id="benchmark_id", + metadata={"foo": "string"}, run_name="run_name", ) assert_matches_type(BenchmarkRunView, benchmark, path=["response"]) @@ -218,6 +220,7 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.create( name="name", + metadata={"foo": "string"}, scenario_ids=["string"], ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -361,6 +364,7 @@ async def test_method_start_run(self, async_client: AsyncRunloop) -> None: async def test_method_start_run_with_all_params(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.start_run( benchmark_id="benchmark_id", + metadata={"foo": "string"}, run_name="run_name", ) assert_matches_type(BenchmarkRunView, benchmark, path=["response"]) diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index 78b3cebc2..245da96bd 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -59,9 +59,22 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: }, environment_parameters={ "blueprint_id": "blueprint_id", + "launch_parameters": { + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "shutdown", + }, + "available_ports": [0], + "keep_alive_time_seconds": 0, + "launch_commands": ["string"], + "resource_size_request": "SMALL", + }, "prebuilt_id": "prebuilt_id", "snapshot_id": "snapshot_id", + "working_directory": "working_directory", }, + metadata={"foo": "string"}, + reference_output="reference_output", ) assert_matches_type(ScenarioView, scenario, path=["response"]) @@ -227,6 +240,7 @@ def test_method_start_run_with_all_params(self, client: Runloop) -> None: scenario = client.scenarios.start_run( scenario_id="scenario_id", benchmark_run_id="benchmark_run_id", + metadata={"foo": "string"}, run_name="run_name", ) assert_matches_type(ScenarioRunView, scenario, path=["response"]) @@ -297,9 +311,22 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - }, environment_parameters={ "blueprint_id": "blueprint_id", + "launch_parameters": { + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "shutdown", + }, + "available_ports": [0], + "keep_alive_time_seconds": 0, + "launch_commands": ["string"], + "resource_size_request": "SMALL", + }, "prebuilt_id": "prebuilt_id", "snapshot_id": "snapshot_id", + "working_directory": "working_directory", }, + metadata={"foo": "string"}, + reference_output="reference_output", ) assert_matches_type(ScenarioView, scenario, path=["response"]) @@ -465,6 +492,7 @@ async def test_method_start_run_with_all_params(self, async_client: AsyncRunloop scenario = await async_client.scenarios.start_run( scenario_id="scenario_id", benchmark_run_id="benchmark_run_id", + metadata={"foo": "string"}, run_name="run_name", ) assert_matches_type(ScenarioRunView, scenario, path=["response"]) From 6179450e635ef5e1c19c856eb3fb22528485a5e6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 01:07:25 +0000 Subject: [PATCH 670/993] chore(internal): version bump (#550) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7f3f5c846..d2d60a3df 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.23.0" + ".": "0.24.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 0d8b9c708..1e703a82d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.23.0" +version = "0.24.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 83f733319..c03b20ee6 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.23.0" # x-release-please-version +__version__ = "0.24.0" # x-release-please-version From cb1bf4f0cf2a4b33f5289bf2082deb4d64ebaad8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 04:39:14 +0000 Subject: [PATCH 671/993] chore(internal): codegen related update (#551) --- README.md | 19 +++++++++++++++++++ src/runloop_api_client/_files.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f480d2d45..cf864f391 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,25 @@ for devbox in first_page.devboxes: # Remove `await` for non-async usage. ``` +## File uploads + +Request parameters that correspond to file uploads can be passed as `bytes`, a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`. + +```python +from pathlib import Path +from runloop_api_client import Runloop + +client = Runloop() + +client.devboxes.upload_file( + id="id", + path="path", + file=Path("/path/to/file"), +) +``` + +The async client uses the exact same interface. If you pass a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance, the file contents will be read asynchronously automatically. + ## Handling errors When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `runloop_api_client.APIConnectionError` is raised. diff --git a/src/runloop_api_client/_files.py b/src/runloop_api_client/_files.py index 715cc2078..1b1825115 100644 --- a/src/runloop_api_client/_files.py +++ b/src/runloop_api_client/_files.py @@ -34,7 +34,7 @@ def assert_is_file_content(obj: object, *, key: str | None = None) -> None: if not is_file_content(obj): prefix = f"Expected entry at `{key}`" if key is not None else f"Expected file input `{obj!r}`" raise RuntimeError( - f"{prefix} to be bytes, an io.IOBase instance, PathLike or a tuple but received {type(obj)} instead." + f"{prefix} to be bytes, an io.IOBase instance, PathLike or a tuple but received {type(obj)} instead. See https://github.com/runloopai/api-client-python/tree/main#file-uploads" ) from None From 86110ee112c8588e37f28d94703c9c3ef81b7498 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 06:31:28 +0000 Subject: [PATCH 672/993] feat(client): allow passing `NotGiven` for body (#553) fix(client): mark some request bodies as optional --- src/runloop_api_client/_base_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index 22e3bc630..6ed767c04 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -518,7 +518,7 @@ def _build_request( # so that passing a `TypedDict` doesn't cause an error. # https://github.com/microsoft/pyright/issues/3526#event-6715453066 params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None, - json=json_data, + json=json_data if is_given(json_data) else None, files=files, **kwargs, ) From 3139fbfe0ca75f020d9e1dbab594487964356640 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 22 Feb 2025 04:47:09 +0000 Subject: [PATCH 673/993] chore(internal): fix devcontainers setup (#554) --- .devcontainer/Dockerfile | 2 +- .devcontainer/devcontainer.json | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index ac9a2e752..55d20255c 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -6,4 +6,4 @@ USER vscode RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.35.0" RYE_INSTALL_OPTION="--yes" bash ENV PATH=/home/vscode/.rye/shims:$PATH -RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc +RUN echo "[[ -d .venv ]] && source .venv/bin/activate || export PATH=\$PATH" >> /home/vscode/.bashrc diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index bbeb30b14..c17fdc169 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -24,6 +24,9 @@ } } } + }, + "features": { + "ghcr.io/devcontainers/features/node:1": {} } // Features to add to the dev container. More info: https://containers.dev/features. From cf64ada9ae299bae057dff969371fbdbdcd32bba Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 01:47:17 +0000 Subject: [PATCH 674/993] feat(api): api update (#555) --- .stats.yml | 4 +- api.md | 1 + .../resources/scenarios/scenarios.py | 157 +++++++++++ src/runloop_api_client/types/__init__.py | 1 + .../types/scenario_update_params.py | 36 +++ .../types/scoring_function.py | 2 +- .../types/scoring_function_param.py | 2 +- tests/api_resources/test_scenarios.py | 246 ++++++++++++++++++ 8 files changed, 445 insertions(+), 4 deletions(-) create mode 100644 src/runloop_api_client/types/scenario_update_params.py diff --git a/.stats.yml b/.stats.yml index 89dc8775e..08c183bf8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ -configured_endpoints: 77 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-cb8add05a7b418d6f8a5624be8477564853da49e8bf9671ae89b8ce49a04b6cd.yml +configured_endpoints: 78 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ccbc7c04012cbcca678f13e39f66bb770b8b3a9d6f1815ce1b9c20fee099128.yml diff --git a/api.md b/api.md index 90c237349..aaecbbfdd 100644 --- a/api.md +++ b/api.md @@ -278,6 +278,7 @@ Methods: - client.scenarios.create(\*\*params) -> ScenarioView - client.scenarios.retrieve(id) -> ScenarioView +- client.scenarios.update(id, \*\*params) -> ScenarioView - client.scenarios.list(\*\*params) -> SyncScenariosCursorIDPage[ScenarioView] - client.scenarios.list_public(\*\*params) -> SyncScenariosCursorIDPage[ScenarioView] - client.scenarios.start_run(\*\*params) -> ScenarioRunView diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index 927028016..b42f56b13 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -17,6 +17,7 @@ from ...types import ( scenario_list_params, scenario_create_params, + scenario_update_params, scenario_start_run_params, scenario_list_public_params, ) @@ -182,6 +183,78 @@ def retrieve( cast_to=ScenarioView, ) + def update( + self, + id: str, + *, + input_context: InputContextParam, + name: str, + scoring_contract: ScoringContractParam, + environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + reference_output: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ScenarioView: + """ + Update a Scenario, a repeatable AI coding evaluation test that defines the + starting environment as well as evaluation success criteria. + + Args: + input_context: The input context for the Scenario. + + name: Name of the scenario. + + scoring_contract: The scoring contract for the Scenario. + + environment_parameters: The Environment in which the Scenario will run. + + metadata: User defined metadata to attach to the scenario for organization. + + reference_output: A string representation of the reference output to solve the scenario. Commonly + can be the result of a git diff or a sequence of command actions to apply to the + environment. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/scenarios/{id}", + body=maybe_transform( + { + "input_context": input_context, + "name": name, + "scoring_contract": scoring_contract, + "environment_parameters": environment_parameters, + "metadata": metadata, + "reference_output": reference_output, + }, + scenario_update_params.ScenarioUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ScenarioView, + ) + def list( self, *, @@ -474,6 +547,78 @@ async def retrieve( cast_to=ScenarioView, ) + async def update( + self, + id: str, + *, + input_context: InputContextParam, + name: str, + scoring_contract: ScoringContractParam, + environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + reference_output: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ScenarioView: + """ + Update a Scenario, a repeatable AI coding evaluation test that defines the + starting environment as well as evaluation success criteria. + + Args: + input_context: The input context for the Scenario. + + name: Name of the scenario. + + scoring_contract: The scoring contract for the Scenario. + + environment_parameters: The Environment in which the Scenario will run. + + metadata: User defined metadata to attach to the scenario for organization. + + reference_output: A string representation of the reference output to solve the scenario. Commonly + can be the result of a git diff or a sequence of command actions to apply to the + environment. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/scenarios/{id}", + body=await async_maybe_transform( + { + "input_context": input_context, + "name": name, + "scoring_contract": scoring_contract, + "environment_parameters": environment_parameters, + "metadata": metadata, + "reference_output": reference_output, + }, + scenario_update_params.ScenarioUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ScenarioView, + ) + def list( self, *, @@ -646,6 +791,9 @@ def __init__(self, scenarios: ScenariosResource) -> None: self.retrieve = to_raw_response_wrapper( scenarios.retrieve, ) + self.update = to_raw_response_wrapper( + scenarios.update, + ) self.list = to_raw_response_wrapper( scenarios.list, ) @@ -675,6 +823,9 @@ def __init__(self, scenarios: AsyncScenariosResource) -> None: self.retrieve = async_to_raw_response_wrapper( scenarios.retrieve, ) + self.update = async_to_raw_response_wrapper( + scenarios.update, + ) self.list = async_to_raw_response_wrapper( scenarios.list, ) @@ -704,6 +855,9 @@ def __init__(self, scenarios: ScenariosResource) -> None: self.retrieve = to_streamed_response_wrapper( scenarios.retrieve, ) + self.update = to_streamed_response_wrapper( + scenarios.update, + ) self.list = to_streamed_response_wrapper( scenarios.list, ) @@ -733,6 +887,9 @@ def __init__(self, scenarios: AsyncScenariosResource) -> None: self.retrieve = async_to_streamed_response_wrapper( scenarios.retrieve, ) + self.update = async_to_streamed_response_wrapper( + scenarios.update, + ) self.list = async_to_streamed_response_wrapper( scenarios.list, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 62b6d30e3..31b76176f 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -35,6 +35,7 @@ from .repository_list_params import RepositoryListParams as RepositoryListParams from .scenario_create_params import ScenarioCreateParams as ScenarioCreateParams from .scenario_run_list_view import ScenarioRunListView as ScenarioRunListView +from .scenario_update_params import ScenarioUpdateParams as ScenarioUpdateParams from .scoring_contract_param import ScoringContractParam as ScoringContractParam from .scoring_function_param import ScoringFunctionParam as ScoringFunctionParam from .benchmark_create_params import BenchmarkCreateParams as BenchmarkCreateParams diff --git a/src/runloop_api_client/types/scenario_update_params.py b/src/runloop_api_client/types/scenario_update_params.py new file mode 100644 index 000000000..1004e7bc8 --- /dev/null +++ b/src/runloop_api_client/types/scenario_update_params.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Optional +from typing_extensions import Required, TypedDict + +from .input_context_param import InputContextParam +from .scoring_contract_param import ScoringContractParam +from .scenario_environment_param import ScenarioEnvironmentParam + +__all__ = ["ScenarioUpdateParams"] + + +class ScenarioUpdateParams(TypedDict, total=False): + input_context: Required[InputContextParam] + """The input context for the Scenario.""" + + name: Required[str] + """Name of the scenario.""" + + scoring_contract: Required[ScoringContractParam] + """The scoring contract for the Scenario.""" + + environment_parameters: Optional[ScenarioEnvironmentParam] + """The Environment in which the Scenario will run.""" + + metadata: Optional[Dict[str, str]] + """User defined metadata to attach to the scenario for organization.""" + + reference_output: Optional[str] + """A string representation of the reference output to solve the scenario. + + Commonly can be the result of a git diff or a sequence of command actions to + apply to the environment. + """ diff --git a/src/runloop_api_client/types/scoring_function.py b/src/runloop_api_client/types/scoring_function.py index bef775eca..f7a2a6e0d 100644 --- a/src/runloop_api_client/types/scoring_function.py +++ b/src/runloop_api_client/types/scoring_function.py @@ -20,7 +20,7 @@ class ScoringFunction(BaseModel): """ weight: float - """Wight to apply to scoring function score. + """Weight to apply to scoring function score. Weights of all scoring functions should sum to 1.0. """ diff --git a/src/runloop_api_client/types/scoring_function_param.py b/src/runloop_api_client/types/scoring_function_param.py index 0caa61468..5bcbacc58 100644 --- a/src/runloop_api_client/types/scoring_function_param.py +++ b/src/runloop_api_client/types/scoring_function_param.py @@ -21,7 +21,7 @@ class ScoringFunctionParam(TypedDict, total=False): """ weight: Required[float] - """Wight to apply to scoring function score. + """Weight to apply to scoring function score. Weights of all scoring functions should sum to 1.0. """ diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index 245da96bd..218ebb542 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -160,6 +160,129 @@ def test_path_params_retrieve(self, client: Runloop) -> None: "", ) + @parametrize + def test_method_update(self, client: Runloop) -> None: + scenario = client.scenarios.update( + id="id", + input_context={"problem_statement": "problem_statement"}, + name="name", + scoring_contract={ + "scoring_function_parameters": [ + { + "name": "name", + "type": "type", + "weight": 0, + } + ] + }, + ) + assert_matches_type(ScenarioView, scenario, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Runloop) -> None: + scenario = client.scenarios.update( + id="id", + input_context={ + "problem_statement": "problem_statement", + "additional_context": {}, + }, + name="name", + scoring_contract={ + "scoring_function_parameters": [ + { + "name": "name", + "type": "type", + "weight": 0, + "bash_script": "bash_script", + "scorer_params": {}, + } + ] + }, + environment_parameters={ + "blueprint_id": "blueprint_id", + "launch_parameters": { + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "shutdown", + }, + "available_ports": [0], + "keep_alive_time_seconds": 0, + "launch_commands": ["string"], + "resource_size_request": "SMALL", + }, + "prebuilt_id": "prebuilt_id", + "snapshot_id": "snapshot_id", + "working_directory": "working_directory", + }, + metadata={"foo": "string"}, + reference_output="reference_output", + ) + assert_matches_type(ScenarioView, scenario, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Runloop) -> None: + response = client.scenarios.with_raw_response.update( + id="id", + input_context={"problem_statement": "problem_statement"}, + name="name", + scoring_contract={ + "scoring_function_parameters": [ + { + "name": "name", + "type": "type", + "weight": 0, + } + ] + }, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scenario = response.parse() + assert_matches_type(ScenarioView, scenario, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Runloop) -> None: + with client.scenarios.with_streaming_response.update( + id="id", + input_context={"problem_statement": "problem_statement"}, + name="name", + scoring_contract={ + "scoring_function_parameters": [ + { + "name": "name", + "type": "type", + "weight": 0, + } + ] + }, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scenario = response.parse() + assert_matches_type(ScenarioView, scenario, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.scenarios.with_raw_response.update( + id="", + input_context={"problem_statement": "problem_statement"}, + name="name", + scoring_contract={ + "scoring_function_parameters": [ + { + "name": "name", + "type": "type", + "weight": 0, + } + ] + }, + ) + @parametrize def test_method_list(self, client: Runloop) -> None: scenario = client.scenarios.list() @@ -412,6 +535,129 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: "", ) + @parametrize + async def test_method_update(self, async_client: AsyncRunloop) -> None: + scenario = await async_client.scenarios.update( + id="id", + input_context={"problem_statement": "problem_statement"}, + name="name", + scoring_contract={ + "scoring_function_parameters": [ + { + "name": "name", + "type": "type", + "weight": 0, + } + ] + }, + ) + assert_matches_type(ScenarioView, scenario, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncRunloop) -> None: + scenario = await async_client.scenarios.update( + id="id", + input_context={ + "problem_statement": "problem_statement", + "additional_context": {}, + }, + name="name", + scoring_contract={ + "scoring_function_parameters": [ + { + "name": "name", + "type": "type", + "weight": 0, + "bash_script": "bash_script", + "scorer_params": {}, + } + ] + }, + environment_parameters={ + "blueprint_id": "blueprint_id", + "launch_parameters": { + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "shutdown", + }, + "available_ports": [0], + "keep_alive_time_seconds": 0, + "launch_commands": ["string"], + "resource_size_request": "SMALL", + }, + "prebuilt_id": "prebuilt_id", + "snapshot_id": "snapshot_id", + "working_directory": "working_directory", + }, + metadata={"foo": "string"}, + reference_output="reference_output", + ) + assert_matches_type(ScenarioView, scenario, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: + response = await async_client.scenarios.with_raw_response.update( + id="id", + input_context={"problem_statement": "problem_statement"}, + name="name", + scoring_contract={ + "scoring_function_parameters": [ + { + "name": "name", + "type": "type", + "weight": 0, + } + ] + }, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scenario = await response.parse() + assert_matches_type(ScenarioView, scenario, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncRunloop) -> None: + async with async_client.scenarios.with_streaming_response.update( + id="id", + input_context={"problem_statement": "problem_statement"}, + name="name", + scoring_contract={ + "scoring_function_parameters": [ + { + "name": "name", + "type": "type", + "weight": 0, + } + ] + }, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scenario = await response.parse() + assert_matches_type(ScenarioView, scenario, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.scenarios.with_raw_response.update( + id="", + input_context={"problem_statement": "problem_statement"}, + name="name", + scoring_contract={ + "scoring_function_parameters": [ + { + "name": "name", + "type": "type", + "weight": 0, + } + ] + }, + ) + @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: scenario = await async_client.scenarios.list() From 7e43cb539d27a67ed5dcd7744be0789b4135ae19 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 03:59:14 +0000 Subject: [PATCH 675/993] chore(internal): properly set __pydantic_private__ (#556) --- src/runloop_api_client/_base_client.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index 6ed767c04..7e97db227 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -63,7 +63,7 @@ ModelBuilderProtocol, ) from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping -from ._compat import model_copy, model_dump +from ._compat import PYDANTIC_V2, model_copy, model_dump from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type from ._response import ( APIResponse, @@ -207,6 +207,9 @@ def _set_private_attributes( model: Type[_T], options: FinalRequestOptions, ) -> None: + if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None: + self.__pydantic_private__ = {} + self._model = model self._client = client self._options = options @@ -292,6 +295,9 @@ def _set_private_attributes( client: AsyncAPIClient, options: FinalRequestOptions, ) -> None: + if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None: + self.__pydantic_private__ = {} + self._model = model self._client = client self._options = options From bf7f77a074548d32c7f4a8453621955433a61bf7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 04:12:20 +0000 Subject: [PATCH 676/993] chore(internal): version bump (#557) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d2d60a3df..a36746b8b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.24.0" + ".": "0.25.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 1e703a82d..377bb5507 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.24.0" +version = "0.25.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index c03b20ee6..2bb1b212e 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.24.0" # x-release-please-version +__version__ = "0.25.0" # x-release-please-version From cda0da68f9bdae6bc92d54b405faf99eb01032a3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 28 Feb 2025 03:13:38 +0000 Subject: [PATCH 677/993] docs: update URLs from stainlessapi.com to stainless.com (#558) More details at https://www.stainless.com/changelog/stainless-com --- README.md | 2 +- SECURITY.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cf864f391..643113029 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ The Runloop Python library provides convenient access to the Runloop REST API fr application. The library includes type definitions for all request params and response fields, and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx). -It is generated with [Stainless](https://www.stainlessapi.com/). +It is generated with [Stainless](https://www.stainless.com/). ## Documentation diff --git a/SECURITY.md b/SECURITY.md index 234cb1f83..3524f0045 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,9 +2,9 @@ ## Reporting Security Issues -This SDK is generated by [Stainless Software Inc](http://stainlessapi.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. +This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. -To report a security issue, please contact the Stainless team at security@stainlessapi.com. +To report a security issue, please contact the Stainless team at security@stainless.com. ## Responsible Disclosure From e92c3cd44afce2fa5c09b2cdfba181f048eb507d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 28 Feb 2025 03:14:21 +0000 Subject: [PATCH 678/993] chore(docs): update client docstring (#559) --- src/runloop_api_client/_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index 8fc0cb6f8..2c6fa90fa 100644 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -74,7 +74,7 @@ def __init__( # part of our public interface in the future. _strict_response_validation: bool = False, ) -> None: - """Construct a new synchronous runloop client instance. + """Construct a new synchronous Runloop client instance. This automatically infers the `bearer_token` argument from the `RUNLOOP_API_KEY` environment variable if it is not provided. """ @@ -252,7 +252,7 @@ def __init__( # part of our public interface in the future. _strict_response_validation: bool = False, ) -> None: - """Construct a new async runloop client instance. + """Construct a new async AsyncRunloop client instance. This automatically infers the `bearer_token` argument from the `RUNLOOP_API_KEY` environment variable if it is not provided. """ From 2d4851fcf70c7e28f22866c97cae64b1c1f7c121 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Mar 2025 05:14:12 +0000 Subject: [PATCH 679/993] chore(internal): remove unused http client options forwarding (#561) --- src/runloop_api_client/_base_client.py | 97 +------------------------- 1 file changed, 1 insertion(+), 96 deletions(-) diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index 7e97db227..62879ec12 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -9,7 +9,6 @@ import inspect import logging import platform -import warnings import email.utils from types import TracebackType from random import random @@ -36,7 +35,7 @@ import httpx import distro import pydantic -from httpx import URL, Limits +from httpx import URL from pydantic import PrivateAttr from . import _exceptions @@ -51,13 +50,10 @@ Timeout, NotGiven, ResponseT, - Transport, AnyMapping, PostParser, - ProxiesTypes, RequestFiles, HttpxSendArgs, - AsyncTransport, RequestOptions, HttpxRequestFiles, ModelBuilderProtocol, @@ -337,9 +333,6 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]): _base_url: URL max_retries: int timeout: Union[float, Timeout, None] - _limits: httpx.Limits - _proxies: ProxiesTypes | None - _transport: Transport | AsyncTransport | None _strict_response_validation: bool _idempotency_header: str | None _default_stream_cls: type[_DefaultStreamT] | None = None @@ -352,9 +345,6 @@ def __init__( _strict_response_validation: bool, max_retries: int = DEFAULT_MAX_RETRIES, timeout: float | Timeout | None = DEFAULT_TIMEOUT, - limits: httpx.Limits, - transport: Transport | AsyncTransport | None, - proxies: ProxiesTypes | None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, ) -> None: @@ -362,9 +352,6 @@ def __init__( self._base_url = self._enforce_trailing_slash(URL(base_url)) self.max_retries = max_retries self.timeout = timeout - self._limits = limits - self._proxies = proxies - self._transport = transport self._custom_headers = custom_headers or {} self._custom_query = custom_query or {} self._strict_response_validation = _strict_response_validation @@ -800,46 +787,11 @@ def __init__( base_url: str | URL, max_retries: int = DEFAULT_MAX_RETRIES, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, - transport: Transport | None = None, - proxies: ProxiesTypes | None = None, - limits: Limits | None = None, http_client: httpx.Client | None = None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, _strict_response_validation: bool, ) -> None: - kwargs: dict[str, Any] = {} - if limits is not None: - warnings.warn( - "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `connection_pool_limits`") - else: - limits = DEFAULT_CONNECTION_LIMITS - - if transport is not None: - kwargs["transport"] = transport - warnings.warn( - "The `transport` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `transport`") - - if proxies is not None: - kwargs["proxies"] = proxies - warnings.warn( - "The `proxies` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `proxies`") - if not is_given(timeout): # if the user passed in a custom http client with a non-default # timeout set then we use that timeout. @@ -860,12 +812,9 @@ def __init__( super().__init__( version=version, - limits=limits, # cast to a valid type because mypy doesn't understand our type narrowing timeout=cast(Timeout, timeout), - proxies=proxies, base_url=base_url, - transport=transport, max_retries=max_retries, custom_query=custom_query, custom_headers=custom_headers, @@ -875,9 +824,6 @@ def __init__( base_url=base_url, # cast to a valid type because mypy doesn't understand our type narrowing timeout=cast(Timeout, timeout), - limits=limits, - follow_redirects=True, - **kwargs, # type: ignore ) def is_closed(self) -> bool: @@ -1372,45 +1318,10 @@ def __init__( _strict_response_validation: bool, max_retries: int = DEFAULT_MAX_RETRIES, timeout: float | Timeout | None | NotGiven = NOT_GIVEN, - transport: AsyncTransport | None = None, - proxies: ProxiesTypes | None = None, - limits: Limits | None = None, http_client: httpx.AsyncClient | None = None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, ) -> None: - kwargs: dict[str, Any] = {} - if limits is not None: - warnings.warn( - "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `connection_pool_limits`") - else: - limits = DEFAULT_CONNECTION_LIMITS - - if transport is not None: - kwargs["transport"] = transport - warnings.warn( - "The `transport` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `transport`") - - if proxies is not None: - kwargs["proxies"] = proxies - warnings.warn( - "The `proxies` argument is deprecated. The `http_client` argument should be passed instead", - category=DeprecationWarning, - stacklevel=3, - ) - if http_client is not None: - raise ValueError("The `http_client` argument is mutually exclusive with `proxies`") - if not is_given(timeout): # if the user passed in a custom http client with a non-default # timeout set then we use that timeout. @@ -1432,11 +1343,8 @@ def __init__( super().__init__( version=version, base_url=base_url, - limits=limits, # cast to a valid type because mypy doesn't understand our type narrowing timeout=cast(Timeout, timeout), - proxies=proxies, - transport=transport, max_retries=max_retries, custom_query=custom_query, custom_headers=custom_headers, @@ -1446,9 +1354,6 @@ def __init__( base_url=base_url, # cast to a valid type because mypy doesn't understand our type narrowing timeout=cast(Timeout, timeout), - limits=limits, - follow_redirects=True, - **kwargs, # type: ignore ) def is_closed(self) -> bool: From 7db9699d612d5bb240218295bc7ac2e7affaa73e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Mar 2025 19:41:27 +0000 Subject: [PATCH 680/993] chore(internal): version bump (#563) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a36746b8b..caf5ca3f3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.25.0" + ".": "0.26.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 377bb5507..7b42ba0af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.25.0" +version = "0.26.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 2bb1b212e..66357b018 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.25.0" # x-release-please-version +__version__ = "0.26.0" # x-release-please-version From ce4c435d754ef6c7c3dc4987b002e32d26c62ca2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Mar 2025 08:24:36 +0000 Subject: [PATCH 681/993] docs: revise readme docs about nested params (#564) --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index 643113029..1446a6a4d 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,31 @@ for devbox in first_page.devboxes: # Remove `await` for non-async usage. ``` +## Nested params + +Nested parameters are dictionaries, typed using `TypedDict`, for example: + +```python +from runloop_api_client import Runloop + +client = Runloop() + +blueprint_view = client.blueprints.create( + name="name", + launch_parameters={ + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "shutdown", + }, + "available_ports": [0], + "keep_alive_time_seconds": 0, + "launch_commands": ["string"], + "resource_size_request": "SMALL", + }, +) +print(blueprint_view.launch_parameters) +``` + ## File uploads Request parameters that correspond to file uploads can be passed as `bytes`, a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`. From 403a1e236f8f0994086afd3ff03e05dcbf6cf368 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Mar 2025 08:41:58 +0000 Subject: [PATCH 682/993] test: add DEFER_PYDANTIC_BUILD=false flag to tests (#566) --- scripts/test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/test b/scripts/test index 4fa5698b8..2b8784567 100755 --- a/scripts/test +++ b/scripts/test @@ -52,6 +52,8 @@ else echo fi +export DEFER_PYDANTIC_BUILD=false + echo "==> Running tests" rye run pytest "$@" From a57b862eb44696064d6c71a0128939eab9605da0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Mar 2025 06:11:59 +0000 Subject: [PATCH 683/993] chore(internal): remove extra empty newlines (#567) --- pyproject.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7b42ba0af..7bc0dad9d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,6 @@ Homepage = "https://github.com/runloopai/api-client-python" Repository = "https://github.com/runloopai/api-client-python" - [tool.rye] managed = true # version pins are in requirements-dev.lock @@ -152,7 +151,6 @@ reportImplicitOverride = true reportImportCycles = false reportPrivateUsage = false - [tool.ruff] line-length = 120 output-format = "grouped" From 75086e77a06cd67eeef427d202c48fd3582784bc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 15 Mar 2025 05:01:40 +0000 Subject: [PATCH 684/993] chore(internal): codegen related update (#568) --- requirements-dev.lock | 1 + requirements.lock | 1 + 2 files changed, 2 insertions(+) diff --git a/requirements-dev.lock b/requirements-dev.lock index 054d61875..c88f710ae 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -7,6 +7,7 @@ # all-features: true # with-sources: false # generate-hashes: false +# universal: false -e file:. annotated-types==0.6.0 diff --git a/requirements.lock b/requirements.lock index 3d1257561..bcd4ab118 100644 --- a/requirements.lock +++ b/requirements.lock @@ -7,6 +7,7 @@ # all-features: true # with-sources: false # generate-hashes: false +# universal: false -e file:. annotated-types==0.6.0 From 079a50a558736fbaf82c21a98b56f4641484753a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 15 Mar 2025 05:06:48 +0000 Subject: [PATCH 685/993] chore(internal): bump rye to 0.44.0 (#569) --- .devcontainer/Dockerfile | 2 +- .github/workflows/ci.yml | 4 ++-- .github/workflows/publish-pypi.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 55d20255c..ff261bad7 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -3,7 +3,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} USER vscode -RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.35.0" RYE_INSTALL_OPTION="--yes" bash +RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.44.0" RYE_INSTALL_OPTION="--yes" bash ENV PATH=/home/vscode/.rye/shims:$PATH RUN echo "[[ -d .venv ]] && source .venv/bin/activate || export PATH=\$PATH" >> /home/vscode/.bashrc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c8a8a4f72..3b286e5ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: curl -sSf https://rye.astral.sh/get | bash echo "$HOME/.rye/shims" >> $GITHUB_PATH env: - RYE_VERSION: '0.35.0' + RYE_VERSION: '0.44.0' RYE_INSTALL_OPTION: '--yes' - name: Install dependencies @@ -42,7 +42,7 @@ jobs: curl -sSf https://rye.astral.sh/get | bash echo "$HOME/.rye/shims" >> $GITHUB_PATH env: - RYE_VERSION: '0.35.0' + RYE_VERSION: '0.44.0' RYE_INSTALL_OPTION: '--yes' - name: Bootstrap diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index a56e643fb..fbcdea446 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -21,7 +21,7 @@ jobs: curl -sSf https://rye.astral.sh/get | bash echo "$HOME/.rye/shims" >> $GITHUB_PATH env: - RYE_VERSION: '0.35.0' + RYE_VERSION: '0.44.0' RYE_INSTALL_OPTION: '--yes' - name: Publish to PyPI From 6260ca5b0d28f7859b9675465f30fee422dde7e5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 15 Mar 2025 05:13:16 +0000 Subject: [PATCH 686/993] fix(types): handle more discriminated union shapes (#570) --- src/runloop_api_client/_models.py | 7 +++++-- tests/test_models.py | 32 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index c4401ff86..b51a1bf5f 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -65,7 +65,7 @@ from ._constants import RAW_RESPONSE_HEADER if TYPE_CHECKING: - from pydantic_core.core_schema import ModelField, LiteralSchema, ModelFieldsSchema + from pydantic_core.core_schema import ModelField, ModelSchema, LiteralSchema, ModelFieldsSchema __all__ = ["BaseModel", "GenericModel"] @@ -646,15 +646,18 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, def _extract_field_schema_pv2(model: type[BaseModel], field_name: str) -> ModelField | None: schema = model.__pydantic_core_schema__ + if schema["type"] == "definitions": + schema = schema["schema"] + if schema["type"] != "model": return None + schema = cast("ModelSchema", schema) fields_schema = schema["schema"] if fields_schema["type"] != "model-fields": return None fields_schema = cast("ModelFieldsSchema", fields_schema) - field = fields_schema["fields"].get(field_name) if not field: return None diff --git a/tests/test_models.py b/tests/test_models.py index 78b2d1141..b65dd474e 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -854,3 +854,35 @@ class Model(BaseModel): m = construct_type(value={"cls": "foo"}, type_=Model) assert isinstance(m, Model) assert isinstance(m.cls, str) + + +def test_discriminated_union_case() -> None: + class A(BaseModel): + type: Literal["a"] + + data: bool + + class B(BaseModel): + type: Literal["b"] + + data: List[Union[A, object]] + + class ModelA(BaseModel): + type: Literal["modelA"] + + data: int + + class ModelB(BaseModel): + type: Literal["modelB"] + + required: str + + data: Union[A, B] + + # when constructing ModelA | ModelB, value data doesn't match ModelB exactly - missing `required` + m = construct_type( + value={"type": "modelB", "data": {"type": "a", "data": True}}, + type_=cast(Any, Annotated[Union[ModelA, ModelB], PropertyInfo(discriminator="type")]), + ) + + assert isinstance(m, ModelB) From 17a6e93ce1ce611c3c20bb8521ac322a903200d1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 16:23:14 +0000 Subject: [PATCH 687/993] fix(ci): ensure pip is always available (#571) --- bin/publish-pypi | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/publish-pypi b/bin/publish-pypi index 05bfccbb7..ebebf9165 100644 --- a/bin/publish-pypi +++ b/bin/publish-pypi @@ -5,5 +5,6 @@ mkdir -p dist rye build --clean # Patching importlib-metadata version until upstream library version is updated # https://github.com/pypa/twine/issues/977#issuecomment-2189800841 +"$HOME/.rye/self/bin/python3" -m ensurepip "$HOME/.rye/self/bin/python3" -m pip install 'importlib-metadata==7.2.1' rye publish --yes --token=$PYPI_TOKEN From 7257b851bef7dd2650b04d15a5a11adb95b1ec88 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 16:30:14 +0000 Subject: [PATCH 688/993] fix(ci): remove publishing patch (#572) --- bin/publish-pypi | 4 ---- pyproject.toml | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/bin/publish-pypi b/bin/publish-pypi index ebebf9165..826054e92 100644 --- a/bin/publish-pypi +++ b/bin/publish-pypi @@ -3,8 +3,4 @@ set -eux mkdir -p dist rye build --clean -# Patching importlib-metadata version until upstream library version is updated -# https://github.com/pypa/twine/issues/977#issuecomment-2189800841 -"$HOME/.rye/self/bin/python3" -m ensurepip -"$HOME/.rye/self/bin/python3" -m pip install 'importlib-metadata==7.2.1' rye publish --yes --token=$PYPI_TOKEN diff --git a/pyproject.toml b/pyproject.toml index 7bc0dad9d..88367b847 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,7 +86,7 @@ typecheck = { chain = [ "typecheck:mypy" = "mypy ." [build-system] -requires = ["hatchling", "hatch-fancy-pypi-readme"] +requires = ["hatchling==1.26.3", "hatch-fancy-pypi-readme"] build-backend = "hatchling.build" [tool.hatch.build] From b5187939bfff58b57bee0d3251d5dabf1ef909c7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Mar 2025 01:10:09 +0000 Subject: [PATCH 689/993] feat(api): api update (#573) --- .stats.yml | 2 +- README.md | 2 + .../resources/scenarios/runs.py | 12 +- .../types/benchmark_list_view.py | 2 + .../types/benchmark_run_list_view.py | 2 + .../types/blueprint_list_view.py | 2 + .../types/devbox_list_view.py | 2 + .../types/devbox_snapshot_list_view.py | 2 + .../types/repository_connection_list_view.py | 2 + .../types/scenario_list_view.py | 2 + .../types/scenario_run_list_view.py | 2 + .../types/scoring_function.py | 22 +-- .../types/scoring_function_param.py | 119 +++++++++++++--- .../types/shared/launch_parameters.py | 6 + .../types/shared_params/launch_parameters.py | 6 + tests/api_resources/scenarios/test_scorers.py | 4 + tests/api_resources/test_blueprints.py | 8 ++ tests/api_resources/test_devboxes.py | 4 + tests/api_resources/test_scenarios.py | 128 ++++++++++++++---- 19 files changed, 260 insertions(+), 69 deletions(-) diff --git a/.stats.yml b/.stats.yml index 08c183bf8..4dd4711f3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 78 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ccbc7c04012cbcca678f13e39f66bb770b8b3a9d6f1815ce1b9c20fee099128.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1c6045460c43f65b30ffcef9f707e8d71dca568bf8d208347a6046a6f03ff239.yml diff --git a/README.md b/README.md index 1446a6a4d..ec6ee93f1 100644 --- a/README.md +++ b/README.md @@ -153,6 +153,8 @@ blueprint_view = client.blueprints.create( "on_idle": "shutdown", }, "available_ports": [0], + "custom_cpu_cores": 0, + "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "SMALL", diff --git a/src/runloop_api_client/resources/scenarios/runs.py b/src/runloop_api_client/resources/scenarios/runs.py index 94b450a36..d140ecdb1 100644 --- a/src/runloop_api_client/resources/scenarios/runs.py +++ b/src/runloop_api_client/resources/scenarios/runs.py @@ -138,8 +138,10 @@ def complete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, ) -> ScenarioRunView: - """ - Complete a currently running ScenarioRun. + """Complete a currently running ScenarioRun. + + Calling complete will shutdown + underlying Devbox resource. Args: extra_headers: Send extra headers @@ -323,8 +325,10 @@ async def complete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, ) -> ScenarioRunView: - """ - Complete a currently running ScenarioRun. + """Complete a currently running ScenarioRun. + + Calling complete will shutdown + underlying Devbox resource. Args: extra_headers: Send extra headers diff --git a/src/runloop_api_client/types/benchmark_list_view.py b/src/runloop_api_client/types/benchmark_list_view.py index 40ebd65dd..225002840 100644 --- a/src/runloop_api_client/types/benchmark_list_view.py +++ b/src/runloop_api_client/types/benchmark_list_view.py @@ -14,4 +14,6 @@ class BenchmarkListView(BaseModel): has_more: bool + remaining_count: int + total_count: int diff --git a/src/runloop_api_client/types/benchmark_run_list_view.py b/src/runloop_api_client/types/benchmark_run_list_view.py index 4a8a1fda0..0d0ca11e1 100644 --- a/src/runloop_api_client/types/benchmark_run_list_view.py +++ b/src/runloop_api_client/types/benchmark_run_list_view.py @@ -11,6 +11,8 @@ class BenchmarkRunListView(BaseModel): has_more: bool + remaining_count: int + runs: List[BenchmarkRunView] """List of BenchmarkRuns matching filter.""" diff --git a/src/runloop_api_client/types/blueprint_list_view.py b/src/runloop_api_client/types/blueprint_list_view.py index 57f845c95..ba7c6066f 100644 --- a/src/runloop_api_client/types/blueprint_list_view.py +++ b/src/runloop_api_client/types/blueprint_list_view.py @@ -14,4 +14,6 @@ class BlueprintListView(BaseModel): has_more: bool + remaining_count: int + total_count: int diff --git a/src/runloop_api_client/types/devbox_list_view.py b/src/runloop_api_client/types/devbox_list_view.py index 332b737f3..f4f266240 100644 --- a/src/runloop_api_client/types/devbox_list_view.py +++ b/src/runloop_api_client/types/devbox_list_view.py @@ -14,4 +14,6 @@ class DevboxListView(BaseModel): has_more: bool + remaining_count: int + total_count: int diff --git a/src/runloop_api_client/types/devbox_snapshot_list_view.py b/src/runloop_api_client/types/devbox_snapshot_list_view.py index 6bb1eb530..3e687f0cc 100644 --- a/src/runloop_api_client/types/devbox_snapshot_list_view.py +++ b/src/runloop_api_client/types/devbox_snapshot_list_view.py @@ -11,6 +11,8 @@ class DevboxSnapshotListView(BaseModel): has_more: bool + remaining_count: int + snapshots: List[DevboxSnapshotView] """List of snapshots matching filter.""" diff --git a/src/runloop_api_client/types/repository_connection_list_view.py b/src/runloop_api_client/types/repository_connection_list_view.py index 4ad5a10ec..8085c4718 100644 --- a/src/runloop_api_client/types/repository_connection_list_view.py +++ b/src/runloop_api_client/types/repository_connection_list_view.py @@ -11,6 +11,8 @@ class RepositoryConnectionListView(BaseModel): has_more: bool + remaining_count: int + repositories: List[RepositoryConnectionView] """List of repositories matching filter.""" diff --git a/src/runloop_api_client/types/scenario_list_view.py b/src/runloop_api_client/types/scenario_list_view.py index 9afe534cf..b11272649 100644 --- a/src/runloop_api_client/types/scenario_list_view.py +++ b/src/runloop_api_client/types/scenario_list_view.py @@ -11,6 +11,8 @@ class ScenarioListView(BaseModel): has_more: bool + remaining_count: int + scenarios: List[ScenarioView] """List of Scenarios matching filter.""" diff --git a/src/runloop_api_client/types/scenario_run_list_view.py b/src/runloop_api_client/types/scenario_run_list_view.py index 73494f84c..db0d16d31 100644 --- a/src/runloop_api_client/types/scenario_run_list_view.py +++ b/src/runloop_api_client/types/scenario_run_list_view.py @@ -11,6 +11,8 @@ class ScenarioRunListView(BaseModel): has_more: bool + remaining_count: int + runs: List[ScenarioRunView] """List of ScenarioRuns matching filter.""" diff --git a/src/runloop_api_client/types/scoring_function.py b/src/runloop_api_client/types/scoring_function.py index f7a2a6e0d..e3eddf554 100644 --- a/src/runloop_api_client/types/scoring_function.py +++ b/src/runloop_api_client/types/scoring_function.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional from .._models import BaseModel @@ -11,12 +10,10 @@ class ScoringFunction(BaseModel): name: str """Name of scoring function. Names must only contain [a-zA-Z0-9_-].""" - type: str - """Type of the scoring function. + scoring_function: ScoringFunction + """The scoring function to use for evaluating this scenario. - Use 'bash' as type and fill out 'bash_script' field for scoring via custom bash - scripts. Otherwise use a type corresponding to a custom scorer function or a - public Runloop scorer type. + The type field determines which built-in function to use. """ weight: float @@ -24,16 +21,3 @@ class ScoringFunction(BaseModel): Weights of all scoring functions should sum to 1.0. """ - - bash_script: Optional[str] = None - """ - A single bash script that sets up the environment, scores, and prints the final - score to standard out. Score should be a float between 0.0 and 1.0, and look - like "score=[0.0..1.0]. - """ - - scorer_params: Optional[object] = None - """ - Additional JSON structured context to pass to the scoring function if using - custom scorer. - """ diff --git a/src/runloop_api_client/types/scoring_function_param.py b/src/runloop_api_client/types/scoring_function_param.py index 5bcbacc58..264bf612c 100644 --- a/src/runloop_api_client/types/scoring_function_param.py +++ b/src/runloop_api_client/types/scoring_function_param.py @@ -2,39 +2,120 @@ from __future__ import annotations -from typing import Optional -from typing_extensions import Required, TypedDict +from typing import Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict -__all__ = ["ScoringFunctionParam"] +__all__ = [ + "ScoringFunctionParam", + "ScoringFunction", + "ScoringFunctionAstGrepScoringFunction", + "ScoringFunctionBashScriptScoringFunction", + "ScoringFunctionCommandScoringFunction", + "ScoringFunctionCustomScoringFunction", + "ScoringFunctionPythonScriptScoringFunction", + "ScoringFunctionTestBasedScoringFunction", + "ScoringFunctionTestBasedScoringFunctionTestFile", +] -class ScoringFunctionParam(TypedDict, total=False): - name: Required[str] - """Name of scoring function. Names must only contain [a-zA-Z0-9_-].""" +class ScoringFunctionAstGrepScoringFunction(TypedDict, total=False): + pattern: Required[str] + """AST pattern to match.""" - type: Required[str] - """Type of the scoring function. + search_directory: Required[str] + """The path to search.""" - Use 'bash' as type and fill out 'bash_script' field for scoring via custom bash - scripts. Otherwise use a type corresponding to a custom scorer function or a - public Runloop scorer type. - """ + type: Required[Literal["ast_grep_scorer"]] - weight: Required[float] - """Weight to apply to scoring function score. + lang: str + """The language of the pattern.""" - Weights of all scoring functions should sum to 1.0. - """ - bash_script: Optional[str] +class ScoringFunctionBashScriptScoringFunction(TypedDict, total=False): + type: Required[Literal["bash_script_scorer"]] + + bash_script: str """ A single bash script that sets up the environment, scores, and prints the final score to standard out. Score should be a float between 0.0 and 1.0, and look like "score=[0.0..1.0]. """ + +class ScoringFunctionCommandScoringFunction(TypedDict, total=False): + type: Required[Literal["command_scorer"]] + + command: str + """The command to execute.""" + + +class ScoringFunctionCustomScoringFunction(TypedDict, total=False): + type: Required[Literal["custom_scorer"]] + scorer_params: Optional[object] + """Additional JSON structured context to pass to the scoring function.""" + + +class ScoringFunctionPythonScriptScoringFunction(TypedDict, total=False): + python_script: Required[str] + """Python script to be run. + + The script should output the score to standard out as a float between 0.0 and + 1.0. """ - Additional JSON structured context to pass to the scoring function if using - custom scorer. + + type: Required[Literal["python_script_scorer"]] + + requirements_contents: str + """Package dependencies to be installed. + + The requirements should be a valid requirements.txt file. + """ + + +class ScoringFunctionTestBasedScoringFunctionTestFile(TypedDict, total=False): + file_contents: str + """Content of the test file""" + + file_path: str + """ + Path to write content of the test file, relative to your environment's working + directory + """ + + +class ScoringFunctionTestBasedScoringFunction(TypedDict, total=False): + type: Required[Literal["test_based_scorer"]] + + test_command: str + """The command to execute for running the tests""" + + test_files: Iterable[ScoringFunctionTestBasedScoringFunctionTestFile] + """List of test files to create""" + + +ScoringFunction: TypeAlias = Union[ + ScoringFunctionAstGrepScoringFunction, + ScoringFunctionBashScriptScoringFunction, + ScoringFunctionCommandScoringFunction, + ScoringFunctionCustomScoringFunction, + ScoringFunctionPythonScriptScoringFunction, + ScoringFunctionTestBasedScoringFunction, +] + + +class ScoringFunctionParam(TypedDict, total=False): + name: Required[str] + """Name of scoring function. Names must only contain [a-zA-Z0-9_-].""" + + scoring_function: Required[ScoringFunction] + """The scoring function to use for evaluating this scenario. + + The type field determines which built-in function to use. + """ + + weight: Required[float] + """Weight to apply to scoring function score. + + Weights of all scoring functions should sum to 1.0. """ diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index 5113a18a0..6a93c7ef5 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -23,6 +23,12 @@ class LaunchParameters(BaseModel): 'createTunnel' API. """ + custom_cpu_cores: Optional[int] = None + """custom resource size, number of cpu cores, must be multiple of 2.""" + + custom_gb_memory: Optional[int] = None + """custom memory size, number in Gi, must be a multiple of 2.""" + keep_alive_time_seconds: Optional[int] = None """Time in seconds after which Devbox will automatically shutdown. diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index 320fa92d1..549b3dbaa 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -24,6 +24,12 @@ class LaunchParameters(TypedDict, total=False): 'createTunnel' API. """ + custom_cpu_cores: Optional[int] + """custom resource size, number of cpu cores, must be multiple of 2.""" + + custom_gb_memory: Optional[int] + """custom memory size, number in Gi, must be a multiple of 2.""" + keep_alive_time_seconds: Optional[int] """Time in seconds after which Devbox will automatically shutdown. diff --git a/tests/api_resources/scenarios/test_scorers.py b/tests/api_resources/scenarios/test_scorers.py index 4c04211da..f848d8798 100644 --- a/tests/api_resources/scenarios/test_scorers.py +++ b/tests/api_resources/scenarios/test_scorers.py @@ -196,6 +196,8 @@ def test_method_validate_with_all_params(self, client: Runloop) -> None: "on_idle": "shutdown", }, "available_ports": [0], + "custom_cpu_cores": 0, + "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "SMALL", @@ -417,6 +419,8 @@ async def test_method_validate_with_all_params(self, async_client: AsyncRunloop) "on_idle": "shutdown", }, "available_ports": [0], + "custom_cpu_cores": 0, + "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "SMALL", diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 0fc433dba..5a9fc89e9 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -49,6 +49,8 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "on_idle": "shutdown", }, "available_ports": [0], + "custom_cpu_cores": 0, + "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "SMALL", @@ -218,6 +220,8 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: "on_idle": "shutdown", }, "available_ports": [0], + "custom_cpu_cores": 0, + "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "SMALL", @@ -281,6 +285,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "on_idle": "shutdown", }, "available_ports": [0], + "custom_cpu_cores": 0, + "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "SMALL", @@ -450,6 +456,8 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) "on_idle": "shutdown", }, "available_ports": [0], + "custom_cpu_cores": 0, + "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "SMALL", diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index e3faa298a..ce6638c01 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -65,6 +65,8 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "on_idle": "shutdown", }, "available_ports": [0], + "custom_cpu_cores": 0, + "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "SMALL", @@ -938,6 +940,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "on_idle": "shutdown", }, "available_ports": [0], + "custom_cpu_cores": 0, + "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "SMALL", diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index 218ebb542..8977f886b 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -30,7 +30,11 @@ def test_method_create(self, client: Runloop) -> None: "scoring_function_parameters": [ { "name": "name", - "type": "type", + "scoring_function": { + "pattern": "pattern", + "search_directory": "search_directory", + "type": "ast_grep_scorer", + }, "weight": 0, } ] @@ -50,10 +54,13 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "scoring_function_parameters": [ { "name": "name", - "type": "type", + "scoring_function": { + "pattern": "pattern", + "search_directory": "search_directory", + "type": "ast_grep_scorer", + "lang": "lang", + }, "weight": 0, - "bash_script": "bash_script", - "scorer_params": {}, } ] }, @@ -65,6 +72,8 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "on_idle": "shutdown", }, "available_ports": [0], + "custom_cpu_cores": 0, + "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "SMALL", @@ -87,7 +96,11 @@ def test_raw_response_create(self, client: Runloop) -> None: "scoring_function_parameters": [ { "name": "name", - "type": "type", + "scoring_function": { + "pattern": "pattern", + "search_directory": "search_directory", + "type": "ast_grep_scorer", + }, "weight": 0, } ] @@ -108,7 +121,11 @@ def test_streaming_response_create(self, client: Runloop) -> None: "scoring_function_parameters": [ { "name": "name", - "type": "type", + "scoring_function": { + "pattern": "pattern", + "search_directory": "search_directory", + "type": "ast_grep_scorer", + }, "weight": 0, } ] @@ -170,7 +187,11 @@ def test_method_update(self, client: Runloop) -> None: "scoring_function_parameters": [ { "name": "name", - "type": "type", + "scoring_function": { + "pattern": "pattern", + "search_directory": "search_directory", + "type": "ast_grep_scorer", + }, "weight": 0, } ] @@ -191,10 +212,13 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: "scoring_function_parameters": [ { "name": "name", - "type": "type", + "scoring_function": { + "pattern": "pattern", + "search_directory": "search_directory", + "type": "ast_grep_scorer", + "lang": "lang", + }, "weight": 0, - "bash_script": "bash_script", - "scorer_params": {}, } ] }, @@ -206,6 +230,8 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: "on_idle": "shutdown", }, "available_ports": [0], + "custom_cpu_cores": 0, + "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "SMALL", @@ -229,7 +255,11 @@ def test_raw_response_update(self, client: Runloop) -> None: "scoring_function_parameters": [ { "name": "name", - "type": "type", + "scoring_function": { + "pattern": "pattern", + "search_directory": "search_directory", + "type": "ast_grep_scorer", + }, "weight": 0, } ] @@ -251,7 +281,11 @@ def test_streaming_response_update(self, client: Runloop) -> None: "scoring_function_parameters": [ { "name": "name", - "type": "type", + "scoring_function": { + "pattern": "pattern", + "search_directory": "search_directory", + "type": "ast_grep_scorer", + }, "weight": 0, } ] @@ -276,7 +310,11 @@ def test_path_params_update(self, client: Runloop) -> None: "scoring_function_parameters": [ { "name": "name", - "type": "type", + "scoring_function": { + "pattern": "pattern", + "search_directory": "search_directory", + "type": "ast_grep_scorer", + }, "weight": 0, } ] @@ -405,7 +443,11 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: "scoring_function_parameters": [ { "name": "name", - "type": "type", + "scoring_function": { + "pattern": "pattern", + "search_directory": "search_directory", + "type": "ast_grep_scorer", + }, "weight": 0, } ] @@ -425,10 +467,13 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "scoring_function_parameters": [ { "name": "name", - "type": "type", + "scoring_function": { + "pattern": "pattern", + "search_directory": "search_directory", + "type": "ast_grep_scorer", + "lang": "lang", + }, "weight": 0, - "bash_script": "bash_script", - "scorer_params": {}, } ] }, @@ -440,6 +485,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "on_idle": "shutdown", }, "available_ports": [0], + "custom_cpu_cores": 0, + "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "SMALL", @@ -462,7 +509,11 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: "scoring_function_parameters": [ { "name": "name", - "type": "type", + "scoring_function": { + "pattern": "pattern", + "search_directory": "search_directory", + "type": "ast_grep_scorer", + }, "weight": 0, } ] @@ -483,7 +534,11 @@ async def test_streaming_response_create(self, async_client: AsyncRunloop) -> No "scoring_function_parameters": [ { "name": "name", - "type": "type", + "scoring_function": { + "pattern": "pattern", + "search_directory": "search_directory", + "type": "ast_grep_scorer", + }, "weight": 0, } ] @@ -545,7 +600,11 @@ async def test_method_update(self, async_client: AsyncRunloop) -> None: "scoring_function_parameters": [ { "name": "name", - "type": "type", + "scoring_function": { + "pattern": "pattern", + "search_directory": "search_directory", + "type": "ast_grep_scorer", + }, "weight": 0, } ] @@ -566,10 +625,13 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - "scoring_function_parameters": [ { "name": "name", - "type": "type", + "scoring_function": { + "pattern": "pattern", + "search_directory": "search_directory", + "type": "ast_grep_scorer", + "lang": "lang", + }, "weight": 0, - "bash_script": "bash_script", - "scorer_params": {}, } ] }, @@ -581,6 +643,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - "on_idle": "shutdown", }, "available_ports": [0], + "custom_cpu_cores": 0, + "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "SMALL", @@ -604,7 +668,11 @@ async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: "scoring_function_parameters": [ { "name": "name", - "type": "type", + "scoring_function": { + "pattern": "pattern", + "search_directory": "search_directory", + "type": "ast_grep_scorer", + }, "weight": 0, } ] @@ -626,7 +694,11 @@ async def test_streaming_response_update(self, async_client: AsyncRunloop) -> No "scoring_function_parameters": [ { "name": "name", - "type": "type", + "scoring_function": { + "pattern": "pattern", + "search_directory": "search_directory", + "type": "ast_grep_scorer", + }, "weight": 0, } ] @@ -651,7 +723,11 @@ async def test_path_params_update(self, async_client: AsyncRunloop) -> None: "scoring_function_parameters": [ { "name": "name", - "type": "type", + "scoring_function": { + "pattern": "pattern", + "search_directory": "search_directory", + "type": "ast_grep_scorer", + }, "weight": 0, } ] From 2df6c6d64bc488b0591cf9e08fbbecfe682f5b18 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Mar 2025 01:22:43 +0000 Subject: [PATCH 690/993] chore(internal): version bump (#574) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index caf5ca3f3..59acac471 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.26.0" + ".": "0.27.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 88367b847..103cd4f9c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.26.0" +version = "0.27.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 66357b018..798803838 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.26.0" # x-release-please-version +__version__ = "0.27.0" # x-release-please-version From f06a22dfc84edbe8351620d044c43f90ac41b759 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Mar 2025 16:35:17 +0000 Subject: [PATCH 691/993] feat(api): api update (#575) --- .stats.yml | 2 +- .../types/scoring_function.py | 106 +++++++++++++++++- .../types/scoring_function_param.py | 48 ++++---- tests/api_resources/test_scenarios.py | 36 +++--- 4 files changed, 147 insertions(+), 45 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4dd4711f3..0805f23e6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 78 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1c6045460c43f65b30ffcef9f707e8d71dca568bf8d208347a6046a6f03ff239.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ac5f2286270f1f2c2b41e7f57fcc0527f602ce8d9383c790ed40ce21236e0cf.yml diff --git a/src/runloop_api_client/types/scoring_function.py b/src/runloop_api_client/types/scoring_function.py index e3eddf554..d3035fe0f 100644 --- a/src/runloop_api_client/types/scoring_function.py +++ b/src/runloop_api_client/types/scoring_function.py @@ -1,16 +1,118 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias +from .._utils import PropertyInfo from .._models import BaseModel -__all__ = ["ScoringFunction"] +__all__ = [ + "ScoringFunction", + "Scorer", + "ScorerAstGrepScoringFunction", + "ScorerBashScriptScoringFunction", + "ScorerCommandScoringFunction", + "ScorerCustomScoringFunction", + "ScorerPythonScriptScoringFunction", + "ScorerTestBasedScoringFunction", + "ScorerTestBasedScoringFunctionTestFile", +] + + +class ScorerAstGrepScoringFunction(BaseModel): + pattern: str + """AST pattern to match.""" + + search_directory: str + """The path to search.""" + + type: Literal["ast_grep_scorer"] + + lang: Optional[str] = None + """The language of the pattern.""" + + +class ScorerBashScriptScoringFunction(BaseModel): + type: Literal["bash_script_scorer"] + + bash_script: Optional[str] = None + """ + A single bash script that sets up the environment, scores, and prints the final + score to standard out. Score should be a float between 0.0 and 1.0, and look + like "score=[0.0..1.0]. + """ + + +class ScorerCommandScoringFunction(BaseModel): + type: Literal["command_scorer"] + + command: Optional[str] = None + """The command to execute.""" + + +class ScorerCustomScoringFunction(BaseModel): + type: Literal["custom_scorer"] + + scorer_params: Optional[object] = None + """Additional JSON structured context to pass to the scoring function.""" + + +class ScorerPythonScriptScoringFunction(BaseModel): + python_script: str + """Python script to be run. + + The script should output the score to standard out as a float between 0.0 and + 1.0. + """ + + type: Literal["python_script_scorer"] + + requirements_contents: Optional[str] = None + """Package dependencies to be installed. + + The requirements should be a valid requirements.txt file. + """ + + +class ScorerTestBasedScoringFunctionTestFile(BaseModel): + file_contents: Optional[str] = None + """Content of the test file""" + + file_path: Optional[str] = None + """ + Path to write content of the test file, relative to your environment's working + directory + """ + + +class ScorerTestBasedScoringFunction(BaseModel): + type: Literal["test_based_scorer"] + + test_command: Optional[str] = None + """The command to execute for running the tests""" + + test_files: Optional[List[ScorerTestBasedScoringFunctionTestFile]] = None + """List of test files to create""" + + +Scorer: TypeAlias = Annotated[ + Union[ + ScorerAstGrepScoringFunction, + ScorerBashScriptScoringFunction, + ScorerCommandScoringFunction, + ScorerCustomScoringFunction, + ScorerPythonScriptScoringFunction, + ScorerTestBasedScoringFunction, + ], + PropertyInfo(discriminator="type"), +] class ScoringFunction(BaseModel): name: str """Name of scoring function. Names must only contain [a-zA-Z0-9_-].""" - scoring_function: ScoringFunction + scorer: Scorer """The scoring function to use for evaluating this scenario. The type field determines which built-in function to use. diff --git a/src/runloop_api_client/types/scoring_function_param.py b/src/runloop_api_client/types/scoring_function_param.py index 264bf612c..7488a9707 100644 --- a/src/runloop_api_client/types/scoring_function_param.py +++ b/src/runloop_api_client/types/scoring_function_param.py @@ -7,18 +7,18 @@ __all__ = [ "ScoringFunctionParam", - "ScoringFunction", - "ScoringFunctionAstGrepScoringFunction", - "ScoringFunctionBashScriptScoringFunction", - "ScoringFunctionCommandScoringFunction", - "ScoringFunctionCustomScoringFunction", - "ScoringFunctionPythonScriptScoringFunction", - "ScoringFunctionTestBasedScoringFunction", - "ScoringFunctionTestBasedScoringFunctionTestFile", + "Scorer", + "ScorerAstGrepScoringFunction", + "ScorerBashScriptScoringFunction", + "ScorerCommandScoringFunction", + "ScorerCustomScoringFunction", + "ScorerPythonScriptScoringFunction", + "ScorerTestBasedScoringFunction", + "ScorerTestBasedScoringFunctionTestFile", ] -class ScoringFunctionAstGrepScoringFunction(TypedDict, total=False): +class ScorerAstGrepScoringFunction(TypedDict, total=False): pattern: Required[str] """AST pattern to match.""" @@ -31,7 +31,7 @@ class ScoringFunctionAstGrepScoringFunction(TypedDict, total=False): """The language of the pattern.""" -class ScoringFunctionBashScriptScoringFunction(TypedDict, total=False): +class ScorerBashScriptScoringFunction(TypedDict, total=False): type: Required[Literal["bash_script_scorer"]] bash_script: str @@ -42,21 +42,21 @@ class ScoringFunctionBashScriptScoringFunction(TypedDict, total=False): """ -class ScoringFunctionCommandScoringFunction(TypedDict, total=False): +class ScorerCommandScoringFunction(TypedDict, total=False): type: Required[Literal["command_scorer"]] command: str """The command to execute.""" -class ScoringFunctionCustomScoringFunction(TypedDict, total=False): +class ScorerCustomScoringFunction(TypedDict, total=False): type: Required[Literal["custom_scorer"]] scorer_params: Optional[object] """Additional JSON structured context to pass to the scoring function.""" -class ScoringFunctionPythonScriptScoringFunction(TypedDict, total=False): +class ScorerPythonScriptScoringFunction(TypedDict, total=False): python_script: Required[str] """Python script to be run. @@ -73,7 +73,7 @@ class ScoringFunctionPythonScriptScoringFunction(TypedDict, total=False): """ -class ScoringFunctionTestBasedScoringFunctionTestFile(TypedDict, total=False): +class ScorerTestBasedScoringFunctionTestFile(TypedDict, total=False): file_contents: str """Content of the test file""" @@ -84,23 +84,23 @@ class ScoringFunctionTestBasedScoringFunctionTestFile(TypedDict, total=False): """ -class ScoringFunctionTestBasedScoringFunction(TypedDict, total=False): +class ScorerTestBasedScoringFunction(TypedDict, total=False): type: Required[Literal["test_based_scorer"]] test_command: str """The command to execute for running the tests""" - test_files: Iterable[ScoringFunctionTestBasedScoringFunctionTestFile] + test_files: Iterable[ScorerTestBasedScoringFunctionTestFile] """List of test files to create""" -ScoringFunction: TypeAlias = Union[ - ScoringFunctionAstGrepScoringFunction, - ScoringFunctionBashScriptScoringFunction, - ScoringFunctionCommandScoringFunction, - ScoringFunctionCustomScoringFunction, - ScoringFunctionPythonScriptScoringFunction, - ScoringFunctionTestBasedScoringFunction, +Scorer: TypeAlias = Union[ + ScorerAstGrepScoringFunction, + ScorerBashScriptScoringFunction, + ScorerCommandScoringFunction, + ScorerCustomScoringFunction, + ScorerPythonScriptScoringFunction, + ScorerTestBasedScoringFunction, ] @@ -108,7 +108,7 @@ class ScoringFunctionParam(TypedDict, total=False): name: Required[str] """Name of scoring function. Names must only contain [a-zA-Z0-9_-].""" - scoring_function: Required[ScoringFunction] + scorer: Required[Scorer] """The scoring function to use for evaluating this scenario. The type field determines which built-in function to use. diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index 8977f886b..a19110235 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -30,7 +30,7 @@ def test_method_create(self, client: Runloop) -> None: "scoring_function_parameters": [ { "name": "name", - "scoring_function": { + "scorer": { "pattern": "pattern", "search_directory": "search_directory", "type": "ast_grep_scorer", @@ -54,7 +54,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "scoring_function_parameters": [ { "name": "name", - "scoring_function": { + "scorer": { "pattern": "pattern", "search_directory": "search_directory", "type": "ast_grep_scorer", @@ -96,7 +96,7 @@ def test_raw_response_create(self, client: Runloop) -> None: "scoring_function_parameters": [ { "name": "name", - "scoring_function": { + "scorer": { "pattern": "pattern", "search_directory": "search_directory", "type": "ast_grep_scorer", @@ -121,7 +121,7 @@ def test_streaming_response_create(self, client: Runloop) -> None: "scoring_function_parameters": [ { "name": "name", - "scoring_function": { + "scorer": { "pattern": "pattern", "search_directory": "search_directory", "type": "ast_grep_scorer", @@ -187,7 +187,7 @@ def test_method_update(self, client: Runloop) -> None: "scoring_function_parameters": [ { "name": "name", - "scoring_function": { + "scorer": { "pattern": "pattern", "search_directory": "search_directory", "type": "ast_grep_scorer", @@ -212,7 +212,7 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: "scoring_function_parameters": [ { "name": "name", - "scoring_function": { + "scorer": { "pattern": "pattern", "search_directory": "search_directory", "type": "ast_grep_scorer", @@ -255,7 +255,7 @@ def test_raw_response_update(self, client: Runloop) -> None: "scoring_function_parameters": [ { "name": "name", - "scoring_function": { + "scorer": { "pattern": "pattern", "search_directory": "search_directory", "type": "ast_grep_scorer", @@ -281,7 +281,7 @@ def test_streaming_response_update(self, client: Runloop) -> None: "scoring_function_parameters": [ { "name": "name", - "scoring_function": { + "scorer": { "pattern": "pattern", "search_directory": "search_directory", "type": "ast_grep_scorer", @@ -310,7 +310,7 @@ def test_path_params_update(self, client: Runloop) -> None: "scoring_function_parameters": [ { "name": "name", - "scoring_function": { + "scorer": { "pattern": "pattern", "search_directory": "search_directory", "type": "ast_grep_scorer", @@ -443,7 +443,7 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: "scoring_function_parameters": [ { "name": "name", - "scoring_function": { + "scorer": { "pattern": "pattern", "search_directory": "search_directory", "type": "ast_grep_scorer", @@ -467,7 +467,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "scoring_function_parameters": [ { "name": "name", - "scoring_function": { + "scorer": { "pattern": "pattern", "search_directory": "search_directory", "type": "ast_grep_scorer", @@ -509,7 +509,7 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: "scoring_function_parameters": [ { "name": "name", - "scoring_function": { + "scorer": { "pattern": "pattern", "search_directory": "search_directory", "type": "ast_grep_scorer", @@ -534,7 +534,7 @@ async def test_streaming_response_create(self, async_client: AsyncRunloop) -> No "scoring_function_parameters": [ { "name": "name", - "scoring_function": { + "scorer": { "pattern": "pattern", "search_directory": "search_directory", "type": "ast_grep_scorer", @@ -600,7 +600,7 @@ async def test_method_update(self, async_client: AsyncRunloop) -> None: "scoring_function_parameters": [ { "name": "name", - "scoring_function": { + "scorer": { "pattern": "pattern", "search_directory": "search_directory", "type": "ast_grep_scorer", @@ -625,7 +625,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - "scoring_function_parameters": [ { "name": "name", - "scoring_function": { + "scorer": { "pattern": "pattern", "search_directory": "search_directory", "type": "ast_grep_scorer", @@ -668,7 +668,7 @@ async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: "scoring_function_parameters": [ { "name": "name", - "scoring_function": { + "scorer": { "pattern": "pattern", "search_directory": "search_directory", "type": "ast_grep_scorer", @@ -694,7 +694,7 @@ async def test_streaming_response_update(self, async_client: AsyncRunloop) -> No "scoring_function_parameters": [ { "name": "name", - "scoring_function": { + "scorer": { "pattern": "pattern", "search_directory": "search_directory", "type": "ast_grep_scorer", @@ -723,7 +723,7 @@ async def test_path_params_update(self, async_client: AsyncRunloop) -> None: "scoring_function_parameters": [ { "name": "name", - "scoring_function": { + "scorer": { "pattern": "pattern", "search_directory": "search_directory", "type": "ast_grep_scorer", From 9952784b90b40ab0c400caaee312bc1ce6ae650a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Mar 2025 16:40:59 +0000 Subject: [PATCH 692/993] chore(internal): version bump (#577) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 59acac471..8935e9328 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.27.0" + ".": "0.28.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 103cd4f9c..597cbb494 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.27.0" +version = "0.28.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 798803838..c111395ef 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.27.0" # x-release-please-version +__version__ = "0.28.0" # x-release-please-version From 9a5de898b371d3327abda9c784f120d08c1bba25 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 24 Mar 2025 22:05:57 +0000 Subject: [PATCH 693/993] feat(api): api update (#578) --- .stats.yml | 2 +- .../types/devboxes/devbox_logs_list_view.py | 2 +- src/runloop_api_client/types/scoring_function.py | 6 +++++- src/runloop_api_client/types/scoring_function_param.py | 6 +++++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0805f23e6..8ee679fca 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 78 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4ac5f2286270f1f2c2b41e7f57fcc0527f602ce8d9383c790ed40ce21236e0cf.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-135977a36f92e43542ef10b01c0762706df01cfb6938ae0cd011aca2f22b3699.yml diff --git a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py index 9bddac9a4..fdcb72023 100644 --- a/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py +++ b/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py @@ -12,7 +12,7 @@ class Log(BaseModel): level: str """Log line severity level.""" - source: Literal["setup_commands", "entrypoint", "exec", "files"] + source: Literal["setup_commands", "entrypoint", "exec", "files", "stats"] """The source of the log.""" timestamp_ms: int diff --git a/src/runloop_api_client/types/scoring_function.py b/src/runloop_api_client/types/scoring_function.py index d3035fe0f..08a0a9f1d 100644 --- a/src/runloop_api_client/types/scoring_function.py +++ b/src/runloop_api_client/types/scoring_function.py @@ -21,7 +21,11 @@ class ScorerAstGrepScoringFunction(BaseModel): pattern: str - """AST pattern to match.""" + """AST pattern to match. + + Pattern will be passed to ast-grep using the commandline surround by double + quotes ("), so make sure to use proper escaping (for example, \\$$\\$$\\$$). + """ search_directory: str """The path to search.""" diff --git a/src/runloop_api_client/types/scoring_function_param.py b/src/runloop_api_client/types/scoring_function_param.py index 7488a9707..e2f7bd506 100644 --- a/src/runloop_api_client/types/scoring_function_param.py +++ b/src/runloop_api_client/types/scoring_function_param.py @@ -20,7 +20,11 @@ class ScorerAstGrepScoringFunction(TypedDict, total=False): pattern: Required[str] - """AST pattern to match.""" + """AST pattern to match. + + Pattern will be passed to ast-grep using the commandline surround by double + quotes ("), so make sure to use proper escaping (for example, \\$$\\$$\\$$). + """ search_directory: Required[str] """The path to search.""" From f27b07252f1b52212bb59109ef0ed2798a188bd9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Mar 2025 00:23:56 +0000 Subject: [PATCH 694/993] feat(api): api update (#580) --- .stats.yml | 2 +- src/runloop_api_client/types/scoring_function.py | 3 +++ src/runloop_api_client/types/scoring_function_param.py | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8ee679fca..8a5068455 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 78 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-135977a36f92e43542ef10b01c0762706df01cfb6938ae0cd011aca2f22b3699.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3542d28a321a2d5ae372d8e99dc615fbda814a223e1c15717c37727a1dd00ff1.yml diff --git a/src/runloop_api_client/types/scoring_function.py b/src/runloop_api_client/types/scoring_function.py index 08a0a9f1d..9d5cf655a 100644 --- a/src/runloop_api_client/types/scoring_function.py +++ b/src/runloop_api_client/types/scoring_function.py @@ -55,6 +55,9 @@ class ScorerCommandScoringFunction(BaseModel): class ScorerCustomScoringFunction(BaseModel): + custom_scorer_type: str + """Type of the scoring function, previously registered with Runloop.""" + type: Literal["custom_scorer"] scorer_params: Optional[object] = None diff --git a/src/runloop_api_client/types/scoring_function_param.py b/src/runloop_api_client/types/scoring_function_param.py index e2f7bd506..bfbddb21b 100644 --- a/src/runloop_api_client/types/scoring_function_param.py +++ b/src/runloop_api_client/types/scoring_function_param.py @@ -54,6 +54,9 @@ class ScorerCommandScoringFunction(TypedDict, total=False): class ScorerCustomScoringFunction(TypedDict, total=False): + custom_scorer_type: Required[str] + """Type of the scoring function, previously registered with Runloop.""" + type: Required[Literal["custom_scorer"]] scorer_params: Optional[object] From 8b28e4c46ad90e906e591240ba38e5955b91d930 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Mar 2025 00:38:48 +0000 Subject: [PATCH 695/993] chore(internal): version bump (#581) --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8935e9328..b8dda9bfc 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.28.0" + ".": "0.29.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 597cbb494..f77538f01 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.28.0" +version = "0.29.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index c111395ef..c454e8b46 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.28.0" # x-release-please-version +__version__ = "0.29.0" # x-release-please-version From bcde815431c521ab6d0a7682f2e329072ebb9394 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Mar 2025 04:08:19 +0000 Subject: [PATCH 696/993] chore: fix typos (#582) --- src/runloop_api_client/_models.py | 2 +- src/runloop_api_client/_utils/_transform.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index b51a1bf5f..349357169 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -681,7 +681,7 @@ def set_pydantic_config(typ: Any, config: pydantic.ConfigDict) -> None: setattr(typ, "__pydantic_config__", config) # noqa: B010 -# our use of subclasssing here causes weirdness for type checkers, +# our use of subclassing here causes weirdness for type checkers, # so we just pretend that we don't subclass if TYPE_CHECKING: GenericModel = BaseModel diff --git a/src/runloop_api_client/_utils/_transform.py b/src/runloop_api_client/_utils/_transform.py index 18afd9d8b..7ac2e17fb 100644 --- a/src/runloop_api_client/_utils/_transform.py +++ b/src/runloop_api_client/_utils/_transform.py @@ -126,7 +126,7 @@ def _get_annotated_type(type_: type) -> type | None: def _maybe_transform_key(key: str, type_: type) -> str: """Transform the given `data` based on the annotations provided in `type_`. - Note: this function only looks at `Annotated` types that contain `PropertInfo` metadata. + Note: this function only looks at `Annotated` types that contain `PropertyInfo` metadata. """ annotated_type = _get_annotated_type(type_) if annotated_type is None: From 83ca1b766c4184f686c51d3c879cc680e040e34a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Mar 2025 04:09:05 +0000 Subject: [PATCH 697/993] codegen metadata --- .stats.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.stats.yml b/.stats.yml index 8a5068455..6d1940656 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,4 @@ configured_endpoints: 78 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3542d28a321a2d5ae372d8e99dc615fbda814a223e1c15717c37727a1dd00ff1.yml +openapi_spec_hash: a7a209abf76a123e47e7cd4fe0b10597 +config_hash: 84dec0743c13de8bb22f976814deaae9 From 4c0660c62183cdd9d5ee762c233e1c32edb5fc73 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 4 Apr 2025 11:51:13 +0000 Subject: [PATCH 698/993] chore(internal): remove trailing character (#584) --- tests/test_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_client.py b/tests/test_client.py index 638f65a36..2453b22ac 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1709,7 +1709,7 @@ def test_get_platform(self) -> None: import threading from runloop_api_client._utils import asyncify - from runloop_api_client._base_client import get_platform + from runloop_api_client._base_client import get_platform async def test_main() -> None: result = await asyncify(get_platform)() From 458b50cc6d1ae8761db9c9e8f769fd5255ad2ad3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 5 Apr 2025 02:28:13 +0000 Subject: [PATCH 699/993] docs: swap examples used in readme (#585) --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ec6ee93f1..d360ef80f 100644 --- a/README.md +++ b/README.md @@ -145,8 +145,7 @@ from runloop_api_client import Runloop client = Runloop() -blueprint_view = client.blueprints.create( - name="name", +devbox_view = client.devboxes.create( launch_parameters={ "after_idle": { "idle_time_seconds": 0, @@ -160,7 +159,7 @@ blueprint_view = client.blueprints.create( "resource_size_request": "SMALL", }, ) -print(blueprint_view.launch_parameters) +print(devbox_view.launch_parameters) ``` ## File uploads From 5af36bd9fec39f9d412cb6ee2cb94c4ed9ba76da Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 8 Apr 2025 23:00:14 +0000 Subject: [PATCH 700/993] feat(api): api update (#586) --- .stats.yml | 4 +- README.md | 2 +- api.md | 34 ++++--- .../resources/benchmarks/benchmarks.py | 45 +++++----- .../resources/devboxes/devboxes.py | 8 +- .../resources/scenarios/scenarios.py | 54 +++++------ .../resources/scenarios/scorers.py | 8 +- src/runloop_api_client/types/__init__.py | 13 ++- .../types/benchmark_create_response.py | 23 +++++ .../types/benchmark_list_public_response.py | 23 +++++ ...ark_view.py => benchmark_list_response.py} | 4 +- .../types/benchmark_list_view.py | 19 ---- .../types/benchmark_retrieve_response.py | 23 +++++ .../types/benchmark_run_view.py | 19 +++- .../types/blueprint_view.py | 3 + .../types/scenario_create_response.py | 37 ++++++++ .../types/scenario_list_public_response.py | 37 ++++++++ ...ario_view.py => scenario_list_response.py} | 4 +- .../types/scenario_list_view.py | 19 ---- .../types/scenario_retrieve_response.py | 37 ++++++++ .../types/scenario_run_view.py | 2 +- .../types/scenario_update_response.py | 37 ++++++++ .../types/scenarios/scorer_create_params.py | 2 +- .../types/scenarios/scorer_update_params.py | 2 +- .../types/shared/launch_parameters.py | 4 +- .../types/shared_params/launch_parameters.py | 4 +- tests/api_resources/scenarios/test_scorers.py | 4 +- tests/api_resources/test_benchmarks.py | 65 +++++++------- tests/api_resources/test_blueprints.py | 8 +- tests/api_resources/test_devboxes.py | 16 ++-- tests/api_resources/test_scenarios.py | 90 ++++++++++--------- 31 files changed, 439 insertions(+), 211 deletions(-) create mode 100644 src/runloop_api_client/types/benchmark_create_response.py create mode 100644 src/runloop_api_client/types/benchmark_list_public_response.py rename src/runloop_api_client/types/{benchmark_view.py => benchmark_list_response.py} (87%) delete mode 100644 src/runloop_api_client/types/benchmark_list_view.py create mode 100644 src/runloop_api_client/types/benchmark_retrieve_response.py create mode 100644 src/runloop_api_client/types/scenario_create_response.py create mode 100644 src/runloop_api_client/types/scenario_list_public_response.py rename src/runloop_api_client/types/{scenario_view.py => scenario_list_response.py} (93%) delete mode 100644 src/runloop_api_client/types/scenario_list_view.py create mode 100644 src/runloop_api_client/types/scenario_retrieve_response.py create mode 100644 src/runloop_api_client/types/scenario_update_response.py diff --git a/.stats.yml b/.stats.yml index 6d1940656..79f2100c6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 78 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3542d28a321a2d5ae372d8e99dc615fbda814a223e1c15717c37727a1dd00ff1.yml -openapi_spec_hash: a7a209abf76a123e47e7cd4fe0b10597 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d0a6e2309db88a60f84521dd672c4beac96b1fcda6145c045fa1251f5bcd4e4f.yml +openapi_spec_hash: b618fb05e03c155c45d16d6a62093106 config_hash: 84dec0743c13de8bb22f976814deaae9 diff --git a/README.md b/README.md index d360ef80f..10c64fd65 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,7 @@ devbox_view = client.devboxes.create( "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], - "resource_size_request": "SMALL", + "resource_size_request": "X_SMALL", }, ) print(devbox_view.launch_parameters) diff --git a/api.md b/api.md index aaecbbfdd..ea4a18d18 100644 --- a/api.md +++ b/api.md @@ -11,20 +11,22 @@ Types: ```python from runloop_api_client.types import ( BenchmarkCreateParameters, - BenchmarkListView, BenchmarkRunListView, BenchmarkRunView, - BenchmarkView, StartBenchmarkRunParameters, + BenchmarkCreateResponse, + BenchmarkRetrieveResponse, + BenchmarkListResponse, + BenchmarkListPublicResponse, ) ``` Methods: -- client.benchmarks.create(\*\*params) -> BenchmarkView -- client.benchmarks.retrieve(id) -> BenchmarkView -- client.benchmarks.list(\*\*params) -> SyncBenchmarksCursorIDPage[BenchmarkView] -- client.benchmarks.list_public(\*\*params) -> SyncBenchmarksCursorIDPage[BenchmarkView] +- client.benchmarks.create(\*\*params) -> BenchmarkCreateResponse +- client.benchmarks.retrieve(id) -> BenchmarkRetrieveResponse +- client.benchmarks.list(\*\*params) -> SyncBenchmarksCursorIDPage[BenchmarkListResponse] +- client.benchmarks.list_public(\*\*params) -> SyncBenchmarksCursorIDPage[BenchmarkListPublicResponse] - client.benchmarks.start_run(\*\*params) -> BenchmarkRunView ## Runs @@ -75,6 +77,7 @@ from runloop_api_client.types import ( DevboxDeleteDiskSnapshotResponse, DevboxKeepAliveResponse, DevboxReadFileContentsResponse, + DevboxRemoveTunnelResponse, DevboxUploadFileResponse, ) ``` @@ -94,7 +97,7 @@ Methods: - client.devboxes.keep_alive(id) -> object - client.devboxes.list_disk_snapshots(\*\*params) -> SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView] - client.devboxes.read_file_contents(id, \*\*params) -> str -- client.devboxes.remove_tunnel(id, \*\*params) -> DevboxTunnelView +- client.devboxes.remove_tunnel(id, \*\*params) -> object - client.devboxes.resume(id) -> DevboxView - client.devboxes.shutdown(id) -> DevboxView - client.devboxes.snapshot_disk(id, \*\*params) -> DevboxSnapshotView @@ -262,25 +265,28 @@ from runloop_api_client.types import ( InputContext, ScenarioCreateParameters, ScenarioEnvironment, - ScenarioListView, ScenarioRunListView, ScenarioRunView, - ScenarioView, ScoringContract, ScoringContractResultView, ScoringFunction, ScoringFunctionResultView, StartScenarioRunParameters, + ScenarioCreateResponse, + ScenarioRetrieveResponse, + ScenarioUpdateResponse, + ScenarioListResponse, + ScenarioListPublicResponse, ) ``` Methods: -- client.scenarios.create(\*\*params) -> ScenarioView -- client.scenarios.retrieve(id) -> ScenarioView -- client.scenarios.update(id, \*\*params) -> ScenarioView -- client.scenarios.list(\*\*params) -> SyncScenariosCursorIDPage[ScenarioView] -- client.scenarios.list_public(\*\*params) -> SyncScenariosCursorIDPage[ScenarioView] +- client.scenarios.create(\*\*params) -> ScenarioCreateResponse +- client.scenarios.retrieve(id) -> ScenarioRetrieveResponse +- client.scenarios.update(id, \*\*params) -> ScenarioUpdateResponse +- client.scenarios.list(\*\*params) -> SyncScenariosCursorIDPage[ScenarioListResponse] +- client.scenarios.list_public(\*\*params) -> SyncScenariosCursorIDPage[ScenarioListPublicResponse] - client.scenarios.start_run(\*\*params) -> ScenarioRunView ## Runs diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py index 54501bfa3..c2ceb10f1 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -35,8 +35,11 @@ ) from ...pagination import SyncBenchmarksCursorIDPage, AsyncBenchmarksCursorIDPage from ..._base_client import AsyncPaginator, make_request_options -from ...types.benchmark_view import BenchmarkView from ...types.benchmark_run_view import BenchmarkRunView +from ...types.benchmark_list_response import BenchmarkListResponse +from ...types.benchmark_create_response import BenchmarkCreateResponse +from ...types.benchmark_retrieve_response import BenchmarkRetrieveResponse +from ...types.benchmark_list_public_response import BenchmarkListPublicResponse __all__ = ["BenchmarksResource", "AsyncBenchmarksResource"] @@ -78,7 +81,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BenchmarkView: + ) -> BenchmarkCreateResponse: """ Create a Benchmark with a set of Scenarios. @@ -116,7 +119,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BenchmarkView, + cast_to=BenchmarkCreateResponse, ) def retrieve( @@ -129,7 +132,7 @@ def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BenchmarkView: + ) -> BenchmarkRetrieveResponse: """ Get a previously created Benchmark. @@ -149,7 +152,7 @@ def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=BenchmarkView, + cast_to=BenchmarkRetrieveResponse, ) def list( @@ -163,7 +166,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncBenchmarksCursorIDPage[BenchmarkView]: + ) -> SyncBenchmarksCursorIDPage[BenchmarkListResponse]: """ List all Benchmarks matching filter. @@ -182,7 +185,7 @@ def list( """ return self._get_api_list( "/v1/benchmarks", - page=SyncBenchmarksCursorIDPage[BenchmarkView], + page=SyncBenchmarksCursorIDPage[BenchmarkListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -196,7 +199,7 @@ def list( benchmark_list_params.BenchmarkListParams, ), ), - model=BenchmarkView, + model=BenchmarkListResponse, ) def list_public( @@ -210,7 +213,7 @@ def list_public( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncBenchmarksCursorIDPage[BenchmarkView]: + ) -> SyncBenchmarksCursorIDPage[BenchmarkListPublicResponse]: """ List all public benchmarks matching filter. @@ -229,7 +232,7 @@ def list_public( """ return self._get_api_list( "/v1/benchmarks/list_public", - page=SyncBenchmarksCursorIDPage[BenchmarkView], + page=SyncBenchmarksCursorIDPage[BenchmarkListPublicResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -243,7 +246,7 @@ def list_public( benchmark_list_public_params.BenchmarkListPublicParams, ), ), - model=BenchmarkView, + model=BenchmarkListPublicResponse, ) def start_run( @@ -338,7 +341,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BenchmarkView: + ) -> BenchmarkCreateResponse: """ Create a Benchmark with a set of Scenarios. @@ -376,7 +379,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BenchmarkView, + cast_to=BenchmarkCreateResponse, ) async def retrieve( @@ -389,7 +392,7 @@ async def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BenchmarkView: + ) -> BenchmarkRetrieveResponse: """ Get a previously created Benchmark. @@ -409,7 +412,7 @@ async def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=BenchmarkView, + cast_to=BenchmarkRetrieveResponse, ) def list( @@ -423,7 +426,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[BenchmarkView, AsyncBenchmarksCursorIDPage[BenchmarkView]]: + ) -> AsyncPaginator[BenchmarkListResponse, AsyncBenchmarksCursorIDPage[BenchmarkListResponse]]: """ List all Benchmarks matching filter. @@ -442,7 +445,7 @@ def list( """ return self._get_api_list( "/v1/benchmarks", - page=AsyncBenchmarksCursorIDPage[BenchmarkView], + page=AsyncBenchmarksCursorIDPage[BenchmarkListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -456,7 +459,7 @@ def list( benchmark_list_params.BenchmarkListParams, ), ), - model=BenchmarkView, + model=BenchmarkListResponse, ) def list_public( @@ -470,7 +473,7 @@ def list_public( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[BenchmarkView, AsyncBenchmarksCursorIDPage[BenchmarkView]]: + ) -> AsyncPaginator[BenchmarkListPublicResponse, AsyncBenchmarksCursorIDPage[BenchmarkListPublicResponse]]: """ List all public benchmarks matching filter. @@ -489,7 +492,7 @@ def list_public( """ return self._get_api_list( "/v1/benchmarks/list_public", - page=AsyncBenchmarksCursorIDPage[BenchmarkView], + page=AsyncBenchmarksCursorIDPage[BenchmarkListPublicResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -503,7 +506,7 @@ def list_public( benchmark_list_public_params.BenchmarkListPublicParams, ), ), - model=BenchmarkView, + model=BenchmarkListPublicResponse, ) async def start_run( diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 7c9253108..a5848c024 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -843,7 +843,7 @@ def remove_tunnel( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> DevboxTunnelView: + ) -> object: """ Remove a previously opened tunnel on the Devbox. @@ -872,7 +872,7 @@ def remove_tunnel( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=DevboxTunnelView, + cast_to=object, ) def resume( @@ -1906,7 +1906,7 @@ async def remove_tunnel( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> DevboxTunnelView: + ) -> object: """ Remove a previously opened tunnel on the Devbox. @@ -1935,7 +1935,7 @@ async def remove_tunnel( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=DevboxTunnelView, + cast_to=object, ) async def resume( diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index b42f56b13..023f1da82 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -44,11 +44,15 @@ ) from ...pagination import SyncScenariosCursorIDPage, AsyncScenariosCursorIDPage from ..._base_client import AsyncPaginator, make_request_options -from ...types.scenario_view import ScenarioView from ...types.scenario_run_view import ScenarioRunView from ...types.input_context_param import InputContextParam +from ...types.scenario_list_response import ScenarioListResponse from ...types.scoring_contract_param import ScoringContractParam +from ...types.scenario_create_response import ScenarioCreateResponse +from ...types.scenario_update_response import ScenarioUpdateResponse from ...types.scenario_environment_param import ScenarioEnvironmentParam +from ...types.scenario_retrieve_response import ScenarioRetrieveResponse +from ...types.scenario_list_public_response import ScenarioListPublicResponse __all__ = ["ScenariosResource", "AsyncScenariosResource"] @@ -97,7 +101,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> ScenarioView: + ) -> ScenarioCreateResponse: """ Create a Scenario, a repeatable AI coding evaluation test that defines the starting environment as well as evaluation success criteria. @@ -147,7 +151,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=ScenarioView, + cast_to=ScenarioCreateResponse, ) def retrieve( @@ -160,7 +164,7 @@ def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScenarioView: + ) -> ScenarioRetrieveResponse: """ Get a previously created scenario. @@ -180,7 +184,7 @@ def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ScenarioView, + cast_to=ScenarioRetrieveResponse, ) def update( @@ -200,7 +204,7 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> ScenarioView: + ) -> ScenarioUpdateResponse: """ Update a Scenario, a repeatable AI coding evaluation test that defines the starting environment as well as evaluation success criteria. @@ -252,7 +256,7 @@ def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=ScenarioView, + cast_to=ScenarioUpdateResponse, ) def list( @@ -267,7 +271,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncScenariosCursorIDPage[ScenarioView]: + ) -> SyncScenariosCursorIDPage[ScenarioListResponse]: """List all Scenarios matching filter. Args: @@ -289,7 +293,7 @@ def list( """ return self._get_api_list( "/v1/scenarios", - page=SyncScenariosCursorIDPage[ScenarioView], + page=SyncScenariosCursorIDPage[ScenarioListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -304,7 +308,7 @@ def list( scenario_list_params.ScenarioListParams, ), ), - model=ScenarioView, + model=ScenarioListResponse, ) def list_public( @@ -319,7 +323,7 @@ def list_public( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncScenariosCursorIDPage[ScenarioView]: + ) -> SyncScenariosCursorIDPage[ScenarioListPublicResponse]: """ List all public scenarios matching filter. @@ -340,7 +344,7 @@ def list_public( """ return self._get_api_list( "/v1/scenarios/list_public", - page=SyncScenariosCursorIDPage[ScenarioView], + page=SyncScenariosCursorIDPage[ScenarioListPublicResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -355,7 +359,7 @@ def list_public( scenario_list_public_params.ScenarioListPublicParams, ), ), - model=ScenarioView, + model=ScenarioListPublicResponse, ) def start_run( @@ -461,7 +465,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> ScenarioView: + ) -> ScenarioCreateResponse: """ Create a Scenario, a repeatable AI coding evaluation test that defines the starting environment as well as evaluation success criteria. @@ -511,7 +515,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=ScenarioView, + cast_to=ScenarioCreateResponse, ) async def retrieve( @@ -524,7 +528,7 @@ async def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScenarioView: + ) -> ScenarioRetrieveResponse: """ Get a previously created scenario. @@ -544,7 +548,7 @@ async def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ScenarioView, + cast_to=ScenarioRetrieveResponse, ) async def update( @@ -564,7 +568,7 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> ScenarioView: + ) -> ScenarioUpdateResponse: """ Update a Scenario, a repeatable AI coding evaluation test that defines the starting environment as well as evaluation success criteria. @@ -616,7 +620,7 @@ async def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=ScenarioView, + cast_to=ScenarioUpdateResponse, ) def list( @@ -631,7 +635,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ScenarioView, AsyncScenariosCursorIDPage[ScenarioView]]: + ) -> AsyncPaginator[ScenarioListResponse, AsyncScenariosCursorIDPage[ScenarioListResponse]]: """List all Scenarios matching filter. Args: @@ -653,7 +657,7 @@ def list( """ return self._get_api_list( "/v1/scenarios", - page=AsyncScenariosCursorIDPage[ScenarioView], + page=AsyncScenariosCursorIDPage[ScenarioListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -668,7 +672,7 @@ def list( scenario_list_params.ScenarioListParams, ), ), - model=ScenarioView, + model=ScenarioListResponse, ) def list_public( @@ -683,7 +687,7 @@ def list_public( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ScenarioView, AsyncScenariosCursorIDPage[ScenarioView]]: + ) -> AsyncPaginator[ScenarioListPublicResponse, AsyncScenariosCursorIDPage[ScenarioListPublicResponse]]: """ List all public scenarios matching filter. @@ -704,7 +708,7 @@ def list_public( """ return self._get_api_list( "/v1/scenarios/list_public", - page=AsyncScenariosCursorIDPage[ScenarioView], + page=AsyncScenariosCursorIDPage[ScenarioListPublicResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -719,7 +723,7 @@ def list_public( scenario_list_public_params.ScenarioListPublicParams, ), ), - model=ScenarioView, + model=ScenarioListPublicResponse, ) async def start_run( diff --git a/src/runloop_api_client/resources/scenarios/scorers.py b/src/runloop_api_client/resources/scenarios/scorers.py index 77f9393d6..c71bb028b 100644 --- a/src/runloop_api_client/resources/scenarios/scorers.py +++ b/src/runloop_api_client/resources/scenarios/scorers.py @@ -68,7 +68,7 @@ def create( Args: bash_script: Bash script for the custom scorer taking context as a json object - $RL_TEST_CONTEXT. + $RL_SCORER_CONTEXT. type: Name of the type of custom scorer. @@ -153,7 +153,7 @@ def update( Args: bash_script: Bash script for the custom scorer taking context as a json object - $RL_TEST_CONTEXT. + $RL_SCORER_CONTEXT. type: Name of the type of custom scorer. @@ -327,7 +327,7 @@ async def create( Args: bash_script: Bash script for the custom scorer taking context as a json object - $RL_TEST_CONTEXT. + $RL_SCORER_CONTEXT. type: Name of the type of custom scorer. @@ -412,7 +412,7 @@ async def update( Args: bash_script: Bash script for the custom scorer taking context as a json object - $RL_TEST_CONTEXT. + $RL_SCORER_CONTEXT. type: Name of the type of custom scorer. diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 31b76176f..88e630982 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -9,8 +9,6 @@ ) from .devbox_view import DevboxView as DevboxView from .input_context import InputContext as InputContext -from .scenario_view import ScenarioView as ScenarioView -from .benchmark_view import BenchmarkView as BenchmarkView from .blueprint_view import BlueprintView as BlueprintView from .devbox_list_view import DevboxListView as DevboxListView from .scoring_contract import ScoringContract as ScoringContract @@ -19,8 +17,6 @@ from .benchmark_run_view import BenchmarkRunView as BenchmarkRunView from .devbox_list_params import DevboxListParams as DevboxListParams from .devbox_tunnel_view import DevboxTunnelView as DevboxTunnelView -from .scenario_list_view import ScenarioListView as ScenarioListView -from .benchmark_list_view import BenchmarkListView as BenchmarkListView from .blueprint_build_log import BlueprintBuildLog as BlueprintBuildLog from .blueprint_list_view import BlueprintListView as BlueprintListView from .input_context_param import InputContextParam as InputContextParam @@ -34,15 +30,20 @@ from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView from .repository_list_params import RepositoryListParams as RepositoryListParams from .scenario_create_params import ScenarioCreateParams as ScenarioCreateParams +from .scenario_list_response import ScenarioListResponse as ScenarioListResponse from .scenario_run_list_view import ScenarioRunListView as ScenarioRunListView from .scenario_update_params import ScenarioUpdateParams as ScenarioUpdateParams from .scoring_contract_param import ScoringContractParam as ScoringContractParam from .scoring_function_param import ScoringFunctionParam as ScoringFunctionParam from .benchmark_create_params import BenchmarkCreateParams as BenchmarkCreateParams +from .benchmark_list_response import BenchmarkListResponse as BenchmarkListResponse from .benchmark_run_list_view import BenchmarkRunListView as BenchmarkRunListView from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams from .repository_create_params import RepositoryCreateParams as RepositoryCreateParams +from .scenario_create_response import ScenarioCreateResponse as ScenarioCreateResponse +from .scenario_update_response import ScenarioUpdateResponse as ScenarioUpdateResponse +from .benchmark_create_response import BenchmarkCreateResponse as BenchmarkCreateResponse from .devbox_snapshot_list_view import DevboxSnapshotListView as DevboxSnapshotListView from .devbox_upload_file_params import DevboxUploadFileParams as DevboxUploadFileParams from .scenario_start_run_params import ScenarioStartRunParams as ScenarioStartRunParams @@ -52,6 +53,8 @@ from .repository_connection_view import RepositoryConnectionView as RepositoryConnectionView from .repository_version_details import RepositoryVersionDetails as RepositoryVersionDetails from .scenario_environment_param import ScenarioEnvironmentParam as ScenarioEnvironmentParam +from .scenario_retrieve_response import ScenarioRetrieveResponse as ScenarioRetrieveResponse +from .benchmark_retrieve_response import BenchmarkRetrieveResponse as BenchmarkRetrieveResponse from .devbox_create_tunnel_params import DevboxCreateTunnelParams as DevboxCreateTunnelParams from .devbox_download_file_params import DevboxDownloadFileParams as DevboxDownloadFileParams from .devbox_execute_async_params import DevboxExecuteAsyncParams as DevboxExecuteAsyncParams @@ -63,6 +66,8 @@ from .repository_version_list_view import RepositoryVersionListView as RepositoryVersionListView from .scoring_contract_result_view import ScoringContractResultView as ScoringContractResultView from .scoring_function_result_view import ScoringFunctionResultView as ScoringFunctionResultView +from .scenario_list_public_response import ScenarioListPublicResponse as ScenarioListPublicResponse +from .benchmark_list_public_response import BenchmarkListPublicResponse as BenchmarkListPublicResponse from .blueprint_build_logs_list_view import BlueprintBuildLogsListView as BlueprintBuildLogsListView from .devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse as DevboxCreateSSHKeyResponse from .repository_connection_list_view import RepositoryConnectionListView as RepositoryConnectionListView diff --git a/src/runloop_api_client/types/benchmark_create_response.py b/src/runloop_api_client/types/benchmark_create_response.py new file mode 100644 index 000000000..a50772cfc --- /dev/null +++ b/src/runloop_api_client/types/benchmark_create_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["BenchmarkCreateResponse"] + + +class BenchmarkCreateResponse(BaseModel): + id: str + """The ID of the Benchmark.""" + + metadata: Dict[str, str] + """User defined metadata to attach to the benchmark for organization.""" + + name: str + """The name of the Benchmark.""" + + scenario_ids: List[str] = FieldInfo(alias="scenarioIds") + """List of Scenario IDs that make up the benchmark.""" diff --git a/src/runloop_api_client/types/benchmark_list_public_response.py b/src/runloop_api_client/types/benchmark_list_public_response.py new file mode 100644 index 000000000..c941722ab --- /dev/null +++ b/src/runloop_api_client/types/benchmark_list_public_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["BenchmarkListPublicResponse"] + + +class BenchmarkListPublicResponse(BaseModel): + id: str + """The ID of the Benchmark.""" + + metadata: Dict[str, str] + """User defined metadata to attach to the benchmark for organization.""" + + name: str + """The name of the Benchmark.""" + + scenario_ids: List[str] = FieldInfo(alias="scenarioIds") + """List of Scenario IDs that make up the benchmark.""" diff --git a/src/runloop_api_client/types/benchmark_view.py b/src/runloop_api_client/types/benchmark_list_response.py similarity index 87% rename from src/runloop_api_client/types/benchmark_view.py rename to src/runloop_api_client/types/benchmark_list_response.py index 7f2f1e1e3..2be118e07 100644 --- a/src/runloop_api_client/types/benchmark_view.py +++ b/src/runloop_api_client/types/benchmark_list_response.py @@ -6,10 +6,10 @@ from .._models import BaseModel -__all__ = ["BenchmarkView"] +__all__ = ["BenchmarkListResponse"] -class BenchmarkView(BaseModel): +class BenchmarkListResponse(BaseModel): id: str """The ID of the Benchmark.""" diff --git a/src/runloop_api_client/types/benchmark_list_view.py b/src/runloop_api_client/types/benchmark_list_view.py deleted file mode 100644 index 225002840..000000000 --- a/src/runloop_api_client/types/benchmark_list_view.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from .._models import BaseModel -from .benchmark_view import BenchmarkView - -__all__ = ["BenchmarkListView"] - - -class BenchmarkListView(BaseModel): - benchmarks: List[BenchmarkView] - """List of Benchmarks matching filter.""" - - has_more: bool - - remaining_count: int - - total_count: int diff --git a/src/runloop_api_client/types/benchmark_retrieve_response.py b/src/runloop_api_client/types/benchmark_retrieve_response.py new file mode 100644 index 000000000..64ad5c1ca --- /dev/null +++ b/src/runloop_api_client/types/benchmark_retrieve_response.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List + +from pydantic import Field as FieldInfo + +from .._models import BaseModel + +__all__ = ["BenchmarkRetrieveResponse"] + + +class BenchmarkRetrieveResponse(BaseModel): + id: str + """The ID of the Benchmark.""" + + metadata: Dict[str, str] + """User defined metadata to attach to the benchmark for organization.""" + + name: str + """The name of the Benchmark.""" + + scenario_ids: List[str] = FieldInfo(alias="scenarioIds") + """List of Scenario IDs that make up the benchmark.""" diff --git a/src/runloop_api_client/types/benchmark_run_view.py b/src/runloop_api_client/types/benchmark_run_view.py index 9bfbd3858..9239985aa 100644 --- a/src/runloop_api_client/types/benchmark_run_view.py +++ b/src/runloop_api_client/types/benchmark_run_view.py @@ -3,9 +3,23 @@ from typing import Dict, List, Optional from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel +from .scoring_contract_result_view import ScoringContractResultView + +__all__ = ["BenchmarkRunView", "ScenarioRun"] + -__all__ = ["BenchmarkRunView"] +class ScenarioRun(BaseModel): + scenario_id: str + """ID of the Scenario that has been run.""" + + scoring_result: ScoringContractResultView = FieldInfo(alias="scoringResult") + """The scoring result of the ScenarioRun.""" + + scenario_run_id: Optional[str] = FieldInfo(alias="scenarioRunId", default=None) + """ID of the scenario run.""" class BenchmarkRunView(BaseModel): @@ -21,6 +35,9 @@ class BenchmarkRunView(BaseModel): pending_scenarios: List[str] """List of Scenarios that need to be completed before benchmark can be completed.""" + scenario_runs: List[ScenarioRun] + """List of Scenarios have been completed.""" + start_time_ms: int """The time the benchmark run execution started (Unix timestamp milliseconds).""" diff --git a/src/runloop_api_client/types/blueprint_view.py b/src/runloop_api_client/types/blueprint_view.py index 0840fff31..a6cd9c412 100644 --- a/src/runloop_api_client/types/blueprint_view.py +++ b/src/runloop_api_client/types/blueprint_view.py @@ -22,6 +22,9 @@ class BlueprintView(BaseModel): parameters: BlueprintBuildParameters """The parameters used to create Blueprint.""" + state: Literal["created", "deleted"] + """The state of the Blueprint.""" + status: Literal["provisioning", "building", "failed", "build_complete"] """The status of the Blueprint build.""" diff --git a/src/runloop_api_client/types/scenario_create_response.py b/src/runloop_api_client/types/scenario_create_response.py new file mode 100644 index 000000000..4df2f7303 --- /dev/null +++ b/src/runloop_api_client/types/scenario_create_response.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Optional + +from .._models import BaseModel +from .input_context import InputContext +from .scoring_contract import ScoringContract +from .scenario_environment import ScenarioEnvironment + +__all__ = ["ScenarioCreateResponse"] + + +class ScenarioCreateResponse(BaseModel): + id: str + """The ID of the Scenario.""" + + input_context: InputContext + """The input context for the Scenario.""" + + metadata: Dict[str, str] + """User defined metadata to attach to the scenario for organization.""" + + name: str + """The name of the Scenario.""" + + scoring_contract: ScoringContract + """The scoring contract for the Scenario.""" + + environment: Optional[ScenarioEnvironment] = None + """The Environment in which the Scenario is run.""" + + reference_output: Optional[str] = None + """A string representation of the reference output to solve the scenario. + + Commonly can be the result of a git diff or a sequence of command actions to + apply to the environment. + """ diff --git a/src/runloop_api_client/types/scenario_list_public_response.py b/src/runloop_api_client/types/scenario_list_public_response.py new file mode 100644 index 000000000..795e437fa --- /dev/null +++ b/src/runloop_api_client/types/scenario_list_public_response.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Optional + +from .._models import BaseModel +from .input_context import InputContext +from .scoring_contract import ScoringContract +from .scenario_environment import ScenarioEnvironment + +__all__ = ["ScenarioListPublicResponse"] + + +class ScenarioListPublicResponse(BaseModel): + id: str + """The ID of the Scenario.""" + + input_context: InputContext + """The input context for the Scenario.""" + + metadata: Dict[str, str] + """User defined metadata to attach to the scenario for organization.""" + + name: str + """The name of the Scenario.""" + + scoring_contract: ScoringContract + """The scoring contract for the Scenario.""" + + environment: Optional[ScenarioEnvironment] = None + """The Environment in which the Scenario is run.""" + + reference_output: Optional[str] = None + """A string representation of the reference output to solve the scenario. + + Commonly can be the result of a git diff or a sequence of command actions to + apply to the environment. + """ diff --git a/src/runloop_api_client/types/scenario_view.py b/src/runloop_api_client/types/scenario_list_response.py similarity index 93% rename from src/runloop_api_client/types/scenario_view.py rename to src/runloop_api_client/types/scenario_list_response.py index 4ba20d9c9..7cf25f9e3 100644 --- a/src/runloop_api_client/types/scenario_view.py +++ b/src/runloop_api_client/types/scenario_list_response.py @@ -7,10 +7,10 @@ from .scoring_contract import ScoringContract from .scenario_environment import ScenarioEnvironment -__all__ = ["ScenarioView"] +__all__ = ["ScenarioListResponse"] -class ScenarioView(BaseModel): +class ScenarioListResponse(BaseModel): id: str """The ID of the Scenario.""" diff --git a/src/runloop_api_client/types/scenario_list_view.py b/src/runloop_api_client/types/scenario_list_view.py deleted file mode 100644 index b11272649..000000000 --- a/src/runloop_api_client/types/scenario_list_view.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from .._models import BaseModel -from .scenario_view import ScenarioView - -__all__ = ["ScenarioListView"] - - -class ScenarioListView(BaseModel): - has_more: bool - - remaining_count: int - - scenarios: List[ScenarioView] - """List of Scenarios matching filter.""" - - total_count: int diff --git a/src/runloop_api_client/types/scenario_retrieve_response.py b/src/runloop_api_client/types/scenario_retrieve_response.py new file mode 100644 index 000000000..42092efd6 --- /dev/null +++ b/src/runloop_api_client/types/scenario_retrieve_response.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Optional + +from .._models import BaseModel +from .input_context import InputContext +from .scoring_contract import ScoringContract +from .scenario_environment import ScenarioEnvironment + +__all__ = ["ScenarioRetrieveResponse"] + + +class ScenarioRetrieveResponse(BaseModel): + id: str + """The ID of the Scenario.""" + + input_context: InputContext + """The input context for the Scenario.""" + + metadata: Dict[str, str] + """User defined metadata to attach to the scenario for organization.""" + + name: str + """The name of the Scenario.""" + + scoring_contract: ScoringContract + """The scoring contract for the Scenario.""" + + environment: Optional[ScenarioEnvironment] = None + """The Environment in which the Scenario is run.""" + + reference_output: Optional[str] = None + """A string representation of the reference output to solve the scenario. + + Commonly can be the result of a git diff or a sequence of command actions to + apply to the environment. + """ diff --git a/src/runloop_api_client/types/scenario_run_view.py b/src/runloop_api_client/types/scenario_run_view.py index 893279409..71c805446 100644 --- a/src/runloop_api_client/types/scenario_run_view.py +++ b/src/runloop_api_client/types/scenario_run_view.py @@ -35,7 +35,7 @@ class ScenarioRunView(BaseModel): """Optional name of ScenarioRun.""" scoring_contract_result: Optional[ScoringContractResultView] = None - """The input context for the Scenario.""" + """The scoring result of the ScenarioRun.""" start_time_ms: Optional[int] = None """The time that the scenario started""" diff --git a/src/runloop_api_client/types/scenario_update_response.py b/src/runloop_api_client/types/scenario_update_response.py new file mode 100644 index 000000000..738aacb6a --- /dev/null +++ b/src/runloop_api_client/types/scenario_update_response.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Optional + +from .._models import BaseModel +from .input_context import InputContext +from .scoring_contract import ScoringContract +from .scenario_environment import ScenarioEnvironment + +__all__ = ["ScenarioUpdateResponse"] + + +class ScenarioUpdateResponse(BaseModel): + id: str + """The ID of the Scenario.""" + + input_context: InputContext + """The input context for the Scenario.""" + + metadata: Dict[str, str] + """User defined metadata to attach to the scenario for organization.""" + + name: str + """The name of the Scenario.""" + + scoring_contract: ScoringContract + """The scoring contract for the Scenario.""" + + environment: Optional[ScenarioEnvironment] = None + """The Environment in which the Scenario is run.""" + + reference_output: Optional[str] = None + """A string representation of the reference output to solve the scenario. + + Commonly can be the result of a git diff or a sequence of command actions to + apply to the environment. + """ diff --git a/src/runloop_api_client/types/scenarios/scorer_create_params.py b/src/runloop_api_client/types/scenarios/scorer_create_params.py index 4ba0d6d4d..62a4e33f9 100644 --- a/src/runloop_api_client/types/scenarios/scorer_create_params.py +++ b/src/runloop_api_client/types/scenarios/scorer_create_params.py @@ -11,7 +11,7 @@ class ScorerCreateParams(TypedDict, total=False): bash_script: Required[str] """ Bash script for the custom scorer taking context as a json object - $RL_TEST_CONTEXT. + $RL_SCORER_CONTEXT. """ type: Required[str] diff --git a/src/runloop_api_client/types/scenarios/scorer_update_params.py b/src/runloop_api_client/types/scenarios/scorer_update_params.py index 3637f4b05..dcc7816a4 100644 --- a/src/runloop_api_client/types/scenarios/scorer_update_params.py +++ b/src/runloop_api_client/types/scenarios/scorer_update_params.py @@ -11,7 +11,7 @@ class ScorerUpdateParams(TypedDict, total=False): bash_script: Required[str] """ Bash script for the custom scorer taking context as a json object - $RL_TEST_CONTEXT. + $RL_SCORER_CONTEXT. """ type: Required[str] diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index 6a93c7ef5..ce15b90b0 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -38,5 +38,7 @@ class LaunchParameters(BaseModel): launch_commands: Optional[List[str]] = None """Set of commands to be run at launch time, before the entrypoint process is run.""" - resource_size_request: Optional[Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "XX_LARGE", "CUSTOM_SIZE"]] = None + resource_size_request: Optional[ + Literal["X_SMALL", "SMALL", "MEDIUM", "LARGE", "X_LARGE", "XX_LARGE", "CUSTOM_SIZE"] + ] = None """Manual resource configuration for Devbox. If not set, defaults will be used.""" diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index 549b3dbaa..76aa7393f 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -39,5 +39,7 @@ class LaunchParameters(TypedDict, total=False): launch_commands: Optional[List[str]] """Set of commands to be run at launch time, before the entrypoint process is run.""" - resource_size_request: Optional[Literal["SMALL", "MEDIUM", "LARGE", "X_LARGE", "XX_LARGE", "CUSTOM_SIZE"]] + resource_size_request: Optional[ + Literal["X_SMALL", "SMALL", "MEDIUM", "LARGE", "X_LARGE", "XX_LARGE", "CUSTOM_SIZE"] + ] """Manual resource configuration for Devbox. If not set, defaults will be used.""" diff --git a/tests/api_resources/scenarios/test_scorers.py b/tests/api_resources/scenarios/test_scorers.py index f848d8798..0ac377ede 100644 --- a/tests/api_resources/scenarios/test_scorers.py +++ b/tests/api_resources/scenarios/test_scorers.py @@ -200,7 +200,7 @@ def test_method_validate_with_all_params(self, client: Runloop) -> None: "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], - "resource_size_request": "SMALL", + "resource_size_request": "X_SMALL", }, "prebuilt_id": "prebuilt_id", "snapshot_id": "snapshot_id", @@ -423,7 +423,7 @@ async def test_method_validate_with_all_params(self, async_client: AsyncRunloop) "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], - "resource_size_request": "SMALL", + "resource_size_request": "X_SMALL", }, "prebuilt_id": "prebuilt_id", "snapshot_id": "snapshot_id", diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py index 087dffb1e..907fe1b6d 100644 --- a/tests/api_resources/test_benchmarks.py +++ b/tests/api_resources/test_benchmarks.py @@ -10,8 +10,11 @@ from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types import ( - BenchmarkView, BenchmarkRunView, + BenchmarkListResponse, + BenchmarkCreateResponse, + BenchmarkRetrieveResponse, + BenchmarkListPublicResponse, ) from runloop_api_client.pagination import SyncBenchmarksCursorIDPage, AsyncBenchmarksCursorIDPage @@ -26,7 +29,7 @@ def test_method_create(self, client: Runloop) -> None: benchmark = client.benchmarks.create( name="name", ) - assert_matches_type(BenchmarkView, benchmark, path=["response"]) + assert_matches_type(BenchmarkCreateResponse, benchmark, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: @@ -35,7 +38,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: metadata={"foo": "string"}, scenario_ids=["string"], ) - assert_matches_type(BenchmarkView, benchmark, path=["response"]) + assert_matches_type(BenchmarkCreateResponse, benchmark, path=["response"]) @parametrize def test_raw_response_create(self, client: Runloop) -> None: @@ -46,7 +49,7 @@ def test_raw_response_create(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = response.parse() - assert_matches_type(BenchmarkView, benchmark, path=["response"]) + assert_matches_type(BenchmarkCreateResponse, benchmark, path=["response"]) @parametrize def test_streaming_response_create(self, client: Runloop) -> None: @@ -57,7 +60,7 @@ def test_streaming_response_create(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = response.parse() - assert_matches_type(BenchmarkView, benchmark, path=["response"]) + assert_matches_type(BenchmarkCreateResponse, benchmark, path=["response"]) assert cast(Any, response.is_closed) is True @@ -66,7 +69,7 @@ def test_method_retrieve(self, client: Runloop) -> None: benchmark = client.benchmarks.retrieve( "id", ) - assert_matches_type(BenchmarkView, benchmark, path=["response"]) + assert_matches_type(BenchmarkRetrieveResponse, benchmark, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Runloop) -> None: @@ -77,7 +80,7 @@ def test_raw_response_retrieve(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = response.parse() - assert_matches_type(BenchmarkView, benchmark, path=["response"]) + assert_matches_type(BenchmarkRetrieveResponse, benchmark, path=["response"]) @parametrize def test_streaming_response_retrieve(self, client: Runloop) -> None: @@ -88,7 +91,7 @@ def test_streaming_response_retrieve(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = response.parse() - assert_matches_type(BenchmarkView, benchmark, path=["response"]) + assert_matches_type(BenchmarkRetrieveResponse, benchmark, path=["response"]) assert cast(Any, response.is_closed) is True @@ -102,7 +105,7 @@ def test_path_params_retrieve(self, client: Runloop) -> None: @parametrize def test_method_list(self, client: Runloop) -> None: benchmark = client.benchmarks.list() - assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkListResponse], benchmark, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: @@ -110,7 +113,7 @@ def test_method_list_with_all_params(self, client: Runloop) -> None: limit=0, starting_after="starting_after", ) - assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkListResponse], benchmark, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -119,7 +122,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = response.parse() - assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkListResponse], benchmark, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -128,14 +131,14 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = response.parse() - assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkListResponse], benchmark, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_list_public(self, client: Runloop) -> None: benchmark = client.benchmarks.list_public() - assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkListPublicResponse], benchmark, path=["response"]) @parametrize def test_method_list_public_with_all_params(self, client: Runloop) -> None: @@ -143,7 +146,7 @@ def test_method_list_public_with_all_params(self, client: Runloop) -> None: limit=0, starting_after="starting_after", ) - assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkListPublicResponse], benchmark, path=["response"]) @parametrize def test_raw_response_list_public(self, client: Runloop) -> None: @@ -152,7 +155,7 @@ def test_raw_response_list_public(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = response.parse() - assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkListPublicResponse], benchmark, path=["response"]) @parametrize def test_streaming_response_list_public(self, client: Runloop) -> None: @@ -161,7 +164,7 @@ def test_streaming_response_list_public(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = response.parse() - assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkListPublicResponse], benchmark, path=["response"]) assert cast(Any, response.is_closed) is True @@ -214,7 +217,7 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.create( name="name", ) - assert_matches_type(BenchmarkView, benchmark, path=["response"]) + assert_matches_type(BenchmarkCreateResponse, benchmark, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -223,7 +226,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - metadata={"foo": "string"}, scenario_ids=["string"], ) - assert_matches_type(BenchmarkView, benchmark, path=["response"]) + assert_matches_type(BenchmarkCreateResponse, benchmark, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: @@ -234,7 +237,7 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = await response.parse() - assert_matches_type(BenchmarkView, benchmark, path=["response"]) + assert_matches_type(BenchmarkCreateResponse, benchmark, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: @@ -245,7 +248,7 @@ async def test_streaming_response_create(self, async_client: AsyncRunloop) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = await response.parse() - assert_matches_type(BenchmarkView, benchmark, path=["response"]) + assert_matches_type(BenchmarkCreateResponse, benchmark, path=["response"]) assert cast(Any, response.is_closed) is True @@ -254,7 +257,7 @@ async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.retrieve( "id", ) - assert_matches_type(BenchmarkView, benchmark, path=["response"]) + assert_matches_type(BenchmarkRetrieveResponse, benchmark, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: @@ -265,7 +268,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = await response.parse() - assert_matches_type(BenchmarkView, benchmark, path=["response"]) + assert_matches_type(BenchmarkRetrieveResponse, benchmark, path=["response"]) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: @@ -276,7 +279,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = await response.parse() - assert_matches_type(BenchmarkView, benchmark, path=["response"]) + assert_matches_type(BenchmarkRetrieveResponse, benchmark, path=["response"]) assert cast(Any, response.is_closed) is True @@ -290,7 +293,7 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.list() - assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkListResponse], benchmark, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -298,7 +301,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> limit=0, starting_after="starting_after", ) - assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkListResponse], benchmark, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -307,7 +310,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = await response.parse() - assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkListResponse], benchmark, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -316,14 +319,14 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = await response.parse() - assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkListResponse], benchmark, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_list_public(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.list_public() - assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkListPublicResponse], benchmark, path=["response"]) @parametrize async def test_method_list_public_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -331,7 +334,7 @@ async def test_method_list_public_with_all_params(self, async_client: AsyncRunlo limit=0, starting_after="starting_after", ) - assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkListPublicResponse], benchmark, path=["response"]) @parametrize async def test_raw_response_list_public(self, async_client: AsyncRunloop) -> None: @@ -340,7 +343,7 @@ async def test_raw_response_list_public(self, async_client: AsyncRunloop) -> Non assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = await response.parse() - assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkListPublicResponse], benchmark, path=["response"]) @parametrize async def test_streaming_response_list_public(self, async_client: AsyncRunloop) -> None: @@ -349,7 +352,7 @@ async def test_streaming_response_list_public(self, async_client: AsyncRunloop) assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = await response.parse() - assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkListPublicResponse], benchmark, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 5a9fc89e9..6d0fc445f 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -53,7 +53,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], - "resource_size_request": "SMALL", + "resource_size_request": "X_SMALL", }, system_setup_commands=["string"], ) @@ -224,7 +224,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], - "resource_size_request": "SMALL", + "resource_size_request": "X_SMALL", }, system_setup_commands=["string"], ) @@ -289,7 +289,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], - "resource_size_request": "SMALL", + "resource_size_request": "X_SMALL", }, system_setup_commands=["string"], ) @@ -460,7 +460,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], - "resource_size_request": "SMALL", + "resource_size_request": "X_SMALL", }, system_setup_commands=["string"], ) diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index ce6638c01..b0bf4b4a5 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -69,7 +69,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], - "resource_size_request": "SMALL", + "resource_size_request": "X_SMALL", }, metadata={"foo": "string"}, name="name", @@ -615,7 +615,7 @@ def test_method_remove_tunnel(self, client: Runloop) -> None: id="id", port=0, ) - assert_matches_type(DevboxTunnelView, devbox, path=["response"]) + assert_matches_type(object, devbox, path=["response"]) @parametrize def test_raw_response_remove_tunnel(self, client: Runloop) -> None: @@ -627,7 +627,7 @@ def test_raw_response_remove_tunnel(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert_matches_type(DevboxTunnelView, devbox, path=["response"]) + assert_matches_type(object, devbox, path=["response"]) @parametrize def test_streaming_response_remove_tunnel(self, client: Runloop) -> None: @@ -639,7 +639,7 @@ def test_streaming_response_remove_tunnel(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert_matches_type(DevboxTunnelView, devbox, path=["response"]) + assert_matches_type(object, devbox, path=["response"]) assert cast(Any, response.is_closed) is True @@ -944,7 +944,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], - "resource_size_request": "SMALL", + "resource_size_request": "X_SMALL", }, metadata={"foo": "string"}, name="name", @@ -1490,7 +1490,7 @@ async def test_method_remove_tunnel(self, async_client: AsyncRunloop) -> None: id="id", port=0, ) - assert_matches_type(DevboxTunnelView, devbox, path=["response"]) + assert_matches_type(object, devbox, path=["response"]) @parametrize async def test_raw_response_remove_tunnel(self, async_client: AsyncRunloop) -> None: @@ -1502,7 +1502,7 @@ async def test_raw_response_remove_tunnel(self, async_client: AsyncRunloop) -> N assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert_matches_type(DevboxTunnelView, devbox, path=["response"]) + assert_matches_type(object, devbox, path=["response"]) @parametrize async def test_streaming_response_remove_tunnel(self, async_client: AsyncRunloop) -> None: @@ -1514,7 +1514,7 @@ async def test_streaming_response_remove_tunnel(self, async_client: AsyncRunloop assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert_matches_type(DevboxTunnelView, devbox, path=["response"]) + assert_matches_type(object, devbox, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index a19110235..e8ab3f29e 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -10,8 +10,12 @@ from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types import ( - ScenarioView, ScenarioRunView, + ScenarioListResponse, + ScenarioCreateResponse, + ScenarioUpdateResponse, + ScenarioRetrieveResponse, + ScenarioListPublicResponse, ) from runloop_api_client.pagination import SyncScenariosCursorIDPage, AsyncScenariosCursorIDPage @@ -40,7 +44,7 @@ def test_method_create(self, client: Runloop) -> None: ] }, ) - assert_matches_type(ScenarioView, scenario, path=["response"]) + assert_matches_type(ScenarioCreateResponse, scenario, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: @@ -76,7 +80,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], - "resource_size_request": "SMALL", + "resource_size_request": "X_SMALL", }, "prebuilt_id": "prebuilt_id", "snapshot_id": "snapshot_id", @@ -85,7 +89,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: metadata={"foo": "string"}, reference_output="reference_output", ) - assert_matches_type(ScenarioView, scenario, path=["response"]) + assert_matches_type(ScenarioCreateResponse, scenario, path=["response"]) @parametrize def test_raw_response_create(self, client: Runloop) -> None: @@ -110,7 +114,7 @@ def test_raw_response_create(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = response.parse() - assert_matches_type(ScenarioView, scenario, path=["response"]) + assert_matches_type(ScenarioCreateResponse, scenario, path=["response"]) @parametrize def test_streaming_response_create(self, client: Runloop) -> None: @@ -135,7 +139,7 @@ def test_streaming_response_create(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = response.parse() - assert_matches_type(ScenarioView, scenario, path=["response"]) + assert_matches_type(ScenarioCreateResponse, scenario, path=["response"]) assert cast(Any, response.is_closed) is True @@ -144,7 +148,7 @@ def test_method_retrieve(self, client: Runloop) -> None: scenario = client.scenarios.retrieve( "id", ) - assert_matches_type(ScenarioView, scenario, path=["response"]) + assert_matches_type(ScenarioRetrieveResponse, scenario, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Runloop) -> None: @@ -155,7 +159,7 @@ def test_raw_response_retrieve(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = response.parse() - assert_matches_type(ScenarioView, scenario, path=["response"]) + assert_matches_type(ScenarioRetrieveResponse, scenario, path=["response"]) @parametrize def test_streaming_response_retrieve(self, client: Runloop) -> None: @@ -166,7 +170,7 @@ def test_streaming_response_retrieve(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = response.parse() - assert_matches_type(ScenarioView, scenario, path=["response"]) + assert_matches_type(ScenarioRetrieveResponse, scenario, path=["response"]) assert cast(Any, response.is_closed) is True @@ -197,7 +201,7 @@ def test_method_update(self, client: Runloop) -> None: ] }, ) - assert_matches_type(ScenarioView, scenario, path=["response"]) + assert_matches_type(ScenarioUpdateResponse, scenario, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Runloop) -> None: @@ -234,7 +238,7 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], - "resource_size_request": "SMALL", + "resource_size_request": "X_SMALL", }, "prebuilt_id": "prebuilt_id", "snapshot_id": "snapshot_id", @@ -243,7 +247,7 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: metadata={"foo": "string"}, reference_output="reference_output", ) - assert_matches_type(ScenarioView, scenario, path=["response"]) + assert_matches_type(ScenarioUpdateResponse, scenario, path=["response"]) @parametrize def test_raw_response_update(self, client: Runloop) -> None: @@ -269,7 +273,7 @@ def test_raw_response_update(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = response.parse() - assert_matches_type(ScenarioView, scenario, path=["response"]) + assert_matches_type(ScenarioUpdateResponse, scenario, path=["response"]) @parametrize def test_streaming_response_update(self, client: Runloop) -> None: @@ -295,7 +299,7 @@ def test_streaming_response_update(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = response.parse() - assert_matches_type(ScenarioView, scenario, path=["response"]) + assert_matches_type(ScenarioUpdateResponse, scenario, path=["response"]) assert cast(Any, response.is_closed) is True @@ -324,7 +328,7 @@ def test_path_params_update(self, client: Runloop) -> None: @parametrize def test_method_list(self, client: Runloop) -> None: scenario = client.scenarios.list() - assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + assert_matches_type(SyncScenariosCursorIDPage[ScenarioListResponse], scenario, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: @@ -333,7 +337,7 @@ def test_method_list_with_all_params(self, client: Runloop) -> None: name="name", starting_after="starting_after", ) - assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + assert_matches_type(SyncScenariosCursorIDPage[ScenarioListResponse], scenario, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -342,7 +346,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = response.parse() - assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + assert_matches_type(SyncScenariosCursorIDPage[ScenarioListResponse], scenario, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -351,14 +355,14 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = response.parse() - assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + assert_matches_type(SyncScenariosCursorIDPage[ScenarioListResponse], scenario, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_list_public(self, client: Runloop) -> None: scenario = client.scenarios.list_public() - assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + assert_matches_type(SyncScenariosCursorIDPage[ScenarioListPublicResponse], scenario, path=["response"]) @parametrize def test_method_list_public_with_all_params(self, client: Runloop) -> None: @@ -367,7 +371,7 @@ def test_method_list_public_with_all_params(self, client: Runloop) -> None: name="name", starting_after="starting_after", ) - assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + assert_matches_type(SyncScenariosCursorIDPage[ScenarioListPublicResponse], scenario, path=["response"]) @parametrize def test_raw_response_list_public(self, client: Runloop) -> None: @@ -376,7 +380,7 @@ def test_raw_response_list_public(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = response.parse() - assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + assert_matches_type(SyncScenariosCursorIDPage[ScenarioListPublicResponse], scenario, path=["response"]) @parametrize def test_streaming_response_list_public(self, client: Runloop) -> None: @@ -385,7 +389,7 @@ def test_streaming_response_list_public(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = response.parse() - assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + assert_matches_type(SyncScenariosCursorIDPage[ScenarioListPublicResponse], scenario, path=["response"]) assert cast(Any, response.is_closed) is True @@ -453,7 +457,7 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: ] }, ) - assert_matches_type(ScenarioView, scenario, path=["response"]) + assert_matches_type(ScenarioCreateResponse, scenario, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -489,7 +493,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], - "resource_size_request": "SMALL", + "resource_size_request": "X_SMALL", }, "prebuilt_id": "prebuilt_id", "snapshot_id": "snapshot_id", @@ -498,7 +502,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - metadata={"foo": "string"}, reference_output="reference_output", ) - assert_matches_type(ScenarioView, scenario, path=["response"]) + assert_matches_type(ScenarioCreateResponse, scenario, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: @@ -523,7 +527,7 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = await response.parse() - assert_matches_type(ScenarioView, scenario, path=["response"]) + assert_matches_type(ScenarioCreateResponse, scenario, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: @@ -548,7 +552,7 @@ async def test_streaming_response_create(self, async_client: AsyncRunloop) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = await response.parse() - assert_matches_type(ScenarioView, scenario, path=["response"]) + assert_matches_type(ScenarioCreateResponse, scenario, path=["response"]) assert cast(Any, response.is_closed) is True @@ -557,7 +561,7 @@ async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: scenario = await async_client.scenarios.retrieve( "id", ) - assert_matches_type(ScenarioView, scenario, path=["response"]) + assert_matches_type(ScenarioRetrieveResponse, scenario, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: @@ -568,7 +572,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = await response.parse() - assert_matches_type(ScenarioView, scenario, path=["response"]) + assert_matches_type(ScenarioRetrieveResponse, scenario, path=["response"]) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: @@ -579,7 +583,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = await response.parse() - assert_matches_type(ScenarioView, scenario, path=["response"]) + assert_matches_type(ScenarioRetrieveResponse, scenario, path=["response"]) assert cast(Any, response.is_closed) is True @@ -610,7 +614,7 @@ async def test_method_update(self, async_client: AsyncRunloop) -> None: ] }, ) - assert_matches_type(ScenarioView, scenario, path=["response"]) + assert_matches_type(ScenarioUpdateResponse, scenario, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -647,7 +651,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], - "resource_size_request": "SMALL", + "resource_size_request": "X_SMALL", }, "prebuilt_id": "prebuilt_id", "snapshot_id": "snapshot_id", @@ -656,7 +660,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - metadata={"foo": "string"}, reference_output="reference_output", ) - assert_matches_type(ScenarioView, scenario, path=["response"]) + assert_matches_type(ScenarioUpdateResponse, scenario, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: @@ -682,7 +686,7 @@ async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = await response.parse() - assert_matches_type(ScenarioView, scenario, path=["response"]) + assert_matches_type(ScenarioUpdateResponse, scenario, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncRunloop) -> None: @@ -708,7 +712,7 @@ async def test_streaming_response_update(self, async_client: AsyncRunloop) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = await response.parse() - assert_matches_type(ScenarioView, scenario, path=["response"]) + assert_matches_type(ScenarioUpdateResponse, scenario, path=["response"]) assert cast(Any, response.is_closed) is True @@ -737,7 +741,7 @@ async def test_path_params_update(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: scenario = await async_client.scenarios.list() - assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioListResponse], scenario, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -746,7 +750,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> name="name", starting_after="starting_after", ) - assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioListResponse], scenario, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -755,7 +759,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = await response.parse() - assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioListResponse], scenario, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -764,14 +768,14 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = await response.parse() - assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioListResponse], scenario, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_list_public(self, async_client: AsyncRunloop) -> None: scenario = await async_client.scenarios.list_public() - assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioListPublicResponse], scenario, path=["response"]) @parametrize async def test_method_list_public_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -780,7 +784,7 @@ async def test_method_list_public_with_all_params(self, async_client: AsyncRunlo name="name", starting_after="starting_after", ) - assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioListPublicResponse], scenario, path=["response"]) @parametrize async def test_raw_response_list_public(self, async_client: AsyncRunloop) -> None: @@ -789,7 +793,7 @@ async def test_raw_response_list_public(self, async_client: AsyncRunloop) -> Non assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = await response.parse() - assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioListPublicResponse], scenario, path=["response"]) @parametrize async def test_streaming_response_list_public(self, async_client: AsyncRunloop) -> None: @@ -798,7 +802,7 @@ async def test_streaming_response_list_public(self, async_client: AsyncRunloop) assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = await response.parse() - assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioListPublicResponse], scenario, path=["response"]) assert cast(Any, response.is_closed) is True From 03e51e25a5da0f6f6de2d2093bfb8aada3f1fa04 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 02:45:57 +0000 Subject: [PATCH 701/993] chore(internal): slight transform perf improvement (#587) --- src/runloop_api_client/_utils/_transform.py | 22 +++++++++++++++++++++ tests/test_transform.py | 12 +++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/runloop_api_client/_utils/_transform.py b/src/runloop_api_client/_utils/_transform.py index 7ac2e17fb..3ec620818 100644 --- a/src/runloop_api_client/_utils/_transform.py +++ b/src/runloop_api_client/_utils/_transform.py @@ -142,6 +142,10 @@ def _maybe_transform_key(key: str, type_: type) -> str: return key +def _no_transform_needed(annotation: type) -> bool: + return annotation == float or annotation == int + + def _transform_recursive( data: object, *, @@ -184,6 +188,15 @@ def _transform_recursive( return cast(object, data) inner_type = extract_type_arg(stripped_type, 0) + if _no_transform_needed(inner_type): + # for some types there is no need to transform anything, so we can get a small + # perf boost from skipping that work. + # + # but we still need to convert to a list to ensure the data is json-serializable + if is_list(data): + return data + return list(data) + return [_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data] if is_union_type(stripped_type): @@ -332,6 +345,15 @@ async def _async_transform_recursive( return cast(object, data) inner_type = extract_type_arg(stripped_type, 0) + if _no_transform_needed(inner_type): + # for some types there is no need to transform anything, so we can get a small + # perf boost from skipping that work. + # + # but we still need to convert to a list to ensure the data is json-serializable + if is_list(data): + return data + return list(data) + return [await _async_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data] if is_union_type(stripped_type): diff --git a/tests/test_transform.py b/tests/test_transform.py index f30ab41ee..7ccb97bfd 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -432,3 +432,15 @@ async def test_base64_file_input(use_async: bool) -> None: assert await transform({"foo": io.BytesIO(b"Hello, world!")}, TypedDictBase64Input, use_async) == { "foo": "SGVsbG8sIHdvcmxkIQ==" } # type: ignore[comparison-overlap] + + +@parametrize +@pytest.mark.asyncio +async def test_transform_skipping(use_async: bool) -> None: + # lists of ints are left as-is + data = [1, 2, 3] + assert await transform(data, List[int], use_async) is data + + # iterables of ints are converted to a list + data = iter([1, 2, 3]) + assert await transform(data, Iterable[int], use_async) == [1, 2, 3] From 0881335651b17dabf68a86efb02cfebefcb80a29 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 02:51:06 +0000 Subject: [PATCH 702/993] chore: slight wording improvement in README (#588) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 10c64fd65..1e29f41fd 100644 --- a/README.md +++ b/README.md @@ -164,7 +164,7 @@ print(devbox_view.launch_parameters) ## File uploads -Request parameters that correspond to file uploads can be passed as `bytes`, a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`. +Request parameters that correspond to file uploads can be passed as `bytes`, or a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`. ```python from pathlib import Path From 344e7dd15c9920e370829ce766eca4c33626ca63 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 03:01:31 +0000 Subject: [PATCH 703/993] chore(internal): expand CI branch coverage --- .github/workflows/ci.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b286e5ae..53a3a09c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,18 +1,18 @@ name: CI on: push: - branches: - - main - pull_request: - branches: - - main - - next + branches-ignore: + - 'generated' + - 'codegen/**' + - 'integrated/**' + - 'preview-head/**' + - 'preview-base/**' + - 'preview/**' jobs: lint: name: lint runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 @@ -33,7 +33,6 @@ jobs: test: name: test runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 From 1697ab5f0f8cc7040a47f9e16586da0b3f35593d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 03:06:01 +0000 Subject: [PATCH 704/993] chore(internal): reduce CI branch coverage --- .github/workflows/ci.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53a3a09c9..81f6dc20f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,13 +1,12 @@ name: CI on: push: - branches-ignore: - - 'generated' - - 'codegen/**' - - 'integrated/**' - - 'preview-head/**' - - 'preview-base/**' - - 'preview/**' + branches: + - main + pull_request: + branches: + - main + - next jobs: lint: From 1fd1daaa71ca25199e964c6958d73ae58929b9c2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 12 Apr 2025 02:53:51 +0000 Subject: [PATCH 705/993] fix(perf): skip traversing types for NotGiven values --- src/runloop_api_client/_utils/_transform.py | 11 +++++++++++ tests/test_transform.py | 9 ++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/runloop_api_client/_utils/_transform.py b/src/runloop_api_client/_utils/_transform.py index 3ec620818..3b2b8e009 100644 --- a/src/runloop_api_client/_utils/_transform.py +++ b/src/runloop_api_client/_utils/_transform.py @@ -12,6 +12,7 @@ from ._utils import ( is_list, + is_given, is_mapping, is_iterable, ) @@ -258,6 +259,11 @@ def _transform_typeddict( result: dict[str, object] = {} annotations = get_type_hints(expected_type, include_extras=True) for key, value in data.items(): + if not is_given(value): + # we don't need to include `NotGiven` values here as they'll + # be stripped out before the request is sent anyway + continue + type_ = annotations.get(key) if type_ is None: # we do not have a type annotation for this field, leave it as is @@ -415,6 +421,11 @@ async def _async_transform_typeddict( result: dict[str, object] = {} annotations = get_type_hints(expected_type, include_extras=True) for key, value in data.items(): + if not is_given(value): + # we don't need to include `NotGiven` values here as they'll + # be stripped out before the request is sent anyway + continue + type_ = annotations.get(key) if type_ is None: # we do not have a type annotation for this field, leave it as is diff --git a/tests/test_transform.py b/tests/test_transform.py index 7ccb97bfd..bc6003b5f 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -8,7 +8,7 @@ import pytest -from runloop_api_client._types import Base64FileInput +from runloop_api_client._types import NOT_GIVEN, Base64FileInput from runloop_api_client._utils import ( PropertyInfo, transform as _transform, @@ -444,3 +444,10 @@ async def test_transform_skipping(use_async: bool) -> None: # iterables of ints are converted to a list data = iter([1, 2, 3]) assert await transform(data, Iterable[int], use_async) == [1, 2, 3] + + +@parametrize +@pytest.mark.asyncio +async def test_strips_notgiven(use_async: bool) -> None: + assert await transform({"foo_bar": "bar"}, Foo1, use_async) == {"fooBar": "bar"} + assert await transform({"foo_bar": NOT_GIVEN}, Foo1, use_async) == {} From 02b289ba136f2469f37c0dc5b9221405b4b1e7fc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 12 Apr 2025 02:54:56 +0000 Subject: [PATCH 706/993] fix(perf): optimize some hot paths --- src/runloop_api_client/_utils/_transform.py | 14 +++++++++++++- src/runloop_api_client/_utils/_typing.py | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/runloop_api_client/_utils/_transform.py b/src/runloop_api_client/_utils/_transform.py index 3b2b8e009..b0cc20a73 100644 --- a/src/runloop_api_client/_utils/_transform.py +++ b/src/runloop_api_client/_utils/_transform.py @@ -5,7 +5,7 @@ import pathlib from typing import Any, Mapping, TypeVar, cast from datetime import date, datetime -from typing_extensions import Literal, get_args, override, get_type_hints +from typing_extensions import Literal, get_args, override, get_type_hints as _get_type_hints import anyio import pydantic @@ -13,6 +13,7 @@ from ._utils import ( is_list, is_given, + lru_cache, is_mapping, is_iterable, ) @@ -109,6 +110,7 @@ class Params(TypedDict, total=False): return cast(_T, transformed) +@lru_cache(maxsize=8096) def _get_annotated_type(type_: type) -> type | None: """If the given type is an `Annotated` type then it is returned, if not `None` is returned. @@ -433,3 +435,13 @@ async def _async_transform_typeddict( else: result[_maybe_transform_key(key, type_)] = await _async_transform_recursive(value, annotation=type_) return result + + +@lru_cache(maxsize=8096) +def get_type_hints( + obj: Any, + globalns: dict[str, Any] | None = None, + localns: Mapping[str, Any] | None = None, + include_extras: bool = False, +) -> dict[str, Any]: + return _get_type_hints(obj, globalns=globalns, localns=localns, include_extras=include_extras) diff --git a/src/runloop_api_client/_utils/_typing.py b/src/runloop_api_client/_utils/_typing.py index 278749b14..1958820f8 100644 --- a/src/runloop_api_client/_utils/_typing.py +++ b/src/runloop_api_client/_utils/_typing.py @@ -13,6 +13,7 @@ get_origin, ) +from ._utils import lru_cache from .._types import InheritsGeneric from .._compat import is_union as _is_union @@ -66,6 +67,7 @@ def is_type_alias_type(tp: Any, /) -> TypeIs[typing_extensions.TypeAliasType]: # Extracts T from Annotated[T, ...] or from Required[Annotated[T, ...]] +@lru_cache(maxsize=8096) def strip_annotated_type(typ: type) -> type: if is_required_type(typ) or is_annotated_type(typ): return strip_annotated_type(cast(type, get_args(typ)[0])) From 3feb01da420e3bf9304c4eb578d4e8cc00f438cf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 15 Apr 2025 03:12:10 +0000 Subject: [PATCH 707/993] chore(internal): update pyright settings --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index f77538f01..fe9ec5938 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -147,6 +147,7 @@ exclude = [ ] reportImplicitOverride = true +reportOverlappingOverload = false reportImportCycles = false reportPrivateUsage = false From 75507256a19bb1015540ece1e0ece6ea81d75cae Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 15 Apr 2025 03:13:54 +0000 Subject: [PATCH 708/993] fix(client): correctly reuse idempotency key --- src/runloop_api_client/_base_client.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index 62879ec12..7d2d646f9 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -409,7 +409,8 @@ def _build_headers(self, options: FinalRequestOptions, *, retries_taken: int = 0 idempotency_header = self._idempotency_header if idempotency_header and options.method.lower() != "get" and idempotency_header not in headers: - headers[idempotency_header] = options.idempotency_key or self._idempotency_key() + options.idempotency_key = options.idempotency_key or self._idempotency_key() + headers[idempotency_header] = options.idempotency_key # Don't set these headers if they were already set or removed by the caller. We check # `custom_headers`, which can contain `Omit()`, instead of `headers` to account for the removal case. @@ -943,6 +944,10 @@ def _request( request = self._build_request(options, retries_taken=retries_taken) self._prepare_request(request) + if options.idempotency_key: + # ensure the idempotency key is reused between requests + input_options.idempotency_key = options.idempotency_key + kwargs: HttpxSendArgs = {} if self.custom_auth is not None: kwargs["auth"] = self.custom_auth @@ -1475,6 +1480,10 @@ async def _request( request = self._build_request(options, retries_taken=retries_taken) await self._prepare_request(request) + if options.idempotency_key: + # ensure the idempotency key is reused between requests + input_options.idempotency_key = options.idempotency_key + kwargs: HttpxSendArgs = {} if self.custom_auth is not None: kwargs["auth"] = self.custom_auth From 099cddfd49ce344def84e67841ceccfadf31b724 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 00:40:52 +0000 Subject: [PATCH 709/993] feat(api): api update --- .stats.yml | 4 ++-- .../resources/benchmarks/benchmarks.py | 8 ++++++++ .../resources/scenarios/scenarios.py | 16 ++++++++++++++++ .../types/benchmark_create_params.py | 3 +++ .../types/benchmark_create_response.py | 5 ++++- .../types/benchmark_list_public_response.py | 5 ++++- .../types/benchmark_list_response.py | 5 ++++- .../types/benchmark_retrieve_response.py | 5 ++++- .../types/scenario_create_params.py | 3 +++ .../types/scenario_create_response.py | 3 +++ .../types/scenario_list_public_response.py | 3 +++ .../types/scenario_list_response.py | 3 +++ .../types/scenario_retrieve_response.py | 3 +++ .../types/scenario_update_params.py | 3 +++ .../types/scenario_update_response.py | 3 +++ tests/api_resources/test_benchmarks.py | 8 ++++++++ tests/api_resources/test_scenarios.py | 18 ++++++++++++++++++ 17 files changed, 92 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 79f2100c6..0b0a3c00b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 78 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d0a6e2309db88a60f84521dd672c4beac96b1fcda6145c045fa1251f5bcd4e4f.yml -openapi_spec_hash: b618fb05e03c155c45d16d6a62093106 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a329900168cdf7b34262f3d80d8f2b70510bef2f5458e50d95ba1725686e8b8d.yml +openapi_spec_hash: 8c9e134ab7521e052e0cfa6f75a96f6b config_hash: 84dec0743c13de8bb22f976814deaae9 diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py index c2ceb10f1..550ef0867 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -71,6 +71,7 @@ def with_streaming_response(self) -> BenchmarksResourceWithStreamingResponse: def create( self, *, + is_public: bool, name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, @@ -86,6 +87,8 @@ def create( Create a Benchmark with a set of Scenarios. Args: + is_public: Whether this benchmark is public. + name: The name of the Benchmark. metadata: User defined metadata to attach to the benchmark for organization. @@ -106,6 +109,7 @@ def create( "/v1/benchmarks", body=maybe_transform( { + "is_public": is_public, "name": name, "metadata": metadata, "scenario_ids": scenario_ids, @@ -331,6 +335,7 @@ def with_streaming_response(self) -> AsyncBenchmarksResourceWithStreamingRespons async def create( self, *, + is_public: bool, name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, @@ -346,6 +351,8 @@ async def create( Create a Benchmark with a set of Scenarios. Args: + is_public: Whether this benchmark is public. + name: The name of the Benchmark. metadata: User defined metadata to attach to the benchmark for organization. @@ -366,6 +373,7 @@ async def create( "/v1/benchmarks", body=await async_maybe_transform( { + "is_public": is_public, "name": name, "metadata": metadata, "scenario_ids": scenario_ids, diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index 023f1da82..23dc9b9d6 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -89,6 +89,7 @@ def create( self, *, input_context: InputContextParam, + is_public: bool, name: str, scoring_contract: ScoringContractParam, environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, @@ -109,6 +110,8 @@ def create( Args: input_context: The input context for the Scenario. + is_public: Whether this scenario is public. + name: Name of the scenario. scoring_contract: The scoring contract for the Scenario. @@ -136,6 +139,7 @@ def create( body=maybe_transform( { "input_context": input_context, + "is_public": is_public, "name": name, "scoring_contract": scoring_contract, "environment_parameters": environment_parameters, @@ -192,6 +196,7 @@ def update( id: str, *, input_context: InputContextParam, + is_public: bool, name: str, scoring_contract: ScoringContractParam, environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, @@ -212,6 +217,8 @@ def update( Args: input_context: The input context for the Scenario. + is_public: Whether this scenario is public. + name: Name of the scenario. scoring_contract: The scoring contract for the Scenario. @@ -241,6 +248,7 @@ def update( body=maybe_transform( { "input_context": input_context, + "is_public": is_public, "name": name, "scoring_contract": scoring_contract, "environment_parameters": environment_parameters, @@ -453,6 +461,7 @@ async def create( self, *, input_context: InputContextParam, + is_public: bool, name: str, scoring_contract: ScoringContractParam, environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, @@ -473,6 +482,8 @@ async def create( Args: input_context: The input context for the Scenario. + is_public: Whether this scenario is public. + name: Name of the scenario. scoring_contract: The scoring contract for the Scenario. @@ -500,6 +511,7 @@ async def create( body=await async_maybe_transform( { "input_context": input_context, + "is_public": is_public, "name": name, "scoring_contract": scoring_contract, "environment_parameters": environment_parameters, @@ -556,6 +568,7 @@ async def update( id: str, *, input_context: InputContextParam, + is_public: bool, name: str, scoring_contract: ScoringContractParam, environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, @@ -576,6 +589,8 @@ async def update( Args: input_context: The input context for the Scenario. + is_public: Whether this scenario is public. + name: Name of the scenario. scoring_contract: The scoring contract for the Scenario. @@ -605,6 +620,7 @@ async def update( body=await async_maybe_transform( { "input_context": input_context, + "is_public": is_public, "name": name, "scoring_contract": scoring_contract, "environment_parameters": environment_parameters, diff --git a/src/runloop_api_client/types/benchmark_create_params.py b/src/runloop_api_client/types/benchmark_create_params.py index 1597e3768..27aabe737 100644 --- a/src/runloop_api_client/types/benchmark_create_params.py +++ b/src/runloop_api_client/types/benchmark_create_params.py @@ -9,6 +9,9 @@ class BenchmarkCreateParams(TypedDict, total=False): + is_public: Required[bool] + """Whether this benchmark is public.""" + name: Required[str] """The name of the Benchmark.""" diff --git a/src/runloop_api_client/types/benchmark_create_response.py b/src/runloop_api_client/types/benchmark_create_response.py index a50772cfc..b0c62817a 100644 --- a/src/runloop_api_client/types/benchmark_create_response.py +++ b/src/runloop_api_client/types/benchmark_create_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List +from typing import Dict, List, Optional from pydantic import Field as FieldInfo @@ -21,3 +21,6 @@ class BenchmarkCreateResponse(BaseModel): scenario_ids: List[str] = FieldInfo(alias="scenarioIds") """List of Scenario IDs that make up the benchmark.""" + + is_public: Optional[bool] = None + """Whether this benchmark is public.""" diff --git a/src/runloop_api_client/types/benchmark_list_public_response.py b/src/runloop_api_client/types/benchmark_list_public_response.py index c941722ab..4df643f8d 100644 --- a/src/runloop_api_client/types/benchmark_list_public_response.py +++ b/src/runloop_api_client/types/benchmark_list_public_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List +from typing import Dict, List, Optional from pydantic import Field as FieldInfo @@ -21,3 +21,6 @@ class BenchmarkListPublicResponse(BaseModel): scenario_ids: List[str] = FieldInfo(alias="scenarioIds") """List of Scenario IDs that make up the benchmark.""" + + is_public: Optional[bool] = None + """Whether this benchmark is public.""" diff --git a/src/runloop_api_client/types/benchmark_list_response.py b/src/runloop_api_client/types/benchmark_list_response.py index 2be118e07..2578ec19c 100644 --- a/src/runloop_api_client/types/benchmark_list_response.py +++ b/src/runloop_api_client/types/benchmark_list_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List +from typing import Dict, List, Optional from pydantic import Field as FieldInfo @@ -21,3 +21,6 @@ class BenchmarkListResponse(BaseModel): scenario_ids: List[str] = FieldInfo(alias="scenarioIds") """List of Scenario IDs that make up the benchmark.""" + + is_public: Optional[bool] = None + """Whether this benchmark is public.""" diff --git a/src/runloop_api_client/types/benchmark_retrieve_response.py b/src/runloop_api_client/types/benchmark_retrieve_response.py index 64ad5c1ca..c704a6209 100644 --- a/src/runloop_api_client/types/benchmark_retrieve_response.py +++ b/src/runloop_api_client/types/benchmark_retrieve_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List +from typing import Dict, List, Optional from pydantic import Field as FieldInfo @@ -21,3 +21,6 @@ class BenchmarkRetrieveResponse(BaseModel): scenario_ids: List[str] = FieldInfo(alias="scenarioIds") """List of Scenario IDs that make up the benchmark.""" + + is_public: Optional[bool] = None + """Whether this benchmark is public.""" diff --git a/src/runloop_api_client/types/scenario_create_params.py b/src/runloop_api_client/types/scenario_create_params.py index 5bd2f3d90..b311c62b3 100644 --- a/src/runloop_api_client/types/scenario_create_params.py +++ b/src/runloop_api_client/types/scenario_create_params.py @@ -16,6 +16,9 @@ class ScenarioCreateParams(TypedDict, total=False): input_context: Required[InputContextParam] """The input context for the Scenario.""" + is_public: Required[bool] + """Whether this scenario is public.""" + name: Required[str] """Name of the scenario.""" diff --git a/src/runloop_api_client/types/scenario_create_response.py b/src/runloop_api_client/types/scenario_create_response.py index 4df2f7303..7ab062f96 100644 --- a/src/runloop_api_client/types/scenario_create_response.py +++ b/src/runloop_api_client/types/scenario_create_response.py @@ -29,6 +29,9 @@ class ScenarioCreateResponse(BaseModel): environment: Optional[ScenarioEnvironment] = None """The Environment in which the Scenario is run.""" + is_public: Optional[bool] = None + """Whether this scenario is public.""" + reference_output: Optional[str] = None """A string representation of the reference output to solve the scenario. diff --git a/src/runloop_api_client/types/scenario_list_public_response.py b/src/runloop_api_client/types/scenario_list_public_response.py index 795e437fa..8fa375956 100644 --- a/src/runloop_api_client/types/scenario_list_public_response.py +++ b/src/runloop_api_client/types/scenario_list_public_response.py @@ -29,6 +29,9 @@ class ScenarioListPublicResponse(BaseModel): environment: Optional[ScenarioEnvironment] = None """The Environment in which the Scenario is run.""" + is_public: Optional[bool] = None + """Whether this scenario is public.""" + reference_output: Optional[str] = None """A string representation of the reference output to solve the scenario. diff --git a/src/runloop_api_client/types/scenario_list_response.py b/src/runloop_api_client/types/scenario_list_response.py index 7cf25f9e3..1d7097172 100644 --- a/src/runloop_api_client/types/scenario_list_response.py +++ b/src/runloop_api_client/types/scenario_list_response.py @@ -29,6 +29,9 @@ class ScenarioListResponse(BaseModel): environment: Optional[ScenarioEnvironment] = None """The Environment in which the Scenario is run.""" + is_public: Optional[bool] = None + """Whether this scenario is public.""" + reference_output: Optional[str] = None """A string representation of the reference output to solve the scenario. diff --git a/src/runloop_api_client/types/scenario_retrieve_response.py b/src/runloop_api_client/types/scenario_retrieve_response.py index 42092efd6..21297daf1 100644 --- a/src/runloop_api_client/types/scenario_retrieve_response.py +++ b/src/runloop_api_client/types/scenario_retrieve_response.py @@ -29,6 +29,9 @@ class ScenarioRetrieveResponse(BaseModel): environment: Optional[ScenarioEnvironment] = None """The Environment in which the Scenario is run.""" + is_public: Optional[bool] = None + """Whether this scenario is public.""" + reference_output: Optional[str] = None """A string representation of the reference output to solve the scenario. diff --git a/src/runloop_api_client/types/scenario_update_params.py b/src/runloop_api_client/types/scenario_update_params.py index 1004e7bc8..4c0ef1ad8 100644 --- a/src/runloop_api_client/types/scenario_update_params.py +++ b/src/runloop_api_client/types/scenario_update_params.py @@ -16,6 +16,9 @@ class ScenarioUpdateParams(TypedDict, total=False): input_context: Required[InputContextParam] """The input context for the Scenario.""" + is_public: Required[bool] + """Whether this scenario is public.""" + name: Required[str] """Name of the scenario.""" diff --git a/src/runloop_api_client/types/scenario_update_response.py b/src/runloop_api_client/types/scenario_update_response.py index 738aacb6a..dd8617f71 100644 --- a/src/runloop_api_client/types/scenario_update_response.py +++ b/src/runloop_api_client/types/scenario_update_response.py @@ -29,6 +29,9 @@ class ScenarioUpdateResponse(BaseModel): environment: Optional[ScenarioEnvironment] = None """The Environment in which the Scenario is run.""" + is_public: Optional[bool] = None + """Whether this scenario is public.""" + reference_output: Optional[str] = None """A string representation of the reference output to solve the scenario. diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py index 907fe1b6d..7c2d47be9 100644 --- a/tests/api_resources/test_benchmarks.py +++ b/tests/api_resources/test_benchmarks.py @@ -27,6 +27,7 @@ class TestBenchmarks: @parametrize def test_method_create(self, client: Runloop) -> None: benchmark = client.benchmarks.create( + is_public=True, name="name", ) assert_matches_type(BenchmarkCreateResponse, benchmark, path=["response"]) @@ -34,6 +35,7 @@ def test_method_create(self, client: Runloop) -> None: @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: benchmark = client.benchmarks.create( + is_public=True, name="name", metadata={"foo": "string"}, scenario_ids=["string"], @@ -43,6 +45,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: @parametrize def test_raw_response_create(self, client: Runloop) -> None: response = client.benchmarks.with_raw_response.create( + is_public=True, name="name", ) @@ -54,6 +57,7 @@ def test_raw_response_create(self, client: Runloop) -> None: @parametrize def test_streaming_response_create(self, client: Runloop) -> None: with client.benchmarks.with_streaming_response.create( + is_public=True, name="name", ) as response: assert not response.is_closed @@ -215,6 +219,7 @@ class TestAsyncBenchmarks: @parametrize async def test_method_create(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.create( + is_public=True, name="name", ) assert_matches_type(BenchmarkCreateResponse, benchmark, path=["response"]) @@ -222,6 +227,7 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.create( + is_public=True, name="name", metadata={"foo": "string"}, scenario_ids=["string"], @@ -231,6 +237,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - @parametrize async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: response = await async_client.benchmarks.with_raw_response.create( + is_public=True, name="name", ) @@ -242,6 +249,7 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: async with async_client.benchmarks.with_streaming_response.create( + is_public=True, name="name", ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index e8ab3f29e..2d6d7048f 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -29,6 +29,7 @@ class TestScenarios: def test_method_create(self, client: Runloop) -> None: scenario = client.scenarios.create( input_context={"problem_statement": "problem_statement"}, + is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -53,6 +54,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "problem_statement": "problem_statement", "additional_context": {}, }, + is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -95,6 +97,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: def test_raw_response_create(self, client: Runloop) -> None: response = client.scenarios.with_raw_response.create( input_context={"problem_statement": "problem_statement"}, + is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -120,6 +123,7 @@ def test_raw_response_create(self, client: Runloop) -> None: def test_streaming_response_create(self, client: Runloop) -> None: with client.scenarios.with_streaming_response.create( input_context={"problem_statement": "problem_statement"}, + is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -186,6 +190,7 @@ def test_method_update(self, client: Runloop) -> None: scenario = client.scenarios.update( id="id", input_context={"problem_statement": "problem_statement"}, + is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -211,6 +216,7 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: "problem_statement": "problem_statement", "additional_context": {}, }, + is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -254,6 +260,7 @@ def test_raw_response_update(self, client: Runloop) -> None: response = client.scenarios.with_raw_response.update( id="id", input_context={"problem_statement": "problem_statement"}, + is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -280,6 +287,7 @@ def test_streaming_response_update(self, client: Runloop) -> None: with client.scenarios.with_streaming_response.update( id="id", input_context={"problem_statement": "problem_statement"}, + is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -309,6 +317,7 @@ def test_path_params_update(self, client: Runloop) -> None: client.scenarios.with_raw_response.update( id="", input_context={"problem_statement": "problem_statement"}, + is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -442,6 +451,7 @@ class TestAsyncScenarios: async def test_method_create(self, async_client: AsyncRunloop) -> None: scenario = await async_client.scenarios.create( input_context={"problem_statement": "problem_statement"}, + is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -466,6 +476,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "problem_statement": "problem_statement", "additional_context": {}, }, + is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -508,6 +519,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: response = await async_client.scenarios.with_raw_response.create( input_context={"problem_statement": "problem_statement"}, + is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -533,6 +545,7 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: async with async_client.scenarios.with_streaming_response.create( input_context={"problem_statement": "problem_statement"}, + is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -599,6 +612,7 @@ async def test_method_update(self, async_client: AsyncRunloop) -> None: scenario = await async_client.scenarios.update( id="id", input_context={"problem_statement": "problem_statement"}, + is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -624,6 +638,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - "problem_statement": "problem_statement", "additional_context": {}, }, + is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -667,6 +682,7 @@ async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: response = await async_client.scenarios.with_raw_response.update( id="id", input_context={"problem_statement": "problem_statement"}, + is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -693,6 +709,7 @@ async def test_streaming_response_update(self, async_client: AsyncRunloop) -> No async with async_client.scenarios.with_streaming_response.update( id="id", input_context={"problem_statement": "problem_statement"}, + is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -722,6 +739,7 @@ async def test_path_params_update(self, async_client: AsyncRunloop) -> None: await async_client.scenarios.with_raw_response.update( id="", input_context={"problem_statement": "problem_statement"}, + is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ From 6ae066043adb93320c4bae25a6ed3621cedbd01a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 00:59:11 +0000 Subject: [PATCH 710/993] feat(api): api update --- .stats.yml | 8 +- api.md | 2 + .../resources/blueprints.py | 92 +++++++++++++++++++ tests/api_resources/test_blueprints.py | 76 +++++++++++++++ 4 files changed, 174 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0b0a3c00b..d1b99e300 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 78 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a329900168cdf7b34262f3d80d8f2b70510bef2f5458e50d95ba1725686e8b8d.yml -openapi_spec_hash: 8c9e134ab7521e052e0cfa6f75a96f6b -config_hash: 84dec0743c13de8bb22f976814deaae9 +configured_endpoints: 79 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-59d51521fb27127ec00a91d37d9cbaa484577dbd200d290e61c9d69d33b3c760.yml +openapi_spec_hash: 4ad68555fc0ec3e969817bebff620e88 +config_hash: 4cb90c87fb61338e46c50cea9c42abd7 diff --git a/api.md b/api.md index ea4a18d18..4ac1bcb8d 100644 --- a/api.md +++ b/api.md @@ -49,6 +49,7 @@ from runloop_api_client.types import ( BlueprintListView, BlueprintPreviewView, BlueprintView, + BlueprintDeleteResponse, ) ``` @@ -57,6 +58,7 @@ Methods: - client.blueprints.create(\*\*params) -> BlueprintView - client.blueprints.retrieve(id) -> BlueprintView - client.blueprints.list(\*\*params) -> SyncBlueprintsCursorIDPage[BlueprintView] +- client.blueprints.delete(id) -> object - client.blueprints.logs(id) -> BlueprintBuildLogsListView - client.blueprints.preview(\*\*params) -> BlueprintPreviewView diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index 124f0a139..0b209dad7 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -205,6 +205,46 @@ def list( model=BlueprintView, ) + def delete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> object: + """ + Delete a previously created Blueprint. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/blueprints/{id}/delete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=object, + ) + def logs( self, id: str, @@ -481,6 +521,46 @@ def list( model=BlueprintView, ) + async def delete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> object: + """ + Delete a previously created Blueprint. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/blueprints/{id}/delete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=object, + ) + async def logs( self, id: str, @@ -596,6 +676,9 @@ def __init__(self, blueprints: BlueprintsResource) -> None: self.list = to_raw_response_wrapper( blueprints.list, ) + self.delete = to_raw_response_wrapper( + blueprints.delete, + ) self.logs = to_raw_response_wrapper( blueprints.logs, ) @@ -617,6 +700,9 @@ def __init__(self, blueprints: AsyncBlueprintsResource) -> None: self.list = async_to_raw_response_wrapper( blueprints.list, ) + self.delete = async_to_raw_response_wrapper( + blueprints.delete, + ) self.logs = async_to_raw_response_wrapper( blueprints.logs, ) @@ -638,6 +724,9 @@ def __init__(self, blueprints: BlueprintsResource) -> None: self.list = to_streamed_response_wrapper( blueprints.list, ) + self.delete = to_streamed_response_wrapper( + blueprints.delete, + ) self.logs = to_streamed_response_wrapper( blueprints.logs, ) @@ -659,6 +748,9 @@ def __init__(self, blueprints: AsyncBlueprintsResource) -> None: self.list = async_to_streamed_response_wrapper( blueprints.list, ) + self.delete = async_to_streamed_response_wrapper( + blueprints.delete, + ) self.logs = async_to_streamed_response_wrapper( blueprints.logs, ) diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 6d0fc445f..5e33440e5 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -155,6 +155,44 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_delete(self, client: Runloop) -> None: + blueprint = client.blueprints.delete( + "id", + ) + assert_matches_type(object, blueprint, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Runloop) -> None: + response = client.blueprints.with_raw_response.delete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = response.parse() + assert_matches_type(object, blueprint, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Runloop) -> None: + with client.blueprints.with_streaming_response.delete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + blueprint = response.parse() + assert_matches_type(object, blueprint, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.blueprints.with_raw_response.delete( + "", + ) + @parametrize def test_method_logs(self, client: Runloop) -> None: blueprint = client.blueprints.logs( @@ -391,6 +429,44 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_delete(self, async_client: AsyncRunloop) -> None: + blueprint = await async_client.blueprints.delete( + "id", + ) + assert_matches_type(object, blueprint, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncRunloop) -> None: + response = await async_client.blueprints.with_raw_response.delete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = await response.parse() + assert_matches_type(object, blueprint, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncRunloop) -> None: + async with async_client.blueprints.with_streaming_response.delete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + blueprint = await response.parse() + assert_matches_type(object, blueprint, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.blueprints.with_raw_response.delete( + "", + ) + @parametrize async def test_method_logs(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.logs( From 161da60629a23ec24b9fd45b1791a3d837082ed6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 16 Apr 2025 01:04:56 +0000 Subject: [PATCH 711/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b8dda9bfc..554e34bbe 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.29.0" + ".": "0.30.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index fe9ec5938..d328c6824 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.29.0" +version = "0.30.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index c454e8b46..524beb9ff 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.29.0" # x-release-please-version +__version__ = "0.30.0" # x-release-please-version From a7229e6eb7c8e005718d2afc5fc92910eea0e631 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 17 Apr 2025 02:56:01 +0000 Subject: [PATCH 712/993] chore(internal): bump pyright version --- pyproject.toml | 2 +- requirements-dev.lock | 2 +- src/runloop_api_client/_base_client.py | 6 +++++- src/runloop_api_client/_models.py | 1 - src/runloop_api_client/_utils/_typing.py | 2 +- tests/conftest.py | 2 +- tests/test_models.py | 2 +- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d328c6824..e4450bc2b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,7 @@ Repository = "https://github.com/runloopai/api-client-python" managed = true # version pins are in requirements-dev.lock dev-dependencies = [ - "pyright>=1.1.359", + "pyright==1.1.399", "mypy", "respx", "pytest", diff --git a/requirements-dev.lock b/requirements-dev.lock index c88f710ae..1e04b71cc 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -69,7 +69,7 @@ pydantic-core==2.27.1 # via pydantic pygments==2.18.0 # via rich -pyright==1.1.392.post0 +pyright==1.1.399 pytest==8.3.3 # via pytest-asyncio pytest-asyncio==0.24.0 diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index 7d2d646f9..2400b1cf8 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -98,7 +98,11 @@ _AsyncStreamT = TypeVar("_AsyncStreamT", bound=AsyncStream[Any]) if TYPE_CHECKING: - from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT + from httpx._config import ( + DEFAULT_TIMEOUT_CONFIG, # pyright: ignore[reportPrivateImportUsage] + ) + + HTTPX_DEFAULT_TIMEOUT = DEFAULT_TIMEOUT_CONFIG else: try: from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index 349357169..58b9263e8 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -19,7 +19,6 @@ ) import pydantic -import pydantic.generics from pydantic.fields import FieldInfo from ._types import ( diff --git a/src/runloop_api_client/_utils/_typing.py b/src/runloop_api_client/_utils/_typing.py index 1958820f8..1bac9542e 100644 --- a/src/runloop_api_client/_utils/_typing.py +++ b/src/runloop_api_client/_utils/_typing.py @@ -110,7 +110,7 @@ class MyResponse(Foo[_T]): ``` """ cls = cast(object, get_origin(typ) or typ) - if cls in generic_bases: + if cls in generic_bases: # pyright: ignore[reportUnnecessaryContains] # we're given the class directly return extract_type_arg(typ, index) diff --git a/tests/conftest.py b/tests/conftest.py index 60d391097..fe6961d03 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -10,7 +10,7 @@ from runloop_api_client import Runloop, AsyncRunloop if TYPE_CHECKING: - from _pytest.fixtures import FixtureRequest + from _pytest.fixtures import FixtureRequest # pyright: ignore[reportPrivateImportUsage] pytest.register_assert_rewrite("tests.utils") diff --git a/tests/test_models.py b/tests/test_models.py index b65dd474e..b66070189 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -832,7 +832,7 @@ class B(BaseModel): @pytest.mark.skipif(not PYDANTIC_V2, reason="TypeAliasType is not supported in Pydantic v1") def test_type_alias_type() -> None: - Alias = TypeAliasType("Alias", str) + Alias = TypeAliasType("Alias", str) # pyright: ignore class Model(BaseModel): alias: Alias From 1403be79d76018ebb4ed09e5a8487f8d96de6b4f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 17 Apr 2025 02:56:43 +0000 Subject: [PATCH 713/993] chore(internal): base client updates --- src/runloop_api_client/_base_client.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index 2400b1cf8..32f743a59 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -119,6 +119,7 @@ class PageInfo: url: URL | NotGiven params: Query | NotGiven + json: Body | NotGiven @overload def __init__( @@ -134,19 +135,30 @@ def __init__( params: Query, ) -> None: ... + @overload + def __init__( + self, + *, + json: Body, + ) -> None: ... + def __init__( self, *, url: URL | NotGiven = NOT_GIVEN, + json: Body | NotGiven = NOT_GIVEN, params: Query | NotGiven = NOT_GIVEN, ) -> None: self.url = url + self.json = json self.params = params @override def __repr__(self) -> str: if self.url: return f"{self.__class__.__name__}(url={self.url})" + if self.json: + return f"{self.__class__.__name__}(json={self.json})" return f"{self.__class__.__name__}(params={self.params})" @@ -195,6 +207,19 @@ def _info_to_options(self, info: PageInfo) -> FinalRequestOptions: options.url = str(url) return options + if not isinstance(info.json, NotGiven): + if not is_mapping(info.json): + raise TypeError("Pagination is only supported with mappings") + + if not options.json_data: + options.json_data = {**info.json} + else: + if not is_mapping(options.json_data): + raise TypeError("Pagination is only supported with mappings") + + options.json_data = {**options.json_data, **info.json} + return options + raise ValueError("Unexpected PageInfo state") From be24c694cfac7f43738c1679343263241207a894 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 19 Apr 2025 03:03:59 +0000 Subject: [PATCH 714/993] chore(internal): update models test --- tests/test_models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_models.py b/tests/test_models.py index b66070189..e47644414 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -492,12 +492,15 @@ class Model(BaseModel): resource_id: Optional[str] = None m = Model.construct() + assert m.resource_id is None assert "resource_id" not in m.model_fields_set m = Model.construct(resource_id=None) + assert m.resource_id is None assert "resource_id" in m.model_fields_set m = Model.construct(resource_id="foo") + assert m.resource_id == "foo" assert "resource_id" in m.model_fields_set From 38c22f835028c72d4f6a01a5949e892e611b427e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Apr 2025 18:26:26 +0000 Subject: [PATCH 715/993] feat(api): api update --- .stats.yml | 4 ++-- README.md | 1 + src/runloop_api_client/types/shared/launch_parameters.py | 3 +++ .../types/shared_params/launch_parameters.py | 3 +++ tests/api_resources/scenarios/test_scorers.py | 2 ++ tests/api_resources/test_blueprints.py | 4 ++++ tests/api_resources/test_devboxes.py | 2 ++ tests/api_resources/test_scenarios.py | 4 ++++ 8 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d1b99e300..a9ee988af 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 79 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-59d51521fb27127ec00a91d37d9cbaa484577dbd200d290e61c9d69d33b3c760.yml -openapi_spec_hash: 4ad68555fc0ec3e969817bebff620e88 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-29770148092f0f5030e7199308862afc7e46cb12da6081cd045e9db6734d3ac9.yml +openapi_spec_hash: b100a6769bf25a0f873ef32201eba45e config_hash: 4cb90c87fb61338e46c50cea9c42abd7 diff --git a/README.md b/README.md index 1e29f41fd..00c2c41bf 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,7 @@ devbox_view = client.devboxes.create( "idle_time_seconds": 0, "on_idle": "shutdown", }, + "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, "custom_gb_memory": 0, diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index ce15b90b0..5d5fa1178 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -16,6 +16,9 @@ class LaunchParameters(BaseModel): If after_idle is set, Devbox will ignore keep_alive_time_seconds. """ + architecture: Optional[Literal["x86_64", "arm64"]] = None + """The target architecture for the Devbox. If unset, defaults to arm64.""" + available_ports: Optional[List[int]] = None """A list of ports to make available on the Devbox. diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index 76aa7393f..decfb9feb 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -17,6 +17,9 @@ class LaunchParameters(TypedDict, total=False): If after_idle is set, Devbox will ignore keep_alive_time_seconds. """ + architecture: Optional[Literal["x86_64", "arm64"]] + """The target architecture for the Devbox. If unset, defaults to arm64.""" + available_ports: Optional[Iterable[int]] """A list of ports to make available on the Devbox. diff --git a/tests/api_resources/scenarios/test_scorers.py b/tests/api_resources/scenarios/test_scorers.py index 0ac377ede..05ec020d4 100644 --- a/tests/api_resources/scenarios/test_scorers.py +++ b/tests/api_resources/scenarios/test_scorers.py @@ -195,6 +195,7 @@ def test_method_validate_with_all_params(self, client: Runloop) -> None: "idle_time_seconds": 0, "on_idle": "shutdown", }, + "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, "custom_gb_memory": 0, @@ -418,6 +419,7 @@ async def test_method_validate_with_all_params(self, async_client: AsyncRunloop) "idle_time_seconds": 0, "on_idle": "shutdown", }, + "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, "custom_gb_memory": 0, diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 5e33440e5..be38be581 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -48,6 +48,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "idle_time_seconds": 0, "on_idle": "shutdown", }, + "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, "custom_gb_memory": 0, @@ -257,6 +258,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: "idle_time_seconds": 0, "on_idle": "shutdown", }, + "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, "custom_gb_memory": 0, @@ -322,6 +324,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "idle_time_seconds": 0, "on_idle": "shutdown", }, + "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, "custom_gb_memory": 0, @@ -531,6 +534,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) "idle_time_seconds": 0, "on_idle": "shutdown", }, + "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, "custom_gb_memory": 0, diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index b0bf4b4a5..b0b96d7a4 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -64,6 +64,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "idle_time_seconds": 0, "on_idle": "shutdown", }, + "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, "custom_gb_memory": 0, @@ -939,6 +940,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "idle_time_seconds": 0, "on_idle": "shutdown", }, + "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, "custom_gb_memory": 0, diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index 2d6d7048f..73af952a4 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -77,6 +77,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "idle_time_seconds": 0, "on_idle": "shutdown", }, + "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, "custom_gb_memory": 0, @@ -239,6 +240,7 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: "idle_time_seconds": 0, "on_idle": "shutdown", }, + "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, "custom_gb_memory": 0, @@ -499,6 +501,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "idle_time_seconds": 0, "on_idle": "shutdown", }, + "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, "custom_gb_memory": 0, @@ -661,6 +664,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - "idle_time_seconds": 0, "on_idle": "shutdown", }, + "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, "custom_gb_memory": 0, From e2d4996afce92c0715033b1ce75384a066a9734e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Apr 2025 20:01:56 +0000 Subject: [PATCH 716/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 554e34bbe..f81bf9923 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.30.0" + ".": "0.31.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index e4450bc2b..6a30dc50f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.30.0" +version = "0.31.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 524beb9ff..8d021c0e2 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.30.0" # x-release-please-version +__version__ = "0.31.0" # x-release-please-version From 2173b913ecea60cbc55aae3ba3a31a208e098d1c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 03:46:18 +0000 Subject: [PATCH 717/993] chore(ci): add timeout thresholds for CI jobs --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81f6dc20f..04b083ca7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,7 @@ on: jobs: lint: + timeout-minutes: 10 name: lint runs-on: ubuntu-latest steps: @@ -30,6 +31,7 @@ jobs: run: ./scripts/lint test: + timeout-minutes: 10 name: test runs-on: ubuntu-latest steps: From 9b57abf3fd5fc951502465abc6290db8f564ddcb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 03:46:53 +0000 Subject: [PATCH 718/993] chore(internal): import reformatting --- src/runloop_api_client/_client.py | 5 +---- src/runloop_api_client/resources/benchmarks/benchmarks.py | 5 +---- src/runloop_api_client/resources/blueprints.py | 5 +---- src/runloop_api_client/resources/devboxes/browsers.py | 5 +---- src/runloop_api_client/resources/devboxes/computers.py | 5 +---- src/runloop_api_client/resources/devboxes/devboxes.py | 7 +------ .../resources/devboxes/disk_snapshots.py | 5 +---- src/runloop_api_client/resources/devboxes/executions.py | 5 +---- src/runloop_api_client/resources/devboxes/logs.py | 5 +---- src/runloop_api_client/resources/devboxes/lsp.py | 5 +---- src/runloop_api_client/resources/repositories.py | 5 +---- src/runloop_api_client/resources/scenarios/scenarios.py | 5 +---- src/runloop_api_client/resources/scenarios/scorers.py | 5 +---- 13 files changed, 13 insertions(+), 54 deletions(-) diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index 2c6fa90fa..babaea83b 100644 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -19,10 +19,7 @@ ProxiesTypes, RequestOptions, ) -from ._utils import ( - is_given, - get_async_library, -) +from ._utils import is_given, get_async_library from ._version import __version__ from .resources import blueprints, repositories from ._streaming import Stream as Stream, AsyncStream as AsyncStream diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py index 550ef0867..beb5f42c3 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -21,10 +21,7 @@ benchmark_list_public_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index 0b209dad7..1b8dba579 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -8,10 +8,7 @@ from ..types import blueprint_list_params, blueprint_create_params, blueprint_preview_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) +from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( diff --git a/src/runloop_api_client/resources/devboxes/browsers.py b/src/runloop_api_client/resources/devboxes/browsers.py index 799b58aef..9a2c1c9f5 100644 --- a/src/runloop_api_client/resources/devboxes/browsers.py +++ b/src/runloop_api_client/resources/devboxes/browsers.py @@ -7,10 +7,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/runloop_api_client/resources/devboxes/computers.py b/src/runloop_api_client/resources/devboxes/computers.py index fea63c395..b08c90c02 100644 --- a/src/runloop_api_client/resources/devboxes/computers.py +++ b/src/runloop_api_client/resources/devboxes/computers.py @@ -8,10 +8,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index a5848c024..52dff69a4 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -39,12 +39,7 @@ devbox_write_file_contents_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes -from ..._utils import ( - extract_files, - maybe_transform, - deepcopy_minimal, - async_maybe_transform, -) +from ..._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform from .browsers import ( BrowsersResource, AsyncBrowsersResource, diff --git a/src/runloop_api_client/resources/devboxes/disk_snapshots.py b/src/runloop_api_client/resources/devboxes/disk_snapshots.py index 9d23416f1..72439a4ec 100644 --- a/src/runloop_api_client/resources/devboxes/disk_snapshots.py +++ b/src/runloop_api_client/resources/devboxes/disk_snapshots.py @@ -7,10 +7,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index 091d7857e..a177f6dc6 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -7,10 +7,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/runloop_api_client/resources/devboxes/logs.py b/src/runloop_api_client/resources/devboxes/logs.py index 05b80f362..c3302e2fb 100644 --- a/src/runloop_api_client/resources/devboxes/logs.py +++ b/src/runloop_api_client/resources/devboxes/logs.py @@ -5,10 +5,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py index d1601f207..9de56eda2 100644 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -5,10 +5,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/runloop_api_client/resources/repositories.py b/src/runloop_api_client/resources/repositories.py index 5ebca0116..5bde8f618 100644 --- a/src/runloop_api_client/resources/repositories.py +++ b/src/runloop_api_client/resources/repositories.py @@ -8,10 +8,7 @@ from ..types import repository_list_params, repository_create_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from .._utils import ( - maybe_transform, - async_maybe_transform, -) +from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index 23dc9b9d6..aa03861d4 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -30,10 +30,7 @@ AsyncScorersResourceWithStreamingResponse, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( diff --git a/src/runloop_api_client/resources/scenarios/scorers.py b/src/runloop_api_client/resources/scenarios/scorers.py index c71bb028b..56236b184 100644 --- a/src/runloop_api_client/resources/scenarios/scorers.py +++ b/src/runloop_api_client/resources/scenarios/scorers.py @@ -5,10 +5,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import ( - maybe_transform, - async_maybe_transform, -) +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( From 27a9b255543784f8802ad64585c0541641130de6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 03:48:25 +0000 Subject: [PATCH 719/993] chore(internal): fix list file params --- src/runloop_api_client/_utils/_utils.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/runloop_api_client/_utils/_utils.py b/src/runloop_api_client/_utils/_utils.py index e5811bba4..ea3cf3f2c 100644 --- a/src/runloop_api_client/_utils/_utils.py +++ b/src/runloop_api_client/_utils/_utils.py @@ -72,8 +72,16 @@ def _extract_items( from .._files import assert_is_file_content # We have exhausted the path, return the entry we found. - assert_is_file_content(obj, key=flattened_key) assert flattened_key is not None + + if is_list(obj): + files: list[tuple[str, FileTypes]] = [] + for entry in obj: + assert_is_file_content(entry, key=flattened_key + "[]" if flattened_key else "") + files.append((flattened_key + "[]", cast(FileTypes, entry))) + return files + + assert_is_file_content(obj, key=flattened_key) return [(flattened_key, cast(FileTypes, obj))] index += 1 From ab86708594f63e520bd452f4b157ca1eed1a04b1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 03:48:57 +0000 Subject: [PATCH 720/993] chore(internal): refactor retries to not use recursion --- src/runloop_api_client/_base_client.py | 414 +++++++++++-------------- 1 file changed, 175 insertions(+), 239 deletions(-) diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index 32f743a59..1b3041060 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -437,8 +437,7 @@ def _build_headers(self, options: FinalRequestOptions, *, retries_taken: int = 0 headers = httpx.Headers(headers_dict) idempotency_header = self._idempotency_header - if idempotency_header and options.method.lower() != "get" and idempotency_header not in headers: - options.idempotency_key = options.idempotency_key or self._idempotency_key() + if idempotency_header and options.idempotency_key and idempotency_header not in headers: headers[idempotency_header] = options.idempotency_key # Don't set these headers if they were already set or removed by the caller. We check @@ -903,7 +902,6 @@ def request( self, cast_to: Type[ResponseT], options: FinalRequestOptions, - remaining_retries: Optional[int] = None, *, stream: Literal[True], stream_cls: Type[_StreamT], @@ -914,7 +912,6 @@ def request( self, cast_to: Type[ResponseT], options: FinalRequestOptions, - remaining_retries: Optional[int] = None, *, stream: Literal[False] = False, ) -> ResponseT: ... @@ -924,7 +921,6 @@ def request( self, cast_to: Type[ResponseT], options: FinalRequestOptions, - remaining_retries: Optional[int] = None, *, stream: bool = False, stream_cls: Type[_StreamT] | None = None, @@ -934,125 +930,109 @@ def request( self, cast_to: Type[ResponseT], options: FinalRequestOptions, - remaining_retries: Optional[int] = None, *, stream: bool = False, stream_cls: type[_StreamT] | None = None, ) -> ResponseT | _StreamT: - if remaining_retries is not None: - retries_taken = options.get_max_retries(self.max_retries) - remaining_retries - else: - retries_taken = 0 - - return self._request( - cast_to=cast_to, - options=options, - stream=stream, - stream_cls=stream_cls, - retries_taken=retries_taken, - ) + cast_to = self._maybe_override_cast_to(cast_to, options) - def _request( - self, - *, - cast_to: Type[ResponseT], - options: FinalRequestOptions, - retries_taken: int, - stream: bool, - stream_cls: type[_StreamT] | None, - ) -> ResponseT | _StreamT: # create a copy of the options we were given so that if the # options are mutated later & we then retry, the retries are # given the original options input_options = model_copy(options) - - cast_to = self._maybe_override_cast_to(cast_to, options) - options = self._prepare_options(options) - - remaining_retries = options.get_max_retries(self.max_retries) - retries_taken - request = self._build_request(options, retries_taken=retries_taken) - self._prepare_request(request) - - if options.idempotency_key: + if input_options.idempotency_key is None and input_options.method.lower() != "get": # ensure the idempotency key is reused between requests - input_options.idempotency_key = options.idempotency_key + input_options.idempotency_key = self._idempotency_key() - kwargs: HttpxSendArgs = {} - if self.custom_auth is not None: - kwargs["auth"] = self.custom_auth + response: httpx.Response | None = None + max_retries = input_options.get_max_retries(self.max_retries) - log.debug("Sending HTTP Request: %s %s", request.method, request.url) + retries_taken = 0 + for retries_taken in range(max_retries + 1): + options = model_copy(input_options) + options = self._prepare_options(options) - try: - response = self._client.send( - request, - stream=stream or self._should_stream_response_body(request=request), - **kwargs, - ) - except httpx.TimeoutException as err: - log.debug("Encountered httpx.TimeoutException", exc_info=True) + remaining_retries = max_retries - retries_taken + request = self._build_request(options, retries_taken=retries_taken) + self._prepare_request(request) - if remaining_retries > 0: - return self._retry_request( - input_options, - cast_to, - retries_taken=retries_taken, - stream=stream, - stream_cls=stream_cls, - response_headers=None, - ) + kwargs: HttpxSendArgs = {} + if self.custom_auth is not None: + kwargs["auth"] = self.custom_auth - log.debug("Raising timeout error") - raise APITimeoutError(request=request) from err - except Exception as err: - log.debug("Encountered Exception", exc_info=True) + log.debug("Sending HTTP Request: %s %s", request.method, request.url) - if remaining_retries > 0: - return self._retry_request( - input_options, - cast_to, - retries_taken=retries_taken, - stream=stream, - stream_cls=stream_cls, - response_headers=None, + response = None + try: + response = self._client.send( + request, + stream=stream or self._should_stream_response_body(request=request), + **kwargs, ) + except httpx.TimeoutException as err: + log.debug("Encountered httpx.TimeoutException", exc_info=True) + + if remaining_retries > 0: + self._sleep_for_retry( + retries_taken=retries_taken, + max_retries=max_retries, + options=input_options, + response=None, + ) + continue + + log.debug("Raising timeout error") + raise APITimeoutError(request=request) from err + except Exception as err: + log.debug("Encountered Exception", exc_info=True) + + if remaining_retries > 0: + self._sleep_for_retry( + retries_taken=retries_taken, + max_retries=max_retries, + options=input_options, + response=None, + ) + continue + + log.debug("Raising connection error") + raise APIConnectionError(request=request) from err + + log.debug( + 'HTTP Response: %s %s "%i %s" %s', + request.method, + request.url, + response.status_code, + response.reason_phrase, + response.headers, + ) - log.debug("Raising connection error") - raise APIConnectionError(request=request) from err - - log.debug( - 'HTTP Response: %s %s "%i %s" %s', - request.method, - request.url, - response.status_code, - response.reason_phrase, - response.headers, - ) + try: + response.raise_for_status() + except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code + log.debug("Encountered httpx.HTTPStatusError", exc_info=True) + + if remaining_retries > 0 and self._should_retry(err.response): + err.response.close() + self._sleep_for_retry( + retries_taken=retries_taken, + max_retries=max_retries, + options=input_options, + response=response, + ) + continue - try: - response.raise_for_status() - except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code - log.debug("Encountered httpx.HTTPStatusError", exc_info=True) - - if remaining_retries > 0 and self._should_retry(err.response): - err.response.close() - return self._retry_request( - input_options, - cast_to, - retries_taken=retries_taken, - response_headers=err.response.headers, - stream=stream, - stream_cls=stream_cls, - ) + # If the response is streamed then we need to explicitly read the response + # to completion before attempting to access the response text. + if not err.response.is_closed: + err.response.read() - # If the response is streamed then we need to explicitly read the response - # to completion before attempting to access the response text. - if not err.response.is_closed: - err.response.read() + log.debug("Re-raising status error") + raise self._make_status_error_from_response(err.response) from None - log.debug("Re-raising status error") - raise self._make_status_error_from_response(err.response) from None + break + assert response is not None, "could not resolve response (should never happen)" return self._process_response( cast_to=cast_to, options=options, @@ -1062,37 +1042,20 @@ def _request( retries_taken=retries_taken, ) - def _retry_request( - self, - options: FinalRequestOptions, - cast_to: Type[ResponseT], - *, - retries_taken: int, - response_headers: httpx.Headers | None, - stream: bool, - stream_cls: type[_StreamT] | None, - ) -> ResponseT | _StreamT: - remaining_retries = options.get_max_retries(self.max_retries) - retries_taken + def _sleep_for_retry( + self, *, retries_taken: int, max_retries: int, options: FinalRequestOptions, response: httpx.Response | None + ) -> None: + remaining_retries = max_retries - retries_taken if remaining_retries == 1: log.debug("1 retry left") else: log.debug("%i retries left", remaining_retries) - timeout = self._calculate_retry_timeout(remaining_retries, options, response_headers) + timeout = self._calculate_retry_timeout(remaining_retries, options, response.headers if response else None) log.info("Retrying request to %s in %f seconds", options.url, timeout) - # In a synchronous context we are blocking the entire thread. Up to the library user to run the client in a - # different thread if necessary. time.sleep(timeout) - return self._request( - options=options, - cast_to=cast_to, - retries_taken=retries_taken + 1, - stream=stream, - stream_cls=stream_cls, - ) - def _process_response( self, *, @@ -1436,7 +1399,6 @@ async def request( options: FinalRequestOptions, *, stream: Literal[False] = False, - remaining_retries: Optional[int] = None, ) -> ResponseT: ... @overload @@ -1447,7 +1409,6 @@ async def request( *, stream: Literal[True], stream_cls: type[_AsyncStreamT], - remaining_retries: Optional[int] = None, ) -> _AsyncStreamT: ... @overload @@ -1458,7 +1419,6 @@ async def request( *, stream: bool, stream_cls: type[_AsyncStreamT] | None = None, - remaining_retries: Optional[int] = None, ) -> ResponseT | _AsyncStreamT: ... async def request( @@ -1468,120 +1428,111 @@ async def request( *, stream: bool = False, stream_cls: type[_AsyncStreamT] | None = None, - remaining_retries: Optional[int] = None, - ) -> ResponseT | _AsyncStreamT: - if remaining_retries is not None: - retries_taken = options.get_max_retries(self.max_retries) - remaining_retries - else: - retries_taken = 0 - - return await self._request( - cast_to=cast_to, - options=options, - stream=stream, - stream_cls=stream_cls, - retries_taken=retries_taken, - ) - - async def _request( - self, - cast_to: Type[ResponseT], - options: FinalRequestOptions, - *, - stream: bool, - stream_cls: type[_AsyncStreamT] | None, - retries_taken: int, ) -> ResponseT | _AsyncStreamT: if self._platform is None: # `get_platform` can make blocking IO calls so we # execute it earlier while we are in an async context self._platform = await asyncify(get_platform)() + cast_to = self._maybe_override_cast_to(cast_to, options) + # create a copy of the options we were given so that if the # options are mutated later & we then retry, the retries are # given the original options input_options = model_copy(options) - - cast_to = self._maybe_override_cast_to(cast_to, options) - options = await self._prepare_options(options) - - remaining_retries = options.get_max_retries(self.max_retries) - retries_taken - request = self._build_request(options, retries_taken=retries_taken) - await self._prepare_request(request) - - if options.idempotency_key: + if input_options.idempotency_key is None and input_options.method.lower() != "get": # ensure the idempotency key is reused between requests - input_options.idempotency_key = options.idempotency_key + input_options.idempotency_key = self._idempotency_key() - kwargs: HttpxSendArgs = {} - if self.custom_auth is not None: - kwargs["auth"] = self.custom_auth + response: httpx.Response | None = None + max_retries = input_options.get_max_retries(self.max_retries) - try: - response = await self._client.send( - request, - stream=stream or self._should_stream_response_body(request=request), - **kwargs, - ) - except httpx.TimeoutException as err: - log.debug("Encountered httpx.TimeoutException", exc_info=True) + retries_taken = 0 + for retries_taken in range(max_retries + 1): + options = model_copy(input_options) + options = await self._prepare_options(options) - if remaining_retries > 0: - return await self._retry_request( - input_options, - cast_to, - retries_taken=retries_taken, - stream=stream, - stream_cls=stream_cls, - response_headers=None, - ) + remaining_retries = max_retries - retries_taken + request = self._build_request(options, retries_taken=retries_taken) + await self._prepare_request(request) - log.debug("Raising timeout error") - raise APITimeoutError(request=request) from err - except Exception as err: - log.debug("Encountered Exception", exc_info=True) + kwargs: HttpxSendArgs = {} + if self.custom_auth is not None: + kwargs["auth"] = self.custom_auth - if remaining_retries > 0: - return await self._retry_request( - input_options, - cast_to, - retries_taken=retries_taken, - stream=stream, - stream_cls=stream_cls, - response_headers=None, - ) + log.debug("Sending HTTP Request: %s %s", request.method, request.url) - log.debug("Raising connection error") - raise APIConnectionError(request=request) from err + response = None + try: + response = await self._client.send( + request, + stream=stream or self._should_stream_response_body(request=request), + **kwargs, + ) + except httpx.TimeoutException as err: + log.debug("Encountered httpx.TimeoutException", exc_info=True) + + if remaining_retries > 0: + await self._sleep_for_retry( + retries_taken=retries_taken, + max_retries=max_retries, + options=input_options, + response=None, + ) + continue + + log.debug("Raising timeout error") + raise APITimeoutError(request=request) from err + except Exception as err: + log.debug("Encountered Exception", exc_info=True) + + if remaining_retries > 0: + await self._sleep_for_retry( + retries_taken=retries_taken, + max_retries=max_retries, + options=input_options, + response=None, + ) + continue + + log.debug("Raising connection error") + raise APIConnectionError(request=request) from err + + log.debug( + 'HTTP Response: %s %s "%i %s" %s', + request.method, + request.url, + response.status_code, + response.reason_phrase, + response.headers, + ) - log.debug( - 'HTTP Request: %s %s "%i %s"', request.method, request.url, response.status_code, response.reason_phrase - ) + try: + response.raise_for_status() + except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code + log.debug("Encountered httpx.HTTPStatusError", exc_info=True) + + if remaining_retries > 0 and self._should_retry(err.response): + await err.response.aclose() + await self._sleep_for_retry( + retries_taken=retries_taken, + max_retries=max_retries, + options=input_options, + response=response, + ) + continue - try: - response.raise_for_status() - except httpx.HTTPStatusError as err: # thrown on 4xx and 5xx status code - log.debug("Encountered httpx.HTTPStatusError", exc_info=True) - - if remaining_retries > 0 and self._should_retry(err.response): - await err.response.aclose() - return await self._retry_request( - input_options, - cast_to, - retries_taken=retries_taken, - response_headers=err.response.headers, - stream=stream, - stream_cls=stream_cls, - ) + # If the response is streamed then we need to explicitly read the response + # to completion before attempting to access the response text. + if not err.response.is_closed: + await err.response.aread() - # If the response is streamed then we need to explicitly read the response - # to completion before attempting to access the response text. - if not err.response.is_closed: - await err.response.aread() + log.debug("Re-raising status error") + raise self._make_status_error_from_response(err.response) from None - log.debug("Re-raising status error") - raise self._make_status_error_from_response(err.response) from None + break + assert response is not None, "could not resolve response (should never happen)" return await self._process_response( cast_to=cast_to, options=options, @@ -1591,35 +1542,20 @@ async def _request( retries_taken=retries_taken, ) - async def _retry_request( - self, - options: FinalRequestOptions, - cast_to: Type[ResponseT], - *, - retries_taken: int, - response_headers: httpx.Headers | None, - stream: bool, - stream_cls: type[_AsyncStreamT] | None, - ) -> ResponseT | _AsyncStreamT: - remaining_retries = options.get_max_retries(self.max_retries) - retries_taken + async def _sleep_for_retry( + self, *, retries_taken: int, max_retries: int, options: FinalRequestOptions, response: httpx.Response | None + ) -> None: + remaining_retries = max_retries - retries_taken if remaining_retries == 1: log.debug("1 retry left") else: log.debug("%i retries left", remaining_retries) - timeout = self._calculate_retry_timeout(remaining_retries, options, response_headers) + timeout = self._calculate_retry_timeout(remaining_retries, options, response.headers if response else None) log.info("Retrying request to %s in %f seconds", options.url, timeout) await anyio.sleep(timeout) - return await self._request( - options=options, - cast_to=cast_to, - retries_taken=retries_taken + 1, - stream=stream, - stream_cls=stream_cls, - ) - async def _process_response( self, *, From bad598d9d58a34dc275a317647b2562a38d5df67 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 03:49:35 +0000 Subject: [PATCH 721/993] fix(pydantic v1): more robust ModelField.annotation check --- src/runloop_api_client/_models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index 58b9263e8..798956f17 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -626,8 +626,8 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, # Note: if one variant defines an alias then they all should discriminator_alias = field_info.alias - if field_info.annotation and is_literal_type(field_info.annotation): - for entry in get_args(field_info.annotation): + if (annotation := getattr(field_info, "annotation", None)) and is_literal_type(annotation): + for entry in get_args(annotation): if isinstance(entry, str): mapping[entry] = variant From 36cc4e01f21ab489b554210f5a1ad8631c77825b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:41:10 +0000 Subject: [PATCH 722/993] chore(internal): minor formatting changes --- src/runloop_api_client/types/blueprint_build_log.py | 1 - src/runloop_api_client/types/blueprint_preview_view.py | 1 - src/runloop_api_client/types/devbox_create_ssh_key_response.py | 1 - src/runloop_api_client/types/devbox_tunnel_view.py | 1 - src/runloop_api_client/types/devboxes/base_location.py | 1 - src/runloop_api_client/types/devboxes/base_markup_content.py | 1 - src/runloop_api_client/types/devboxes/base_range.py | 1 - src/runloop_api_client/types/devboxes/browser_view.py | 1 - src/runloop_api_client/types/devboxes/computer_view.py | 1 - src/runloop_api_client/types/devboxes/file_contents_response.py | 1 - src/runloop_api_client/types/devboxes/watched_file_response.py | 1 - src/runloop_api_client/types/scenarios/scorer_create_response.py | 1 - src/runloop_api_client/types/scenarios/scorer_list_response.py | 1 - .../types/scenarios/scorer_retrieve_response.py | 1 - src/runloop_api_client/types/scenarios/scorer_update_response.py | 1 - 15 files changed, 15 deletions(-) diff --git a/src/runloop_api_client/types/blueprint_build_log.py b/src/runloop_api_client/types/blueprint_build_log.py index 3343bb16f..7666ac65c 100644 --- a/src/runloop_api_client/types/blueprint_build_log.py +++ b/src/runloop_api_client/types/blueprint_build_log.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from .._models import BaseModel __all__ = ["BlueprintBuildLog"] diff --git a/src/runloop_api_client/types/blueprint_preview_view.py b/src/runloop_api_client/types/blueprint_preview_view.py index 5703115a4..7e4b0c53c 100644 --- a/src/runloop_api_client/types/blueprint_preview_view.py +++ b/src/runloop_api_client/types/blueprint_preview_view.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from .._models import BaseModel __all__ = ["BlueprintPreviewView"] diff --git a/src/runloop_api_client/types/devbox_create_ssh_key_response.py b/src/runloop_api_client/types/devbox_create_ssh_key_response.py index 90746ab31..1b69373a3 100755 --- a/src/runloop_api_client/types/devbox_create_ssh_key_response.py +++ b/src/runloop_api_client/types/devbox_create_ssh_key_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from .._models import BaseModel __all__ = ["DevboxCreateSSHKeyResponse"] diff --git a/src/runloop_api_client/types/devbox_tunnel_view.py b/src/runloop_api_client/types/devbox_tunnel_view.py index ac47c82a0..48e3b3ac8 100644 --- a/src/runloop_api_client/types/devbox_tunnel_view.py +++ b/src/runloop_api_client/types/devbox_tunnel_view.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from .._models import BaseModel __all__ = ["DevboxTunnelView"] diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py index 3d83663f0..716a7cc0a 100644 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ b/src/runloop_api_client/types/devboxes/base_location.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ..._models import BaseModel from .base_range import BaseRange diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py index bd874488d..8a00ea75d 100644 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ b/src/runloop_api_client/types/devboxes/base_markup_content.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ..._models import BaseModel __all__ = ["BaseMarkupContent"] diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py index 52e22338d..a15dd11d4 100644 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ b/src/runloop_api_client/types/devboxes/base_range.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ..._models import BaseModel __all__ = ["BaseRange", "End", "Start"] diff --git a/src/runloop_api_client/types/devboxes/browser_view.py b/src/runloop_api_client/types/devboxes/browser_view.py index 84341e301..d6d377a28 100644 --- a/src/runloop_api_client/types/devboxes/browser_view.py +++ b/src/runloop_api_client/types/devboxes/browser_view.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ..._models import BaseModel from ..devbox_view import DevboxView diff --git a/src/runloop_api_client/types/devboxes/computer_view.py b/src/runloop_api_client/types/devboxes/computer_view.py index f401845cc..907629d54 100644 --- a/src/runloop_api_client/types/devboxes/computer_view.py +++ b/src/runloop_api_client/types/devboxes/computer_view.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ..._models import BaseModel from ..devbox_view import DevboxView diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py index e5aa38d11..b862022e5 100644 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ b/src/runloop_api_client/types/devboxes/file_contents_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from pydantic import Field as FieldInfo from ..._models import BaseModel diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py index 01884f8e8..9ef69585a 100644 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ b/src/runloop_api_client/types/devboxes/watched_file_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from pydantic import Field as FieldInfo from ..._models import BaseModel diff --git a/src/runloop_api_client/types/scenarios/scorer_create_response.py b/src/runloop_api_client/types/scenarios/scorer_create_response.py index 49b614e0d..345779a1d 100644 --- a/src/runloop_api_client/types/scenarios/scorer_create_response.py +++ b/src/runloop_api_client/types/scenarios/scorer_create_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ..._models import BaseModel __all__ = ["ScorerCreateResponse"] diff --git a/src/runloop_api_client/types/scenarios/scorer_list_response.py b/src/runloop_api_client/types/scenarios/scorer_list_response.py index d24bfd87e..8f8b12e15 100644 --- a/src/runloop_api_client/types/scenarios/scorer_list_response.py +++ b/src/runloop_api_client/types/scenarios/scorer_list_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ..._models import BaseModel __all__ = ["ScorerListResponse"] diff --git a/src/runloop_api_client/types/scenarios/scorer_retrieve_response.py b/src/runloop_api_client/types/scenarios/scorer_retrieve_response.py index d72dd5778..f2dd7f0b1 100644 --- a/src/runloop_api_client/types/scenarios/scorer_retrieve_response.py +++ b/src/runloop_api_client/types/scenarios/scorer_retrieve_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ..._models import BaseModel __all__ = ["ScorerRetrieveResponse"] diff --git a/src/runloop_api_client/types/scenarios/scorer_update_response.py b/src/runloop_api_client/types/scenarios/scorer_update_response.py index ef77f37e6..540107613 100644 --- a/src/runloop_api_client/types/scenarios/scorer_update_response.py +++ b/src/runloop_api_client/types/scenarios/scorer_update_response.py @@ -1,6 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - from ..._models import BaseModel __all__ = ["ScorerUpdateResponse"] From 6180ae15cea84e647543b34fb576da31e89494bc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:41:41 +0000 Subject: [PATCH 723/993] chore(internal): codegen related update --- .github/workflows/ci.yml | 16 ++++++++-------- .github/workflows/publish-pypi.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04b083ca7..33820422d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,18 +1,18 @@ name: CI on: push: - branches: - - main - pull_request: - branches: - - main - - next + branches-ignore: + - 'generated' + - 'codegen/**' + - 'integrated/**' + - 'stl-preview-head/**' + - 'stl-preview-base/**' jobs: lint: timeout-minutes: 10 name: lint - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 steps: - uses: actions/checkout@v4 @@ -33,7 +33,7 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index fbcdea446..73813f923 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -11,7 +11,7 @@ on: jobs: publish: name: publish - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index d80447e1d..c911f41a0 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -8,7 +8,7 @@ on: jobs: release_doctor: name: release doctor - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 if: github.repository == 'runloopai/api-client-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: From 8f33adf6f273ac786a5b52dbf88efb19fa28713f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:42:19 +0000 Subject: [PATCH 724/993] chore(ci): only use depot for staging repos --- .github/workflows/ci.yml | 4 ++-- .github/workflows/publish-pypi.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33820422d..87c2de57f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: lint: timeout-minutes: 10 name: lint - runs-on: depot-ubuntu-24.04 + runs-on: ${{ github.repository == 'stainless-sdks/runloop-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 @@ -33,7 +33,7 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: depot-ubuntu-24.04 + runs-on: ${{ github.repository == 'stainless-sdks/runloop-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 73813f923..fbcdea446 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -11,7 +11,7 @@ on: jobs: publish: name: publish - runs-on: depot-ubuntu-24.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index c911f41a0..d80447e1d 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -8,7 +8,7 @@ on: jobs: release_doctor: name: release doctor - runs-on: depot-ubuntu-24.04 + runs-on: ubuntu-latest if: github.repository == 'runloopai/api-client-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: From 778548174fbf300c70b5ac8a7935396b4e021bf6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:43:55 +0000 Subject: [PATCH 725/993] chore: broadly detect json family of content-type headers --- src/runloop_api_client/_response.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runloop_api_client/_response.py b/src/runloop_api_client/_response.py index 1e0ab213e..31591fad8 100644 --- a/src/runloop_api_client/_response.py +++ b/src/runloop_api_client/_response.py @@ -235,7 +235,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: # split is required to handle cases where additional information is included # in the response, e.g. application/json; charset=utf-8 content_type, *_ = response.headers.get("content-type", "*").split(";") - if content_type != "application/json": + if not content_type.endswith("json"): if is_basemodel(cast_to): try: data = response.json() From fe2759be7a0e8eeec247287db2dadbd37826ff9c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 17:22:00 +0000 Subject: [PATCH 726/993] feat(api): api update --- .stats.yml | 4 ++-- README.md | 4 ++++ .../types/shared/launch_parameters.py | 16 +++++++++++++++- .../types/shared_params/launch_parameters.py | 18 ++++++++++++++++-- tests/api_resources/scenarios/test_scorers.py | 8 ++++++++ tests/api_resources/test_blueprints.py | 16 ++++++++++++++++ tests/api_resources/test_devboxes.py | 8 ++++++++ tests/api_resources/test_scenarios.py | 16 ++++++++++++++++ 8 files changed, 85 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index a9ee988af..bae579201 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 79 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-29770148092f0f5030e7199308862afc7e46cb12da6081cd045e9db6734d3ac9.yml -openapi_spec_hash: b100a6769bf25a0f873ef32201eba45e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ba1b6db5490b976ad56ecea10d380f462ec5b9f8d47d139f87d7fff3e7df330a.yml +openapi_spec_hash: bf76fd15629ea1a4c134c4af5436c78f config_hash: 4cb90c87fb61338e46c50cea9c42abd7 diff --git a/README.md b/README.md index 00c2c41bf..05e74c625 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,10 @@ devbox_view = client.devboxes.create( "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "X_SMALL", + "user_parameters": { + "uid": 0, + "username": "username", + }, }, ) print(devbox_view.launch_parameters) diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index 5d5fa1178..f2f78f3da 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -6,7 +6,15 @@ from ..._models import BaseModel from .after_idle import AfterIdle -__all__ = ["LaunchParameters"] +__all__ = ["LaunchParameters", "UserParameters"] + + +class UserParameters(BaseModel): + uid: int + """User ID (UID) for the Linux user. Must be a positive integer.""" + + username: str + """Username for the Linux user.""" class LaunchParameters(BaseModel): @@ -45,3 +53,9 @@ class LaunchParameters(BaseModel): Literal["X_SMALL", "SMALL", "MEDIUM", "LARGE", "X_LARGE", "XX_LARGE", "CUSTOM_SIZE"] ] = None """Manual resource configuration for Devbox. If not set, defaults will be used.""" + + user_parameters: Optional[UserParameters] = None + """Specify the user for execution on Devbox. + + If not set, default `user` will be used. + """ diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index decfb9feb..d51d06d99 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -3,11 +3,19 @@ from __future__ import annotations from typing import List, Iterable, Optional -from typing_extensions import Literal, TypedDict +from typing_extensions import Literal, Required, TypedDict from .after_idle import AfterIdle -__all__ = ["LaunchParameters"] +__all__ = ["LaunchParameters", "UserParameters"] + + +class UserParameters(TypedDict, total=False): + uid: Required[int] + """User ID (UID) for the Linux user. Must be a positive integer.""" + + username: Required[str] + """Username for the Linux user.""" class LaunchParameters(TypedDict, total=False): @@ -46,3 +54,9 @@ class LaunchParameters(TypedDict, total=False): Literal["X_SMALL", "SMALL", "MEDIUM", "LARGE", "X_LARGE", "XX_LARGE", "CUSTOM_SIZE"] ] """Manual resource configuration for Devbox. If not set, defaults will be used.""" + + user_parameters: Optional[UserParameters] + """Specify the user for execution on Devbox. + + If not set, default `user` will be used. + """ diff --git a/tests/api_resources/scenarios/test_scorers.py b/tests/api_resources/scenarios/test_scorers.py index 05ec020d4..db1ae2c56 100644 --- a/tests/api_resources/scenarios/test_scorers.py +++ b/tests/api_resources/scenarios/test_scorers.py @@ -202,6 +202,10 @@ def test_method_validate_with_all_params(self, client: Runloop) -> None: "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "X_SMALL", + "user_parameters": { + "uid": 0, + "username": "username", + }, }, "prebuilt_id": "prebuilt_id", "snapshot_id": "snapshot_id", @@ -426,6 +430,10 @@ async def test_method_validate_with_all_params(self, async_client: AsyncRunloop) "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "X_SMALL", + "user_parameters": { + "uid": 0, + "username": "username", + }, }, "prebuilt_id": "prebuilt_id", "snapshot_id": "snapshot_id", diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index be38be581..64cd30459 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -55,6 +55,10 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "X_SMALL", + "user_parameters": { + "uid": 0, + "username": "username", + }, }, system_setup_commands=["string"], ) @@ -265,6 +269,10 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "X_SMALL", + "user_parameters": { + "uid": 0, + "username": "username", + }, }, system_setup_commands=["string"], ) @@ -331,6 +339,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "X_SMALL", + "user_parameters": { + "uid": 0, + "username": "username", + }, }, system_setup_commands=["string"], ) @@ -541,6 +553,10 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "X_SMALL", + "user_parameters": { + "uid": 0, + "username": "username", + }, }, system_setup_commands=["string"], ) diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index b0b96d7a4..0f7045def 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -71,6 +71,10 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "X_SMALL", + "user_parameters": { + "uid": 0, + "username": "username", + }, }, metadata={"foo": "string"}, name="name", @@ -947,6 +951,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "X_SMALL", + "user_parameters": { + "uid": 0, + "username": "username", + }, }, metadata={"foo": "string"}, name="name", diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index 73af952a4..6f7183bf8 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -84,6 +84,10 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "X_SMALL", + "user_parameters": { + "uid": 0, + "username": "username", + }, }, "prebuilt_id": "prebuilt_id", "snapshot_id": "snapshot_id", @@ -247,6 +251,10 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "X_SMALL", + "user_parameters": { + "uid": 0, + "username": "username", + }, }, "prebuilt_id": "prebuilt_id", "snapshot_id": "snapshot_id", @@ -508,6 +516,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "X_SMALL", + "user_parameters": { + "uid": 0, + "username": "username", + }, }, "prebuilt_id": "prebuilt_id", "snapshot_id": "snapshot_id", @@ -671,6 +683,10 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - "keep_alive_time_seconds": 0, "launch_commands": ["string"], "resource_size_request": "X_SMALL", + "user_parameters": { + "uid": 0, + "username": "username", + }, }, "prebuilt_id": "prebuilt_id", "snapshot_id": "snapshot_id", From 7849505900acc9628abcb412c2f03573f2cb5732 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 26 Apr 2025 02:41:52 +0000 Subject: [PATCH 727/993] chore(internal): codegen related update --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f81bf9923..f04d08965 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.31.0" + ".": "0.32.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 6a30dc50f..1ace85349 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.31.0" +version = "0.32.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 8d021c0e2..6db6388a9 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.31.0" # x-release-please-version +__version__ = "0.32.0" # x-release-please-version From 02e5596924fe832b276ee6c2102047f0b0d26973 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 30 Apr 2025 21:43:51 +0000 Subject: [PATCH 728/993] feat(api): api update --- .stats.yml | 6 +- api.md | 29 +++---- .../resources/benchmarks/benchmarks.py | 45 +++++----- .../resources/scenarios/scenarios.py | 54 ++++++------ src/runloop_api_client/types/__init__.py | 11 +-- .../types/benchmark_create_response.py | 26 ------ .../types/benchmark_list_public_response.py | 26 ------ .../types/benchmark_retrieve_response.py | 26 ------ ...ark_list_response.py => benchmark_view.py} | 4 +- .../types/scenario_create_response.py | 40 --------- .../types/scenario_list_public_response.py | 40 --------- .../types/scenario_retrieve_response.py | 40 --------- .../types/scenario_update_response.py | 40 --------- ...ario_list_response.py => scenario_view.py} | 4 +- tests/api_resources/test_benchmarks.py | 65 +++++++-------- tests/api_resources/test_scenarios.py | 82 +++++++++---------- 16 files changed, 136 insertions(+), 402 deletions(-) delete mode 100644 src/runloop_api_client/types/benchmark_create_response.py delete mode 100644 src/runloop_api_client/types/benchmark_list_public_response.py delete mode 100644 src/runloop_api_client/types/benchmark_retrieve_response.py rename src/runloop_api_client/types/{benchmark_list_response.py => benchmark_view.py} (88%) delete mode 100644 src/runloop_api_client/types/scenario_create_response.py delete mode 100644 src/runloop_api_client/types/scenario_list_public_response.py delete mode 100644 src/runloop_api_client/types/scenario_retrieve_response.py delete mode 100644 src/runloop_api_client/types/scenario_update_response.py rename src/runloop_api_client/types/{scenario_list_response.py => scenario_view.py} (93%) diff --git a/.stats.yml b/.stats.yml index bae579201..f3bd95afb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 79 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ba1b6db5490b976ad56ecea10d380f462ec5b9f8d47d139f87d7fff3e7df330a.yml -openapi_spec_hash: bf76fd15629ea1a4c134c4af5436c78f -config_hash: 4cb90c87fb61338e46c50cea9c42abd7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8227cc69585fb2b6d4eed5266a60ed91768c97200f52f95fe022417c6e9e91da.yml +openapi_spec_hash: e038f338d187fe1ac41d36ccce67dcc6 +config_hash: e9831eba75eecfc502817af80812f6a7 diff --git a/api.md b/api.md index 4ac1bcb8d..8c1b856d0 100644 --- a/api.md +++ b/api.md @@ -13,20 +13,17 @@ from runloop_api_client.types import ( BenchmarkCreateParameters, BenchmarkRunListView, BenchmarkRunView, + BenchmarkView, StartBenchmarkRunParameters, - BenchmarkCreateResponse, - BenchmarkRetrieveResponse, - BenchmarkListResponse, - BenchmarkListPublicResponse, ) ``` Methods: -- client.benchmarks.create(\*\*params) -> BenchmarkCreateResponse -- client.benchmarks.retrieve(id) -> BenchmarkRetrieveResponse -- client.benchmarks.list(\*\*params) -> SyncBenchmarksCursorIDPage[BenchmarkListResponse] -- client.benchmarks.list_public(\*\*params) -> SyncBenchmarksCursorIDPage[BenchmarkListPublicResponse] +- client.benchmarks.create(\*\*params) -> BenchmarkView +- client.benchmarks.retrieve(id) -> BenchmarkView +- client.benchmarks.list(\*\*params) -> SyncBenchmarksCursorIDPage[BenchmarkView] +- client.benchmarks.list_public(\*\*params) -> SyncBenchmarksCursorIDPage[BenchmarkView] - client.benchmarks.start_run(\*\*params) -> BenchmarkRunView ## Runs @@ -269,26 +266,22 @@ from runloop_api_client.types import ( ScenarioEnvironment, ScenarioRunListView, ScenarioRunView, + ScenarioView, ScoringContract, ScoringContractResultView, ScoringFunction, ScoringFunctionResultView, StartScenarioRunParameters, - ScenarioCreateResponse, - ScenarioRetrieveResponse, - ScenarioUpdateResponse, - ScenarioListResponse, - ScenarioListPublicResponse, ) ``` Methods: -- client.scenarios.create(\*\*params) -> ScenarioCreateResponse -- client.scenarios.retrieve(id) -> ScenarioRetrieveResponse -- client.scenarios.update(id, \*\*params) -> ScenarioUpdateResponse -- client.scenarios.list(\*\*params) -> SyncScenariosCursorIDPage[ScenarioListResponse] -- client.scenarios.list_public(\*\*params) -> SyncScenariosCursorIDPage[ScenarioListPublicResponse] +- client.scenarios.create(\*\*params) -> ScenarioView +- client.scenarios.retrieve(id) -> ScenarioView +- client.scenarios.update(id, \*\*params) -> ScenarioView +- client.scenarios.list(\*\*params) -> SyncScenariosCursorIDPage[ScenarioView] +- client.scenarios.list_public(\*\*params) -> SyncScenariosCursorIDPage[ScenarioView] - client.scenarios.start_run(\*\*params) -> ScenarioRunView ## Runs diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py index beb5f42c3..3b2823b3d 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -32,11 +32,8 @@ ) from ...pagination import SyncBenchmarksCursorIDPage, AsyncBenchmarksCursorIDPage from ..._base_client import AsyncPaginator, make_request_options +from ...types.benchmark_view import BenchmarkView from ...types.benchmark_run_view import BenchmarkRunView -from ...types.benchmark_list_response import BenchmarkListResponse -from ...types.benchmark_create_response import BenchmarkCreateResponse -from ...types.benchmark_retrieve_response import BenchmarkRetrieveResponse -from ...types.benchmark_list_public_response import BenchmarkListPublicResponse __all__ = ["BenchmarksResource", "AsyncBenchmarksResource"] @@ -79,7 +76,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BenchmarkCreateResponse: + ) -> BenchmarkView: """ Create a Benchmark with a set of Scenarios. @@ -120,7 +117,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BenchmarkCreateResponse, + cast_to=BenchmarkView, ) def retrieve( @@ -133,7 +130,7 @@ def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BenchmarkRetrieveResponse: + ) -> BenchmarkView: """ Get a previously created Benchmark. @@ -153,7 +150,7 @@ def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=BenchmarkRetrieveResponse, + cast_to=BenchmarkView, ) def list( @@ -167,7 +164,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncBenchmarksCursorIDPage[BenchmarkListResponse]: + ) -> SyncBenchmarksCursorIDPage[BenchmarkView]: """ List all Benchmarks matching filter. @@ -186,7 +183,7 @@ def list( """ return self._get_api_list( "/v1/benchmarks", - page=SyncBenchmarksCursorIDPage[BenchmarkListResponse], + page=SyncBenchmarksCursorIDPage[BenchmarkView], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -200,7 +197,7 @@ def list( benchmark_list_params.BenchmarkListParams, ), ), - model=BenchmarkListResponse, + model=BenchmarkView, ) def list_public( @@ -214,7 +211,7 @@ def list_public( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncBenchmarksCursorIDPage[BenchmarkListPublicResponse]: + ) -> SyncBenchmarksCursorIDPage[BenchmarkView]: """ List all public benchmarks matching filter. @@ -233,7 +230,7 @@ def list_public( """ return self._get_api_list( "/v1/benchmarks/list_public", - page=SyncBenchmarksCursorIDPage[BenchmarkListPublicResponse], + page=SyncBenchmarksCursorIDPage[BenchmarkView], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -247,7 +244,7 @@ def list_public( benchmark_list_public_params.BenchmarkListPublicParams, ), ), - model=BenchmarkListPublicResponse, + model=BenchmarkView, ) def start_run( @@ -343,7 +340,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> BenchmarkCreateResponse: + ) -> BenchmarkView: """ Create a Benchmark with a set of Scenarios. @@ -384,7 +381,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=BenchmarkCreateResponse, + cast_to=BenchmarkView, ) async def retrieve( @@ -397,7 +394,7 @@ async def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> BenchmarkRetrieveResponse: + ) -> BenchmarkView: """ Get a previously created Benchmark. @@ -417,7 +414,7 @@ async def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=BenchmarkRetrieveResponse, + cast_to=BenchmarkView, ) def list( @@ -431,7 +428,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[BenchmarkListResponse, AsyncBenchmarksCursorIDPage[BenchmarkListResponse]]: + ) -> AsyncPaginator[BenchmarkView, AsyncBenchmarksCursorIDPage[BenchmarkView]]: """ List all Benchmarks matching filter. @@ -450,7 +447,7 @@ def list( """ return self._get_api_list( "/v1/benchmarks", - page=AsyncBenchmarksCursorIDPage[BenchmarkListResponse], + page=AsyncBenchmarksCursorIDPage[BenchmarkView], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -464,7 +461,7 @@ def list( benchmark_list_params.BenchmarkListParams, ), ), - model=BenchmarkListResponse, + model=BenchmarkView, ) def list_public( @@ -478,7 +475,7 @@ def list_public( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[BenchmarkListPublicResponse, AsyncBenchmarksCursorIDPage[BenchmarkListPublicResponse]]: + ) -> AsyncPaginator[BenchmarkView, AsyncBenchmarksCursorIDPage[BenchmarkView]]: """ List all public benchmarks matching filter. @@ -497,7 +494,7 @@ def list_public( """ return self._get_api_list( "/v1/benchmarks/list_public", - page=AsyncBenchmarksCursorIDPage[BenchmarkListPublicResponse], + page=AsyncBenchmarksCursorIDPage[BenchmarkView], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -511,7 +508,7 @@ def list_public( benchmark_list_public_params.BenchmarkListPublicParams, ), ), - model=BenchmarkListPublicResponse, + model=BenchmarkView, ) async def start_run( diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index aa03861d4..82e43c43f 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -41,15 +41,11 @@ ) from ...pagination import SyncScenariosCursorIDPage, AsyncScenariosCursorIDPage from ..._base_client import AsyncPaginator, make_request_options +from ...types.scenario_view import ScenarioView from ...types.scenario_run_view import ScenarioRunView from ...types.input_context_param import InputContextParam -from ...types.scenario_list_response import ScenarioListResponse from ...types.scoring_contract_param import ScoringContractParam -from ...types.scenario_create_response import ScenarioCreateResponse -from ...types.scenario_update_response import ScenarioUpdateResponse from ...types.scenario_environment_param import ScenarioEnvironmentParam -from ...types.scenario_retrieve_response import ScenarioRetrieveResponse -from ...types.scenario_list_public_response import ScenarioListPublicResponse __all__ = ["ScenariosResource", "AsyncScenariosResource"] @@ -99,7 +95,7 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> ScenarioCreateResponse: + ) -> ScenarioView: """ Create a Scenario, a repeatable AI coding evaluation test that defines the starting environment as well as evaluation success criteria. @@ -152,7 +148,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=ScenarioCreateResponse, + cast_to=ScenarioView, ) def retrieve( @@ -165,7 +161,7 @@ def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScenarioRetrieveResponse: + ) -> ScenarioView: """ Get a previously created scenario. @@ -185,7 +181,7 @@ def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ScenarioRetrieveResponse, + cast_to=ScenarioView, ) def update( @@ -206,7 +202,7 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> ScenarioUpdateResponse: + ) -> ScenarioView: """ Update a Scenario, a repeatable AI coding evaluation test that defines the starting environment as well as evaluation success criteria. @@ -261,7 +257,7 @@ def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=ScenarioUpdateResponse, + cast_to=ScenarioView, ) def list( @@ -276,7 +272,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncScenariosCursorIDPage[ScenarioListResponse]: + ) -> SyncScenariosCursorIDPage[ScenarioView]: """List all Scenarios matching filter. Args: @@ -298,7 +294,7 @@ def list( """ return self._get_api_list( "/v1/scenarios", - page=SyncScenariosCursorIDPage[ScenarioListResponse], + page=SyncScenariosCursorIDPage[ScenarioView], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -313,7 +309,7 @@ def list( scenario_list_params.ScenarioListParams, ), ), - model=ScenarioListResponse, + model=ScenarioView, ) def list_public( @@ -328,7 +324,7 @@ def list_public( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncScenariosCursorIDPage[ScenarioListPublicResponse]: + ) -> SyncScenariosCursorIDPage[ScenarioView]: """ List all public scenarios matching filter. @@ -349,7 +345,7 @@ def list_public( """ return self._get_api_list( "/v1/scenarios/list_public", - page=SyncScenariosCursorIDPage[ScenarioListPublicResponse], + page=SyncScenariosCursorIDPage[ScenarioView], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -364,7 +360,7 @@ def list_public( scenario_list_public_params.ScenarioListPublicParams, ), ), - model=ScenarioListPublicResponse, + model=ScenarioView, ) def start_run( @@ -471,7 +467,7 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> ScenarioCreateResponse: + ) -> ScenarioView: """ Create a Scenario, a repeatable AI coding evaluation test that defines the starting environment as well as evaluation success criteria. @@ -524,7 +520,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=ScenarioCreateResponse, + cast_to=ScenarioView, ) async def retrieve( @@ -537,7 +533,7 @@ async def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ScenarioRetrieveResponse: + ) -> ScenarioView: """ Get a previously created scenario. @@ -557,7 +553,7 @@ async def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=ScenarioRetrieveResponse, + cast_to=ScenarioView, ) async def update( @@ -578,7 +574,7 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> ScenarioUpdateResponse: + ) -> ScenarioView: """ Update a Scenario, a repeatable AI coding evaluation test that defines the starting environment as well as evaluation success criteria. @@ -633,7 +629,7 @@ async def update( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=ScenarioUpdateResponse, + cast_to=ScenarioView, ) def list( @@ -648,7 +644,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ScenarioListResponse, AsyncScenariosCursorIDPage[ScenarioListResponse]]: + ) -> AsyncPaginator[ScenarioView, AsyncScenariosCursorIDPage[ScenarioView]]: """List all Scenarios matching filter. Args: @@ -670,7 +666,7 @@ def list( """ return self._get_api_list( "/v1/scenarios", - page=AsyncScenariosCursorIDPage[ScenarioListResponse], + page=AsyncScenariosCursorIDPage[ScenarioView], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -685,7 +681,7 @@ def list( scenario_list_params.ScenarioListParams, ), ), - model=ScenarioListResponse, + model=ScenarioView, ) def list_public( @@ -700,7 +696,7 @@ def list_public( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[ScenarioListPublicResponse, AsyncScenariosCursorIDPage[ScenarioListPublicResponse]]: + ) -> AsyncPaginator[ScenarioView, AsyncScenariosCursorIDPage[ScenarioView]]: """ List all public scenarios matching filter. @@ -721,7 +717,7 @@ def list_public( """ return self._get_api_list( "/v1/scenarios/list_public", - page=AsyncScenariosCursorIDPage[ScenarioListPublicResponse], + page=AsyncScenariosCursorIDPage[ScenarioView], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -736,7 +732,7 @@ def list_public( scenario_list_public_params.ScenarioListPublicParams, ), ), - model=ScenarioListPublicResponse, + model=ScenarioView, ) async def start_run( diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 88e630982..f3dbc61d9 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -9,6 +9,8 @@ ) from .devbox_view import DevboxView as DevboxView from .input_context import InputContext as InputContext +from .scenario_view import ScenarioView as ScenarioView +from .benchmark_view import BenchmarkView as BenchmarkView from .blueprint_view import BlueprintView as BlueprintView from .devbox_list_view import DevboxListView as DevboxListView from .scoring_contract import ScoringContract as ScoringContract @@ -30,20 +32,15 @@ from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView from .repository_list_params import RepositoryListParams as RepositoryListParams from .scenario_create_params import ScenarioCreateParams as ScenarioCreateParams -from .scenario_list_response import ScenarioListResponse as ScenarioListResponse from .scenario_run_list_view import ScenarioRunListView as ScenarioRunListView from .scenario_update_params import ScenarioUpdateParams as ScenarioUpdateParams from .scoring_contract_param import ScoringContractParam as ScoringContractParam from .scoring_function_param import ScoringFunctionParam as ScoringFunctionParam from .benchmark_create_params import BenchmarkCreateParams as BenchmarkCreateParams -from .benchmark_list_response import BenchmarkListResponse as BenchmarkListResponse from .benchmark_run_list_view import BenchmarkRunListView as BenchmarkRunListView from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams from .repository_create_params import RepositoryCreateParams as RepositoryCreateParams -from .scenario_create_response import ScenarioCreateResponse as ScenarioCreateResponse -from .scenario_update_response import ScenarioUpdateResponse as ScenarioUpdateResponse -from .benchmark_create_response import BenchmarkCreateResponse as BenchmarkCreateResponse from .devbox_snapshot_list_view import DevboxSnapshotListView as DevboxSnapshotListView from .devbox_upload_file_params import DevboxUploadFileParams as DevboxUploadFileParams from .scenario_start_run_params import ScenarioStartRunParams as ScenarioStartRunParams @@ -53,8 +50,6 @@ from .repository_connection_view import RepositoryConnectionView as RepositoryConnectionView from .repository_version_details import RepositoryVersionDetails as RepositoryVersionDetails from .scenario_environment_param import ScenarioEnvironmentParam as ScenarioEnvironmentParam -from .scenario_retrieve_response import ScenarioRetrieveResponse as ScenarioRetrieveResponse -from .benchmark_retrieve_response import BenchmarkRetrieveResponse as BenchmarkRetrieveResponse from .devbox_create_tunnel_params import DevboxCreateTunnelParams as DevboxCreateTunnelParams from .devbox_download_file_params import DevboxDownloadFileParams as DevboxDownloadFileParams from .devbox_execute_async_params import DevboxExecuteAsyncParams as DevboxExecuteAsyncParams @@ -66,8 +61,6 @@ from .repository_version_list_view import RepositoryVersionListView as RepositoryVersionListView from .scoring_contract_result_view import ScoringContractResultView as ScoringContractResultView from .scoring_function_result_view import ScoringFunctionResultView as ScoringFunctionResultView -from .scenario_list_public_response import ScenarioListPublicResponse as ScenarioListPublicResponse -from .benchmark_list_public_response import BenchmarkListPublicResponse as BenchmarkListPublicResponse from .blueprint_build_logs_list_view import BlueprintBuildLogsListView as BlueprintBuildLogsListView from .devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse as DevboxCreateSSHKeyResponse from .repository_connection_list_view import RepositoryConnectionListView as RepositoryConnectionListView diff --git a/src/runloop_api_client/types/benchmark_create_response.py b/src/runloop_api_client/types/benchmark_create_response.py deleted file mode 100644 index b0c62817a..000000000 --- a/src/runloop_api_client/types/benchmark_create_response.py +++ /dev/null @@ -1,26 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Optional - -from pydantic import Field as FieldInfo - -from .._models import BaseModel - -__all__ = ["BenchmarkCreateResponse"] - - -class BenchmarkCreateResponse(BaseModel): - id: str - """The ID of the Benchmark.""" - - metadata: Dict[str, str] - """User defined metadata to attach to the benchmark for organization.""" - - name: str - """The name of the Benchmark.""" - - scenario_ids: List[str] = FieldInfo(alias="scenarioIds") - """List of Scenario IDs that make up the benchmark.""" - - is_public: Optional[bool] = None - """Whether this benchmark is public.""" diff --git a/src/runloop_api_client/types/benchmark_list_public_response.py b/src/runloop_api_client/types/benchmark_list_public_response.py deleted file mode 100644 index 4df643f8d..000000000 --- a/src/runloop_api_client/types/benchmark_list_public_response.py +++ /dev/null @@ -1,26 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Optional - -from pydantic import Field as FieldInfo - -from .._models import BaseModel - -__all__ = ["BenchmarkListPublicResponse"] - - -class BenchmarkListPublicResponse(BaseModel): - id: str - """The ID of the Benchmark.""" - - metadata: Dict[str, str] - """User defined metadata to attach to the benchmark for organization.""" - - name: str - """The name of the Benchmark.""" - - scenario_ids: List[str] = FieldInfo(alias="scenarioIds") - """List of Scenario IDs that make up the benchmark.""" - - is_public: Optional[bool] = None - """Whether this benchmark is public.""" diff --git a/src/runloop_api_client/types/benchmark_retrieve_response.py b/src/runloop_api_client/types/benchmark_retrieve_response.py deleted file mode 100644 index c704a6209..000000000 --- a/src/runloop_api_client/types/benchmark_retrieve_response.py +++ /dev/null @@ -1,26 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Optional - -from pydantic import Field as FieldInfo - -from .._models import BaseModel - -__all__ = ["BenchmarkRetrieveResponse"] - - -class BenchmarkRetrieveResponse(BaseModel): - id: str - """The ID of the Benchmark.""" - - metadata: Dict[str, str] - """User defined metadata to attach to the benchmark for organization.""" - - name: str - """The name of the Benchmark.""" - - scenario_ids: List[str] = FieldInfo(alias="scenarioIds") - """List of Scenario IDs that make up the benchmark.""" - - is_public: Optional[bool] = None - """Whether this benchmark is public.""" diff --git a/src/runloop_api_client/types/benchmark_list_response.py b/src/runloop_api_client/types/benchmark_view.py similarity index 88% rename from src/runloop_api_client/types/benchmark_list_response.py rename to src/runloop_api_client/types/benchmark_view.py index 2578ec19c..ceab4ff95 100644 --- a/src/runloop_api_client/types/benchmark_list_response.py +++ b/src/runloop_api_client/types/benchmark_view.py @@ -6,10 +6,10 @@ from .._models import BaseModel -__all__ = ["BenchmarkListResponse"] +__all__ = ["BenchmarkView"] -class BenchmarkListResponse(BaseModel): +class BenchmarkView(BaseModel): id: str """The ID of the Benchmark.""" diff --git a/src/runloop_api_client/types/scenario_create_response.py b/src/runloop_api_client/types/scenario_create_response.py deleted file mode 100644 index 7ab062f96..000000000 --- a/src/runloop_api_client/types/scenario_create_response.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, Optional - -from .._models import BaseModel -from .input_context import InputContext -from .scoring_contract import ScoringContract -from .scenario_environment import ScenarioEnvironment - -__all__ = ["ScenarioCreateResponse"] - - -class ScenarioCreateResponse(BaseModel): - id: str - """The ID of the Scenario.""" - - input_context: InputContext - """The input context for the Scenario.""" - - metadata: Dict[str, str] - """User defined metadata to attach to the scenario for organization.""" - - name: str - """The name of the Scenario.""" - - scoring_contract: ScoringContract - """The scoring contract for the Scenario.""" - - environment: Optional[ScenarioEnvironment] = None - """The Environment in which the Scenario is run.""" - - is_public: Optional[bool] = None - """Whether this scenario is public.""" - - reference_output: Optional[str] = None - """A string representation of the reference output to solve the scenario. - - Commonly can be the result of a git diff or a sequence of command actions to - apply to the environment. - """ diff --git a/src/runloop_api_client/types/scenario_list_public_response.py b/src/runloop_api_client/types/scenario_list_public_response.py deleted file mode 100644 index 8fa375956..000000000 --- a/src/runloop_api_client/types/scenario_list_public_response.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, Optional - -from .._models import BaseModel -from .input_context import InputContext -from .scoring_contract import ScoringContract -from .scenario_environment import ScenarioEnvironment - -__all__ = ["ScenarioListPublicResponse"] - - -class ScenarioListPublicResponse(BaseModel): - id: str - """The ID of the Scenario.""" - - input_context: InputContext - """The input context for the Scenario.""" - - metadata: Dict[str, str] - """User defined metadata to attach to the scenario for organization.""" - - name: str - """The name of the Scenario.""" - - scoring_contract: ScoringContract - """The scoring contract for the Scenario.""" - - environment: Optional[ScenarioEnvironment] = None - """The Environment in which the Scenario is run.""" - - is_public: Optional[bool] = None - """Whether this scenario is public.""" - - reference_output: Optional[str] = None - """A string representation of the reference output to solve the scenario. - - Commonly can be the result of a git diff or a sequence of command actions to - apply to the environment. - """ diff --git a/src/runloop_api_client/types/scenario_retrieve_response.py b/src/runloop_api_client/types/scenario_retrieve_response.py deleted file mode 100644 index 21297daf1..000000000 --- a/src/runloop_api_client/types/scenario_retrieve_response.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, Optional - -from .._models import BaseModel -from .input_context import InputContext -from .scoring_contract import ScoringContract -from .scenario_environment import ScenarioEnvironment - -__all__ = ["ScenarioRetrieveResponse"] - - -class ScenarioRetrieveResponse(BaseModel): - id: str - """The ID of the Scenario.""" - - input_context: InputContext - """The input context for the Scenario.""" - - metadata: Dict[str, str] - """User defined metadata to attach to the scenario for organization.""" - - name: str - """The name of the Scenario.""" - - scoring_contract: ScoringContract - """The scoring contract for the Scenario.""" - - environment: Optional[ScenarioEnvironment] = None - """The Environment in which the Scenario is run.""" - - is_public: Optional[bool] = None - """Whether this scenario is public.""" - - reference_output: Optional[str] = None - """A string representation of the reference output to solve the scenario. - - Commonly can be the result of a git diff or a sequence of command actions to - apply to the environment. - """ diff --git a/src/runloop_api_client/types/scenario_update_response.py b/src/runloop_api_client/types/scenario_update_response.py deleted file mode 100644 index dd8617f71..000000000 --- a/src/runloop_api_client/types/scenario_update_response.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, Optional - -from .._models import BaseModel -from .input_context import InputContext -from .scoring_contract import ScoringContract -from .scenario_environment import ScenarioEnvironment - -__all__ = ["ScenarioUpdateResponse"] - - -class ScenarioUpdateResponse(BaseModel): - id: str - """The ID of the Scenario.""" - - input_context: InputContext - """The input context for the Scenario.""" - - metadata: Dict[str, str] - """User defined metadata to attach to the scenario for organization.""" - - name: str - """The name of the Scenario.""" - - scoring_contract: ScoringContract - """The scoring contract for the Scenario.""" - - environment: Optional[ScenarioEnvironment] = None - """The Environment in which the Scenario is run.""" - - is_public: Optional[bool] = None - """Whether this scenario is public.""" - - reference_output: Optional[str] = None - """A string representation of the reference output to solve the scenario. - - Commonly can be the result of a git diff or a sequence of command actions to - apply to the environment. - """ diff --git a/src/runloop_api_client/types/scenario_list_response.py b/src/runloop_api_client/types/scenario_view.py similarity index 93% rename from src/runloop_api_client/types/scenario_list_response.py rename to src/runloop_api_client/types/scenario_view.py index 1d7097172..1a3233ab7 100644 --- a/src/runloop_api_client/types/scenario_list_response.py +++ b/src/runloop_api_client/types/scenario_view.py @@ -7,10 +7,10 @@ from .scoring_contract import ScoringContract from .scenario_environment import ScenarioEnvironment -__all__ = ["ScenarioListResponse"] +__all__ = ["ScenarioView"] -class ScenarioListResponse(BaseModel): +class ScenarioView(BaseModel): id: str """The ID of the Scenario.""" diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py index 7c2d47be9..19a93ad89 100644 --- a/tests/api_resources/test_benchmarks.py +++ b/tests/api_resources/test_benchmarks.py @@ -10,11 +10,8 @@ from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types import ( + BenchmarkView, BenchmarkRunView, - BenchmarkListResponse, - BenchmarkCreateResponse, - BenchmarkRetrieveResponse, - BenchmarkListPublicResponse, ) from runloop_api_client.pagination import SyncBenchmarksCursorIDPage, AsyncBenchmarksCursorIDPage @@ -30,7 +27,7 @@ def test_method_create(self, client: Runloop) -> None: is_public=True, name="name", ) - assert_matches_type(BenchmarkCreateResponse, benchmark, path=["response"]) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: @@ -40,7 +37,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: metadata={"foo": "string"}, scenario_ids=["string"], ) - assert_matches_type(BenchmarkCreateResponse, benchmark, path=["response"]) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) @parametrize def test_raw_response_create(self, client: Runloop) -> None: @@ -52,7 +49,7 @@ def test_raw_response_create(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = response.parse() - assert_matches_type(BenchmarkCreateResponse, benchmark, path=["response"]) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) @parametrize def test_streaming_response_create(self, client: Runloop) -> None: @@ -64,7 +61,7 @@ def test_streaming_response_create(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = response.parse() - assert_matches_type(BenchmarkCreateResponse, benchmark, path=["response"]) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) assert cast(Any, response.is_closed) is True @@ -73,7 +70,7 @@ def test_method_retrieve(self, client: Runloop) -> None: benchmark = client.benchmarks.retrieve( "id", ) - assert_matches_type(BenchmarkRetrieveResponse, benchmark, path=["response"]) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Runloop) -> None: @@ -84,7 +81,7 @@ def test_raw_response_retrieve(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = response.parse() - assert_matches_type(BenchmarkRetrieveResponse, benchmark, path=["response"]) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) @parametrize def test_streaming_response_retrieve(self, client: Runloop) -> None: @@ -95,7 +92,7 @@ def test_streaming_response_retrieve(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = response.parse() - assert_matches_type(BenchmarkRetrieveResponse, benchmark, path=["response"]) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) assert cast(Any, response.is_closed) is True @@ -109,7 +106,7 @@ def test_path_params_retrieve(self, client: Runloop) -> None: @parametrize def test_method_list(self, client: Runloop) -> None: benchmark = client.benchmarks.list() - assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkListResponse], benchmark, path=["response"]) + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: @@ -117,7 +114,7 @@ def test_method_list_with_all_params(self, client: Runloop) -> None: limit=0, starting_after="starting_after", ) - assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkListResponse], benchmark, path=["response"]) + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -126,7 +123,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = response.parse() - assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkListResponse], benchmark, path=["response"]) + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -135,14 +132,14 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = response.parse() - assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkListResponse], benchmark, path=["response"]) + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_list_public(self, client: Runloop) -> None: benchmark = client.benchmarks.list_public() - assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkListPublicResponse], benchmark, path=["response"]) + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) @parametrize def test_method_list_public_with_all_params(self, client: Runloop) -> None: @@ -150,7 +147,7 @@ def test_method_list_public_with_all_params(self, client: Runloop) -> None: limit=0, starting_after="starting_after", ) - assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkListPublicResponse], benchmark, path=["response"]) + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) @parametrize def test_raw_response_list_public(self, client: Runloop) -> None: @@ -159,7 +156,7 @@ def test_raw_response_list_public(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = response.parse() - assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkListPublicResponse], benchmark, path=["response"]) + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) @parametrize def test_streaming_response_list_public(self, client: Runloop) -> None: @@ -168,7 +165,7 @@ def test_streaming_response_list_public(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = response.parse() - assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkListPublicResponse], benchmark, path=["response"]) + assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) assert cast(Any, response.is_closed) is True @@ -222,7 +219,7 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: is_public=True, name="name", ) - assert_matches_type(BenchmarkCreateResponse, benchmark, path=["response"]) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -232,7 +229,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - metadata={"foo": "string"}, scenario_ids=["string"], ) - assert_matches_type(BenchmarkCreateResponse, benchmark, path=["response"]) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: @@ -244,7 +241,7 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = await response.parse() - assert_matches_type(BenchmarkCreateResponse, benchmark, path=["response"]) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: @@ -256,7 +253,7 @@ async def test_streaming_response_create(self, async_client: AsyncRunloop) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = await response.parse() - assert_matches_type(BenchmarkCreateResponse, benchmark, path=["response"]) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) assert cast(Any, response.is_closed) is True @@ -265,7 +262,7 @@ async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.retrieve( "id", ) - assert_matches_type(BenchmarkRetrieveResponse, benchmark, path=["response"]) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: @@ -276,7 +273,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = await response.parse() - assert_matches_type(BenchmarkRetrieveResponse, benchmark, path=["response"]) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: @@ -287,7 +284,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = await response.parse() - assert_matches_type(BenchmarkRetrieveResponse, benchmark, path=["response"]) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) assert cast(Any, response.is_closed) is True @@ -301,7 +298,7 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.list() - assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkListResponse], benchmark, path=["response"]) + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -309,7 +306,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> limit=0, starting_after="starting_after", ) - assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkListResponse], benchmark, path=["response"]) + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -318,7 +315,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = await response.parse() - assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkListResponse], benchmark, path=["response"]) + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -327,14 +324,14 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = await response.parse() - assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkListResponse], benchmark, path=["response"]) + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_list_public(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.list_public() - assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkListPublicResponse], benchmark, path=["response"]) + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) @parametrize async def test_method_list_public_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -342,7 +339,7 @@ async def test_method_list_public_with_all_params(self, async_client: AsyncRunlo limit=0, starting_after="starting_after", ) - assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkListPublicResponse], benchmark, path=["response"]) + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) @parametrize async def test_raw_response_list_public(self, async_client: AsyncRunloop) -> None: @@ -351,7 +348,7 @@ async def test_raw_response_list_public(self, async_client: AsyncRunloop) -> Non assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = await response.parse() - assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkListPublicResponse], benchmark, path=["response"]) + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) @parametrize async def test_streaming_response_list_public(self, async_client: AsyncRunloop) -> None: @@ -360,7 +357,7 @@ async def test_streaming_response_list_public(self, async_client: AsyncRunloop) assert response.http_request.headers.get("X-Stainless-Lang") == "python" benchmark = await response.parse() - assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkListPublicResponse], benchmark, path=["response"]) + assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index 6f7183bf8..a55134679 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -10,12 +10,8 @@ from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types import ( + ScenarioView, ScenarioRunView, - ScenarioListResponse, - ScenarioCreateResponse, - ScenarioUpdateResponse, - ScenarioRetrieveResponse, - ScenarioListPublicResponse, ) from runloop_api_client.pagination import SyncScenariosCursorIDPage, AsyncScenariosCursorIDPage @@ -45,7 +41,7 @@ def test_method_create(self, client: Runloop) -> None: ] }, ) - assert_matches_type(ScenarioCreateResponse, scenario, path=["response"]) + assert_matches_type(ScenarioView, scenario, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: @@ -96,7 +92,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: metadata={"foo": "string"}, reference_output="reference_output", ) - assert_matches_type(ScenarioCreateResponse, scenario, path=["response"]) + assert_matches_type(ScenarioView, scenario, path=["response"]) @parametrize def test_raw_response_create(self, client: Runloop) -> None: @@ -122,7 +118,7 @@ def test_raw_response_create(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = response.parse() - assert_matches_type(ScenarioCreateResponse, scenario, path=["response"]) + assert_matches_type(ScenarioView, scenario, path=["response"]) @parametrize def test_streaming_response_create(self, client: Runloop) -> None: @@ -148,7 +144,7 @@ def test_streaming_response_create(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = response.parse() - assert_matches_type(ScenarioCreateResponse, scenario, path=["response"]) + assert_matches_type(ScenarioView, scenario, path=["response"]) assert cast(Any, response.is_closed) is True @@ -157,7 +153,7 @@ def test_method_retrieve(self, client: Runloop) -> None: scenario = client.scenarios.retrieve( "id", ) - assert_matches_type(ScenarioRetrieveResponse, scenario, path=["response"]) + assert_matches_type(ScenarioView, scenario, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Runloop) -> None: @@ -168,7 +164,7 @@ def test_raw_response_retrieve(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = response.parse() - assert_matches_type(ScenarioRetrieveResponse, scenario, path=["response"]) + assert_matches_type(ScenarioView, scenario, path=["response"]) @parametrize def test_streaming_response_retrieve(self, client: Runloop) -> None: @@ -179,7 +175,7 @@ def test_streaming_response_retrieve(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = response.parse() - assert_matches_type(ScenarioRetrieveResponse, scenario, path=["response"]) + assert_matches_type(ScenarioView, scenario, path=["response"]) assert cast(Any, response.is_closed) is True @@ -211,7 +207,7 @@ def test_method_update(self, client: Runloop) -> None: ] }, ) - assert_matches_type(ScenarioUpdateResponse, scenario, path=["response"]) + assert_matches_type(ScenarioView, scenario, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Runloop) -> None: @@ -263,7 +259,7 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: metadata={"foo": "string"}, reference_output="reference_output", ) - assert_matches_type(ScenarioUpdateResponse, scenario, path=["response"]) + assert_matches_type(ScenarioView, scenario, path=["response"]) @parametrize def test_raw_response_update(self, client: Runloop) -> None: @@ -290,7 +286,7 @@ def test_raw_response_update(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = response.parse() - assert_matches_type(ScenarioUpdateResponse, scenario, path=["response"]) + assert_matches_type(ScenarioView, scenario, path=["response"]) @parametrize def test_streaming_response_update(self, client: Runloop) -> None: @@ -317,7 +313,7 @@ def test_streaming_response_update(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = response.parse() - assert_matches_type(ScenarioUpdateResponse, scenario, path=["response"]) + assert_matches_type(ScenarioView, scenario, path=["response"]) assert cast(Any, response.is_closed) is True @@ -347,7 +343,7 @@ def test_path_params_update(self, client: Runloop) -> None: @parametrize def test_method_list(self, client: Runloop) -> None: scenario = client.scenarios.list() - assert_matches_type(SyncScenariosCursorIDPage[ScenarioListResponse], scenario, path=["response"]) + assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: @@ -356,7 +352,7 @@ def test_method_list_with_all_params(self, client: Runloop) -> None: name="name", starting_after="starting_after", ) - assert_matches_type(SyncScenariosCursorIDPage[ScenarioListResponse], scenario, path=["response"]) + assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: @@ -365,7 +361,7 @@ def test_raw_response_list(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = response.parse() - assert_matches_type(SyncScenariosCursorIDPage[ScenarioListResponse], scenario, path=["response"]) + assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) @parametrize def test_streaming_response_list(self, client: Runloop) -> None: @@ -374,14 +370,14 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = response.parse() - assert_matches_type(SyncScenariosCursorIDPage[ScenarioListResponse], scenario, path=["response"]) + assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_list_public(self, client: Runloop) -> None: scenario = client.scenarios.list_public() - assert_matches_type(SyncScenariosCursorIDPage[ScenarioListPublicResponse], scenario, path=["response"]) + assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) @parametrize def test_method_list_public_with_all_params(self, client: Runloop) -> None: @@ -390,7 +386,7 @@ def test_method_list_public_with_all_params(self, client: Runloop) -> None: name="name", starting_after="starting_after", ) - assert_matches_type(SyncScenariosCursorIDPage[ScenarioListPublicResponse], scenario, path=["response"]) + assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) @parametrize def test_raw_response_list_public(self, client: Runloop) -> None: @@ -399,7 +395,7 @@ def test_raw_response_list_public(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = response.parse() - assert_matches_type(SyncScenariosCursorIDPage[ScenarioListPublicResponse], scenario, path=["response"]) + assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) @parametrize def test_streaming_response_list_public(self, client: Runloop) -> None: @@ -408,7 +404,7 @@ def test_streaming_response_list_public(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = response.parse() - assert_matches_type(SyncScenariosCursorIDPage[ScenarioListPublicResponse], scenario, path=["response"]) + assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) assert cast(Any, response.is_closed) is True @@ -477,7 +473,7 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: ] }, ) - assert_matches_type(ScenarioCreateResponse, scenario, path=["response"]) + assert_matches_type(ScenarioView, scenario, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -528,7 +524,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - metadata={"foo": "string"}, reference_output="reference_output", ) - assert_matches_type(ScenarioCreateResponse, scenario, path=["response"]) + assert_matches_type(ScenarioView, scenario, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: @@ -554,7 +550,7 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = await response.parse() - assert_matches_type(ScenarioCreateResponse, scenario, path=["response"]) + assert_matches_type(ScenarioView, scenario, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: @@ -580,7 +576,7 @@ async def test_streaming_response_create(self, async_client: AsyncRunloop) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = await response.parse() - assert_matches_type(ScenarioCreateResponse, scenario, path=["response"]) + assert_matches_type(ScenarioView, scenario, path=["response"]) assert cast(Any, response.is_closed) is True @@ -589,7 +585,7 @@ async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: scenario = await async_client.scenarios.retrieve( "id", ) - assert_matches_type(ScenarioRetrieveResponse, scenario, path=["response"]) + assert_matches_type(ScenarioView, scenario, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: @@ -600,7 +596,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = await response.parse() - assert_matches_type(ScenarioRetrieveResponse, scenario, path=["response"]) + assert_matches_type(ScenarioView, scenario, path=["response"]) @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: @@ -611,7 +607,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = await response.parse() - assert_matches_type(ScenarioRetrieveResponse, scenario, path=["response"]) + assert_matches_type(ScenarioView, scenario, path=["response"]) assert cast(Any, response.is_closed) is True @@ -643,7 +639,7 @@ async def test_method_update(self, async_client: AsyncRunloop) -> None: ] }, ) - assert_matches_type(ScenarioUpdateResponse, scenario, path=["response"]) + assert_matches_type(ScenarioView, scenario, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -695,7 +691,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - metadata={"foo": "string"}, reference_output="reference_output", ) - assert_matches_type(ScenarioUpdateResponse, scenario, path=["response"]) + assert_matches_type(ScenarioView, scenario, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: @@ -722,7 +718,7 @@ async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = await response.parse() - assert_matches_type(ScenarioUpdateResponse, scenario, path=["response"]) + assert_matches_type(ScenarioView, scenario, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncRunloop) -> None: @@ -749,7 +745,7 @@ async def test_streaming_response_update(self, async_client: AsyncRunloop) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = await response.parse() - assert_matches_type(ScenarioUpdateResponse, scenario, path=["response"]) + assert_matches_type(ScenarioView, scenario, path=["response"]) assert cast(Any, response.is_closed) is True @@ -779,7 +775,7 @@ async def test_path_params_update(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: scenario = await async_client.scenarios.list() - assert_matches_type(AsyncScenariosCursorIDPage[ScenarioListResponse], scenario, path=["response"]) + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -788,7 +784,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> name="name", starting_after="starting_after", ) - assert_matches_type(AsyncScenariosCursorIDPage[ScenarioListResponse], scenario, path=["response"]) + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @@ -797,7 +793,7 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = await response.parse() - assert_matches_type(AsyncScenariosCursorIDPage[ScenarioListResponse], scenario, path=["response"]) + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: @@ -806,14 +802,14 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = await response.parse() - assert_matches_type(AsyncScenariosCursorIDPage[ScenarioListResponse], scenario, path=["response"]) + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_list_public(self, async_client: AsyncRunloop) -> None: scenario = await async_client.scenarios.list_public() - assert_matches_type(AsyncScenariosCursorIDPage[ScenarioListPublicResponse], scenario, path=["response"]) + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) @parametrize async def test_method_list_public_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -822,7 +818,7 @@ async def test_method_list_public_with_all_params(self, async_client: AsyncRunlo name="name", starting_after="starting_after", ) - assert_matches_type(AsyncScenariosCursorIDPage[ScenarioListPublicResponse], scenario, path=["response"]) + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) @parametrize async def test_raw_response_list_public(self, async_client: AsyncRunloop) -> None: @@ -831,7 +827,7 @@ async def test_raw_response_list_public(self, async_client: AsyncRunloop) -> Non assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = await response.parse() - assert_matches_type(AsyncScenariosCursorIDPage[ScenarioListPublicResponse], scenario, path=["response"]) + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) @parametrize async def test_streaming_response_list_public(self, async_client: AsyncRunloop) -> None: @@ -840,7 +836,7 @@ async def test_streaming_response_list_public(self, async_client: AsyncRunloop) assert response.http_request.headers.get("X-Stainless-Lang") == "python" scenario = await response.parse() - assert_matches_type(AsyncScenariosCursorIDPage[ScenarioListPublicResponse], scenario, path=["response"]) + assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) assert cast(Any, response.is_closed) is True From ecb7fd5a95f565d1ebed7fae55dc2910eab2e46d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 9 May 2025 04:19:36 +0000 Subject: [PATCH 729/993] chore(internal): avoid errors for isinstance checks on proxies --- src/runloop_api_client/_utils/_proxy.py | 5 ++++- tests/test_utils/test_proxy.py | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/runloop_api_client/_utils/_proxy.py b/src/runloop_api_client/_utils/_proxy.py index ffd883e9d..0f239a33c 100644 --- a/src/runloop_api_client/_utils/_proxy.py +++ b/src/runloop_api_client/_utils/_proxy.py @@ -46,7 +46,10 @@ def __dir__(self) -> Iterable[str]: @property # type: ignore @override def __class__(self) -> type: # pyright: ignore - proxied = self.__get_proxied__() + try: + proxied = self.__get_proxied__() + except Exception: + return type(self) if issubclass(type(proxied), LazyProxy): return type(proxied) return proxied.__class__ diff --git a/tests/test_utils/test_proxy.py b/tests/test_utils/test_proxy.py index af0c2a623..e3506d9c3 100644 --- a/tests/test_utils/test_proxy.py +++ b/tests/test_utils/test_proxy.py @@ -21,3 +21,14 @@ def test_recursive_proxy() -> None: assert dir(proxy) == [] assert type(proxy).__name__ == "RecursiveLazyProxy" assert type(operator.attrgetter("name.foo.bar.baz")(proxy)).__name__ == "RecursiveLazyProxy" + + +def test_isinstance_does_not_error() -> None: + class AlwaysErrorProxy(LazyProxy[Any]): + @override + def __load__(self) -> Any: + raise RuntimeError("Mocking missing dependency") + + proxy = AlwaysErrorProxy() + assert not isinstance(proxy, dict) + assert isinstance(proxy, LazyProxy) From 025a0b93c2b2be885e219e5baf05784c64fe6bc3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 9 May 2025 20:46:54 +0000 Subject: [PATCH 730/993] feat(api): api update --- .stats.yml | 4 ++-- src/runloop_api_client/resources/benchmarks/benchmarks.py | 4 ++-- src/runloop_api_client/types/benchmark_create_params.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index f3bd95afb..975ec3b38 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 79 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8227cc69585fb2b6d4eed5266a60ed91768c97200f52f95fe022417c6e9e91da.yml -openapi_spec_hash: e038f338d187fe1ac41d36ccce67dcc6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-31e39bc164768e4e73feb3ed3727643705b455e322c91e7fff1dfb2df504d2e8.yml +openapi_spec_hash: 3f2c3d5358dc1732a92e3fed0f5cbcd7 config_hash: e9831eba75eecfc502817af80812f6a7 diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py index 3b2823b3d..0c77ce342 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -83,7 +83,7 @@ def create( Args: is_public: Whether this benchmark is public. - name: The name of the Benchmark. + name: The name of the Benchmark. This must be unique. metadata: User defined metadata to attach to the benchmark for organization. @@ -347,7 +347,7 @@ async def create( Args: is_public: Whether this benchmark is public. - name: The name of the Benchmark. + name: The name of the Benchmark. This must be unique. metadata: User defined metadata to attach to the benchmark for organization. diff --git a/src/runloop_api_client/types/benchmark_create_params.py b/src/runloop_api_client/types/benchmark_create_params.py index 27aabe737..7e1621f59 100644 --- a/src/runloop_api_client/types/benchmark_create_params.py +++ b/src/runloop_api_client/types/benchmark_create_params.py @@ -13,7 +13,7 @@ class BenchmarkCreateParams(TypedDict, total=False): """Whether this benchmark is public.""" name: Required[str] - """The name of the Benchmark.""" + """The name of the Benchmark. This must be unique.""" metadata: Optional[Dict[str, str]] """User defined metadata to attach to the benchmark for organization.""" From 991fa7789e36eb649c9e54f4444c05d2b64ce3c7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 10 May 2025 03:40:13 +0000 Subject: [PATCH 731/993] fix(package): support direct resource imports --- src/runloop_api_client/__init__.py | 5 ++++ .../_utils/_resources_proxy.py | 24 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 src/runloop_api_client/_utils/_resources_proxy.py diff --git a/src/runloop_api_client/__init__.py b/src/runloop_api_client/__init__.py index 42d79a14c..fd4bc5d8d 100644 --- a/src/runloop_api_client/__init__.py +++ b/src/runloop_api_client/__init__.py @@ -1,5 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +import typing as _t + from . import types from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes from ._utils import file_from_path @@ -68,6 +70,9 @@ "DefaultAsyncHttpxClient", ] +if not _t.TYPE_CHECKING: + from ._utils._resources_proxy import resources as resources + _setup_logging() # Update the __module__ attribute for exported symbols so that diff --git a/src/runloop_api_client/_utils/_resources_proxy.py b/src/runloop_api_client/_utils/_resources_proxy.py new file mode 100644 index 000000000..a3b5c0479 --- /dev/null +++ b/src/runloop_api_client/_utils/_resources_proxy.py @@ -0,0 +1,24 @@ +from __future__ import annotations + +from typing import Any +from typing_extensions import override + +from ._proxy import LazyProxy + + +class ResourcesProxy(LazyProxy[Any]): + """A proxy for the `runloop_api_client.resources` module. + + This is used so that we can lazily import `runloop_api_client.resources` only when + needed *and* so that users can just import `runloop_api_client` and reference `runloop_api_client.resources` + """ + + @override + def __load__(self) -> Any: + import importlib + + mod = importlib.import_module("runloop_api_client.resources") + return mod + + +resources = ResourcesProxy().__as_proxied__() From d5b340e2bb59a3a09a4732bd6b73ec03e1314646 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 May 2025 05:01:55 +0000 Subject: [PATCH 732/993] chore(ci): upload sdks to package manager --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ scripts/utils/upload-artifact.sh | 25 +++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100755 scripts/utils/upload-artifact.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87c2de57f..f88c4fe28 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,30 @@ jobs: - name: Run lints run: ./scripts/lint + upload: + if: github.repository == 'stainless-sdks/runloop-python' + timeout-minutes: 10 + name: upload + permissions: + contents: read + id-token: write + runs-on: depot-ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + + - name: Get GitHub OIDC Token + id: github-oidc + uses: actions/github-script@v6 + with: + script: core.setOutput('github_token', await core.getIDToken()); + + - name: Upload tarball + env: + URL: https://pkg.stainless.com/s + AUTH: ${{ steps.github-oidc.outputs.github_token }} + SHA: ${{ github.sha }} + run: ./scripts/utils/upload-artifact.sh + test: timeout-minutes: 10 name: test diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh new file mode 100755 index 000000000..b1f9b36b1 --- /dev/null +++ b/scripts/utils/upload-artifact.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -exuo pipefail + +RESPONSE=$(curl -X POST "$URL" \ + -H "Authorization: Bearer $AUTH" \ + -H "Content-Type: application/json") + +SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url') + +if [[ "$SIGNED_URL" == "null" ]]; then + echo -e "\033[31mFailed to get signed URL.\033[0m" + exit 1 +fi + +UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \ + -H "Content-Type: application/gzip" \ + --data-binary @- "$SIGNED_URL" 2>&1) + +if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then + echo -e "\033[32mUploaded build to Stainless storage.\033[0m" + echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/runloop-python/$SHA'\033[0m" +else + echo -e "\033[31mFailed to upload artifact.\033[0m" + exit 1 +fi From 6586272529f03f251881e9392b0eeee27fad0a47 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 May 2025 03:51:03 +0000 Subject: [PATCH 733/993] chore(ci): fix installation instructions --- scripts/utils/upload-artifact.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh index b1f9b36b1..01188eb0a 100755 --- a/scripts/utils/upload-artifact.sh +++ b/scripts/utils/upload-artifact.sh @@ -18,7 +18,7 @@ UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \ if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then echo -e "\033[32mUploaded build to Stainless storage.\033[0m" - echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/runloop-python/$SHA'\033[0m" + echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/runloop-python/$SHA'\033[0m" else echo -e "\033[31mFailed to upload artifact.\033[0m" exit 1 From 765b6ee4ad1c031cf888793ef04517584e7fa12d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 22 May 2025 02:36:24 +0000 Subject: [PATCH 734/993] chore(docs): grammar improvements --- SECURITY.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index 3524f0045..6426d978b 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -16,11 +16,11 @@ before making any information public. ## Reporting Non-SDK Related Security Issues If you encounter security issues that are not directly related to SDKs but pertain to the services -or products provided by Runloop please follow the respective company's security reporting guidelines. +or products provided by Runloop, please follow the respective company's security reporting guidelines. ### Runloop Terms and Policies -Please contact support@runloop.ai for any questions or concerns regarding security of our services. +Please contact support@runloop.ai for any questions or concerns regarding the security of our services. --- From 2b25bc417aa44dcff10aa1e7df1d0380a8631524 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 22 May 2025 21:35:46 +0000 Subject: [PATCH 735/993] feat(api): api update --- .stats.yml | 6 +-- README.md | 4 +- src/runloop_api_client/_constants.py | 4 +- .../resources/devboxes/devboxes.py | 38 +++++++++++++------ .../resources/devboxes/disk_snapshots.py | 24 +++++++++++- .../devbox_list_disk_snapshots_params.py | 13 ++++++- .../devboxes/disk_snapshot_list_params.py | 13 ++++++- .../devboxes/test_disk_snapshots.py | 4 ++ tests/api_resources/test_devboxes.py | 4 ++ 9 files changed, 87 insertions(+), 23 deletions(-) diff --git a/.stats.yml b/.stats.yml index 975ec3b38..4506c9ccb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 79 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-31e39bc164768e4e73feb3ed3727643705b455e322c91e7fff1dfb2df504d2e8.yml -openapi_spec_hash: 3f2c3d5358dc1732a92e3fed0f5cbcd7 -config_hash: e9831eba75eecfc502817af80812f6a7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-589e342137de29187fec9e332ae5ca29de64e531f8b92b46b2469fdb3449a721.yml +openapi_spec_hash: 5dbf4fe59153afb4d4c8642e05fcecdc +config_hash: 38219157b7a6dd4d0accbd0d57095420 diff --git a/README.md b/README.md index 05e74c625..0664c6b26 100644 --- a/README.md +++ b/README.md @@ -250,7 +250,7 @@ client.with_options(max_retries=5).devboxes.create() ### Timeouts -By default requests time out after 1 minute. You can configure this with a `timeout` option, +By default requests time out after 10 minutes. You can configure this with a `timeout` option, which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object: ```python @@ -258,7 +258,7 @@ from runloop_api_client import Runloop # Configure the default for all requests: client = Runloop( - # 20 seconds (default is 1 minute) + # 20 seconds (default is 10 minutes) timeout=20.0, ) diff --git a/src/runloop_api_client/_constants.py b/src/runloop_api_client/_constants.py index 6be0f5e04..a949b3e6f 100644 --- a/src/runloop_api_client/_constants.py +++ b/src/runloop_api_client/_constants.py @@ -5,8 +5,8 @@ RAW_RESPONSE_HEADER = "X-Stainless-Raw-Response" OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to" -# default timeout is 1 minute -DEFAULT_TIMEOUT = httpx.Timeout(timeout=60, connect=5.0) +# default timeout is 10 minutes +DEFAULT_TIMEOUT = httpx.Timeout(timeout=600, connect=5.0) DEFAULT_MAX_RETRIES = 0 DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20) diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 52dff69a4..ccf209f21 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -444,11 +444,8 @@ def create_tunnel( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, ) -> DevboxTunnelView: - """Create a live tunnel to an available port on the Devbox. - - Note the port must be - made available using Devbox.create.availablePorts. Otherwise, the tunnel will - not connect to any running processes on the Devbox. + """ + Create a live tunnel to an available port on the Devbox. Args: port: Devbox port that tunnel will expose. @@ -729,6 +726,8 @@ def list_disk_snapshots( *, devbox_id: str | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, + metadata_key: str | NotGiven = NOT_GIVEN, + metadata_key_in: str | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -738,13 +737,19 @@ def list_disk_snapshots( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView]: """ - List all snapshots of a Devbox while optionally filtering by Devbox ID. + List all snapshots of a Devbox while optionally filtering by Devbox ID and + metadata. Args: devbox_id: Devbox ID to filter by. limit: The limit of items to return. Default is 20. + metadata_key: Filter snapshots by metadata key-value pair. Can be used multiple times for + different keys. + + metadata_key_in: Filter snapshots by metadata key with multiple possible values (OR condition). + starting_after: Load the next page of data starting after the item with the given ID. extra_headers: Send extra headers @@ -767,6 +772,8 @@ def list_disk_snapshots( { "devbox_id": devbox_id, "limit": limit, + "metadata_key": metadata_key, + "metadata_key_in": metadata_key_in, "starting_after": starting_after, }, devbox_list_disk_snapshots_params.DevboxListDiskSnapshotsParams, @@ -1507,11 +1514,8 @@ async def create_tunnel( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, ) -> DevboxTunnelView: - """Create a live tunnel to an available port on the Devbox. - - Note the port must be - made available using Devbox.create.availablePorts. Otherwise, the tunnel will - not connect to any running processes on the Devbox. + """ + Create a live tunnel to an available port on the Devbox. Args: port: Devbox port that tunnel will expose. @@ -1792,6 +1796,8 @@ def list_disk_snapshots( *, devbox_id: str | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, + metadata_key: str | NotGiven = NOT_GIVEN, + metadata_key_in: str | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1801,13 +1807,19 @@ def list_disk_snapshots( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[DevboxSnapshotView, AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView]]: """ - List all snapshots of a Devbox while optionally filtering by Devbox ID. + List all snapshots of a Devbox while optionally filtering by Devbox ID and + metadata. Args: devbox_id: Devbox ID to filter by. limit: The limit of items to return. Default is 20. + metadata_key: Filter snapshots by metadata key-value pair. Can be used multiple times for + different keys. + + metadata_key_in: Filter snapshots by metadata key with multiple possible values (OR condition). + starting_after: Load the next page of data starting after the item with the given ID. extra_headers: Send extra headers @@ -1830,6 +1842,8 @@ def list_disk_snapshots( { "devbox_id": devbox_id, "limit": limit, + "metadata_key": metadata_key, + "metadata_key_in": metadata_key_in, "starting_after": starting_after, }, devbox_list_disk_snapshots_params.DevboxListDiskSnapshotsParams, diff --git a/src/runloop_api_client/resources/devboxes/disk_snapshots.py b/src/runloop_api_client/resources/devboxes/disk_snapshots.py index 72439a4ec..7b99974e9 100644 --- a/src/runloop_api_client/resources/devboxes/disk_snapshots.py +++ b/src/runloop_api_client/resources/devboxes/disk_snapshots.py @@ -104,6 +104,8 @@ def list( *, devbox_id: str | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, + metadata_key: str | NotGiven = NOT_GIVEN, + metadata_key_in: str | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -113,13 +115,19 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView]: """ - List all snapshots of a Devbox while optionally filtering by Devbox ID. + List all snapshots of a Devbox while optionally filtering by Devbox ID and + metadata. Args: devbox_id: Devbox ID to filter by. limit: The limit of items to return. Default is 20. + metadata_key: Filter snapshots by metadata key-value pair. Can be used multiple times for + different keys. + + metadata_key_in: Filter snapshots by metadata key with multiple possible values (OR condition). + starting_after: Load the next page of data starting after the item with the given ID. extra_headers: Send extra headers @@ -142,6 +150,8 @@ def list( { "devbox_id": devbox_id, "limit": limit, + "metadata_key": metadata_key, + "metadata_key_in": metadata_key_in, "starting_after": starting_after, }, disk_snapshot_list_params.DiskSnapshotListParams, @@ -271,6 +281,8 @@ def list( *, devbox_id: str | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, + metadata_key: str | NotGiven = NOT_GIVEN, + metadata_key_in: str | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -280,13 +292,19 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[DevboxSnapshotView, AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView]]: """ - List all snapshots of a Devbox while optionally filtering by Devbox ID. + List all snapshots of a Devbox while optionally filtering by Devbox ID and + metadata. Args: devbox_id: Devbox ID to filter by. limit: The limit of items to return. Default is 20. + metadata_key: Filter snapshots by metadata key-value pair. Can be used multiple times for + different keys. + + metadata_key_in: Filter snapshots by metadata key with multiple possible values (OR condition). + starting_after: Load the next page of data starting after the item with the given ID. extra_headers: Send extra headers @@ -309,6 +327,8 @@ def list( { "devbox_id": devbox_id, "limit": limit, + "metadata_key": metadata_key, + "metadata_key_in": metadata_key_in, "starting_after": starting_after, }, disk_snapshot_list_params.DiskSnapshotListParams, diff --git a/src/runloop_api_client/types/devbox_list_disk_snapshots_params.py b/src/runloop_api_client/types/devbox_list_disk_snapshots_params.py index 7676c1de9..ad476b208 100644 --- a/src/runloop_api_client/types/devbox_list_disk_snapshots_params.py +++ b/src/runloop_api_client/types/devbox_list_disk_snapshots_params.py @@ -2,7 +2,9 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Annotated, TypedDict + +from .._utils import PropertyInfo __all__ = ["DevboxListDiskSnapshotsParams"] @@ -14,5 +16,14 @@ class DevboxListDiskSnapshotsParams(TypedDict, total=False): limit: int """The limit of items to return. Default is 20.""" + metadata_key: Annotated[str, PropertyInfo(alias="metadata[key]")] + """Filter snapshots by metadata key-value pair. + + Can be used multiple times for different keys. + """ + + metadata_key_in: Annotated[str, PropertyInfo(alias="metadata[key][in]")] + """Filter snapshots by metadata key with multiple possible values (OR condition).""" + starting_after: str """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/devboxes/disk_snapshot_list_params.py b/src/runloop_api_client/types/devboxes/disk_snapshot_list_params.py index 82cd12731..e43a55d1d 100644 --- a/src/runloop_api_client/types/devboxes/disk_snapshot_list_params.py +++ b/src/runloop_api_client/types/devboxes/disk_snapshot_list_params.py @@ -2,7 +2,9 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo __all__ = ["DiskSnapshotListParams"] @@ -14,5 +16,14 @@ class DiskSnapshotListParams(TypedDict, total=False): limit: int """The limit of items to return. Default is 20.""" + metadata_key: Annotated[str, PropertyInfo(alias="metadata[key]")] + """Filter snapshots by metadata key-value pair. + + Can be used multiple times for different keys. + """ + + metadata_key_in: Annotated[str, PropertyInfo(alias="metadata[key][in]")] + """Filter snapshots by metadata key with multiple possible values (OR condition).""" + starting_after: str """Load the next page of data starting after the item with the given ID.""" diff --git a/tests/api_resources/devboxes/test_disk_snapshots.py b/tests/api_resources/devboxes/test_disk_snapshots.py index dbbefa079..c7708f348 100644 --- a/tests/api_resources/devboxes/test_disk_snapshots.py +++ b/tests/api_resources/devboxes/test_disk_snapshots.py @@ -75,6 +75,8 @@ def test_method_list_with_all_params(self, client: Runloop) -> None: disk_snapshot = client.devboxes.disk_snapshots.list( devbox_id="devbox_id", limit=0, + metadata_key="metadata[key]", + metadata_key_in="metadata[key][in]", starting_after="starting_after", ) assert_matches_type(SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], disk_snapshot, path=["response"]) @@ -198,6 +200,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> disk_snapshot = await async_client.devboxes.disk_snapshots.list( devbox_id="devbox_id", limit=0, + metadata_key="metadata[key]", + metadata_key_in="metadata[key][in]", starting_after="starting_after", ) assert_matches_type(AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], disk_snapshot, path=["response"]) diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 0f7045def..d27e04f01 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -548,6 +548,8 @@ def test_method_list_disk_snapshots_with_all_params(self, client: Runloop) -> No devbox = client.devboxes.list_disk_snapshots( devbox_id="devbox_id", limit=0, + metadata_key="metadata[key]", + metadata_key_in="metadata[key][in]", starting_after="starting_after", ) assert_matches_type(SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], devbox, path=["response"]) @@ -1428,6 +1430,8 @@ async def test_method_list_disk_snapshots_with_all_params(self, async_client: As devbox = await async_client.devboxes.list_disk_snapshots( devbox_id="devbox_id", limit=0, + metadata_key="metadata[key]", + metadata_key_in="metadata[key][in]", starting_after="starting_after", ) assert_matches_type(AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], devbox, path=["response"]) From b8dabbef4ebcce5e7e28d8156295a772211c25e0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 22 May 2025 22:35:21 +0000 Subject: [PATCH 736/993] feat(api): api update --- .stats.yml | 2 +- README.md | 4 ++-- src/runloop_api_client/_constants.py | 4 ++-- src/runloop_api_client/resources/devboxes/devboxes.py | 11 ++++++++++- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4506c9ccb..637120fbb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 79 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-589e342137de29187fec9e332ae5ca29de64e531f8b92b46b2469fdb3449a721.yml openapi_spec_hash: 5dbf4fe59153afb4d4c8642e05fcecdc -config_hash: 38219157b7a6dd4d0accbd0d57095420 +config_hash: 7cef6c9fce4f9a345184516c6cde462f diff --git a/README.md b/README.md index 0664c6b26..05e74c625 100644 --- a/README.md +++ b/README.md @@ -250,7 +250,7 @@ client.with_options(max_retries=5).devboxes.create() ### Timeouts -By default requests time out after 10 minutes. You can configure this with a `timeout` option, +By default requests time out after 1 minute. You can configure this with a `timeout` option, which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object: ```python @@ -258,7 +258,7 @@ from runloop_api_client import Runloop # Configure the default for all requests: client = Runloop( - # 20 seconds (default is 10 minutes) + # 20 seconds (default is 1 minute) timeout=20.0, ) diff --git a/src/runloop_api_client/_constants.py b/src/runloop_api_client/_constants.py index a949b3e6f..6be0f5e04 100644 --- a/src/runloop_api_client/_constants.py +++ b/src/runloop_api_client/_constants.py @@ -5,8 +5,8 @@ RAW_RESPONSE_HEADER = "X-Stainless-Raw-Response" OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to" -# default timeout is 10 minutes -DEFAULT_TIMEOUT = httpx.Timeout(timeout=600, connect=5.0) +# default timeout is 1 minute +DEFAULT_TIMEOUT = httpx.Timeout(timeout=60, connect=5.0) DEFAULT_MAX_RETRIES = 0 DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20) diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index ccf209f21..16fd23dc8 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -39,7 +39,7 @@ devbox_write_file_contents_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes -from ..._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform +from ..._utils import is_given, extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform from .browsers import ( BrowsersResource, AsyncBrowsersResource, @@ -80,6 +80,7 @@ async_to_custom_raw_response_wrapper, async_to_custom_streamed_response_wrapper, ) +from ..._constants import DEFAULT_TIMEOUT from ...pagination import ( SyncDevboxesCursorIDPage, AsyncDevboxesCursorIDPage, @@ -661,6 +662,8 @@ def execute_sync( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT: + timeout = 600 return self._post( f"/v1/devboxes/{id}/execute_sync", body=maybe_transform( @@ -998,6 +1001,8 @@ def snapshot_disk( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT: + timeout = 600 return self._post( f"/v1/devboxes/{id}/snapshot_disk", body=maybe_transform( @@ -1731,6 +1736,8 @@ async def execute_sync( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT: + timeout = 600 return await self._post( f"/v1/devboxes/{id}/execute_sync", body=await async_maybe_transform( @@ -2068,6 +2075,8 @@ async def snapshot_disk( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT: + timeout = 600 return await self._post( f"/v1/devboxes/{id}/snapshot_disk", body=await async_maybe_transform( From 0285b2249059a81ce5ab13b05c256143343b16d2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 22 May 2025 22:37:38 +0000 Subject: [PATCH 737/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f04d08965..57dc0c3da 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.32.0" + ".": "0.33.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 1ace85349..7b17becbb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.32.0" +version = "0.33.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 6db6388a9..fc69d63b8 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.32.0" # x-release-please-version +__version__ = "0.33.0" # x-release-please-version From b7126c786625f8eb99f0c08886b2d5b75eed4ed9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 27 May 2025 21:27:12 +0000 Subject: [PATCH 738/993] feat(api): api update --- .stats.yml | 8 +- api.md | 7 +- .../resources/devboxes/devboxes.py | 123 ++++++++++++++++++ .../resources/devboxes/disk_snapshots.py | 81 ++++++++++++ src/runloop_api_client/types/__init__.py | 1 + .../devbox_snapshot_disk_async_params.py | 16 +++ .../types/devboxes/__init__.py | 1 + .../devbox_snapshot_async_status_view.py | 20 +++ .../devboxes/test_disk_snapshots.py | 79 +++++++++++ tests/api_resources/test_devboxes.py | 94 +++++++++++++ 10 files changed, 425 insertions(+), 5 deletions(-) create mode 100644 src/runloop_api_client/types/devbox_snapshot_disk_async_params.py create mode 100644 src/runloop_api_client/types/devboxes/devbox_snapshot_async_status_view.py diff --git a/.stats.yml b/.stats.yml index 637120fbb..ed111e8b5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 79 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-589e342137de29187fec9e332ae5ca29de64e531f8b92b46b2469fdb3449a721.yml -openapi_spec_hash: 5dbf4fe59153afb4d4c8642e05fcecdc -config_hash: 7cef6c9fce4f9a345184516c6cde462f +configured_endpoints: 81 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-88c3df1881ce3ca780736c14f781e2b1930abb2ceeadb5cdabeda4d67f877511.yml +openapi_spec_hash: e47eece926740aba8272685c342a1d4b +config_hash: e17450cd026f260f68713ad9f12bd999 diff --git a/api.md b/api.md index 8c1b856d0..3cfe5e3b4 100644 --- a/api.md +++ b/api.md @@ -100,6 +100,7 @@ Methods: - client.devboxes.resume(id) -> DevboxView - client.devboxes.shutdown(id) -> DevboxView - client.devboxes.snapshot_disk(id, \*\*params) -> DevboxSnapshotView +- client.devboxes.snapshot_disk_async(id, \*\*params) -> DevboxSnapshotView - client.devboxes.suspend(id) -> DevboxView - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file_contents(id, \*\*params) -> DevboxExecutionDetailView @@ -109,7 +110,10 @@ Methods: Types: ```python -from runloop_api_client.types.devboxes import DiskSnapshotDeleteResponse +from runloop_api_client.types.devboxes import ( + DevboxSnapshotAsyncStatusView, + DiskSnapshotDeleteResponse, +) ``` Methods: @@ -117,6 +121,7 @@ Methods: - client.devboxes.disk_snapshots.update(id, \*\*params) -> DevboxSnapshotView - client.devboxes.disk_snapshots.list(\*\*params) -> SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView] - client.devboxes.disk_snapshots.delete(id) -> object +- client.devboxes.disk_snapshots.query_status(id) -> DevboxSnapshotAsyncStatusView ## Browsers diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 16fd23dc8..755442c54 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -36,6 +36,7 @@ devbox_snapshot_disk_params, devbox_read_file_contents_params, devbox_list_disk_snapshots_params, + devbox_snapshot_disk_async_params, devbox_write_file_contents_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes @@ -1022,6 +1023,61 @@ def snapshot_disk( cast_to=DevboxSnapshotView, ) + def snapshot_disk_async( + self, + id: str, + *, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> DevboxSnapshotView: + """ + Start an asynchronous disk snapshot of a devbox with the specified name and + metadata. The snapshot operation will continue in the background and can be + monitored using the query endpoint. + + Args: + metadata: (Optional) Metadata used to describe the snapshot + + name: (Optional) A user specified name to give the snapshot + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/snapshot_disk_async", + body=maybe_transform( + { + "metadata": metadata, + "name": name, + }, + devbox_snapshot_disk_async_params.DevboxSnapshotDiskAsyncParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=DevboxSnapshotView, + ) + def suspend( self, id: str, @@ -2096,6 +2152,61 @@ async def snapshot_disk( cast_to=DevboxSnapshotView, ) + async def snapshot_disk_async( + self, + id: str, + *, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> DevboxSnapshotView: + """ + Start an asynchronous disk snapshot of a devbox with the specified name and + metadata. The snapshot operation will continue in the background and can be + monitored using the query endpoint. + + Args: + metadata: (Optional) Metadata used to describe the snapshot + + name: (Optional) A user specified name to give the snapshot + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/snapshot_disk_async", + body=await async_maybe_transform( + { + "metadata": metadata, + "name": name, + }, + devbox_snapshot_disk_async_params.DevboxSnapshotDiskAsyncParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=DevboxSnapshotView, + ) + async def suspend( self, id: str, @@ -2312,6 +2423,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.snapshot_disk = to_raw_response_wrapper( devboxes.snapshot_disk, ) + self.snapshot_disk_async = to_raw_response_wrapper( + devboxes.snapshot_disk_async, + ) self.suspend = to_raw_response_wrapper( devboxes.suspend, ) @@ -2403,6 +2517,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.snapshot_disk = async_to_raw_response_wrapper( devboxes.snapshot_disk, ) + self.snapshot_disk_async = async_to_raw_response_wrapper( + devboxes.snapshot_disk_async, + ) self.suspend = async_to_raw_response_wrapper( devboxes.suspend, ) @@ -2494,6 +2611,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.snapshot_disk = to_streamed_response_wrapper( devboxes.snapshot_disk, ) + self.snapshot_disk_async = to_streamed_response_wrapper( + devboxes.snapshot_disk_async, + ) self.suspend = to_streamed_response_wrapper( devboxes.suspend, ) @@ -2585,6 +2705,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.snapshot_disk = async_to_streamed_response_wrapper( devboxes.snapshot_disk, ) + self.snapshot_disk_async = async_to_streamed_response_wrapper( + devboxes.snapshot_disk_async, + ) self.suspend = async_to_streamed_response_wrapper( devboxes.suspend, ) diff --git a/src/runloop_api_client/resources/devboxes/disk_snapshots.py b/src/runloop_api_client/resources/devboxes/disk_snapshots.py index 7b99974e9..3b8b2313e 100644 --- a/src/runloop_api_client/resources/devboxes/disk_snapshots.py +++ b/src/runloop_api_client/resources/devboxes/disk_snapshots.py @@ -20,6 +20,7 @@ from ..._base_client import AsyncPaginator, make_request_options from ...types.devboxes import disk_snapshot_list_params, disk_snapshot_update_params from ...types.devbox_snapshot_view import DevboxSnapshotView +from ...types.devboxes.devbox_snapshot_async_status_view import DevboxSnapshotAsyncStatusView __all__ = ["DiskSnapshotsResource", "AsyncDiskSnapshotsResource"] @@ -200,6 +201,40 @@ def delete( cast_to=object, ) + def query_status( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxSnapshotAsyncStatusView: + """ + Get the current status of an asynchronous disk snapshot operation, including + whether it is still in progress and any error messages if it failed. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/disk_snapshots/{id}/status", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxSnapshotAsyncStatusView, + ) + class AsyncDiskSnapshotsResource(AsyncAPIResource): @cached_property @@ -377,6 +412,40 @@ async def delete( cast_to=object, ) + async def query_status( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> DevboxSnapshotAsyncStatusView: + """ + Get the current status of an asynchronous disk snapshot operation, including + whether it is still in progress and any error messages if it failed. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/disk_snapshots/{id}/status", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxSnapshotAsyncStatusView, + ) + class DiskSnapshotsResourceWithRawResponse: def __init__(self, disk_snapshots: DiskSnapshotsResource) -> None: @@ -391,6 +460,9 @@ def __init__(self, disk_snapshots: DiskSnapshotsResource) -> None: self.delete = to_raw_response_wrapper( disk_snapshots.delete, ) + self.query_status = to_raw_response_wrapper( + disk_snapshots.query_status, + ) class AsyncDiskSnapshotsResourceWithRawResponse: @@ -406,6 +478,9 @@ def __init__(self, disk_snapshots: AsyncDiskSnapshotsResource) -> None: self.delete = async_to_raw_response_wrapper( disk_snapshots.delete, ) + self.query_status = async_to_raw_response_wrapper( + disk_snapshots.query_status, + ) class DiskSnapshotsResourceWithStreamingResponse: @@ -421,6 +496,9 @@ def __init__(self, disk_snapshots: DiskSnapshotsResource) -> None: self.delete = to_streamed_response_wrapper( disk_snapshots.delete, ) + self.query_status = to_streamed_response_wrapper( + disk_snapshots.query_status, + ) class AsyncDiskSnapshotsResourceWithStreamingResponse: @@ -436,3 +514,6 @@ def __init__(self, disk_snapshots: AsyncDiskSnapshotsResource) -> None: self.delete = async_to_streamed_response_wrapper( disk_snapshots.delete, ) + self.query_status = async_to_streamed_response_wrapper( + disk_snapshots.query_status, + ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index f3dbc61d9..a0205effb 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -66,6 +66,7 @@ from .repository_connection_list_view import RepositoryConnectionListView as RepositoryConnectionListView from .devbox_read_file_contents_params import DevboxReadFileContentsParams as DevboxReadFileContentsParams from .devbox_list_disk_snapshots_params import DevboxListDiskSnapshotsParams as DevboxListDiskSnapshotsParams +from .devbox_snapshot_disk_async_params import DevboxSnapshotDiskAsyncParams as DevboxSnapshotDiskAsyncParams from .devbox_write_file_contents_params import DevboxWriteFileContentsParams as DevboxWriteFileContentsParams from .devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView as DevboxAsyncExecutionDetailView from .devbox_read_file_contents_response import DevboxReadFileContentsResponse as DevboxReadFileContentsResponse diff --git a/src/runloop_api_client/types/devbox_snapshot_disk_async_params.py b/src/runloop_api_client/types/devbox_snapshot_disk_async_params.py new file mode 100644 index 000000000..eda38c53b --- /dev/null +++ b/src/runloop_api_client/types/devbox_snapshot_disk_async_params.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Optional +from typing_extensions import TypedDict + +__all__ = ["DevboxSnapshotDiskAsyncParams"] + + +class DevboxSnapshotDiskAsyncParams(TypedDict, total=False): + metadata: Optional[Dict[str, str]] + """(Optional) Metadata used to describe the snapshot""" + + name: Optional[str] + """(Optional) A user specified name to give the snapshot""" diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index ebfdc7800..2d5c61a93 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -78,6 +78,7 @@ from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse from .computer_mouse_interaction_params import ComputerMouseInteractionParams as ComputerMouseInteractionParams +from .devbox_snapshot_async_status_view import DevboxSnapshotAsyncStatusView as DevboxSnapshotAsyncStatusView from .computer_screen_interaction_params import ComputerScreenInteractionParams as ComputerScreenInteractionParams from .computer_mouse_interaction_response import ComputerMouseInteractionResponse as ComputerMouseInteractionResponse from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam diff --git a/src/runloop_api_client/types/devboxes/devbox_snapshot_async_status_view.py b/src/runloop_api_client/types/devboxes/devbox_snapshot_async_status_view.py new file mode 100644 index 000000000..2c7ea8eee --- /dev/null +++ b/src/runloop_api_client/types/devboxes/devbox_snapshot_async_status_view.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel +from ..devbox_snapshot_view import DevboxSnapshotView + +__all__ = ["DevboxSnapshotAsyncStatusView"] + + +class DevboxSnapshotAsyncStatusView(BaseModel): + status: Literal["in_progress", "error", "complete"] + """The current status of the snapshot operation.""" + + error_message: Optional[str] = None + """Error message if the operation failed.""" + + snapshot: Optional[DevboxSnapshotView] = None + """The snapshot details if the operation completed successfully.""" diff --git a/tests/api_resources/devboxes/test_disk_snapshots.py b/tests/api_resources/devboxes/test_disk_snapshots.py index c7708f348..aff385ef0 100644 --- a/tests/api_resources/devboxes/test_disk_snapshots.py +++ b/tests/api_resources/devboxes/test_disk_snapshots.py @@ -11,6 +11,9 @@ from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types import DevboxSnapshotView from runloop_api_client.pagination import SyncDiskSnapshotsCursorIDPage, AsyncDiskSnapshotsCursorIDPage +from runloop_api_client.types.devboxes import ( + DevboxSnapshotAsyncStatusView, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -139,6 +142,44 @@ def test_path_params_delete(self, client: Runloop) -> None: "", ) + @parametrize + def test_method_query_status(self, client: Runloop) -> None: + disk_snapshot = client.devboxes.disk_snapshots.query_status( + "id", + ) + assert_matches_type(DevboxSnapshotAsyncStatusView, disk_snapshot, path=["response"]) + + @parametrize + def test_raw_response_query_status(self, client: Runloop) -> None: + response = client.devboxes.disk_snapshots.with_raw_response.query_status( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + disk_snapshot = response.parse() + assert_matches_type(DevboxSnapshotAsyncStatusView, disk_snapshot, path=["response"]) + + @parametrize + def test_streaming_response_query_status(self, client: Runloop) -> None: + with client.devboxes.disk_snapshots.with_streaming_response.query_status( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + disk_snapshot = response.parse() + assert_matches_type(DevboxSnapshotAsyncStatusView, disk_snapshot, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_query_status(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.disk_snapshots.with_raw_response.query_status( + "", + ) + class TestAsyncDiskSnapshots: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -263,3 +304,41 @@ async def test_path_params_delete(self, async_client: AsyncRunloop) -> None: await async_client.devboxes.disk_snapshots.with_raw_response.delete( "", ) + + @parametrize + async def test_method_query_status(self, async_client: AsyncRunloop) -> None: + disk_snapshot = await async_client.devboxes.disk_snapshots.query_status( + "id", + ) + assert_matches_type(DevboxSnapshotAsyncStatusView, disk_snapshot, path=["response"]) + + @parametrize + async def test_raw_response_query_status(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.disk_snapshots.with_raw_response.query_status( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + disk_snapshot = await response.parse() + assert_matches_type(DevboxSnapshotAsyncStatusView, disk_snapshot, path=["response"]) + + @parametrize + async def test_streaming_response_query_status(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.disk_snapshots.with_streaming_response.query_status( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + disk_snapshot = await response.parse() + assert_matches_type(DevboxSnapshotAsyncStatusView, disk_snapshot, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_query_status(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.disk_snapshots.with_raw_response.query_status( + "", + ) diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index d27e04f01..3d4983fc0 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -781,6 +781,53 @@ def test_path_params_snapshot_disk(self, client: Runloop) -> None: id="", ) + @parametrize + def test_method_snapshot_disk_async(self, client: Runloop) -> None: + devbox = client.devboxes.snapshot_disk_async( + id="id", + ) + assert_matches_type(DevboxSnapshotView, devbox, path=["response"]) + + @parametrize + def test_method_snapshot_disk_async_with_all_params(self, client: Runloop) -> None: + devbox = client.devboxes.snapshot_disk_async( + id="id", + metadata={"foo": "string"}, + name="name", + ) + assert_matches_type(DevboxSnapshotView, devbox, path=["response"]) + + @parametrize + def test_raw_response_snapshot_disk_async(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.snapshot_disk_async( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(DevboxSnapshotView, devbox, path=["response"]) + + @parametrize + def test_streaming_response_snapshot_disk_async(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.snapshot_disk_async( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(DevboxSnapshotView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_snapshot_disk_async(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.snapshot_disk_async( + id="", + ) + @parametrize def test_method_suspend(self, client: Runloop) -> None: devbox = client.devboxes.suspend( @@ -1663,6 +1710,53 @@ async def test_path_params_snapshot_disk(self, async_client: AsyncRunloop) -> No id="", ) + @parametrize + async def test_method_snapshot_disk_async(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.snapshot_disk_async( + id="id", + ) + assert_matches_type(DevboxSnapshotView, devbox, path=["response"]) + + @parametrize + async def test_method_snapshot_disk_async_with_all_params(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.snapshot_disk_async( + id="id", + metadata={"foo": "string"}, + name="name", + ) + assert_matches_type(DevboxSnapshotView, devbox, path=["response"]) + + @parametrize + async def test_raw_response_snapshot_disk_async(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.snapshot_disk_async( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(DevboxSnapshotView, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_snapshot_disk_async(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.snapshot_disk_async( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(DevboxSnapshotView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_snapshot_disk_async(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.snapshot_disk_async( + id="", + ) + @parametrize async def test_method_suspend(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.suspend( From 5c5bce9038bca24ba7ecdd64ef16d556587948f1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 27 May 2025 21:42:00 +0000 Subject: [PATCH 739/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 57dc0c3da..e4e1c3ce9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.33.0" + ".": "0.34.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 7b17becbb..b101d7b20 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.33.0" +version = "0.34.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index fc69d63b8..a584e44ab 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.33.0" # x-release-please-version +__version__ = "0.34.0" # x-release-please-version From 54bc608e226738e8cf0339bdcba590d6797add61 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 03:33:59 +0000 Subject: [PATCH 740/993] fix(docs/api): remove references to nonexistent types --- api.md | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/api.md b/api.md index 3cfe5e3b4..ae70d24ec 100644 --- a/api.md +++ b/api.md @@ -46,7 +46,6 @@ from runloop_api_client.types import ( BlueprintListView, BlueprintPreviewView, BlueprintView, - BlueprintDeleteResponse, ) ``` @@ -55,7 +54,7 @@ Methods: - client.blueprints.create(\*\*params) -> BlueprintView - client.blueprints.retrieve(id) -> BlueprintView - client.blueprints.list(\*\*params) -> SyncBlueprintsCursorIDPage[BlueprintView] -- client.blueprints.delete(id) -> object +- client.blueprints.delete(id) -> object - client.blueprints.logs(id) -> BlueprintBuildLogsListView - client.blueprints.preview(\*\*params) -> BlueprintPreviewView @@ -73,11 +72,7 @@ from runloop_api_client.types import ( DevboxTunnelView, DevboxView, DevboxCreateSSHKeyResponse, - DevboxDeleteDiskSnapshotResponse, - DevboxKeepAliveResponse, DevboxReadFileContentsResponse, - DevboxRemoveTunnelResponse, - DevboxUploadFileResponse, ) ``` @@ -89,20 +84,20 @@ Methods: - client.devboxes.list(\*\*params) -> SyncDevboxesCursorIDPage[DevboxView] - client.devboxes.create_ssh_key(id) -> DevboxCreateSSHKeyResponse - client.devboxes.create_tunnel(id, \*\*params) -> DevboxTunnelView -- client.devboxes.delete_disk_snapshot(id) -> object +- client.devboxes.delete_disk_snapshot(id) -> object - client.devboxes.download_file(id, \*\*params) -> BinaryAPIResponse - client.devboxes.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView -- client.devboxes.keep_alive(id) -> object +- client.devboxes.keep_alive(id) -> object - client.devboxes.list_disk_snapshots(\*\*params) -> SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView] - client.devboxes.read_file_contents(id, \*\*params) -> str -- client.devboxes.remove_tunnel(id, \*\*params) -> object +- client.devboxes.remove_tunnel(id, \*\*params) -> object - client.devboxes.resume(id) -> DevboxView - client.devboxes.shutdown(id) -> DevboxView - client.devboxes.snapshot_disk(id, \*\*params) -> DevboxSnapshotView - client.devboxes.snapshot_disk_async(id, \*\*params) -> DevboxSnapshotView - client.devboxes.suspend(id) -> DevboxView -- client.devboxes.upload_file(id, \*\*params) -> object +- client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.write_file_contents(id, \*\*params) -> DevboxExecutionDetailView ## DiskSnapshots @@ -110,17 +105,14 @@ Methods: Types: ```python -from runloop_api_client.types.devboxes import ( - DevboxSnapshotAsyncStatusView, - DiskSnapshotDeleteResponse, -) +from runloop_api_client.types.devboxes import DevboxSnapshotAsyncStatusView ``` Methods: - client.devboxes.disk_snapshots.update(id, \*\*params) -> DevboxSnapshotView - client.devboxes.disk_snapshots.list(\*\*params) -> SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView] -- client.devboxes.disk_snapshots.delete(id) -> object +- client.devboxes.disk_snapshots.delete(id) -> object - client.devboxes.disk_snapshots.query_status(id) -> DevboxSnapshotAsyncStatusView ## Browsers @@ -330,7 +322,6 @@ from runloop_api_client.types import ( RepositoryConnectionView, RepositoryVersionDetails, RepositoryVersionListView, - RepositoryDeleteResponse, ) ``` @@ -339,5 +330,5 @@ Methods: - client.repositories.create(\*\*params) -> RepositoryConnectionView - client.repositories.retrieve(id) -> RepositoryConnectionView - client.repositories.list(\*\*params) -> SyncRepositoriesCursorIDPage[RepositoryConnectionView] -- client.repositories.delete(id) -> object +- client.repositories.delete(id) -> object - client.repositories.versions(id) -> RepositoryVersionListView From 964994db4be0afe5d0c9fe662c440285f86f9cbc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 May 2025 18:41:05 +0000 Subject: [PATCH 741/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e4e1c3ce9..1d52ad841 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.34.0" + ".": "0.34.1" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index b101d7b20..393834923 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.34.0" +version = "0.34.1" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index a584e44ab..d1eb93af3 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.34.0" # x-release-please-version +__version__ = "0.34.1" # x-release-please-version From ca96ae788176227f61e1fc4edae95dfed3752db7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 May 2025 18:42:31 +0000 Subject: [PATCH 742/993] feat(api): api update --- .stats.yml | 8 +- api.md | 3 + .../resources/benchmarks/benchmarks.py | 135 ++++++++++++++++++ .../resources/benchmarks/runs.py | 92 ++++++++++++ .../resources/scenarios/runs.py | 96 +++++++++++++ src/runloop_api_client/types/__init__.py | 1 + .../types/benchmark_run_view.py | 4 +- .../types/benchmark_update_params.py | 22 +++ tests/api_resources/benchmarks/test_runs.py | 76 ++++++++++ tests/api_resources/scenarios/test_runs.py | 76 ++++++++++ tests/api_resources/test_benchmarks.py | 114 +++++++++++++++ 11 files changed, 621 insertions(+), 6 deletions(-) create mode 100644 src/runloop_api_client/types/benchmark_update_params.py diff --git a/.stats.yml b/.stats.yml index ed111e8b5..46caeac12 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 81 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-88c3df1881ce3ca780736c14f781e2b1930abb2ceeadb5cdabeda4d67f877511.yml -openapi_spec_hash: e47eece926740aba8272685c342a1d4b -config_hash: e17450cd026f260f68713ad9f12bd999 +configured_endpoints: 84 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-da7ec5b4cc55e7316bc3de6a9c0a37f5ee3057d3d68fdda9cb570d1a1fee57ea.yml +openapi_spec_hash: 5b89a8e3c67c4816dfab9a87fd67247d +config_hash: 8c014837a658512c2e23c002bb0f2ab1 diff --git a/api.md b/api.md index ae70d24ec..7014986f6 100644 --- a/api.md +++ b/api.md @@ -22,6 +22,7 @@ Methods: - client.benchmarks.create(\*\*params) -> BenchmarkView - client.benchmarks.retrieve(id) -> BenchmarkView +- client.benchmarks.update(id, \*\*params) -> BenchmarkView - client.benchmarks.list(\*\*params) -> SyncBenchmarksCursorIDPage[BenchmarkView] - client.benchmarks.list_public(\*\*params) -> SyncBenchmarksCursorIDPage[BenchmarkView] - client.benchmarks.start_run(\*\*params) -> BenchmarkRunView @@ -32,6 +33,7 @@ Methods: - client.benchmarks.runs.retrieve(id) -> BenchmarkRunView - client.benchmarks.runs.list(\*\*params) -> SyncBenchmarkRunsCursorIDPage[BenchmarkRunView] +- client.benchmarks.runs.cancel(id) -> BenchmarkRunView - client.benchmarks.runs.complete(id) -> BenchmarkRunView # Blueprints @@ -287,6 +289,7 @@ Methods: - client.scenarios.runs.retrieve(id) -> ScenarioRunView - client.scenarios.runs.list(\*\*params) -> SyncBenchmarkRunsCursorIDPage[ScenarioRunView] +- client.scenarios.runs.cancel(id) -> ScenarioRunView - client.scenarios.runs.complete(id) -> ScenarioRunView - client.scenarios.runs.score(id) -> ScenarioRunView diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py index 0c77ce342..fdbb65b22 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -17,6 +17,7 @@ from ...types import ( benchmark_list_params, benchmark_create_params, + benchmark_update_params, benchmark_start_run_params, benchmark_list_public_params, ) @@ -153,6 +154,67 @@ def retrieve( cast_to=BenchmarkView, ) + def update( + self, + id: str, + *, + is_public: bool, + name: str, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> BenchmarkView: + """ + Update a Benchmark with a set of Scenarios. + + Args: + is_public: Whether this benchmark is public. + + name: The name of the Benchmark. This must be unique. + + metadata: User defined metadata to attach to the benchmark for organization. + + scenario_ids: The Scenario IDs that make up the Benchmark. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/benchmarks/{id}", + body=maybe_transform( + { + "is_public": is_public, + "name": name, + "metadata": metadata, + "scenario_ids": scenario_ids, + }, + benchmark_update_params.BenchmarkUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BenchmarkView, + ) + def list( self, *, @@ -417,6 +479,67 @@ async def retrieve( cast_to=BenchmarkView, ) + async def update( + self, + id: str, + *, + is_public: bool, + name: str, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> BenchmarkView: + """ + Update a Benchmark with a set of Scenarios. + + Args: + is_public: Whether this benchmark is public. + + name: The name of the Benchmark. This must be unique. + + metadata: User defined metadata to attach to the benchmark for organization. + + scenario_ids: The Scenario IDs that make up the Benchmark. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/benchmarks/{id}", + body=await async_maybe_transform( + { + "is_public": is_public, + "name": name, + "metadata": metadata, + "scenario_ids": scenario_ids, + }, + benchmark_update_params.BenchmarkUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BenchmarkView, + ) + def list( self, *, @@ -576,6 +699,9 @@ def __init__(self, benchmarks: BenchmarksResource) -> None: self.retrieve = to_raw_response_wrapper( benchmarks.retrieve, ) + self.update = to_raw_response_wrapper( + benchmarks.update, + ) self.list = to_raw_response_wrapper( benchmarks.list, ) @@ -601,6 +727,9 @@ def __init__(self, benchmarks: AsyncBenchmarksResource) -> None: self.retrieve = async_to_raw_response_wrapper( benchmarks.retrieve, ) + self.update = async_to_raw_response_wrapper( + benchmarks.update, + ) self.list = async_to_raw_response_wrapper( benchmarks.list, ) @@ -626,6 +755,9 @@ def __init__(self, benchmarks: BenchmarksResource) -> None: self.retrieve = to_streamed_response_wrapper( benchmarks.retrieve, ) + self.update = to_streamed_response_wrapper( + benchmarks.update, + ) self.list = to_streamed_response_wrapper( benchmarks.list, ) @@ -651,6 +783,9 @@ def __init__(self, benchmarks: AsyncBenchmarksResource) -> None: self.retrieve = async_to_streamed_response_wrapper( benchmarks.retrieve, ) + self.update = async_to_streamed_response_wrapper( + benchmarks.update, + ) self.list = async_to_streamed_response_wrapper( benchmarks.list, ) diff --git a/src/runloop_api_client/resources/benchmarks/runs.py b/src/runloop_api_client/resources/benchmarks/runs.py index 7f84c5da5..ef6022d19 100644 --- a/src/runloop_api_client/resources/benchmarks/runs.py +++ b/src/runloop_api_client/resources/benchmarks/runs.py @@ -126,6 +126,46 @@ def list( model=BenchmarkRunView, ) + def cancel( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> BenchmarkRunView: + """ + Cancel a currently running Benchmark run. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/benchmarks/runs/{id}/cancel", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BenchmarkRunView, + ) + def complete( self, id: str, @@ -271,6 +311,46 @@ def list( model=BenchmarkRunView, ) + async def cancel( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> BenchmarkRunView: + """ + Cancel a currently running Benchmark run. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/benchmarks/runs/{id}/cancel", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BenchmarkRunView, + ) + async def complete( self, id: str, @@ -322,6 +402,9 @@ def __init__(self, runs: RunsResource) -> None: self.list = to_raw_response_wrapper( runs.list, ) + self.cancel = to_raw_response_wrapper( + runs.cancel, + ) self.complete = to_raw_response_wrapper( runs.complete, ) @@ -337,6 +420,9 @@ def __init__(self, runs: AsyncRunsResource) -> None: self.list = async_to_raw_response_wrapper( runs.list, ) + self.cancel = async_to_raw_response_wrapper( + runs.cancel, + ) self.complete = async_to_raw_response_wrapper( runs.complete, ) @@ -352,6 +438,9 @@ def __init__(self, runs: RunsResource) -> None: self.list = to_streamed_response_wrapper( runs.list, ) + self.cancel = to_streamed_response_wrapper( + runs.cancel, + ) self.complete = to_streamed_response_wrapper( runs.complete, ) @@ -367,6 +456,9 @@ def __init__(self, runs: AsyncRunsResource) -> None: self.list = async_to_streamed_response_wrapper( runs.list, ) + self.cancel = async_to_streamed_response_wrapper( + runs.cancel, + ) self.complete = async_to_streamed_response_wrapper( runs.complete, ) diff --git a/src/runloop_api_client/resources/scenarios/runs.py b/src/runloop_api_client/resources/scenarios/runs.py index d140ecdb1..2c0dcd4e6 100644 --- a/src/runloop_api_client/resources/scenarios/runs.py +++ b/src/runloop_api_client/resources/scenarios/runs.py @@ -126,6 +126,48 @@ def list( model=ScenarioRunView, ) + def cancel( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ScenarioRunView: + """Cancel a currently running Scenario run. + + This will shutdown the underlying + Devbox resource. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/scenarios/runs/{id}/cancel", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ScenarioRunView, + ) + def complete( self, id: str, @@ -313,6 +355,48 @@ def list( model=ScenarioRunView, ) + async def cancel( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ScenarioRunView: + """Cancel a currently running Scenario run. + + This will shutdown the underlying + Devbox resource. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/scenarios/runs/{id}/cancel", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ScenarioRunView, + ) + async def complete( self, id: str, @@ -406,6 +490,9 @@ def __init__(self, runs: RunsResource) -> None: self.list = to_raw_response_wrapper( runs.list, ) + self.cancel = to_raw_response_wrapper( + runs.cancel, + ) self.complete = to_raw_response_wrapper( runs.complete, ) @@ -424,6 +511,9 @@ def __init__(self, runs: AsyncRunsResource) -> None: self.list = async_to_raw_response_wrapper( runs.list, ) + self.cancel = async_to_raw_response_wrapper( + runs.cancel, + ) self.complete = async_to_raw_response_wrapper( runs.complete, ) @@ -442,6 +532,9 @@ def __init__(self, runs: RunsResource) -> None: self.list = to_streamed_response_wrapper( runs.list, ) + self.cancel = to_streamed_response_wrapper( + runs.cancel, + ) self.complete = to_streamed_response_wrapper( runs.complete, ) @@ -460,6 +553,9 @@ def __init__(self, runs: AsyncRunsResource) -> None: self.list = async_to_streamed_response_wrapper( runs.list, ) + self.cancel = async_to_streamed_response_wrapper( + runs.cancel, + ) self.complete = async_to_streamed_response_wrapper( runs.complete, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index a0205effb..8e29c98ef 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -38,6 +38,7 @@ from .scoring_function_param import ScoringFunctionParam as ScoringFunctionParam from .benchmark_create_params import BenchmarkCreateParams as BenchmarkCreateParams from .benchmark_run_list_view import BenchmarkRunListView as BenchmarkRunListView +from .benchmark_update_params import BenchmarkUpdateParams as BenchmarkUpdateParams from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams from .repository_create_params import RepositoryCreateParams as RepositoryCreateParams diff --git a/src/runloop_api_client/types/benchmark_run_view.py b/src/runloop_api_client/types/benchmark_run_view.py index 9239985aa..0f88d045b 100644 --- a/src/runloop_api_client/types/benchmark_run_view.py +++ b/src/runloop_api_client/types/benchmark_run_view.py @@ -33,7 +33,7 @@ class BenchmarkRunView(BaseModel): """User defined metadata to attach to the benchmark run for organization.""" pending_scenarios: List[str] - """List of Scenarios that need to be completed before benchmark can be completed.""" + """List of Scenarios that have yet to be scored.""" scenario_runs: List[ScenarioRun] """List of Scenarios have been completed.""" @@ -41,7 +41,7 @@ class BenchmarkRunView(BaseModel): start_time_ms: int """The time the benchmark run execution started (Unix timestamp milliseconds).""" - state: Literal["running", "completed"] + state: Literal["running", "canceled", "completed"] """The state of the BenchmarkRun.""" duration_ms: Optional[int] = None diff --git a/src/runloop_api_client/types/benchmark_update_params.py b/src/runloop_api_client/types/benchmark_update_params.py new file mode 100644 index 000000000..a00a379e0 --- /dev/null +++ b/src/runloop_api_client/types/benchmark_update_params.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, List, Optional +from typing_extensions import Required, TypedDict + +__all__ = ["BenchmarkUpdateParams"] + + +class BenchmarkUpdateParams(TypedDict, total=False): + is_public: Required[bool] + """Whether this benchmark is public.""" + + name: Required[str] + """The name of the Benchmark. This must be unique.""" + + metadata: Optional[Dict[str, str]] + """User defined metadata to attach to the benchmark for organization.""" + + scenario_ids: Optional[List[str]] + """The Scenario IDs that make up the Benchmark.""" diff --git a/tests/api_resources/benchmarks/test_runs.py b/tests/api_resources/benchmarks/test_runs.py index e6acbebad..d23aa33b7 100644 --- a/tests/api_resources/benchmarks/test_runs.py +++ b/tests/api_resources/benchmarks/test_runs.py @@ -90,6 +90,44 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_cancel(self, client: Runloop) -> None: + run = client.benchmarks.runs.cancel( + "id", + ) + assert_matches_type(BenchmarkRunView, run, path=["response"]) + + @parametrize + def test_raw_response_cancel(self, client: Runloop) -> None: + response = client.benchmarks.runs.with_raw_response.cancel( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + run = response.parse() + assert_matches_type(BenchmarkRunView, run, path=["response"]) + + @parametrize + def test_streaming_response_cancel(self, client: Runloop) -> None: + with client.benchmarks.runs.with_streaming_response.cancel( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + run = response.parse() + assert_matches_type(BenchmarkRunView, run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_cancel(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.benchmarks.runs.with_raw_response.cancel( + "", + ) + @parametrize def test_method_complete(self, client: Runloop) -> None: run = client.benchmarks.runs.complete( @@ -204,6 +242,44 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_cancel(self, async_client: AsyncRunloop) -> None: + run = await async_client.benchmarks.runs.cancel( + "id", + ) + assert_matches_type(BenchmarkRunView, run, path=["response"]) + + @parametrize + async def test_raw_response_cancel(self, async_client: AsyncRunloop) -> None: + response = await async_client.benchmarks.runs.with_raw_response.cancel( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + run = await response.parse() + assert_matches_type(BenchmarkRunView, run, path=["response"]) + + @parametrize + async def test_streaming_response_cancel(self, async_client: AsyncRunloop) -> None: + async with async_client.benchmarks.runs.with_streaming_response.cancel( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + run = await response.parse() + assert_matches_type(BenchmarkRunView, run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_cancel(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.benchmarks.runs.with_raw_response.cancel( + "", + ) + @parametrize async def test_method_complete(self, async_client: AsyncRunloop) -> None: run = await async_client.benchmarks.runs.complete( diff --git a/tests/api_resources/scenarios/test_runs.py b/tests/api_resources/scenarios/test_runs.py index 35b2e5141..de0adca5f 100644 --- a/tests/api_resources/scenarios/test_runs.py +++ b/tests/api_resources/scenarios/test_runs.py @@ -90,6 +90,44 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_cancel(self, client: Runloop) -> None: + run = client.scenarios.runs.cancel( + "id", + ) + assert_matches_type(ScenarioRunView, run, path=["response"]) + + @parametrize + def test_raw_response_cancel(self, client: Runloop) -> None: + response = client.scenarios.runs.with_raw_response.cancel( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + run = response.parse() + assert_matches_type(ScenarioRunView, run, path=["response"]) + + @parametrize + def test_streaming_response_cancel(self, client: Runloop) -> None: + with client.scenarios.runs.with_streaming_response.cancel( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + run = response.parse() + assert_matches_type(ScenarioRunView, run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_cancel(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.scenarios.runs.with_raw_response.cancel( + "", + ) + @parametrize def test_method_complete(self, client: Runloop) -> None: run = client.scenarios.runs.complete( @@ -242,6 +280,44 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_cancel(self, async_client: AsyncRunloop) -> None: + run = await async_client.scenarios.runs.cancel( + "id", + ) + assert_matches_type(ScenarioRunView, run, path=["response"]) + + @parametrize + async def test_raw_response_cancel(self, async_client: AsyncRunloop) -> None: + response = await async_client.scenarios.runs.with_raw_response.cancel( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + run = await response.parse() + assert_matches_type(ScenarioRunView, run, path=["response"]) + + @parametrize + async def test_streaming_response_cancel(self, async_client: AsyncRunloop) -> None: + async with async_client.scenarios.runs.with_streaming_response.cancel( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + run = await response.parse() + assert_matches_type(ScenarioRunView, run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_cancel(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.scenarios.runs.with_raw_response.cancel( + "", + ) + @parametrize async def test_method_complete(self, async_client: AsyncRunloop) -> None: run = await async_client.scenarios.runs.complete( diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py index 19a93ad89..0d70ef3c8 100644 --- a/tests/api_resources/test_benchmarks.py +++ b/tests/api_resources/test_benchmarks.py @@ -103,6 +103,63 @@ def test_path_params_retrieve(self, client: Runloop) -> None: "", ) + @parametrize + def test_method_update(self, client: Runloop) -> None: + benchmark = client.benchmarks.update( + id="id", + is_public=True, + name="name", + ) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Runloop) -> None: + benchmark = client.benchmarks.update( + id="id", + is_public=True, + name="name", + metadata={"foo": "string"}, + scenario_ids=["string"], + ) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Runloop) -> None: + response = client.benchmarks.with_raw_response.update( + id="id", + is_public=True, + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark = response.parse() + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Runloop) -> None: + with client.benchmarks.with_streaming_response.update( + id="id", + is_public=True, + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark = response.parse() + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.benchmarks.with_raw_response.update( + id="", + is_public=True, + name="name", + ) + @parametrize def test_method_list(self, client: Runloop) -> None: benchmark = client.benchmarks.list() @@ -295,6 +352,63 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: "", ) + @parametrize + async def test_method_update(self, async_client: AsyncRunloop) -> None: + benchmark = await async_client.benchmarks.update( + id="id", + is_public=True, + name="name", + ) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncRunloop) -> None: + benchmark = await async_client.benchmarks.update( + id="id", + is_public=True, + name="name", + metadata={"foo": "string"}, + scenario_ids=["string"], + ) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: + response = await async_client.benchmarks.with_raw_response.update( + id="id", + is_public=True, + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark = await response.parse() + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncRunloop) -> None: + async with async_client.benchmarks.with_streaming_response.update( + id="id", + is_public=True, + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark = await response.parse() + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.benchmarks.with_raw_response.update( + id="", + is_public=True, + name="name", + ) + @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.list() From f1b8ac00a2a6b041c5989b12fe200a51c1806eda Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 May 2025 18:44:23 +0000 Subject: [PATCH 743/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1d52ad841..ce5e5c7c5 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.34.1" + ".": "0.35.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 393834923..6338f7f73 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.34.1" +version = "0.35.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index d1eb93af3..64c7ee59c 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.34.1" # x-release-please-version +__version__ = "0.35.0" # x-release-please-version From 1a74d08681347a8816a689e62e39348e9821ae98 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 2 Jun 2025 18:35:27 +0000 Subject: [PATCH 744/993] feat(api): api update --- .stats.yml | 8 +- api.md | 8 +- .../resources/devboxes/devboxes.py | 8 + .../resources/repositories.py | 144 +++++++++++++++--- src/runloop_api_client/types/__init__.py | 5 +- .../types/devbox_create_params.py | 20 ++- .../types/repository_connection_view.py | 9 -- .../types/repository_create_params.py | 3 + .../types/repository_inspection_details.py | 39 +++++ .../types/repository_inspection_list_view.py | 13 ++ .../types/repository_manifest_view.py | 91 +++++++++++ .../types/repository_version_details.py | 44 ------ .../types/repository_version_list_view.py | 13 -- tests/api_resources/test_devboxes.py | 8 + tests/api_resources/test_repositories.py | 124 ++++++++++++--- 15 files changed, 417 insertions(+), 120 deletions(-) create mode 100644 src/runloop_api_client/types/repository_inspection_details.py create mode 100644 src/runloop_api_client/types/repository_inspection_list_view.py create mode 100644 src/runloop_api_client/types/repository_manifest_view.py delete mode 100644 src/runloop_api_client/types/repository_version_details.py delete mode 100644 src/runloop_api_client/types/repository_version_list_view.py diff --git a/.stats.yml b/.stats.yml index 46caeac12..5a58d5b1e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 84 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-da7ec5b4cc55e7316bc3de6a9c0a37f5ee3057d3d68fdda9cb570d1a1fee57ea.yml -openapi_spec_hash: 5b89a8e3c67c4816dfab9a87fd67247d -config_hash: 8c014837a658512c2e23c002bb0f2ab1 +configured_endpoints: 85 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3484df665f4c2b7cb17ad044b825223fc69ad67b05d967fbb6dfbb6a6ac9ccac.yml +openapi_spec_hash: 58c0860078f5f26c8b517603956700b5 +config_hash: c03c6a4c057a38e2809a102c48fafe6c diff --git a/api.md b/api.md index 7014986f6..367aa7f0d 100644 --- a/api.md +++ b/api.md @@ -323,8 +323,9 @@ Types: from runloop_api_client.types import ( RepositoryConnectionListView, RepositoryConnectionView, - RepositoryVersionDetails, - RepositoryVersionListView, + RepositoryInspectionDetails, + RepositoryInspectionListView, + RepositoryManifestView, ) ``` @@ -334,4 +335,5 @@ Methods: - client.repositories.retrieve(id) -> RepositoryConnectionView - client.repositories.list(\*\*params) -> SyncRepositoriesCursorIDPage[RepositoryConnectionView] - client.repositories.delete(id) -> object -- client.repositories.versions(id) -> RepositoryVersionListView +- client.repositories.list_inspections(id) -> RepositoryInspectionListView +- client.repositories.refresh(id) -> object diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 755442c54..d97e4564c 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -166,6 +166,7 @@ def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, prebuilt: Optional[str] | NotGiven = NOT_GIVEN, + repository_connection: Optional[devbox_create_params.RepositoryConnection] | NotGiven = NOT_GIVEN, snapshot_id: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -211,6 +212,8 @@ def create( prebuilt: Reference to prebuilt Blueprint to create the Devbox from. Should not be used together with (Snapshot ID, Blueprint ID, or Blueprint name). + repository_connection: Repository connection parameters for configuring repository integration. + snapshot_id: Snapshot ID to use for the Devbox. Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified. @@ -238,6 +241,7 @@ def create( "metadata": metadata, "name": name, "prebuilt": prebuilt, + "repository_connection": repository_connection, "snapshot_id": snapshot_id, }, devbox_create_params.DevboxCreateParams, @@ -1295,6 +1299,7 @@ async def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, prebuilt: Optional[str] | NotGiven = NOT_GIVEN, + repository_connection: Optional[devbox_create_params.RepositoryConnection] | NotGiven = NOT_GIVEN, snapshot_id: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1340,6 +1345,8 @@ async def create( prebuilt: Reference to prebuilt Blueprint to create the Devbox from. Should not be used together with (Snapshot ID, Blueprint ID, or Blueprint name). + repository_connection: Repository connection parameters for configuring repository integration. + snapshot_id: Snapshot ID to use for the Devbox. Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified. @@ -1367,6 +1374,7 @@ async def create( "metadata": metadata, "name": name, "prebuilt": prebuilt, + "repository_connection": repository_connection, "snapshot_id": snapshot_id, }, devbox_create_params.DevboxCreateParams, diff --git a/src/runloop_api_client/resources/repositories.py b/src/runloop_api_client/resources/repositories.py index 5bde8f618..909e05e7b 100644 --- a/src/runloop_api_client/resources/repositories.py +++ b/src/runloop_api_client/resources/repositories.py @@ -20,7 +20,7 @@ from ..pagination import SyncRepositoriesCursorIDPage, AsyncRepositoriesCursorIDPage from .._base_client import AsyncPaginator, make_request_options from ..types.repository_connection_view import RepositoryConnectionView -from ..types.repository_version_list_view import RepositoryVersionListView +from ..types.repository_inspection_list_view import RepositoryInspectionListView __all__ = ["RepositoriesResource", "AsyncRepositoriesResource"] @@ -51,6 +51,7 @@ def create( name: str, owner: str, blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, + github_auth_token: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -70,6 +71,8 @@ def create( blueprint_id: ID of blueprint to use as base for resulting RepositoryVersion blueprint. + github_auth_token: GitHub authentication token for accessing private repositories. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -87,6 +90,7 @@ def create( "name": name, "owner": owner, "blueprint_id": blueprint_id, + "github_auth_token": github_auth_token, }, repository_create_params.RepositoryCreateParams, ), @@ -230,7 +234,7 @@ def delete( cast_to=object, ) - def versions( + def list_inspections( self, id: str, *, @@ -240,10 +244,10 @@ def versions( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RepositoryVersionListView: + ) -> RepositoryInspectionListView: """ - List all analyzed versions of a repository connection including automatically - generated insights for each version. + List all inspections of a repository connection including automatically + generated insights for each inspection. Args: extra_headers: Send extra headers @@ -257,11 +261,52 @@ def versions( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._get( - f"/v1/repositories/{id}/versions", + f"/v1/repositories/{id}/inspections", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=RepositoryVersionListView, + cast_to=RepositoryInspectionListView, + ) + + def refresh( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> object: + """ + Refresh a repository connection by inspecting the latest version including + repo's technical stack and developer environment requirements. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/repositories/{id}/refresh", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=object, ) @@ -291,6 +336,7 @@ async def create( name: str, owner: str, blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, + github_auth_token: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -310,6 +356,8 @@ async def create( blueprint_id: ID of blueprint to use as base for resulting RepositoryVersion blueprint. + github_auth_token: GitHub authentication token for accessing private repositories. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -327,6 +375,7 @@ async def create( "name": name, "owner": owner, "blueprint_id": blueprint_id, + "github_auth_token": github_auth_token, }, repository_create_params.RepositoryCreateParams, ), @@ -470,7 +519,7 @@ async def delete( cast_to=object, ) - async def versions( + async def list_inspections( self, id: str, *, @@ -480,10 +529,10 @@ async def versions( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RepositoryVersionListView: + ) -> RepositoryInspectionListView: """ - List all analyzed versions of a repository connection including automatically - generated insights for each version. + List all inspections of a repository connection including automatically + generated insights for each inspection. Args: extra_headers: Send extra headers @@ -497,11 +546,52 @@ async def versions( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._get( - f"/v1/repositories/{id}/versions", + f"/v1/repositories/{id}/inspections", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=RepositoryVersionListView, + cast_to=RepositoryInspectionListView, + ) + + async def refresh( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> object: + """ + Refresh a repository connection by inspecting the latest version including + repo's technical stack and developer environment requirements. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/repositories/{id}/refresh", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=object, ) @@ -521,8 +611,11 @@ def __init__(self, repositories: RepositoriesResource) -> None: self.delete = to_raw_response_wrapper( repositories.delete, ) - self.versions = to_raw_response_wrapper( - repositories.versions, + self.list_inspections = to_raw_response_wrapper( + repositories.list_inspections, + ) + self.refresh = to_raw_response_wrapper( + repositories.refresh, ) @@ -542,8 +635,11 @@ def __init__(self, repositories: AsyncRepositoriesResource) -> None: self.delete = async_to_raw_response_wrapper( repositories.delete, ) - self.versions = async_to_raw_response_wrapper( - repositories.versions, + self.list_inspections = async_to_raw_response_wrapper( + repositories.list_inspections, + ) + self.refresh = async_to_raw_response_wrapper( + repositories.refresh, ) @@ -563,8 +659,11 @@ def __init__(self, repositories: RepositoriesResource) -> None: self.delete = to_streamed_response_wrapper( repositories.delete, ) - self.versions = to_streamed_response_wrapper( - repositories.versions, + self.list_inspections = to_streamed_response_wrapper( + repositories.list_inspections, + ) + self.refresh = to_streamed_response_wrapper( + repositories.refresh, ) @@ -584,6 +683,9 @@ def __init__(self, repositories: AsyncRepositoriesResource) -> None: self.delete = async_to_streamed_response_wrapper( repositories.delete, ) - self.versions = async_to_streamed_response_wrapper( - repositories.versions, + self.list_inspections = async_to_streamed_response_wrapper( + repositories.list_inspections, + ) + self.refresh = async_to_streamed_response_wrapper( + repositories.refresh, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 8e29c98ef..ac900e84d 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -42,6 +42,7 @@ from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams from .repository_create_params import RepositoryCreateParams as RepositoryCreateParams +from .repository_manifest_view import RepositoryManifestView as RepositoryManifestView from .devbox_snapshot_list_view import DevboxSnapshotListView as DevboxSnapshotListView from .devbox_upload_file_params import DevboxUploadFileParams as DevboxUploadFileParams from .scenario_start_run_params import ScenarioStartRunParams as ScenarioStartRunParams @@ -49,7 +50,6 @@ from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams from .repository_connection_view import RepositoryConnectionView as RepositoryConnectionView -from .repository_version_details import RepositoryVersionDetails as RepositoryVersionDetails from .scenario_environment_param import ScenarioEnvironmentParam as ScenarioEnvironmentParam from .devbox_create_tunnel_params import DevboxCreateTunnelParams as DevboxCreateTunnelParams from .devbox_download_file_params import DevboxDownloadFileParams as DevboxDownloadFileParams @@ -59,12 +59,13 @@ from .scenario_list_public_params import ScenarioListPublicParams as ScenarioListPublicParams from .benchmark_list_public_params import BenchmarkListPublicParams as BenchmarkListPublicParams from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView -from .repository_version_list_view import RepositoryVersionListView as RepositoryVersionListView from .scoring_contract_result_view import ScoringContractResultView as ScoringContractResultView from .scoring_function_result_view import ScoringFunctionResultView as ScoringFunctionResultView +from .repository_inspection_details import RepositoryInspectionDetails as RepositoryInspectionDetails from .blueprint_build_logs_list_view import BlueprintBuildLogsListView as BlueprintBuildLogsListView from .devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse as DevboxCreateSSHKeyResponse from .repository_connection_list_view import RepositoryConnectionListView as RepositoryConnectionListView +from .repository_inspection_list_view import RepositoryInspectionListView as RepositoryInspectionListView from .devbox_read_file_contents_params import DevboxReadFileContentsParams as DevboxReadFileContentsParams from .devbox_list_disk_snapshots_params import DevboxListDiskSnapshotsParams as DevboxListDiskSnapshotsParams from .devbox_snapshot_disk_async_params import DevboxSnapshotDiskAsyncParams as DevboxSnapshotDiskAsyncParams diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 51f405ed5..65905f8a3 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -8,7 +8,7 @@ from .shared_params.launch_parameters import LaunchParameters from .shared_params.code_mount_parameters import CodeMountParameters -__all__ = ["DevboxCreateParams"] +__all__ = ["DevboxCreateParams", "RepositoryConnection"] class DevboxCreateParams(TypedDict, total=False): @@ -58,8 +58,26 @@ class DevboxCreateParams(TypedDict, total=False): Should not be used together with (Snapshot ID, Blueprint ID, or Blueprint name). """ + repository_connection: Optional[RepositoryConnection] + """Repository connection parameters for configuring repository integration.""" + snapshot_id: Optional[str] """Snapshot ID to use for the Devbox. Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified. """ + + +class RepositoryConnection(TypedDict, total=False): + github_auth_token: Optional[str] + """ + GitHub authentication token for accessing private repositories when using + repository_connection_id. + """ + + repository_connection_id: Optional[str] + """Repository connection ID to use for the Devbox. + + When specified, the latest inspection blueprint will be used and workspace + maintenance commands will be run during boot. + """ diff --git a/src/runloop_api_client/types/repository_connection_view.py b/src/runloop_api_client/types/repository_connection_view.py index f0c81ecd3..74718de27 100644 --- a/src/runloop_api_client/types/repository_connection_view.py +++ b/src/runloop_api_client/types/repository_connection_view.py @@ -1,8 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional -from typing_extensions import Literal - from .._models import BaseModel __all__ = ["RepositoryConnectionView"] @@ -17,9 +14,3 @@ class RepositoryConnectionView(BaseModel): owner: str """The account owner of the Repository.""" - - status: Literal["pending", "failure", "active"] - """The current status of the Repository.""" - - failure_reason: Optional[str] = None - """Reason for failure, if the status is 'failure'.""" diff --git a/src/runloop_api_client/types/repository_create_params.py b/src/runloop_api_client/types/repository_create_params.py index 78e31175e..fc241739e 100644 --- a/src/runloop_api_client/types/repository_create_params.py +++ b/src/runloop_api_client/types/repository_create_params.py @@ -17,3 +17,6 @@ class RepositoryCreateParams(TypedDict, total=False): blueprint_id: Optional[str] """ID of blueprint to use as base for resulting RepositoryVersion blueprint.""" + + github_auth_token: Optional[str] + """GitHub authentication token for accessing private repositories.""" diff --git a/src/runloop_api_client/types/repository_inspection_details.py b/src/runloop_api_client/types/repository_inspection_details.py new file mode 100644 index 000000000..4f685e09b --- /dev/null +++ b/src/runloop_api_client/types/repository_inspection_details.py @@ -0,0 +1,39 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from .._models import BaseModel +from .repository_manifest_view import RepositoryManifestView + +__all__ = ["RepositoryInspectionDetails"] + + +class RepositoryInspectionDetails(BaseModel): + commit_sha: str + """The sha of the inspected version of the Repository.""" + + inspected_at: int + """Inspection time of the Repository Version (Unix timestamp milliseconds).""" + + repository_manifest: RepositoryManifestView + """Repository manifest containing container config and workspace details.""" + + status: Literal[ + "invalid", + "repo_auth_pending", + "repo_authentication_failure", + "repo_access_failure", + "inspection_pending", + "inspection_failed", + "inspection_success", + "image_build_success", + "image_build_failure", + ] + """The status of the repository inspection.""" + + blueprint_id: Optional[str] = None + """The blueprint ID associated with this inspection if successful.""" + + blueprint_name: Optional[str] = None + """The blueprint name associated with this inspection if successful.""" diff --git a/src/runloop_api_client/types/repository_inspection_list_view.py b/src/runloop_api_client/types/repository_inspection_list_view.py new file mode 100644 index 000000000..e6a7108b7 --- /dev/null +++ b/src/runloop_api_client/types/repository_inspection_list_view.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .repository_inspection_details import RepositoryInspectionDetails + +__all__ = ["RepositoryInspectionListView"] + + +class RepositoryInspectionListView(BaseModel): + inspections: List[RepositoryInspectionDetails] + """List of inspections for this repository.""" diff --git a/src/runloop_api_client/types/repository_manifest_view.py b/src/runloop_api_client/types/repository_manifest_view.py new file mode 100644 index 000000000..d4dbf0b3e --- /dev/null +++ b/src/runloop_api_client/types/repository_manifest_view.py @@ -0,0 +1,91 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from .._models import BaseModel + +__all__ = ["RepositoryManifestView", "ContainerConfig", "Workspace", "WorkspaceDevCommands"] + + +class ContainerConfig(BaseModel): + base_image_name: str + """The name of the base image. + + Should be one of the GitHub public images like ubuntu-latest, ubuntu-24.04, + ubuntu-22.04, windows-latest, windows-2022, macos-latest etc. + """ + + setup_commands: Optional[List[str]] = None + """ + Commands to run to setup the base container such as installing necessary + toolchains (e.g. apt install). + """ + + +class WorkspaceDevCommands(BaseModel): + build: Optional[str] = None + """Build command (e.g. npm run build).""" + + install: Optional[str] = None + """Installation command (e.g. pip install -r requirements.txt).""" + + lint: Optional[str] = None + """Lint command (e.g. flake8).""" + + test: Optional[str] = None + """Test command (e.g. pytest).""" + + +class Workspace(BaseModel): + package_manager: str + """Name of the package manager used (e.g. pip, npm).""" + + dev_commands: Optional[WorkspaceDevCommands] = None + """ + Extracted common commands important to the developer life cycle like linting, + testing, building, etc. + """ + + name: Optional[str] = None + """Name of the workspace. + + Can be empty if the workspace is the root of the repository. Only necessary for + monorepo style repositories. + """ + + path: Optional[str] = None + """Path to the workspace from the root of the repository. + + Can be empty if the workspace is the root of the repository. Only necessary for + monorepo style repositories. + """ + + required_env_vars: Optional[List[str]] = None + """ + Environment variables that are required to be set for this workspace to run + correctly. + """ + + workspace_refresh_commands: Optional[List[str]] = None + """ + Commands to run to refresh this workspace after pulling the latest changes to + the repository via git (e.g. npm install). + """ + + workspace_setup_commands: Optional[List[str]] = None + """ + Commands to run to setup this workspace after a fresh clone of the repository on + a new container such as installing necessary toolchains and dependencies (e.g. + npm install). + """ + + +class RepositoryManifestView(BaseModel): + container_config: ContainerConfig + """Container configuration specifying the base image and setup commands.""" + + workspaces: List[Workspace] + """List of workspaces within the repository. + + Each workspace represents a buildable unit of code. + """ diff --git a/src/runloop_api_client/types/repository_version_details.py b/src/runloop_api_client/types/repository_version_details.py deleted file mode 100644 index 8d6d2b0d8..000000000 --- a/src/runloop_api_client/types/repository_version_details.py +++ /dev/null @@ -1,44 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["RepositoryVersionDetails", "ExtractedTools", "RepositorySetupDetails"] - - -class ExtractedTools(BaseModel): - commands: Dict[str, str] - """The set of available commands on this repository such as building etc.""" - - package_manager: str - """What package manager this repository uses.""" - - -class RepositorySetupDetails(BaseModel): - blueprint_id: str - """The blueprint built that supports setting up this repository.""" - - env_initialization_command: str - """Command to initialize the env we need to run the commands for this repository.""" - - workspace_setup: List[str] - """Setup commands necessary to support repository i.e. apt install XXX.""" - - -class RepositoryVersionDetails(BaseModel): - analyzed_at: int - """Analyzed time of the Repository Version (Unix timestamp milliseconds).""" - - commit_sha: str - """The sha of the analyzed version of the Repository.""" - - extracted_tools: ExtractedTools - """Tools discovered during inspection.""" - - repository_setup_details: RepositorySetupDetails - """Commands required to set up repository environment.""" - - status: Literal["inspecting", "inspection_failed", "success"] - """The account owner of the Repository.""" diff --git a/src/runloop_api_client/types/repository_version_list_view.py b/src/runloop_api_client/types/repository_version_list_view.py deleted file mode 100644 index 6e4872663..000000000 --- a/src/runloop_api_client/types/repository_version_list_view.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from .._models import BaseModel -from .repository_version_details import RepositoryVersionDetails - -__all__ = ["RepositoryVersionListView"] - - -class RepositoryVersionListView(BaseModel): - analyzed_versions: List[RepositoryVersionDetails] - """List of analyzed versions of this repository.""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 3d4983fc0..1af1bbb6f 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -79,6 +79,10 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: metadata={"foo": "string"}, name="name", prebuilt="prebuilt", + repository_connection={ + "github_auth_token": "github_auth_token", + "repository_connection_id": "repository_connection_id", + }, snapshot_id="snapshot_id", ) assert_matches_type(DevboxView, devbox, path=["response"]) @@ -1008,6 +1012,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - metadata={"foo": "string"}, name="name", prebuilt="prebuilt", + repository_connection={ + "github_auth_token": "github_auth_token", + "repository_connection_id": "repository_connection_id", + }, snapshot_id="snapshot_id", ) assert_matches_type(DevboxView, devbox, path=["response"]) diff --git a/tests/api_resources/test_repositories.py b/tests/api_resources/test_repositories.py index 47e0798c8..2206e0273 100644 --- a/tests/api_resources/test_repositories.py +++ b/tests/api_resources/test_repositories.py @@ -11,7 +11,7 @@ from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types import ( RepositoryConnectionView, - RepositoryVersionListView, + RepositoryInspectionListView, ) from runloop_api_client.pagination import SyncRepositoriesCursorIDPage, AsyncRepositoriesCursorIDPage @@ -35,6 +35,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: name="name", owner="owner", blueprint_id="blueprint_id", + github_auth_token="github_auth_token", ) assert_matches_type(RepositoryConnectionView, repository, path=["response"]) @@ -176,40 +177,78 @@ def test_path_params_delete(self, client: Runloop) -> None: ) @parametrize - def test_method_versions(self, client: Runloop) -> None: - repository = client.repositories.versions( + def test_method_list_inspections(self, client: Runloop) -> None: + repository = client.repositories.list_inspections( "id", ) - assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + assert_matches_type(RepositoryInspectionListView, repository, path=["response"]) @parametrize - def test_raw_response_versions(self, client: Runloop) -> None: - response = client.repositories.with_raw_response.versions( + def test_raw_response_list_inspections(self, client: Runloop) -> None: + response = client.repositories.with_raw_response.list_inspections( "id", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" repository = response.parse() - assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + assert_matches_type(RepositoryInspectionListView, repository, path=["response"]) @parametrize - def test_streaming_response_versions(self, client: Runloop) -> None: - with client.repositories.with_streaming_response.versions( + def test_streaming_response_list_inspections(self, client: Runloop) -> None: + with client.repositories.with_streaming_response.list_inspections( "id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" repository = response.parse() - assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + assert_matches_type(RepositoryInspectionListView, repository, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_versions(self, client: Runloop) -> None: + def test_path_params_list_inspections(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.repositories.with_raw_response.versions( + client.repositories.with_raw_response.list_inspections( + "", + ) + + @parametrize + def test_method_refresh(self, client: Runloop) -> None: + repository = client.repositories.refresh( + "id", + ) + assert_matches_type(object, repository, path=["response"]) + + @parametrize + def test_raw_response_refresh(self, client: Runloop) -> None: + response = client.repositories.with_raw_response.refresh( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = response.parse() + assert_matches_type(object, repository, path=["response"]) + + @parametrize + def test_streaming_response_refresh(self, client: Runloop) -> None: + with client.repositories.with_streaming_response.refresh( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = response.parse() + assert_matches_type(object, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_refresh(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.repositories.with_raw_response.refresh( "", ) @@ -231,6 +270,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - name="name", owner="owner", blueprint_id="blueprint_id", + github_auth_token="github_auth_token", ) assert_matches_type(RepositoryConnectionView, repository, path=["response"]) @@ -372,39 +412,77 @@ async def test_path_params_delete(self, async_client: AsyncRunloop) -> None: ) @parametrize - async def test_method_versions(self, async_client: AsyncRunloop) -> None: - repository = await async_client.repositories.versions( + async def test_method_list_inspections(self, async_client: AsyncRunloop) -> None: + repository = await async_client.repositories.list_inspections( "id", ) - assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + assert_matches_type(RepositoryInspectionListView, repository, path=["response"]) @parametrize - async def test_raw_response_versions(self, async_client: AsyncRunloop) -> None: - response = await async_client.repositories.with_raw_response.versions( + async def test_raw_response_list_inspections(self, async_client: AsyncRunloop) -> None: + response = await async_client.repositories.with_raw_response.list_inspections( "id", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" repository = await response.parse() - assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + assert_matches_type(RepositoryInspectionListView, repository, path=["response"]) @parametrize - async def test_streaming_response_versions(self, async_client: AsyncRunloop) -> None: - async with async_client.repositories.with_streaming_response.versions( + async def test_streaming_response_list_inspections(self, async_client: AsyncRunloop) -> None: + async with async_client.repositories.with_streaming_response.list_inspections( "id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" repository = await response.parse() - assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + assert_matches_type(RepositoryInspectionListView, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list_inspections(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.repositories.with_raw_response.list_inspections( + "", + ) + + @parametrize + async def test_method_refresh(self, async_client: AsyncRunloop) -> None: + repository = await async_client.repositories.refresh( + "id", + ) + assert_matches_type(object, repository, path=["response"]) + + @parametrize + async def test_raw_response_refresh(self, async_client: AsyncRunloop) -> None: + response = await async_client.repositories.with_raw_response.refresh( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = await response.parse() + assert_matches_type(object, repository, path=["response"]) + + @parametrize + async def test_streaming_response_refresh(self, async_client: AsyncRunloop) -> None: + async with async_client.repositories.with_streaming_response.refresh( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = await response.parse() + assert_matches_type(object, repository, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_versions(self, async_client: AsyncRunloop) -> None: + async def test_path_params_refresh(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.repositories.with_raw_response.versions( + await async_client.repositories.with_raw_response.refresh( "", ) From 3e72a34d4f6f7f82ff7a01a7dd524e77a540ffbf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 2 Jun 2025 18:54:48 +0000 Subject: [PATCH 745/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ce5e5c7c5..157f0355f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.35.0" + ".": "0.36.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 6338f7f73..4bfa8e5a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.35.0" +version = "0.36.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 64c7ee59c..12ac26a82 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.35.0" # x-release-please-version +__version__ = "0.36.0" # x-release-please-version From bc86dd6e8386eff5a4a791345dd6332a57b4e4a9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 2 Jun 2025 19:41:42 +0000 Subject: [PATCH 746/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 5a58d5b1e..55406453d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 85 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3484df665f4c2b7cb17ad044b825223fc69ad67b05d967fbb6dfbb6a6ac9ccac.yml openapi_spec_hash: 58c0860078f5f26c8b517603956700b5 -config_hash: c03c6a4c057a38e2809a102c48fafe6c +config_hash: 877879fdb00371dafaddf7137e296832 From 4f36868f69ddbee057436b89c18d3937da0f5d98 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 02:22:48 +0000 Subject: [PATCH 747/993] chore(docs): remove reference to rye shell --- CONTRIBUTING.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fcf955358..67732aae5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,8 +17,7 @@ $ rye sync --all-features You can then run scripts using `rye run python script.py` or by activating the virtual environment: ```sh -$ rye shell -# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work +# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work $ source .venv/bin/activate # now you can omit the `rye run` prefix From 8142dbd4d3ee1e5c2be57ca44ec3f5bf0755c3da Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 02:35:03 +0000 Subject: [PATCH 748/993] chore(docs): remove unnecessary param examples --- README.md | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/README.md b/README.md index 05e74c625..b59a62b8d 100644 --- a/README.md +++ b/README.md @@ -146,23 +146,7 @@ from runloop_api_client import Runloop client = Runloop() devbox_view = client.devboxes.create( - launch_parameters={ - "after_idle": { - "idle_time_seconds": 0, - "on_idle": "shutdown", - }, - "architecture": "x86_64", - "available_ports": [0], - "custom_cpu_cores": 0, - "custom_gb_memory": 0, - "keep_alive_time_seconds": 0, - "launch_commands": ["string"], - "resource_size_request": "X_SMALL", - "user_parameters": { - "uid": 0, - "username": "username", - }, - }, + launch_parameters={}, ) print(devbox_view.launch_parameters) ``` From a0fcc599cfd1095934b1b210f8762af40f8c0ee0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 03:37:10 +0000 Subject: [PATCH 749/993] feat(client): add follow_redirects request option --- src/runloop_api_client/_base_client.py | 6 +++ src/runloop_api_client/_models.py | 2 + src/runloop_api_client/_types.py | 2 + tests/test_client.py | 54 ++++++++++++++++++++++++++ 4 files changed, 64 insertions(+) diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index 1b3041060..bba4933f3 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -960,6 +960,9 @@ def request( if self.custom_auth is not None: kwargs["auth"] = self.custom_auth + if options.follow_redirects is not None: + kwargs["follow_redirects"] = options.follow_redirects + log.debug("Sending HTTP Request: %s %s", request.method, request.url) response = None @@ -1460,6 +1463,9 @@ async def request( if self.custom_auth is not None: kwargs["auth"] = self.custom_auth + if options.follow_redirects is not None: + kwargs["follow_redirects"] = options.follow_redirects + log.debug("Sending HTTP Request: %s %s", request.method, request.url) response = None diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index 798956f17..4f2149805 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -737,6 +737,7 @@ class FinalRequestOptionsInput(TypedDict, total=False): idempotency_key: str json_data: Body extra_json: AnyMapping + follow_redirects: bool @final @@ -750,6 +751,7 @@ class FinalRequestOptions(pydantic.BaseModel): files: Union[HttpxRequestFiles, None] = None idempotency_key: Union[str, None] = None post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven() + follow_redirects: Union[bool, None] = None # It should be noted that we cannot use `json` here as that would override # a BaseModel method in an incompatible fashion. diff --git a/src/runloop_api_client/_types.py b/src/runloop_api_client/_types.py index 114eefd47..40ccb19ed 100644 --- a/src/runloop_api_client/_types.py +++ b/src/runloop_api_client/_types.py @@ -100,6 +100,7 @@ class RequestOptions(TypedDict, total=False): params: Query extra_json: AnyMapping idempotency_key: str + follow_redirects: bool # Sentinel class used until PEP 0661 is accepted @@ -215,3 +216,4 @@ class _GenericAlias(Protocol): class HttpxSendArgs(TypedDict, total=False): auth: httpx.Auth + follow_redirects: bool diff --git a/tests/test_client.py b/tests/test_client.py index 2453b22ac..e3faa0506 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -873,6 +873,33 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: assert response.http_request.headers.get("x-stainless-retry-count") == "42" + @pytest.mark.respx(base_url=base_url) + def test_follow_redirects(self, respx_mock: MockRouter) -> None: + # Test that the default follow_redirects=True allows following redirects + respx_mock.post("/redirect").mock( + return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) + ) + respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"})) + + response = self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) + assert response.status_code == 200 + assert response.json() == {"status": "ok"} + + @pytest.mark.respx(base_url=base_url) + def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None: + # Test that follow_redirects=False prevents following redirects + respx_mock.post("/redirect").mock( + return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) + ) + + with pytest.raises(APIStatusError) as exc_info: + self.client.post( + "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response + ) + + assert exc_info.value.response.status_code == 302 + assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected" + class TestAsyncRunloop: client = AsyncRunloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) @@ -1741,3 +1768,30 @@ async def test_main() -> None: raise AssertionError("calling get_platform using asyncify resulted in a hung process") time.sleep(0.1) + + @pytest.mark.respx(base_url=base_url) + async def test_follow_redirects(self, respx_mock: MockRouter) -> None: + # Test that the default follow_redirects=True allows following redirects + respx_mock.post("/redirect").mock( + return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) + ) + respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"})) + + response = await self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) + assert response.status_code == 200 + assert response.json() == {"status": "ok"} + + @pytest.mark.respx(base_url=base_url) + async def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None: + # Test that follow_redirects=False prevents following redirects + respx_mock.post("/redirect").mock( + return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) + ) + + with pytest.raises(APIStatusError) as exc_info: + await self.client.post( + "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response + ) + + assert exc_info.value.response.status_code == 302 + assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected" From 3040f7367d7f1bc9ac72fbd83f43eaf780dbce63 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 00:10:19 +0000 Subject: [PATCH 750/993] feat(api): api update --- .stats.yml | 8 +- api.md | 1 + .../resources/benchmarks/runs.py | 115 +++++++++++++++++- .../types/benchmarks/__init__.py | 1 + .../run_list_scenario_runs_params.py | 15 +++ tests/api_resources/benchmarks/test_runs.py | 96 ++++++++++++++- 6 files changed, 230 insertions(+), 6 deletions(-) create mode 100644 src/runloop_api_client/types/benchmarks/run_list_scenario_runs_params.py diff --git a/.stats.yml b/.stats.yml index 55406453d..cb2817919 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 85 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3484df665f4c2b7cb17ad044b825223fc69ad67b05d967fbb6dfbb6a6ac9ccac.yml -openapi_spec_hash: 58c0860078f5f26c8b517603956700b5 -config_hash: 877879fdb00371dafaddf7137e296832 +configured_endpoints: 86 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-141cac5a78c04271425090df61bb3f19446c1c065ae66a5b7a6329c53628aafa.yml +openapi_spec_hash: 2380917eddc78d715847c7ef6bfa3b4a +config_hash: 5b50498887b4fdca175b8377a9cb675f diff --git a/api.md b/api.md index 367aa7f0d..7e511f221 100644 --- a/api.md +++ b/api.md @@ -35,6 +35,7 @@ Methods: - client.benchmarks.runs.list(\*\*params) -> SyncBenchmarkRunsCursorIDPage[BenchmarkRunView] - client.benchmarks.runs.cancel(id) -> BenchmarkRunView - client.benchmarks.runs.complete(id) -> BenchmarkRunView +- client.benchmarks.runs.list_scenario_runs(id, \*\*params) -> SyncBenchmarkRunsCursorIDPage[ScenarioRunView] # Blueprints diff --git a/src/runloop_api_client/resources/benchmarks/runs.py b/src/runloop_api_client/resources/benchmarks/runs.py index ef6022d19..5735a5aa6 100644 --- a/src/runloop_api_client/resources/benchmarks/runs.py +++ b/src/runloop_api_client/resources/benchmarks/runs.py @@ -16,7 +16,8 @@ ) from ...pagination import SyncBenchmarkRunsCursorIDPage, AsyncBenchmarkRunsCursorIDPage from ..._base_client import AsyncPaginator, make_request_options -from ...types.benchmarks import run_list_params +from ...types.benchmarks import run_list_params, run_list_scenario_runs_params +from ...types.scenario_run_view import ScenarioRunView from ...types.benchmark_run_view import BenchmarkRunView __all__ = ["RunsResource", "AsyncRunsResource"] @@ -206,6 +207,56 @@ def complete( cast_to=BenchmarkRunView, ) + def list_scenario_runs( + self, + id: str, + *, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncBenchmarkRunsCursorIDPage[ScenarioRunView]: + """ + List started scenario runs for a benchmark run. + + Args: + limit: The limit of items to return. Default is 20. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get_api_list( + f"/v1/benchmarks/runs/{id}/scenario_runs", + page=SyncBenchmarkRunsCursorIDPage[ScenarioRunView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + run_list_scenario_runs_params.RunListScenarioRunsParams, + ), + ), + model=ScenarioRunView, + ) + class AsyncRunsResource(AsyncAPIResource): @cached_property @@ -391,6 +442,56 @@ async def complete( cast_to=BenchmarkRunView, ) + def list_scenario_runs( + self, + id: str, + *, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[ScenarioRunView, AsyncBenchmarkRunsCursorIDPage[ScenarioRunView]]: + """ + List started scenario runs for a benchmark run. + + Args: + limit: The limit of items to return. Default is 20. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get_api_list( + f"/v1/benchmarks/runs/{id}/scenario_runs", + page=AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + run_list_scenario_runs_params.RunListScenarioRunsParams, + ), + ), + model=ScenarioRunView, + ) + class RunsResourceWithRawResponse: def __init__(self, runs: RunsResource) -> None: @@ -408,6 +509,9 @@ def __init__(self, runs: RunsResource) -> None: self.complete = to_raw_response_wrapper( runs.complete, ) + self.list_scenario_runs = to_raw_response_wrapper( + runs.list_scenario_runs, + ) class AsyncRunsResourceWithRawResponse: @@ -426,6 +530,9 @@ def __init__(self, runs: AsyncRunsResource) -> None: self.complete = async_to_raw_response_wrapper( runs.complete, ) + self.list_scenario_runs = async_to_raw_response_wrapper( + runs.list_scenario_runs, + ) class RunsResourceWithStreamingResponse: @@ -444,6 +551,9 @@ def __init__(self, runs: RunsResource) -> None: self.complete = to_streamed_response_wrapper( runs.complete, ) + self.list_scenario_runs = to_streamed_response_wrapper( + runs.list_scenario_runs, + ) class AsyncRunsResourceWithStreamingResponse: @@ -462,3 +572,6 @@ def __init__(self, runs: AsyncRunsResource) -> None: self.complete = async_to_streamed_response_wrapper( runs.complete, ) + self.list_scenario_runs = async_to_streamed_response_wrapper( + runs.list_scenario_runs, + ) diff --git a/src/runloop_api_client/types/benchmarks/__init__.py b/src/runloop_api_client/types/benchmarks/__init__.py index 4bc4e1112..2fb29daa0 100644 --- a/src/runloop_api_client/types/benchmarks/__init__.py +++ b/src/runloop_api_client/types/benchmarks/__init__.py @@ -3,3 +3,4 @@ from __future__ import annotations from .run_list_params import RunListParams as RunListParams +from .run_list_scenario_runs_params import RunListScenarioRunsParams as RunListScenarioRunsParams diff --git a/src/runloop_api_client/types/benchmarks/run_list_scenario_runs_params.py b/src/runloop_api_client/types/benchmarks/run_list_scenario_runs_params.py new file mode 100644 index 000000000..b001bd54e --- /dev/null +++ b/src/runloop_api_client/types/benchmarks/run_list_scenario_runs_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["RunListScenarioRunsParams"] + + +class RunListScenarioRunsParams(TypedDict, total=False): + limit: int + """The limit of items to return. Default is 20.""" + + starting_after: str + """Load the next page of data starting after the item with the given ID.""" diff --git a/tests/api_resources/benchmarks/test_runs.py b/tests/api_resources/benchmarks/test_runs.py index d23aa33b7..a9a54ed76 100644 --- a/tests/api_resources/benchmarks/test_runs.py +++ b/tests/api_resources/benchmarks/test_runs.py @@ -9,7 +9,7 @@ from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types import BenchmarkRunView +from runloop_api_client.types import ScenarioRunView, BenchmarkRunView from runloop_api_client.pagination import SyncBenchmarkRunsCursorIDPage, AsyncBenchmarkRunsCursorIDPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -166,6 +166,53 @@ def test_path_params_complete(self, client: Runloop) -> None: "", ) + @parametrize + def test_method_list_scenario_runs(self, client: Runloop) -> None: + run = client.benchmarks.runs.list_scenario_runs( + id="id", + ) + assert_matches_type(SyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) + + @parametrize + def test_method_list_scenario_runs_with_all_params(self, client: Runloop) -> None: + run = client.benchmarks.runs.list_scenario_runs( + id="id", + limit=0, + starting_after="starting_after", + ) + assert_matches_type(SyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) + + @parametrize + def test_raw_response_list_scenario_runs(self, client: Runloop) -> None: + response = client.benchmarks.runs.with_raw_response.list_scenario_runs( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + run = response.parse() + assert_matches_type(SyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) + + @parametrize + def test_streaming_response_list_scenario_runs(self, client: Runloop) -> None: + with client.benchmarks.runs.with_streaming_response.list_scenario_runs( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + run = response.parse() + assert_matches_type(SyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list_scenario_runs(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.benchmarks.runs.with_raw_response.list_scenario_runs( + id="", + ) + class TestAsyncRuns: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @@ -317,3 +364,50 @@ async def test_path_params_complete(self, async_client: AsyncRunloop) -> None: await async_client.benchmarks.runs.with_raw_response.complete( "", ) + + @parametrize + async def test_method_list_scenario_runs(self, async_client: AsyncRunloop) -> None: + run = await async_client.benchmarks.runs.list_scenario_runs( + id="id", + ) + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) + + @parametrize + async def test_method_list_scenario_runs_with_all_params(self, async_client: AsyncRunloop) -> None: + run = await async_client.benchmarks.runs.list_scenario_runs( + id="id", + limit=0, + starting_after="starting_after", + ) + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) + + @parametrize + async def test_raw_response_list_scenario_runs(self, async_client: AsyncRunloop) -> None: + response = await async_client.benchmarks.runs.with_raw_response.list_scenario_runs( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + run = await response.parse() + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) + + @parametrize + async def test_streaming_response_list_scenario_runs(self, async_client: AsyncRunloop) -> None: + async with async_client.benchmarks.runs.with_streaming_response.list_scenario_runs( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + run = await response.parse() + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list_scenario_runs(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.benchmarks.runs.with_raw_response.list_scenario_runs( + id="", + ) From 329474aeb7af4862fdcc161c68082cb5f6484168 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 00:19:24 +0000 Subject: [PATCH 751/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 157f0355f..51acdaa4e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.36.0" + ".": "0.37.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 4bfa8e5a8..5ea158891 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.36.0" +version = "0.37.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 12ac26a82..5eea31e80 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.36.0" # x-release-please-version +__version__ = "0.37.0" # x-release-please-version From f2feb78de54a11c0999826e437e37f0dc65b084b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 15:46:59 +0000 Subject: [PATCH 752/993] feat(api): api update --- .stats.yml | 4 ++-- src/runloop_api_client/resources/benchmarks/runs.py | 12 ++++++++++++ .../benchmarks/run_list_scenario_runs_params.py | 5 ++++- tests/api_resources/benchmarks/test_runs.py | 2 ++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index cb2817919..2c30b1fb9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 86 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-141cac5a78c04271425090df61bb3f19446c1c065ae66a5b7a6329c53628aafa.yml -openapi_spec_hash: 2380917eddc78d715847c7ef6bfa3b4a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4cd38d2f4180cc9bd949f182a221d6221c44e7e0ec1ddc110dd7677ba822b51a.yml +openapi_spec_hash: e186fd7fd5f09ba496f0b7bb87365f3b config_hash: 5b50498887b4fdca175b8377a9cb675f diff --git a/src/runloop_api_client/resources/benchmarks/runs.py b/src/runloop_api_client/resources/benchmarks/runs.py index 5735a5aa6..ce86a527c 100644 --- a/src/runloop_api_client/resources/benchmarks/runs.py +++ b/src/runloop_api_client/resources/benchmarks/runs.py @@ -2,6 +2,8 @@ from __future__ import annotations +from typing_extensions import Literal + import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven @@ -213,6 +215,8 @@ def list_scenario_runs( *, limit: int | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, + state: Literal["running", "scoring", "scored", "completed", "canceled", "timeout", "failed"] + | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -228,6 +232,8 @@ def list_scenario_runs( starting_after: Load the next page of data starting after the item with the given ID. + state: Filter by Scenario Run state + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -250,6 +256,7 @@ def list_scenario_runs( { "limit": limit, "starting_after": starting_after, + "state": state, }, run_list_scenario_runs_params.RunListScenarioRunsParams, ), @@ -448,6 +455,8 @@ def list_scenario_runs( *, limit: int | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, + state: Literal["running", "scoring", "scored", "completed", "canceled", "timeout", "failed"] + | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -463,6 +472,8 @@ def list_scenario_runs( starting_after: Load the next page of data starting after the item with the given ID. + state: Filter by Scenario Run state + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -485,6 +496,7 @@ def list_scenario_runs( { "limit": limit, "starting_after": starting_after, + "state": state, }, run_list_scenario_runs_params.RunListScenarioRunsParams, ), diff --git a/src/runloop_api_client/types/benchmarks/run_list_scenario_runs_params.py b/src/runloop_api_client/types/benchmarks/run_list_scenario_runs_params.py index b001bd54e..241df1a1f 100644 --- a/src/runloop_api_client/types/benchmarks/run_list_scenario_runs_params.py +++ b/src/runloop_api_client/types/benchmarks/run_list_scenario_runs_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Literal, TypedDict __all__ = ["RunListScenarioRunsParams"] @@ -13,3 +13,6 @@ class RunListScenarioRunsParams(TypedDict, total=False): starting_after: str """Load the next page of data starting after the item with the given ID.""" + + state: Literal["running", "scoring", "scored", "completed", "canceled", "timeout", "failed"] + """Filter by Scenario Run state""" diff --git a/tests/api_resources/benchmarks/test_runs.py b/tests/api_resources/benchmarks/test_runs.py index a9a54ed76..03db357df 100644 --- a/tests/api_resources/benchmarks/test_runs.py +++ b/tests/api_resources/benchmarks/test_runs.py @@ -179,6 +179,7 @@ def test_method_list_scenario_runs_with_all_params(self, client: Runloop) -> Non id="id", limit=0, starting_after="starting_after", + state="running", ) assert_matches_type(SyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) @@ -378,6 +379,7 @@ async def test_method_list_scenario_runs_with_all_params(self, async_client: Asy id="id", limit=0, starting_after="starting_after", + state="running", ) assert_matches_type(AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) From 4011d571e61fb90cb147001980e379d720f2dda6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 15:58:18 +0000 Subject: [PATCH 753/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 51acdaa4e..8ea07c9a4 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.37.0" + ".": "0.38.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 5ea158891..4583fb652 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.37.0" +version = "0.38.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 5eea31e80..700ae89d1 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.37.0" # x-release-please-version +__version__ = "0.38.0" # x-release-please-version From f3f4b629e319f24c26431eadf8bb91173fbdfb01 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 16:39:40 +0000 Subject: [PATCH 754/993] feat(api): api update --- .stats.yml | 2 +- api.md | 1 + src/runloop_api_client/types/__init__.py | 1 + .../types/scenario_definition_list_view.py | 19 +++++++++++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/runloop_api_client/types/scenario_definition_list_view.py diff --git a/.stats.yml b/.stats.yml index 2c30b1fb9..e05857011 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 86 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4cd38d2f4180cc9bd949f182a221d6221c44e7e0ec1ddc110dd7677ba822b51a.yml openapi_spec_hash: e186fd7fd5f09ba496f0b7bb87365f3b -config_hash: 5b50498887b4fdca175b8377a9cb675f +config_hash: d39a06c3965a9c5d5e95b12d34e3f3a5 diff --git a/api.md b/api.md index 7e511f221..20893ea5e 100644 --- a/api.md +++ b/api.md @@ -14,6 +14,7 @@ from runloop_api_client.types import ( BenchmarkRunListView, BenchmarkRunView, BenchmarkView, + ScenarioDefinitionListView, StartBenchmarkRunParameters, ) ``` diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index ac900e84d..4344357e8 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -62,6 +62,7 @@ from .scoring_contract_result_view import ScoringContractResultView as ScoringContractResultView from .scoring_function_result_view import ScoringFunctionResultView as ScoringFunctionResultView from .repository_inspection_details import RepositoryInspectionDetails as RepositoryInspectionDetails +from .scenario_definition_list_view import ScenarioDefinitionListView as ScenarioDefinitionListView from .blueprint_build_logs_list_view import BlueprintBuildLogsListView as BlueprintBuildLogsListView from .devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse as DevboxCreateSSHKeyResponse from .repository_connection_list_view import RepositoryConnectionListView as RepositoryConnectionListView diff --git a/src/runloop_api_client/types/scenario_definition_list_view.py b/src/runloop_api_client/types/scenario_definition_list_view.py new file mode 100644 index 000000000..5aa4ac3e4 --- /dev/null +++ b/src/runloop_api_client/types/scenario_definition_list_view.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .scenario_view import ScenarioView + +__all__ = ["ScenarioDefinitionListView"] + + +class ScenarioDefinitionListView(BaseModel): + has_more: bool + + remaining_count: int + + scenarios: List[ScenarioView] + """List of Scenarios matching filter.""" + + total_count: int From 82dda670f0d67010f81fc350f64d4e5ef5953095 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 16:49:27 +0000 Subject: [PATCH 755/993] feat(api): api update --- .stats.yml | 4 +- api.md | 1 + .../resources/benchmarks/benchmarks.py | 112 ++++++++++++++++++ src/runloop_api_client/types/__init__.py | 1 + .../types/benchmark_definitions_params.py | 15 +++ tests/api_resources/test_benchmarks.py | 95 +++++++++++++++ 6 files changed, 226 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/types/benchmark_definitions_params.py diff --git a/.stats.yml b/.stats.yml index e05857011..aacf02853 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 86 +configured_endpoints: 87 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4cd38d2f4180cc9bd949f182a221d6221c44e7e0ec1ddc110dd7677ba822b51a.yml openapi_spec_hash: e186fd7fd5f09ba496f0b7bb87365f3b -config_hash: d39a06c3965a9c5d5e95b12d34e3f3a5 +config_hash: 4514558503b7aa6eba8c2941564c247d diff --git a/api.md b/api.md index 20893ea5e..c8fd0e94e 100644 --- a/api.md +++ b/api.md @@ -25,6 +25,7 @@ Methods: - client.benchmarks.retrieve(id) -> BenchmarkView - client.benchmarks.update(id, \*\*params) -> BenchmarkView - client.benchmarks.list(\*\*params) -> SyncBenchmarksCursorIDPage[BenchmarkView] +- client.benchmarks.definitions(id, \*\*params) -> ScenarioDefinitionListView - client.benchmarks.list_public(\*\*params) -> SyncBenchmarksCursorIDPage[BenchmarkView] - client.benchmarks.start_run(\*\*params) -> BenchmarkRunView diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py index fdbb65b22..65381f93d 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -19,6 +19,7 @@ benchmark_create_params, benchmark_update_params, benchmark_start_run_params, + benchmark_definitions_params, benchmark_list_public_params, ) from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven @@ -35,6 +36,7 @@ from ..._base_client import AsyncPaginator, make_request_options from ...types.benchmark_view import BenchmarkView from ...types.benchmark_run_view import BenchmarkRunView +from ...types.scenario_definition_list_view import ScenarioDefinitionListView __all__ = ["BenchmarksResource", "AsyncBenchmarksResource"] @@ -262,6 +264,55 @@ def list( model=BenchmarkView, ) + def definitions( + self, + id: str, + *, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScenarioDefinitionListView: + """ + Get scenario definitions for a previously created Benchmark. + + Args: + limit: The limit of items to return. Default is 20. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/benchmarks/{id}/definitions", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + benchmark_definitions_params.BenchmarkDefinitionsParams, + ), + ), + cast_to=ScenarioDefinitionListView, + ) + def list_public( self, *, @@ -587,6 +638,55 @@ def list( model=BenchmarkView, ) + async def definitions( + self, + id: str, + *, + limit: int | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ScenarioDefinitionListView: + """ + Get scenario definitions for a previously created Benchmark. + + Args: + limit: The limit of items to return. Default is 20. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/benchmarks/{id}/definitions", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + }, + benchmark_definitions_params.BenchmarkDefinitionsParams, + ), + ), + cast_to=ScenarioDefinitionListView, + ) + def list_public( self, *, @@ -705,6 +805,9 @@ def __init__(self, benchmarks: BenchmarksResource) -> None: self.list = to_raw_response_wrapper( benchmarks.list, ) + self.definitions = to_raw_response_wrapper( + benchmarks.definitions, + ) self.list_public = to_raw_response_wrapper( benchmarks.list_public, ) @@ -733,6 +836,9 @@ def __init__(self, benchmarks: AsyncBenchmarksResource) -> None: self.list = async_to_raw_response_wrapper( benchmarks.list, ) + self.definitions = async_to_raw_response_wrapper( + benchmarks.definitions, + ) self.list_public = async_to_raw_response_wrapper( benchmarks.list_public, ) @@ -761,6 +867,9 @@ def __init__(self, benchmarks: BenchmarksResource) -> None: self.list = to_streamed_response_wrapper( benchmarks.list, ) + self.definitions = to_streamed_response_wrapper( + benchmarks.definitions, + ) self.list_public = to_streamed_response_wrapper( benchmarks.list_public, ) @@ -789,6 +898,9 @@ def __init__(self, benchmarks: AsyncBenchmarksResource) -> None: self.list = async_to_streamed_response_wrapper( benchmarks.list, ) + self.definitions = async_to_streamed_response_wrapper( + benchmarks.definitions, + ) self.list_public = async_to_streamed_response_wrapper( benchmarks.list_public, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 4344357e8..eff9bd405 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -57,6 +57,7 @@ from .devbox_remove_tunnel_params import DevboxRemoveTunnelParams as DevboxRemoveTunnelParams from .devbox_snapshot_disk_params import DevboxSnapshotDiskParams as DevboxSnapshotDiskParams from .scenario_list_public_params import ScenarioListPublicParams as ScenarioListPublicParams +from .benchmark_definitions_params import BenchmarkDefinitionsParams as BenchmarkDefinitionsParams from .benchmark_list_public_params import BenchmarkListPublicParams as BenchmarkListPublicParams from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView from .scoring_contract_result_view import ScoringContractResultView as ScoringContractResultView diff --git a/src/runloop_api_client/types/benchmark_definitions_params.py b/src/runloop_api_client/types/benchmark_definitions_params.py new file mode 100644 index 000000000..f92d57d76 --- /dev/null +++ b/src/runloop_api_client/types/benchmark_definitions_params.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["BenchmarkDefinitionsParams"] + + +class BenchmarkDefinitionsParams(TypedDict, total=False): + limit: int + """The limit of items to return. Default is 20.""" + + starting_after: str + """Load the next page of data starting after the item with the given ID.""" diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py index 0d70ef3c8..c065cd847 100644 --- a/tests/api_resources/test_benchmarks.py +++ b/tests/api_resources/test_benchmarks.py @@ -12,6 +12,7 @@ from runloop_api_client.types import ( BenchmarkView, BenchmarkRunView, + ScenarioDefinitionListView, ) from runloop_api_client.pagination import SyncBenchmarksCursorIDPage, AsyncBenchmarksCursorIDPage @@ -193,6 +194,53 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_definitions(self, client: Runloop) -> None: + benchmark = client.benchmarks.definitions( + id="id", + ) + assert_matches_type(ScenarioDefinitionListView, benchmark, path=["response"]) + + @parametrize + def test_method_definitions_with_all_params(self, client: Runloop) -> None: + benchmark = client.benchmarks.definitions( + id="id", + limit=0, + starting_after="starting_after", + ) + assert_matches_type(ScenarioDefinitionListView, benchmark, path=["response"]) + + @parametrize + def test_raw_response_definitions(self, client: Runloop) -> None: + response = client.benchmarks.with_raw_response.definitions( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark = response.parse() + assert_matches_type(ScenarioDefinitionListView, benchmark, path=["response"]) + + @parametrize + def test_streaming_response_definitions(self, client: Runloop) -> None: + with client.benchmarks.with_streaming_response.definitions( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark = response.parse() + assert_matches_type(ScenarioDefinitionListView, benchmark, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_definitions(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.benchmarks.with_raw_response.definitions( + id="", + ) + @parametrize def test_method_list_public(self, client: Runloop) -> None: benchmark = client.benchmarks.list_public() @@ -442,6 +490,53 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_definitions(self, async_client: AsyncRunloop) -> None: + benchmark = await async_client.benchmarks.definitions( + id="id", + ) + assert_matches_type(ScenarioDefinitionListView, benchmark, path=["response"]) + + @parametrize + async def test_method_definitions_with_all_params(self, async_client: AsyncRunloop) -> None: + benchmark = await async_client.benchmarks.definitions( + id="id", + limit=0, + starting_after="starting_after", + ) + assert_matches_type(ScenarioDefinitionListView, benchmark, path=["response"]) + + @parametrize + async def test_raw_response_definitions(self, async_client: AsyncRunloop) -> None: + response = await async_client.benchmarks.with_raw_response.definitions( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark = await response.parse() + assert_matches_type(ScenarioDefinitionListView, benchmark, path=["response"]) + + @parametrize + async def test_streaming_response_definitions(self, async_client: AsyncRunloop) -> None: + async with async_client.benchmarks.with_streaming_response.definitions( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark = await response.parse() + assert_matches_type(ScenarioDefinitionListView, benchmark, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_definitions(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.benchmarks.with_raw_response.definitions( + id="", + ) + @parametrize async def test_method_list_public(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.list_public() From d313db02730b5b437367684ca5a407833c77e7b4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 16:50:48 +0000 Subject: [PATCH 756/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8ea07c9a4..1b5dc400b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.38.0" + ".": "0.39.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 4583fb652..2a900f11a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.38.0" +version = "0.39.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 700ae89d1..b6c29df97 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.38.0" # x-release-please-version +__version__ = "0.39.0" # x-release-please-version From f7eccee12640754ad76823869b4063bf87519d63 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 16:59:47 +0000 Subject: [PATCH 757/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index aacf02853..0f2af9672 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 87 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4cd38d2f4180cc9bd949f182a221d6221c44e7e0ec1ddc110dd7677ba822b51a.yml openapi_spec_hash: e186fd7fd5f09ba496f0b7bb87365f3b -config_hash: 4514558503b7aa6eba8c2941564c247d +config_hash: e36a10de3bba40d7894f4893019bf671 From 3a81e5aaa3023b72765e025223a72f091eaceecf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Jun 2025 23:48:12 +0000 Subject: [PATCH 758/993] feat(api): api update --- .stats.yml | 6 ++-- api.md | 2 +- .../resources/repositories.py | 28 ++++++++++++++- src/runloop_api_client/types/__init__.py | 1 + .../types/benchmark_run_view.py | 24 ++----------- .../types/repository_refresh_params.py | 16 +++++++++ tests/api_resources/test_repositories.py | 34 ++++++++++++++----- 7 files changed, 76 insertions(+), 35 deletions(-) create mode 100644 src/runloop_api_client/types/repository_refresh_params.py diff --git a/.stats.yml b/.stats.yml index 0f2af9672..ee98d462a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 87 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4cd38d2f4180cc9bd949f182a221d6221c44e7e0ec1ddc110dd7677ba822b51a.yml -openapi_spec_hash: e186fd7fd5f09ba496f0b7bb87365f3b -config_hash: e36a10de3bba40d7894f4893019bf671 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6bbcd490ee6a51a17c19f8d2b545791744a73145b4f9f05b8a7fae5590b21135.yml +openapi_spec_hash: 832de93ff415ecc09a7fa66017ee012f +config_hash: 4514558503b7aa6eba8c2941564c247d diff --git a/api.md b/api.md index c8fd0e94e..ce2831ca0 100644 --- a/api.md +++ b/api.md @@ -339,4 +339,4 @@ Methods: - client.repositories.list(\*\*params) -> SyncRepositoriesCursorIDPage[RepositoryConnectionView] - client.repositories.delete(id) -> object - client.repositories.list_inspections(id) -> RepositoryInspectionListView -- client.repositories.refresh(id) -> object +- client.repositories.refresh(id, \*\*params) -> object diff --git a/src/runloop_api_client/resources/repositories.py b/src/runloop_api_client/resources/repositories.py index 909e05e7b..b580da7a2 100644 --- a/src/runloop_api_client/resources/repositories.py +++ b/src/runloop_api_client/resources/repositories.py @@ -6,7 +6,7 @@ import httpx -from ..types import repository_list_params, repository_create_params +from ..types import repository_list_params, repository_create_params, repository_refresh_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property @@ -272,6 +272,8 @@ def refresh( self, id: str, *, + blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, + github_auth_token: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -285,6 +287,10 @@ def refresh( repo's technical stack and developer environment requirements. Args: + blueprint_id: ID of blueprint to use as base for resulting RepositoryVersion blueprint. + + github_auth_token: GitHub authentication token for accessing private repositories. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -299,6 +305,13 @@ def refresh( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/repositories/{id}/refresh", + body=maybe_transform( + { + "blueprint_id": blueprint_id, + "github_auth_token": github_auth_token, + }, + repository_refresh_params.RepositoryRefreshParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -557,6 +570,8 @@ async def refresh( self, id: str, *, + blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, + github_auth_token: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -570,6 +585,10 @@ async def refresh( repo's technical stack and developer environment requirements. Args: + blueprint_id: ID of blueprint to use as base for resulting RepositoryVersion blueprint. + + github_auth_token: GitHub authentication token for accessing private repositories. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -584,6 +603,13 @@ async def refresh( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( f"/v1/repositories/{id}/refresh", + body=await async_maybe_transform( + { + "blueprint_id": blueprint_id, + "github_auth_token": github_auth_token, + }, + repository_refresh_params.RepositoryRefreshParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index eff9bd405..3428ea1c9 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -45,6 +45,7 @@ from .repository_manifest_view import RepositoryManifestView as RepositoryManifestView from .devbox_snapshot_list_view import DevboxSnapshotListView as DevboxSnapshotListView from .devbox_upload_file_params import DevboxUploadFileParams as DevboxUploadFileParams +from .repository_refresh_params import RepositoryRefreshParams as RepositoryRefreshParams from .scenario_start_run_params import ScenarioStartRunParams as ScenarioStartRunParams from .benchmark_start_run_params import BenchmarkStartRunParams as BenchmarkStartRunParams from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters diff --git a/src/runloop_api_client/types/benchmark_run_view.py b/src/runloop_api_client/types/benchmark_run_view.py index 0f88d045b..baf97cf52 100644 --- a/src/runloop_api_client/types/benchmark_run_view.py +++ b/src/runloop_api_client/types/benchmark_run_view.py @@ -1,25 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, List, Optional +from typing import Dict, Optional from typing_extensions import Literal -from pydantic import Field as FieldInfo - from .._models import BaseModel -from .scoring_contract_result_view import ScoringContractResultView - -__all__ = ["BenchmarkRunView", "ScenarioRun"] - - -class ScenarioRun(BaseModel): - scenario_id: str - """ID of the Scenario that has been run.""" - scoring_result: ScoringContractResultView = FieldInfo(alias="scoringResult") - """The scoring result of the ScenarioRun.""" - - scenario_run_id: Optional[str] = FieldInfo(alias="scenarioRunId", default=None) - """ID of the scenario run.""" +__all__ = ["BenchmarkRunView"] class BenchmarkRunView(BaseModel): @@ -32,12 +18,6 @@ class BenchmarkRunView(BaseModel): metadata: Dict[str, str] """User defined metadata to attach to the benchmark run for organization.""" - pending_scenarios: List[str] - """List of Scenarios that have yet to be scored.""" - - scenario_runs: List[ScenarioRun] - """List of Scenarios have been completed.""" - start_time_ms: int """The time the benchmark run execution started (Unix timestamp milliseconds).""" diff --git a/src/runloop_api_client/types/repository_refresh_params.py b/src/runloop_api_client/types/repository_refresh_params.py new file mode 100644 index 000000000..e0eeae3e1 --- /dev/null +++ b/src/runloop_api_client/types/repository_refresh_params.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import TypedDict + +__all__ = ["RepositoryRefreshParams"] + + +class RepositoryRefreshParams(TypedDict, total=False): + blueprint_id: Optional[str] + """ID of blueprint to use as base for resulting RepositoryVersion blueprint.""" + + github_auth_token: Optional[str] + """GitHub authentication token for accessing private repositories.""" diff --git a/tests/api_resources/test_repositories.py b/tests/api_resources/test_repositories.py index 2206e0273..c74290fbe 100644 --- a/tests/api_resources/test_repositories.py +++ b/tests/api_resources/test_repositories.py @@ -217,14 +217,23 @@ def test_path_params_list_inspections(self, client: Runloop) -> None: @parametrize def test_method_refresh(self, client: Runloop) -> None: repository = client.repositories.refresh( - "id", + id="id", + ) + assert_matches_type(object, repository, path=["response"]) + + @parametrize + def test_method_refresh_with_all_params(self, client: Runloop) -> None: + repository = client.repositories.refresh( + id="id", + blueprint_id="blueprint_id", + github_auth_token="github_auth_token", ) assert_matches_type(object, repository, path=["response"]) @parametrize def test_raw_response_refresh(self, client: Runloop) -> None: response = client.repositories.with_raw_response.refresh( - "id", + id="id", ) assert response.is_closed is True @@ -235,7 +244,7 @@ def test_raw_response_refresh(self, client: Runloop) -> None: @parametrize def test_streaming_response_refresh(self, client: Runloop) -> None: with client.repositories.with_streaming_response.refresh( - "id", + id="id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -249,7 +258,7 @@ def test_streaming_response_refresh(self, client: Runloop) -> None: def test_path_params_refresh(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.repositories.with_raw_response.refresh( - "", + id="", ) @@ -452,14 +461,23 @@ async def test_path_params_list_inspections(self, async_client: AsyncRunloop) -> @parametrize async def test_method_refresh(self, async_client: AsyncRunloop) -> None: repository = await async_client.repositories.refresh( - "id", + id="id", + ) + assert_matches_type(object, repository, path=["response"]) + + @parametrize + async def test_method_refresh_with_all_params(self, async_client: AsyncRunloop) -> None: + repository = await async_client.repositories.refresh( + id="id", + blueprint_id="blueprint_id", + github_auth_token="github_auth_token", ) assert_matches_type(object, repository, path=["response"]) @parametrize async def test_raw_response_refresh(self, async_client: AsyncRunloop) -> None: response = await async_client.repositories.with_raw_response.refresh( - "id", + id="id", ) assert response.is_closed is True @@ -470,7 +488,7 @@ async def test_raw_response_refresh(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_refresh(self, async_client: AsyncRunloop) -> None: async with async_client.repositories.with_streaming_response.refresh( - "id", + id="id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -484,5 +502,5 @@ async def test_streaming_response_refresh(self, async_client: AsyncRunloop) -> N async def test_path_params_refresh(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.repositories.with_raw_response.refresh( - "", + id="", ) From dbd084a6862707b66207435afa7477f3673b8a49 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 18:16:49 +0000 Subject: [PATCH 759/993] feat(api): api update --- .stats.yml | 4 +-- .../resources/benchmarks/benchmarks.py | 16 ------------ .../resources/devboxes/devboxes.py | 12 ++++----- .../resources/scenarios/scenarios.py | 16 ------------ .../types/benchmark_create_params.py | 3 --- .../types/benchmark_update_params.py | 3 --- .../types/devbox_create_params.py | 21 +++------------- src/runloop_api_client/types/devbox_view.py | 25 ++++++++++++++++++- .../types/repository_inspection_details.py | 10 ++++++++ .../types/scenario_create_params.py | 3 --- .../types/scenario_update_params.py | 3 --- tests/api_resources/test_benchmarks.py | 18 ------------- tests/api_resources/test_devboxes.py | 10 ++------ tests/api_resources/test_scenarios.py | 18 ------------- 14 files changed, 47 insertions(+), 115 deletions(-) diff --git a/.stats.yml b/.stats.yml index ee98d462a..4abf1099f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 87 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6bbcd490ee6a51a17c19f8d2b545791744a73145b4f9f05b8a7fae5590b21135.yml -openapi_spec_hash: 832de93ff415ecc09a7fa66017ee012f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c23f8f8426208651ecf7b2a4108ea2003c6e3241c6928e88ef004f76fe826c08.yml +openapi_spec_hash: 2eee5118b3c2dd49f9124df0d10341ed config_hash: 4514558503b7aa6eba8c2941564c247d diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py index 65381f93d..d4270d242 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -68,7 +68,6 @@ def with_streaming_response(self) -> BenchmarksResourceWithStreamingResponse: def create( self, *, - is_public: bool, name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, @@ -84,8 +83,6 @@ def create( Create a Benchmark with a set of Scenarios. Args: - is_public: Whether this benchmark is public. - name: The name of the Benchmark. This must be unique. metadata: User defined metadata to attach to the benchmark for organization. @@ -106,7 +103,6 @@ def create( "/v1/benchmarks", body=maybe_transform( { - "is_public": is_public, "name": name, "metadata": metadata, "scenario_ids": scenario_ids, @@ -160,7 +156,6 @@ def update( self, id: str, *, - is_public: bool, name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, @@ -176,8 +171,6 @@ def update( Update a Benchmark with a set of Scenarios. Args: - is_public: Whether this benchmark is public. - name: The name of the Benchmark. This must be unique. metadata: User defined metadata to attach to the benchmark for organization. @@ -200,7 +193,6 @@ def update( f"/v1/benchmarks/{id}", body=maybe_transform( { - "is_public": is_public, "name": name, "metadata": metadata, "scenario_ids": scenario_ids, @@ -442,7 +434,6 @@ def with_streaming_response(self) -> AsyncBenchmarksResourceWithStreamingRespons async def create( self, *, - is_public: bool, name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, @@ -458,8 +449,6 @@ async def create( Create a Benchmark with a set of Scenarios. Args: - is_public: Whether this benchmark is public. - name: The name of the Benchmark. This must be unique. metadata: User defined metadata to attach to the benchmark for organization. @@ -480,7 +469,6 @@ async def create( "/v1/benchmarks", body=await async_maybe_transform( { - "is_public": is_public, "name": name, "metadata": metadata, "scenario_ids": scenario_ids, @@ -534,7 +522,6 @@ async def update( self, id: str, *, - is_public: bool, name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, @@ -550,8 +537,6 @@ async def update( Update a Benchmark with a set of Scenarios. Args: - is_public: Whether this benchmark is public. - name: The name of the Benchmark. This must be unique. metadata: User defined metadata to attach to the benchmark for organization. @@ -574,7 +559,6 @@ async def update( f"/v1/benchmarks/{id}", body=await async_maybe_transform( { - "is_public": is_public, "name": name, "metadata": metadata, "scenario_ids": scenario_ids, diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index d97e4564c..14097dcb9 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -166,7 +166,7 @@ def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, prebuilt: Optional[str] | NotGiven = NOT_GIVEN, - repository_connection: Optional[devbox_create_params.RepositoryConnection] | NotGiven = NOT_GIVEN, + repo_connection_id: Optional[str] | NotGiven = NOT_GIVEN, snapshot_id: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -212,7 +212,7 @@ def create( prebuilt: Reference to prebuilt Blueprint to create the Devbox from. Should not be used together with (Snapshot ID, Blueprint ID, or Blueprint name). - repository_connection: Repository connection parameters for configuring repository integration. + repo_connection_id: Repository connection id the devbox should source its base image from. snapshot_id: Snapshot ID to use for the Devbox. Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified. @@ -241,7 +241,7 @@ def create( "metadata": metadata, "name": name, "prebuilt": prebuilt, - "repository_connection": repository_connection, + "repo_connection_id": repo_connection_id, "snapshot_id": snapshot_id, }, devbox_create_params.DevboxCreateParams, @@ -1299,7 +1299,7 @@ async def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, prebuilt: Optional[str] | NotGiven = NOT_GIVEN, - repository_connection: Optional[devbox_create_params.RepositoryConnection] | NotGiven = NOT_GIVEN, + repo_connection_id: Optional[str] | NotGiven = NOT_GIVEN, snapshot_id: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1345,7 +1345,7 @@ async def create( prebuilt: Reference to prebuilt Blueprint to create the Devbox from. Should not be used together with (Snapshot ID, Blueprint ID, or Blueprint name). - repository_connection: Repository connection parameters for configuring repository integration. + repo_connection_id: Repository connection id the devbox should source its base image from. snapshot_id: Snapshot ID to use for the Devbox. Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified. @@ -1374,7 +1374,7 @@ async def create( "metadata": metadata, "name": name, "prebuilt": prebuilt, - "repository_connection": repository_connection, + "repo_connection_id": repo_connection_id, "snapshot_id": snapshot_id, }, devbox_create_params.DevboxCreateParams, diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index 82e43c43f..5e4ae5132 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -82,7 +82,6 @@ def create( self, *, input_context: InputContextParam, - is_public: bool, name: str, scoring_contract: ScoringContractParam, environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, @@ -103,8 +102,6 @@ def create( Args: input_context: The input context for the Scenario. - is_public: Whether this scenario is public. - name: Name of the scenario. scoring_contract: The scoring contract for the Scenario. @@ -132,7 +129,6 @@ def create( body=maybe_transform( { "input_context": input_context, - "is_public": is_public, "name": name, "scoring_contract": scoring_contract, "environment_parameters": environment_parameters, @@ -189,7 +185,6 @@ def update( id: str, *, input_context: InputContextParam, - is_public: bool, name: str, scoring_contract: ScoringContractParam, environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, @@ -210,8 +205,6 @@ def update( Args: input_context: The input context for the Scenario. - is_public: Whether this scenario is public. - name: Name of the scenario. scoring_contract: The scoring contract for the Scenario. @@ -241,7 +234,6 @@ def update( body=maybe_transform( { "input_context": input_context, - "is_public": is_public, "name": name, "scoring_contract": scoring_contract, "environment_parameters": environment_parameters, @@ -454,7 +446,6 @@ async def create( self, *, input_context: InputContextParam, - is_public: bool, name: str, scoring_contract: ScoringContractParam, environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, @@ -475,8 +466,6 @@ async def create( Args: input_context: The input context for the Scenario. - is_public: Whether this scenario is public. - name: Name of the scenario. scoring_contract: The scoring contract for the Scenario. @@ -504,7 +493,6 @@ async def create( body=await async_maybe_transform( { "input_context": input_context, - "is_public": is_public, "name": name, "scoring_contract": scoring_contract, "environment_parameters": environment_parameters, @@ -561,7 +549,6 @@ async def update( id: str, *, input_context: InputContextParam, - is_public: bool, name: str, scoring_contract: ScoringContractParam, environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, @@ -582,8 +569,6 @@ async def update( Args: input_context: The input context for the Scenario. - is_public: Whether this scenario is public. - name: Name of the scenario. scoring_contract: The scoring contract for the Scenario. @@ -613,7 +598,6 @@ async def update( body=await async_maybe_transform( { "input_context": input_context, - "is_public": is_public, "name": name, "scoring_contract": scoring_contract, "environment_parameters": environment_parameters, diff --git a/src/runloop_api_client/types/benchmark_create_params.py b/src/runloop_api_client/types/benchmark_create_params.py index 7e1621f59..2a46ff0df 100644 --- a/src/runloop_api_client/types/benchmark_create_params.py +++ b/src/runloop_api_client/types/benchmark_create_params.py @@ -9,9 +9,6 @@ class BenchmarkCreateParams(TypedDict, total=False): - is_public: Required[bool] - """Whether this benchmark is public.""" - name: Required[str] """The name of the Benchmark. This must be unique.""" diff --git a/src/runloop_api_client/types/benchmark_update_params.py b/src/runloop_api_client/types/benchmark_update_params.py index a00a379e0..b3c0fd1fe 100644 --- a/src/runloop_api_client/types/benchmark_update_params.py +++ b/src/runloop_api_client/types/benchmark_update_params.py @@ -9,9 +9,6 @@ class BenchmarkUpdateParams(TypedDict, total=False): - is_public: Required[bool] - """Whether this benchmark is public.""" - name: Required[str] """The name of the Benchmark. This must be unique.""" diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 65905f8a3..192fabe73 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -8,7 +8,7 @@ from .shared_params.launch_parameters import LaunchParameters from .shared_params.code_mount_parameters import CodeMountParameters -__all__ = ["DevboxCreateParams", "RepositoryConnection"] +__all__ = ["DevboxCreateParams"] class DevboxCreateParams(TypedDict, total=False): @@ -58,26 +58,11 @@ class DevboxCreateParams(TypedDict, total=False): Should not be used together with (Snapshot ID, Blueprint ID, or Blueprint name). """ - repository_connection: Optional[RepositoryConnection] - """Repository connection parameters for configuring repository integration.""" + repo_connection_id: Optional[str] + """Repository connection id the devbox should source its base image from.""" snapshot_id: Optional[str] """Snapshot ID to use for the Devbox. Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified. """ - - -class RepositoryConnection(TypedDict, total=False): - github_auth_token: Optional[str] - """ - GitHub authentication token for accessing private repositories when using - repository_connection_id. - """ - - repository_connection_id: Optional[str] - """Repository connection ID to use for the Devbox. - - When specified, the latest inspection blueprint will be used and workspace - maintenance commands will be run during boot. - """ diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 0a056748e..6b6be39c5 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -6,7 +6,27 @@ from .._models import BaseModel from .shared.launch_parameters import LaunchParameters -__all__ = ["DevboxView"] +__all__ = ["DevboxView", "StateTransition"] + + +class StateTransition(BaseModel): + status: Optional[ + Literal["provisioning", "initializing", "running", "suspending", "suspended", "resuming", "failure", "shutdown"] + ] = None + """The status of the Devbox. + + provisioning: Runloop is allocating and booting the necessary infrastructure + resources. initializing: Runloop defined boot scripts are running to enable the + environment for interaction. running: The Devbox is ready for interaction. + suspending: The Devbox disk is being snaphsotted and as part of suspension. + suspended: The Devbox disk is saved and no more active compute is being used for + the Devbox. resuming: The Devbox disk is being loaded as part of booting a + suspended Devbox. failure: The Devbox failed as part of booting or running user + requested actions. shutdown: The Devbox was successfully shutdown and no more + active compute is being used. + """ + + transition_time_ms: Optional[object] = None class DevboxView(BaseModel): @@ -29,6 +49,9 @@ class DevboxView(BaseModel): metadata: Dict[str, str] """The user defined Devbox metadata.""" + state_transitions: List[StateTransition] + """A list of state transitions in order with durations""" + status: Literal[ "provisioning", "initializing", "running", "suspending", "suspended", "resuming", "failure", "shutdown" ] diff --git a/src/runloop_api_client/types/repository_inspection_details.py b/src/runloop_api_client/types/repository_inspection_details.py index 4f685e09b..c978586a7 100644 --- a/src/runloop_api_client/types/repository_inspection_details.py +++ b/src/runloop_api_client/types/repository_inspection_details.py @@ -10,6 +10,9 @@ class RepositoryInspectionDetails(BaseModel): + id: str + """The ID of the inspection.""" + commit_sha: str """The sha of the inspected version of the Repository.""" @@ -29,6 +32,7 @@ class RepositoryInspectionDetails(BaseModel): "inspection_success", "image_build_success", "image_build_failure", + "inspection_user_manifest_added", ] """The status of the repository inspection.""" @@ -37,3 +41,9 @@ class RepositoryInspectionDetails(BaseModel): blueprint_name: Optional[str] = None """The blueprint name associated with this inspection if successful.""" + + user_manifest: Optional[RepositoryManifestView] = None + """ + User uploaded repository manifest containing container config and workspace + details. + """ diff --git a/src/runloop_api_client/types/scenario_create_params.py b/src/runloop_api_client/types/scenario_create_params.py index b311c62b3..5bd2f3d90 100644 --- a/src/runloop_api_client/types/scenario_create_params.py +++ b/src/runloop_api_client/types/scenario_create_params.py @@ -16,9 +16,6 @@ class ScenarioCreateParams(TypedDict, total=False): input_context: Required[InputContextParam] """The input context for the Scenario.""" - is_public: Required[bool] - """Whether this scenario is public.""" - name: Required[str] """Name of the scenario.""" diff --git a/src/runloop_api_client/types/scenario_update_params.py b/src/runloop_api_client/types/scenario_update_params.py index 4c0ef1ad8..1004e7bc8 100644 --- a/src/runloop_api_client/types/scenario_update_params.py +++ b/src/runloop_api_client/types/scenario_update_params.py @@ -16,9 +16,6 @@ class ScenarioUpdateParams(TypedDict, total=False): input_context: Required[InputContextParam] """The input context for the Scenario.""" - is_public: Required[bool] - """Whether this scenario is public.""" - name: Required[str] """Name of the scenario.""" diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py index c065cd847..c453baf0a 100644 --- a/tests/api_resources/test_benchmarks.py +++ b/tests/api_resources/test_benchmarks.py @@ -25,7 +25,6 @@ class TestBenchmarks: @parametrize def test_method_create(self, client: Runloop) -> None: benchmark = client.benchmarks.create( - is_public=True, name="name", ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -33,7 +32,6 @@ def test_method_create(self, client: Runloop) -> None: @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: benchmark = client.benchmarks.create( - is_public=True, name="name", metadata={"foo": "string"}, scenario_ids=["string"], @@ -43,7 +41,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: @parametrize def test_raw_response_create(self, client: Runloop) -> None: response = client.benchmarks.with_raw_response.create( - is_public=True, name="name", ) @@ -55,7 +52,6 @@ def test_raw_response_create(self, client: Runloop) -> None: @parametrize def test_streaming_response_create(self, client: Runloop) -> None: with client.benchmarks.with_streaming_response.create( - is_public=True, name="name", ) as response: assert not response.is_closed @@ -108,7 +104,6 @@ def test_path_params_retrieve(self, client: Runloop) -> None: def test_method_update(self, client: Runloop) -> None: benchmark = client.benchmarks.update( id="id", - is_public=True, name="name", ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -117,7 +112,6 @@ def test_method_update(self, client: Runloop) -> None: def test_method_update_with_all_params(self, client: Runloop) -> None: benchmark = client.benchmarks.update( id="id", - is_public=True, name="name", metadata={"foo": "string"}, scenario_ids=["string"], @@ -128,7 +122,6 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: def test_raw_response_update(self, client: Runloop) -> None: response = client.benchmarks.with_raw_response.update( id="id", - is_public=True, name="name", ) @@ -141,7 +134,6 @@ def test_raw_response_update(self, client: Runloop) -> None: def test_streaming_response_update(self, client: Runloop) -> None: with client.benchmarks.with_streaming_response.update( id="id", - is_public=True, name="name", ) as response: assert not response.is_closed @@ -157,7 +149,6 @@ def test_path_params_update(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.benchmarks.with_raw_response.update( id="", - is_public=True, name="name", ) @@ -321,7 +312,6 @@ class TestAsyncBenchmarks: @parametrize async def test_method_create(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.create( - is_public=True, name="name", ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -329,7 +319,6 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.create( - is_public=True, name="name", metadata={"foo": "string"}, scenario_ids=["string"], @@ -339,7 +328,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - @parametrize async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: response = await async_client.benchmarks.with_raw_response.create( - is_public=True, name="name", ) @@ -351,7 +339,6 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: async with async_client.benchmarks.with_streaming_response.create( - is_public=True, name="name", ) as response: assert not response.is_closed @@ -404,7 +391,6 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: async def test_method_update(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.update( id="id", - is_public=True, name="name", ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -413,7 +399,6 @@ async def test_method_update(self, async_client: AsyncRunloop) -> None: async def test_method_update_with_all_params(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.update( id="id", - is_public=True, name="name", metadata={"foo": "string"}, scenario_ids=["string"], @@ -424,7 +409,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: response = await async_client.benchmarks.with_raw_response.update( id="id", - is_public=True, name="name", ) @@ -437,7 +421,6 @@ async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: async def test_streaming_response_update(self, async_client: AsyncRunloop) -> None: async with async_client.benchmarks.with_streaming_response.update( id="id", - is_public=True, name="name", ) as response: assert not response.is_closed @@ -453,7 +436,6 @@ async def test_path_params_update(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.benchmarks.with_raw_response.update( id="", - is_public=True, name="name", ) diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 1af1bbb6f..7097c6f69 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -79,10 +79,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: metadata={"foo": "string"}, name="name", prebuilt="prebuilt", - repository_connection={ - "github_auth_token": "github_auth_token", - "repository_connection_id": "repository_connection_id", - }, + repo_connection_id="repo_connection_id", snapshot_id="snapshot_id", ) assert_matches_type(DevboxView, devbox, path=["response"]) @@ -1012,10 +1009,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - metadata={"foo": "string"}, name="name", prebuilt="prebuilt", - repository_connection={ - "github_auth_token": "github_auth_token", - "repository_connection_id": "repository_connection_id", - }, + repo_connection_id="repo_connection_id", snapshot_id="snapshot_id", ) assert_matches_type(DevboxView, devbox, path=["response"]) diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index a55134679..7e77cd2a9 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -25,7 +25,6 @@ class TestScenarios: def test_method_create(self, client: Runloop) -> None: scenario = client.scenarios.create( input_context={"problem_statement": "problem_statement"}, - is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -50,7 +49,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "problem_statement": "problem_statement", "additional_context": {}, }, - is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -98,7 +96,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: def test_raw_response_create(self, client: Runloop) -> None: response = client.scenarios.with_raw_response.create( input_context={"problem_statement": "problem_statement"}, - is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -124,7 +121,6 @@ def test_raw_response_create(self, client: Runloop) -> None: def test_streaming_response_create(self, client: Runloop) -> None: with client.scenarios.with_streaming_response.create( input_context={"problem_statement": "problem_statement"}, - is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -191,7 +187,6 @@ def test_method_update(self, client: Runloop) -> None: scenario = client.scenarios.update( id="id", input_context={"problem_statement": "problem_statement"}, - is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -217,7 +212,6 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: "problem_statement": "problem_statement", "additional_context": {}, }, - is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -266,7 +260,6 @@ def test_raw_response_update(self, client: Runloop) -> None: response = client.scenarios.with_raw_response.update( id="id", input_context={"problem_statement": "problem_statement"}, - is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -293,7 +286,6 @@ def test_streaming_response_update(self, client: Runloop) -> None: with client.scenarios.with_streaming_response.update( id="id", input_context={"problem_statement": "problem_statement"}, - is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -323,7 +315,6 @@ def test_path_params_update(self, client: Runloop) -> None: client.scenarios.with_raw_response.update( id="", input_context={"problem_statement": "problem_statement"}, - is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -457,7 +448,6 @@ class TestAsyncScenarios: async def test_method_create(self, async_client: AsyncRunloop) -> None: scenario = await async_client.scenarios.create( input_context={"problem_statement": "problem_statement"}, - is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -482,7 +472,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "problem_statement": "problem_statement", "additional_context": {}, }, - is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -530,7 +519,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: response = await async_client.scenarios.with_raw_response.create( input_context={"problem_statement": "problem_statement"}, - is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -556,7 +544,6 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: async with async_client.scenarios.with_streaming_response.create( input_context={"problem_statement": "problem_statement"}, - is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -623,7 +610,6 @@ async def test_method_update(self, async_client: AsyncRunloop) -> None: scenario = await async_client.scenarios.update( id="id", input_context={"problem_statement": "problem_statement"}, - is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -649,7 +635,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - "problem_statement": "problem_statement", "additional_context": {}, }, - is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -698,7 +683,6 @@ async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: response = await async_client.scenarios.with_raw_response.update( id="id", input_context={"problem_statement": "problem_statement"}, - is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -725,7 +709,6 @@ async def test_streaming_response_update(self, async_client: AsyncRunloop) -> No async with async_client.scenarios.with_streaming_response.update( id="id", input_context={"problem_statement": "problem_statement"}, - is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ @@ -755,7 +738,6 @@ async def test_path_params_update(self, async_client: AsyncRunloop) -> None: await async_client.scenarios.with_raw_response.update( id="", input_context={"problem_statement": "problem_statement"}, - is_public=True, name="name", scoring_contract={ "scoring_function_parameters": [ From bb1eebe8360d775ba7e73337bedfb48938c64acd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 18:27:47 +0000 Subject: [PATCH 760/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1b5dc400b..0a40b9d77 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.39.0" + ".": "0.40.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 2a900f11a..e3cc18f2a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.39.0" +version = "0.40.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index b6c29df97..30ecb38ba 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.39.0" # x-release-please-version +__version__ = "0.40.0" # x-release-please-version From 614ec06671884dcf955003d81419d4b7e0ac6b98 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 23:12:18 +0000 Subject: [PATCH 761/993] feat(api): api update --- .stats.yml | 4 ++-- .../resources/devboxes/devboxes.py | 14 ++++++++++++++ .../types/devbox_create_params.py | 8 ++++++++ tests/api_resources/test_devboxes.py | 2 ++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4abf1099f..763a7a7ea 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 87 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c23f8f8426208651ecf7b2a4108ea2003c6e3241c6928e88ef004f76fe826c08.yml -openapi_spec_hash: 2eee5118b3c2dd49f9124df0d10341ed +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-028690466821f7d03fc038928ce12d65025db071b8a74b9c1fb39309e40a99ec.yml +openapi_spec_hash: a6433c9e1bcf8cb3b4e23413ad6f7f11 config_hash: 4514558503b7aa6eba8c2941564c247d diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 14097dcb9..4623b40d7 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -167,6 +167,7 @@ def create( name: Optional[str] | NotGiven = NOT_GIVEN, prebuilt: Optional[str] | NotGiven = NOT_GIVEN, repo_connection_id: Optional[str] | NotGiven = NOT_GIVEN, + secrets: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, snapshot_id: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -214,6 +215,11 @@ def create( repo_connection_id: Repository connection id the devbox should source its base image from. + secrets: (Optional) Map of environment variable names to secret names. The secret values + will be securely injected as environment variables in the Devbox. Example: + {"DB_PASS": "DATABASE_PASSWORD"} sets environment variable 'DB_PASS' to the + value of secret 'DATABASE_PASSWORD'. + snapshot_id: Snapshot ID to use for the Devbox. Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified. @@ -242,6 +248,7 @@ def create( "name": name, "prebuilt": prebuilt, "repo_connection_id": repo_connection_id, + "secrets": secrets, "snapshot_id": snapshot_id, }, devbox_create_params.DevboxCreateParams, @@ -1300,6 +1307,7 @@ async def create( name: Optional[str] | NotGiven = NOT_GIVEN, prebuilt: Optional[str] | NotGiven = NOT_GIVEN, repo_connection_id: Optional[str] | NotGiven = NOT_GIVEN, + secrets: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, snapshot_id: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1347,6 +1355,11 @@ async def create( repo_connection_id: Repository connection id the devbox should source its base image from. + secrets: (Optional) Map of environment variable names to secret names. The secret values + will be securely injected as environment variables in the Devbox. Example: + {"DB_PASS": "DATABASE_PASSWORD"} sets environment variable 'DB_PASS' to the + value of secret 'DATABASE_PASSWORD'. + snapshot_id: Snapshot ID to use for the Devbox. Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified. @@ -1375,6 +1388,7 @@ async def create( "name": name, "prebuilt": prebuilt, "repo_connection_id": repo_connection_id, + "secrets": secrets, "snapshot_id": snapshot_id, }, devbox_create_params.DevboxCreateParams, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 192fabe73..d35ab34a5 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -61,6 +61,14 @@ class DevboxCreateParams(TypedDict, total=False): repo_connection_id: Optional[str] """Repository connection id the devbox should source its base image from.""" + secrets: Optional[Dict[str, str]] + """(Optional) Map of environment variable names to secret names. + + The secret values will be securely injected as environment variables in the + Devbox. Example: {"DB_PASS": "DATABASE_PASSWORD"} sets environment variable + 'DB_PASS' to the value of secret 'DATABASE_PASSWORD'. + """ + snapshot_id: Optional[str] """Snapshot ID to use for the Devbox. diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 7097c6f69..f9402f955 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -80,6 +80,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: name="name", prebuilt="prebuilt", repo_connection_id="repo_connection_id", + secrets={"foo": "string"}, snapshot_id="snapshot_id", ) assert_matches_type(DevboxView, devbox, path=["response"]) @@ -1010,6 +1011,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - name="name", prebuilt="prebuilt", repo_connection_id="repo_connection_id", + secrets={"foo": "string"}, snapshot_id="snapshot_id", ) assert_matches_type(DevboxView, devbox, path=["response"]) From 45f3ebc2adc2eab993d5e0d05c540005bee60f97 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 23:32:02 +0000 Subject: [PATCH 762/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 763a7a7ea..d90c138a9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 87 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-028690466821f7d03fc038928ce12d65025db071b8a74b9c1fb39309e40a99ec.yml openapi_spec_hash: a6433c9e1bcf8cb3b4e23413ad6f7f11 -config_hash: 4514558503b7aa6eba8c2941564c247d +config_hash: 421e8d0e71c7ef71fdfebede08ea7271 From e9dd7c58988de2f926fcf43bcf87d58b5ae35ed0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 23:39:07 +0000 Subject: [PATCH 763/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0a40b9d77..ea2682c30 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.40.0" + ".": "0.41.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index e3cc18f2a..c2161ff26 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.40.0" +version = "0.41.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 30ecb38ba..262799d1e 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.40.0" # x-release-please-version +__version__ = "0.41.0" # x-release-please-version From 72c557f51f3e756fa247e25f056d064276169077 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Jun 2025 01:41:28 +0000 Subject: [PATCH 764/993] feat(api): api update --- .stats.yml | 6 +- api.md | 20 + src/runloop_api_client/_client.py | 10 +- src/runloop_api_client/resources/__init__.py | 14 + src/runloop_api_client/resources/secrets.py | 468 ++++++++++++++++++ src/runloop_api_client/types/__init__.py | 4 + .../types/secret_create_params.py | 23 + .../types/secret_list_view.py | 22 + .../types/secret_update_params.py | 16 + src/runloop_api_client/types/secret_view.py | 22 + tests/api_resources/test_secrets.py | 300 +++++++++++ 11 files changed, 901 insertions(+), 4 deletions(-) create mode 100644 src/runloop_api_client/resources/secrets.py create mode 100644 src/runloop_api_client/types/secret_create_params.py create mode 100644 src/runloop_api_client/types/secret_list_view.py create mode 100644 src/runloop_api_client/types/secret_update_params.py create mode 100644 src/runloop_api_client/types/secret_view.py create mode 100644 tests/api_resources/test_secrets.py diff --git a/.stats.yml b/.stats.yml index d90c138a9..9af3f652d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 87 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-028690466821f7d03fc038928ce12d65025db071b8a74b9c1fb39309e40a99ec.yml -openapi_spec_hash: a6433c9e1bcf8cb3b4e23413ad6f7f11 +configured_endpoints: 91 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-86c4a065b1820b26c7afd40bbc374e87dd5e9c2ffa0abad26e7fd4ebec1cf72b.yml +openapi_spec_hash: 6c6a44548177464033f3c174c89ba06a config_hash: 421e8d0e71c7ef71fdfebede08ea7271 diff --git a/api.md b/api.md index ce2831ca0..da4195d42 100644 --- a/api.md +++ b/api.md @@ -340,3 +340,23 @@ Methods: - client.repositories.delete(id) -> object - client.repositories.list_inspections(id) -> RepositoryInspectionListView - client.repositories.refresh(id, \*\*params) -> object + +# Secrets + +Types: + +```python +from runloop_api_client.types import ( + SecretCreateParameters, + SecretListView, + SecretUpdateParameters, + SecretView, +) +``` + +Methods: + +- client.secrets.create(\*\*params) -> SecretView +- client.secrets.update(name, \*\*params) -> SecretView +- client.secrets.list() -> SecretListView +- client.secrets.delete(name) -> SecretView diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index babaea83b..ff8c86578 100644 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -21,7 +21,7 @@ ) from ._utils import is_given, get_async_library from ._version import __version__ -from .resources import blueprints, repositories +from .resources import secrets, blueprints, repositories from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import RunloopError, APIStatusError from ._base_client import ( @@ -42,6 +42,7 @@ class Runloop(SyncAPIClient): devboxes: devboxes.DevboxesResource scenarios: scenarios.ScenariosResource repositories: repositories.RepositoriesResource + secrets: secrets.SecretsResource with_raw_response: RunloopWithRawResponse with_streaming_response: RunloopWithStreamedResponse @@ -106,6 +107,7 @@ def __init__( self.devboxes = devboxes.DevboxesResource(self) self.scenarios = scenarios.ScenariosResource(self) self.repositories = repositories.RepositoriesResource(self) + self.secrets = secrets.SecretsResource(self) self.with_raw_response = RunloopWithRawResponse(self) self.with_streaming_response = RunloopWithStreamedResponse(self) @@ -220,6 +222,7 @@ class AsyncRunloop(AsyncAPIClient): devboxes: devboxes.AsyncDevboxesResource scenarios: scenarios.AsyncScenariosResource repositories: repositories.AsyncRepositoriesResource + secrets: secrets.AsyncSecretsResource with_raw_response: AsyncRunloopWithRawResponse with_streaming_response: AsyncRunloopWithStreamedResponse @@ -284,6 +287,7 @@ def __init__( self.devboxes = devboxes.AsyncDevboxesResource(self) self.scenarios = scenarios.AsyncScenariosResource(self) self.repositories = repositories.AsyncRepositoriesResource(self) + self.secrets = secrets.AsyncSecretsResource(self) self.with_raw_response = AsyncRunloopWithRawResponse(self) self.with_streaming_response = AsyncRunloopWithStreamedResponse(self) @@ -399,6 +403,7 @@ def __init__(self, client: Runloop) -> None: self.devboxes = devboxes.DevboxesResourceWithRawResponse(client.devboxes) self.scenarios = scenarios.ScenariosResourceWithRawResponse(client.scenarios) self.repositories = repositories.RepositoriesResourceWithRawResponse(client.repositories) + self.secrets = secrets.SecretsResourceWithRawResponse(client.secrets) class AsyncRunloopWithRawResponse: @@ -408,6 +413,7 @@ def __init__(self, client: AsyncRunloop) -> None: self.devboxes = devboxes.AsyncDevboxesResourceWithRawResponse(client.devboxes) self.scenarios = scenarios.AsyncScenariosResourceWithRawResponse(client.scenarios) self.repositories = repositories.AsyncRepositoriesResourceWithRawResponse(client.repositories) + self.secrets = secrets.AsyncSecretsResourceWithRawResponse(client.secrets) class RunloopWithStreamedResponse: @@ -417,6 +423,7 @@ def __init__(self, client: Runloop) -> None: self.devboxes = devboxes.DevboxesResourceWithStreamingResponse(client.devboxes) self.scenarios = scenarios.ScenariosResourceWithStreamingResponse(client.scenarios) self.repositories = repositories.RepositoriesResourceWithStreamingResponse(client.repositories) + self.secrets = secrets.SecretsResourceWithStreamingResponse(client.secrets) class AsyncRunloopWithStreamedResponse: @@ -426,6 +433,7 @@ def __init__(self, client: AsyncRunloop) -> None: self.devboxes = devboxes.AsyncDevboxesResourceWithStreamingResponse(client.devboxes) self.scenarios = scenarios.AsyncScenariosResourceWithStreamingResponse(client.scenarios) self.repositories = repositories.AsyncRepositoriesResourceWithStreamingResponse(client.repositories) + self.secrets = secrets.AsyncSecretsResourceWithStreamingResponse(client.secrets) Client = Runloop diff --git a/src/runloop_api_client/resources/__init__.py b/src/runloop_api_client/resources/__init__.py index 2c103b15e..c493ac8c7 100644 --- a/src/runloop_api_client/resources/__init__.py +++ b/src/runloop_api_client/resources/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .secrets import ( + SecretsResource, + AsyncSecretsResource, + SecretsResourceWithRawResponse, + AsyncSecretsResourceWithRawResponse, + SecretsResourceWithStreamingResponse, + AsyncSecretsResourceWithStreamingResponse, +) from .devboxes import ( DevboxesResource, AsyncDevboxesResource, @@ -72,4 +80,10 @@ "AsyncRepositoriesResourceWithRawResponse", "RepositoriesResourceWithStreamingResponse", "AsyncRepositoriesResourceWithStreamingResponse", + "SecretsResource", + "AsyncSecretsResource", + "SecretsResourceWithRawResponse", + "AsyncSecretsResourceWithRawResponse", + "SecretsResourceWithStreamingResponse", + "AsyncSecretsResourceWithStreamingResponse", ] diff --git a/src/runloop_api_client/resources/secrets.py b/src/runloop_api_client/resources/secrets.py new file mode 100644 index 000000000..d6eb94c7a --- /dev/null +++ b/src/runloop_api_client/resources/secrets.py @@ -0,0 +1,468 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..types import secret_create_params, secret_update_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import maybe_transform, async_maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.secret_view import SecretView +from ..types.secret_list_view import SecretListView + +__all__ = ["SecretsResource", "AsyncSecretsResource"] + + +class SecretsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> SecretsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return SecretsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> SecretsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return SecretsResourceWithStreamingResponse(self) + + def create( + self, + *, + name: str, + value: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> SecretView: + """Create a new Secret with a globally unique name and value. + + The Secret will be + encrypted at rest and made available as an environment variable in Devboxes. + + Args: + name: The globally unique name for the Secret. Must be a valid environment variable + name (alphanumeric and underscores only). Example: 'DATABASE_PASSWORD' + + value: The value to store for this Secret. This will be encrypted at rest and made + available as an environment variable in Devboxes. Example: 'my-secure-password' + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/v1/secrets", + body=maybe_transform( + { + "name": name, + "value": value, + }, + secret_create_params.SecretCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=SecretView, + ) + + def update( + self, + name: str, + *, + value: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> SecretView: + """Update the value of an existing Secret by name. + + The new value will be encrypted + at rest. + + Args: + value: The new value for the Secret. This will replace the existing value and be + encrypted at rest. Example: 'my-updated-secure-password' + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not name: + raise ValueError(f"Expected a non-empty value for `name` but received {name!r}") + return self._post( + f"/v1/secrets/{name}", + body=maybe_transform({"value": value}, secret_update_params.SecretUpdateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=SecretView, + ) + + def list( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SecretListView: + """List all Secrets for the authenticated account. + + Secret values are not included + for security reasons. + """ + return self._get( + "/v1/secrets", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SecretListView, + ) + + def delete( + self, + name: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> SecretView: + """Delete an existing Secret by name. + + This action is irreversible and will remove + the Secret from all Devboxes. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not name: + raise ValueError(f"Expected a non-empty value for `name` but received {name!r}") + return self._post( + f"/v1/secrets/{name}/delete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=SecretView, + ) + + +class AsyncSecretsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncSecretsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncSecretsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncSecretsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncSecretsResourceWithStreamingResponse(self) + + async def create( + self, + *, + name: str, + value: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> SecretView: + """Create a new Secret with a globally unique name and value. + + The Secret will be + encrypted at rest and made available as an environment variable in Devboxes. + + Args: + name: The globally unique name for the Secret. Must be a valid environment variable + name (alphanumeric and underscores only). Example: 'DATABASE_PASSWORD' + + value: The value to store for this Secret. This will be encrypted at rest and made + available as an environment variable in Devboxes. Example: 'my-secure-password' + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/v1/secrets", + body=await async_maybe_transform( + { + "name": name, + "value": value, + }, + secret_create_params.SecretCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=SecretView, + ) + + async def update( + self, + name: str, + *, + value: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> SecretView: + """Update the value of an existing Secret by name. + + The new value will be encrypted + at rest. + + Args: + value: The new value for the Secret. This will replace the existing value and be + encrypted at rest. Example: 'my-updated-secure-password' + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not name: + raise ValueError(f"Expected a non-empty value for `name` but received {name!r}") + return await self._post( + f"/v1/secrets/{name}", + body=await async_maybe_transform({"value": value}, secret_update_params.SecretUpdateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=SecretView, + ) + + async def list( + self, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SecretListView: + """List all Secrets for the authenticated account. + + Secret values are not included + for security reasons. + """ + return await self._get( + "/v1/secrets", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=SecretListView, + ) + + async def delete( + self, + name: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> SecretView: + """Delete an existing Secret by name. + + This action is irreversible and will remove + the Secret from all Devboxes. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not name: + raise ValueError(f"Expected a non-empty value for `name` but received {name!r}") + return await self._post( + f"/v1/secrets/{name}/delete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=SecretView, + ) + + +class SecretsResourceWithRawResponse: + def __init__(self, secrets: SecretsResource) -> None: + self._secrets = secrets + + self.create = to_raw_response_wrapper( + secrets.create, + ) + self.update = to_raw_response_wrapper( + secrets.update, + ) + self.list = to_raw_response_wrapper( + secrets.list, + ) + self.delete = to_raw_response_wrapper( + secrets.delete, + ) + + +class AsyncSecretsResourceWithRawResponse: + def __init__(self, secrets: AsyncSecretsResource) -> None: + self._secrets = secrets + + self.create = async_to_raw_response_wrapper( + secrets.create, + ) + self.update = async_to_raw_response_wrapper( + secrets.update, + ) + self.list = async_to_raw_response_wrapper( + secrets.list, + ) + self.delete = async_to_raw_response_wrapper( + secrets.delete, + ) + + +class SecretsResourceWithStreamingResponse: + def __init__(self, secrets: SecretsResource) -> None: + self._secrets = secrets + + self.create = to_streamed_response_wrapper( + secrets.create, + ) + self.update = to_streamed_response_wrapper( + secrets.update, + ) + self.list = to_streamed_response_wrapper( + secrets.list, + ) + self.delete = to_streamed_response_wrapper( + secrets.delete, + ) + + +class AsyncSecretsResourceWithStreamingResponse: + def __init__(self, secrets: AsyncSecretsResource) -> None: + self._secrets = secrets + + self.create = async_to_streamed_response_wrapper( + secrets.create, + ) + self.update = async_to_streamed_response_wrapper( + secrets.update, + ) + self.list = async_to_streamed_response_wrapper( + secrets.list, + ) + self.delete = async_to_streamed_response_wrapper( + secrets.delete, + ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 3428ea1c9..12c611295 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -8,6 +8,7 @@ CodeMountParameters as CodeMountParameters, ) from .devbox_view import DevboxView as DevboxView +from .secret_view import SecretView as SecretView from .input_context import InputContext as InputContext from .scenario_view import ScenarioView as ScenarioView from .benchmark_view import BenchmarkView as BenchmarkView @@ -15,6 +16,7 @@ from .devbox_list_view import DevboxListView as DevboxListView from .scoring_contract import ScoringContract as ScoringContract from .scoring_function import ScoringFunction as ScoringFunction +from .secret_list_view import SecretListView as SecretListView from .scenario_run_view import ScenarioRunView as ScenarioRunView from .benchmark_run_view import BenchmarkRunView as BenchmarkRunView from .devbox_list_params import DevboxListParams as DevboxListParams @@ -27,6 +29,8 @@ from .devbox_update_params import DevboxUpdateParams as DevboxUpdateParams from .scenario_environment import ScenarioEnvironment as ScenarioEnvironment from .scenario_list_params import ScenarioListParams as ScenarioListParams +from .secret_create_params import SecretCreateParams as SecretCreateParams +from .secret_update_params import SecretUpdateParams as SecretUpdateParams from .benchmark_list_params import BenchmarkListParams as BenchmarkListParams from .blueprint_list_params import BlueprintListParams as BlueprintListParams from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView diff --git a/src/runloop_api_client/types/secret_create_params.py b/src/runloop_api_client/types/secret_create_params.py new file mode 100644 index 000000000..5d5234b56 --- /dev/null +++ b/src/runloop_api_client/types/secret_create_params.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["SecretCreateParams"] + + +class SecretCreateParams(TypedDict, total=False): + name: Required[str] + """The globally unique name for the Secret. + + Must be a valid environment variable name (alphanumeric and underscores only). + Example: 'DATABASE_PASSWORD' + """ + + value: Required[str] + """The value to store for this Secret. + + This will be encrypted at rest and made available as an environment variable in + Devboxes. Example: 'my-secure-password' + """ diff --git a/src/runloop_api_client/types/secret_list_view.py b/src/runloop_api_client/types/secret_list_view.py new file mode 100644 index 000000000..d7feec9c5 --- /dev/null +++ b/src/runloop_api_client/types/secret_list_view.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .secret_view import SecretView + +__all__ = ["SecretListView"] + + +class SecretListView(BaseModel): + has_more: bool + """True if there are more results available beyond this page.""" + + remaining_count: int + """Number of Secrets remaining after this page.""" + + secrets: List[SecretView] + """List of Secret objects. Values are omitted for security.""" + + total_count: int + """Total number of Secrets across all pages.""" diff --git a/src/runloop_api_client/types/secret_update_params.py b/src/runloop_api_client/types/secret_update_params.py new file mode 100644 index 000000000..5b5af9a0f --- /dev/null +++ b/src/runloop_api_client/types/secret_update_params.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["SecretUpdateParams"] + + +class SecretUpdateParams(TypedDict, total=False): + value: Required[str] + """The new value for the Secret. + + This will replace the existing value and be encrypted at rest. Example: + 'my-updated-secure-password' + """ diff --git a/src/runloop_api_client/types/secret_view.py b/src/runloop_api_client/types/secret_view.py new file mode 100644 index 000000000..1303f7bfd --- /dev/null +++ b/src/runloop_api_client/types/secret_view.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .._models import BaseModel + +__all__ = ["SecretView"] + + +class SecretView(BaseModel): + id: str + """The unique identifier of the Secret.""" + + create_time_ms: int + """Creation time of the Secret (Unix timestamp in milliseconds).""" + + name: str + """The globally unique name of the Secret. + + Used as the environment variable name in Devboxes. + """ + + update_time_ms: int + """Last update time of the Secret (Unix timestamp in milliseconds).""" diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py new file mode 100644 index 000000000..730447d77 --- /dev/null +++ b/tests/api_resources/test_secrets.py @@ -0,0 +1,300 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types import SecretView, SecretListView + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestSecrets: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Runloop) -> None: + secret = client.secrets.create( + name="name", + value="value", + ) + assert_matches_type(SecretView, secret, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Runloop) -> None: + response = client.secrets.with_raw_response.create( + name="name", + value="value", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + secret = response.parse() + assert_matches_type(SecretView, secret, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Runloop) -> None: + with client.secrets.with_streaming_response.create( + name="name", + value="value", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + secret = response.parse() + assert_matches_type(SecretView, secret, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_update(self, client: Runloop) -> None: + secret = client.secrets.update( + name="name", + value="value", + ) + assert_matches_type(SecretView, secret, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Runloop) -> None: + response = client.secrets.with_raw_response.update( + name="name", + value="value", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + secret = response.parse() + assert_matches_type(SecretView, secret, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Runloop) -> None: + with client.secrets.with_streaming_response.update( + name="name", + value="value", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + secret = response.parse() + assert_matches_type(SecretView, secret, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `name` but received ''"): + client.secrets.with_raw_response.update( + name="", + value="value", + ) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + secret = client.secrets.list() + assert_matches_type(SecretListView, secret, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.secrets.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + secret = response.parse() + assert_matches_type(SecretListView, secret, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.secrets.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + secret = response.parse() + assert_matches_type(SecretListView, secret, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_delete(self, client: Runloop) -> None: + secret = client.secrets.delete( + "name", + ) + assert_matches_type(SecretView, secret, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Runloop) -> None: + response = client.secrets.with_raw_response.delete( + "name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + secret = response.parse() + assert_matches_type(SecretView, secret, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Runloop) -> None: + with client.secrets.with_streaming_response.delete( + "name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + secret = response.parse() + assert_matches_type(SecretView, secret, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `name` but received ''"): + client.secrets.with_raw_response.delete( + "", + ) + + +class TestAsyncSecrets: + parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + async def test_method_create(self, async_client: AsyncRunloop) -> None: + secret = await async_client.secrets.create( + name="name", + value="value", + ) + assert_matches_type(SecretView, secret, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: + response = await async_client.secrets.with_raw_response.create( + name="name", + value="value", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + secret = await response.parse() + assert_matches_type(SecretView, secret, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: + async with async_client.secrets.with_streaming_response.create( + name="name", + value="value", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + secret = await response.parse() + assert_matches_type(SecretView, secret, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update(self, async_client: AsyncRunloop) -> None: + secret = await async_client.secrets.update( + name="name", + value="value", + ) + assert_matches_type(SecretView, secret, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: + response = await async_client.secrets.with_raw_response.update( + name="name", + value="value", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + secret = await response.parse() + assert_matches_type(SecretView, secret, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncRunloop) -> None: + async with async_client.secrets.with_streaming_response.update( + name="name", + value="value", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + secret = await response.parse() + assert_matches_type(SecretView, secret, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `name` but received ''"): + await async_client.secrets.with_raw_response.update( + name="", + value="value", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + secret = await async_client.secrets.list() + assert_matches_type(SecretListView, secret, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.secrets.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + secret = await response.parse() + assert_matches_type(SecretListView, secret, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.secrets.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + secret = await response.parse() + assert_matches_type(SecretListView, secret, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete(self, async_client: AsyncRunloop) -> None: + secret = await async_client.secrets.delete( + "name", + ) + assert_matches_type(SecretView, secret, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncRunloop) -> None: + response = await async_client.secrets.with_raw_response.delete( + "name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + secret = await response.parse() + assert_matches_type(SecretView, secret, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncRunloop) -> None: + async with async_client.secrets.with_streaming_response.delete( + "name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + secret = await response.parse() + assert_matches_type(SecretView, secret, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `name` but received ''"): + await async_client.secrets.with_raw_response.delete( + "", + ) From 8ff98b72d10de30f489c0a8703cc123179644e8c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Jun 2025 17:37:03 +0000 Subject: [PATCH 765/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ea2682c30..52afe059d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.41.0" + ".": "0.42.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index c2161ff26..c61d56fec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.41.0" +version = "0.42.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 262799d1e..dee24268d 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.41.0" # x-release-please-version +__version__ = "0.42.0" # x-release-please-version From 515c6149158d5248e59cf28f224817e0cfda6cbf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Jun 2025 02:09:11 +0000 Subject: [PATCH 766/993] chore(tests): run tests in parallel --- pyproject.toml | 3 ++- requirements-dev.lock | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c61d56fec..d0011aa21 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,6 +54,7 @@ dev-dependencies = [ "importlib-metadata>=6.7.0", "rich>=13.7.1", "nest_asyncio==1.6.0", + "pytest-xdist>=3.6.1", ] [tool.rye.scripts] @@ -125,7 +126,7 @@ replacement = '[\1](https://github.com/runloopai/api-client-python/tree/main/\g< [tool.pytest.ini_options] testpaths = ["tests"] -addopts = "--tb=short" +addopts = "--tb=short -n auto" xfail_strict = true asyncio_mode = "auto" asyncio_default_fixture_loop_scope = "session" diff --git a/requirements-dev.lock b/requirements-dev.lock index 1e04b71cc..3063be477 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -30,6 +30,8 @@ distro==1.8.0 exceptiongroup==1.2.2 # via anyio # via pytest +execnet==2.1.1 + # via pytest-xdist filelock==3.12.4 # via virtualenv h11==0.14.0 @@ -72,7 +74,9 @@ pygments==2.18.0 pyright==1.1.399 pytest==8.3.3 # via pytest-asyncio + # via pytest-xdist pytest-asyncio==0.24.0 +pytest-xdist==3.7.0 python-dateutil==2.8.2 # via time-machine pytz==2023.3.post1 From 7df6775be7434c65ee56ce6d59da2e8e103a3a8e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Jun 2025 02:34:20 +0000 Subject: [PATCH 767/993] fix(client): correctly parse binary response | stream --- src/runloop_api_client/_base_client.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index bba4933f3..74864535d 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -1071,7 +1071,14 @@ def _process_response( ) -> ResponseT: origin = get_origin(cast_to) or cast_to - if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse): + if ( + inspect.isclass(origin) + and issubclass(origin, BaseAPIResponse) + # we only want to actually return the custom BaseAPIResponse class if we're + # returning the raw response, or if we're not streaming SSE, as if we're streaming + # SSE then `cast_to` doesn't actively reflect the type we need to parse into + and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER))) + ): if not issubclass(origin, APIResponse): raise TypeError(f"API Response types must subclass {APIResponse}; Received {origin}") @@ -1574,7 +1581,14 @@ async def _process_response( ) -> ResponseT: origin = get_origin(cast_to) or cast_to - if inspect.isclass(origin) and issubclass(origin, BaseAPIResponse): + if ( + inspect.isclass(origin) + and issubclass(origin, BaseAPIResponse) + # we only want to actually return the custom BaseAPIResponse class if we're + # returning the raw response, or if we're not streaming SSE, as if we're streaming + # SSE then `cast_to` doesn't actively reflect the type we need to parse into + and (not stream or bool(response.request.headers.get(RAW_RESPONSE_HEADER))) + ): if not issubclass(origin, AsyncAPIResponse): raise TypeError(f"API Response types must subclass {AsyncAPIResponse}; Received {origin}") From f8c0f21b783c1b3ec267ea469bd09ac0a03bea7e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Jun 2025 00:11:48 +0000 Subject: [PATCH 768/993] feat(api): api update --- .stats.yml | 4 ++-- .../resources/scenarios/scenarios.py | 18 ++++++++++++------ .../types/scenario_list_params.py | 3 +++ tests/api_resources/test_scenarios.py | 2 ++ 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9af3f652d..2595a1785 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 91 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-86c4a065b1820b26c7afd40bbc374e87dd5e9c2ffa0abad26e7fd4ebec1cf72b.yml -openapi_spec_hash: 6c6a44548177464033f3c174c89ba06a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-32aaecf1da425c37d534ed04df36003ab9d766a7755cd18f96541929a2a3ea59.yml +openapi_spec_hash: e326c47b99943cbbab473fde3b257221 config_hash: 421e8d0e71c7ef71fdfebede08ea7271 diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index 5e4ae5132..5e96cf59b 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -255,6 +255,7 @@ def update( def list( self, *, + benchmark_id: str | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, @@ -265,12 +266,13 @@ def list( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SyncScenariosCursorIDPage[ScenarioView]: - """List all Scenarios matching filter. + """ + List all Scenarios matching filter. Args: - limit: The limit of items to return. + benchmark_id: Filter scenarios by benchmark ID. - Default is 20. + limit: The limit of items to return. Default is 20. name: Query for Scenarios with a given name. @@ -294,6 +296,7 @@ def list( timeout=timeout, query=maybe_transform( { + "benchmark_id": benchmark_id, "limit": limit, "name": name, "starting_after": starting_after, @@ -619,6 +622,7 @@ async def update( def list( self, *, + benchmark_id: str | NotGiven = NOT_GIVEN, limit: int | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, starting_after: str | NotGiven = NOT_GIVEN, @@ -629,12 +633,13 @@ def list( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncPaginator[ScenarioView, AsyncScenariosCursorIDPage[ScenarioView]]: - """List all Scenarios matching filter. + """ + List all Scenarios matching filter. Args: - limit: The limit of items to return. + benchmark_id: Filter scenarios by benchmark ID. - Default is 20. + limit: The limit of items to return. Default is 20. name: Query for Scenarios with a given name. @@ -658,6 +663,7 @@ def list( timeout=timeout, query=maybe_transform( { + "benchmark_id": benchmark_id, "limit": limit, "name": name, "starting_after": starting_after, diff --git a/src/runloop_api_client/types/scenario_list_params.py b/src/runloop_api_client/types/scenario_list_params.py index 26c4b5c79..917da6c94 100644 --- a/src/runloop_api_client/types/scenario_list_params.py +++ b/src/runloop_api_client/types/scenario_list_params.py @@ -8,6 +8,9 @@ class ScenarioListParams(TypedDict, total=False): + benchmark_id: str + """Filter scenarios by benchmark ID.""" + limit: int """The limit of items to return. Default is 20.""" diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index 7e77cd2a9..a7fa7a293 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -339,6 +339,7 @@ def test_method_list(self, client: Runloop) -> None: @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: scenario = client.scenarios.list( + benchmark_id="benchmark_id", limit=0, name="name", starting_after="starting_after", @@ -762,6 +763,7 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: scenario = await async_client.scenarios.list( + benchmark_id="benchmark_id", limit=0, name="name", starting_after="starting_after", From f0a02ab00fc97da992a44f2227615af4c3c2ea0f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Jun 2025 00:38:11 +0000 Subject: [PATCH 769/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 52afe059d..fe87cd917 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.42.0" + ".": "0.43.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index d0011aa21..1f083a49a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.42.0" +version = "0.43.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index dee24268d..5c05630c7 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.42.0" # x-release-please-version +__version__ = "0.43.0" # x-release-please-version From cde6d52d936a8f53e4728d16acf245a106d7654d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 02:38:07 +0000 Subject: [PATCH 770/993] chore(tests): add tests for httpx client instantiation & proxies --- tests/test_client.py | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/tests/test_client.py b/tests/test_client.py index e3faa0506..cdecceeb8 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -31,6 +31,8 @@ DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, + DefaultHttpxClient, + DefaultAsyncHttpxClient, make_request_options, ) from runloop_api_client.types.devbox_create_params import DevboxCreateParams @@ -873,6 +875,28 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: assert response.http_request.headers.get("x-stainless-retry-count") == "42" + def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: + # Test that the proxy environment variables are set correctly + monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + + client = DefaultHttpxClient() + + mounts = tuple(client._mounts.items()) + assert len(mounts) == 1 + assert mounts[0][0].pattern == "https://" + + @pytest.mark.filterwarnings("ignore:.*deprecated.*:DeprecationWarning") + def test_default_client_creation(self) -> None: + # Ensure that the client can be initialized without any exceptions + DefaultHttpxClient( + verify=True, + cert=None, + trust_env=True, + http1=True, + http2=False, + limits=httpx.Limits(max_connections=100, max_keepalive_connections=20), + ) + @pytest.mark.respx(base_url=base_url) def test_follow_redirects(self, respx_mock: MockRouter) -> None: # Test that the default follow_redirects=True allows following redirects @@ -1769,6 +1793,28 @@ async def test_main() -> None: time.sleep(0.1) + async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: + # Test that the proxy environment variables are set correctly + monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + + client = DefaultAsyncHttpxClient() + + mounts = tuple(client._mounts.items()) + assert len(mounts) == 1 + assert mounts[0][0].pattern == "https://" + + @pytest.mark.filterwarnings("ignore:.*deprecated.*:DeprecationWarning") + async def test_default_client_creation(self) -> None: + # Ensure that the client can be initialized without any exceptions + DefaultAsyncHttpxClient( + verify=True, + cert=None, + trust_env=True, + http1=True, + http2=False, + limits=httpx.Limits(max_connections=100, max_keepalive_connections=20), + ) + @pytest.mark.respx(base_url=base_url) async def test_follow_redirects(self, respx_mock: MockRouter) -> None: # Test that the default follow_redirects=True allows following redirects From 6eb9b4e7b5b5c743e058b8e7a86216fd60b7f6a3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 04:08:21 +0000 Subject: [PATCH 771/993] chore(internal): update conftest.py --- tests/conftest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index fe6961d03..eb2e5f333 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,3 +1,5 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + from __future__ import annotations import os From 5717e07b88f2afd7cfb6dcea69f41ecf0ff7f478 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 06:38:39 +0000 Subject: [PATCH 772/993] chore(ci): enable for pull requests --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f88c4fe28..98974d6cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,10 @@ on: - 'integrated/**' - 'stl-preview-head/**' - 'stl-preview-base/**' + pull_request: + branches-ignore: + - 'stl-preview-head/**' + - 'stl-preview-base/**' jobs: lint: From 0d8283ea734fe1cca2e824b583ccbcf9942f11bd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Jun 2025 02:10:56 +0000 Subject: [PATCH 773/993] chore(readme): update badges --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b59a62b8d..8bc930b9b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Runloop Python API library -[![PyPI version](https://img.shields.io/pypi/v/runloop_api_client.svg)](https://pypi.org/project/runloop_api_client/) +[![PyPI version]()](https://pypi.org/project/runloop_api_client/) The Runloop Python library provides convenient access to the Runloop REST API from any Python 3.8+ application. The library includes type definitions for all request params and response fields, From e689cc4358773805043eb64739b54bfbad68d36c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Jun 2025 05:49:13 +0000 Subject: [PATCH 774/993] fix(tests): fix: tests which call HTTP endpoints directly with the example parameters --- tests/test_client.py | 43 ++++++++++--------------------------------- 1 file changed, 10 insertions(+), 33 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index cdecceeb8..60cefa491 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -23,9 +23,7 @@ from runloop_api_client import Runloop, AsyncRunloop, APIResponseValidationError from runloop_api_client._types import Omit -from runloop_api_client._utils import maybe_transform from runloop_api_client._models import BaseModel, FinalRequestOptions -from runloop_api_client._constants import RAW_RESPONSE_HEADER from runloop_api_client._exceptions import RunloopError, APIStatusError, APITimeoutError, APIResponseValidationError from runloop_api_client._base_client import ( DEFAULT_TIMEOUT, @@ -35,7 +33,6 @@ DefaultAsyncHttpxClient, make_request_options, ) -from runloop_api_client.types.devbox_create_params import DevboxCreateParams from .utils import update_env @@ -770,32 +767,21 @@ def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, client: Runloop) -> None: respx_mock.post("/v1/devboxes").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): - self.client.post( - "/v1/devboxes", - body=cast(object, maybe_transform({}, DevboxCreateParams)), - cast_to=httpx.Response, - options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, - ) + client.devboxes.with_streaming_response.create().__enter__() assert _get_open_connections(self.client) == 0 @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client: Runloop) -> None: respx_mock.post("/v1/devboxes").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): - self.client.post( - "/v1/devboxes", - body=cast(object, maybe_transform({}, DevboxCreateParams)), - cast_to=httpx.Response, - options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, - ) - + client.devboxes.with_streaming_response.create().__enter__() assert _get_open_connections(self.client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @@ -1640,32 +1626,23 @@ async def test_parse_retry_after_header(self, remaining_retries: int, retry_afte @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + async def test_retrying_timeout_errors_doesnt_leak( + self, respx_mock: MockRouter, async_client: AsyncRunloop + ) -> None: respx_mock.post("/v1/devboxes").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): - await self.client.post( - "/v1/devboxes", - body=cast(object, maybe_transform({}, DevboxCreateParams)), - cast_to=httpx.Response, - options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, - ) + await async_client.devboxes.with_streaming_response.create().__aenter__() assert _get_open_connections(self.client) == 0 @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None: + async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, async_client: AsyncRunloop) -> None: respx_mock.post("/v1/devboxes").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): - await self.client.post( - "/v1/devboxes", - body=cast(object, maybe_transform({}, DevboxCreateParams)), - cast_to=httpx.Response, - options={"headers": {RAW_RESPONSE_HEADER: "stream"}}, - ) - + await async_client.devboxes.with_streaming_response.create().__aenter__() assert _get_open_connections(self.client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) From 2c30a5b80ee95d2c536c5fc5913831a9cf0dba14 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Jun 2025 23:33:07 +0000 Subject: [PATCH 775/993] feat(api): api update --- .stats.yml | 4 +- .../resources/scenarios/scenarios.py | 54 +++--- .../types/scenario_update_params.py | 20 +- tests/api_resources/test_scenarios.py | 172 +++--------------- 4 files changed, 66 insertions(+), 184 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2595a1785..41db5c4aa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 91 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-32aaecf1da425c37d534ed04df36003ab9d766a7755cd18f96541929a2a3ea59.yml -openapi_spec_hash: e326c47b99943cbbab473fde3b257221 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ecb3d41adaf06e76fd95f11d6da77c7aa0119387a3f372e736edd1579ec2aa03.yml +openapi_spec_hash: 2671664b7d6b0107a6402746033a65ac config_hash: 421e8d0e71c7ef71fdfebede08ea7271 diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index 5e96cf59b..393bc6b7a 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -184,12 +184,12 @@ def update( self, id: str, *, - input_context: InputContextParam, - name: str, - scoring_contract: ScoringContractParam, environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, + input_context: Optional[InputContextParam] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, reference_output: Optional[str] | NotGiven = NOT_GIVEN, + scoring_contract: Optional[ScoringContractParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -200,23 +200,24 @@ def update( ) -> ScenarioView: """ Update a Scenario, a repeatable AI coding evaluation test that defines the - starting environment as well as evaluation success criteria. + starting environment as well as evaluation success criteria. Only provided + fields will be updated. Args: - input_context: The input context for the Scenario. - - name: Name of the scenario. - - scoring_contract: The scoring contract for the Scenario. - environment_parameters: The Environment in which the Scenario will run. + input_context: The input context for the Scenario. + metadata: User defined metadata to attach to the scenario for organization. + name: Name of the scenario. + reference_output: A string representation of the reference output to solve the scenario. Commonly can be the result of a git diff or a sequence of command actions to apply to the environment. + scoring_contract: The scoring contract for the Scenario. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -233,12 +234,12 @@ def update( f"/v1/scenarios/{id}", body=maybe_transform( { - "input_context": input_context, - "name": name, - "scoring_contract": scoring_contract, "environment_parameters": environment_parameters, + "input_context": input_context, "metadata": metadata, + "name": name, "reference_output": reference_output, + "scoring_contract": scoring_contract, }, scenario_update_params.ScenarioUpdateParams, ), @@ -551,12 +552,12 @@ async def update( self, id: str, *, - input_context: InputContextParam, - name: str, - scoring_contract: ScoringContractParam, environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, + input_context: Optional[InputContextParam] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + name: Optional[str] | NotGiven = NOT_GIVEN, reference_output: Optional[str] | NotGiven = NOT_GIVEN, + scoring_contract: Optional[ScoringContractParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -567,23 +568,24 @@ async def update( ) -> ScenarioView: """ Update a Scenario, a repeatable AI coding evaluation test that defines the - starting environment as well as evaluation success criteria. + starting environment as well as evaluation success criteria. Only provided + fields will be updated. Args: - input_context: The input context for the Scenario. - - name: Name of the scenario. - - scoring_contract: The scoring contract for the Scenario. - environment_parameters: The Environment in which the Scenario will run. + input_context: The input context for the Scenario. + metadata: User defined metadata to attach to the scenario for organization. + name: Name of the scenario. + reference_output: A string representation of the reference output to solve the scenario. Commonly can be the result of a git diff or a sequence of command actions to apply to the environment. + scoring_contract: The scoring contract for the Scenario. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -600,12 +602,12 @@ async def update( f"/v1/scenarios/{id}", body=await async_maybe_transform( { - "input_context": input_context, - "name": name, - "scoring_contract": scoring_contract, "environment_parameters": environment_parameters, + "input_context": input_context, "metadata": metadata, + "name": name, "reference_output": reference_output, + "scoring_contract": scoring_contract, }, scenario_update_params.ScenarioUpdateParams, ), diff --git a/src/runloop_api_client/types/scenario_update_params.py b/src/runloop_api_client/types/scenario_update_params.py index 1004e7bc8..e2be5fac1 100644 --- a/src/runloop_api_client/types/scenario_update_params.py +++ b/src/runloop_api_client/types/scenario_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, Optional -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict from .input_context_param import InputContextParam from .scoring_contract_param import ScoringContractParam @@ -13,24 +13,24 @@ class ScenarioUpdateParams(TypedDict, total=False): - input_context: Required[InputContextParam] - """The input context for the Scenario.""" - - name: Required[str] - """Name of the scenario.""" - - scoring_contract: Required[ScoringContractParam] - """The scoring contract for the Scenario.""" - environment_parameters: Optional[ScenarioEnvironmentParam] """The Environment in which the Scenario will run.""" + input_context: Optional[InputContextParam] + """The input context for the Scenario.""" + metadata: Optional[Dict[str, str]] """User defined metadata to attach to the scenario for organization.""" + name: Optional[str] + """Name of the scenario.""" + reference_output: Optional[str] """A string representation of the reference output to solve the scenario. Commonly can be the result of a git diff or a sequence of command actions to apply to the environment. """ + + scoring_contract: Optional[ScoringContractParam] + """The scoring contract for the Scenario.""" diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index a7fa7a293..0ae1b71fc 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -186,21 +186,6 @@ def test_path_params_retrieve(self, client: Runloop) -> None: def test_method_update(self, client: Runloop) -> None: scenario = client.scenarios.update( id="id", - input_context={"problem_statement": "problem_statement"}, - name="name", - scoring_contract={ - "scoring_function_parameters": [ - { - "name": "name", - "scorer": { - "pattern": "pattern", - "search_directory": "search_directory", - "type": "ast_grep_scorer", - }, - "weight": 0, - } - ] - }, ) assert_matches_type(ScenarioView, scenario, path=["response"]) @@ -208,25 +193,6 @@ def test_method_update(self, client: Runloop) -> None: def test_method_update_with_all_params(self, client: Runloop) -> None: scenario = client.scenarios.update( id="id", - input_context={ - "problem_statement": "problem_statement", - "additional_context": {}, - }, - name="name", - scoring_contract={ - "scoring_function_parameters": [ - { - "name": "name", - "scorer": { - "pattern": "pattern", - "search_directory": "search_directory", - "type": "ast_grep_scorer", - "lang": "lang", - }, - "weight": 0, - } - ] - }, environment_parameters={ "blueprint_id": "blueprint_id", "launch_parameters": { @@ -250,17 +216,13 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: "snapshot_id": "snapshot_id", "working_directory": "working_directory", }, + input_context={ + "problem_statement": "problem_statement", + "additional_context": {}, + }, metadata={"foo": "string"}, - reference_output="reference_output", - ) - assert_matches_type(ScenarioView, scenario, path=["response"]) - - @parametrize - def test_raw_response_update(self, client: Runloop) -> None: - response = client.scenarios.with_raw_response.update( - id="id", - input_context={"problem_statement": "problem_statement"}, name="name", + reference_output="reference_output", scoring_contract={ "scoring_function_parameters": [ { @@ -269,12 +231,20 @@ def test_raw_response_update(self, client: Runloop) -> None: "pattern": "pattern", "search_directory": "search_directory", "type": "ast_grep_scorer", + "lang": "lang", }, "weight": 0, } ] }, ) + assert_matches_type(ScenarioView, scenario, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Runloop) -> None: + response = client.scenarios.with_raw_response.update( + id="id", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -285,21 +255,6 @@ def test_raw_response_update(self, client: Runloop) -> None: def test_streaming_response_update(self, client: Runloop) -> None: with client.scenarios.with_streaming_response.update( id="id", - input_context={"problem_statement": "problem_statement"}, - name="name", - scoring_contract={ - "scoring_function_parameters": [ - { - "name": "name", - "scorer": { - "pattern": "pattern", - "search_directory": "search_directory", - "type": "ast_grep_scorer", - }, - "weight": 0, - } - ] - }, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -314,21 +269,6 @@ def test_path_params_update(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.scenarios.with_raw_response.update( id="", - input_context={"problem_statement": "problem_statement"}, - name="name", - scoring_contract={ - "scoring_function_parameters": [ - { - "name": "name", - "scorer": { - "pattern": "pattern", - "search_directory": "search_directory", - "type": "ast_grep_scorer", - }, - "weight": 0, - } - ] - }, ) @parametrize @@ -610,21 +550,6 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: async def test_method_update(self, async_client: AsyncRunloop) -> None: scenario = await async_client.scenarios.update( id="id", - input_context={"problem_statement": "problem_statement"}, - name="name", - scoring_contract={ - "scoring_function_parameters": [ - { - "name": "name", - "scorer": { - "pattern": "pattern", - "search_directory": "search_directory", - "type": "ast_grep_scorer", - }, - "weight": 0, - } - ] - }, ) assert_matches_type(ScenarioView, scenario, path=["response"]) @@ -632,25 +557,6 @@ async def test_method_update(self, async_client: AsyncRunloop) -> None: async def test_method_update_with_all_params(self, async_client: AsyncRunloop) -> None: scenario = await async_client.scenarios.update( id="id", - input_context={ - "problem_statement": "problem_statement", - "additional_context": {}, - }, - name="name", - scoring_contract={ - "scoring_function_parameters": [ - { - "name": "name", - "scorer": { - "pattern": "pattern", - "search_directory": "search_directory", - "type": "ast_grep_scorer", - "lang": "lang", - }, - "weight": 0, - } - ] - }, environment_parameters={ "blueprint_id": "blueprint_id", "launch_parameters": { @@ -674,17 +580,13 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - "snapshot_id": "snapshot_id", "working_directory": "working_directory", }, + input_context={ + "problem_statement": "problem_statement", + "additional_context": {}, + }, metadata={"foo": "string"}, - reference_output="reference_output", - ) - assert_matches_type(ScenarioView, scenario, path=["response"]) - - @parametrize - async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: - response = await async_client.scenarios.with_raw_response.update( - id="id", - input_context={"problem_statement": "problem_statement"}, name="name", + reference_output="reference_output", scoring_contract={ "scoring_function_parameters": [ { @@ -693,12 +595,20 @@ async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: "pattern": "pattern", "search_directory": "search_directory", "type": "ast_grep_scorer", + "lang": "lang", }, "weight": 0, } ] }, ) + assert_matches_type(ScenarioView, scenario, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: + response = await async_client.scenarios.with_raw_response.update( + id="id", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -709,21 +619,6 @@ async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: async def test_streaming_response_update(self, async_client: AsyncRunloop) -> None: async with async_client.scenarios.with_streaming_response.update( id="id", - input_context={"problem_statement": "problem_statement"}, - name="name", - scoring_contract={ - "scoring_function_parameters": [ - { - "name": "name", - "scorer": { - "pattern": "pattern", - "search_directory": "search_directory", - "type": "ast_grep_scorer", - }, - "weight": 0, - } - ] - }, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -738,21 +633,6 @@ async def test_path_params_update(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.scenarios.with_raw_response.update( id="", - input_context={"problem_statement": "problem_statement"}, - name="name", - scoring_contract={ - "scoring_function_parameters": [ - { - "name": "name", - "scorer": { - "pattern": "pattern", - "search_directory": "search_directory", - "type": "ast_grep_scorer", - }, - "weight": 0, - } - ] - }, ) @parametrize From d32737825188063c96db891bac38b9d57f6a41c7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Jun 2025 01:08:57 +0000 Subject: [PATCH 776/993] feat(api): api update --- .stats.yml | 2 +- api.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 41db5c4aa..f27792d6d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 91 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ecb3d41adaf06e76fd95f11d6da77c7aa0119387a3f372e736edd1579ec2aa03.yml openapi_spec_hash: 2671664b7d6b0107a6402746033a65ac -config_hash: 421e8d0e71c7ef71fdfebede08ea7271 +config_hash: c4d0f5cf7262a18f9254da07d289f3ec diff --git a/api.md b/api.md index da4195d42..20cfc67ff 100644 --- a/api.md +++ b/api.md @@ -268,6 +268,7 @@ from runloop_api_client.types import ( ScenarioEnvironment, ScenarioRunListView, ScenarioRunView, + ScenarioUpdateParameters, ScenarioView, ScoringContract, ScoringContractResultView, From f279bcb97b5f0816798d700399b797b82c95305b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Jun 2025 02:49:56 +0000 Subject: [PATCH 777/993] docs(client): fix httpx.Timeout documentation reference --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8bc930b9b..592c80e16 100644 --- a/README.md +++ b/README.md @@ -235,7 +235,7 @@ client.with_options(max_retries=5).devboxes.create() ### Timeouts By default requests time out after 1 minute. You can configure this with a `timeout` option, -which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object: +which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object: ```python from runloop_api_client import Runloop From c333f075d20b645ed7a35585d4072095f13c4f57 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 21 Jun 2025 04:05:59 +0000 Subject: [PATCH 778/993] feat(client): add support for aiohttp --- README.md | 32 ++++++++++++++ pyproject.toml | 2 + requirements-dev.lock | 27 ++++++++++++ requirements.lock | 27 ++++++++++++ src/runloop_api_client/__init__.py | 3 +- src/runloop_api_client/_base_client.py | 22 ++++++++++ tests/api_resources/benchmarks/test_runs.py | 4 +- tests/api_resources/devboxes/test_browsers.py | 4 +- .../api_resources/devboxes/test_computers.py | 4 +- .../devboxes/test_disk_snapshots.py | 4 +- .../api_resources/devboxes/test_executions.py | 4 +- tests/api_resources/devboxes/test_logs.py | 4 +- tests/api_resources/devboxes/test_lsp.py | 4 +- tests/api_resources/scenarios/test_runs.py | 4 +- tests/api_resources/scenarios/test_scorers.py | 4 +- tests/api_resources/test_benchmarks.py | 4 +- tests/api_resources/test_blueprints.py | 4 +- tests/api_resources/test_devboxes.py | 4 +- tests/api_resources/test_repositories.py | 4 +- tests/api_resources/test_scenarios.py | 4 +- tests/api_resources/test_secrets.py | 4 +- tests/conftest.py | 43 ++++++++++++++++--- 22 files changed, 194 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 592c80e16..eb5672f4d 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,38 @@ asyncio.run(main()) Functionality between the synchronous and asynchronous clients is otherwise identical. +### With aiohttp + +By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend. + +You can enable this by installing `aiohttp`: + +```sh +# install from PyPI +pip install runloop_api_client[aiohttp] +``` + +Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: + +```python +import os +import asyncio +from runloop_api_client import DefaultAioHttpClient +from runloop_api_client import AsyncRunloop + + +async def main() -> None: + async with AsyncRunloop( + bearer_token=os.environ.get("RUNLOOP_API_KEY"), # This is the default and can be omitted + http_client=DefaultAioHttpClient(), + ) as client: + devbox_view = await client.devboxes.create() + print(devbox_view.id) + + +asyncio.run(main()) +``` + ## Using types Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like: diff --git a/pyproject.toml b/pyproject.toml index 1f083a49a..a403578ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,6 +37,8 @@ classifiers = [ Homepage = "https://github.com/runloopai/api-client-python" Repository = "https://github.com/runloopai/api-client-python" +[project.optional-dependencies] +aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.6"] [tool.rye] managed = true diff --git a/requirements-dev.lock b/requirements-dev.lock index 3063be477..56d0598e4 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -10,6 +10,13 @@ # universal: false -e file:. +aiohappyeyeballs==2.6.1 + # via aiohttp +aiohttp==3.12.8 + # via httpx-aiohttp + # via runloop-api-client +aiosignal==1.3.2 + # via aiohttp annotated-types==0.6.0 # via pydantic anyio==4.4.0 @@ -17,6 +24,10 @@ anyio==4.4.0 # via runloop-api-client argcomplete==3.1.2 # via nox +async-timeout==5.0.1 + # via aiohttp +attrs==25.3.0 + # via aiohttp certifi==2023.7.22 # via httpcore # via httpx @@ -34,16 +45,23 @@ execnet==2.1.1 # via pytest-xdist filelock==3.12.4 # via virtualenv +frozenlist==1.6.2 + # via aiohttp + # via aiosignal h11==0.14.0 # via httpcore httpcore==1.0.2 # via httpx httpx==0.28.1 + # via httpx-aiohttp # via respx # via runloop-api-client +httpx-aiohttp==0.1.6 + # via runloop-api-client idna==3.4 # via anyio # via httpx + # via yarl importlib-metadata==7.0.0 iniconfig==2.0.0 # via pytest @@ -51,6 +69,9 @@ markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py +multidict==6.4.4 + # via aiohttp + # via yarl mypy==1.14.1 mypy-extensions==1.0.0 # via mypy @@ -65,6 +86,9 @@ platformdirs==3.11.0 # via virtualenv pluggy==1.5.0 # via pytest +propcache==0.3.1 + # via aiohttp + # via yarl pydantic==2.10.3 # via runloop-api-client pydantic-core==2.27.1 @@ -97,6 +121,7 @@ tomli==2.0.2 # via pytest typing-extensions==4.12.2 # via anyio + # via multidict # via mypy # via pydantic # via pydantic-core @@ -104,5 +129,7 @@ typing-extensions==4.12.2 # via runloop-api-client virtualenv==20.24.5 # via nox +yarl==1.20.0 + # via aiohttp zipp==3.17.0 # via importlib-metadata diff --git a/requirements.lock b/requirements.lock index bcd4ab118..24dc0c2dd 100644 --- a/requirements.lock +++ b/requirements.lock @@ -10,11 +10,22 @@ # universal: false -e file:. +aiohappyeyeballs==2.6.1 + # via aiohttp +aiohttp==3.12.8 + # via httpx-aiohttp + # via runloop-api-client +aiosignal==1.3.2 + # via aiohttp annotated-types==0.6.0 # via pydantic anyio==4.4.0 # via httpx # via runloop-api-client +async-timeout==5.0.1 + # via aiohttp +attrs==25.3.0 + # via aiohttp certifi==2023.7.22 # via httpcore # via httpx @@ -22,15 +33,28 @@ distro==1.8.0 # via runloop-api-client exceptiongroup==1.2.2 # via anyio +frozenlist==1.6.2 + # via aiohttp + # via aiosignal h11==0.14.0 # via httpcore httpcore==1.0.2 # via httpx httpx==0.28.1 + # via httpx-aiohttp + # via runloop-api-client +httpx-aiohttp==0.1.6 # via runloop-api-client idna==3.4 # via anyio # via httpx + # via yarl +multidict==6.4.4 + # via aiohttp + # via yarl +propcache==0.3.1 + # via aiohttp + # via yarl pydantic==2.10.3 # via runloop-api-client pydantic-core==2.27.1 @@ -40,6 +64,9 @@ sniffio==1.3.0 # via runloop-api-client typing-extensions==4.12.2 # via anyio + # via multidict # via pydantic # via pydantic-core # via runloop-api-client +yarl==1.20.0 + # via aiohttp diff --git a/src/runloop_api_client/__init__.py b/src/runloop_api_client/__init__.py index fd4bc5d8d..2c679e1f1 100644 --- a/src/runloop_api_client/__init__.py +++ b/src/runloop_api_client/__init__.py @@ -26,7 +26,7 @@ UnprocessableEntityError, APIResponseValidationError, ) -from ._base_client import DefaultHttpxClient, DefaultAsyncHttpxClient +from ._base_client import DefaultHttpxClient, DefaultAioHttpClient, DefaultAsyncHttpxClient from ._utils._logs import setup_logging as _setup_logging __all__ = [ @@ -68,6 +68,7 @@ "DEFAULT_CONNECTION_LIMITS", "DefaultHttpxClient", "DefaultAsyncHttpxClient", + "DefaultAioHttpClient", ] if not _t.TYPE_CHECKING: diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index 74864535d..d2758d8cc 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -1289,6 +1289,24 @@ def __init__(self, **kwargs: Any) -> None: super().__init__(**kwargs) +try: + import httpx_aiohttp +except ImportError: + + class _DefaultAioHttpClient(httpx.AsyncClient): + def __init__(self, **_kwargs: Any) -> None: + raise RuntimeError("To use the aiohttp client you must have installed the package with the `aiohttp` extra") +else: + + class _DefaultAioHttpClient(httpx_aiohttp.HttpxAiohttpClient): # type: ignore + def __init__(self, **kwargs: Any) -> None: + kwargs.setdefault("timeout", DEFAULT_TIMEOUT) + kwargs.setdefault("limits", DEFAULT_CONNECTION_LIMITS) + kwargs.setdefault("follow_redirects", True) + + super().__init__(**kwargs) + + if TYPE_CHECKING: DefaultAsyncHttpxClient = httpx.AsyncClient """An alias to `httpx.AsyncClient` that provides the same defaults that this SDK @@ -1297,8 +1315,12 @@ def __init__(self, **kwargs: Any) -> None: This is useful because overriding the `http_client` with your own instance of `httpx.AsyncClient` will result in httpx's defaults being used, not ours. """ + + DefaultAioHttpClient = httpx.AsyncClient + """An alias to `httpx.AsyncClient` that changes the default HTTP transport to `aiohttp`.""" else: DefaultAsyncHttpxClient = _DefaultAsyncHttpxClient + DefaultAioHttpClient = _DefaultAioHttpClient class AsyncHttpxClientWrapper(DefaultAsyncHttpxClient): diff --git a/tests/api_resources/benchmarks/test_runs.py b/tests/api_resources/benchmarks/test_runs.py index 03db357df..a95855518 100644 --- a/tests/api_resources/benchmarks/test_runs.py +++ b/tests/api_resources/benchmarks/test_runs.py @@ -216,7 +216,9 @@ def test_path_params_list_scenario_runs(self, client: Runloop) -> None: class TestAsyncRuns: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: diff --git a/tests/api_resources/devboxes/test_browsers.py b/tests/api_resources/devboxes/test_browsers.py index 5fa04afc0..1e72e079e 100644 --- a/tests/api_resources/devboxes/test_browsers.py +++ b/tests/api_resources/devboxes/test_browsers.py @@ -89,7 +89,9 @@ def test_path_params_retrieve(self, client: Runloop) -> None: class TestAsyncBrowsers: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_create(self, async_client: AsyncRunloop) -> None: diff --git a/tests/api_resources/devboxes/test_computers.py b/tests/api_resources/devboxes/test_computers.py index 8671cf96c..a7cbf4e52 100644 --- a/tests/api_resources/devboxes/test_computers.py +++ b/tests/api_resources/devboxes/test_computers.py @@ -245,7 +245,9 @@ def test_path_params_screen_interaction(self, client: Runloop) -> None: class TestAsyncComputers: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_create(self, async_client: AsyncRunloop) -> None: diff --git a/tests/api_resources/devboxes/test_disk_snapshots.py b/tests/api_resources/devboxes/test_disk_snapshots.py index aff385ef0..3ef9f7b94 100644 --- a/tests/api_resources/devboxes/test_disk_snapshots.py +++ b/tests/api_resources/devboxes/test_disk_snapshots.py @@ -182,7 +182,9 @@ def test_path_params_query_status(self, client: Runloop) -> None: class TestAsyncDiskSnapshots: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_update(self, async_client: AsyncRunloop) -> None: diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index a1a7b8b58..32da6909f 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -226,7 +226,9 @@ def test_path_params_kill(self, client: Runloop) -> None: class TestAsyncExecutions: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: diff --git a/tests/api_resources/devboxes/test_logs.py b/tests/api_resources/devboxes/test_logs.py index 3546c378a..80f10afca 100644 --- a/tests/api_resources/devboxes/test_logs.py +++ b/tests/api_resources/devboxes/test_logs.py @@ -66,7 +66,9 @@ def test_path_params_list(self, client: Runloop) -> None: class TestAsyncLogs: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py index c23afde06..fe9a479b1 100644 --- a/tests/api_resources/devboxes/test_lsp.py +++ b/tests/api_resources/devboxes/test_lsp.py @@ -822,7 +822,9 @@ def test_path_params_set_watch_directory(self, client: Runloop) -> None: class TestAsyncLsp: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: diff --git a/tests/api_resources/scenarios/test_runs.py b/tests/api_resources/scenarios/test_runs.py index de0adca5f..57eacb2b5 100644 --- a/tests/api_resources/scenarios/test_runs.py +++ b/tests/api_resources/scenarios/test_runs.py @@ -206,7 +206,9 @@ def test_path_params_score(self, client: Runloop) -> None: class TestAsyncRuns: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: diff --git a/tests/api_resources/scenarios/test_scorers.py b/tests/api_resources/scenarios/test_scorers.py index db1ae2c56..5388ad044 100644 --- a/tests/api_resources/scenarios/test_scorers.py +++ b/tests/api_resources/scenarios/test_scorers.py @@ -250,7 +250,9 @@ def test_path_params_validate(self, client: Runloop) -> None: class TestAsyncScorers: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_create(self, async_client: AsyncRunloop) -> None: diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py index c453baf0a..615ff95da 100644 --- a/tests/api_resources/test_benchmarks.py +++ b/tests/api_resources/test_benchmarks.py @@ -307,7 +307,9 @@ def test_streaming_response_start_run(self, client: Runloop) -> None: class TestAsyncBenchmarks: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_create(self, async_client: AsyncRunloop) -> None: diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 64cd30459..f2f3f7c67 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -304,7 +304,9 @@ def test_streaming_response_preview(self, client: Runloop) -> None: class TestAsyncBlueprints: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_create(self, async_client: AsyncRunloop) -> None: diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index f9402f955..9c9c78e49 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -967,7 +967,9 @@ def test_path_params_write_file_contents(self, client: Runloop) -> None: class TestAsyncDevboxes: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_create(self, async_client: AsyncRunloop) -> None: diff --git a/tests/api_resources/test_repositories.py b/tests/api_resources/test_repositories.py index c74290fbe..da723e080 100644 --- a/tests/api_resources/test_repositories.py +++ b/tests/api_resources/test_repositories.py @@ -263,7 +263,9 @@ def test_path_params_refresh(self, client: Runloop) -> None: class TestAsyncRepositories: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_create(self, async_client: AsyncRunloop) -> None: diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index 0ae1b71fc..c4243a16a 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -383,7 +383,9 @@ def test_streaming_response_start_run(self, client: Runloop) -> None: class TestAsyncScenarios: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_create(self, async_client: AsyncRunloop) -> None: diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index 730447d77..09a27ab44 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -158,7 +158,9 @@ def test_path_params_delete(self, client: Runloop) -> None: class TestAsyncSecrets: - parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) @parametrize async def test_method_create(self, async_client: AsyncRunloop) -> None: diff --git a/tests/conftest.py b/tests/conftest.py index eb2e5f333..b68f5d7ab 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -6,10 +6,12 @@ import logging from typing import TYPE_CHECKING, Iterator, AsyncIterator +import httpx import pytest from pytest_asyncio import is_async_test -from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client import Runloop, AsyncRunloop, DefaultAioHttpClient +from runloop_api_client._utils import is_dict if TYPE_CHECKING: from _pytest.fixtures import FixtureRequest # pyright: ignore[reportPrivateImportUsage] @@ -27,6 +29,19 @@ def pytest_collection_modifyitems(items: list[pytest.Function]) -> None: for async_test in pytest_asyncio_tests: async_test.add_marker(session_scope_marker, append=False) + # We skip tests that use both the aiohttp client and respx_mock as respx_mock + # doesn't support custom transports. + for item in items: + if "async_client" not in item.fixturenames or "respx_mock" not in item.fixturenames: + continue + + if not hasattr(item, "callspec"): + continue + + async_client_param = item.callspec.params.get("async_client") + if is_dict(async_client_param) and async_client_param.get("http_client") == "aiohttp": + item.add_marker(pytest.mark.skip(reason="aiohttp client is not compatible with respx_mock")) + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -45,9 +60,25 @@ def client(request: FixtureRequest) -> Iterator[Runloop]: @pytest.fixture(scope="session") async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncRunloop]: - strict = getattr(request, "param", True) - if not isinstance(strict, bool): - raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}") - - async with AsyncRunloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=strict) as client: + param = getattr(request, "param", True) + + # defaults + strict = True + http_client: None | httpx.AsyncClient = None + + if isinstance(param, bool): + strict = param + elif is_dict(param): + strict = param.get("strict", True) + assert isinstance(strict, bool) + + http_client_type = param.get("http_client", "httpx") + if http_client_type == "aiohttp": + http_client = DefaultAioHttpClient() + else: + raise TypeError(f"Unexpected fixture parameter type {type(param)}, expected bool or dict") + + async with AsyncRunloop( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=strict, http_client=http_client + ) as client: yield client From ce356cdc1da01f0f97995eaa6e112e6999d755e1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Jun 2025 17:22:00 +0000 Subject: [PATCH 779/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index fe87cd917..cc51f6f8e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.43.0" + ".": "0.44.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index a403578ad..541db7250 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.43.0" +version = "0.44.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 5c05630c7..9382b6e18 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.43.0" # x-release-please-version +__version__ = "0.44.0" # x-release-please-version From d4d3f2a181b9f80c308f42ae7146985d63865cf4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Jun 2025 22:04:46 +0000 Subject: [PATCH 780/993] feat(api): api update --- .stats.yml | 6 +- api.md | 2 + .../resources/scenarios/scenarios.py | 10 +-- src/runloop_api_client/types/__init__.py | 2 + .../types/input_context_update_param.py | 67 +++++++++++++++++++ .../types/scenario_update_params.py | 8 +-- .../types/scoring_contract_update_param.py | 15 +++++ tests/api_resources/test_scenarios.py | 50 +++++++++++++- 8 files changed, 147 insertions(+), 13 deletions(-) create mode 100644 src/runloop_api_client/types/input_context_update_param.py create mode 100644 src/runloop_api_client/types/scoring_contract_update_param.py diff --git a/.stats.yml b/.stats.yml index f27792d6d..e8a6c9e17 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 91 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ecb3d41adaf06e76fd95f11d6da77c7aa0119387a3f372e736edd1579ec2aa03.yml -openapi_spec_hash: 2671664b7d6b0107a6402746033a65ac -config_hash: c4d0f5cf7262a18f9254da07d289f3ec +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-04db114d63ee85c22cfe1523fc2422a2e19b7cb7b93cbee97936a1e1a8997a89.yml +openapi_spec_hash: c3d50a0138a3a9c35f0a02292f3788a3 +config_hash: 55cf3b0829d3d91846df7c4cfab7db0d diff --git a/api.md b/api.md index 20cfc67ff..1ec5c2e25 100644 --- a/api.md +++ b/api.md @@ -264,6 +264,7 @@ Types: ```python from runloop_api_client.types import ( InputContext, + InputContextUpdate, ScenarioCreateParameters, ScenarioEnvironment, ScenarioRunListView, @@ -272,6 +273,7 @@ from runloop_api_client.types import ( ScenarioView, ScoringContract, ScoringContractResultView, + ScoringContractUpdate, ScoringFunction, ScoringFunctionResultView, StartScenarioRunParameters, diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index 393bc6b7a..f52ab4539 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -45,7 +45,9 @@ from ...types.scenario_run_view import ScenarioRunView from ...types.input_context_param import InputContextParam from ...types.scoring_contract_param import ScoringContractParam +from ...types.input_context_update_param import InputContextUpdateParam from ...types.scenario_environment_param import ScenarioEnvironmentParam +from ...types.scoring_contract_update_param import ScoringContractUpdateParam __all__ = ["ScenariosResource", "AsyncScenariosResource"] @@ -185,11 +187,11 @@ def update( id: str, *, environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, - input_context: Optional[InputContextParam] | NotGiven = NOT_GIVEN, + input_context: Optional[InputContextUpdateParam] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, reference_output: Optional[str] | NotGiven = NOT_GIVEN, - scoring_contract: Optional[ScoringContractParam] | NotGiven = NOT_GIVEN, + scoring_contract: Optional[ScoringContractUpdateParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -553,11 +555,11 @@ async def update( id: str, *, environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, - input_context: Optional[InputContextParam] | NotGiven = NOT_GIVEN, + input_context: Optional[InputContextUpdateParam] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, reference_output: Optional[str] | NotGiven = NOT_GIVEN, - scoring_contract: Optional[ScoringContractParam] | NotGiven = NOT_GIVEN, + scoring_contract: Optional[ScoringContractUpdateParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 12c611295..e21c31852 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -54,6 +54,7 @@ from .benchmark_start_run_params import BenchmarkStartRunParams as BenchmarkStartRunParams from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams +from .input_context_update_param import InputContextUpdateParam as InputContextUpdateParam from .repository_connection_view import RepositoryConnectionView as RepositoryConnectionView from .scenario_environment_param import ScenarioEnvironmentParam as ScenarioEnvironmentParam from .devbox_create_tunnel_params import DevboxCreateTunnelParams as DevboxCreateTunnelParams @@ -69,6 +70,7 @@ from .scoring_function_result_view import ScoringFunctionResultView as ScoringFunctionResultView from .repository_inspection_details import RepositoryInspectionDetails as RepositoryInspectionDetails from .scenario_definition_list_view import ScenarioDefinitionListView as ScenarioDefinitionListView +from .scoring_contract_update_param import ScoringContractUpdateParam as ScoringContractUpdateParam from .blueprint_build_logs_list_view import BlueprintBuildLogsListView as BlueprintBuildLogsListView from .devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse as DevboxCreateSSHKeyResponse from .repository_connection_list_view import RepositoryConnectionListView as RepositoryConnectionListView diff --git a/src/runloop_api_client/types/input_context_update_param.py b/src/runloop_api_client/types/input_context_update_param.py new file mode 100644 index 000000000..90685312a --- /dev/null +++ b/src/runloop_api_client/types/input_context_update_param.py @@ -0,0 +1,67 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["InputContextUpdateParam", "AdditionalContext"] + + +class AdditionalContext(TypedDict, total=False): + array: Required[bool] + + big_decimal: Required[Annotated[bool, PropertyInfo(alias="bigDecimal")]] + + big_integer: Required[Annotated[bool, PropertyInfo(alias="bigInteger")]] + + binary: Required[bool] + + boolean: Required[bool] + + container_node: Required[Annotated[bool, PropertyInfo(alias="containerNode")]] + + double: Required[bool] + + empty: Required[bool] + + float: Required[bool] + + floating_point_number: Required[Annotated[bool, PropertyInfo(alias="floatingPointNumber")]] + + int: Required[bool] + + integral_number: Required[Annotated[bool, PropertyInfo(alias="integralNumber")]] + + long: Required[bool] + + missing_node: Required[Annotated[bool, PropertyInfo(alias="missingNode")]] + + null: Required[bool] + + number: Required[bool] + + object: Required[bool] + + pojo: Required[bool] + + short: Required[bool] + + textual: Required[bool] + + value_node: Required[Annotated[bool, PropertyInfo(alias="valueNode")]] + + node_type: Annotated[ + Literal["ARRAY", "BINARY", "BOOLEAN", "MISSING", "NULL", "NUMBER", "OBJECT", "POJO", "STRING"], + PropertyInfo(alias="nodeType"), + ] + + +class InputContextUpdateParam(TypedDict, total=False): + additional_context: Optional[AdditionalContext] + """Additional JSON structured input context.""" + + problem_statement: Optional[str] + """The problem statement for the Scenario.""" diff --git a/src/runloop_api_client/types/scenario_update_params.py b/src/runloop_api_client/types/scenario_update_params.py index e2be5fac1..1bc7524ca 100644 --- a/src/runloop_api_client/types/scenario_update_params.py +++ b/src/runloop_api_client/types/scenario_update_params.py @@ -5,9 +5,9 @@ from typing import Dict, Optional from typing_extensions import TypedDict -from .input_context_param import InputContextParam -from .scoring_contract_param import ScoringContractParam +from .input_context_update_param import InputContextUpdateParam from .scenario_environment_param import ScenarioEnvironmentParam +from .scoring_contract_update_param import ScoringContractUpdateParam __all__ = ["ScenarioUpdateParams"] @@ -16,7 +16,7 @@ class ScenarioUpdateParams(TypedDict, total=False): environment_parameters: Optional[ScenarioEnvironmentParam] """The Environment in which the Scenario will run.""" - input_context: Optional[InputContextParam] + input_context: Optional[InputContextUpdateParam] """The input context for the Scenario.""" metadata: Optional[Dict[str, str]] @@ -32,5 +32,5 @@ class ScenarioUpdateParams(TypedDict, total=False): apply to the environment. """ - scoring_contract: Optional[ScoringContractParam] + scoring_contract: Optional[ScoringContractUpdateParam] """The scoring contract for the Scenario.""" diff --git a/src/runloop_api_client/types/scoring_contract_update_param.py b/src/runloop_api_client/types/scoring_contract_update_param.py new file mode 100644 index 000000000..ce2c85289 --- /dev/null +++ b/src/runloop_api_client/types/scoring_contract_update_param.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Iterable, Optional +from typing_extensions import TypedDict + +from .scoring_function_param import ScoringFunctionParam + +__all__ = ["ScoringContractUpdateParam"] + + +class ScoringContractUpdateParam(TypedDict, total=False): + scoring_function_parameters: Optional[Iterable[ScoringFunctionParam]] + """A list of scoring functions used to evaluate the Scenario.""" diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index c4243a16a..9e9b8e3f6 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -217,8 +217,31 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: "working_directory": "working_directory", }, input_context={ + "additional_context": { + "array": True, + "big_decimal": True, + "big_integer": True, + "binary": True, + "boolean": True, + "container_node": True, + "double": True, + "empty": True, + "float": True, + "floating_point_number": True, + "int": True, + "integral_number": True, + "long": True, + "missing_node": True, + "null": True, + "number": True, + "object": True, + "pojo": True, + "short": True, + "textual": True, + "value_node": True, + "node_type": "ARRAY", + }, "problem_statement": "problem_statement", - "additional_context": {}, }, metadata={"foo": "string"}, name="name", @@ -583,8 +606,31 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - "working_directory": "working_directory", }, input_context={ + "additional_context": { + "array": True, + "big_decimal": True, + "big_integer": True, + "binary": True, + "boolean": True, + "container_node": True, + "double": True, + "empty": True, + "float": True, + "floating_point_number": True, + "int": True, + "integral_number": True, + "long": True, + "missing_node": True, + "null": True, + "number": True, + "object": True, + "pojo": True, + "short": True, + "textual": True, + "value_node": True, + "node_type": "ARRAY", + }, "problem_statement": "problem_statement", - "additional_context": {}, }, metadata={"foo": "string"}, name="name", From fe3c7c57687af4a1d764cea5d6bf47859e21c636 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Jun 2025 22:26:41 +0000 Subject: [PATCH 781/993] feat(api): api update --- .stats.yml | 4 +- .../types/input_context_update_param.py | 57 +------------------ tests/api_resources/test_scenarios.py | 50 +--------------- 3 files changed, 7 insertions(+), 104 deletions(-) diff --git a/.stats.yml b/.stats.yml index e8a6c9e17..27297fbd4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 91 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-04db114d63ee85c22cfe1523fc2422a2e19b7cb7b93cbee97936a1e1a8997a89.yml -openapi_spec_hash: c3d50a0138a3a9c35f0a02292f3788a3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1d4b018cbfb409baf83725737f00789a9ddbbdbdbe12db1ac7a1fd2cf9c453f0.yml +openapi_spec_hash: 1c533f386f6d3d3802d353cc6f1df547 config_hash: 55cf3b0829d3d91846df7c4cfab7db0d diff --git a/src/runloop_api_client/types/input_context_update_param.py b/src/runloop_api_client/types/input_context_update_param.py index 90685312a..30580cf9a 100644 --- a/src/runloop_api_client/types/input_context_update_param.py +++ b/src/runloop_api_client/types/input_context_update_param.py @@ -3,64 +3,13 @@ from __future__ import annotations from typing import Optional -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import TypedDict -from .._utils import PropertyInfo - -__all__ = ["InputContextUpdateParam", "AdditionalContext"] - - -class AdditionalContext(TypedDict, total=False): - array: Required[bool] - - big_decimal: Required[Annotated[bool, PropertyInfo(alias="bigDecimal")]] - - big_integer: Required[Annotated[bool, PropertyInfo(alias="bigInteger")]] - - binary: Required[bool] - - boolean: Required[bool] - - container_node: Required[Annotated[bool, PropertyInfo(alias="containerNode")]] - - double: Required[bool] - - empty: Required[bool] - - float: Required[bool] - - floating_point_number: Required[Annotated[bool, PropertyInfo(alias="floatingPointNumber")]] - - int: Required[bool] - - integral_number: Required[Annotated[bool, PropertyInfo(alias="integralNumber")]] - - long: Required[bool] - - missing_node: Required[Annotated[bool, PropertyInfo(alias="missingNode")]] - - null: Required[bool] - - number: Required[bool] - - object: Required[bool] - - pojo: Required[bool] - - short: Required[bool] - - textual: Required[bool] - - value_node: Required[Annotated[bool, PropertyInfo(alias="valueNode")]] - - node_type: Annotated[ - Literal["ARRAY", "BINARY", "BOOLEAN", "MISSING", "NULL", "NUMBER", "OBJECT", "POJO", "STRING"], - PropertyInfo(alias="nodeType"), - ] +__all__ = ["InputContextUpdateParam"] class InputContextUpdateParam(TypedDict, total=False): - additional_context: Optional[AdditionalContext] + additional_context: Optional[object] """Additional JSON structured input context.""" problem_statement: Optional[str] diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index 9e9b8e3f6..170a63476 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -217,30 +217,7 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: "working_directory": "working_directory", }, input_context={ - "additional_context": { - "array": True, - "big_decimal": True, - "big_integer": True, - "binary": True, - "boolean": True, - "container_node": True, - "double": True, - "empty": True, - "float": True, - "floating_point_number": True, - "int": True, - "integral_number": True, - "long": True, - "missing_node": True, - "null": True, - "number": True, - "object": True, - "pojo": True, - "short": True, - "textual": True, - "value_node": True, - "node_type": "ARRAY", - }, + "additional_context": {}, "problem_statement": "problem_statement", }, metadata={"foo": "string"}, @@ -606,30 +583,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - "working_directory": "working_directory", }, input_context={ - "additional_context": { - "array": True, - "big_decimal": True, - "big_integer": True, - "binary": True, - "boolean": True, - "container_node": True, - "double": True, - "empty": True, - "float": True, - "floating_point_number": True, - "int": True, - "integral_number": True, - "long": True, - "missing_node": True, - "null": True, - "number": True, - "object": True, - "pojo": True, - "short": True, - "textual": True, - "value_node": True, - "node_type": "ARRAY", - }, + "additional_context": {}, "problem_statement": "problem_statement", }, metadata={"foo": "string"}, From 5f74568f47832cf9de3e7c2915524f94a247dcb2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Jun 2025 04:13:55 +0000 Subject: [PATCH 782/993] chore(tests): skip some failing tests on the latest python versions --- tests/test_client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_client.py b/tests/test_client.py index 60cefa491..8f3f70514 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -194,6 +194,7 @@ def test_copy_signature(self) -> None: copy_param = copy_signature.parameters.get(name) assert copy_param is not None, f"copy() signature is missing the {name} param" + @pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12") def test_copy_build_request(self) -> None: options = FinalRequestOptions(method="get", url="/foo") @@ -1049,6 +1050,7 @@ def test_copy_signature(self) -> None: copy_param = copy_signature.parameters.get(name) assert copy_param is not None, f"copy() signature is missing the {name} param" + @pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12") def test_copy_build_request(self) -> None: options = FinalRequestOptions(method="get", url="/foo") From d6aedc6b889428d20dd66576397e2325d98c4e0e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Jun 2025 16:30:40 +0000 Subject: [PATCH 783/993] feat(api): api update --- .stats.yml | 4 +- api.md | 1 + .../resources/scenarios/runs.py | 108 ++++++++++++++++ tests/api_resources/scenarios/test_runs.py | 120 ++++++++++++++++++ 4 files changed, 231 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 27297fbd4..a615cde74 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 91 +configured_endpoints: 92 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1d4b018cbfb409baf83725737f00789a9ddbbdbdbe12db1ac7a1fd2cf9c453f0.yml openapi_spec_hash: 1c533f386f6d3d3802d353cc6f1df547 -config_hash: 55cf3b0829d3d91846df7c4cfab7db0d +config_hash: 33b544375e4a932cbb2890f79a9aa040 diff --git a/api.md b/api.md index 1ec5c2e25..84d42980a 100644 --- a/api.md +++ b/api.md @@ -297,6 +297,7 @@ Methods: - client.scenarios.runs.list(\*\*params) -> SyncBenchmarkRunsCursorIDPage[ScenarioRunView] - client.scenarios.runs.cancel(id) -> ScenarioRunView - client.scenarios.runs.complete(id) -> ScenarioRunView +- client.scenarios.runs.download_logs(id) -> BinaryAPIResponse - client.scenarios.runs.score(id) -> ScenarioRunView ## Scorers diff --git a/src/runloop_api_client/resources/scenarios/runs.py b/src/runloop_api_client/resources/scenarios/runs.py index 2c0dcd4e6..d1dee1d15 100644 --- a/src/runloop_api_client/resources/scenarios/runs.py +++ b/src/runloop_api_client/resources/scenarios/runs.py @@ -9,10 +9,18 @@ from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( + BinaryAPIResponse, + AsyncBinaryAPIResponse, + StreamedBinaryAPIResponse, + AsyncStreamedBinaryAPIResponse, to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, + to_custom_raw_response_wrapper, async_to_streamed_response_wrapper, + to_custom_streamed_response_wrapper, + async_to_custom_raw_response_wrapper, + async_to_custom_streamed_response_wrapper, ) from ...pagination import SyncBenchmarkRunsCursorIDPage, AsyncBenchmarkRunsCursorIDPage from ..._base_client import AsyncPaginator, make_request_options @@ -210,6 +218,48 @@ def complete( cast_to=ScenarioRunView, ) + def download_logs( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> BinaryAPIResponse: + """ + Download a zip file containing all logs for a Scenario run from the associated + devbox. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = {"Accept": "application/zip", **(extra_headers or {})} + return self._post( + f"/v1/scenarios/runs/{id}/download_logs", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BinaryAPIResponse, + ) + def score( self, id: str, @@ -439,6 +489,48 @@ async def complete( cast_to=ScenarioRunView, ) + async def download_logs( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> AsyncBinaryAPIResponse: + """ + Download a zip file containing all logs for a Scenario run from the associated + devbox. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + extra_headers = {"Accept": "application/zip", **(extra_headers or {})} + return await self._post( + f"/v1/scenarios/runs/{id}/download_logs", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=AsyncBinaryAPIResponse, + ) + async def score( self, id: str, @@ -496,6 +588,10 @@ def __init__(self, runs: RunsResource) -> None: self.complete = to_raw_response_wrapper( runs.complete, ) + self.download_logs = to_custom_raw_response_wrapper( + runs.download_logs, + BinaryAPIResponse, + ) self.score = to_raw_response_wrapper( runs.score, ) @@ -517,6 +613,10 @@ def __init__(self, runs: AsyncRunsResource) -> None: self.complete = async_to_raw_response_wrapper( runs.complete, ) + self.download_logs = async_to_custom_raw_response_wrapper( + runs.download_logs, + AsyncBinaryAPIResponse, + ) self.score = async_to_raw_response_wrapper( runs.score, ) @@ -538,6 +638,10 @@ def __init__(self, runs: RunsResource) -> None: self.complete = to_streamed_response_wrapper( runs.complete, ) + self.download_logs = to_custom_streamed_response_wrapper( + runs.download_logs, + StreamedBinaryAPIResponse, + ) self.score = to_streamed_response_wrapper( runs.score, ) @@ -559,6 +663,10 @@ def __init__(self, runs: AsyncRunsResource) -> None: self.complete = async_to_streamed_response_wrapper( runs.complete, ) + self.download_logs = async_to_custom_streamed_response_wrapper( + runs.download_logs, + AsyncStreamedBinaryAPIResponse, + ) self.score = async_to_streamed_response_wrapper( runs.score, ) diff --git a/tests/api_resources/scenarios/test_runs.py b/tests/api_resources/scenarios/test_runs.py index 57eacb2b5..7b981e9bb 100644 --- a/tests/api_resources/scenarios/test_runs.py +++ b/tests/api_resources/scenarios/test_runs.py @@ -5,11 +5,19 @@ import os from typing import Any, cast +import httpx import pytest +from respx import MockRouter from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types import ScenarioRunView +from runloop_api_client._response import ( + BinaryAPIResponse, + AsyncBinaryAPIResponse, + StreamedBinaryAPIResponse, + AsyncStreamedBinaryAPIResponse, +) from runloop_api_client.pagination import SyncBenchmarkRunsCursorIDPage, AsyncBenchmarkRunsCursorIDPage base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -166,6 +174,62 @@ def test_path_params_complete(self, client: Runloop) -> None: "", ) + @parametrize + @pytest.mark.respx(base_url=base_url) + def test_method_download_logs(self, client: Runloop, respx_mock: MockRouter) -> None: + respx_mock.post("/v1/scenarios/runs/id/download_logs").mock( + return_value=httpx.Response(200, json={"foo": "bar"}) + ) + run = client.scenarios.runs.download_logs( + "id", + ) + assert run.is_closed + assert run.json() == {"foo": "bar"} + assert cast(Any, run.is_closed) is True + assert isinstance(run, BinaryAPIResponse) + + @parametrize + @pytest.mark.respx(base_url=base_url) + def test_raw_response_download_logs(self, client: Runloop, respx_mock: MockRouter) -> None: + respx_mock.post("/v1/scenarios/runs/id/download_logs").mock( + return_value=httpx.Response(200, json={"foo": "bar"}) + ) + + run = client.scenarios.runs.with_raw_response.download_logs( + "id", + ) + + assert run.is_closed is True + assert run.http_request.headers.get("X-Stainless-Lang") == "python" + assert run.json() == {"foo": "bar"} + assert isinstance(run, BinaryAPIResponse) + + @parametrize + @pytest.mark.respx(base_url=base_url) + def test_streaming_response_download_logs(self, client: Runloop, respx_mock: MockRouter) -> None: + respx_mock.post("/v1/scenarios/runs/id/download_logs").mock( + return_value=httpx.Response(200, json={"foo": "bar"}) + ) + with client.scenarios.runs.with_streaming_response.download_logs( + "id", + ) as run: + assert not run.is_closed + assert run.http_request.headers.get("X-Stainless-Lang") == "python" + + assert run.json() == {"foo": "bar"} + assert cast(Any, run.is_closed) is True + assert isinstance(run, StreamedBinaryAPIResponse) + + assert cast(Any, run.is_closed) is True + + @parametrize + @pytest.mark.respx(base_url=base_url) + def test_path_params_download_logs(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.scenarios.runs.with_raw_response.download_logs( + "", + ) + @parametrize def test_method_score(self, client: Runloop) -> None: run = client.scenarios.runs.score( @@ -358,6 +422,62 @@ async def test_path_params_complete(self, async_client: AsyncRunloop) -> None: "", ) + @parametrize + @pytest.mark.respx(base_url=base_url) + async def test_method_download_logs(self, async_client: AsyncRunloop, respx_mock: MockRouter) -> None: + respx_mock.post("/v1/scenarios/runs/id/download_logs").mock( + return_value=httpx.Response(200, json={"foo": "bar"}) + ) + run = await async_client.scenarios.runs.download_logs( + "id", + ) + assert run.is_closed + assert await run.json() == {"foo": "bar"} + assert cast(Any, run.is_closed) is True + assert isinstance(run, AsyncBinaryAPIResponse) + + @parametrize + @pytest.mark.respx(base_url=base_url) + async def test_raw_response_download_logs(self, async_client: AsyncRunloop, respx_mock: MockRouter) -> None: + respx_mock.post("/v1/scenarios/runs/id/download_logs").mock( + return_value=httpx.Response(200, json={"foo": "bar"}) + ) + + run = await async_client.scenarios.runs.with_raw_response.download_logs( + "id", + ) + + assert run.is_closed is True + assert run.http_request.headers.get("X-Stainless-Lang") == "python" + assert await run.json() == {"foo": "bar"} + assert isinstance(run, AsyncBinaryAPIResponse) + + @parametrize + @pytest.mark.respx(base_url=base_url) + async def test_streaming_response_download_logs(self, async_client: AsyncRunloop, respx_mock: MockRouter) -> None: + respx_mock.post("/v1/scenarios/runs/id/download_logs").mock( + return_value=httpx.Response(200, json={"foo": "bar"}) + ) + async with async_client.scenarios.runs.with_streaming_response.download_logs( + "id", + ) as run: + assert not run.is_closed + assert run.http_request.headers.get("X-Stainless-Lang") == "python" + + assert await run.json() == {"foo": "bar"} + assert cast(Any, run.is_closed) is True + assert isinstance(run, AsyncStreamedBinaryAPIResponse) + + assert cast(Any, run.is_closed) is True + + @parametrize + @pytest.mark.respx(base_url=base_url) + async def test_path_params_download_logs(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.scenarios.runs.with_raw_response.download_logs( + "", + ) + @parametrize async def test_method_score(self, async_client: AsyncRunloop) -> None: run = await async_client.scenarios.runs.score( From 5b491ad6153553afd9fa4403aebfeefd6d3e1c70 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Jun 2025 16:36:10 +0000 Subject: [PATCH 784/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index cc51f6f8e..fc0d7ff8b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.44.0" + ".": "0.45.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 541db7250..33cf23a70 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.44.0" +version = "0.45.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 9382b6e18..0bac585fa 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.44.0" # x-release-please-version +__version__ = "0.45.0" # x-release-please-version From fce9b2a84eafd1fe20740d9907092930468f99e2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Jun 2025 02:32:10 +0000 Subject: [PATCH 785/993] =?UTF-8?q?fix(ci):=20release-doctor=20=E2=80=94?= =?UTF-8?q?=20report=20correct=20token=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/check-release-environment | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/check-release-environment b/bin/check-release-environment index 2ba897b5f..b845b0f4c 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -3,7 +3,7 @@ errors=() if [ -z "${PYPI_TOKEN}" ]; then - errors+=("The RUNLOOP_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") + errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.") fi lenErrors=${#errors[@]} From af666eb667720a4ac257453d873ded3720fe96ae Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 28 Jun 2025 08:43:15 +0000 Subject: [PATCH 786/993] chore(ci): only run for pushes and fork pull requests --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98974d6cf..d4c5f6399 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,7 @@ jobs: timeout-minutes: 10 name: lint runs-on: ${{ github.repository == 'stainless-sdks/runloop-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 @@ -42,6 +43,7 @@ jobs: contents: read id-token: write runs-on: depot-ubuntu-24.04 + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 @@ -62,6 +64,7 @@ jobs: timeout-minutes: 10 name: test runs-on: ${{ github.repository == 'stainless-sdks/runloop-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 From ce1b6b0feadebdc68f0e38b99dc3eb0d5775ead7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 02:28:42 +0000 Subject: [PATCH 787/993] fix(ci): correct conditional --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d4c5f6399..a6a934d47 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,14 +36,13 @@ jobs: run: ./scripts/lint upload: - if: github.repository == 'stainless-sdks/runloop-python' + if: github.repository == 'stainless-sdks/runloop-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) timeout-minutes: 10 name: upload permissions: contents: read id-token: write runs-on: depot-ubuntu-24.04 - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 From 8e741a37a16074451762c775f7e793c807bc18fd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 1 Jul 2025 00:38:31 +0000 Subject: [PATCH 788/993] feat(api): api update --- .stats.yml | 6 +++--- README.md | 6 +++--- src/runloop_api_client/_constants.py | 8 ++++---- .../resources/devboxes/devboxes.py | 16 ++++++++++++++++ .../resources/devboxes/executions.py | 7 ++++++- src/runloop_api_client/types/scoring_function.py | 3 +++ .../types/scoring_function_param.py | 3 +++ tests/test_client.py | 8 ++++---- 8 files changed, 42 insertions(+), 15 deletions(-) diff --git a/.stats.yml b/.stats.yml index a615cde74..b752c3f19 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 92 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1d4b018cbfb409baf83725737f00789a9ddbbdbdbe12db1ac7a1fd2cf9c453f0.yml -openapi_spec_hash: 1c533f386f6d3d3802d353cc6f1df547 -config_hash: 33b544375e4a932cbb2890f79a9aa040 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-75c0dc94dd629772c98b3e6f763d8b3a1bdb732aa3eb92d49a59fb446fb2410d.yml +openapi_spec_hash: 12286e648ea1156bfa23020ed0c7598b +config_hash: e722b7242ee36143533531c419043a6f diff --git a/README.md b/README.md index eb5672f4d..afc66e029 100644 --- a/README.md +++ b/README.md @@ -245,7 +245,7 @@ Error codes are as follows: ### Retries -Certain errors are automatically retried 0 times by default, with a short exponential backoff. +Certain errors are automatically retried 3 times by default, with a short exponential backoff. Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors are all retried by default. @@ -266,7 +266,7 @@ client.with_options(max_retries=5).devboxes.create() ### Timeouts -By default requests time out after 1 minute. You can configure this with a `timeout` option, +By default requests time out after 30 seconds. You can configure this with a `timeout` option, which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object: ```python @@ -274,7 +274,7 @@ from runloop_api_client import Runloop # Configure the default for all requests: client = Runloop( - # 20 seconds (default is 1 minute) + # 20 seconds (default is 30 seconds) timeout=20.0, ) diff --git a/src/runloop_api_client/_constants.py b/src/runloop_api_client/_constants.py index 6be0f5e04..d1ccc0109 100644 --- a/src/runloop_api_client/_constants.py +++ b/src/runloop_api_client/_constants.py @@ -5,10 +5,10 @@ RAW_RESPONSE_HEADER = "X-Stainless-Raw-Response" OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to" -# default timeout is 1 minute -DEFAULT_TIMEOUT = httpx.Timeout(timeout=60, connect=5.0) -DEFAULT_MAX_RETRIES = 0 +# default timeout is 30 seconds +DEFAULT_TIMEOUT = httpx.Timeout(timeout=30, connect=5.0) +DEFAULT_MAX_RETRIES = 3 DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20) INITIAL_RETRY_DELAY = 1.0 -MAX_RETRY_DELAY = 10.0 +MAX_RETRY_DELAY = 15.0 diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 4623b40d7..312b9247d 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -561,6 +561,8 @@ def download_file( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT: + timeout = 600 extra_headers = {"Accept": "application/octet-stream", **(extra_headers or {})} return self._post( f"/v1/devboxes/{id}/download_file", @@ -832,6 +834,8 @@ def read_file_contents( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT: + timeout = 600 extra_headers = {"Accept": "text/plain", **(extra_headers or {})} return self._post( f"/v1/devboxes/{id}/read_file_contents", @@ -1167,6 +1171,8 @@ def upload_file( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT: + timeout = 600 body = deepcopy_minimal( { "path": path, @@ -1229,6 +1235,8 @@ def write_file_contents( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT: + timeout = 600 return self._post( f"/v1/devboxes/{id}/write_file_contents", body=maybe_transform( @@ -1701,6 +1709,8 @@ async def download_file( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT: + timeout = 600 extra_headers = {"Accept": "application/octet-stream", **(extra_headers or {})} return await self._post( f"/v1/devboxes/{id}/download_file", @@ -1972,6 +1982,8 @@ async def read_file_contents( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT: + timeout = 600 extra_headers = {"Accept": "text/plain", **(extra_headers or {})} return await self._post( f"/v1/devboxes/{id}/read_file_contents", @@ -2307,6 +2319,8 @@ async def upload_file( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT: + timeout = 600 body = deepcopy_minimal( { "path": path, @@ -2369,6 +2383,8 @@ async def write_file_contents( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT: + timeout = 600 return await self._post( f"/v1/devboxes/{id}/write_file_contents", body=await async_maybe_transform( diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index a177f6dc6..864aa7937 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -7,7 +7,7 @@ import httpx from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import is_given, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -16,6 +16,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) +from ..._constants import DEFAULT_TIMEOUT from ..._base_client import make_request_options from ...types.devboxes import execution_retrieve_params, execution_execute_sync_params, execution_execute_async_params from ...types.devbox_execution_detail_view import DevboxExecutionDetailView @@ -187,6 +188,8 @@ def execute_sync( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT: + timeout = 600 return self._post( f"/v1/devboxes/{id}/execute_sync", body=maybe_transform( @@ -416,6 +419,8 @@ async def execute_sync( """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT: + timeout = 600 return await self._post( f"/v1/devboxes/{id}/execute_sync", body=await async_maybe_transform( diff --git a/src/runloop_api_client/types/scoring_function.py b/src/runloop_api_client/types/scoring_function.py index 9d5cf655a..c49ff61e4 100644 --- a/src/runloop_api_client/types/scoring_function.py +++ b/src/runloop_api_client/types/scoring_function.py @@ -74,6 +74,9 @@ class ScorerPythonScriptScoringFunction(BaseModel): type: Literal["python_script_scorer"] + python_version_constraint: Optional[str] = None + """Python version to run scoring. Default is "==3.12.10" """ + requirements_contents: Optional[str] = None """Package dependencies to be installed. diff --git a/src/runloop_api_client/types/scoring_function_param.py b/src/runloop_api_client/types/scoring_function_param.py index bfbddb21b..1dedcc557 100644 --- a/src/runloop_api_client/types/scoring_function_param.py +++ b/src/runloop_api_client/types/scoring_function_param.py @@ -73,6 +73,9 @@ class ScorerPythonScriptScoringFunction(TypedDict, total=False): type: Required[Literal["python_script_scorer"]] + python_version_constraint: Optional[str] + """Python version to run scoring. Default is "==3.12.10" """ + requirements_contents: str """Package dependencies to be installed. diff --git a/tests/test_client.py b/tests/test_client.py index 8f3f70514..9542e6d4b 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -93,7 +93,7 @@ def test_copy_default_options(self) -> None: # options that have a default are overridden correctly copied = self.client.copy(max_retries=7) assert copied.max_retries == 7 - assert self.client.max_retries == 0 + assert self.client.max_retries == 3 copied2 = copied.copy(max_retries=6) assert copied2.max_retries == 6 @@ -754,7 +754,7 @@ class Model(BaseModel): [3, "", 1], [2, "", 1 * 2.0], [1, "", 1 * 4.0], - [-1100, "", 10], # test large number potentially overflowing + [-1100, "", 15], # test large number potentially overflowing ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) @@ -949,7 +949,7 @@ def test_copy_default_options(self) -> None: # options that have a default are overridden correctly copied = self.client.copy(max_retries=7) assert copied.max_retries == 7 - assert self.client.max_retries == 0 + assert self.client.max_retries == 3 copied2 = copied.copy(max_retries=6) assert copied2.max_retries == 6 @@ -1613,7 +1613,7 @@ class Model(BaseModel): [3, "", 1], [2, "", 1 * 2.0], [1, "", 1 * 4.0], - [-1100, "", 10], # test large number potentially overflowing + [-1100, "", 15], # test large number potentially overflowing ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) From 5cf799219b220ad266f6f514885ed9cdaaef2dd5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 1 Jul 2025 01:01:21 +0000 Subject: [PATCH 789/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index b752c3f19..212d59968 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 92 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-75c0dc94dd629772c98b3e6f763d8b3a1bdb732aa3eb92d49a59fb446fb2410d.yml openapi_spec_hash: 12286e648ea1156bfa23020ed0c7598b -config_hash: e722b7242ee36143533531c419043a6f +config_hash: 5a04741d17a98f68dc474a29c516d3f8 From 25f06a61017123f5433b0a9b8fa6baaa96fe1815 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 1 Jul 2025 01:02:37 +0000 Subject: [PATCH 790/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index fc0d7ff8b..563004f25 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.45.0" + ".": "0.46.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 33cf23a70..fcc69280b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.45.0" +version = "0.46.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 0bac585fa..f66dbcb44 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.45.0" # x-release-please-version +__version__ = "0.46.0" # x-release-please-version From b2aa25cc66fada5f40607b7cb3b3a485f69f42e7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 1 Jul 2025 22:19:10 +0000 Subject: [PATCH 791/993] feat(api): api update --- .stats.yml | 2 +- README.md | 2 +- src/runloop_api_client/_constants.py | 4 ++-- tests/test_client.py | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 212d59968..f9898b1cc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 92 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-75c0dc94dd629772c98b3e6f763d8b3a1bdb732aa3eb92d49a59fb446fb2410d.yml openapi_spec_hash: 12286e648ea1156bfa23020ed0c7598b -config_hash: 5a04741d17a98f68dc474a29c516d3f8 +config_hash: 60681f589a9e641fdb7f19af2021a033 diff --git a/README.md b/README.md index afc66e029..b62044992 100644 --- a/README.md +++ b/README.md @@ -245,7 +245,7 @@ Error codes are as follows: ### Retries -Certain errors are automatically retried 3 times by default, with a short exponential backoff. +Certain errors are automatically retried 5 times by default, with a short exponential backoff. Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors are all retried by default. diff --git a/src/runloop_api_client/_constants.py b/src/runloop_api_client/_constants.py index d1ccc0109..4fe93f3ea 100644 --- a/src/runloop_api_client/_constants.py +++ b/src/runloop_api_client/_constants.py @@ -7,8 +7,8 @@ # default timeout is 30 seconds DEFAULT_TIMEOUT = httpx.Timeout(timeout=30, connect=5.0) -DEFAULT_MAX_RETRIES = 3 +DEFAULT_MAX_RETRIES = 5 DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20) INITIAL_RETRY_DELAY = 1.0 -MAX_RETRY_DELAY = 15.0 +MAX_RETRY_DELAY = 60.0 diff --git a/tests/test_client.py b/tests/test_client.py index 9542e6d4b..ed6595b46 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -93,7 +93,7 @@ def test_copy_default_options(self) -> None: # options that have a default are overridden correctly copied = self.client.copy(max_retries=7) assert copied.max_retries == 7 - assert self.client.max_retries == 3 + assert self.client.max_retries == 5 copied2 = copied.copy(max_retries=6) assert copied2.max_retries == 6 @@ -754,7 +754,7 @@ class Model(BaseModel): [3, "", 1], [2, "", 1 * 2.0], [1, "", 1 * 4.0], - [-1100, "", 15], # test large number potentially overflowing + [-1100, "", 60], # test large number potentially overflowing ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) @@ -949,7 +949,7 @@ def test_copy_default_options(self) -> None: # options that have a default are overridden correctly copied = self.client.copy(max_retries=7) assert copied.max_retries == 7 - assert self.client.max_retries == 3 + assert self.client.max_retries == 5 copied2 = copied.copy(max_retries=6) assert copied2.max_retries == 6 @@ -1613,7 +1613,7 @@ class Model(BaseModel): [3, "", 1], [2, "", 1 * 2.0], [1, "", 1 * 4.0], - [-1100, "", 15], # test large number potentially overflowing + [-1100, "", 60], # test large number potentially overflowing ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) From 24f5875958038b01303283381289e5ccf685d178 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 1 Jul 2025 22:24:53 +0000 Subject: [PATCH 792/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 563004f25..141e7cde8 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.46.0" + ".": "0.47.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index fcc69280b..baed22217 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.46.0" +version = "0.47.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index f66dbcb44..b483571e5 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.46.0" # x-release-please-version +__version__ = "0.47.0" # x-release-please-version From d1ce0ce07e06093c92f02c3a12ee28fc47930e6d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 2 Jul 2025 05:03:32 +0000 Subject: [PATCH 793/993] chore(ci): change upload type --- .github/workflows/ci.yml | 18 ++++++++++++++++-- scripts/utils/upload-artifact.sh | 12 +++++++----- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6a934d47..aea470f67 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,10 +35,10 @@ jobs: - name: Run lints run: ./scripts/lint - upload: + build: if: github.repository == 'stainless-sdks/runloop-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) timeout-minutes: 10 - name: upload + name: build permissions: contents: read id-token: write @@ -46,6 +46,20 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Install Rye + run: | + curl -sSf https://rye.astral.sh/get | bash + echo "$HOME/.rye/shims" >> $GITHUB_PATH + env: + RYE_VERSION: '0.44.0' + RYE_INSTALL_OPTION: '--yes' + + - name: Install dependencies + run: rye sync --all-features + + - name: Run build + run: rye build + - name: Get GitHub OIDC Token id: github-oidc uses: actions/github-script@v6 diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh index 01188eb0a..36ac739d1 100755 --- a/scripts/utils/upload-artifact.sh +++ b/scripts/utils/upload-artifact.sh @@ -1,7 +1,9 @@ #!/usr/bin/env bash set -exuo pipefail -RESPONSE=$(curl -X POST "$URL" \ +FILENAME=$(basename dist/*.whl) + +RESPONSE=$(curl -X POST "$URL?filename=$FILENAME" \ -H "Authorization: Bearer $AUTH" \ -H "Content-Type: application/json") @@ -12,13 +14,13 @@ if [[ "$SIGNED_URL" == "null" ]]; then exit 1 fi -UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \ - -H "Content-Type: application/gzip" \ - --data-binary @- "$SIGNED_URL" 2>&1) +UPLOAD_RESPONSE=$(curl -v -X PUT \ + -H "Content-Type: binary/octet-stream" \ + --data-binary "@dist/$FILENAME" "$SIGNED_URL" 2>&1) if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then echo -e "\033[32mUploaded build to Stainless storage.\033[0m" - echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/runloop-python/$SHA'\033[0m" + echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/runloop-python/$SHA/$FILENAME'\033[0m" else echo -e "\033[31mFailed to upload artifact.\033[0m" exit 1 From 401fb9bd1065c528830b77c960f9412c9b1a0f70 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 02:11:46 +0000 Subject: [PATCH 794/993] chore(internal): codegen related update --- requirements-dev.lock | 2 +- requirements.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index 56d0598e4..dd8651b91 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -56,7 +56,7 @@ httpx==0.28.1 # via httpx-aiohttp # via respx # via runloop-api-client -httpx-aiohttp==0.1.6 +httpx-aiohttp==0.1.8 # via runloop-api-client idna==3.4 # via anyio diff --git a/requirements.lock b/requirements.lock index 24dc0c2dd..dba28a94b 100644 --- a/requirements.lock +++ b/requirements.lock @@ -43,7 +43,7 @@ httpcore==1.0.2 httpx==0.28.1 # via httpx-aiohttp # via runloop-api-client -httpx-aiohttp==0.1.6 +httpx-aiohttp==0.1.8 # via runloop-api-client idna==3.4 # via anyio From 5d5ca9af6d572d267d49f0fd7142f3e6620734fb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 8 Jul 2025 23:56:24 +0000 Subject: [PATCH 795/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 141e7cde8..cd2f5a323 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.47.0" + ".": "0.47.1" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index baed22217..a1c96c9e5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.47.0" +version = "0.47.1" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index b483571e5..98e09da66 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.47.0" # x-release-please-version +__version__ = "0.47.1" # x-release-please-version From 435a5e21fe24265e122d4ed46c787720ced0b4c3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 9 Jul 2025 00:32:50 +0000 Subject: [PATCH 796/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index f9898b1cc..b6e2c2d76 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 92 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-75c0dc94dd629772c98b3e6f763d8b3a1bdb732aa3eb92d49a59fb446fb2410d.yml openapi_spec_hash: 12286e648ea1156bfa23020ed0c7598b -config_hash: 60681f589a9e641fdb7f19af2021a033 +config_hash: aeb178e14a85ac4cd585f0667484c7c3 From 4c2b63e2227f2e95b614f0dace659c5e7237f5ee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 9 Jul 2025 00:37:36 +0000 Subject: [PATCH 797/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index cd2f5a323..ff6612050 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.47.1" + ".": "0.48.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index a1c96c9e5..43e9420d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.47.1" +version = "0.48.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 98e09da66..24cb51bc3 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.47.1" # x-release-please-version +__version__ = "0.48.0" # x-release-please-version From de41173c75248a8c22679633886058f4855e82cf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 9 Jul 2025 02:27:50 +0000 Subject: [PATCH 798/993] chore(internal): bump pinned h11 dep --- requirements-dev.lock | 4 ++-- requirements.lock | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index dd8651b91..de857a2d6 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -48,9 +48,9 @@ filelock==3.12.4 frozenlist==1.6.2 # via aiohttp # via aiosignal -h11==0.14.0 +h11==0.16.0 # via httpcore -httpcore==1.0.2 +httpcore==1.0.9 # via httpx httpx==0.28.1 # via httpx-aiohttp diff --git a/requirements.lock b/requirements.lock index dba28a94b..d96106522 100644 --- a/requirements.lock +++ b/requirements.lock @@ -36,9 +36,9 @@ exceptiongroup==1.2.2 frozenlist==1.6.2 # via aiohttp # via aiosignal -h11==0.14.0 +h11==0.16.0 # via httpcore -httpcore==1.0.2 +httpcore==1.0.9 # via httpx httpx==0.28.1 # via httpx-aiohttp From d51e300aab88f1d03c741c8921d49879dc4b2815 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 9 Jul 2025 02:46:49 +0000 Subject: [PATCH 799/993] chore(package): mark python 3.13 as supported --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 43e9420d4..1271b2541 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Operating System :: OS Independent", "Operating System :: POSIX", "Operating System :: MacOS", From 75170724bd58acfe7b9288fd5cd29442de43cc32 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 02:42:55 +0000 Subject: [PATCH 800/993] fix(parsing): correctly handle nested discriminated unions --- src/runloop_api_client/_models.py | 13 +++++---- tests/test_models.py | 45 +++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 5 deletions(-) diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index 4f2149805..528d56803 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -2,9 +2,10 @@ import os import inspect -from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, cast +from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast from datetime import date, datetime from typing_extensions import ( + List, Unpack, Literal, ClassVar, @@ -366,7 +367,7 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object: if type_ is None: raise RuntimeError(f"Unexpected field type is None for {key}") - return construct_type(value=value, type_=type_) + return construct_type(value=value, type_=type_, metadata=getattr(field, "metadata", None)) def is_basemodel(type_: type) -> bool: @@ -420,7 +421,7 @@ def construct_type_unchecked(*, value: object, type_: type[_T]) -> _T: return cast(_T, construct_type(value=value, type_=type_)) -def construct_type(*, value: object, type_: object) -> object: +def construct_type(*, value: object, type_: object, metadata: Optional[List[Any]] = None) -> object: """Loose coercion to the expected type with construction of nested values. If the given value does not match the expected type then it is returned as-is. @@ -438,8 +439,10 @@ def construct_type(*, value: object, type_: object) -> object: type_ = type_.__value__ # type: ignore[unreachable] # unwrap `Annotated[T, ...]` -> `T` - if is_annotated_type(type_): - meta: tuple[Any, ...] = get_args(type_)[1:] + if metadata is not None: + meta: tuple[Any, ...] = tuple(metadata) + elif is_annotated_type(type_): + meta = get_args(type_)[1:] type_ = extract_type_arg(type_, 0) else: meta = tuple() diff --git a/tests/test_models.py b/tests/test_models.py index e47644414..519462f8b 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -889,3 +889,48 @@ class ModelB(BaseModel): ) assert isinstance(m, ModelB) + + +def test_nested_discriminated_union() -> None: + class InnerType1(BaseModel): + type: Literal["type_1"] + + class InnerModel(BaseModel): + inner_value: str + + class InnerType2(BaseModel): + type: Literal["type_2"] + some_inner_model: InnerModel + + class Type1(BaseModel): + base_type: Literal["base_type_1"] + value: Annotated[ + Union[ + InnerType1, + InnerType2, + ], + PropertyInfo(discriminator="type"), + ] + + class Type2(BaseModel): + base_type: Literal["base_type_2"] + + T = Annotated[ + Union[ + Type1, + Type2, + ], + PropertyInfo(discriminator="base_type"), + ] + + model = construct_type( + type_=T, + value={ + "base_type": "base_type_1", + "value": { + "type": "type_2", + }, + }, + ) + assert isinstance(model, Type1) + assert isinstance(model.value, InnerType2) From 97deb6ebcce2cf70f879f28b1ca660cd5e5caecb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Jul 2025 00:12:12 +0000 Subject: [PATCH 801/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ff6612050..f17937927 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.48.0" + ".": "0.48.1" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 1271b2541..ed0938c55 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.48.0" +version = "0.48.1" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 24cb51bc3..ccf01e547 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.48.0" # x-release-please-version +__version__ = "0.48.1" # x-release-please-version From d48421270ac825bcc26d2a142ab4b9fea30049bd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Jul 2025 03:01:03 +0000 Subject: [PATCH 802/993] chore(readme): fix version rendering on pypi --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b62044992..1876f7729 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Runloop Python API library -[![PyPI version]()](https://pypi.org/project/runloop_api_client/) + +[![PyPI version](https://img.shields.io/pypi/v/runloop_api_client.svg?label=pypi%20(stable))](https://pypi.org/project/runloop_api_client/) The Runloop Python library provides convenient access to the Runloop REST API from any Python 3.8+ application. The library includes type definitions for all request params and response fields, From 2ed7c585e6496f3409817842515497e2a13d1810 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Jul 2025 17:52:45 +0000 Subject: [PATCH 803/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f17937927..0c2fee4ac 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.48.1" + ".": "0.48.2" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index ed0938c55..88fe6e0ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.48.1" +version = "0.48.2" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index ccf01e547..a8f5b6493 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.48.1" # x-release-please-version +__version__ = "0.48.2" # x-release-please-version From b0453b61119d5504efa7e061d4dceaafa3679545 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 12 Jul 2025 02:07:36 +0000 Subject: [PATCH 804/993] fix(client): don't send Content-Type header on GET requests --- pyproject.toml | 2 +- src/runloop_api_client/_base_client.py | 11 +++++++++-- tests/test_client.py | 4 ++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 88fe6e0ee..a74dc2c3c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ Homepage = "https://github.com/runloopai/api-client-python" Repository = "https://github.com/runloopai/api-client-python" [project.optional-dependencies] -aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.6"] +aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"] [tool.rye] managed = true diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index d2758d8cc..d3b08b71d 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -529,6 +529,15 @@ def _build_request( # work around https://github.com/encode/httpx/discussions/2880 kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")} + is_body_allowed = options.method.lower() != "get" + + if is_body_allowed: + kwargs["json"] = json_data if is_given(json_data) else None + kwargs["files"] = files + else: + headers.pop("Content-Type", None) + kwargs.pop("data", None) + # TODO: report this error to httpx return self._client.build_request( # pyright: ignore[reportUnknownMemberType] headers=headers, @@ -540,8 +549,6 @@ def _build_request( # so that passing a `TypedDict` doesn't cause an error. # https://github.com/microsoft/pyright/issues/3526#event-6715453066 params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None, - json=json_data if is_given(json_data) else None, - files=files, **kwargs, ) diff --git a/tests/test_client.py b/tests/test_client.py index ed6595b46..cb84f9ebe 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -473,7 +473,7 @@ def test_request_extra_query(self) -> None: def test_multipart_repeating_array(self, client: Runloop) -> None: request = client._build_request( FinalRequestOptions.construct( - method="get", + method="post", url="/foo", headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"}, json_data={"array": ["foo", "bar"]}, @@ -1329,7 +1329,7 @@ def test_request_extra_query(self) -> None: def test_multipart_repeating_array(self, async_client: AsyncRunloop) -> None: request = async_client._build_request( FinalRequestOptions.construct( - method="get", + method="post", url="/foo", headers={"Content-Type": "multipart/form-data; boundary=6b7ba517decee4a450543ea6ae821c82"}, json_data={"array": ["foo", "bar"]}, From 2ddcafafb6dd4f5ea6570d7b132b9ae96c6c8966 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 20:40:28 +0000 Subject: [PATCH 805/993] feat(api): api update --- .stats.yml | 6 ++-- .../resources/benchmarks/benchmarks.py | 28 +++++++++++++++++++ .../resources/blueprints.py | 8 +++--- .../resources/scenarios/scenarios.py | 28 ++++++++++++++++++- .../types/benchmark_create_params.py | 6 ++++ .../types/benchmark_run_view.py | 6 ++++ .../types/benchmark_start_run_params.py | 17 +++++++++-- .../types/benchmark_update_params.py | 6 ++++ .../types/benchmark_view.py | 6 ++++ .../types/blueprint_build_parameters.py | 2 +- .../types/blueprint_create_params.py | 2 +- .../types/blueprint_preview_params.py | 2 +- .../types/repository_inspection_details.py | 5 ++-- .../types/scenario_create_params.py | 8 +++++- .../types/scenario_run_view.py | 6 ++++ .../types/scenario_start_run_params.py | 17 +++++++++-- .../types/scenario_update_params.py | 8 ++++-- src/runloop_api_client/types/scenario_view.py | 9 +++++- .../types/shared/launch_parameters.py | 3 ++ .../types/shared_params/launch_parameters.py | 3 ++ tests/api_resources/scenarios/test_scorers.py | 2 ++ tests/api_resources/test_benchmarks.py | 12 ++++++++ tests/api_resources/test_blueprints.py | 4 +++ tests/api_resources/test_devboxes.py | 2 ++ tests/api_resources/test_scenarios.py | 16 +++++++++++ 25 files changed, 191 insertions(+), 21 deletions(-) diff --git a/.stats.yml b/.stats.yml index b6e2c2d76..e6d3acdb6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 92 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-75c0dc94dd629772c98b3e6f763d8b3a1bdb732aa3eb92d49a59fb446fb2410d.yml -openapi_spec_hash: 12286e648ea1156bfa23020ed0c7598b -config_hash: aeb178e14a85ac4cd585f0667484c7c3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e5ce0fefdcb08eeb8d337329c89374e8a11a26dd986c75cffd93ad2756fb6ed7.yml +openapi_spec_hash: e2807c1c3955b268937eb33f345dbfe5 +config_hash: 60681f589a9e641fdb7f19af2021a033 diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py index d4270d242..af8a721b3 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -70,6 +70,7 @@ def create( *, name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -87,6 +88,9 @@ def create( metadata: User defined metadata to attach to the benchmark for organization. + required_environment_variables: Environment variables required to run the benchmark. If these variables are not + supplied, the benchmark will fail to start + scenario_ids: The Scenario IDs that make up the Benchmark. extra_headers: Send extra headers @@ -105,6 +109,7 @@ def create( { "name": name, "metadata": metadata, + "required_environment_variables": required_environment_variables, "scenario_ids": scenario_ids, }, benchmark_create_params.BenchmarkCreateParams, @@ -158,6 +163,7 @@ def update( *, name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -175,6 +181,9 @@ def update( metadata: User defined metadata to attach to the benchmark for organization. + required_environment_variables: Environment variables required to run the benchmark. If these variables are not + supplied, the benchmark will fail to start + scenario_ids: The Scenario IDs that make up the Benchmark. extra_headers: Send extra headers @@ -195,6 +204,7 @@ def update( { "name": name, "metadata": metadata, + "required_environment_variables": required_environment_variables, "scenario_ids": scenario_ids, }, benchmark_update_params.BenchmarkUpdateParams, @@ -358,6 +368,7 @@ def start_run( benchmark_id: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, run_name: Optional[str] | NotGiven = NOT_GIVEN, + run_profile: Optional[benchmark_start_run_params.RunProfile] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -376,6 +387,8 @@ def start_run( run_name: Display name of the run. + run_profile: Runtime configuration to use for this benchmark run + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -393,6 +406,7 @@ def start_run( "benchmark_id": benchmark_id, "metadata": metadata, "run_name": run_name, + "run_profile": run_profile, }, benchmark_start_run_params.BenchmarkStartRunParams, ), @@ -436,6 +450,7 @@ async def create( *, name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -453,6 +468,9 @@ async def create( metadata: User defined metadata to attach to the benchmark for organization. + required_environment_variables: Environment variables required to run the benchmark. If these variables are not + supplied, the benchmark will fail to start + scenario_ids: The Scenario IDs that make up the Benchmark. extra_headers: Send extra headers @@ -471,6 +489,7 @@ async def create( { "name": name, "metadata": metadata, + "required_environment_variables": required_environment_variables, "scenario_ids": scenario_ids, }, benchmark_create_params.BenchmarkCreateParams, @@ -524,6 +543,7 @@ async def update( *, name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -541,6 +561,9 @@ async def update( metadata: User defined metadata to attach to the benchmark for organization. + required_environment_variables: Environment variables required to run the benchmark. If these variables are not + supplied, the benchmark will fail to start + scenario_ids: The Scenario IDs that make up the Benchmark. extra_headers: Send extra headers @@ -561,6 +584,7 @@ async def update( { "name": name, "metadata": metadata, + "required_environment_variables": required_environment_variables, "scenario_ids": scenario_ids, }, benchmark_update_params.BenchmarkUpdateParams, @@ -724,6 +748,7 @@ async def start_run( benchmark_id: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, run_name: Optional[str] | NotGiven = NOT_GIVEN, + run_profile: Optional[benchmark_start_run_params.RunProfile] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -742,6 +767,8 @@ async def start_run( run_name: Display name of the run. + run_profile: Runtime configuration to use for this benchmark run + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -759,6 +786,7 @@ async def start_run( "benchmark_id": benchmark_id, "metadata": metadata, "run_name": run_name, + "run_profile": run_profile, }, benchmark_start_run_params.BenchmarkStartRunParams, ), diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index 1b8dba579..dd834a9cb 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -79,7 +79,7 @@ def create( dockerfile: Dockerfile contents to be used to build the Blueprint. - file_mounts: (Optional) Map of paths and file contents to write before setup.. + file_mounts: (Optional) Map of paths and file contents to write before setup. launch_parameters: Parameters to configure your Devbox at launch time. @@ -304,7 +304,7 @@ def preview( dockerfile: Dockerfile contents to be used to build the Blueprint. - file_mounts: (Optional) Map of paths and file contents to write before setup.. + file_mounts: (Optional) Map of paths and file contents to write before setup. launch_parameters: Parameters to configure your Devbox at launch time. @@ -395,7 +395,7 @@ async def create( dockerfile: Dockerfile contents to be used to build the Blueprint. - file_mounts: (Optional) Map of paths and file contents to write before setup.. + file_mounts: (Optional) Map of paths and file contents to write before setup. launch_parameters: Parameters to configure your Devbox at launch time. @@ -620,7 +620,7 @@ async def preview( dockerfile: Dockerfile contents to be used to build the Blueprint. - file_mounts: (Optional) Map of paths and file contents to write before setup.. + file_mounts: (Optional) Map of paths and file contents to write before setup. launch_parameters: Parameters to configure your Devbox at launch time. diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index f52ab4539..504be9770 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Optional +from typing import Dict, List, Optional import httpx @@ -89,6 +89,7 @@ def create( environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, reference_output: Optional[str] | NotGiven = NOT_GIVEN, + required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -116,6 +117,9 @@ def create( can be the result of a git diff or a sequence of command actions to apply to the environment. + required_environment_variables: Environment variables required to run the scenario. If these variables are not + provided, the scenario will fail to start. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -136,6 +140,7 @@ def create( "environment_parameters": environment_parameters, "metadata": metadata, "reference_output": reference_output, + "required_environment_variables": required_environment_variables, }, scenario_create_params.ScenarioCreateParams, ), @@ -191,6 +196,7 @@ def update( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, reference_output: Optional[str] | NotGiven = NOT_GIVEN, + required_env_vars: Optional[List[str]] | NotGiven = NOT_GIVEN, scoring_contract: Optional[ScoringContractUpdateParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -218,6 +224,8 @@ def update( can be the result of a git diff or a sequence of command actions to apply to the environment. + required_env_vars: Environment variables required to run the benchmark. + scoring_contract: The scoring contract for the Scenario. extra_headers: Send extra headers @@ -241,6 +249,7 @@ def update( "metadata": metadata, "name": name, "reference_output": reference_output, + "required_env_vars": required_env_vars, "scoring_contract": scoring_contract, }, scenario_update_params.ScenarioUpdateParams, @@ -368,6 +377,7 @@ def start_run( benchmark_run_id: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, run_name: Optional[str] | NotGiven = NOT_GIVEN, + run_profile: Optional[scenario_start_run_params.RunProfile] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -388,6 +398,8 @@ def start_run( run_name: Display name of the run. + run_profile: Runtime configuration to use for this benchmark run + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -406,6 +418,7 @@ def start_run( "benchmark_run_id": benchmark_run_id, "metadata": metadata, "run_name": run_name, + "run_profile": run_profile, }, scenario_start_run_params.ScenarioStartRunParams, ), @@ -457,6 +470,7 @@ async def create( environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, reference_output: Optional[str] | NotGiven = NOT_GIVEN, + required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -484,6 +498,9 @@ async def create( can be the result of a git diff or a sequence of command actions to apply to the environment. + required_environment_variables: Environment variables required to run the scenario. If these variables are not + provided, the scenario will fail to start. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -504,6 +521,7 @@ async def create( "environment_parameters": environment_parameters, "metadata": metadata, "reference_output": reference_output, + "required_environment_variables": required_environment_variables, }, scenario_create_params.ScenarioCreateParams, ), @@ -559,6 +577,7 @@ async def update( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, reference_output: Optional[str] | NotGiven = NOT_GIVEN, + required_env_vars: Optional[List[str]] | NotGiven = NOT_GIVEN, scoring_contract: Optional[ScoringContractUpdateParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -586,6 +605,8 @@ async def update( can be the result of a git diff or a sequence of command actions to apply to the environment. + required_env_vars: Environment variables required to run the benchmark. + scoring_contract: The scoring contract for the Scenario. extra_headers: Send extra headers @@ -609,6 +630,7 @@ async def update( "metadata": metadata, "name": name, "reference_output": reference_output, + "required_env_vars": required_env_vars, "scoring_contract": scoring_contract, }, scenario_update_params.ScenarioUpdateParams, @@ -736,6 +758,7 @@ async def start_run( benchmark_run_id: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, run_name: Optional[str] | NotGiven = NOT_GIVEN, + run_profile: Optional[scenario_start_run_params.RunProfile] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -756,6 +779,8 @@ async def start_run( run_name: Display name of the run. + run_profile: Runtime configuration to use for this benchmark run + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -774,6 +799,7 @@ async def start_run( "benchmark_run_id": benchmark_run_id, "metadata": metadata, "run_name": run_name, + "run_profile": run_profile, }, scenario_start_run_params.ScenarioStartRunParams, ), diff --git a/src/runloop_api_client/types/benchmark_create_params.py b/src/runloop_api_client/types/benchmark_create_params.py index 2a46ff0df..7906b0e91 100644 --- a/src/runloop_api_client/types/benchmark_create_params.py +++ b/src/runloop_api_client/types/benchmark_create_params.py @@ -15,5 +15,11 @@ class BenchmarkCreateParams(TypedDict, total=False): metadata: Optional[Dict[str, str]] """User defined metadata to attach to the benchmark for organization.""" + required_environment_variables: Optional[List[str]] + """Environment variables required to run the benchmark. + + If these variables are not supplied, the benchmark will fail to start + """ + scenario_ids: Optional[List[str]] """The Scenario IDs that make up the Benchmark.""" diff --git a/src/runloop_api_client/types/benchmark_run_view.py b/src/runloop_api_client/types/benchmark_run_view.py index baf97cf52..aad3cd68b 100644 --- a/src/runloop_api_client/types/benchmark_run_view.py +++ b/src/runloop_api_client/types/benchmark_run_view.py @@ -27,9 +27,15 @@ class BenchmarkRunView(BaseModel): duration_ms: Optional[int] = None """The duration for the BenchmarkRun to complete.""" + environment_variables: Optional[Dict[str, str]] = None + """Environment variables used to run the benchmark.""" + name: Optional[str] = None """The name of the BenchmarkRun.""" + purpose: Optional[str] = None + """Purpose of the run.""" + score: Optional[float] = None """The final score across the BenchmarkRun, present once completed. diff --git a/src/runloop_api_client/types/benchmark_start_run_params.py b/src/runloop_api_client/types/benchmark_start_run_params.py index 9a0a70057..1a5ca1d54 100644 --- a/src/runloop_api_client/types/benchmark_start_run_params.py +++ b/src/runloop_api_client/types/benchmark_start_run_params.py @@ -3,9 +3,11 @@ from __future__ import annotations from typing import Dict, Optional -from typing_extensions import Required, TypedDict +from typing_extensions import Required, Annotated, TypedDict -__all__ = ["BenchmarkStartRunParams"] +from .._utils import PropertyInfo + +__all__ = ["BenchmarkStartRunParams", "RunProfile"] class BenchmarkStartRunParams(TypedDict, total=False): @@ -17,3 +19,14 @@ class BenchmarkStartRunParams(TypedDict, total=False): run_name: Optional[str] """Display name of the run.""" + + run_profile: Annotated[Optional[RunProfile], PropertyInfo(alias="runProfile")] + """Runtime configuration to use for this benchmark run""" + + +class RunProfile(TypedDict, total=False): + env_vars: Annotated[Optional[Dict[str, str]], PropertyInfo(alias="envVars")] + """Environment variables.""" + + purpose: Optional[str] + """Purpose of the run.""" diff --git a/src/runloop_api_client/types/benchmark_update_params.py b/src/runloop_api_client/types/benchmark_update_params.py index b3c0fd1fe..b4cb08dc2 100644 --- a/src/runloop_api_client/types/benchmark_update_params.py +++ b/src/runloop_api_client/types/benchmark_update_params.py @@ -15,5 +15,11 @@ class BenchmarkUpdateParams(TypedDict, total=False): metadata: Optional[Dict[str, str]] """User defined metadata to attach to the benchmark for organization.""" + required_environment_variables: Optional[List[str]] + """Environment variables required to run the benchmark. + + If these variables are not supplied, the benchmark will fail to start + """ + scenario_ids: Optional[List[str]] """The Scenario IDs that make up the Benchmark.""" diff --git a/src/runloop_api_client/types/benchmark_view.py b/src/runloop_api_client/types/benchmark_view.py index ceab4ff95..777aab50a 100644 --- a/src/runloop_api_client/types/benchmark_view.py +++ b/src/runloop_api_client/types/benchmark_view.py @@ -24,3 +24,9 @@ class BenchmarkView(BaseModel): is_public: Optional[bool] = None """Whether this benchmark is public.""" + + required_environment_variables: Optional[List[str]] = None + """Required environment variables used to run the benchmark. + + If any required environment are missing, the benchmark will fail to start. + """ diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index 2ce8c69bd..ee067a13d 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -20,7 +20,7 @@ class BlueprintBuildParameters(BaseModel): """Dockerfile contents to be used to build the Blueprint.""" file_mounts: Optional[Dict[str, str]] = None - """(Optional) Map of paths and file contents to write before setup..""" + """(Optional) Map of paths and file contents to write before setup.""" launch_parameters: Optional[LaunchParameters] = None """Parameters to configure your Devbox at launch time.""" diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index b851ecdd4..9fe859df3 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -22,7 +22,7 @@ class BlueprintCreateParams(TypedDict, total=False): """Dockerfile contents to be used to build the Blueprint.""" file_mounts: Optional[Dict[str, str]] - """(Optional) Map of paths and file contents to write before setup..""" + """(Optional) Map of paths and file contents to write before setup.""" launch_parameters: Optional[LaunchParameters] """Parameters to configure your Devbox at launch time.""" diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index 20d1bcd17..81aa5c29e 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -22,7 +22,7 @@ class BlueprintPreviewParams(TypedDict, total=False): """Dockerfile contents to be used to build the Blueprint.""" file_mounts: Optional[Dict[str, str]] - """(Optional) Map of paths and file contents to write before setup..""" + """(Optional) Map of paths and file contents to write before setup.""" launch_parameters: Optional[LaunchParameters] """Parameters to configure your Devbox at launch time.""" diff --git a/src/runloop_api_client/types/repository_inspection_details.py b/src/runloop_api_client/types/repository_inspection_details.py index c978586a7..8b36909e4 100644 --- a/src/runloop_api_client/types/repository_inspection_details.py +++ b/src/runloop_api_client/types/repository_inspection_details.py @@ -30,8 +30,6 @@ class RepositoryInspectionDetails(BaseModel): "inspection_pending", "inspection_failed", "inspection_success", - "image_build_success", - "image_build_failure", "inspection_user_manifest_added", ] """The status of the repository inspection.""" @@ -42,6 +40,9 @@ class RepositoryInspectionDetails(BaseModel): blueprint_name: Optional[str] = None """The blueprint name associated with this inspection if successful.""" + build_status: Optional[Literal["image_building", "image_build_success", "image_build_failure"]] = None + """The status of the linked Blueprint build.""" + user_manifest: Optional[RepositoryManifestView] = None """ User uploaded repository manifest containing container config and workspace diff --git a/src/runloop_api_client/types/scenario_create_params.py b/src/runloop_api_client/types/scenario_create_params.py index 5bd2f3d90..37438bc02 100644 --- a/src/runloop_api_client/types/scenario_create_params.py +++ b/src/runloop_api_client/types/scenario_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Optional +from typing import Dict, List, Optional from typing_extensions import Required, TypedDict from .input_context_param import InputContextParam @@ -34,3 +34,9 @@ class ScenarioCreateParams(TypedDict, total=False): Commonly can be the result of a git diff or a sequence of command actions to apply to the environment. """ + + required_environment_variables: Optional[List[str]] + """Environment variables required to run the scenario. + + If these variables are not provided, the scenario will fail to start. + """ diff --git a/src/runloop_api_client/types/scenario_run_view.py b/src/runloop_api_client/types/scenario_run_view.py index 71c805446..1b667865d 100644 --- a/src/runloop_api_client/types/scenario_run_view.py +++ b/src/runloop_api_client/types/scenario_run_view.py @@ -31,9 +31,15 @@ class ScenarioRunView(BaseModel): duration_ms: Optional[int] = None """Duration scenario took to run.""" + environment_variables: Optional[Dict[str, str]] = None + """Environment variables used to run the Scenario.""" + name: Optional[str] = None """Optional name of ScenarioRun.""" + purpose: Optional[str] = None + """Purpose of the ScenarioRun.""" + scoring_contract_result: Optional[ScoringContractResultView] = None """The scoring result of the ScenarioRun.""" diff --git a/src/runloop_api_client/types/scenario_start_run_params.py b/src/runloop_api_client/types/scenario_start_run_params.py index f9161aa2f..3a7fb80c5 100644 --- a/src/runloop_api_client/types/scenario_start_run_params.py +++ b/src/runloop_api_client/types/scenario_start_run_params.py @@ -3,9 +3,11 @@ from __future__ import annotations from typing import Dict, Optional -from typing_extensions import Required, TypedDict +from typing_extensions import Required, Annotated, TypedDict -__all__ = ["ScenarioStartRunParams"] +from .._utils import PropertyInfo + +__all__ = ["ScenarioStartRunParams", "RunProfile"] class ScenarioStartRunParams(TypedDict, total=False): @@ -20,3 +22,14 @@ class ScenarioStartRunParams(TypedDict, total=False): run_name: Optional[str] """Display name of the run.""" + + run_profile: Annotated[Optional[RunProfile], PropertyInfo(alias="runProfile")] + """Runtime configuration to use for this benchmark run""" + + +class RunProfile(TypedDict, total=False): + env_vars: Annotated[Optional[Dict[str, str]], PropertyInfo(alias="envVars")] + """Environment variables.""" + + purpose: Optional[str] + """Purpose of the run.""" diff --git a/src/runloop_api_client/types/scenario_update_params.py b/src/runloop_api_client/types/scenario_update_params.py index 1bc7524ca..6007bf844 100644 --- a/src/runloop_api_client/types/scenario_update_params.py +++ b/src/runloop_api_client/types/scenario_update_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import Dict, Optional -from typing_extensions import TypedDict +from typing import Dict, List, Optional +from typing_extensions import Annotated, TypedDict +from .._utils import PropertyInfo from .input_context_update_param import InputContextUpdateParam from .scenario_environment_param import ScenarioEnvironmentParam from .scoring_contract_update_param import ScoringContractUpdateParam @@ -32,5 +33,8 @@ class ScenarioUpdateParams(TypedDict, total=False): apply to the environment. """ + required_env_vars: Annotated[Optional[List[str]], PropertyInfo(alias="requiredEnvVars")] + """Environment variables required to run the benchmark.""" + scoring_contract: Optional[ScoringContractUpdateParam] """The scoring contract for the Scenario.""" diff --git a/src/runloop_api_client/types/scenario_view.py b/src/runloop_api_client/types/scenario_view.py index 1a3233ab7..816fef1b5 100644 --- a/src/runloop_api_client/types/scenario_view.py +++ b/src/runloop_api_client/types/scenario_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Optional +from typing import Dict, List, Optional from .._models import BaseModel from .input_context import InputContext @@ -38,3 +38,10 @@ class ScenarioView(BaseModel): Commonly can be the result of a git diff or a sequence of command actions to apply to the environment. """ + + required_environment_variables: Optional[List[str]] = None + """Environment variables required to run the scenario. + + If any required environment variables are missing, the scenario will fail to + start. + """ diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index f2f78f3da..123ec0efc 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -37,6 +37,9 @@ class LaunchParameters(BaseModel): custom_cpu_cores: Optional[int] = None """custom resource size, number of cpu cores, must be multiple of 2.""" + custom_disk_size: Optional[int] = None + """custom disk size, number in Gi, must be a multiple of 2.""" + custom_gb_memory: Optional[int] = None """custom memory size, number in Gi, must be a multiple of 2.""" diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index d51d06d99..300c6da0d 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -38,6 +38,9 @@ class LaunchParameters(TypedDict, total=False): custom_cpu_cores: Optional[int] """custom resource size, number of cpu cores, must be multiple of 2.""" + custom_disk_size: Optional[int] + """custom disk size, number in Gi, must be a multiple of 2.""" + custom_gb_memory: Optional[int] """custom memory size, number in Gi, must be a multiple of 2.""" diff --git a/tests/api_resources/scenarios/test_scorers.py b/tests/api_resources/scenarios/test_scorers.py index 5388ad044..bff5423a9 100644 --- a/tests/api_resources/scenarios/test_scorers.py +++ b/tests/api_resources/scenarios/test_scorers.py @@ -198,6 +198,7 @@ def test_method_validate_with_all_params(self, client: Runloop) -> None: "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], @@ -428,6 +429,7 @@ async def test_method_validate_with_all_params(self, async_client: AsyncRunloop) "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py index 615ff95da..bbbbd0e05 100644 --- a/tests/api_resources/test_benchmarks.py +++ b/tests/api_resources/test_benchmarks.py @@ -34,6 +34,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: benchmark = client.benchmarks.create( name="name", metadata={"foo": "string"}, + required_environment_variables=["string"], scenario_ids=["string"], ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -114,6 +115,7 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: id="id", name="name", metadata={"foo": "string"}, + required_environment_variables=["string"], scenario_ids=["string"], ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -278,6 +280,10 @@ def test_method_start_run_with_all_params(self, client: Runloop) -> None: benchmark_id="benchmark_id", metadata={"foo": "string"}, run_name="run_name", + run_profile={ + "env_vars": {"foo": "string"}, + "purpose": "purpose", + }, ) assert_matches_type(BenchmarkRunView, benchmark, path=["response"]) @@ -323,6 +329,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - benchmark = await async_client.benchmarks.create( name="name", metadata={"foo": "string"}, + required_environment_variables=["string"], scenario_ids=["string"], ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -403,6 +410,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - id="id", name="name", metadata={"foo": "string"}, + required_environment_variables=["string"], scenario_ids=["string"], ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -567,6 +575,10 @@ async def test_method_start_run_with_all_params(self, async_client: AsyncRunloop benchmark_id="benchmark_id", metadata={"foo": "string"}, run_name="run_name", + run_profile={ + "env_vars": {"foo": "string"}, + "purpose": "purpose", + }, ) assert_matches_type(BenchmarkRunView, benchmark, path=["response"]) diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index f2f3f7c67..e4c611950 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -51,6 +51,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], @@ -265,6 +266,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], @@ -337,6 +339,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], @@ -551,6 +554,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 9c9c78e49..b1299c2b0 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -67,6 +67,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], @@ -1000,6 +1001,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index 170a63476..5c5ae84c8 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -74,6 +74,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], @@ -89,6 +90,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: }, metadata={"foo": "string"}, reference_output="reference_output", + required_environment_variables=["string"], ) assert_matches_type(ScenarioView, scenario, path=["response"]) @@ -203,6 +205,7 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], @@ -223,6 +226,7 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: metadata={"foo": "string"}, name="name", reference_output="reference_output", + required_env_vars=["string"], scoring_contract={ "scoring_function_parameters": [ { @@ -354,6 +358,10 @@ def test_method_start_run_with_all_params(self, client: Runloop) -> None: benchmark_run_id="benchmark_run_id", metadata={"foo": "string"}, run_name="run_name", + run_profile={ + "env_vars": {"foo": "string"}, + "purpose": "purpose", + }, ) assert_matches_type(ScenarioRunView, scenario, path=["response"]) @@ -440,6 +448,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], @@ -455,6 +464,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - }, metadata={"foo": "string"}, reference_output="reference_output", + required_environment_variables=["string"], ) assert_matches_type(ScenarioView, scenario, path=["response"]) @@ -569,6 +579,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - "architecture": "x86_64", "available_ports": [0], "custom_cpu_cores": 0, + "custom_disk_size": 0, "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], @@ -589,6 +600,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - metadata={"foo": "string"}, name="name", reference_output="reference_output", + required_env_vars=["string"], scoring_contract={ "scoring_function_parameters": [ { @@ -720,6 +732,10 @@ async def test_method_start_run_with_all_params(self, async_client: AsyncRunloop benchmark_run_id="benchmark_run_id", metadata={"foo": "string"}, run_name="run_name", + run_profile={ + "env_vars": {"foo": "string"}, + "purpose": "purpose", + }, ) assert_matches_type(ScenarioRunView, scenario, path=["response"]) From 4472670d312088ac766a8797ebd77a4beb9c8b02 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 02:07:37 +0000 Subject: [PATCH 806/993] feat: clean up environment call outs --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 1876f7729..1866dfe99 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,6 @@ pip install runloop_api_client[aiohttp] Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: ```python -import os import asyncio from runloop_api_client import DefaultAioHttpClient from runloop_api_client import AsyncRunloop @@ -87,7 +86,7 @@ from runloop_api_client import AsyncRunloop async def main() -> None: async with AsyncRunloop( - bearer_token=os.environ.get("RUNLOOP_API_KEY"), # This is the default and can be omitted + bearer_token="My Bearer Token", http_client=DefaultAioHttpClient(), ) as client: devbox_view = await client.devboxes.create() From 80e31a878868cc8121010bb14c99436606da41e1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 17:55:31 +0000 Subject: [PATCH 807/993] feat(api): api update --- .stats.yml | 4 ++-- .../resources/blueprints.py | 20 +++++++++++++++++++ .../types/blueprint_build_parameters.py | 6 ++++++ .../types/blueprint_create_params.py | 6 ++++++ .../types/blueprint_preview_params.py | 6 ++++++ .../types/blueprint_view.py | 3 +++ tests/api_resources/test_blueprints.py | 4 ++++ 7 files changed, 47 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e6d3acdb6..51a944b95 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 92 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e5ce0fefdcb08eeb8d337329c89374e8a11a26dd986c75cffd93ad2756fb6ed7.yml -openapi_spec_hash: e2807c1c3955b268937eb33f345dbfe5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b3ce005070de130c689c5e82a0decb0515feedc16f6aed5b68a620c0e2c33c99.yml +openapi_spec_hash: a6d282538829a82c412ed65565d33c9c config_hash: 60681f589a9e641fdb7f19af2021a033 diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index dd834a9cb..6f91b5922 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -52,6 +52,7 @@ def create( self, *, name: str, + base_blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, dockerfile: Optional[str] | NotGiven = NOT_GIVEN, file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, @@ -75,6 +76,9 @@ def create( Args: name: Name of the Blueprint. + base_blueprint_id: (Optional) ID of previously built blueprint to use as a base blueprint for this + build. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -100,6 +104,7 @@ def create( body=maybe_transform( { "name": name, + "base_blueprint_id": base_blueprint_id, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, @@ -279,6 +284,7 @@ def preview( self, *, name: str, + base_blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, dockerfile: Optional[str] | NotGiven = NOT_GIVEN, file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, @@ -300,6 +306,9 @@ def preview( Args: name: Name of the Blueprint. + base_blueprint_id: (Optional) ID of previously built blueprint to use as a base blueprint for this + build. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -325,6 +334,7 @@ def preview( body=maybe_transform( { "name": name, + "base_blueprint_id": base_blueprint_id, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, @@ -368,6 +378,7 @@ async def create( self, *, name: str, + base_blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, dockerfile: Optional[str] | NotGiven = NOT_GIVEN, file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, @@ -391,6 +402,9 @@ async def create( Args: name: Name of the Blueprint. + base_blueprint_id: (Optional) ID of previously built blueprint to use as a base blueprint for this + build. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -416,6 +430,7 @@ async def create( body=await async_maybe_transform( { "name": name, + "base_blueprint_id": base_blueprint_id, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, @@ -595,6 +610,7 @@ async def preview( self, *, name: str, + base_blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, dockerfile: Optional[str] | NotGiven = NOT_GIVEN, file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, @@ -616,6 +632,9 @@ async def preview( Args: name: Name of the Blueprint. + base_blueprint_id: (Optional) ID of previously built blueprint to use as a base blueprint for this + build. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -641,6 +660,7 @@ async def preview( body=await async_maybe_transform( { "name": name, + "base_blueprint_id": base_blueprint_id, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index ee067a13d..e3742d185 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -13,6 +13,12 @@ class BlueprintBuildParameters(BaseModel): name: str """Name of the Blueprint.""" + base_blueprint_id: Optional[str] = None + """ + (Optional) ID of previously built blueprint to use as a base blueprint for this + build. + """ + code_mounts: Optional[List[CodeMountParameters]] = None """A list of code mounts to be included in the Blueprint.""" diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index 9fe859df3..a588a6a0b 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -15,6 +15,12 @@ class BlueprintCreateParams(TypedDict, total=False): name: Required[str] """Name of the Blueprint.""" + base_blueprint_id: Optional[str] + """ + (Optional) ID of previously built blueprint to use as a base blueprint for this + build. + """ + code_mounts: Optional[Iterable[CodeMountParameters]] """A list of code mounts to be included in the Blueprint.""" diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index 81aa5c29e..d7384f54c 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -15,6 +15,12 @@ class BlueprintPreviewParams(TypedDict, total=False): name: Required[str] """Name of the Blueprint.""" + base_blueprint_id: Optional[str] + """ + (Optional) ID of previously built blueprint to use as a base blueprint for this + build. + """ + code_mounts: Optional[Iterable[CodeMountParameters]] """A list of code mounts to be included in the Blueprint.""" diff --git a/src/runloop_api_client/types/blueprint_view.py b/src/runloop_api_client/types/blueprint_view.py index a6cd9c412..971c6e636 100644 --- a/src/runloop_api_client/types/blueprint_view.py +++ b/src/runloop_api_client/types/blueprint_view.py @@ -28,5 +28,8 @@ class BlueprintView(BaseModel): status: Literal["provisioning", "building", "failed", "build_complete"] """The status of the Blueprint build.""" + base_blueprint_id: Optional[str] = None + """The ID of the base Blueprint.""" + failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "build_failed"]] = None """The failure reason if the Blueprint build failed, if any.""" diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index e4c611950..25871a9e0 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -33,6 +33,7 @@ def test_method_create(self, client: Runloop) -> None: def test_method_create_with_all_params(self, client: Runloop) -> None: blueprint = client.blueprints.create( name="name", + base_blueprint_id="base_blueprint_id", code_mounts=[ { "repo_name": "repo_name", @@ -248,6 +249,7 @@ def test_method_preview(self, client: Runloop) -> None: def test_method_preview_with_all_params(self, client: Runloop) -> None: blueprint = client.blueprints.preview( name="name", + base_blueprint_id="base_blueprint_id", code_mounts=[ { "repo_name": "repo_name", @@ -321,6 +323,7 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.create( name="name", + base_blueprint_id="base_blueprint_id", code_mounts=[ { "repo_name": "repo_name", @@ -536,6 +539,7 @@ async def test_method_preview(self, async_client: AsyncRunloop) -> None: async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.preview( name="name", + base_blueprint_id="base_blueprint_id", code_mounts=[ { "repo_name": "repo_name", From 5c29ea91f93e623b1d51edfb3d2ef6bd7b5c057b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 18:02:40 +0000 Subject: [PATCH 808/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0c2fee4ac..dd7ced1c3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.48.2" + ".": "0.49.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index a74dc2c3c..3b32db696 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.48.2" +version = "0.49.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index a8f5b6493..5ac0de8a0 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.48.2" # x-release-please-version +__version__ = "0.49.0" # x-release-please-version From a58238ab8779878cce8ac077f9983dae17a8d4fe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 21:31:26 +0000 Subject: [PATCH 809/993] feat(api): api update --- .stats.yml | 4 ++-- .../types/shared/launch_parameters.py | 15 ++++++++++++--- .../types/shared_params/launch_parameters.py | 15 ++++++++++++--- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 51a944b95..1f711db8b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 92 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b3ce005070de130c689c5e82a0decb0515feedc16f6aed5b68a620c0e2c33c99.yml -openapi_spec_hash: a6d282538829a82c412ed65565d33c9c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-21b418d85e71d7b32808df083e062682b61218b07f32c952f55fc5011c2844c3.yml +openapi_spec_hash: ce35e568bb138376f3345a61a65a57cc config_hash: 60681f589a9e641fdb7f19af2021a033 diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index 123ec0efc..fdc18c6b0 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -35,13 +35,22 @@ class LaunchParameters(BaseModel): """ custom_cpu_cores: Optional[int] = None - """custom resource size, number of cpu cores, must be multiple of 2.""" + """custom resource size, number of cpu cores, must be multiple of 2. + + Min is 1, max is 16. + """ custom_disk_size: Optional[int] = None - """custom disk size, number in Gi, must be a multiple of 2.""" + """custom disk size, number in GiB, must be a multiple of 2. + + Min is 2GiB, max is 64GiB. + """ custom_gb_memory: Optional[int] = None - """custom memory size, number in Gi, must be a multiple of 2.""" + """custom memory size, number in GiB, must be a multiple of 2. + + Min is 2GiB, max is 64GiB. + """ keep_alive_time_seconds: Optional[int] = None """Time in seconds after which Devbox will automatically shutdown. diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index 300c6da0d..0ed9e4f71 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -36,13 +36,22 @@ class LaunchParameters(TypedDict, total=False): """ custom_cpu_cores: Optional[int] - """custom resource size, number of cpu cores, must be multiple of 2.""" + """custom resource size, number of cpu cores, must be multiple of 2. + + Min is 1, max is 16. + """ custom_disk_size: Optional[int] - """custom disk size, number in Gi, must be a multiple of 2.""" + """custom disk size, number in GiB, must be a multiple of 2. + + Min is 2GiB, max is 64GiB. + """ custom_gb_memory: Optional[int] - """custom memory size, number in Gi, must be a multiple of 2.""" + """custom memory size, number in GiB, must be a multiple of 2. + + Min is 2GiB, max is 64GiB. + """ keep_alive_time_seconds: Optional[int] """Time in seconds after which Devbox will automatically shutdown. From 8a5acd61b55b5db55f7cdcadd099e208d4ef01ce Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 21:48:12 +0000 Subject: [PATCH 810/993] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1f711db8b..39fbbd07f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 92 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-21b418d85e71d7b32808df083e062682b61218b07f32c952f55fc5011c2844c3.yml -openapi_spec_hash: ce35e568bb138376f3345a61a65a57cc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-963f8c488e668763300b08860aef9dd85b72c32069ca20e0c36795e86d2938b1.yml +openapi_spec_hash: 65c50f6ab92fd7bf7d108be411923a7a config_hash: 60681f589a9e641fdb7f19af2021a033 From e87e2436b135ece5f69510c42da89810dbda3046 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 22:01:15 +0000 Subject: [PATCH 811/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index dd7ced1c3..26b1ce24e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.49.0" + ".": "0.50.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 3b32db696..d314374dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.49.0" +version = "0.50.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 5ac0de8a0..ab9750372 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.49.0" # x-release-please-version +__version__ = "0.50.0" # x-release-please-version From 6dd2b661ba571d9ebdd2eaf489bb4774b9d08768 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 02:07:35 +0000 Subject: [PATCH 812/993] fix(parsing): ignore empty metadata --- src/runloop_api_client/_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index 528d56803..ffcbf67bc 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -439,7 +439,7 @@ def construct_type(*, value: object, type_: object, metadata: Optional[List[Any] type_ = type_.__value__ # type: ignore[unreachable] # unwrap `Annotated[T, ...]` -> `T` - if metadata is not None: + if metadata is not None and len(metadata) > 0: meta: tuple[Any, ...] = tuple(metadata) elif is_annotated_type(type_): meta = get_args(type_)[1:] From 1952fc47aae99cc82a9fd1561c6ebe78167aff3b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 03:12:32 +0000 Subject: [PATCH 813/993] chore(types): rebuild Pydantic models after all types are defined --- src/runloop_api_client/types/__init__.py | 13 +++++++++++++ .../types/devboxes/code_segment_info_response.py | 8 -------- .../types/devboxes/document_symbol.py | 7 ------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index e21c31852..5a4773839 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -2,6 +2,8 @@ from __future__ import annotations +from . import devboxes +from .. import _compat from .shared import ( AfterIdle as AfterIdle, LaunchParameters as LaunchParameters, @@ -81,3 +83,14 @@ from .devbox_write_file_contents_params import DevboxWriteFileContentsParams as DevboxWriteFileContentsParams from .devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView as DevboxAsyncExecutionDetailView from .devbox_read_file_contents_response import DevboxReadFileContentsResponse as DevboxReadFileContentsResponse + +# Rebuild cyclical models only after all modules are imported. +# This ensures that, when building the deferred (due to cyclical references) model schema, +# Pydantic can resolve the necessary references. +# See: https://github.com/pydantic/pydantic/issues/11250 for more context. +if _compat.PYDANTIC_V2: + devboxes.code_segment_info_response.CodeSegmentInfoResponse.model_rebuild(_parent_namespace_depth=0) + devboxes.document_symbol.DocumentSymbol.model_rebuild(_parent_namespace_depth=0) +else: + devboxes.code_segment_info_response.CodeSegmentInfoResponse.update_forward_refs() # type: ignore + devboxes.document_symbol.DocumentSymbol.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py index aa0641872..0e931bd28 100644 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ b/src/runloop_api_client/types/devboxes/code_segment_info_response.py @@ -5,7 +5,6 @@ from typing import List, Optional from .file_uri import FileUri -from ..._compat import PYDANTIC_V2 from ..._models import BaseModel from .base_range import BaseRange from .base_location import BaseLocation @@ -45,10 +44,3 @@ class CodeSegmentInfoResponse(BaseModel): from .document_symbol import DocumentSymbol - -if PYDANTIC_V2: - CodeSegmentInfoResponse.model_rebuild() - Hover.model_rebuild() -else: - CodeSegmentInfoResponse.update_forward_refs() # type: ignore - Hover.update_forward_refs() # type: ignore diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py index 30ca96d6d..02babc32e 100644 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -7,7 +7,6 @@ from pydantic import Field as FieldInfo from .range import Range -from ..._compat import PYDANTIC_V2 from ..._models import BaseModel from .symbol_tag import SymbolTag from .symbol_kind import SymbolKind @@ -56,9 +55,3 @@ class DocumentSymbol(BaseModel): # To access properties that are not valid identifiers you can use `getattr`, e.g. # `getattr(obj, '$type')` def __getattr__(self, attr: str) -> object: ... - - -if PYDANTIC_V2: - DocumentSymbol.model_rebuild() -else: - DocumentSymbol.update_forward_refs() # type: ignore From 5f3729b4332fbcae1a930d4d67b02f1569713889 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 02:23:46 +0000 Subject: [PATCH 814/993] fix(parsing): parse extra field types --- src/runloop_api_client/_models.py | 25 ++++++++++++++-- .../types/devboxes/document_symbol.py | 3 +- .../types/devboxes/position.py | 5 +++- .../types/devboxes/range.py | 5 +++- .../types/devboxes/text_edit.py | 3 +- tests/test_models.py | 29 ++++++++++++++++++- 6 files changed, 63 insertions(+), 7 deletions(-) diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index ffcbf67bc..b8387ce98 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -208,14 +208,18 @@ def construct( # pyright: ignore[reportIncompatibleMethodOverride] else: fields_values[name] = field_get_default(field) + extra_field_type = _get_extra_fields_type(__cls) + _extra = {} for key, value in values.items(): if key not in model_fields: + parsed = construct_type(value=value, type_=extra_field_type) if extra_field_type is not None else value + if PYDANTIC_V2: - _extra[key] = value + _extra[key] = parsed else: _fields_set.add(key) - fields_values[key] = value + fields_values[key] = parsed object.__setattr__(m, "__dict__", fields_values) @@ -370,6 +374,23 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object: return construct_type(value=value, type_=type_, metadata=getattr(field, "metadata", None)) +def _get_extra_fields_type(cls: type[pydantic.BaseModel]) -> type | None: + if not PYDANTIC_V2: + # TODO + return None + + schema = cls.__pydantic_core_schema__ + if schema["type"] == "model": + fields = schema["schema"] + if fields["type"] == "model-fields": + extras = fields.get("extras_schema") + if extras and "cls" in extras: + # mypy can't narrow the type + return extras["cls"] # type: ignore[no-any-return] + + return None + + def is_basemodel(type_: type) -> bool: """Returns whether or not the given type is either a `BaseModel` or a union of `BaseModel`""" if is_union(type_): diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py index 02babc32e..39eb3e0ce 100644 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ b/src/runloop_api_client/types/devboxes/document_symbol.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING, List, Optional +from typing import TYPE_CHECKING, Dict, List, Optional from pydantic import Field as FieldInfo @@ -50,6 +50,7 @@ class DocumentSymbol(BaseModel): tags: Optional[List[SymbolTag]] = None """Tags for this document symbol.""" + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. # To access properties that are not valid identifiers you can use `getattr`, e.g. diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py index 411f291c1..25937dec2 100644 --- a/src/runloop_api_client/types/devboxes/position.py +++ b/src/runloop_api_client/types/devboxes/position.py @@ -1,6 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Dict + +from pydantic import Field as FieldInfo from .uinteger import Uinteger from ..._models import BaseModel @@ -27,6 +29,7 @@ class Position(BaseModel): defaults to 0. """ + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. # To access properties that are not valid identifiers you can use `getattr`, e.g. diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py index 9be6adb56..b7b4717e5 100644 --- a/src/runloop_api_client/types/devboxes/range.py +++ b/src/runloop_api_client/types/devboxes/range.py @@ -1,6 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Dict + +from pydantic import Field as FieldInfo from .position import Position from ..._models import BaseModel @@ -15,6 +17,7 @@ class Range(BaseModel): start: Position """The range's start position.""" + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. # To access properties that are not valid identifiers you can use `getattr`, e.g. diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py index 30826edbc..3f1c860a8 100644 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ b/src/runloop_api_client/types/devboxes/text_edit.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Dict from pydantic import Field as FieldInfo @@ -20,6 +20,7 @@ class TextEdit(BaseModel): To insert text into a document create a range where start === end. """ + __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] if TYPE_CHECKING: # Stub to indicate that arbitrary properties are accepted. # To access properties that are not valid identifiers you can use `getattr`, e.g. diff --git a/tests/test_models.py b/tests/test_models.py index 519462f8b..b11d9b63d 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -1,5 +1,5 @@ import json -from typing import Any, Dict, List, Union, Optional, cast +from typing import TYPE_CHECKING, Any, Dict, List, Union, Optional, cast from datetime import datetime, timezone from typing_extensions import Literal, Annotated, TypeAliasType @@ -934,3 +934,30 @@ class Type2(BaseModel): ) assert isinstance(model, Type1) assert isinstance(model.value, InnerType2) + + +@pytest.mark.skipif(not PYDANTIC_V2, reason="this is only supported in pydantic v2 for now") +def test_extra_properties() -> None: + class Item(BaseModel): + prop: int + + class Model(BaseModel): + __pydantic_extra__: Dict[str, Item] = Field(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + other: str + + if TYPE_CHECKING: + + def __getattr__(self, attr: str) -> Item: ... + + model = construct_type( + type_=Model, + value={ + "a": {"prop": 1}, + "other": "foo", + }, + ) + assert isinstance(model, Model) + assert model.a.prop == 1 + assert isinstance(model.a, Item) + assert model.other == "foo" From 1ab1ceecaeb59f9a53938ca2fd3ffeb649c0c8d1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 03:20:03 +0000 Subject: [PATCH 815/993] chore(project): add settings file for vscode --- .gitignore | 1 - .vscode/settings.json | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 877974080..95ceb189a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .prism.log -.vscode _dev __pycache__ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..5b0103078 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.analysis.importFormat": "relative", +} From 1f0d8aac93623f19bb79e1cab06c6ee030adb744 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 23:26:35 +0000 Subject: [PATCH 816/993] feat(api): api update --- .stats.yml | 4 +- .../resources/devboxes/devboxes.py | 40 +++++++++++++ .../types/devbox_upload_file_params.py | 13 +++++ .../devbox_write_file_contents_params.py | 13 +++++ .../types/repository_manifest_view.py | 58 ++++++++++++++++--- tests/api_resources/test_devboxes.py | 26 +++++++++ 6 files changed, 145 insertions(+), 9 deletions(-) diff --git a/.stats.yml b/.stats.yml index 39fbbd07f..1e72a9a13 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 92 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-963f8c488e668763300b08860aef9dd85b72c32069ca20e0c36795e86d2938b1.yml -openapi_spec_hash: 65c50f6ab92fd7bf7d108be411923a7a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bbb5c731b774122662526cc0b24015828012b1f09bb32fe2d54498aa09e52c92.yml +openapi_spec_hash: 3d23e89561895724da8d48967dd26f17 config_hash: 60681f589a9e641fdb7f19af2021a033 diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 312b9247d..591f37b9c 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -1140,7 +1140,9 @@ def upload_file( id: str, *, path: str, + chmod: Optional[str] | NotGiven = NOT_GIVEN, file: FileTypes | NotGiven = NOT_GIVEN, + owner: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1159,6 +1161,12 @@ def upload_file( path: The path to write the file to on the Devbox. Path is relative to user home directory. + chmod: File permissions in octal format (e.g., "644", "1755"). Optional. If not + specified, default system permissions will be used. + + owner: File owner username. Optional. If not specified, the file will be owned by the + current user. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1176,7 +1184,9 @@ def upload_file( body = deepcopy_minimal( { "path": path, + "chmod": chmod, "file": file, + "owner": owner, } ) files = extract_files(cast(Mapping[str, object], body), paths=[["file"]]) @@ -1204,6 +1214,8 @@ def write_file_contents( *, contents: str, file_path: str, + chmod: Optional[str] | NotGiven = NOT_GIVEN, + owner: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1223,6 +1235,12 @@ def write_file_contents( file_path: The path to write the file to on the Devbox. Path is relative to user home directory. + chmod: File permissions in octal format (e.g., "644", "1755"). Optional. If not + specified, default system permissions will be used. + + owner: File owner username. Optional. If not specified, the file will be owned by the + current user. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1243,6 +1261,8 @@ def write_file_contents( { "contents": contents, "file_path": file_path, + "chmod": chmod, + "owner": owner, }, devbox_write_file_contents_params.DevboxWriteFileContentsParams, ), @@ -2288,7 +2308,9 @@ async def upload_file( id: str, *, path: str, + chmod: Optional[str] | NotGiven = NOT_GIVEN, file: FileTypes | NotGiven = NOT_GIVEN, + owner: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2307,6 +2329,12 @@ async def upload_file( path: The path to write the file to on the Devbox. Path is relative to user home directory. + chmod: File permissions in octal format (e.g., "644", "1755"). Optional. If not + specified, default system permissions will be used. + + owner: File owner username. Optional. If not specified, the file will be owned by the + current user. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2324,7 +2352,9 @@ async def upload_file( body = deepcopy_minimal( { "path": path, + "chmod": chmod, "file": file, + "owner": owner, } ) files = extract_files(cast(Mapping[str, object], body), paths=[["file"]]) @@ -2352,6 +2382,8 @@ async def write_file_contents( *, contents: str, file_path: str, + chmod: Optional[str] | NotGiven = NOT_GIVEN, + owner: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2371,6 +2403,12 @@ async def write_file_contents( file_path: The path to write the file to on the Devbox. Path is relative to user home directory. + chmod: File permissions in octal format (e.g., "644", "1755"). Optional. If not + specified, default system permissions will be used. + + owner: File owner username. Optional. If not specified, the file will be owned by the + current user. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2391,6 +2429,8 @@ async def write_file_contents( { "contents": contents, "file_path": file_path, + "chmod": chmod, + "owner": owner, }, devbox_write_file_contents_params.DevboxWriteFileContentsParams, ), diff --git a/src/runloop_api_client/types/devbox_upload_file_params.py b/src/runloop_api_client/types/devbox_upload_file_params.py index 9e83fa318..edcad111d 100644 --- a/src/runloop_api_client/types/devbox_upload_file_params.py +++ b/src/runloop_api_client/types/devbox_upload_file_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, TypedDict from .._types import FileTypes @@ -16,4 +17,16 @@ class DevboxUploadFileParams(TypedDict, total=False): Path is relative to user home directory. """ + chmod: Optional[str] + """File permissions in octal format (e.g., "644", "1755"). + + Optional. If not specified, default system permissions will be used. + """ + file: FileTypes + + owner: Optional[str] + """File owner username. + + Optional. If not specified, the file will be owned by the current user. + """ diff --git a/src/runloop_api_client/types/devbox_write_file_contents_params.py b/src/runloop_api_client/types/devbox_write_file_contents_params.py index f47a73839..549125912 100644 --- a/src/runloop_api_client/types/devbox_write_file_contents_params.py +++ b/src/runloop_api_client/types/devbox_write_file_contents_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, TypedDict __all__ = ["DevboxWriteFileContentsParams"] @@ -16,3 +17,15 @@ class DevboxWriteFileContentsParams(TypedDict, total=False): Path is relative to user home directory. """ + + chmod: Optional[str] + """File permissions in octal format (e.g., "644", "1755"). + + Optional. If not specified, default system permissions will be used. + """ + + owner: Optional[str] + """File owner username. + + Optional. If not specified, the file will be owned by the current user. + """ diff --git a/src/runloop_api_client/types/repository_manifest_view.py b/src/runloop_api_client/types/repository_manifest_view.py index d4dbf0b3e..334910a99 100644 --- a/src/runloop_api_client/types/repository_manifest_view.py +++ b/src/runloop_api_client/types/repository_manifest_view.py @@ -1,10 +1,17 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Dict, List, Optional from .._models import BaseModel -__all__ = ["RepositoryManifestView", "ContainerConfig", "Workspace", "WorkspaceDevCommands"] +__all__ = [ + "RepositoryManifestView", + "ContainerConfig", + "Workspace", + "WorkspaceDevCommands", + "ContainerizedService", + "ContainerizedServiceCredentials", +] class ContainerConfig(BaseModel): @@ -23,21 +30,21 @@ class ContainerConfig(BaseModel): class WorkspaceDevCommands(BaseModel): - build: Optional[str] = None + build: Optional[List[str]] = None """Build command (e.g. npm run build).""" - install: Optional[str] = None + install: Optional[List[str]] = None """Installation command (e.g. pip install -r requirements.txt).""" - lint: Optional[str] = None + lint: Optional[List[str]] = None """Lint command (e.g. flake8).""" - test: Optional[str] = None + test: Optional[List[str]] = None """Test command (e.g. pytest).""" class Workspace(BaseModel): - package_manager: str + package_manager: List[str] """Name of the package manager used (e.g. pip, npm).""" dev_commands: Optional[WorkspaceDevCommands] = None @@ -80,6 +87,37 @@ class Workspace(BaseModel): """ +class ContainerizedServiceCredentials(BaseModel): + password: str + """The password of the container service.""" + + username: str + """The username of the container service.""" + + +class ContainerizedService(BaseModel): + image: str + """The image of the container service.""" + + name: str + """The name of the container service.""" + + credentials: Optional[ContainerizedServiceCredentials] = None + """The credentials of the container service.""" + + env: Optional[Dict[str, str]] = None + """The environment variables of the container service.""" + + options: Optional[str] = None + """Additional Docker container create options.""" + + port_mappings: Optional[List[str]] = None + """The port mappings of the container service. + + Port mappings are in the format of :. + """ + + class RepositoryManifestView(BaseModel): container_config: ContainerConfig """Container configuration specifying the base image and setup commands.""" @@ -89,3 +127,9 @@ class RepositoryManifestView(BaseModel): Each workspace represents a buildable unit of code. """ + + containerized_services: Optional[List[ContainerizedService]] = None + """List of discovered ContainerizedServices. + + Services can be explicitly started when creating a Devbox. + """ diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index b1299c2b0..5b787b627 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -882,7 +882,9 @@ def test_method_upload_file_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.upload_file( id="id", path="path", + chmod="chmod", file=b"raw file contents", + owner="owner", ) assert_matches_type(object, devbox, path=["response"]) @@ -929,6 +931,17 @@ def test_method_write_file_contents(self, client: Runloop) -> None: ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + @parametrize + def test_method_write_file_contents_with_all_params(self, client: Runloop) -> None: + devbox = client.devboxes.write_file_contents( + id="id", + contents="contents", + file_path="file_path", + chmod="chmod", + owner="owner", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + @parametrize def test_raw_response_write_file_contents(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.write_file_contents( @@ -1816,7 +1829,9 @@ async def test_method_upload_file_with_all_params(self, async_client: AsyncRunlo devbox = await async_client.devboxes.upload_file( id="id", path="path", + chmod="chmod", file=b"raw file contents", + owner="owner", ) assert_matches_type(object, devbox, path=["response"]) @@ -1863,6 +1878,17 @@ async def test_method_write_file_contents(self, async_client: AsyncRunloop) -> N ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + @parametrize + async def test_method_write_file_contents_with_all_params(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.write_file_contents( + id="id", + contents="contents", + file_path="file_path", + chmod="chmod", + owner="owner", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + @parametrize async def test_raw_response_write_file_contents(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.write_file_contents( From ff716874b863267f46382d07381e79bd4c5b5e29 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 23:29:37 +0000 Subject: [PATCH 817/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 26b1ce24e..2b2b4fa9e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.50.0" + ".": "0.51.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index d314374dd..9c383f0b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.50.0" +version = "0.51.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index ab9750372..fd4eb3432 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.50.0" # x-release-please-version +__version__ = "0.51.0" # x-release-please-version From 26387753c9df50f6675d9c5d4062fd68c435bc9d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 18:09:02 +0000 Subject: [PATCH 818/993] feat(api): api update --- .stats.yml | 4 +- .../resources/benchmarks/benchmarks.py | 40 +++++++++++++---- .../resources/scenarios/scenarios.py | 32 ++++++++++--- .../types/benchmark_create_params.py | 9 +++- .../types/benchmark_run_view.py | 3 ++ .../types/benchmark_start_run_params.py | 5 ++- .../types/benchmark_update_params.py | 9 +++- .../types/benchmark_view.py | 9 +++- .../types/blueprint_view.py | 45 ++++++++++++++++++- .../types/scenario_create_params.py | 7 +++ .../types/scenario_run_view.py | 5 ++- .../types/scenario_start_run_params.py | 5 ++- .../types/scenario_update_params.py | 10 +++-- src/runloop_api_client/types/scenario_view.py | 6 +++ .../types/shared/launch_parameters.py | 6 +++ .../types/shared_params/launch_parameters.py | 6 +++ tests/api_resources/scenarios/test_scorers.py | 2 + tests/api_resources/test_benchmarks.py | 6 +++ tests/api_resources/test_blueprints.py | 4 ++ tests/api_resources/test_devboxes.py | 2 + tests/api_resources/test_scenarios.py | 14 +++++- 21 files changed, 199 insertions(+), 30 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1e72a9a13..5be2d49b7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 92 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-bbb5c731b774122662526cc0b24015828012b1f09bb32fe2d54498aa09e52c92.yml -openapi_spec_hash: 3d23e89561895724da8d48967dd26f17 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2417f3ff96b2f0934e6ee5cafd072e111515712cebb58eff3690bda46b9e04d8.yml +openapi_spec_hash: 15877c256d01485dacbb4e348d79845d config_hash: 60681f589a9e641fdb7f19af2021a033 diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py index af8a721b3..3df2b183d 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -71,6 +71,7 @@ def create( name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, + required_secrets: List[str] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -88,8 +89,12 @@ def create( metadata: User defined metadata to attach to the benchmark for organization. - required_environment_variables: Environment variables required to run the benchmark. If these variables are not - supplied, the benchmark will fail to start + required_environment_variables: Environment variables required to run the benchmark. If any required variables + are not supplied, the benchmark will fail to start + + required_secrets: Secrets required to run the benchmark with (user secret name will be mapped to + benchmark required secret name). If any of these secrets are not provided or the + mapping is incorrect, the benchmark will fail to start. scenario_ids: The Scenario IDs that make up the Benchmark. @@ -110,6 +115,7 @@ def create( "name": name, "metadata": metadata, "required_environment_variables": required_environment_variables, + "required_secrets": required_secrets, "scenario_ids": scenario_ids, }, benchmark_create_params.BenchmarkCreateParams, @@ -164,6 +170,7 @@ def update( name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, + required_secrets: List[str] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -181,8 +188,12 @@ def update( metadata: User defined metadata to attach to the benchmark for organization. - required_environment_variables: Environment variables required to run the benchmark. If these variables are not - supplied, the benchmark will fail to start + required_environment_variables: Environment variables required to run the benchmark. If any required variables + are not supplied, the benchmark will fail to start + + required_secrets: Secrets required to run the benchmark with (user secret name will be mapped to + benchmark required secret name). If any of these secrets are not provided or the + mapping is incorrect, the benchmark will fail to start. scenario_ids: The Scenario IDs that make up the Benchmark. @@ -205,6 +216,7 @@ def update( "name": name, "metadata": metadata, "required_environment_variables": required_environment_variables, + "required_secrets": required_secrets, "scenario_ids": scenario_ids, }, benchmark_update_params.BenchmarkUpdateParams, @@ -451,6 +463,7 @@ async def create( name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, + required_secrets: List[str] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -468,8 +481,12 @@ async def create( metadata: User defined metadata to attach to the benchmark for organization. - required_environment_variables: Environment variables required to run the benchmark. If these variables are not - supplied, the benchmark will fail to start + required_environment_variables: Environment variables required to run the benchmark. If any required variables + are not supplied, the benchmark will fail to start + + required_secrets: Secrets required to run the benchmark with (user secret name will be mapped to + benchmark required secret name). If any of these secrets are not provided or the + mapping is incorrect, the benchmark will fail to start. scenario_ids: The Scenario IDs that make up the Benchmark. @@ -490,6 +507,7 @@ async def create( "name": name, "metadata": metadata, "required_environment_variables": required_environment_variables, + "required_secrets": required_secrets, "scenario_ids": scenario_ids, }, benchmark_create_params.BenchmarkCreateParams, @@ -544,6 +562,7 @@ async def update( name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, + required_secrets: List[str] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -561,8 +580,12 @@ async def update( metadata: User defined metadata to attach to the benchmark for organization. - required_environment_variables: Environment variables required to run the benchmark. If these variables are not - supplied, the benchmark will fail to start + required_environment_variables: Environment variables required to run the benchmark. If any required variables + are not supplied, the benchmark will fail to start + + required_secrets: Secrets required to run the benchmark with (user secret name will be mapped to + benchmark required secret name). If any of these secrets are not provided or the + mapping is incorrect, the benchmark will fail to start. scenario_ids: The Scenario IDs that make up the Benchmark. @@ -585,6 +608,7 @@ async def update( "name": name, "metadata": metadata, "required_environment_variables": required_environment_variables, + "required_secrets": required_secrets, "scenario_ids": scenario_ids, }, benchmark_update_params.BenchmarkUpdateParams, diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index 504be9770..7e7199b27 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -90,6 +90,7 @@ def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, reference_output: Optional[str] | NotGiven = NOT_GIVEN, required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, + required_secret_names: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -120,6 +121,10 @@ def create( required_environment_variables: Environment variables required to run the scenario. If these variables are not provided, the scenario will fail to start. + required_secret_names: Secrets required to run the scenario (user secret name to scenario required + secret name). If these secrets are not provided or the mapping is incorrect, the + scenario will fail to start. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -141,6 +146,7 @@ def create( "metadata": metadata, "reference_output": reference_output, "required_environment_variables": required_environment_variables, + "required_secret_names": required_secret_names, }, scenario_create_params.ScenarioCreateParams, ), @@ -196,7 +202,8 @@ def update( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, reference_output: Optional[str] | NotGiven = NOT_GIVEN, - required_env_vars: Optional[List[str]] | NotGiven = NOT_GIVEN, + required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, + required_secrets: Optional[List[str]] | NotGiven = NOT_GIVEN, scoring_contract: Optional[ScoringContractUpdateParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -224,7 +231,9 @@ def update( can be the result of a git diff or a sequence of command actions to apply to the environment. - required_env_vars: Environment variables required to run the benchmark. + required_environment_variables: Environment variables required to run the scenario. + + required_secrets: Secrets required to run the scenario. scoring_contract: The scoring contract for the Scenario. @@ -249,7 +258,8 @@ def update( "metadata": metadata, "name": name, "reference_output": reference_output, - "required_env_vars": required_env_vars, + "required_environment_variables": required_environment_variables, + "required_secrets": required_secrets, "scoring_contract": scoring_contract, }, scenario_update_params.ScenarioUpdateParams, @@ -471,6 +481,7 @@ async def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, reference_output: Optional[str] | NotGiven = NOT_GIVEN, required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, + required_secret_names: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -501,6 +512,10 @@ async def create( required_environment_variables: Environment variables required to run the scenario. If these variables are not provided, the scenario will fail to start. + required_secret_names: Secrets required to run the scenario (user secret name to scenario required + secret name). If these secrets are not provided or the mapping is incorrect, the + scenario will fail to start. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -522,6 +537,7 @@ async def create( "metadata": metadata, "reference_output": reference_output, "required_environment_variables": required_environment_variables, + "required_secret_names": required_secret_names, }, scenario_create_params.ScenarioCreateParams, ), @@ -577,7 +593,8 @@ async def update( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, reference_output: Optional[str] | NotGiven = NOT_GIVEN, - required_env_vars: Optional[List[str]] | NotGiven = NOT_GIVEN, + required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, + required_secrets: Optional[List[str]] | NotGiven = NOT_GIVEN, scoring_contract: Optional[ScoringContractUpdateParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -605,7 +622,9 @@ async def update( can be the result of a git diff or a sequence of command actions to apply to the environment. - required_env_vars: Environment variables required to run the benchmark. + required_environment_variables: Environment variables required to run the scenario. + + required_secrets: Secrets required to run the scenario. scoring_contract: The scoring contract for the Scenario. @@ -630,7 +649,8 @@ async def update( "metadata": metadata, "name": name, "reference_output": reference_output, - "required_env_vars": required_env_vars, + "required_environment_variables": required_environment_variables, + "required_secrets": required_secrets, "scoring_contract": scoring_contract, }, scenario_update_params.ScenarioUpdateParams, diff --git a/src/runloop_api_client/types/benchmark_create_params.py b/src/runloop_api_client/types/benchmark_create_params.py index 7906b0e91..2025bc52c 100644 --- a/src/runloop_api_client/types/benchmark_create_params.py +++ b/src/runloop_api_client/types/benchmark_create_params.py @@ -18,7 +18,14 @@ class BenchmarkCreateParams(TypedDict, total=False): required_environment_variables: Optional[List[str]] """Environment variables required to run the benchmark. - If these variables are not supplied, the benchmark will fail to start + If any required variables are not supplied, the benchmark will fail to start + """ + + required_secrets: List[str] + """ + Secrets required to run the benchmark with (user secret name will be mapped to + benchmark required secret name). If any of these secrets are not provided or the + mapping is incorrect, the benchmark will fail to start. """ scenario_ids: Optional[List[str]] diff --git a/src/runloop_api_client/types/benchmark_run_view.py b/src/runloop_api_client/types/benchmark_run_view.py index aad3cd68b..140122ecd 100644 --- a/src/runloop_api_client/types/benchmark_run_view.py +++ b/src/runloop_api_client/types/benchmark_run_view.py @@ -41,3 +41,6 @@ class BenchmarkRunView(BaseModel): Calculated as sum of scenario scores / number of scenario runs. """ + + secrets_provided: Optional[Dict[str, str]] = None + """User secrets used to run the benchmark.""" diff --git a/src/runloop_api_client/types/benchmark_start_run_params.py b/src/runloop_api_client/types/benchmark_start_run_params.py index 1a5ca1d54..caa2e1927 100644 --- a/src/runloop_api_client/types/benchmark_start_run_params.py +++ b/src/runloop_api_client/types/benchmark_start_run_params.py @@ -26,7 +26,10 @@ class BenchmarkStartRunParams(TypedDict, total=False): class RunProfile(TypedDict, total=False): env_vars: Annotated[Optional[Dict[str, str]], PropertyInfo(alias="envVars")] - """Environment variables.""" + """Environment Variables: Environment Variable to Value.""" purpose: Optional[str] """Purpose of the run.""" + + secrets: Optional[Dict[str, str]] + """Secrets: Environment Variable to User Secret Name.""" diff --git a/src/runloop_api_client/types/benchmark_update_params.py b/src/runloop_api_client/types/benchmark_update_params.py index b4cb08dc2..d3b2a1276 100644 --- a/src/runloop_api_client/types/benchmark_update_params.py +++ b/src/runloop_api_client/types/benchmark_update_params.py @@ -18,7 +18,14 @@ class BenchmarkUpdateParams(TypedDict, total=False): required_environment_variables: Optional[List[str]] """Environment variables required to run the benchmark. - If these variables are not supplied, the benchmark will fail to start + If any required variables are not supplied, the benchmark will fail to start + """ + + required_secrets: List[str] + """ + Secrets required to run the benchmark with (user secret name will be mapped to + benchmark required secret name). If any of these secrets are not provided or the + mapping is incorrect, the benchmark will fail to start. """ scenario_ids: Optional[List[str]] diff --git a/src/runloop_api_client/types/benchmark_view.py b/src/runloop_api_client/types/benchmark_view.py index 777aab50a..1b8753c1f 100644 --- a/src/runloop_api_client/types/benchmark_view.py +++ b/src/runloop_api_client/types/benchmark_view.py @@ -28,5 +28,12 @@ class BenchmarkView(BaseModel): required_environment_variables: Optional[List[str]] = None """Required environment variables used to run the benchmark. - If any required environment are missing, the benchmark will fail to start. + If any required environment variables are missing, the benchmark will fail to + start. + """ + + required_secret_names: Optional[List[str]] = None + """Required secrets used to run the benchmark. + + If any required secrets are missing, the benchmark will fail to start. """ diff --git a/src/runloop_api_client/types/blueprint_view.py b/src/runloop_api_client/types/blueprint_view.py index 971c6e636..7ea201c55 100644 --- a/src/runloop_api_client/types/blueprint_view.py +++ b/src/runloop_api_client/types/blueprint_view.py @@ -1,12 +1,45 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import Dict, List, Optional from typing_extensions import Literal +from pydantic import Field as FieldInfo + from .._models import BaseModel from .blueprint_build_parameters import BlueprintBuildParameters -__all__ = ["BlueprintView"] +__all__ = ["BlueprintView", "ContainerizedService", "ContainerizedServiceCredentials"] + + +class ContainerizedServiceCredentials(BaseModel): + password: str + """The password of the container service.""" + + username: str + """The username of the container service.""" + + +class ContainerizedService(BaseModel): + image: str + """The image of the container service.""" + + name: str + """The name of the container service.""" + + credentials: Optional[ContainerizedServiceCredentials] = None + """The credentials of the container service.""" + + env: Optional[Dict[str, str]] = None + """The environment variables of the container service.""" + + options: Optional[str] = None + """Additional Docker container create options.""" + + port_mappings: Optional[List[str]] = None + """The port mappings of the container service. + + Port mappings are in the format of :. + """ class BlueprintView(BaseModel): @@ -31,5 +64,13 @@ class BlueprintView(BaseModel): base_blueprint_id: Optional[str] = None """The ID of the base Blueprint.""" + containerized_services: Optional[List[ContainerizedService]] = FieldInfo( + alias="containerizedServices", default=None + ) + """List of ContainerizedServices available in the Blueprint. + + Services can be explicitly started when creating a Devbox. + """ + failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "build_failed"]] = None """The failure reason if the Blueprint build failed, if any.""" diff --git a/src/runloop_api_client/types/scenario_create_params.py b/src/runloop_api_client/types/scenario_create_params.py index 37438bc02..71f402aa9 100644 --- a/src/runloop_api_client/types/scenario_create_params.py +++ b/src/runloop_api_client/types/scenario_create_params.py @@ -40,3 +40,10 @@ class ScenarioCreateParams(TypedDict, total=False): If these variables are not provided, the scenario will fail to start. """ + + required_secret_names: Optional[List[str]] + """ + Secrets required to run the scenario (user secret name to scenario required + secret name). If these secrets are not provided or the mapping is incorrect, the + scenario will fail to start. + """ diff --git a/src/runloop_api_client/types/scenario_run_view.py b/src/runloop_api_client/types/scenario_run_view.py index 1b667865d..225e90a89 100644 --- a/src/runloop_api_client/types/scenario_run_view.py +++ b/src/runloop_api_client/types/scenario_run_view.py @@ -32,7 +32,7 @@ class ScenarioRunView(BaseModel): """Duration scenario took to run.""" environment_variables: Optional[Dict[str, str]] = None - """Environment variables used to run the Scenario.""" + """Environment variables used to run the scenario.""" name: Optional[str] = None """Optional name of ScenarioRun.""" @@ -43,5 +43,8 @@ class ScenarioRunView(BaseModel): scoring_contract_result: Optional[ScoringContractResultView] = None """The scoring result of the ScenarioRun.""" + secrets_provided: Optional[Dict[str, str]] = None + """User secrets used to run the scenario.""" + start_time_ms: Optional[int] = None """The time that the scenario started""" diff --git a/src/runloop_api_client/types/scenario_start_run_params.py b/src/runloop_api_client/types/scenario_start_run_params.py index 3a7fb80c5..ea3871193 100644 --- a/src/runloop_api_client/types/scenario_start_run_params.py +++ b/src/runloop_api_client/types/scenario_start_run_params.py @@ -29,7 +29,10 @@ class ScenarioStartRunParams(TypedDict, total=False): class RunProfile(TypedDict, total=False): env_vars: Annotated[Optional[Dict[str, str]], PropertyInfo(alias="envVars")] - """Environment variables.""" + """Environment Variables: Environment Variable to Value.""" purpose: Optional[str] """Purpose of the run.""" + + secrets: Optional[Dict[str, str]] + """Secrets: Environment Variable to User Secret Name.""" diff --git a/src/runloop_api_client/types/scenario_update_params.py b/src/runloop_api_client/types/scenario_update_params.py index 6007bf844..81608552d 100644 --- a/src/runloop_api_client/types/scenario_update_params.py +++ b/src/runloop_api_client/types/scenario_update_params.py @@ -3,9 +3,8 @@ from __future__ import annotations from typing import Dict, List, Optional -from typing_extensions import Annotated, TypedDict +from typing_extensions import TypedDict -from .._utils import PropertyInfo from .input_context_update_param import InputContextUpdateParam from .scenario_environment_param import ScenarioEnvironmentParam from .scoring_contract_update_param import ScoringContractUpdateParam @@ -33,8 +32,11 @@ class ScenarioUpdateParams(TypedDict, total=False): apply to the environment. """ - required_env_vars: Annotated[Optional[List[str]], PropertyInfo(alias="requiredEnvVars")] - """Environment variables required to run the benchmark.""" + required_environment_variables: Optional[List[str]] + """Environment variables required to run the scenario.""" + + required_secrets: Optional[List[str]] + """Secrets required to run the scenario.""" scoring_contract: Optional[ScoringContractUpdateParam] """The scoring contract for the Scenario.""" diff --git a/src/runloop_api_client/types/scenario_view.py b/src/runloop_api_client/types/scenario_view.py index 816fef1b5..2b608038a 100644 --- a/src/runloop_api_client/types/scenario_view.py +++ b/src/runloop_api_client/types/scenario_view.py @@ -45,3 +45,9 @@ class ScenarioView(BaseModel): If any required environment variables are missing, the scenario will fail to start. """ + + required_secret_names: Optional[List[str]] = None + """Environment variables required to run the scenario. + + If any required secrets are missing, the scenario will fail to start. + """ diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index fdc18c6b0..ccc3d725a 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -61,6 +61,12 @@ class LaunchParameters(BaseModel): launch_commands: Optional[List[str]] = None """Set of commands to be run at launch time, before the entrypoint process is run.""" + required_services: Optional[List[str]] = None + """A list of ContainerizedService names to be started when a Devbox is created. + + A valid ContainerizedService must be specified in Blueprint to be started. + """ + resource_size_request: Optional[ Literal["X_SMALL", "SMALL", "MEDIUM", "LARGE", "X_LARGE", "XX_LARGE", "CUSTOM_SIZE"] ] = None diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index 0ed9e4f71..000d52c11 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -62,6 +62,12 @@ class LaunchParameters(TypedDict, total=False): launch_commands: Optional[List[str]] """Set of commands to be run at launch time, before the entrypoint process is run.""" + required_services: Optional[List[str]] + """A list of ContainerizedService names to be started when a Devbox is created. + + A valid ContainerizedService must be specified in Blueprint to be started. + """ + resource_size_request: Optional[ Literal["X_SMALL", "SMALL", "MEDIUM", "LARGE", "X_LARGE", "XX_LARGE", "CUSTOM_SIZE"] ] diff --git a/tests/api_resources/scenarios/test_scorers.py b/tests/api_resources/scenarios/test_scorers.py index bff5423a9..415693ada 100644 --- a/tests/api_resources/scenarios/test_scorers.py +++ b/tests/api_resources/scenarios/test_scorers.py @@ -202,6 +202,7 @@ def test_method_validate_with_all_params(self, client: Runloop) -> None: "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { "uid": 0, @@ -433,6 +434,7 @@ async def test_method_validate_with_all_params(self, async_client: AsyncRunloop) "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { "uid": 0, diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py index bbbbd0e05..bf4e4921c 100644 --- a/tests/api_resources/test_benchmarks.py +++ b/tests/api_resources/test_benchmarks.py @@ -35,6 +35,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: name="name", metadata={"foo": "string"}, required_environment_variables=["string"], + required_secrets=["string"], scenario_ids=["string"], ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -116,6 +117,7 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: name="name", metadata={"foo": "string"}, required_environment_variables=["string"], + required_secrets=["string"], scenario_ids=["string"], ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -283,6 +285,7 @@ def test_method_start_run_with_all_params(self, client: Runloop) -> None: run_profile={ "env_vars": {"foo": "string"}, "purpose": "purpose", + "secrets": {"foo": "string"}, }, ) assert_matches_type(BenchmarkRunView, benchmark, path=["response"]) @@ -330,6 +333,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - name="name", metadata={"foo": "string"}, required_environment_variables=["string"], + required_secrets=["string"], scenario_ids=["string"], ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -411,6 +415,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - name="name", metadata={"foo": "string"}, required_environment_variables=["string"], + required_secrets=["string"], scenario_ids=["string"], ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -578,6 +583,7 @@ async def test_method_start_run_with_all_params(self, async_client: AsyncRunloop run_profile={ "env_vars": {"foo": "string"}, "purpose": "purpose", + "secrets": {"foo": "string"}, }, ) assert_matches_type(BenchmarkRunView, benchmark, path=["response"]) diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 25871a9e0..1ef1edb90 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -56,6 +56,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { "uid": 0, @@ -272,6 +273,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { "uid": 0, @@ -346,6 +348,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { "uid": 0, @@ -562,6 +565,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { "uid": 0, diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 5b787b627..9f52afd1c 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -71,6 +71,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { "uid": 0, @@ -1018,6 +1019,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { "uid": 0, diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index 5c5ae84c8..69c75072f 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -78,6 +78,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { "uid": 0, @@ -91,6 +92,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: metadata={"foo": "string"}, reference_output="reference_output", required_environment_variables=["string"], + required_secret_names=["string"], ) assert_matches_type(ScenarioView, scenario, path=["response"]) @@ -209,6 +211,7 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { "uid": 0, @@ -226,7 +229,8 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: metadata={"foo": "string"}, name="name", reference_output="reference_output", - required_env_vars=["string"], + required_environment_variables=["string"], + required_secrets=["string"], scoring_contract={ "scoring_function_parameters": [ { @@ -361,6 +365,7 @@ def test_method_start_run_with_all_params(self, client: Runloop) -> None: run_profile={ "env_vars": {"foo": "string"}, "purpose": "purpose", + "secrets": {"foo": "string"}, }, ) assert_matches_type(ScenarioRunView, scenario, path=["response"]) @@ -452,6 +457,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { "uid": 0, @@ -465,6 +471,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - metadata={"foo": "string"}, reference_output="reference_output", required_environment_variables=["string"], + required_secret_names=["string"], ) assert_matches_type(ScenarioView, scenario, path=["response"]) @@ -583,6 +590,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { "uid": 0, @@ -600,7 +608,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - metadata={"foo": "string"}, name="name", reference_output="reference_output", - required_env_vars=["string"], + required_environment_variables=["string"], + required_secrets=["string"], scoring_contract={ "scoring_function_parameters": [ { @@ -735,6 +744,7 @@ async def test_method_start_run_with_all_params(self, async_client: AsyncRunloop run_profile={ "env_vars": {"foo": "string"}, "purpose": "purpose", + "secrets": {"foo": "string"}, }, ) assert_matches_type(ScenarioRunView, scenario, path=["response"]) From 9f55aa215c29e703b22361774f50bde9f35b94e0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 18:15:27 +0000 Subject: [PATCH 819/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2b2b4fa9e..fed4b17fa 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.51.0" + ".": "0.52.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 9c383f0b8..89faf5d15 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.51.0" +version = "0.52.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index fd4eb3432..d274d886e 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.51.0" # x-release-please-version +__version__ = "0.52.0" # x-release-please-version From 31201019225ec122bac30e1365c7015ed1c2db1a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 19:53:26 +0000 Subject: [PATCH 820/993] feat(api): api update --- .stats.yml | 4 ++-- src/runloop_api_client/types/blueprint_view.py | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5be2d49b7..de587de97 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 92 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2417f3ff96b2f0934e6ee5cafd072e111515712cebb58eff3690bda46b9e04d8.yml -openapi_spec_hash: 15877c256d01485dacbb4e348d79845d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8805efc665011161897e5c4c326dc44090ae55471a36bef8d63d17fec4e289f1.yml +openapi_spec_hash: 4d348158fc0b5daa3f55d831301859e4 config_hash: 60681f589a9e641fdb7f19af2021a033 diff --git a/src/runloop_api_client/types/blueprint_view.py b/src/runloop_api_client/types/blueprint_view.py index 7ea201c55..47e7baac8 100644 --- a/src/runloop_api_client/types/blueprint_view.py +++ b/src/runloop_api_client/types/blueprint_view.py @@ -3,8 +3,6 @@ from typing import Dict, List, Optional from typing_extensions import Literal -from pydantic import Field as FieldInfo - from .._models import BaseModel from .blueprint_build_parameters import BlueprintBuildParameters @@ -64,9 +62,7 @@ class BlueprintView(BaseModel): base_blueprint_id: Optional[str] = None """The ID of the base Blueprint.""" - containerized_services: Optional[List[ContainerizedService]] = FieldInfo( - alias="containerizedServices", default=None - ) + containerized_services: Optional[List[ContainerizedService]] = None """List of ContainerizedServices available in the Blueprint. Services can be explicitly started when creating a Devbox. From 132c5acf0b2fb7d7dec20c204f8276124a39d3f8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 19:56:35 +0000 Subject: [PATCH 821/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index fed4b17fa..c3e01e1e5 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.52.0" + ".": "0.53.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 89faf5d15..4b550520d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.52.0" +version = "0.53.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index d274d886e..70e50373d 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.52.0" # x-release-please-version +__version__ = "0.53.0" # x-release-please-version From 107391e2ee4471116b5809d393d51c32151ad731 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 04:17:11 +0000 Subject: [PATCH 822/993] feat(client): support file upload requests --- src/runloop_api_client/_base_client.py | 5 ++++- src/runloop_api_client/_files.py | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index d3b08b71d..4090e2164 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -532,7 +532,10 @@ def _build_request( is_body_allowed = options.method.lower() != "get" if is_body_allowed: - kwargs["json"] = json_data if is_given(json_data) else None + if isinstance(json_data, bytes): + kwargs["content"] = json_data + else: + kwargs["json"] = json_data if is_given(json_data) else None kwargs["files"] = files else: headers.pop("Content-Type", None) diff --git a/src/runloop_api_client/_files.py b/src/runloop_api_client/_files.py index 1b1825115..10f7978c8 100644 --- a/src/runloop_api_client/_files.py +++ b/src/runloop_api_client/_files.py @@ -69,12 +69,12 @@ def _transform_file(file: FileTypes) -> HttpxFileTypes: return file if is_tuple_t(file): - return (file[0], _read_file_content(file[1]), *file[2:]) + return (file[0], read_file_content(file[1]), *file[2:]) raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") -def _read_file_content(file: FileContent) -> HttpxFileContent: +def read_file_content(file: FileContent) -> HttpxFileContent: if isinstance(file, os.PathLike): return pathlib.Path(file).read_bytes() return file @@ -111,12 +111,12 @@ async def _async_transform_file(file: FileTypes) -> HttpxFileTypes: return file if is_tuple_t(file): - return (file[0], await _async_read_file_content(file[1]), *file[2:]) + return (file[0], await async_read_file_content(file[1]), *file[2:]) raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") -async def _async_read_file_content(file: FileContent) -> HttpxFileContent: +async def async_read_file_content(file: FileContent) -> HttpxFileContent: if isinstance(file, os.PathLike): return await anyio.Path(file).read_bytes() From d07c0889a3822dbd426fcba0e8b065a4aa2419f6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 18:31:49 +0000 Subject: [PATCH 823/993] feat(api): api update --- .stats.yml | 4 +- .../resources/benchmarks/benchmarks.py | 40 +++++++++---------- .../resources/devboxes/devboxes.py | 40 ------------------- .../resources/scenarios/scenarios.py | 12 +++--- .../types/benchmark_create_params.py | 8 ++-- .../types/benchmark_run_view.py | 7 +++- .../types/benchmark_start_run_params.py | 13 +++++- .../types/benchmark_update_params.py | 8 ++-- .../types/devbox_upload_file_params.py | 13 ------ .../devbox_write_file_contents_params.py | 13 ------ .../types/repository_manifest_view.py | 13 ++++++ .../types/scenario_start_run_params.py | 13 +++++- .../types/scenario_update_params.py | 2 +- .../types/scoring_function_param.py | 2 +- tests/api_resources/test_benchmarks.py | 8 ++-- tests/api_resources/test_devboxes.py | 26 ------------ tests/api_resources/test_scenarios.py | 4 +- 17 files changed, 85 insertions(+), 141 deletions(-) diff --git a/.stats.yml b/.stats.yml index de587de97..6f1758654 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 92 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8805efc665011161897e5c4c326dc44090ae55471a36bef8d63d17fec4e289f1.yml -openapi_spec_hash: 4d348158fc0b5daa3f55d831301859e4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-20da49cddb76a81f77844447916c6d445b25634ff99aae15d8dfd50fe6d854e6.yml +openapi_spec_hash: 2097a1bfb48092ed3b03fa606f5c5447 config_hash: 60681f589a9e641fdb7f19af2021a033 diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py index 3df2b183d..c8b3ca1e7 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -71,7 +71,7 @@ def create( name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, - required_secrets: List[str] | NotGiven = NOT_GIVEN, + required_secret_names: List[str] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -92,9 +92,9 @@ def create( required_environment_variables: Environment variables required to run the benchmark. If any required variables are not supplied, the benchmark will fail to start - required_secrets: Secrets required to run the benchmark with (user secret name will be mapped to - benchmark required secret name). If any of these secrets are not provided or the - mapping is incorrect, the benchmark will fail to start. + required_secret_names: Secrets required to run the benchmark with (environment variable name will be + mapped to the your user secret by name). If any of these secrets are not + provided or the mapping is incorrect, the benchmark will fail to start. scenario_ids: The Scenario IDs that make up the Benchmark. @@ -115,7 +115,7 @@ def create( "name": name, "metadata": metadata, "required_environment_variables": required_environment_variables, - "required_secrets": required_secrets, + "required_secret_names": required_secret_names, "scenario_ids": scenario_ids, }, benchmark_create_params.BenchmarkCreateParams, @@ -170,7 +170,7 @@ def update( name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, - required_secrets: List[str] | NotGiven = NOT_GIVEN, + required_secret_names: List[str] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -191,9 +191,9 @@ def update( required_environment_variables: Environment variables required to run the benchmark. If any required variables are not supplied, the benchmark will fail to start - required_secrets: Secrets required to run the benchmark with (user secret name will be mapped to - benchmark required secret name). If any of these secrets are not provided or the - mapping is incorrect, the benchmark will fail to start. + required_secret_names: Secrets required to run the benchmark with (environment variable name will be + mapped to the your user secret by name). If any of these secrets are not + provided or the mapping is incorrect, the benchmark will fail to start. scenario_ids: The Scenario IDs that make up the Benchmark. @@ -216,7 +216,7 @@ def update( "name": name, "metadata": metadata, "required_environment_variables": required_environment_variables, - "required_secrets": required_secrets, + "required_secret_names": required_secret_names, "scenario_ids": scenario_ids, }, benchmark_update_params.BenchmarkUpdateParams, @@ -463,7 +463,7 @@ async def create( name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, - required_secrets: List[str] | NotGiven = NOT_GIVEN, + required_secret_names: List[str] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -484,9 +484,9 @@ async def create( required_environment_variables: Environment variables required to run the benchmark. If any required variables are not supplied, the benchmark will fail to start - required_secrets: Secrets required to run the benchmark with (user secret name will be mapped to - benchmark required secret name). If any of these secrets are not provided or the - mapping is incorrect, the benchmark will fail to start. + required_secret_names: Secrets required to run the benchmark with (environment variable name will be + mapped to the your user secret by name). If any of these secrets are not + provided or the mapping is incorrect, the benchmark will fail to start. scenario_ids: The Scenario IDs that make up the Benchmark. @@ -507,7 +507,7 @@ async def create( "name": name, "metadata": metadata, "required_environment_variables": required_environment_variables, - "required_secrets": required_secrets, + "required_secret_names": required_secret_names, "scenario_ids": scenario_ids, }, benchmark_create_params.BenchmarkCreateParams, @@ -562,7 +562,7 @@ async def update( name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, - required_secrets: List[str] | NotGiven = NOT_GIVEN, + required_secret_names: List[str] | NotGiven = NOT_GIVEN, scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -583,9 +583,9 @@ async def update( required_environment_variables: Environment variables required to run the benchmark. If any required variables are not supplied, the benchmark will fail to start - required_secrets: Secrets required to run the benchmark with (user secret name will be mapped to - benchmark required secret name). If any of these secrets are not provided or the - mapping is incorrect, the benchmark will fail to start. + required_secret_names: Secrets required to run the benchmark with (environment variable name will be + mapped to the your user secret by name). If any of these secrets are not + provided or the mapping is incorrect, the benchmark will fail to start. scenario_ids: The Scenario IDs that make up the Benchmark. @@ -608,7 +608,7 @@ async def update( "name": name, "metadata": metadata, "required_environment_variables": required_environment_variables, - "required_secrets": required_secrets, + "required_secret_names": required_secret_names, "scenario_ids": scenario_ids, }, benchmark_update_params.BenchmarkUpdateParams, diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 591f37b9c..312b9247d 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -1140,9 +1140,7 @@ def upload_file( id: str, *, path: str, - chmod: Optional[str] | NotGiven = NOT_GIVEN, file: FileTypes | NotGiven = NOT_GIVEN, - owner: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1161,12 +1159,6 @@ def upload_file( path: The path to write the file to on the Devbox. Path is relative to user home directory. - chmod: File permissions in octal format (e.g., "644", "1755"). Optional. If not - specified, default system permissions will be used. - - owner: File owner username. Optional. If not specified, the file will be owned by the - current user. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1184,9 +1176,7 @@ def upload_file( body = deepcopy_minimal( { "path": path, - "chmod": chmod, "file": file, - "owner": owner, } ) files = extract_files(cast(Mapping[str, object], body), paths=[["file"]]) @@ -1214,8 +1204,6 @@ def write_file_contents( *, contents: str, file_path: str, - chmod: Optional[str] | NotGiven = NOT_GIVEN, - owner: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1235,12 +1223,6 @@ def write_file_contents( file_path: The path to write the file to on the Devbox. Path is relative to user home directory. - chmod: File permissions in octal format (e.g., "644", "1755"). Optional. If not - specified, default system permissions will be used. - - owner: File owner username. Optional. If not specified, the file will be owned by the - current user. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1261,8 +1243,6 @@ def write_file_contents( { "contents": contents, "file_path": file_path, - "chmod": chmod, - "owner": owner, }, devbox_write_file_contents_params.DevboxWriteFileContentsParams, ), @@ -2308,9 +2288,7 @@ async def upload_file( id: str, *, path: str, - chmod: Optional[str] | NotGiven = NOT_GIVEN, file: FileTypes | NotGiven = NOT_GIVEN, - owner: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2329,12 +2307,6 @@ async def upload_file( path: The path to write the file to on the Devbox. Path is relative to user home directory. - chmod: File permissions in octal format (e.g., "644", "1755"). Optional. If not - specified, default system permissions will be used. - - owner: File owner username. Optional. If not specified, the file will be owned by the - current user. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2352,9 +2324,7 @@ async def upload_file( body = deepcopy_minimal( { "path": path, - "chmod": chmod, "file": file, - "owner": owner, } ) files = extract_files(cast(Mapping[str, object], body), paths=[["file"]]) @@ -2382,8 +2352,6 @@ async def write_file_contents( *, contents: str, file_path: str, - chmod: Optional[str] | NotGiven = NOT_GIVEN, - owner: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2403,12 +2371,6 @@ async def write_file_contents( file_path: The path to write the file to on the Devbox. Path is relative to user home directory. - chmod: File permissions in octal format (e.g., "644", "1755"). Optional. If not - specified, default system permissions will be used. - - owner: File owner username. Optional. If not specified, the file will be owned by the - current user. - extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2429,8 +2391,6 @@ async def write_file_contents( { "contents": contents, "file_path": file_path, - "chmod": chmod, - "owner": owner, }, devbox_write_file_contents_params.DevboxWriteFileContentsParams, ), diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index 7e7199b27..43ed765ca 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -203,7 +203,7 @@ def update( name: Optional[str] | NotGiven = NOT_GIVEN, reference_output: Optional[str] | NotGiven = NOT_GIVEN, required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, - required_secrets: Optional[List[str]] | NotGiven = NOT_GIVEN, + required_secret_names: Optional[List[str]] | NotGiven = NOT_GIVEN, scoring_contract: Optional[ScoringContractUpdateParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -233,7 +233,7 @@ def update( required_environment_variables: Environment variables required to run the scenario. - required_secrets: Secrets required to run the scenario. + required_secret_names: Secrets required to run the scenario. scoring_contract: The scoring contract for the Scenario. @@ -259,7 +259,7 @@ def update( "name": name, "reference_output": reference_output, "required_environment_variables": required_environment_variables, - "required_secrets": required_secrets, + "required_secret_names": required_secret_names, "scoring_contract": scoring_contract, }, scenario_update_params.ScenarioUpdateParams, @@ -594,7 +594,7 @@ async def update( name: Optional[str] | NotGiven = NOT_GIVEN, reference_output: Optional[str] | NotGiven = NOT_GIVEN, required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, - required_secrets: Optional[List[str]] | NotGiven = NOT_GIVEN, + required_secret_names: Optional[List[str]] | NotGiven = NOT_GIVEN, scoring_contract: Optional[ScoringContractUpdateParam] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -624,7 +624,7 @@ async def update( required_environment_variables: Environment variables required to run the scenario. - required_secrets: Secrets required to run the scenario. + required_secret_names: Secrets required to run the scenario. scoring_contract: The scoring contract for the Scenario. @@ -650,7 +650,7 @@ async def update( "name": name, "reference_output": reference_output, "required_environment_variables": required_environment_variables, - "required_secrets": required_secrets, + "required_secret_names": required_secret_names, "scoring_contract": scoring_contract, }, scenario_update_params.ScenarioUpdateParams, diff --git a/src/runloop_api_client/types/benchmark_create_params.py b/src/runloop_api_client/types/benchmark_create_params.py index 2025bc52c..11937ef53 100644 --- a/src/runloop_api_client/types/benchmark_create_params.py +++ b/src/runloop_api_client/types/benchmark_create_params.py @@ -21,11 +21,11 @@ class BenchmarkCreateParams(TypedDict, total=False): If any required variables are not supplied, the benchmark will fail to start """ - required_secrets: List[str] + required_secret_names: List[str] """ - Secrets required to run the benchmark with (user secret name will be mapped to - benchmark required secret name). If any of these secrets are not provided or the - mapping is incorrect, the benchmark will fail to start. + Secrets required to run the benchmark with (environment variable name will be + mapped to the your user secret by name). If any of these secrets are not + provided or the mapping is incorrect, the benchmark will fail to start. """ scenario_ids: Optional[List[str]] diff --git a/src/runloop_api_client/types/benchmark_run_view.py b/src/runloop_api_client/types/benchmark_run_view.py index 140122ecd..00dd98fc2 100644 --- a/src/runloop_api_client/types/benchmark_run_view.py +++ b/src/runloop_api_client/types/benchmark_run_view.py @@ -43,4 +43,9 @@ class BenchmarkRunView(BaseModel): """ secrets_provided: Optional[Dict[str, str]] = None - """User secrets used to run the benchmark.""" + """User secrets used to run the benchmark. + + Example: {"DB_PASS": "DATABASE_PASSWORD"} would set the environment variable + 'DB_PASS' on all scenario devboxes to the value of the secret + 'DATABASE_PASSWORD'. + """ diff --git a/src/runloop_api_client/types/benchmark_start_run_params.py b/src/runloop_api_client/types/benchmark_start_run_params.py index caa2e1927..23f211cae 100644 --- a/src/runloop_api_client/types/benchmark_start_run_params.py +++ b/src/runloop_api_client/types/benchmark_start_run_params.py @@ -26,10 +26,19 @@ class BenchmarkStartRunParams(TypedDict, total=False): class RunProfile(TypedDict, total=False): env_vars: Annotated[Optional[Dict[str, str]], PropertyInfo(alias="envVars")] - """Environment Variables: Environment Variable to Value.""" + """Mapping of Environment Variable to Value. + + May be shown in devbox logging. Example: {"DB_PASS": "DATABASE_PASSWORD"} would + set the environment variable 'DB_PASS' to the value 'DATABASE_PASSWORD_VALUE'. + """ purpose: Optional[str] """Purpose of the run.""" secrets: Optional[Dict[str, str]] - """Secrets: Environment Variable to User Secret Name.""" + """Mapping of Environment Variable to User Secret Name. + + Never shown in devbox logging. Example: {"DB_PASS": "DATABASE_PASSWORD"} would + set the environment variable 'DB_PASS' to the value of the secret + 'DATABASE_PASSWORD'. + """ diff --git a/src/runloop_api_client/types/benchmark_update_params.py b/src/runloop_api_client/types/benchmark_update_params.py index d3b2a1276..009dd5793 100644 --- a/src/runloop_api_client/types/benchmark_update_params.py +++ b/src/runloop_api_client/types/benchmark_update_params.py @@ -21,11 +21,11 @@ class BenchmarkUpdateParams(TypedDict, total=False): If any required variables are not supplied, the benchmark will fail to start """ - required_secrets: List[str] + required_secret_names: List[str] """ - Secrets required to run the benchmark with (user secret name will be mapped to - benchmark required secret name). If any of these secrets are not provided or the - mapping is incorrect, the benchmark will fail to start. + Secrets required to run the benchmark with (environment variable name will be + mapped to the your user secret by name). If any of these secrets are not + provided or the mapping is incorrect, the benchmark will fail to start. """ scenario_ids: Optional[List[str]] diff --git a/src/runloop_api_client/types/devbox_upload_file_params.py b/src/runloop_api_client/types/devbox_upload_file_params.py index edcad111d..9e83fa318 100644 --- a/src/runloop_api_client/types/devbox_upload_file_params.py +++ b/src/runloop_api_client/types/devbox_upload_file_params.py @@ -2,7 +2,6 @@ from __future__ import annotations -from typing import Optional from typing_extensions import Required, TypedDict from .._types import FileTypes @@ -17,16 +16,4 @@ class DevboxUploadFileParams(TypedDict, total=False): Path is relative to user home directory. """ - chmod: Optional[str] - """File permissions in octal format (e.g., "644", "1755"). - - Optional. If not specified, default system permissions will be used. - """ - file: FileTypes - - owner: Optional[str] - """File owner username. - - Optional. If not specified, the file will be owned by the current user. - """ diff --git a/src/runloop_api_client/types/devbox_write_file_contents_params.py b/src/runloop_api_client/types/devbox_write_file_contents_params.py index 549125912..f47a73839 100644 --- a/src/runloop_api_client/types/devbox_write_file_contents_params.py +++ b/src/runloop_api_client/types/devbox_write_file_contents_params.py @@ -2,7 +2,6 @@ from __future__ import annotations -from typing import Optional from typing_extensions import Required, TypedDict __all__ = ["DevboxWriteFileContentsParams"] @@ -17,15 +16,3 @@ class DevboxWriteFileContentsParams(TypedDict, total=False): Path is relative to user home directory. """ - - chmod: Optional[str] - """File permissions in octal format (e.g., "644", "1755"). - - Optional. If not specified, default system permissions will be used. - """ - - owner: Optional[str] - """File owner username. - - Optional. If not specified, the file will be owned by the current user. - """ diff --git a/src/runloop_api_client/types/repository_manifest_view.py b/src/runloop_api_client/types/repository_manifest_view.py index 334910a99..dbae3e986 100644 --- a/src/runloop_api_client/types/repository_manifest_view.py +++ b/src/runloop_api_client/types/repository_manifest_view.py @@ -7,6 +7,7 @@ __all__ = [ "RepositoryManifestView", "ContainerConfig", + "Language", "Workspace", "WorkspaceDevCommands", "ContainerizedService", @@ -29,6 +30,12 @@ class ContainerConfig(BaseModel): """ +class Language(BaseModel): + language: Optional[str] = None + + version: Optional[str] = None + + class WorkspaceDevCommands(BaseModel): build: Optional[List[str]] = None """Build command (e.g. npm run build).""" @@ -122,6 +129,12 @@ class RepositoryManifestView(BaseModel): container_config: ContainerConfig """Container configuration specifying the base image and setup commands.""" + languages: List[Language] + """List of required languages found in Repository.""" + + workflows: List[str] + """The workflow(s) that were selected to build the manifest for this repo.""" + workspaces: List[Workspace] """List of workspaces within the repository. diff --git a/src/runloop_api_client/types/scenario_start_run_params.py b/src/runloop_api_client/types/scenario_start_run_params.py index ea3871193..91d7e34e8 100644 --- a/src/runloop_api_client/types/scenario_start_run_params.py +++ b/src/runloop_api_client/types/scenario_start_run_params.py @@ -29,10 +29,19 @@ class ScenarioStartRunParams(TypedDict, total=False): class RunProfile(TypedDict, total=False): env_vars: Annotated[Optional[Dict[str, str]], PropertyInfo(alias="envVars")] - """Environment Variables: Environment Variable to Value.""" + """Mapping of Environment Variable to Value. + + May be shown in devbox logging. Example: {"DB_PASS": "DATABASE_PASSWORD"} would + set the environment variable 'DB_PASS' to the value 'DATABASE_PASSWORD_VALUE'. + """ purpose: Optional[str] """Purpose of the run.""" secrets: Optional[Dict[str, str]] - """Secrets: Environment Variable to User Secret Name.""" + """Mapping of Environment Variable to User Secret Name. + + Never shown in devbox logging. Example: {"DB_PASS": "DATABASE_PASSWORD"} would + set the environment variable 'DB_PASS' to the value of the secret + 'DATABASE_PASSWORD'. + """ diff --git a/src/runloop_api_client/types/scenario_update_params.py b/src/runloop_api_client/types/scenario_update_params.py index 81608552d..6605c9f24 100644 --- a/src/runloop_api_client/types/scenario_update_params.py +++ b/src/runloop_api_client/types/scenario_update_params.py @@ -35,7 +35,7 @@ class ScenarioUpdateParams(TypedDict, total=False): required_environment_variables: Optional[List[str]] """Environment variables required to run the scenario.""" - required_secrets: Optional[List[str]] + required_secret_names: Optional[List[str]] """Secrets required to run the scenario.""" scoring_contract: Optional[ScoringContractUpdateParam] diff --git a/src/runloop_api_client/types/scoring_function_param.py b/src/runloop_api_client/types/scoring_function_param.py index 1dedcc557..e2c9bc253 100644 --- a/src/runloop_api_client/types/scoring_function_param.py +++ b/src/runloop_api_client/types/scoring_function_param.py @@ -76,7 +76,7 @@ class ScorerPythonScriptScoringFunction(TypedDict, total=False): python_version_constraint: Optional[str] """Python version to run scoring. Default is "==3.12.10" """ - requirements_contents: str + requirements_contents: Optional[str] """Package dependencies to be installed. The requirements should be a valid requirements.txt file. diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py index bf4e4921c..00afa4d43 100644 --- a/tests/api_resources/test_benchmarks.py +++ b/tests/api_resources/test_benchmarks.py @@ -35,7 +35,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: name="name", metadata={"foo": "string"}, required_environment_variables=["string"], - required_secrets=["string"], + required_secret_names=["string"], scenario_ids=["string"], ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -117,7 +117,7 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: name="name", metadata={"foo": "string"}, required_environment_variables=["string"], - required_secrets=["string"], + required_secret_names=["string"], scenario_ids=["string"], ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -333,7 +333,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - name="name", metadata={"foo": "string"}, required_environment_variables=["string"], - required_secrets=["string"], + required_secret_names=["string"], scenario_ids=["string"], ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -415,7 +415,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - name="name", metadata={"foo": "string"}, required_environment_variables=["string"], - required_secrets=["string"], + required_secret_names=["string"], scenario_ids=["string"], ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 9f52afd1c..bdc63ff54 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -883,9 +883,7 @@ def test_method_upload_file_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.upload_file( id="id", path="path", - chmod="chmod", file=b"raw file contents", - owner="owner", ) assert_matches_type(object, devbox, path=["response"]) @@ -932,17 +930,6 @@ def test_method_write_file_contents(self, client: Runloop) -> None: ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - @parametrize - def test_method_write_file_contents_with_all_params(self, client: Runloop) -> None: - devbox = client.devboxes.write_file_contents( - id="id", - contents="contents", - file_path="file_path", - chmod="chmod", - owner="owner", - ) - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - @parametrize def test_raw_response_write_file_contents(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.write_file_contents( @@ -1831,9 +1818,7 @@ async def test_method_upload_file_with_all_params(self, async_client: AsyncRunlo devbox = await async_client.devboxes.upload_file( id="id", path="path", - chmod="chmod", file=b"raw file contents", - owner="owner", ) assert_matches_type(object, devbox, path=["response"]) @@ -1880,17 +1865,6 @@ async def test_method_write_file_contents(self, async_client: AsyncRunloop) -> N ) assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - @parametrize - async def test_method_write_file_contents_with_all_params(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.write_file_contents( - id="id", - contents="contents", - file_path="file_path", - chmod="chmod", - owner="owner", - ) - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) - @parametrize async def test_raw_response_write_file_contents(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.write_file_contents( diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index 69c75072f..53507ac7f 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -230,7 +230,7 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: name="name", reference_output="reference_output", required_environment_variables=["string"], - required_secrets=["string"], + required_secret_names=["string"], scoring_contract={ "scoring_function_parameters": [ { @@ -609,7 +609,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - name="name", reference_output="reference_output", required_environment_variables=["string"], - required_secrets=["string"], + required_secret_names=["string"], scoring_contract={ "scoring_function_parameters": [ { From 9587f8d1becbe5a4253b216edf971b32025e5e59 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 20:11:58 +0000 Subject: [PATCH 824/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c3e01e1e5..21fa4455a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.53.0" + ".": "0.54.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 4b550520d..1cebe7a4d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.53.0" +version = "0.54.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 70e50373d..a42e6aeee 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.53.0" # x-release-please-version +__version__ = "0.54.0" # x-release-please-version From c97718c320e5f3c33239fdc97c68bdd4e6aeb051 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 05:05:06 +0000 Subject: [PATCH 825/993] chore(internal): fix ruff target version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1cebe7a4d..be0e01e26 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -159,7 +159,7 @@ reportPrivateUsage = false [tool.ruff] line-length = 120 output-format = "grouped" -target-version = "py37" +target-version = "py38" [tool.ruff.format] docstring-code-format = true From 979a555a321d7e5000283f73b4b9f880de60c220 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 9 Aug 2025 03:50:27 +0000 Subject: [PATCH 826/993] chore: update @stainless-api/prism-cli to v5.15.0 --- scripts/mock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mock b/scripts/mock index d2814ae6a..0b28f6ea2 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & # Wait for server to come online echo -n "Waiting for server" @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" fi From 0593e8200721ed7965327ca5504989fe2756a1d0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 9 Aug 2025 03:52:25 +0000 Subject: [PATCH 827/993] chore(internal): update comment in script --- scripts/test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test b/scripts/test index 2b8784567..dbeda2d21 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! prism_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the prism command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" echo exit 1 From 1cbea9562fcb3d97d471351bc47cd4f5e5a673c6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 18:16:11 +0000 Subject: [PATCH 828/993] feat(api): api update --- .stats.yml | 4 +- api.md | 2 +- .../resources/blueprints.py | 24 +++++++++ .../resources/devboxes/devboxes.py | 10 ---- src/runloop_api_client/resources/secrets.py | 38 ++++++++++++-- src/runloop_api_client/types/__init__.py | 1 + .../types/blueprint_build_parameters.py | 40 +++++++++++++- .../types/blueprint_create_params.py | 40 +++++++++++++- .../types/blueprint_preview_params.py | 40 +++++++++++++- .../types/blueprint_view.py | 6 +++ .../types/devbox_create_params.py | 6 --- src/runloop_api_client/types/devbox_view.py | 4 +- .../types/repository_inspection_details.py | 31 ++++++++++- .../types/repository_manifest_view.py | 32 ++++++++---- .../types/secret_list_params.py | 12 +++++ tests/api_resources/test_blueprints.py | 52 +++++++++++++++++++ tests/api_resources/test_devboxes.py | 2 - tests/api_resources/test_secrets.py | 19 ++++++- 18 files changed, 319 insertions(+), 44 deletions(-) create mode 100644 src/runloop_api_client/types/secret_list_params.py diff --git a/.stats.yml b/.stats.yml index 6f1758654..f55d212bd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 92 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-20da49cddb76a81f77844447916c6d445b25634ff99aae15d8dfd50fe6d854e6.yml -openapi_spec_hash: 2097a1bfb48092ed3b03fa606f5c5447 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ff6a7188da87d1550f7d3cda78f43990a455e42eb7560ee1a8b8a49d3ed22fcb.yml +openapi_spec_hash: ea324758dd7f60d228d777a50c17b487 config_hash: 60681f589a9e641fdb7f19af2021a033 diff --git a/api.md b/api.md index 84d42980a..18b2b65d9 100644 --- a/api.md +++ b/api.md @@ -362,5 +362,5 @@ Methods: - client.secrets.create(\*\*params) -> SecretView - client.secrets.update(name, \*\*params) -> SecretView -- client.secrets.list() -> SecretListView +- client.secrets.list(\*\*params) -> SecretListView - client.secrets.delete(name) -> SecretView diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index 6f91b5922..5516d0138 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -57,6 +57,7 @@ def create( dockerfile: Optional[str] | NotGiven = NOT_GIVEN, file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, + services: Optional[Iterable[blueprint_create_params.Service]] | NotGiven = NOT_GIVEN, system_setup_commands: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -87,6 +88,10 @@ def create( launch_parameters: Parameters to configure your Devbox at launch time. + services: (Optional) List of containerized services to include in the Blueprint. These + services will be pre-pulled during the build phase for optimized startup + performance. + system_setup_commands: A list of commands to run to set up your system. extra_headers: Send extra headers @@ -109,6 +114,7 @@ def create( "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, + "services": services, "system_setup_commands": system_setup_commands, }, blueprint_create_params.BlueprintCreateParams, @@ -289,6 +295,7 @@ def preview( dockerfile: Optional[str] | NotGiven = NOT_GIVEN, file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, + services: Optional[Iterable[blueprint_preview_params.Service]] | NotGiven = NOT_GIVEN, system_setup_commands: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -317,6 +324,10 @@ def preview( launch_parameters: Parameters to configure your Devbox at launch time. + services: (Optional) List of containerized services to include in the Blueprint. These + services will be pre-pulled during the build phase for optimized startup + performance. + system_setup_commands: A list of commands to run to set up your system. extra_headers: Send extra headers @@ -339,6 +350,7 @@ def preview( "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, + "services": services, "system_setup_commands": system_setup_commands, }, blueprint_preview_params.BlueprintPreviewParams, @@ -383,6 +395,7 @@ async def create( dockerfile: Optional[str] | NotGiven = NOT_GIVEN, file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, + services: Optional[Iterable[blueprint_create_params.Service]] | NotGiven = NOT_GIVEN, system_setup_commands: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -413,6 +426,10 @@ async def create( launch_parameters: Parameters to configure your Devbox at launch time. + services: (Optional) List of containerized services to include in the Blueprint. These + services will be pre-pulled during the build phase for optimized startup + performance. + system_setup_commands: A list of commands to run to set up your system. extra_headers: Send extra headers @@ -435,6 +452,7 @@ async def create( "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, + "services": services, "system_setup_commands": system_setup_commands, }, blueprint_create_params.BlueprintCreateParams, @@ -615,6 +633,7 @@ async def preview( dockerfile: Optional[str] | NotGiven = NOT_GIVEN, file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, + services: Optional[Iterable[blueprint_preview_params.Service]] | NotGiven = NOT_GIVEN, system_setup_commands: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -643,6 +662,10 @@ async def preview( launch_parameters: Parameters to configure your Devbox at launch time. + services: (Optional) List of containerized services to include in the Blueprint. These + services will be pre-pulled during the build phase for optimized startup + performance. + system_setup_commands: A list of commands to run to set up your system. extra_headers: Send extra headers @@ -665,6 +688,7 @@ async def preview( "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, + "services": services, "system_setup_commands": system_setup_commands, }, blueprint_preview_params.BlueprintPreviewParams, diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 312b9247d..7ddfd92f3 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -165,7 +165,6 @@ def create( launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, - prebuilt: Optional[str] | NotGiven = NOT_GIVEN, repo_connection_id: Optional[str] | NotGiven = NOT_GIVEN, secrets: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, snapshot_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -210,9 +209,6 @@ def create( name: (Optional) A user specified name to give the Devbox. - prebuilt: Reference to prebuilt Blueprint to create the Devbox from. Should not be used - together with (Snapshot ID, Blueprint ID, or Blueprint name). - repo_connection_id: Repository connection id the devbox should source its base image from. secrets: (Optional) Map of environment variable names to secret names. The secret values @@ -246,7 +242,6 @@ def create( "launch_parameters": launch_parameters, "metadata": metadata, "name": name, - "prebuilt": prebuilt, "repo_connection_id": repo_connection_id, "secrets": secrets, "snapshot_id": snapshot_id, @@ -1313,7 +1308,6 @@ async def create( launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, - prebuilt: Optional[str] | NotGiven = NOT_GIVEN, repo_connection_id: Optional[str] | NotGiven = NOT_GIVEN, secrets: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, snapshot_id: Optional[str] | NotGiven = NOT_GIVEN, @@ -1358,9 +1352,6 @@ async def create( name: (Optional) A user specified name to give the Devbox. - prebuilt: Reference to prebuilt Blueprint to create the Devbox from. Should not be used - together with (Snapshot ID, Blueprint ID, or Blueprint name). - repo_connection_id: Repository connection id the devbox should source its base image from. secrets: (Optional) Map of environment variable names to secret names. The secret values @@ -1394,7 +1385,6 @@ async def create( "launch_parameters": launch_parameters, "metadata": metadata, "name": name, - "prebuilt": prebuilt, "repo_connection_id": repo_connection_id, "secrets": secrets, "snapshot_id": snapshot_id, diff --git a/src/runloop_api_client/resources/secrets.py b/src/runloop_api_client/resources/secrets.py index d6eb94c7a..e70e67f98 100644 --- a/src/runloop_api_client/resources/secrets.py +++ b/src/runloop_api_client/resources/secrets.py @@ -4,7 +4,7 @@ import httpx -from ..types import secret_create_params, secret_update_params +from ..types import secret_list_params, secret_create_params, secret_update_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property @@ -146,6 +146,7 @@ def update( def list( self, *, + limit: int | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -157,11 +158,26 @@ def list( Secret values are not included for security reasons. + + Args: + limit: The limit of items to return. Default is 20. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds """ return self._get( "/v1/secrets", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"limit": limit}, secret_list_params.SecretListParams), ), cast_to=SecretListView, ) @@ -333,6 +349,7 @@ async def update( async def list( self, *, + limit: int | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -344,11 +361,26 @@ async def list( Secret values are not included for security reasons. + + Args: + limit: The limit of items to return. Default is 20. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds """ return await self._get( "/v1/secrets", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"limit": limit}, secret_list_params.SecretListParams), ), cast_to=SecretListView, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 5a4773839..796fca424 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -23,6 +23,7 @@ from .benchmark_run_view import BenchmarkRunView as BenchmarkRunView from .devbox_list_params import DevboxListParams as DevboxListParams from .devbox_tunnel_view import DevboxTunnelView as DevboxTunnelView +from .secret_list_params import SecretListParams as SecretListParams from .blueprint_build_log import BlueprintBuildLog as BlueprintBuildLog from .blueprint_list_view import BlueprintListView as BlueprintListView from .input_context_param import InputContextParam as InputContextParam diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index e3742d185..4139526f8 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -6,7 +6,38 @@ from .shared.launch_parameters import LaunchParameters from .shared.code_mount_parameters import CodeMountParameters -__all__ = ["BlueprintBuildParameters"] +__all__ = ["BlueprintBuildParameters", "Service", "ServiceCredentials"] + + +class ServiceCredentials(BaseModel): + password: str + """The password of the container service.""" + + username: str + """The username of the container service.""" + + +class Service(BaseModel): + image: str + """The image of the container service.""" + + name: str + """The name of the container service.""" + + credentials: Optional[ServiceCredentials] = None + """The credentials of the container service.""" + + env: Optional[Dict[str, str]] = None + """The environment variables of the container service.""" + + options: Optional[str] = None + """Additional Docker container create options.""" + + port_mappings: Optional[List[str]] = None + """The port mappings of the container service. + + Port mappings are in the format of :. + """ class BlueprintBuildParameters(BaseModel): @@ -31,5 +62,12 @@ class BlueprintBuildParameters(BaseModel): launch_parameters: Optional[LaunchParameters] = None """Parameters to configure your Devbox at launch time.""" + services: Optional[List[Service]] = None + """(Optional) List of containerized services to include in the Blueprint. + + These services will be pre-pulled during the build phase for optimized startup + performance. + """ + system_setup_commands: Optional[List[str]] = None """A list of commands to run to set up your system.""" diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index a588a6a0b..0beb3d469 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -8,7 +8,7 @@ from .shared_params.launch_parameters import LaunchParameters from .shared_params.code_mount_parameters import CodeMountParameters -__all__ = ["BlueprintCreateParams"] +__all__ = ["BlueprintCreateParams", "Service", "ServiceCredentials"] class BlueprintCreateParams(TypedDict, total=False): @@ -33,5 +33,43 @@ class BlueprintCreateParams(TypedDict, total=False): launch_parameters: Optional[LaunchParameters] """Parameters to configure your Devbox at launch time.""" + services: Optional[Iterable[Service]] + """(Optional) List of containerized services to include in the Blueprint. + + These services will be pre-pulled during the build phase for optimized startup + performance. + """ + system_setup_commands: Optional[List[str]] """A list of commands to run to set up your system.""" + + +class ServiceCredentials(TypedDict, total=False): + password: Required[str] + """The password of the container service.""" + + username: Required[str] + """The username of the container service.""" + + +class Service(TypedDict, total=False): + image: Required[str] + """The image of the container service.""" + + name: Required[str] + """The name of the container service.""" + + credentials: Optional[ServiceCredentials] + """The credentials of the container service.""" + + env: Optional[Dict[str, str]] + """The environment variables of the container service.""" + + options: Optional[str] + """Additional Docker container create options.""" + + port_mappings: Optional[List[str]] + """The port mappings of the container service. + + Port mappings are in the format of :. + """ diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index d7384f54c..11112080f 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -8,7 +8,7 @@ from .shared_params.launch_parameters import LaunchParameters from .shared_params.code_mount_parameters import CodeMountParameters -__all__ = ["BlueprintPreviewParams"] +__all__ = ["BlueprintPreviewParams", "Service", "ServiceCredentials"] class BlueprintPreviewParams(TypedDict, total=False): @@ -33,5 +33,43 @@ class BlueprintPreviewParams(TypedDict, total=False): launch_parameters: Optional[LaunchParameters] """Parameters to configure your Devbox at launch time.""" + services: Optional[Iterable[Service]] + """(Optional) List of containerized services to include in the Blueprint. + + These services will be pre-pulled during the build phase for optimized startup + performance. + """ + system_setup_commands: Optional[List[str]] """A list of commands to run to set up your system.""" + + +class ServiceCredentials(TypedDict, total=False): + password: Required[str] + """The password of the container service.""" + + username: Required[str] + """The username of the container service.""" + + +class Service(TypedDict, total=False): + image: Required[str] + """The image of the container service.""" + + name: Required[str] + """The name of the container service.""" + + credentials: Optional[ServiceCredentials] + """The credentials of the container service.""" + + env: Optional[Dict[str, str]] + """The environment variables of the container service.""" + + options: Optional[str] + """Additional Docker container create options.""" + + port_mappings: Optional[List[str]] + """The port mappings of the container service. + + Port mappings are in the format of :. + """ diff --git a/src/runloop_api_client/types/blueprint_view.py b/src/runloop_api_client/types/blueprint_view.py index 47e7baac8..7c6b9ee77 100644 --- a/src/runloop_api_client/types/blueprint_view.py +++ b/src/runloop_api_client/types/blueprint_view.py @@ -70,3 +70,9 @@ class BlueprintView(BaseModel): failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "build_failed"]] = None """The failure reason if the Blueprint build failed, if any.""" + + is_public: Optional[bool] = None + """Whether this Blueprint is publicly accessible to all users.""" + + metadata: Optional[Dict[str, str]] = None + """User defined metadata associated with the blueprint.""" diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index d35ab34a5..6efea2b79 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -52,12 +52,6 @@ class DevboxCreateParams(TypedDict, total=False): name: Optional[str] """(Optional) A user specified name to give the Devbox.""" - prebuilt: Optional[str] - """Reference to prebuilt Blueprint to create the Devbox from. - - Should not be used together with (Snapshot ID, Blueprint ID, or Blueprint name). - """ - repo_connection_id: Optional[str] """Repository connection id the devbox should source its base image from.""" diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 6b6be39c5..dc4904eae 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -75,9 +75,7 @@ class DevboxView(BaseModel): name: Optional[str] = None """The name of the Devbox.""" - shutdown_reason: Optional[ - Literal["api_shutdown", "keep_alive_timeout", "entrypoint_exit", "idle", "lambda_lifecycle"] - ] = None + shutdown_reason: Optional[Literal["api_shutdown", "keep_alive_timeout", "entrypoint_exit", "idle"]] = None """ The shutdown reason if the Devbox shutdown, if the Devbox has a 'shutdown' status. diff --git a/src/runloop_api_client/types/repository_inspection_details.py b/src/runloop_api_client/types/repository_inspection_details.py index 8b36909e4..f83932d29 100644 --- a/src/runloop_api_client/types/repository_inspection_details.py +++ b/src/runloop_api_client/types/repository_inspection_details.py @@ -1,12 +1,36 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import Dict, List, Optional from typing_extensions import Literal from .._models import BaseModel from .repository_manifest_view import RepositoryManifestView -__all__ = ["RepositoryInspectionDetails"] +__all__ = ["RepositoryInspectionDetails", "WorkflowContexts", "WorkflowContextsActionsContext"] + + +class WorkflowContextsActionsContext(BaseModel): + actions_skipped_unnecessary: List[str] + """ + Actions that were skipped because they were unnecessary (e.g., upload + artifacts). + """ + + actions_taken: List[str] + """Actions that were translated into commands and executed.""" + + actions_unknown: List[str] + """ + Actions that were not understood and skipped because we did not know what to do. + """ + + +class WorkflowContexts(BaseModel): + actions_context: WorkflowContextsActionsContext + """Details about actions processing for this workflow.""" + + file_name: str + """The file name of the workflow.""" class RepositoryInspectionDetails(BaseModel): @@ -48,3 +72,6 @@ class RepositoryInspectionDetails(BaseModel): User uploaded repository manifest containing container config and workspace details. """ + + workflow_contexts: Optional[Dict[str, WorkflowContexts]] = None + """Workflow contexts mapping workflow names to their processing details.""" diff --git a/src/runloop_api_client/types/repository_manifest_view.py b/src/runloop_api_client/types/repository_manifest_view.py index dbae3e986..461722b59 100644 --- a/src/runloop_api_client/types/repository_manifest_view.py +++ b/src/runloop_api_client/types/repository_manifest_view.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Dict, List, Optional +from typing_extensions import Literal from .._models import BaseModel @@ -23,6 +24,9 @@ class ContainerConfig(BaseModel): ubuntu-22.04, windows-latest, windows-2022, macos-latest etc. """ + architecture: Optional[Literal["x86_64", "arm64"]] = None + """The target architecture for the Repository Container.""" + setup_commands: Optional[List[str]] = None """ Commands to run to setup the base container such as installing necessary @@ -46,13 +50,16 @@ class WorkspaceDevCommands(BaseModel): lint: Optional[List[str]] = None """Lint command (e.g. flake8).""" + scripts: Optional[List[str]] = None + """Script commands.""" + test: Optional[List[str]] = None """Test command (e.g. pytest).""" class Workspace(BaseModel): - package_manager: List[str] - """Name of the package manager used (e.g. pip, npm).""" + build_tool: List[str] + """Name of the build tool used (e.g. pip, npm).""" dev_commands: Optional[WorkspaceDevCommands] = None """ @@ -74,12 +81,6 @@ class Workspace(BaseModel): monorepo style repositories. """ - required_env_vars: Optional[List[str]] = None - """ - Environment variables that are required to be set for this workspace to run - correctly. - """ - workspace_refresh_commands: Optional[List[str]] = None """ Commands to run to refresh this workspace after pulling the latest changes to @@ -132,9 +133,6 @@ class RepositoryManifestView(BaseModel): languages: List[Language] """List of required languages found in Repository.""" - workflows: List[str] - """The workflow(s) that were selected to build the manifest for this repo.""" - workspaces: List[Workspace] """List of workspaces within the repository. @@ -146,3 +144,15 @@ class RepositoryManifestView(BaseModel): Services can be explicitly started when creating a Devbox. """ + + env_vars: Optional[Dict[str, str]] = None + """ + Qualified environment variables and values that should be set for this + repository to run correctly. + """ + + required_env_vars: Optional[List[str]] = None + """ + Missing environment variables that (may) be required for this repository to run + correctly. + """ diff --git a/src/runloop_api_client/types/secret_list_params.py b/src/runloop_api_client/types/secret_list_params.py new file mode 100644 index 000000000..296a66b62 --- /dev/null +++ b/src/runloop_api_client/types/secret_list_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["SecretListParams"] + + +class SecretListParams(TypedDict, total=False): + limit: int + """The limit of items to return. Default is 20.""" diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 1ef1edb90..cc47a3d4d 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -63,6 +63,19 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "username": "username", }, }, + services=[ + { + "image": "image", + "name": "name", + "credentials": { + "password": "password", + "username": "username", + }, + "env": {"foo": "string"}, + "options": "options", + "port_mappings": ["string"], + } + ], system_setup_commands=["string"], ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @@ -280,6 +293,19 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: "username": "username", }, }, + services=[ + { + "image": "image", + "name": "name", + "credentials": { + "password": "password", + "username": "username", + }, + "env": {"foo": "string"}, + "options": "options", + "port_mappings": ["string"], + } + ], system_setup_commands=["string"], ) assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) @@ -355,6 +381,19 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "username": "username", }, }, + services=[ + { + "image": "image", + "name": "name", + "credentials": { + "password": "password", + "username": "username", + }, + "env": {"foo": "string"}, + "options": "options", + "port_mappings": ["string"], + } + ], system_setup_commands=["string"], ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @@ -572,6 +611,19 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) "username": "username", }, }, + services=[ + { + "image": "image", + "name": "name", + "credentials": { + "password": "password", + "username": "username", + }, + "env": {"foo": "string"}, + "options": "options", + "port_mappings": ["string"], + } + ], system_setup_commands=["string"], ) assert_matches_type(BlueprintPreviewView, blueprint, path=["response"]) diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index bdc63ff54..4842d4b2f 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -80,7 +80,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: }, metadata={"foo": "string"}, name="name", - prebuilt="prebuilt", repo_connection_id="repo_connection_id", secrets={"foo": "string"}, snapshot_id="snapshot_id", @@ -1015,7 +1014,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - }, metadata={"foo": "string"}, name="name", - prebuilt="prebuilt", repo_connection_id="repo_connection_id", secrets={"foo": "string"}, snapshot_id="snapshot_id", diff --git a/tests/api_resources/test_secrets.py b/tests/api_resources/test_secrets.py index 09a27ab44..7f0ff8e21 100644 --- a/tests/api_resources/test_secrets.py +++ b/tests/api_resources/test_secrets.py @@ -9,7 +9,10 @@ from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types import SecretView, SecretListView +from runloop_api_client.types import ( + SecretView, + SecretListView, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -98,6 +101,13 @@ def test_method_list(self, client: Runloop) -> None: secret = client.secrets.list() assert_matches_type(SecretListView, secret, path=["response"]) + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + secret = client.secrets.list( + limit=0, + ) + assert_matches_type(SecretListView, secret, path=["response"]) + @parametrize def test_raw_response_list(self, client: Runloop) -> None: response = client.secrets.with_raw_response.list() @@ -243,6 +253,13 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: secret = await async_client.secrets.list() assert_matches_type(SecretListView, secret, path=["response"]) + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + secret = await async_client.secrets.list( + limit=0, + ) + assert_matches_type(SecretListView, secret, path=["response"]) + @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: response = await async_client.secrets.with_raw_response.list() From 5276f0bdaad14af20df656c331f6b00ab5c4ce2a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 18:41:36 +0000 Subject: [PATCH 829/993] feat(api): api update --- .stats.yml | 8 +- api.md | 1 + .../resources/blueprints.py | 121 +++++++++++++++++- src/runloop_api_client/types/__init__.py | 1 + .../types/blueprint_list_public_params.py | 18 +++ tests/api_resources/test_blueprints.py | 68 ++++++++++ 6 files changed, 212 insertions(+), 5 deletions(-) create mode 100644 src/runloop_api_client/types/blueprint_list_public_params.py diff --git a/.stats.yml b/.stats.yml index f55d212bd..4ac8bf319 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 92 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ff6a7188da87d1550f7d3cda78f43990a455e42eb7560ee1a8b8a49d3ed22fcb.yml -openapi_spec_hash: ea324758dd7f60d228d777a50c17b487 -config_hash: 60681f589a9e641fdb7f19af2021a033 +configured_endpoints: 93 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-5bf266bfc4635f690b764f54cbbcd71ff347622e3bfd8540a7d2a4d7d2d78be8.yml +openapi_spec_hash: 3769820d0ac76caf6a1950802c73a382 +config_hash: 7d940dc50b19e75e3719c4d41fd0e8dd diff --git a/api.md b/api.md index 18b2b65d9..012c2a3e8 100644 --- a/api.md +++ b/api.md @@ -60,6 +60,7 @@ Methods: - client.blueprints.retrieve(id) -> BlueprintView - client.blueprints.list(\*\*params) -> SyncBlueprintsCursorIDPage[BlueprintView] - client.blueprints.delete(id) -> object +- client.blueprints.list_public(\*\*params) -> SyncBlueprintsCursorIDPage[BlueprintView] - client.blueprints.logs(id) -> BlueprintBuildLogsListView - client.blueprints.preview(\*\*params) -> BlueprintPreviewView diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index 5516d0138..2bf125bcf 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -6,7 +6,12 @@ import httpx -from ..types import blueprint_list_params, blueprint_create_params, blueprint_preview_params +from ..types import ( + blueprint_list_params, + blueprint_create_params, + blueprint_preview_params, + blueprint_list_public_params, +) from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property @@ -253,6 +258,57 @@ def delete( cast_to=object, ) + def list_public( + self, + *, + limit: int | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncBlueprintsCursorIDPage[BlueprintView]: + """ + List all public Blueprints that are available to all users. + + Args: + limit: The limit of items to return. Default is 20. + + name: Filter by name + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/blueprints/list_public", + page=SyncBlueprintsCursorIDPage[BlueprintView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "name": name, + "starting_after": starting_after, + }, + blueprint_list_public_params.BlueprintListPublicParams, + ), + ), + model=BlueprintView, + ) + def logs( self, id: str, @@ -591,6 +647,57 @@ async def delete( cast_to=object, ) + def list_public( + self, + *, + limit: int | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[BlueprintView, AsyncBlueprintsCursorIDPage[BlueprintView]]: + """ + List all public Blueprints that are available to all users. + + Args: + limit: The limit of items to return. Default is 20. + + name: Filter by name + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/blueprints/list_public", + page=AsyncBlueprintsCursorIDPage[BlueprintView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "name": name, + "starting_after": starting_after, + }, + blueprint_list_public_params.BlueprintListPublicParams, + ), + ), + model=BlueprintView, + ) + async def logs( self, id: str, @@ -720,6 +827,9 @@ def __init__(self, blueprints: BlueprintsResource) -> None: self.delete = to_raw_response_wrapper( blueprints.delete, ) + self.list_public = to_raw_response_wrapper( + blueprints.list_public, + ) self.logs = to_raw_response_wrapper( blueprints.logs, ) @@ -744,6 +854,9 @@ def __init__(self, blueprints: AsyncBlueprintsResource) -> None: self.delete = async_to_raw_response_wrapper( blueprints.delete, ) + self.list_public = async_to_raw_response_wrapper( + blueprints.list_public, + ) self.logs = async_to_raw_response_wrapper( blueprints.logs, ) @@ -768,6 +881,9 @@ def __init__(self, blueprints: BlueprintsResource) -> None: self.delete = to_streamed_response_wrapper( blueprints.delete, ) + self.list_public = to_streamed_response_wrapper( + blueprints.list_public, + ) self.logs = to_streamed_response_wrapper( blueprints.logs, ) @@ -792,6 +908,9 @@ def __init__(self, blueprints: AsyncBlueprintsResource) -> None: self.delete = async_to_streamed_response_wrapper( blueprints.delete, ) + self.list_public = async_to_streamed_response_wrapper( + blueprints.list_public, + ) self.logs = async_to_streamed_response_wrapper( blueprints.logs, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 796fca424..8a9145ca0 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -68,6 +68,7 @@ from .scenario_list_public_params import ScenarioListPublicParams as ScenarioListPublicParams from .benchmark_definitions_params import BenchmarkDefinitionsParams as BenchmarkDefinitionsParams from .benchmark_list_public_params import BenchmarkListPublicParams as BenchmarkListPublicParams +from .blueprint_list_public_params import BlueprintListPublicParams as BlueprintListPublicParams from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView from .scoring_contract_result_view import ScoringContractResultView as ScoringContractResultView from .scoring_function_result_view import ScoringFunctionResultView as ScoringFunctionResultView diff --git a/src/runloop_api_client/types/blueprint_list_public_params.py b/src/runloop_api_client/types/blueprint_list_public_params.py new file mode 100644 index 000000000..d6b11e78e --- /dev/null +++ b/src/runloop_api_client/types/blueprint_list_public_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["BlueprintListPublicParams"] + + +class BlueprintListPublicParams(TypedDict, total=False): + limit: int + """The limit of items to return. Default is 20.""" + + name: str + """Filter by name""" + + starting_after: str + """Load the next page of data starting after the item with the given ID.""" diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index cc47a3d4d..a72c1beac 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -214,6 +214,40 @@ def test_path_params_delete(self, client: Runloop) -> None: "", ) + @parametrize + def test_method_list_public(self, client: Runloop) -> None: + blueprint = client.blueprints.list_public() + assert_matches_type(SyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"]) + + @parametrize + def test_method_list_public_with_all_params(self, client: Runloop) -> None: + blueprint = client.blueprints.list_public( + limit=0, + name="name", + starting_after="starting_after", + ) + assert_matches_type(SyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"]) + + @parametrize + def test_raw_response_list_public(self, client: Runloop) -> None: + response = client.blueprints.with_raw_response.list_public() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = response.parse() + assert_matches_type(SyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"]) + + @parametrize + def test_streaming_response_list_public(self, client: Runloop) -> None: + with client.blueprints.with_streaming_response.list_public() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + blueprint = response.parse() + assert_matches_type(SyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_logs(self, client: Runloop) -> None: blueprint = client.blueprints.logs( @@ -532,6 +566,40 @@ async def test_path_params_delete(self, async_client: AsyncRunloop) -> None: "", ) + @parametrize + async def test_method_list_public(self, async_client: AsyncRunloop) -> None: + blueprint = await async_client.blueprints.list_public() + assert_matches_type(AsyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"]) + + @parametrize + async def test_method_list_public_with_all_params(self, async_client: AsyncRunloop) -> None: + blueprint = await async_client.blueprints.list_public( + limit=0, + name="name", + starting_after="starting_after", + ) + assert_matches_type(AsyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"]) + + @parametrize + async def test_raw_response_list_public(self, async_client: AsyncRunloop) -> None: + response = await async_client.blueprints.with_raw_response.list_public() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = await response.parse() + assert_matches_type(AsyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"]) + + @parametrize + async def test_streaming_response_list_public(self, async_client: AsyncRunloop) -> None: + async with async_client.blueprints.with_streaming_response.list_public() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + blueprint = await response.parse() + assert_matches_type(AsyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_logs(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.logs( From 7716fe98cc9f67ca09095941d5da38afd61ee3c3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 18:46:27 +0000 Subject: [PATCH 830/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 21fa4455a..d940b6004 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.54.0" + ".": "0.55.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index be0e01e26..580e4ce47 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.54.0" +version = "0.55.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index a42e6aeee..221eb9d85 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.54.0" # x-release-please-version +__version__ = "0.55.0" # x-release-please-version From 0348d01811e309cf2cdfa43fd48a838401c98a53 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 20:12:00 +0000 Subject: [PATCH 831/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d940b6004..a7ae93626 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.55.0" + ".": "0.55.1" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 580e4ce47..1c6bfb1c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.55.0" +version = "0.55.1" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 221eb9d85..c371d82d4 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.55.0" # x-release-please-version +__version__ = "0.55.1" # x-release-please-version From 379bfcb3942d4e92683ec92c5b823860f3243084 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 20 Aug 2025 00:02:53 +0000 Subject: [PATCH 832/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a7ae93626..f27781a0f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.55.1" + ".": "0.55.2" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 1c6bfb1c8..b8283da6a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.55.1" +version = "0.55.2" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index c371d82d4..4a5e9b111 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.55.1" # x-release-please-version +__version__ = "0.55.2" # x-release-please-version From 3414d7a451d7c65245ee822bb4f26913cb4b6d08 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 21 Aug 2025 23:01:33 +0000 Subject: [PATCH 833/993] feat(api): api update --- .stats.yml | 8 +- api.md | 25 +- src/runloop_api_client/_client.py | 10 +- src/runloop_api_client/pagination.py | 75 ++ src/runloop_api_client/resources/__init__.py | 14 + .../resources/benchmarks/benchmarks.py | 37 +- src/runloop_api_client/resources/objects.py | 902 ++++++++++++++++++ .../resources/scenarios/scenarios.py | 22 +- src/runloop_api_client/types/__init__.py | 8 + .../types/benchmark_create_params.py | 6 + .../types/benchmark_start_run_params.py | 23 +- .../types/benchmark_update_params.py | 6 + .../types/benchmark_view.py | 6 + .../types/object_create_params.py | 42 + .../types/object_download_params.py | 12 + .../types/object_download_url_view.py | 10 + .../types/object_list_params.py | 27 + .../types/object_list_public_params.py | 27 + .../types/object_list_view.py | 22 + src/runloop_api_client/types/object_view.py | 49 + .../types/scenario_create_params.py | 5 +- .../types/scenario_environment.py | 3 - .../types/scenario_environment_param.py | 3 - .../types/scenario_start_run_params.py | 23 +- .../types/scenario_update_params.py | 5 +- src/runloop_api_client/types/scenario_view.py | 4 + .../types/shared/__init__.py | 1 + .../types/shared/run_profile.py | 29 + .../types/shared_params/__init__.py | 1 + .../types/shared_params/run_profile.py | 30 + tests/api_resources/scenarios/test_scorers.py | 2 - tests/api_resources/test_benchmarks.py | 8 + tests/api_resources/test_objects.py | 582 +++++++++++ tests/api_resources/test_scenarios.py | 8 +- 34 files changed, 1969 insertions(+), 66 deletions(-) create mode 100644 src/runloop_api_client/resources/objects.py create mode 100644 src/runloop_api_client/types/object_create_params.py create mode 100644 src/runloop_api_client/types/object_download_params.py create mode 100644 src/runloop_api_client/types/object_download_url_view.py create mode 100644 src/runloop_api_client/types/object_list_params.py create mode 100644 src/runloop_api_client/types/object_list_public_params.py create mode 100644 src/runloop_api_client/types/object_list_view.py create mode 100644 src/runloop_api_client/types/object_view.py create mode 100644 src/runloop_api_client/types/shared/run_profile.py create mode 100644 src/runloop_api_client/types/shared_params/run_profile.py create mode 100644 tests/api_resources/test_objects.py diff --git a/.stats.yml b/.stats.yml index 4ac8bf319..e93852be7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 93 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-5bf266bfc4635f690b764f54cbbcd71ff347622e3bfd8540a7d2a4d7d2d78be8.yml -openapi_spec_hash: 3769820d0ac76caf6a1950802c73a382 -config_hash: 7d940dc50b19e75e3719c4d41fd0e8dd +configured_endpoints: 100 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-feb1c5fb18adf1bfc11f6fc7ee95f08a319ce4a504c34c68dee66f090f69a70c.yml +openapi_spec_hash: 758379882a3c4bf49f3ded6ac065a604 +config_hash: b97411af91b8ec0b8b066358c29091b4 diff --git a/api.md b/api.md index 012c2a3e8..8116fd462 100644 --- a/api.md +++ b/api.md @@ -1,7 +1,7 @@ # Shared Types ```python -from runloop_api_client.types import AfterIdle, CodeMountParameters, LaunchParameters +from runloop_api_client.types import AfterIdle, CodeMountParameters, LaunchParameters, RunProfile ``` # Benchmarks @@ -323,6 +323,29 @@ Methods: - client.scenarios.scorers.list(\*\*params) -> SyncScenarioScorersCursorIDPage[ScorerListResponse] - client.scenarios.scorers.validate(id, \*\*params) -> ScorerValidateResponse +# Objects + +Types: + +```python +from runloop_api_client.types import ( + ObjectCreateParameters, + ObjectDownloadURLView, + ObjectListView, + ObjectView, +) +``` + +Methods: + +- client.objects.create(\*\*params) -> ObjectView +- client.objects.retrieve(id) -> ObjectView +- client.objects.list(\*\*params) -> SyncObjectsCursorIDPage[ObjectView] +- client.objects.delete(id) -> ObjectView +- client.objects.complete(id) -> ObjectView +- client.objects.download(id, \*\*params) -> ObjectDownloadURLView +- client.objects.list_public(\*\*params) -> SyncObjectsCursorIDPage[ObjectView] + # Repositories Types: diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index ff8c86578..ace01b2ee 100644 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -21,7 +21,7 @@ ) from ._utils import is_given, get_async_library from ._version import __version__ -from .resources import secrets, blueprints, repositories +from .resources import objects, secrets, blueprints, repositories from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import RunloopError, APIStatusError from ._base_client import ( @@ -41,6 +41,7 @@ class Runloop(SyncAPIClient): blueprints: blueprints.BlueprintsResource devboxes: devboxes.DevboxesResource scenarios: scenarios.ScenariosResource + objects: objects.ObjectsResource repositories: repositories.RepositoriesResource secrets: secrets.SecretsResource with_raw_response: RunloopWithRawResponse @@ -106,6 +107,7 @@ def __init__( self.blueprints = blueprints.BlueprintsResource(self) self.devboxes = devboxes.DevboxesResource(self) self.scenarios = scenarios.ScenariosResource(self) + self.objects = objects.ObjectsResource(self) self.repositories = repositories.RepositoriesResource(self) self.secrets = secrets.SecretsResource(self) self.with_raw_response = RunloopWithRawResponse(self) @@ -221,6 +223,7 @@ class AsyncRunloop(AsyncAPIClient): blueprints: blueprints.AsyncBlueprintsResource devboxes: devboxes.AsyncDevboxesResource scenarios: scenarios.AsyncScenariosResource + objects: objects.AsyncObjectsResource repositories: repositories.AsyncRepositoriesResource secrets: secrets.AsyncSecretsResource with_raw_response: AsyncRunloopWithRawResponse @@ -286,6 +289,7 @@ def __init__( self.blueprints = blueprints.AsyncBlueprintsResource(self) self.devboxes = devboxes.AsyncDevboxesResource(self) self.scenarios = scenarios.AsyncScenariosResource(self) + self.objects = objects.AsyncObjectsResource(self) self.repositories = repositories.AsyncRepositoriesResource(self) self.secrets = secrets.AsyncSecretsResource(self) self.with_raw_response = AsyncRunloopWithRawResponse(self) @@ -402,6 +406,7 @@ def __init__(self, client: Runloop) -> None: self.blueprints = blueprints.BlueprintsResourceWithRawResponse(client.blueprints) self.devboxes = devboxes.DevboxesResourceWithRawResponse(client.devboxes) self.scenarios = scenarios.ScenariosResourceWithRawResponse(client.scenarios) + self.objects = objects.ObjectsResourceWithRawResponse(client.objects) self.repositories = repositories.RepositoriesResourceWithRawResponse(client.repositories) self.secrets = secrets.SecretsResourceWithRawResponse(client.secrets) @@ -412,6 +417,7 @@ def __init__(self, client: AsyncRunloop) -> None: self.blueprints = blueprints.AsyncBlueprintsResourceWithRawResponse(client.blueprints) self.devboxes = devboxes.AsyncDevboxesResourceWithRawResponse(client.devboxes) self.scenarios = scenarios.AsyncScenariosResourceWithRawResponse(client.scenarios) + self.objects = objects.AsyncObjectsResourceWithRawResponse(client.objects) self.repositories = repositories.AsyncRepositoriesResourceWithRawResponse(client.repositories) self.secrets = secrets.AsyncSecretsResourceWithRawResponse(client.secrets) @@ -422,6 +428,7 @@ def __init__(self, client: Runloop) -> None: self.blueprints = blueprints.BlueprintsResourceWithStreamingResponse(client.blueprints) self.devboxes = devboxes.DevboxesResourceWithStreamingResponse(client.devboxes) self.scenarios = scenarios.ScenariosResourceWithStreamingResponse(client.scenarios) + self.objects = objects.ObjectsResourceWithStreamingResponse(client.objects) self.repositories = repositories.RepositoriesResourceWithStreamingResponse(client.repositories) self.secrets = secrets.SecretsResourceWithStreamingResponse(client.secrets) @@ -432,6 +439,7 @@ def __init__(self, client: AsyncRunloop) -> None: self.blueprints = blueprints.AsyncBlueprintsResourceWithStreamingResponse(client.blueprints) self.devboxes = devboxes.AsyncDevboxesResourceWithStreamingResponse(client.devboxes) self.scenarios = scenarios.AsyncScenariosResourceWithStreamingResponse(client.scenarios) + self.objects = objects.AsyncObjectsResourceWithStreamingResponse(client.objects) self.repositories = repositories.AsyncRepositoriesResourceWithStreamingResponse(client.repositories) self.secrets = secrets.AsyncSecretsResourceWithStreamingResponse(client.secrets) diff --git a/src/runloop_api_client/pagination.py b/src/runloop_api_client/pagination.py index eb5d5653f..734b6996f 100644 --- a/src/runloop_api_client/pagination.py +++ b/src/runloop_api_client/pagination.py @@ -24,6 +24,8 @@ "AsyncScenarioRunsCursorIDPage", "SyncScenarioScorersCursorIDPage", "AsyncScenarioScorersCursorIDPage", + "SyncObjectsCursorIDPage", + "AsyncObjectsCursorIDPage", ] _T = TypeVar("_T") @@ -74,6 +76,11 @@ class ScenarioScorersCursorIDPageItem(Protocol): id: str +@runtime_checkable +class ObjectsCursorIDPageItem(Protocol): + id: str + + class SyncBlueprintsCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): blueprints: List[_T] has_more: Optional[bool] = None @@ -684,3 +691,71 @@ def next_page_info(self) -> Optional[PageInfo]: return None return PageInfo(params={"starting_after": item.id}) + + +class SyncObjectsCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + objects: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + objects = self.objects + if not objects: + return [] + return objects + + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + + @override + def next_page_info(self) -> Optional[PageInfo]: + objects = self.objects + if not objects: + return None + + item = cast(Any, objects[-1]) + if not isinstance(item, ObjectsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) + + +class AsyncObjectsCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + objects: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + objects = self.objects + if not objects: + return [] + return objects + + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + + @override + def next_page_info(self) -> Optional[PageInfo]: + objects = self.objects + if not objects: + return None + + item = cast(Any, objects[-1]) + if not isinstance(item, ObjectsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) diff --git a/src/runloop_api_client/resources/__init__.py b/src/runloop_api_client/resources/__init__.py index c493ac8c7..72ea92468 100644 --- a/src/runloop_api_client/resources/__init__.py +++ b/src/runloop_api_client/resources/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .objects import ( + ObjectsResource, + AsyncObjectsResource, + ObjectsResourceWithRawResponse, + AsyncObjectsResourceWithRawResponse, + ObjectsResourceWithStreamingResponse, + AsyncObjectsResourceWithStreamingResponse, +) from .secrets import ( SecretsResource, AsyncSecretsResource, @@ -74,6 +82,12 @@ "AsyncScenariosResourceWithRawResponse", "ScenariosResourceWithStreamingResponse", "AsyncScenariosResourceWithStreamingResponse", + "ObjectsResource", + "AsyncObjectsResource", + "ObjectsResourceWithRawResponse", + "AsyncObjectsResourceWithRawResponse", + "ObjectsResourceWithStreamingResponse", + "AsyncObjectsResourceWithStreamingResponse", "RepositoriesResource", "AsyncRepositoriesResource", "RepositoriesResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py index c8b3ca1e7..38b84a5fb 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -36,6 +36,7 @@ from ..._base_client import AsyncPaginator, make_request_options from ...types.benchmark_view import BenchmarkView from ...types.benchmark_run_view import BenchmarkRunView +from ...types.shared_params.run_profile import RunProfile from ...types.scenario_definition_list_view import ScenarioDefinitionListView __all__ = ["BenchmarksResource", "AsyncBenchmarksResource"] @@ -69,6 +70,8 @@ def create( self, *, name: str, + attribution: Optional[str] | NotGiven = NOT_GIVEN, + description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, required_secret_names: List[str] | NotGiven = NOT_GIVEN, @@ -87,6 +90,10 @@ def create( Args: name: The name of the Benchmark. This must be unique. + attribution: Attribution information for the benchmark. + + description: Detailed description of the benchmark. + metadata: User defined metadata to attach to the benchmark for organization. required_environment_variables: Environment variables required to run the benchmark. If any required variables @@ -113,6 +120,8 @@ def create( body=maybe_transform( { "name": name, + "attribution": attribution, + "description": description, "metadata": metadata, "required_environment_variables": required_environment_variables, "required_secret_names": required_secret_names, @@ -168,6 +177,8 @@ def update( id: str, *, name: str, + attribution: Optional[str] | NotGiven = NOT_GIVEN, + description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, required_secret_names: List[str] | NotGiven = NOT_GIVEN, @@ -186,6 +197,10 @@ def update( Args: name: The name of the Benchmark. This must be unique. + attribution: Attribution information for the benchmark. + + description: Detailed description of the benchmark. + metadata: User defined metadata to attach to the benchmark for organization. required_environment_variables: Environment variables required to run the benchmark. If any required variables @@ -214,6 +229,8 @@ def update( body=maybe_transform( { "name": name, + "attribution": attribution, + "description": description, "metadata": metadata, "required_environment_variables": required_environment_variables, "required_secret_names": required_secret_names, @@ -380,7 +397,7 @@ def start_run( benchmark_id: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, run_name: Optional[str] | NotGiven = NOT_GIVEN, - run_profile: Optional[benchmark_start_run_params.RunProfile] | NotGiven = NOT_GIVEN, + run_profile: Optional[RunProfile] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -461,6 +478,8 @@ async def create( self, *, name: str, + attribution: Optional[str] | NotGiven = NOT_GIVEN, + description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, required_secret_names: List[str] | NotGiven = NOT_GIVEN, @@ -479,6 +498,10 @@ async def create( Args: name: The name of the Benchmark. This must be unique. + attribution: Attribution information for the benchmark. + + description: Detailed description of the benchmark. + metadata: User defined metadata to attach to the benchmark for organization. required_environment_variables: Environment variables required to run the benchmark. If any required variables @@ -505,6 +528,8 @@ async def create( body=await async_maybe_transform( { "name": name, + "attribution": attribution, + "description": description, "metadata": metadata, "required_environment_variables": required_environment_variables, "required_secret_names": required_secret_names, @@ -560,6 +585,8 @@ async def update( id: str, *, name: str, + attribution: Optional[str] | NotGiven = NOT_GIVEN, + description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, required_secret_names: List[str] | NotGiven = NOT_GIVEN, @@ -578,6 +605,10 @@ async def update( Args: name: The name of the Benchmark. This must be unique. + attribution: Attribution information for the benchmark. + + description: Detailed description of the benchmark. + metadata: User defined metadata to attach to the benchmark for organization. required_environment_variables: Environment variables required to run the benchmark. If any required variables @@ -606,6 +637,8 @@ async def update( body=await async_maybe_transform( { "name": name, + "attribution": attribution, + "description": description, "metadata": metadata, "required_environment_variables": required_environment_variables, "required_secret_names": required_secret_names, @@ -772,7 +805,7 @@ async def start_run( benchmark_id: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, run_name: Optional[str] | NotGiven = NOT_GIVEN, - run_profile: Optional[benchmark_start_run_params.RunProfile] | NotGiven = NOT_GIVEN, + run_profile: Optional[RunProfile] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/runloop_api_client/resources/objects.py b/src/runloop_api_client/resources/objects.py new file mode 100644 index 000000000..8f90b1323 --- /dev/null +++ b/src/runloop_api_client/resources/objects.py @@ -0,0 +1,902 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Optional +from typing_extensions import Literal + +import httpx + +from ..types import object_list_params, object_create_params, object_download_params, object_list_public_params +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import maybe_transform, async_maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..pagination import SyncObjectsCursorIDPage, AsyncObjectsCursorIDPage +from .._base_client import AsyncPaginator, make_request_options +from ..types.object_view import ObjectView +from ..types.object_download_url_view import ObjectDownloadURLView + +__all__ = ["ObjectsResource", "AsyncObjectsResource"] + + +class ObjectsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ObjectsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return ObjectsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ObjectsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return ObjectsResourceWithStreamingResponse(self) + + def create( + self, + *, + content_type: Literal[ + "UNSPECIFIED", + "TEXT_PLAIN", + "TEXT_HTML", + "TEXT_CSS", + "TEXT_JAVASCRIPT", + "TEXT_YAML", + "TEXT_CSV", + "APPLICATION_JSON", + "APPLICATION_XML", + "APPLICATION_PDF", + "APPLICATION_ZIP", + "APPLICATION_GZIP", + "APPLICATION_TAR", + "APPLICATION_TAR_GZIP", + "APPLICATION_OCTET_STREAM", + "IMAGE_JPEG", + "IMAGE_PNG", + "IMAGE_GIF", + "IMAGE_SVG", + "IMAGE_WEBP", + ], + name: str, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ObjectView: + """Create a new Object with content and metadata. + + The Object will be assigned a + unique ID. + + Args: + content_type: The content type of the Object. + + name: The name of the Object. + + metadata: User defined metadata to attach to the object for organization. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/v1/objects", + body=maybe_transform( + { + "content_type": content_type, + "name": name, + "metadata": metadata, + }, + object_create_params.ObjectCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ObjectView, + ) + + def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ObjectView: + """ + Retrieve a specific Object by its unique identifier. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/objects/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ObjectView, + ) + + def list( + self, + *, + content_type: str | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + search: str | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + state: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncObjectsCursorIDPage[ObjectView]: + """ + List all Objects for the authenticated account with pagination support. + + Args: + content_type: Filter objects by content type. + + limit: The limit of items to return. Default is 20. + + name: Filter objects by name (partial match supported). + + search: Search by object ID or name. + + starting_after: Load the next page of data starting after the item with the given ID. + + state: Filter objects by state (UPLOADING, READ_ONLY, DELETED). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/objects", + page=SyncObjectsCursorIDPage[ObjectView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "content_type": content_type, + "limit": limit, + "name": name, + "search": search, + "starting_after": starting_after, + "state": state, + }, + object_list_params.ObjectListParams, + ), + ), + model=ObjectView, + ) + + def delete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ObjectView: + """Delete an existing Object by ID. + + This action is irreversible and will remove the + Object and all its metadata. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/objects/{id}/delete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ObjectView, + ) + + def complete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ObjectView: + """ + Mark an Object's upload as complete, transitioning it from UPLOADING to + READ-only state. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/objects/{id}/complete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ObjectView, + ) + + def download( + self, + id: str, + *, + duration_seconds: int | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ObjectDownloadURLView: + """Generate a presigned download URL for an Object. + + The URL will be valid for the + specified duration. + + Args: + duration_seconds: Duration in seconds for the presigned URL validity (default: 3600). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/objects/{id}/download", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + {"duration_seconds": duration_seconds}, object_download_params.ObjectDownloadParams + ), + ), + cast_to=ObjectDownloadURLView, + ) + + def list_public( + self, + *, + content_type: str | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + search: str | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + state: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncObjectsCursorIDPage[ObjectView]: + """ + List all public Objects with pagination support. + + Args: + content_type: Filter objects by content type. + + limit: The limit of items to return. Default is 20. + + name: Filter objects by name (partial match supported). + + search: Search by object ID or name. + + starting_after: Load the next page of data starting after the item with the given ID. + + state: Filter objects by state (UPLOADING, READ_ONLY, DELETED). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/objects/list_public", + page=SyncObjectsCursorIDPage[ObjectView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "content_type": content_type, + "limit": limit, + "name": name, + "search": search, + "starting_after": starting_after, + "state": state, + }, + object_list_public_params.ObjectListPublicParams, + ), + ), + model=ObjectView, + ) + + +class AsyncObjectsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncObjectsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncObjectsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncObjectsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncObjectsResourceWithStreamingResponse(self) + + async def create( + self, + *, + content_type: Literal[ + "UNSPECIFIED", + "TEXT_PLAIN", + "TEXT_HTML", + "TEXT_CSS", + "TEXT_JAVASCRIPT", + "TEXT_YAML", + "TEXT_CSV", + "APPLICATION_JSON", + "APPLICATION_XML", + "APPLICATION_PDF", + "APPLICATION_ZIP", + "APPLICATION_GZIP", + "APPLICATION_TAR", + "APPLICATION_TAR_GZIP", + "APPLICATION_OCTET_STREAM", + "IMAGE_JPEG", + "IMAGE_PNG", + "IMAGE_GIF", + "IMAGE_SVG", + "IMAGE_WEBP", + ], + name: str, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ObjectView: + """Create a new Object with content and metadata. + + The Object will be assigned a + unique ID. + + Args: + content_type: The content type of the Object. + + name: The name of the Object. + + metadata: User defined metadata to attach to the object for organization. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/v1/objects", + body=await async_maybe_transform( + { + "content_type": content_type, + "name": name, + "metadata": metadata, + }, + object_create_params.ObjectCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ObjectView, + ) + + async def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ObjectView: + """ + Retrieve a specific Object by its unique identifier. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/objects/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ObjectView, + ) + + def list( + self, + *, + content_type: str | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + search: str | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + state: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[ObjectView, AsyncObjectsCursorIDPage[ObjectView]]: + """ + List all Objects for the authenticated account with pagination support. + + Args: + content_type: Filter objects by content type. + + limit: The limit of items to return. Default is 20. + + name: Filter objects by name (partial match supported). + + search: Search by object ID or name. + + starting_after: Load the next page of data starting after the item with the given ID. + + state: Filter objects by state (UPLOADING, READ_ONLY, DELETED). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/objects", + page=AsyncObjectsCursorIDPage[ObjectView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "content_type": content_type, + "limit": limit, + "name": name, + "search": search, + "starting_after": starting_after, + "state": state, + }, + object_list_params.ObjectListParams, + ), + ), + model=ObjectView, + ) + + async def delete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ObjectView: + """Delete an existing Object by ID. + + This action is irreversible and will remove the + Object and all its metadata. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/objects/{id}/delete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ObjectView, + ) + + async def complete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> ObjectView: + """ + Mark an Object's upload as complete, transitioning it from UPLOADING to + READ-only state. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/objects/{id}/complete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ObjectView, + ) + + async def download( + self, + id: str, + *, + duration_seconds: int | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> ObjectDownloadURLView: + """Generate a presigned download URL for an Object. + + The URL will be valid for the + specified duration. + + Args: + duration_seconds: Duration in seconds for the presigned URL validity (default: 3600). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/objects/{id}/download", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + {"duration_seconds": duration_seconds}, object_download_params.ObjectDownloadParams + ), + ), + cast_to=ObjectDownloadURLView, + ) + + def list_public( + self, + *, + content_type: str | NotGiven = NOT_GIVEN, + limit: int | NotGiven = NOT_GIVEN, + name: str | NotGiven = NOT_GIVEN, + search: str | NotGiven = NOT_GIVEN, + starting_after: str | NotGiven = NOT_GIVEN, + state: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[ObjectView, AsyncObjectsCursorIDPage[ObjectView]]: + """ + List all public Objects with pagination support. + + Args: + content_type: Filter objects by content type. + + limit: The limit of items to return. Default is 20. + + name: Filter objects by name (partial match supported). + + search: Search by object ID or name. + + starting_after: Load the next page of data starting after the item with the given ID. + + state: Filter objects by state (UPLOADING, READ_ONLY, DELETED). + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/objects/list_public", + page=AsyncObjectsCursorIDPage[ObjectView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "content_type": content_type, + "limit": limit, + "name": name, + "search": search, + "starting_after": starting_after, + "state": state, + }, + object_list_public_params.ObjectListPublicParams, + ), + ), + model=ObjectView, + ) + + +class ObjectsResourceWithRawResponse: + def __init__(self, objects: ObjectsResource) -> None: + self._objects = objects + + self.create = to_raw_response_wrapper( + objects.create, + ) + self.retrieve = to_raw_response_wrapper( + objects.retrieve, + ) + self.list = to_raw_response_wrapper( + objects.list, + ) + self.delete = to_raw_response_wrapper( + objects.delete, + ) + self.complete = to_raw_response_wrapper( + objects.complete, + ) + self.download = to_raw_response_wrapper( + objects.download, + ) + self.list_public = to_raw_response_wrapper( + objects.list_public, + ) + + +class AsyncObjectsResourceWithRawResponse: + def __init__(self, objects: AsyncObjectsResource) -> None: + self._objects = objects + + self.create = async_to_raw_response_wrapper( + objects.create, + ) + self.retrieve = async_to_raw_response_wrapper( + objects.retrieve, + ) + self.list = async_to_raw_response_wrapper( + objects.list, + ) + self.delete = async_to_raw_response_wrapper( + objects.delete, + ) + self.complete = async_to_raw_response_wrapper( + objects.complete, + ) + self.download = async_to_raw_response_wrapper( + objects.download, + ) + self.list_public = async_to_raw_response_wrapper( + objects.list_public, + ) + + +class ObjectsResourceWithStreamingResponse: + def __init__(self, objects: ObjectsResource) -> None: + self._objects = objects + + self.create = to_streamed_response_wrapper( + objects.create, + ) + self.retrieve = to_streamed_response_wrapper( + objects.retrieve, + ) + self.list = to_streamed_response_wrapper( + objects.list, + ) + self.delete = to_streamed_response_wrapper( + objects.delete, + ) + self.complete = to_streamed_response_wrapper( + objects.complete, + ) + self.download = to_streamed_response_wrapper( + objects.download, + ) + self.list_public = to_streamed_response_wrapper( + objects.list_public, + ) + + +class AsyncObjectsResourceWithStreamingResponse: + def __init__(self, objects: AsyncObjectsResource) -> None: + self._objects = objects + + self.create = async_to_streamed_response_wrapper( + objects.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + objects.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + objects.list, + ) + self.delete = async_to_streamed_response_wrapper( + objects.delete, + ) + self.complete = async_to_streamed_response_wrapper( + objects.complete, + ) + self.download = async_to_streamed_response_wrapper( + objects.download, + ) + self.list_public = async_to_streamed_response_wrapper( + objects.list_public, + ) diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index 43ed765ca..262023ebc 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import Dict, List, Optional +from typing_extensions import Literal import httpx @@ -45,6 +46,7 @@ from ...types.scenario_run_view import ScenarioRunView from ...types.input_context_param import InputContextParam from ...types.scoring_contract_param import ScoringContractParam +from ...types.shared_params.run_profile import RunProfile from ...types.input_context_update_param import InputContextUpdateParam from ...types.scenario_environment_param import ScenarioEnvironmentParam from ...types.scoring_contract_update_param import ScoringContractUpdateParam @@ -91,6 +93,7 @@ def create( reference_output: Optional[str] | NotGiven = NOT_GIVEN, required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, required_secret_names: Optional[List[str]] | NotGiven = NOT_GIVEN, + validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -125,6 +128,8 @@ def create( secret name). If these secrets are not provided or the mapping is incorrect, the scenario will fail to start. + validation_type: Validation strategy. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -147,6 +152,7 @@ def create( "reference_output": reference_output, "required_environment_variables": required_environment_variables, "required_secret_names": required_secret_names, + "validation_type": validation_type, }, scenario_create_params.ScenarioCreateParams, ), @@ -205,6 +211,7 @@ def update( required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, required_secret_names: Optional[List[str]] | NotGiven = NOT_GIVEN, scoring_contract: Optional[ScoringContractUpdateParam] | NotGiven = NOT_GIVEN, + validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -237,6 +244,8 @@ def update( scoring_contract: The scoring contract for the Scenario. + validation_type: Validation strategy. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -261,6 +270,7 @@ def update( "required_environment_variables": required_environment_variables, "required_secret_names": required_secret_names, "scoring_contract": scoring_contract, + "validation_type": validation_type, }, scenario_update_params.ScenarioUpdateParams, ), @@ -387,7 +397,7 @@ def start_run( benchmark_run_id: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, run_name: Optional[str] | NotGiven = NOT_GIVEN, - run_profile: Optional[scenario_start_run_params.RunProfile] | NotGiven = NOT_GIVEN, + run_profile: Optional[RunProfile] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -482,6 +492,7 @@ async def create( reference_output: Optional[str] | NotGiven = NOT_GIVEN, required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, required_secret_names: Optional[List[str]] | NotGiven = NOT_GIVEN, + validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -516,6 +527,8 @@ async def create( secret name). If these secrets are not provided or the mapping is incorrect, the scenario will fail to start. + validation_type: Validation strategy. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -538,6 +551,7 @@ async def create( "reference_output": reference_output, "required_environment_variables": required_environment_variables, "required_secret_names": required_secret_names, + "validation_type": validation_type, }, scenario_create_params.ScenarioCreateParams, ), @@ -596,6 +610,7 @@ async def update( required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, required_secret_names: Optional[List[str]] | NotGiven = NOT_GIVEN, scoring_contract: Optional[ScoringContractUpdateParam] | NotGiven = NOT_GIVEN, + validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -628,6 +643,8 @@ async def update( scoring_contract: The scoring contract for the Scenario. + validation_type: Validation strategy. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -652,6 +669,7 @@ async def update( "required_environment_variables": required_environment_variables, "required_secret_names": required_secret_names, "scoring_contract": scoring_contract, + "validation_type": validation_type, }, scenario_update_params.ScenarioUpdateParams, ), @@ -778,7 +796,7 @@ async def start_run( benchmark_run_id: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, run_name: Optional[str] | NotGiven = NOT_GIVEN, - run_profile: Optional[scenario_start_run_params.RunProfile] | NotGiven = NOT_GIVEN, + run_profile: Optional[RunProfile] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 8a9145ca0..31f7c8ca5 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -6,16 +6,19 @@ from .. import _compat from .shared import ( AfterIdle as AfterIdle, + RunProfile as RunProfile, LaunchParameters as LaunchParameters, CodeMountParameters as CodeMountParameters, ) from .devbox_view import DevboxView as DevboxView +from .object_view import ObjectView as ObjectView from .secret_view import SecretView as SecretView from .input_context import InputContext as InputContext from .scenario_view import ScenarioView as ScenarioView from .benchmark_view import BenchmarkView as BenchmarkView from .blueprint_view import BlueprintView as BlueprintView from .devbox_list_view import DevboxListView as DevboxListView +from .object_list_view import ObjectListView as ObjectListView from .scoring_contract import ScoringContract as ScoringContract from .scoring_function import ScoringFunction as ScoringFunction from .secret_list_view import SecretListView as SecretListView @@ -23,6 +26,7 @@ from .benchmark_run_view import BenchmarkRunView as BenchmarkRunView from .devbox_list_params import DevboxListParams as DevboxListParams from .devbox_tunnel_view import DevboxTunnelView as DevboxTunnelView +from .object_list_params import ObjectListParams as ObjectListParams from .secret_list_params import SecretListParams as SecretListParams from .blueprint_build_log import BlueprintBuildLog as BlueprintBuildLog from .blueprint_list_view import BlueprintListView as BlueprintListView @@ -30,6 +34,7 @@ from .devbox_create_params import DevboxCreateParams as DevboxCreateParams from .devbox_snapshot_view import DevboxSnapshotView as DevboxSnapshotView from .devbox_update_params import DevboxUpdateParams as DevboxUpdateParams +from .object_create_params import ObjectCreateParams as ObjectCreateParams from .scenario_environment import ScenarioEnvironment as ScenarioEnvironment from .scenario_list_params import ScenarioListParams as ScenarioListParams from .secret_create_params import SecretCreateParams as SecretCreateParams @@ -37,6 +42,7 @@ from .benchmark_list_params import BenchmarkListParams as BenchmarkListParams from .blueprint_list_params import BlueprintListParams as BlueprintListParams from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView +from .object_download_params import ObjectDownloadParams as ObjectDownloadParams from .repository_list_params import RepositoryListParams as RepositoryListParams from .scenario_create_params import ScenarioCreateParams as ScenarioCreateParams from .scenario_run_list_view import ScenarioRunListView as ScenarioRunListView @@ -48,10 +54,12 @@ from .benchmark_update_params import BenchmarkUpdateParams as BenchmarkUpdateParams from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams +from .object_download_url_view import ObjectDownloadURLView as ObjectDownloadURLView from .repository_create_params import RepositoryCreateParams as RepositoryCreateParams from .repository_manifest_view import RepositoryManifestView as RepositoryManifestView from .devbox_snapshot_list_view import DevboxSnapshotListView as DevboxSnapshotListView from .devbox_upload_file_params import DevboxUploadFileParams as DevboxUploadFileParams +from .object_list_public_params import ObjectListPublicParams as ObjectListPublicParams from .repository_refresh_params import RepositoryRefreshParams as RepositoryRefreshParams from .scenario_start_run_params import ScenarioStartRunParams as ScenarioStartRunParams from .benchmark_start_run_params import BenchmarkStartRunParams as BenchmarkStartRunParams diff --git a/src/runloop_api_client/types/benchmark_create_params.py b/src/runloop_api_client/types/benchmark_create_params.py index 11937ef53..c43d5a98c 100644 --- a/src/runloop_api_client/types/benchmark_create_params.py +++ b/src/runloop_api_client/types/benchmark_create_params.py @@ -12,6 +12,12 @@ class BenchmarkCreateParams(TypedDict, total=False): name: Required[str] """The name of the Benchmark. This must be unique.""" + attribution: Optional[str] + """Attribution information for the benchmark.""" + + description: Optional[str] + """Detailed description of the benchmark.""" + metadata: Optional[Dict[str, str]] """User defined metadata to attach to the benchmark for organization.""" diff --git a/src/runloop_api_client/types/benchmark_start_run_params.py b/src/runloop_api_client/types/benchmark_start_run_params.py index 23f211cae..7655ff5ad 100644 --- a/src/runloop_api_client/types/benchmark_start_run_params.py +++ b/src/runloop_api_client/types/benchmark_start_run_params.py @@ -6,8 +6,9 @@ from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo +from .shared_params.run_profile import RunProfile -__all__ = ["BenchmarkStartRunParams", "RunProfile"] +__all__ = ["BenchmarkStartRunParams"] class BenchmarkStartRunParams(TypedDict, total=False): @@ -22,23 +23,3 @@ class BenchmarkStartRunParams(TypedDict, total=False): run_profile: Annotated[Optional[RunProfile], PropertyInfo(alias="runProfile")] """Runtime configuration to use for this benchmark run""" - - -class RunProfile(TypedDict, total=False): - env_vars: Annotated[Optional[Dict[str, str]], PropertyInfo(alias="envVars")] - """Mapping of Environment Variable to Value. - - May be shown in devbox logging. Example: {"DB_PASS": "DATABASE_PASSWORD"} would - set the environment variable 'DB_PASS' to the value 'DATABASE_PASSWORD_VALUE'. - """ - - purpose: Optional[str] - """Purpose of the run.""" - - secrets: Optional[Dict[str, str]] - """Mapping of Environment Variable to User Secret Name. - - Never shown in devbox logging. Example: {"DB_PASS": "DATABASE_PASSWORD"} would - set the environment variable 'DB_PASS' to the value of the secret - 'DATABASE_PASSWORD'. - """ diff --git a/src/runloop_api_client/types/benchmark_update_params.py b/src/runloop_api_client/types/benchmark_update_params.py index 009dd5793..ef26cd42f 100644 --- a/src/runloop_api_client/types/benchmark_update_params.py +++ b/src/runloop_api_client/types/benchmark_update_params.py @@ -12,6 +12,12 @@ class BenchmarkUpdateParams(TypedDict, total=False): name: Required[str] """The name of the Benchmark. This must be unique.""" + attribution: Optional[str] + """Attribution information for the benchmark.""" + + description: Optional[str] + """Detailed description of the benchmark.""" + metadata: Optional[Dict[str, str]] """User defined metadata to attach to the benchmark for organization.""" diff --git a/src/runloop_api_client/types/benchmark_view.py b/src/runloop_api_client/types/benchmark_view.py index 1b8753c1f..877c8fe26 100644 --- a/src/runloop_api_client/types/benchmark_view.py +++ b/src/runloop_api_client/types/benchmark_view.py @@ -22,6 +22,12 @@ class BenchmarkView(BaseModel): scenario_ids: List[str] = FieldInfo(alias="scenarioIds") """List of Scenario IDs that make up the benchmark.""" + attribution: Optional[str] = None + """Attribution information for the benchmark.""" + + description: Optional[str] = None + """Detailed description of the benchmark.""" + is_public: Optional[bool] = None """Whether this benchmark is public.""" diff --git a/src/runloop_api_client/types/object_create_params.py b/src/runloop_api_client/types/object_create_params.py new file mode 100644 index 000000000..52a5af6f9 --- /dev/null +++ b/src/runloop_api_client/types/object_create_params.py @@ -0,0 +1,42 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ObjectCreateParams"] + + +class ObjectCreateParams(TypedDict, total=False): + content_type: Required[ + Literal[ + "UNSPECIFIED", + "TEXT_PLAIN", + "TEXT_HTML", + "TEXT_CSS", + "TEXT_JAVASCRIPT", + "TEXT_YAML", + "TEXT_CSV", + "APPLICATION_JSON", + "APPLICATION_XML", + "APPLICATION_PDF", + "APPLICATION_ZIP", + "APPLICATION_GZIP", + "APPLICATION_TAR", + "APPLICATION_TAR_GZIP", + "APPLICATION_OCTET_STREAM", + "IMAGE_JPEG", + "IMAGE_PNG", + "IMAGE_GIF", + "IMAGE_SVG", + "IMAGE_WEBP", + ] + ] + """The content type of the Object.""" + + name: Required[str] + """The name of the Object.""" + + metadata: Optional[Dict[str, str]] + """User defined metadata to attach to the object for organization.""" diff --git a/src/runloop_api_client/types/object_download_params.py b/src/runloop_api_client/types/object_download_params.py new file mode 100644 index 000000000..3dd9e3472 --- /dev/null +++ b/src/runloop_api_client/types/object_download_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["ObjectDownloadParams"] + + +class ObjectDownloadParams(TypedDict, total=False): + duration_seconds: int + """Duration in seconds for the presigned URL validity (default: 3600).""" diff --git a/src/runloop_api_client/types/object_download_url_view.py b/src/runloop_api_client/types/object_download_url_view.py new file mode 100644 index 000000000..eb35ac3db --- /dev/null +++ b/src/runloop_api_client/types/object_download_url_view.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .._models import BaseModel + +__all__ = ["ObjectDownloadURLView"] + + +class ObjectDownloadURLView(BaseModel): + download_url: str + """The presigned download URL for the Object.""" diff --git a/src/runloop_api_client/types/object_list_params.py b/src/runloop_api_client/types/object_list_params.py new file mode 100644 index 000000000..044cff81a --- /dev/null +++ b/src/runloop_api_client/types/object_list_params.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["ObjectListParams"] + + +class ObjectListParams(TypedDict, total=False): + content_type: str + """Filter objects by content type.""" + + limit: int + """The limit of items to return. Default is 20.""" + + name: str + """Filter objects by name (partial match supported).""" + + search: str + """Search by object ID or name.""" + + starting_after: str + """Load the next page of data starting after the item with the given ID.""" + + state: str + """Filter objects by state (UPLOADING, READ_ONLY, DELETED).""" diff --git a/src/runloop_api_client/types/object_list_public_params.py b/src/runloop_api_client/types/object_list_public_params.py new file mode 100644 index 000000000..a69ef53dd --- /dev/null +++ b/src/runloop_api_client/types/object_list_public_params.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["ObjectListPublicParams"] + + +class ObjectListPublicParams(TypedDict, total=False): + content_type: str + """Filter objects by content type.""" + + limit: int + """The limit of items to return. Default is 20.""" + + name: str + """Filter objects by name (partial match supported).""" + + search: str + """Search by object ID or name.""" + + starting_after: str + """Load the next page of data starting after the item with the given ID.""" + + state: str + """Filter objects by state (UPLOADING, READ_ONLY, DELETED).""" diff --git a/src/runloop_api_client/types/object_list_view.py b/src/runloop_api_client/types/object_list_view.py new file mode 100644 index 000000000..049b1be81 --- /dev/null +++ b/src/runloop_api_client/types/object_list_view.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .object_view import ObjectView + +__all__ = ["ObjectListView"] + + +class ObjectListView(BaseModel): + has_more: bool + """True if there are more results available beyond this page.""" + + objects: List[ObjectView] + """List of Object entities.""" + + remaining_count: int + """Number of Objects remaining after this page.""" + + total_count: int + """Total number of Objects across all pages.""" diff --git a/src/runloop_api_client/types/object_view.py b/src/runloop_api_client/types/object_view.py new file mode 100644 index 000000000..549e7e8fb --- /dev/null +++ b/src/runloop_api_client/types/object_view.py @@ -0,0 +1,49 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["ObjectView"] + + +class ObjectView(BaseModel): + id: str + """The unique identifier of the Object.""" + + content_type: Literal[ + "UNSPECIFIED", + "TEXT_PLAIN", + "TEXT_HTML", + "TEXT_CSS", + "TEXT_JAVASCRIPT", + "TEXT_YAML", + "TEXT_CSV", + "APPLICATION_JSON", + "APPLICATION_XML", + "APPLICATION_PDF", + "APPLICATION_ZIP", + "APPLICATION_GZIP", + "APPLICATION_TAR", + "APPLICATION_TAR_GZIP", + "APPLICATION_OCTET_STREAM", + "IMAGE_JPEG", + "IMAGE_PNG", + "IMAGE_GIF", + "IMAGE_SVG", + "IMAGE_WEBP", + ] + """The content type of the Object.""" + + name: str + """The name of the Object.""" + + state: str + """The current state of the Object.""" + + size_bytes: Optional[int] = None + """The size of the Object content in bytes (null until uploaded).""" + + upload_url: Optional[str] = None + """Presigned URL for uploading content to S3 (only present on create).""" diff --git a/src/runloop_api_client/types/scenario_create_params.py b/src/runloop_api_client/types/scenario_create_params.py index 71f402aa9..294c1645d 100644 --- a/src/runloop_api_client/types/scenario_create_params.py +++ b/src/runloop_api_client/types/scenario_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, List, Optional -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict from .input_context_param import InputContextParam from .scoring_contract_param import ScoringContractParam @@ -47,3 +47,6 @@ class ScenarioCreateParams(TypedDict, total=False): secret name). If these secrets are not provided or the mapping is incorrect, the scenario will fail to start. """ + + validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] + """Validation strategy.""" diff --git a/src/runloop_api_client/types/scenario_environment.py b/src/runloop_api_client/types/scenario_environment.py index 97c2977fc..94e244df9 100644 --- a/src/runloop_api_client/types/scenario_environment.py +++ b/src/runloop_api_client/types/scenario_environment.py @@ -15,9 +15,6 @@ class ScenarioEnvironment(BaseModel): launch_parameters: Optional[LaunchParameters] = None """Optional launch parameters to apply to the devbox environment at launch.""" - prebuilt_id: Optional[str] = None - """Use the prebuilt with matching ID.""" - snapshot_id: Optional[str] = None """Use the snapshot with matching ID.""" diff --git a/src/runloop_api_client/types/scenario_environment_param.py b/src/runloop_api_client/types/scenario_environment_param.py index 3b749bb76..5069e5943 100644 --- a/src/runloop_api_client/types/scenario_environment_param.py +++ b/src/runloop_api_client/types/scenario_environment_param.py @@ -17,9 +17,6 @@ class ScenarioEnvironmentParam(TypedDict, total=False): launch_parameters: Optional[LaunchParameters] """Optional launch parameters to apply to the devbox environment at launch.""" - prebuilt_id: Optional[str] - """Use the prebuilt with matching ID.""" - snapshot_id: Optional[str] """Use the snapshot with matching ID.""" diff --git a/src/runloop_api_client/types/scenario_start_run_params.py b/src/runloop_api_client/types/scenario_start_run_params.py index 91d7e34e8..6f5e39c00 100644 --- a/src/runloop_api_client/types/scenario_start_run_params.py +++ b/src/runloop_api_client/types/scenario_start_run_params.py @@ -6,8 +6,9 @@ from typing_extensions import Required, Annotated, TypedDict from .._utils import PropertyInfo +from .shared_params.run_profile import RunProfile -__all__ = ["ScenarioStartRunParams", "RunProfile"] +__all__ = ["ScenarioStartRunParams"] class ScenarioStartRunParams(TypedDict, total=False): @@ -25,23 +26,3 @@ class ScenarioStartRunParams(TypedDict, total=False): run_profile: Annotated[Optional[RunProfile], PropertyInfo(alias="runProfile")] """Runtime configuration to use for this benchmark run""" - - -class RunProfile(TypedDict, total=False): - env_vars: Annotated[Optional[Dict[str, str]], PropertyInfo(alias="envVars")] - """Mapping of Environment Variable to Value. - - May be shown in devbox logging. Example: {"DB_PASS": "DATABASE_PASSWORD"} would - set the environment variable 'DB_PASS' to the value 'DATABASE_PASSWORD_VALUE'. - """ - - purpose: Optional[str] - """Purpose of the run.""" - - secrets: Optional[Dict[str, str]] - """Mapping of Environment Variable to User Secret Name. - - Never shown in devbox logging. Example: {"DB_PASS": "DATABASE_PASSWORD"} would - set the environment variable 'DB_PASS' to the value of the secret - 'DATABASE_PASSWORD'. - """ diff --git a/src/runloop_api_client/types/scenario_update_params.py b/src/runloop_api_client/types/scenario_update_params.py index 6605c9f24..d92641215 100644 --- a/src/runloop_api_client/types/scenario_update_params.py +++ b/src/runloop_api_client/types/scenario_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, List, Optional -from typing_extensions import TypedDict +from typing_extensions import Literal, TypedDict from .input_context_update_param import InputContextUpdateParam from .scenario_environment_param import ScenarioEnvironmentParam @@ -40,3 +40,6 @@ class ScenarioUpdateParams(TypedDict, total=False): scoring_contract: Optional[ScoringContractUpdateParam] """The scoring contract for the Scenario.""" + + validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] + """Validation strategy.""" diff --git a/src/runloop_api_client/types/scenario_view.py b/src/runloop_api_client/types/scenario_view.py index 2b608038a..230bda36c 100644 --- a/src/runloop_api_client/types/scenario_view.py +++ b/src/runloop_api_client/types/scenario_view.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Dict, List, Optional +from typing_extensions import Literal from .._models import BaseModel from .input_context import InputContext @@ -51,3 +52,6 @@ class ScenarioView(BaseModel): If any required secrets are missing, the scenario will fail to start. """ + + validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] = None + """Validation strategy.""" diff --git a/src/runloop_api_client/types/shared/__init__.py b/src/runloop_api_client/types/shared/__init__.py index bc4b7503e..356cc4022 100644 --- a/src/runloop_api_client/types/shared/__init__.py +++ b/src/runloop_api_client/types/shared/__init__.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .after_idle import AfterIdle as AfterIdle +from .run_profile import RunProfile as RunProfile from .launch_parameters import LaunchParameters as LaunchParameters from .code_mount_parameters import CodeMountParameters as CodeMountParameters diff --git a/src/runloop_api_client/types/shared/run_profile.py b/src/runloop_api_client/types/shared/run_profile.py new file mode 100644 index 000000000..d107fcc76 --- /dev/null +++ b/src/runloop_api_client/types/shared/run_profile.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["RunProfile"] + + +class RunProfile(BaseModel): + env_vars: Optional[Dict[str, str]] = FieldInfo(alias="envVars", default=None) + """Mapping of Environment Variable to Value. + + May be shown in devbox logging. Example: {"DB_PASS": "DATABASE_PASSWORD"} would + set the environment variable 'DB_PASS' to the value 'DATABASE_PASSWORD_VALUE'. + """ + + purpose: Optional[str] = None + """Purpose of the run.""" + + secrets: Optional[Dict[str, str]] = None + """Mapping of Environment Variable to User Secret Name. + + Never shown in devbox logging. Example: {"DB_PASS": "DATABASE_PASSWORD"} would + set the environment variable 'DB_PASS' to the value of the secret + 'DATABASE_PASSWORD'. + """ diff --git a/src/runloop_api_client/types/shared_params/__init__.py b/src/runloop_api_client/types/shared_params/__init__.py index bc4b7503e..356cc4022 100644 --- a/src/runloop_api_client/types/shared_params/__init__.py +++ b/src/runloop_api_client/types/shared_params/__init__.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from .after_idle import AfterIdle as AfterIdle +from .run_profile import RunProfile as RunProfile from .launch_parameters import LaunchParameters as LaunchParameters from .code_mount_parameters import CodeMountParameters as CodeMountParameters diff --git a/src/runloop_api_client/types/shared_params/run_profile.py b/src/runloop_api_client/types/shared_params/run_profile.py new file mode 100644 index 000000000..eca72fcd1 --- /dev/null +++ b/src/runloop_api_client/types/shared_params/run_profile.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Optional +from typing_extensions import Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["RunProfile"] + + +class RunProfile(TypedDict, total=False): + env_vars: Annotated[Optional[Dict[str, str]], PropertyInfo(alias="envVars")] + """Mapping of Environment Variable to Value. + + May be shown in devbox logging. Example: {"DB_PASS": "DATABASE_PASSWORD"} would + set the environment variable 'DB_PASS' to the value 'DATABASE_PASSWORD_VALUE'. + """ + + purpose: Optional[str] + """Purpose of the run.""" + + secrets: Optional[Dict[str, str]] + """Mapping of Environment Variable to User Secret Name. + + Never shown in devbox logging. Example: {"DB_PASS": "DATABASE_PASSWORD"} would + set the environment variable 'DB_PASS' to the value of the secret + 'DATABASE_PASSWORD'. + """ diff --git a/tests/api_resources/scenarios/test_scorers.py b/tests/api_resources/scenarios/test_scorers.py index 415693ada..f104a0924 100644 --- a/tests/api_resources/scenarios/test_scorers.py +++ b/tests/api_resources/scenarios/test_scorers.py @@ -209,7 +209,6 @@ def test_method_validate_with_all_params(self, client: Runloop) -> None: "username": "username", }, }, - "prebuilt_id": "prebuilt_id", "snapshot_id": "snapshot_id", "working_directory": "working_directory", }, @@ -441,7 +440,6 @@ async def test_method_validate_with_all_params(self, async_client: AsyncRunloop) "username": "username", }, }, - "prebuilt_id": "prebuilt_id", "snapshot_id": "snapshot_id", "working_directory": "working_directory", }, diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py index 00afa4d43..5585bf1db 100644 --- a/tests/api_resources/test_benchmarks.py +++ b/tests/api_resources/test_benchmarks.py @@ -33,6 +33,8 @@ def test_method_create(self, client: Runloop) -> None: def test_method_create_with_all_params(self, client: Runloop) -> None: benchmark = client.benchmarks.create( name="name", + attribution="attribution", + description="description", metadata={"foo": "string"}, required_environment_variables=["string"], required_secret_names=["string"], @@ -115,6 +117,8 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: benchmark = client.benchmarks.update( id="id", name="name", + attribution="attribution", + description="description", metadata={"foo": "string"}, required_environment_variables=["string"], required_secret_names=["string"], @@ -331,6 +335,8 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.create( name="name", + attribution="attribution", + description="description", metadata={"foo": "string"}, required_environment_variables=["string"], required_secret_names=["string"], @@ -413,6 +419,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - benchmark = await async_client.benchmarks.update( id="id", name="name", + attribution="attribution", + description="description", metadata={"foo": "string"}, required_environment_variables=["string"], required_secret_names=["string"], diff --git a/tests/api_resources/test_objects.py b/tests/api_resources/test_objects.py new file mode 100644 index 000000000..aa3462a55 --- /dev/null +++ b/tests/api_resources/test_objects.py @@ -0,0 +1,582 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types import ( + ObjectView, + ObjectDownloadURLView, +) +from runloop_api_client.pagination import SyncObjectsCursorIDPage, AsyncObjectsCursorIDPage + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestObjects: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Runloop) -> None: + object_ = client.objects.create( + content_type="UNSPECIFIED", + name="name", + ) + assert_matches_type(ObjectView, object_, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Runloop) -> None: + object_ = client.objects.create( + content_type="UNSPECIFIED", + name="name", + metadata={"foo": "string"}, + ) + assert_matches_type(ObjectView, object_, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Runloop) -> None: + response = client.objects.with_raw_response.create( + content_type="UNSPECIFIED", + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + object_ = response.parse() + assert_matches_type(ObjectView, object_, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Runloop) -> None: + with client.objects.with_streaming_response.create( + content_type="UNSPECIFIED", + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + object_ = response.parse() + assert_matches_type(ObjectView, object_, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + object_ = client.objects.retrieve( + "id", + ) + assert_matches_type(ObjectView, object_, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.objects.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + object_ = response.parse() + assert_matches_type(ObjectView, object_, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.objects.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + object_ = response.parse() + assert_matches_type(ObjectView, object_, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.objects.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + object_ = client.objects.list() + assert_matches_type(SyncObjectsCursorIDPage[ObjectView], object_, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + object_ = client.objects.list( + content_type="content_type", + limit=0, + name="name", + search="search", + starting_after="starting_after", + state="state", + ) + assert_matches_type(SyncObjectsCursorIDPage[ObjectView], object_, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.objects.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + object_ = response.parse() + assert_matches_type(SyncObjectsCursorIDPage[ObjectView], object_, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.objects.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + object_ = response.parse() + assert_matches_type(SyncObjectsCursorIDPage[ObjectView], object_, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_delete(self, client: Runloop) -> None: + object_ = client.objects.delete( + "id", + ) + assert_matches_type(ObjectView, object_, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Runloop) -> None: + response = client.objects.with_raw_response.delete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + object_ = response.parse() + assert_matches_type(ObjectView, object_, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Runloop) -> None: + with client.objects.with_streaming_response.delete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + object_ = response.parse() + assert_matches_type(ObjectView, object_, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.objects.with_raw_response.delete( + "", + ) + + @parametrize + def test_method_complete(self, client: Runloop) -> None: + object_ = client.objects.complete( + "id", + ) + assert_matches_type(ObjectView, object_, path=["response"]) + + @parametrize + def test_raw_response_complete(self, client: Runloop) -> None: + response = client.objects.with_raw_response.complete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + object_ = response.parse() + assert_matches_type(ObjectView, object_, path=["response"]) + + @parametrize + def test_streaming_response_complete(self, client: Runloop) -> None: + with client.objects.with_streaming_response.complete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + object_ = response.parse() + assert_matches_type(ObjectView, object_, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_complete(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.objects.with_raw_response.complete( + "", + ) + + @parametrize + def test_method_download(self, client: Runloop) -> None: + object_ = client.objects.download( + id="id", + ) + assert_matches_type(ObjectDownloadURLView, object_, path=["response"]) + + @parametrize + def test_method_download_with_all_params(self, client: Runloop) -> None: + object_ = client.objects.download( + id="id", + duration_seconds=0, + ) + assert_matches_type(ObjectDownloadURLView, object_, path=["response"]) + + @parametrize + def test_raw_response_download(self, client: Runloop) -> None: + response = client.objects.with_raw_response.download( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + object_ = response.parse() + assert_matches_type(ObjectDownloadURLView, object_, path=["response"]) + + @parametrize + def test_streaming_response_download(self, client: Runloop) -> None: + with client.objects.with_streaming_response.download( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + object_ = response.parse() + assert_matches_type(ObjectDownloadURLView, object_, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_download(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.objects.with_raw_response.download( + id="", + ) + + @parametrize + def test_method_list_public(self, client: Runloop) -> None: + object_ = client.objects.list_public() + assert_matches_type(SyncObjectsCursorIDPage[ObjectView], object_, path=["response"]) + + @parametrize + def test_method_list_public_with_all_params(self, client: Runloop) -> None: + object_ = client.objects.list_public( + content_type="content_type", + limit=0, + name="name", + search="search", + starting_after="starting_after", + state="state", + ) + assert_matches_type(SyncObjectsCursorIDPage[ObjectView], object_, path=["response"]) + + @parametrize + def test_raw_response_list_public(self, client: Runloop) -> None: + response = client.objects.with_raw_response.list_public() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + object_ = response.parse() + assert_matches_type(SyncObjectsCursorIDPage[ObjectView], object_, path=["response"]) + + @parametrize + def test_streaming_response_list_public(self, client: Runloop) -> None: + with client.objects.with_streaming_response.list_public() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + object_ = response.parse() + assert_matches_type(SyncObjectsCursorIDPage[ObjectView], object_, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncObjects: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_create(self, async_client: AsyncRunloop) -> None: + object_ = await async_client.objects.create( + content_type="UNSPECIFIED", + name="name", + ) + assert_matches_type(ObjectView, object_, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: + object_ = await async_client.objects.create( + content_type="UNSPECIFIED", + name="name", + metadata={"foo": "string"}, + ) + assert_matches_type(ObjectView, object_, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: + response = await async_client.objects.with_raw_response.create( + content_type="UNSPECIFIED", + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + object_ = await response.parse() + assert_matches_type(ObjectView, object_, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: + async with async_client.objects.with_streaming_response.create( + content_type="UNSPECIFIED", + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + object_ = await response.parse() + assert_matches_type(ObjectView, object_, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + object_ = await async_client.objects.retrieve( + "id", + ) + assert_matches_type(ObjectView, object_, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.objects.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + object_ = await response.parse() + assert_matches_type(ObjectView, object_, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.objects.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + object_ = await response.parse() + assert_matches_type(ObjectView, object_, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.objects.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + object_ = await async_client.objects.list() + assert_matches_type(AsyncObjectsCursorIDPage[ObjectView], object_, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + object_ = await async_client.objects.list( + content_type="content_type", + limit=0, + name="name", + search="search", + starting_after="starting_after", + state="state", + ) + assert_matches_type(AsyncObjectsCursorIDPage[ObjectView], object_, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.objects.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + object_ = await response.parse() + assert_matches_type(AsyncObjectsCursorIDPage[ObjectView], object_, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.objects.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + object_ = await response.parse() + assert_matches_type(AsyncObjectsCursorIDPage[ObjectView], object_, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete(self, async_client: AsyncRunloop) -> None: + object_ = await async_client.objects.delete( + "id", + ) + assert_matches_type(ObjectView, object_, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncRunloop) -> None: + response = await async_client.objects.with_raw_response.delete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + object_ = await response.parse() + assert_matches_type(ObjectView, object_, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncRunloop) -> None: + async with async_client.objects.with_streaming_response.delete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + object_ = await response.parse() + assert_matches_type(ObjectView, object_, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.objects.with_raw_response.delete( + "", + ) + + @parametrize + async def test_method_complete(self, async_client: AsyncRunloop) -> None: + object_ = await async_client.objects.complete( + "id", + ) + assert_matches_type(ObjectView, object_, path=["response"]) + + @parametrize + async def test_raw_response_complete(self, async_client: AsyncRunloop) -> None: + response = await async_client.objects.with_raw_response.complete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + object_ = await response.parse() + assert_matches_type(ObjectView, object_, path=["response"]) + + @parametrize + async def test_streaming_response_complete(self, async_client: AsyncRunloop) -> None: + async with async_client.objects.with_streaming_response.complete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + object_ = await response.parse() + assert_matches_type(ObjectView, object_, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_complete(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.objects.with_raw_response.complete( + "", + ) + + @parametrize + async def test_method_download(self, async_client: AsyncRunloop) -> None: + object_ = await async_client.objects.download( + id="id", + ) + assert_matches_type(ObjectDownloadURLView, object_, path=["response"]) + + @parametrize + async def test_method_download_with_all_params(self, async_client: AsyncRunloop) -> None: + object_ = await async_client.objects.download( + id="id", + duration_seconds=0, + ) + assert_matches_type(ObjectDownloadURLView, object_, path=["response"]) + + @parametrize + async def test_raw_response_download(self, async_client: AsyncRunloop) -> None: + response = await async_client.objects.with_raw_response.download( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + object_ = await response.parse() + assert_matches_type(ObjectDownloadURLView, object_, path=["response"]) + + @parametrize + async def test_streaming_response_download(self, async_client: AsyncRunloop) -> None: + async with async_client.objects.with_streaming_response.download( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + object_ = await response.parse() + assert_matches_type(ObjectDownloadURLView, object_, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_download(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.objects.with_raw_response.download( + id="", + ) + + @parametrize + async def test_method_list_public(self, async_client: AsyncRunloop) -> None: + object_ = await async_client.objects.list_public() + assert_matches_type(AsyncObjectsCursorIDPage[ObjectView], object_, path=["response"]) + + @parametrize + async def test_method_list_public_with_all_params(self, async_client: AsyncRunloop) -> None: + object_ = await async_client.objects.list_public( + content_type="content_type", + limit=0, + name="name", + search="search", + starting_after="starting_after", + state="state", + ) + assert_matches_type(AsyncObjectsCursorIDPage[ObjectView], object_, path=["response"]) + + @parametrize + async def test_raw_response_list_public(self, async_client: AsyncRunloop) -> None: + response = await async_client.objects.with_raw_response.list_public() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + object_ = await response.parse() + assert_matches_type(AsyncObjectsCursorIDPage[ObjectView], object_, path=["response"]) + + @parametrize + async def test_streaming_response_list_public(self, async_client: AsyncRunloop) -> None: + async with async_client.objects.with_streaming_response.list_public() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + object_ = await response.parse() + assert_matches_type(AsyncObjectsCursorIDPage[ObjectView], object_, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index 53507ac7f..a2da71fab 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -85,7 +85,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "username": "username", }, }, - "prebuilt_id": "prebuilt_id", "snapshot_id": "snapshot_id", "working_directory": "working_directory", }, @@ -93,6 +92,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: reference_output="reference_output", required_environment_variables=["string"], required_secret_names=["string"], + validation_type="FORWARD", ) assert_matches_type(ScenarioView, scenario, path=["response"]) @@ -218,7 +218,6 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: "username": "username", }, }, - "prebuilt_id": "prebuilt_id", "snapshot_id": "snapshot_id", "working_directory": "working_directory", }, @@ -245,6 +244,7 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: } ] }, + validation_type="FORWARD", ) assert_matches_type(ScenarioView, scenario, path=["response"]) @@ -464,7 +464,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "username": "username", }, }, - "prebuilt_id": "prebuilt_id", "snapshot_id": "snapshot_id", "working_directory": "working_directory", }, @@ -472,6 +471,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - reference_output="reference_output", required_environment_variables=["string"], required_secret_names=["string"], + validation_type="FORWARD", ) assert_matches_type(ScenarioView, scenario, path=["response"]) @@ -597,7 +597,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - "username": "username", }, }, - "prebuilt_id": "prebuilt_id", "snapshot_id": "snapshot_id", "working_directory": "working_directory", }, @@ -624,6 +623,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - } ] }, + validation_type="FORWARD", ) assert_matches_type(ScenarioView, scenario, path=["response"]) From b7423ed46f9a76566524dd4deceb986995b5f36b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 21 Aug 2025 23:33:06 +0000 Subject: [PATCH 834/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- README.md | 4 ++-- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f27781a0f..2c310a467 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.55.2" + ".": "0.56.1-beta" } \ No newline at end of file diff --git a/README.md b/README.md index 1866dfe99..1ab153190 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ The REST API documentation can be found on [runloop.ai](https://runloop.ai). The ```sh # install from PyPI -pip install runloop_api_client +pip install --pre runloop_api_client ``` ## Usage @@ -73,7 +73,7 @@ You can enable this by installing `aiohttp`: ```sh # install from PyPI -pip install runloop_api_client[aiohttp] +pip install --pre runloop_api_client[aiohttp] ``` Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: diff --git a/pyproject.toml b/pyproject.toml index b8283da6a..a6e5e0f40 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.55.2" +version = "0.56.1-beta" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 4a5e9b111..b85a0a21b 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.55.2" # x-release-please-version +__version__ = "0.56.1-beta" # x-release-please-version From 18e14a42fda6da6725815c20a55098e71127b2aa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 22 Aug 2025 05:08:21 +0000 Subject: [PATCH 835/993] chore: update github action --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aea470f67..9d8dc4898 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: run: ./scripts/lint build: - if: github.repository == 'stainless-sdks/runloop-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork timeout-minutes: 10 name: build permissions: @@ -61,12 +61,14 @@ jobs: run: rye build - name: Get GitHub OIDC Token + if: github.repository == 'stainless-sdks/runloop-python' id: github-oidc uses: actions/github-script@v6 with: script: core.setOutput('github_token', await core.getIDToken()); - name: Upload tarball + if: github.repository == 'stainless-sdks/runloop-python' env: URL: https://pkg.stainless.com/s AUTH: ${{ steps.github-oidc.outputs.github_token }} From 08049aabc96b7ba9e9da9c07b0158b512d1ae477 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 25 Aug 2025 19:05:52 +0000 Subject: [PATCH 836/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- README.md | 4 ++-- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2c310a467..c09634347 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.56.1-beta" + ".": "0.56.2" } \ No newline at end of file diff --git a/README.md b/README.md index 1ab153190..1866dfe99 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ The REST API documentation can be found on [runloop.ai](https://runloop.ai). The ```sh # install from PyPI -pip install --pre runloop_api_client +pip install runloop_api_client ``` ## Usage @@ -73,7 +73,7 @@ You can enable this by installing `aiohttp`: ```sh # install from PyPI -pip install --pre runloop_api_client[aiohttp] +pip install runloop_api_client[aiohttp] ``` Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: diff --git a/pyproject.toml b/pyproject.toml index a6e5e0f40..68dec0994 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.56.1-beta" +version = "0.56.2" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index b85a0a21b..7ae731aba 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.56.1-beta" # x-release-please-version +__version__ = "0.56.2" # x-release-please-version From cba1541128a70d30cf739546e27d8898a1b55443 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 26 Aug 2025 04:07:29 +0000 Subject: [PATCH 837/993] chore(internal): change ci workflow machines --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d8dc4898..f4c594677 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: permissions: contents: read id-token: write - runs-on: depot-ubuntu-24.04 + runs-on: ${{ github.repository == 'stainless-sdks/runloop-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 From 9cfb5834e8146a336a462ce762c413968b46626b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 26 Aug 2025 19:13:53 +0000 Subject: [PATCH 838/993] feat(api): api update --- .stats.yml | 4 +- .../resources/blueprints.py | 16 ++++++++ .../types/blueprint_build_parameters.py | 3 ++ .../types/blueprint_create_params.py | 3 ++ .../types/blueprint_preview_params.py | 3 ++ .../types/shared/run_profile.py | 4 ++ .../types/shared_params/run_profile.py | 4 ++ tests/api_resources/test_benchmarks.py | 38 +++++++++++++++++++ tests/api_resources/test_blueprints.py | 4 ++ tests/api_resources/test_scenarios.py | 38 +++++++++++++++++++ 10 files changed, 115 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e93852be7..2761bb773 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 100 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-feb1c5fb18adf1bfc11f6fc7ee95f08a319ce4a504c34c68dee66f090f69a70c.yml -openapi_spec_hash: 758379882a3c4bf49f3ded6ac065a604 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6056b68db5d556977ff43e18d58b7ab073fca5ceb8c7204326895bc37618a0e2.yml +openapi_spec_hash: 093289672abcf8bb4d4d1eca424012bc config_hash: b97411af91b8ec0b8b066358c29091b4 diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index 2bf125bcf..52938a10b 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -62,6 +62,7 @@ def create( dockerfile: Optional[str] | NotGiven = NOT_GIVEN, file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, services: Optional[Iterable[blueprint_create_params.Service]] | NotGiven = NOT_GIVEN, system_setup_commands: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -93,6 +94,8 @@ def create( launch_parameters: Parameters to configure your Devbox at launch time. + metadata: (Optional) User defined metadata for the Blueprint. + services: (Optional) List of containerized services to include in the Blueprint. These services will be pre-pulled during the build phase for optimized startup performance. @@ -119,6 +122,7 @@ def create( "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, + "metadata": metadata, "services": services, "system_setup_commands": system_setup_commands, }, @@ -351,6 +355,7 @@ def preview( dockerfile: Optional[str] | NotGiven = NOT_GIVEN, file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, services: Optional[Iterable[blueprint_preview_params.Service]] | NotGiven = NOT_GIVEN, system_setup_commands: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -380,6 +385,8 @@ def preview( launch_parameters: Parameters to configure your Devbox at launch time. + metadata: (Optional) User defined metadata for the Blueprint. + services: (Optional) List of containerized services to include in the Blueprint. These services will be pre-pulled during the build phase for optimized startup performance. @@ -406,6 +413,7 @@ def preview( "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, + "metadata": metadata, "services": services, "system_setup_commands": system_setup_commands, }, @@ -451,6 +459,7 @@ async def create( dockerfile: Optional[str] | NotGiven = NOT_GIVEN, file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, services: Optional[Iterable[blueprint_create_params.Service]] | NotGiven = NOT_GIVEN, system_setup_commands: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -482,6 +491,8 @@ async def create( launch_parameters: Parameters to configure your Devbox at launch time. + metadata: (Optional) User defined metadata for the Blueprint. + services: (Optional) List of containerized services to include in the Blueprint. These services will be pre-pulled during the build phase for optimized startup performance. @@ -508,6 +519,7 @@ async def create( "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, + "metadata": metadata, "services": services, "system_setup_commands": system_setup_commands, }, @@ -740,6 +752,7 @@ async def preview( dockerfile: Optional[str] | NotGiven = NOT_GIVEN, file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, services: Optional[Iterable[blueprint_preview_params.Service]] | NotGiven = NOT_GIVEN, system_setup_commands: Optional[List[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -769,6 +782,8 @@ async def preview( launch_parameters: Parameters to configure your Devbox at launch time. + metadata: (Optional) User defined metadata for the Blueprint. + services: (Optional) List of containerized services to include in the Blueprint. These services will be pre-pulled during the build phase for optimized startup performance. @@ -795,6 +810,7 @@ async def preview( "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, + "metadata": metadata, "services": services, "system_setup_commands": system_setup_commands, }, diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index 4139526f8..9d6b25504 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -62,6 +62,9 @@ class BlueprintBuildParameters(BaseModel): launch_parameters: Optional[LaunchParameters] = None """Parameters to configure your Devbox at launch time.""" + metadata: Optional[Dict[str, str]] = None + """(Optional) User defined metadata for the Blueprint.""" + services: Optional[List[Service]] = None """(Optional) List of containerized services to include in the Blueprint. diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index 0beb3d469..5931a8ce4 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -33,6 +33,9 @@ class BlueprintCreateParams(TypedDict, total=False): launch_parameters: Optional[LaunchParameters] """Parameters to configure your Devbox at launch time.""" + metadata: Optional[Dict[str, str]] + """(Optional) User defined metadata for the Blueprint.""" + services: Optional[Iterable[Service]] """(Optional) List of containerized services to include in the Blueprint. diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index 11112080f..41c0d9e63 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -33,6 +33,9 @@ class BlueprintPreviewParams(TypedDict, total=False): launch_parameters: Optional[LaunchParameters] """Parameters to configure your Devbox at launch time.""" + metadata: Optional[Dict[str, str]] + """(Optional) User defined metadata for the Blueprint.""" + services: Optional[Iterable[Service]] """(Optional) List of containerized services to include in the Blueprint. diff --git a/src/runloop_api_client/types/shared/run_profile.py b/src/runloop_api_client/types/shared/run_profile.py index d107fcc76..21a29ef38 100644 --- a/src/runloop_api_client/types/shared/run_profile.py +++ b/src/runloop_api_client/types/shared/run_profile.py @@ -5,6 +5,7 @@ from pydantic import Field as FieldInfo from ..._models import BaseModel +from .launch_parameters import LaunchParameters __all__ = ["RunProfile"] @@ -17,6 +18,9 @@ class RunProfile(BaseModel): set the environment variable 'DB_PASS' to the value 'DATABASE_PASSWORD_VALUE'. """ + launch_parameters: Optional[LaunchParameters] = FieldInfo(alias="launchParameters", default=None) + """Additional runtime LaunchParameters to apply after the devbox starts.""" + purpose: Optional[str] = None """Purpose of the run.""" diff --git a/src/runloop_api_client/types/shared_params/run_profile.py b/src/runloop_api_client/types/shared_params/run_profile.py index eca72fcd1..20816c36d 100644 --- a/src/runloop_api_client/types/shared_params/run_profile.py +++ b/src/runloop_api_client/types/shared_params/run_profile.py @@ -6,6 +6,7 @@ from typing_extensions import Annotated, TypedDict from ..._utils import PropertyInfo +from .launch_parameters import LaunchParameters __all__ = ["RunProfile"] @@ -18,6 +19,9 @@ class RunProfile(TypedDict, total=False): set the environment variable 'DB_PASS' to the value 'DATABASE_PASSWORD_VALUE'. """ + launch_parameters: Annotated[Optional[LaunchParameters], PropertyInfo(alias="launchParameters")] + """Additional runtime LaunchParameters to apply after the devbox starts.""" + purpose: Optional[str] """Purpose of the run.""" diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py index 5585bf1db..0a40742ee 100644 --- a/tests/api_resources/test_benchmarks.py +++ b/tests/api_resources/test_benchmarks.py @@ -288,6 +288,25 @@ def test_method_start_run_with_all_params(self, client: Runloop) -> None: run_name="run_name", run_profile={ "env_vars": {"foo": "string"}, + "launch_parameters": { + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "shutdown", + }, + "architecture": "x86_64", + "available_ports": [0], + "custom_cpu_cores": 0, + "custom_disk_size": 0, + "custom_gb_memory": 0, + "keep_alive_time_seconds": 0, + "launch_commands": ["string"], + "required_services": ["string"], + "resource_size_request": "X_SMALL", + "user_parameters": { + "uid": 0, + "username": "username", + }, + }, "purpose": "purpose", "secrets": {"foo": "string"}, }, @@ -590,6 +609,25 @@ async def test_method_start_run_with_all_params(self, async_client: AsyncRunloop run_name="run_name", run_profile={ "env_vars": {"foo": "string"}, + "launch_parameters": { + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "shutdown", + }, + "architecture": "x86_64", + "available_ports": [0], + "custom_cpu_cores": 0, + "custom_disk_size": 0, + "custom_gb_memory": 0, + "keep_alive_time_seconds": 0, + "launch_commands": ["string"], + "required_services": ["string"], + "resource_size_request": "X_SMALL", + "user_parameters": { + "uid": 0, + "username": "username", + }, + }, "purpose": "purpose", "secrets": {"foo": "string"}, }, diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index a72c1beac..0ac239ecb 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -63,6 +63,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "username": "username", }, }, + metadata={"foo": "string"}, services=[ { "image": "image", @@ -327,6 +328,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: "username": "username", }, }, + metadata={"foo": "string"}, services=[ { "image": "image", @@ -415,6 +417,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "username": "username", }, }, + metadata={"foo": "string"}, services=[ { "image": "image", @@ -679,6 +682,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) "username": "username", }, }, + metadata={"foo": "string"}, services=[ { "image": "image", diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index a2da71fab..0896213f7 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -364,6 +364,25 @@ def test_method_start_run_with_all_params(self, client: Runloop) -> None: run_name="run_name", run_profile={ "env_vars": {"foo": "string"}, + "launch_parameters": { + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "shutdown", + }, + "architecture": "x86_64", + "available_ports": [0], + "custom_cpu_cores": 0, + "custom_disk_size": 0, + "custom_gb_memory": 0, + "keep_alive_time_seconds": 0, + "launch_commands": ["string"], + "required_services": ["string"], + "resource_size_request": "X_SMALL", + "user_parameters": { + "uid": 0, + "username": "username", + }, + }, "purpose": "purpose", "secrets": {"foo": "string"}, }, @@ -743,6 +762,25 @@ async def test_method_start_run_with_all_params(self, async_client: AsyncRunloop run_name="run_name", run_profile={ "env_vars": {"foo": "string"}, + "launch_parameters": { + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "shutdown", + }, + "architecture": "x86_64", + "available_ports": [0], + "custom_cpu_cores": 0, + "custom_disk_size": 0, + "custom_gb_memory": 0, + "keep_alive_time_seconds": 0, + "launch_commands": ["string"], + "required_services": ["string"], + "resource_size_request": "X_SMALL", + "user_parameters": { + "uid": 0, + "username": "username", + }, + }, "purpose": "purpose", "secrets": {"foo": "string"}, }, From 960e05ddcf7a2451767f5d2f3b00a30d9821c00b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 27 Aug 2025 05:44:18 +0000 Subject: [PATCH 839/993] fix: avoid newer type syntax --- src/runloop_api_client/_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index b8387ce98..92f7c10bc 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -304,7 +304,7 @@ def model_dump( exclude_none=exclude_none, ) - return cast(dict[str, Any], json_safe(dumped)) if mode == "json" else dumped + return cast("dict[str, Any]", json_safe(dumped)) if mode == "json" else dumped @override def model_dump_json( From 3894ed1c712c706626ddcbeed3ecde4e59966ac1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 27 Aug 2025 05:47:39 +0000 Subject: [PATCH 840/993] chore(internal): update pyright exclude list --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 68dec0994..d2d886733 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -148,6 +148,7 @@ exclude = [ "_dev", ".venv", ".nox", + ".git", ] reportImplicitOverride = true From 13737969db36a22ba36798dfe68ab95099d3a864 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 27 Aug 2025 16:48:15 +0000 Subject: [PATCH 841/993] feat(api): api update --- .stats.yml | 4 +- src/runloop_api_client/resources/objects.py | 46 +------------------ .../types/object_create_params.py | 25 +--------- src/runloop_api_client/types/object_view.py | 23 +--------- tests/api_resources/test_objects.py | 16 +++---- 5 files changed, 14 insertions(+), 100 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2761bb773..6225bdc74 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 100 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6056b68db5d556977ff43e18d58b7ab073fca5ceb8c7204326895bc37618a0e2.yml -openapi_spec_hash: 093289672abcf8bb4d4d1eca424012bc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2027ff4b25ad2b5574b2ce497f5d0d02ad8804816ffd6b4e36511e2fa955d0cf.yml +openapi_spec_hash: 54a5a26e9c0b179d2f2a532268d3d711 config_hash: b97411af91b8ec0b8b066358c29091b4 diff --git a/src/runloop_api_client/resources/objects.py b/src/runloop_api_client/resources/objects.py index 8f90b1323..56ffb29fe 100644 --- a/src/runloop_api_client/resources/objects.py +++ b/src/runloop_api_client/resources/objects.py @@ -49,28 +49,7 @@ def with_streaming_response(self) -> ObjectsResourceWithStreamingResponse: def create( self, *, - content_type: Literal[ - "UNSPECIFIED", - "TEXT_PLAIN", - "TEXT_HTML", - "TEXT_CSS", - "TEXT_JAVASCRIPT", - "TEXT_YAML", - "TEXT_CSV", - "APPLICATION_JSON", - "APPLICATION_XML", - "APPLICATION_PDF", - "APPLICATION_ZIP", - "APPLICATION_GZIP", - "APPLICATION_TAR", - "APPLICATION_TAR_GZIP", - "APPLICATION_OCTET_STREAM", - "IMAGE_JPEG", - "IMAGE_PNG", - "IMAGE_GIF", - "IMAGE_SVG", - "IMAGE_WEBP", - ], + content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"], name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -433,28 +412,7 @@ def with_streaming_response(self) -> AsyncObjectsResourceWithStreamingResponse: async def create( self, *, - content_type: Literal[ - "UNSPECIFIED", - "TEXT_PLAIN", - "TEXT_HTML", - "TEXT_CSS", - "TEXT_JAVASCRIPT", - "TEXT_YAML", - "TEXT_CSV", - "APPLICATION_JSON", - "APPLICATION_XML", - "APPLICATION_PDF", - "APPLICATION_ZIP", - "APPLICATION_GZIP", - "APPLICATION_TAR", - "APPLICATION_TAR_GZIP", - "APPLICATION_OCTET_STREAM", - "IMAGE_JPEG", - "IMAGE_PNG", - "IMAGE_GIF", - "IMAGE_SVG", - "IMAGE_WEBP", - ], + content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"], name: str, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/runloop_api_client/types/object_create_params.py b/src/runloop_api_client/types/object_create_params.py index 52a5af6f9..fe554c188 100644 --- a/src/runloop_api_client/types/object_create_params.py +++ b/src/runloop_api_client/types/object_create_params.py @@ -9,30 +9,7 @@ class ObjectCreateParams(TypedDict, total=False): - content_type: Required[ - Literal[ - "UNSPECIFIED", - "TEXT_PLAIN", - "TEXT_HTML", - "TEXT_CSS", - "TEXT_JAVASCRIPT", - "TEXT_YAML", - "TEXT_CSV", - "APPLICATION_JSON", - "APPLICATION_XML", - "APPLICATION_PDF", - "APPLICATION_ZIP", - "APPLICATION_GZIP", - "APPLICATION_TAR", - "APPLICATION_TAR_GZIP", - "APPLICATION_OCTET_STREAM", - "IMAGE_JPEG", - "IMAGE_PNG", - "IMAGE_GIF", - "IMAGE_SVG", - "IMAGE_WEBP", - ] - ] + content_type: Required[Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"]] """The content type of the Object.""" name: Required[str] diff --git a/src/runloop_api_client/types/object_view.py b/src/runloop_api_client/types/object_view.py index 549e7e8fb..18c7c1d3c 100644 --- a/src/runloop_api_client/types/object_view.py +++ b/src/runloop_api_client/types/object_view.py @@ -12,28 +12,7 @@ class ObjectView(BaseModel): id: str """The unique identifier of the Object.""" - content_type: Literal[ - "UNSPECIFIED", - "TEXT_PLAIN", - "TEXT_HTML", - "TEXT_CSS", - "TEXT_JAVASCRIPT", - "TEXT_YAML", - "TEXT_CSV", - "APPLICATION_JSON", - "APPLICATION_XML", - "APPLICATION_PDF", - "APPLICATION_ZIP", - "APPLICATION_GZIP", - "APPLICATION_TAR", - "APPLICATION_TAR_GZIP", - "APPLICATION_OCTET_STREAM", - "IMAGE_JPEG", - "IMAGE_PNG", - "IMAGE_GIF", - "IMAGE_SVG", - "IMAGE_WEBP", - ] + content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"] """The content type of the Object.""" name: str diff --git a/tests/api_resources/test_objects.py b/tests/api_resources/test_objects.py index aa3462a55..cf5a4cd3b 100644 --- a/tests/api_resources/test_objects.py +++ b/tests/api_resources/test_objects.py @@ -24,7 +24,7 @@ class TestObjects: @parametrize def test_method_create(self, client: Runloop) -> None: object_ = client.objects.create( - content_type="UNSPECIFIED", + content_type="unspecified", name="name", ) assert_matches_type(ObjectView, object_, path=["response"]) @@ -32,7 +32,7 @@ def test_method_create(self, client: Runloop) -> None: @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: object_ = client.objects.create( - content_type="UNSPECIFIED", + content_type="unspecified", name="name", metadata={"foo": "string"}, ) @@ -41,7 +41,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: @parametrize def test_raw_response_create(self, client: Runloop) -> None: response = client.objects.with_raw_response.create( - content_type="UNSPECIFIED", + content_type="unspecified", name="name", ) @@ -53,7 +53,7 @@ def test_raw_response_create(self, client: Runloop) -> None: @parametrize def test_streaming_response_create(self, client: Runloop) -> None: with client.objects.with_streaming_response.create( - content_type="UNSPECIFIED", + content_type="unspecified", name="name", ) as response: assert not response.is_closed @@ -307,7 +307,7 @@ class TestAsyncObjects: @parametrize async def test_method_create(self, async_client: AsyncRunloop) -> None: object_ = await async_client.objects.create( - content_type="UNSPECIFIED", + content_type="unspecified", name="name", ) assert_matches_type(ObjectView, object_, path=["response"]) @@ -315,7 +315,7 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: object_ = await async_client.objects.create( - content_type="UNSPECIFIED", + content_type="unspecified", name="name", metadata={"foo": "string"}, ) @@ -324,7 +324,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - @parametrize async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: response = await async_client.objects.with_raw_response.create( - content_type="UNSPECIFIED", + content_type="unspecified", name="name", ) @@ -336,7 +336,7 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: async with async_client.objects.with_streaming_response.create( - content_type="UNSPECIFIED", + content_type="unspecified", name="name", ) as response: assert not response.is_closed From ea7a02cd79333d157c0b8734fe77304605841ef8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 27 Aug 2025 17:19:04 +0000 Subject: [PATCH 842/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c09634347..2afb750c5 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.56.2" + ".": "0.57.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index d2d886733..51054cc0c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.56.2" +version = "0.57.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 7ae731aba..23715c2d3 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.56.2" # x-release-please-version +__version__ = "0.57.0" # x-release-please-version From 7a78fce56194bde22623c66a8598ac0c66683123 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 30 Aug 2025 03:17:05 +0000 Subject: [PATCH 843/993] chore(internal): add Sequence related utils --- src/runloop_api_client/_types.py | 36 ++++++++++++++++++++++- src/runloop_api_client/_utils/__init__.py | 1 + src/runloop_api_client/_utils/_typing.py | 5 ++++ tests/utils.py | 10 ++++++- 4 files changed, 50 insertions(+), 2 deletions(-) diff --git a/src/runloop_api_client/_types.py b/src/runloop_api_client/_types.py index 40ccb19ed..46042bd52 100644 --- a/src/runloop_api_client/_types.py +++ b/src/runloop_api_client/_types.py @@ -13,10 +13,21 @@ Mapping, TypeVar, Callable, + Iterator, Optional, Sequence, ) -from typing_extensions import Set, Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable +from typing_extensions import ( + Set, + Literal, + Protocol, + TypeAlias, + TypedDict, + SupportsIndex, + overload, + override, + runtime_checkable, +) import httpx import pydantic @@ -217,3 +228,26 @@ class _GenericAlias(Protocol): class HttpxSendArgs(TypedDict, total=False): auth: httpx.Auth follow_redirects: bool + + +_T_co = TypeVar("_T_co", covariant=True) + + +if TYPE_CHECKING: + # This works because str.__contains__ does not accept object (either in typeshed or at runtime) + # https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285 + class SequenceNotStr(Protocol[_T_co]): + @overload + def __getitem__(self, index: SupportsIndex, /) -> _T_co: ... + @overload + def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ... + def __contains__(self, value: object, /) -> bool: ... + def __len__(self) -> int: ... + def __iter__(self) -> Iterator[_T_co]: ... + def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ... + def count(self, value: Any, /) -> int: ... + def __reversed__(self) -> Iterator[_T_co]: ... +else: + # just point this to a normal `Sequence` at runtime to avoid having to special case + # deserializing our custom sequence type + SequenceNotStr = Sequence diff --git a/src/runloop_api_client/_utils/__init__.py b/src/runloop_api_client/_utils/__init__.py index d4fda26f3..ca547ce52 100644 --- a/src/runloop_api_client/_utils/__init__.py +++ b/src/runloop_api_client/_utils/__init__.py @@ -38,6 +38,7 @@ extract_type_arg as extract_type_arg, is_iterable_type as is_iterable_type, is_required_type as is_required_type, + is_sequence_type as is_sequence_type, is_annotated_type as is_annotated_type, is_type_alias_type as is_type_alias_type, strip_annotated_type as strip_annotated_type, diff --git a/src/runloop_api_client/_utils/_typing.py b/src/runloop_api_client/_utils/_typing.py index 1bac9542e..845cd6b28 100644 --- a/src/runloop_api_client/_utils/_typing.py +++ b/src/runloop_api_client/_utils/_typing.py @@ -26,6 +26,11 @@ def is_list_type(typ: type) -> bool: return (get_origin(typ) or typ) == list +def is_sequence_type(typ: type) -> bool: + origin = get_origin(typ) or typ + return origin == typing_extensions.Sequence or origin == typing.Sequence or origin == _c_abc.Sequence + + def is_iterable_type(typ: type) -> bool: """If the given type is `typing.Iterable[T]`""" origin = get_origin(typ) or typ diff --git a/tests/utils.py b/tests/utils.py index 9ae192db0..44d940e25 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -4,7 +4,7 @@ import inspect import traceback import contextlib -from typing import Any, TypeVar, Iterator, cast +from typing import Any, TypeVar, Iterator, Sequence, cast from datetime import date, datetime from typing_extensions import Literal, get_args, get_origin, assert_type @@ -15,6 +15,7 @@ is_list_type, is_union_type, extract_type_arg, + is_sequence_type, is_annotated_type, is_type_alias_type, ) @@ -71,6 +72,13 @@ def assert_matches_type( if is_list_type(type_): return _assert_list_type(type_, value) + if is_sequence_type(type_): + assert isinstance(value, Sequence) + inner_type = get_args(type_)[0] + for entry in value: # type: ignore + assert_type(inner_type, entry) # type: ignore + return + if origin == str: assert isinstance(value, str) elif origin == int: From 0ad53d7b738180592616572432a0531922ecfdbb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 3 Sep 2025 02:56:08 +0000 Subject: [PATCH 844/993] feat(types): replace List[str] with SequenceNotStr in params --- src/runloop_api_client/_utils/_transform.py | 6 ++++ .../resources/benchmarks/benchmarks.py | 28 +++++++++---------- .../resources/blueprints.py | 12 ++++---- .../resources/scenarios/scenarios.py | 20 ++++++------- .../types/benchmark_create_params.py | 10 ++++--- .../types/benchmark_update_params.py | 10 ++++--- .../types/blueprint_create_params.py | 7 +++-- .../types/blueprint_preview_params.py | 7 +++-- .../devboxes/code_action_context_param.py | 5 ++-- .../types/scenario_create_params.py | 7 +++-- .../types/scenario_update_params.py | 7 +++-- .../types/shared_params/launch_parameters.py | 7 +++-- 12 files changed, 71 insertions(+), 55 deletions(-) diff --git a/src/runloop_api_client/_utils/_transform.py b/src/runloop_api_client/_utils/_transform.py index b0cc20a73..f0bcefd49 100644 --- a/src/runloop_api_client/_utils/_transform.py +++ b/src/runloop_api_client/_utils/_transform.py @@ -16,6 +16,7 @@ lru_cache, is_mapping, is_iterable, + is_sequence, ) from .._files import is_base64_file_input from ._typing import ( @@ -24,6 +25,7 @@ extract_type_arg, is_iterable_type, is_required_type, + is_sequence_type, is_annotated_type, strip_annotated_type, ) @@ -184,6 +186,8 @@ def _transform_recursive( (is_list_type(stripped_type) and is_list(data)) # Iterable[T] or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str)) + # Sequence[T] + or (is_sequence_type(stripped_type) and is_sequence(data) and not isinstance(data, str)) ): # dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually # intended as an iterable, so we don't transform it. @@ -346,6 +350,8 @@ async def _async_transform_recursive( (is_list_type(stripped_type) and is_list(data)) # Iterable[T] or (is_iterable_type(stripped_type) and is_iterable(data) and not isinstance(data, str)) + # Sequence[T] + or (is_sequence_type(stripped_type) and is_sequence(data) and not isinstance(data, str)) ): # dicts are technically iterable, but it is an iterable on the keys of the dict and is not usually # intended as an iterable, so we don't transform it. diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py index 38b84a5fb..12de4d42a 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Optional +from typing import Dict, Optional import httpx @@ -22,7 +22,7 @@ benchmark_definitions_params, benchmark_list_public_params, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -73,9 +73,9 @@ def create( attribution: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, - required_secret_names: List[str] | NotGiven = NOT_GIVEN, - scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, + required_environment_variables: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + required_secret_names: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + scenario_ids: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -180,9 +180,9 @@ def update( attribution: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, - required_secret_names: List[str] | NotGiven = NOT_GIVEN, - scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, + required_environment_variables: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + required_secret_names: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + scenario_ids: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -481,9 +481,9 @@ async def create( attribution: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, - required_secret_names: List[str] | NotGiven = NOT_GIVEN, - scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, + required_environment_variables: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + required_secret_names: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + scenario_ids: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -588,9 +588,9 @@ async def update( attribution: Optional[str] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, - required_secret_names: List[str] | NotGiven = NOT_GIVEN, - scenario_ids: Optional[List[str]] | NotGiven = NOT_GIVEN, + required_environment_variables: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + required_secret_names: SequenceNotStr[str] | NotGiven = NOT_GIVEN, + scenario_ids: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index 52938a10b..5b50d7688 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Iterable, Optional +from typing import Dict, Iterable, Optional import httpx @@ -12,7 +12,7 @@ blueprint_preview_params, blueprint_list_public_params, ) -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -64,7 +64,7 @@ def create( launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, services: Optional[Iterable[blueprint_create_params.Service]] | NotGiven = NOT_GIVEN, - system_setup_commands: Optional[List[str]] | NotGiven = NOT_GIVEN, + system_setup_commands: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -357,7 +357,7 @@ def preview( launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, services: Optional[Iterable[blueprint_preview_params.Service]] | NotGiven = NOT_GIVEN, - system_setup_commands: Optional[List[str]] | NotGiven = NOT_GIVEN, + system_setup_commands: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -461,7 +461,7 @@ async def create( launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, services: Optional[Iterable[blueprint_create_params.Service]] | NotGiven = NOT_GIVEN, - system_setup_commands: Optional[List[str]] | NotGiven = NOT_GIVEN, + system_setup_commands: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -754,7 +754,7 @@ async def preview( launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, services: Optional[Iterable[blueprint_preview_params.Service]] | NotGiven = NOT_GIVEN, - system_setup_commands: Optional[List[str]] | NotGiven = NOT_GIVEN, + system_setup_commands: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index 262023ebc..5ee3c70b5 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Optional +from typing import Dict, Optional from typing_extensions import Literal import httpx @@ -30,7 +30,7 @@ ScorersResourceWithStreamingResponse, AsyncScorersResourceWithStreamingResponse, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -91,8 +91,8 @@ def create( environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, reference_output: Optional[str] | NotGiven = NOT_GIVEN, - required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, - required_secret_names: Optional[List[str]] | NotGiven = NOT_GIVEN, + required_environment_variables: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + required_secret_names: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -208,8 +208,8 @@ def update( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, reference_output: Optional[str] | NotGiven = NOT_GIVEN, - required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, - required_secret_names: Optional[List[str]] | NotGiven = NOT_GIVEN, + required_environment_variables: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + required_secret_names: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, scoring_contract: Optional[ScoringContractUpdateParam] | NotGiven = NOT_GIVEN, validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -490,8 +490,8 @@ async def create( environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, reference_output: Optional[str] | NotGiven = NOT_GIVEN, - required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, - required_secret_names: Optional[List[str]] | NotGiven = NOT_GIVEN, + required_environment_variables: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + required_secret_names: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -607,8 +607,8 @@ async def update( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, reference_output: Optional[str] | NotGiven = NOT_GIVEN, - required_environment_variables: Optional[List[str]] | NotGiven = NOT_GIVEN, - required_secret_names: Optional[List[str]] | NotGiven = NOT_GIVEN, + required_environment_variables: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + required_secret_names: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, scoring_contract: Optional[ScoringContractUpdateParam] | NotGiven = NOT_GIVEN, validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/runloop_api_client/types/benchmark_create_params.py b/src/runloop_api_client/types/benchmark_create_params.py index c43d5a98c..1aec35f5f 100644 --- a/src/runloop_api_client/types/benchmark_create_params.py +++ b/src/runloop_api_client/types/benchmark_create_params.py @@ -2,9 +2,11 @@ from __future__ import annotations -from typing import Dict, List, Optional +from typing import Dict, Optional from typing_extensions import Required, TypedDict +from .._types import SequenceNotStr + __all__ = ["BenchmarkCreateParams"] @@ -21,18 +23,18 @@ class BenchmarkCreateParams(TypedDict, total=False): metadata: Optional[Dict[str, str]] """User defined metadata to attach to the benchmark for organization.""" - required_environment_variables: Optional[List[str]] + required_environment_variables: Optional[SequenceNotStr[str]] """Environment variables required to run the benchmark. If any required variables are not supplied, the benchmark will fail to start """ - required_secret_names: List[str] + required_secret_names: SequenceNotStr[str] """ Secrets required to run the benchmark with (environment variable name will be mapped to the your user secret by name). If any of these secrets are not provided or the mapping is incorrect, the benchmark will fail to start. """ - scenario_ids: Optional[List[str]] + scenario_ids: Optional[SequenceNotStr[str]] """The Scenario IDs that make up the Benchmark.""" diff --git a/src/runloop_api_client/types/benchmark_update_params.py b/src/runloop_api_client/types/benchmark_update_params.py index ef26cd42f..1291e3e38 100644 --- a/src/runloop_api_client/types/benchmark_update_params.py +++ b/src/runloop_api_client/types/benchmark_update_params.py @@ -2,9 +2,11 @@ from __future__ import annotations -from typing import Dict, List, Optional +from typing import Dict, Optional from typing_extensions import Required, TypedDict +from .._types import SequenceNotStr + __all__ = ["BenchmarkUpdateParams"] @@ -21,18 +23,18 @@ class BenchmarkUpdateParams(TypedDict, total=False): metadata: Optional[Dict[str, str]] """User defined metadata to attach to the benchmark for organization.""" - required_environment_variables: Optional[List[str]] + required_environment_variables: Optional[SequenceNotStr[str]] """Environment variables required to run the benchmark. If any required variables are not supplied, the benchmark will fail to start """ - required_secret_names: List[str] + required_secret_names: SequenceNotStr[str] """ Secrets required to run the benchmark with (environment variable name will be mapped to the your user secret by name). If any of these secrets are not provided or the mapping is incorrect, the benchmark will fail to start. """ - scenario_ids: Optional[List[str]] + scenario_ids: Optional[SequenceNotStr[str]] """The Scenario IDs that make up the Benchmark.""" diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index 5931a8ce4..fb3e2ee49 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import Dict, List, Iterable, Optional +from typing import Dict, Iterable, Optional from typing_extensions import Required, TypedDict +from .._types import SequenceNotStr from .shared_params.launch_parameters import LaunchParameters from .shared_params.code_mount_parameters import CodeMountParameters @@ -43,7 +44,7 @@ class BlueprintCreateParams(TypedDict, total=False): performance. """ - system_setup_commands: Optional[List[str]] + system_setup_commands: Optional[SequenceNotStr[str]] """A list of commands to run to set up your system.""" @@ -71,7 +72,7 @@ class Service(TypedDict, total=False): options: Optional[str] """Additional Docker container create options.""" - port_mappings: Optional[List[str]] + port_mappings: Optional[SequenceNotStr[str]] """The port mappings of the container service. Port mappings are in the format of :. diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index 41c0d9e63..eb3ba757b 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import Dict, List, Iterable, Optional +from typing import Dict, Iterable, Optional from typing_extensions import Required, TypedDict +from .._types import SequenceNotStr from .shared_params.launch_parameters import LaunchParameters from .shared_params.code_mount_parameters import CodeMountParameters @@ -43,7 +44,7 @@ class BlueprintPreviewParams(TypedDict, total=False): performance. """ - system_setup_commands: Optional[List[str]] + system_setup_commands: Optional[SequenceNotStr[str]] """A list of commands to run to set up your system.""" @@ -71,7 +72,7 @@ class Service(TypedDict, total=False): options: Optional[str] """Additional Docker container create options.""" - port_mappings: Optional[List[str]] + port_mappings: Optional[SequenceNotStr[str]] """The port mappings of the container service. Port mappings are in the format of :. diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py index 118601394..94238f551 100644 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ b/src/runloop_api_client/types/devboxes/code_action_context_param.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import Dict, List, Union, Iterable +from typing import Dict, Union, Iterable from typing_extensions import Required, Annotated, TypeAlias, TypedDict +from ..._types import SequenceNotStr from ..._utils import PropertyInfo from .code_action_kind import CodeActionKind from .diagnostic_param import DiagnosticParam @@ -23,7 +24,7 @@ class CodeActionContextParamTyped(TypedDict, total=False): resource. The primary parameter to compute code actions is the provided range. """ - only: List[CodeActionKind] + only: SequenceNotStr[CodeActionKind] """Requested kind of actions to return. Actions not of this kind are filtered out by the client before being shown. So diff --git a/src/runloop_api_client/types/scenario_create_params.py b/src/runloop_api_client/types/scenario_create_params.py index 294c1645d..b8f6910e0 100644 --- a/src/runloop_api_client/types/scenario_create_params.py +++ b/src/runloop_api_client/types/scenario_create_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import Dict, List, Optional +from typing import Dict, Optional from typing_extensions import Literal, Required, TypedDict +from .._types import SequenceNotStr from .input_context_param import InputContextParam from .scoring_contract_param import ScoringContractParam from .scenario_environment_param import ScenarioEnvironmentParam @@ -35,13 +36,13 @@ class ScenarioCreateParams(TypedDict, total=False): apply to the environment. """ - required_environment_variables: Optional[List[str]] + required_environment_variables: Optional[SequenceNotStr[str]] """Environment variables required to run the scenario. If these variables are not provided, the scenario will fail to start. """ - required_secret_names: Optional[List[str]] + required_secret_names: Optional[SequenceNotStr[str]] """ Secrets required to run the scenario (user secret name to scenario required secret name). If these secrets are not provided or the mapping is incorrect, the diff --git a/src/runloop_api_client/types/scenario_update_params.py b/src/runloop_api_client/types/scenario_update_params.py index d92641215..4dcb6ee5c 100644 --- a/src/runloop_api_client/types/scenario_update_params.py +++ b/src/runloop_api_client/types/scenario_update_params.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import Dict, List, Optional +from typing import Dict, Optional from typing_extensions import Literal, TypedDict +from .._types import SequenceNotStr from .input_context_update_param import InputContextUpdateParam from .scenario_environment_param import ScenarioEnvironmentParam from .scoring_contract_update_param import ScoringContractUpdateParam @@ -32,10 +33,10 @@ class ScenarioUpdateParams(TypedDict, total=False): apply to the environment. """ - required_environment_variables: Optional[List[str]] + required_environment_variables: Optional[SequenceNotStr[str]] """Environment variables required to run the scenario.""" - required_secret_names: Optional[List[str]] + required_secret_names: Optional[SequenceNotStr[str]] """Secrets required to run the scenario.""" scoring_contract: Optional[ScoringContractUpdateParam] diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index 000d52c11..4fd9ef5a6 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import List, Iterable, Optional +from typing import Iterable, Optional from typing_extensions import Literal, Required, TypedDict +from ..._types import SequenceNotStr from .after_idle import AfterIdle __all__ = ["LaunchParameters", "UserParameters"] @@ -59,10 +60,10 @@ class LaunchParameters(TypedDict, total=False): Default is 1 hour. """ - launch_commands: Optional[List[str]] + launch_commands: Optional[SequenceNotStr[str]] """Set of commands to be run at launch time, before the entrypoint process is run.""" - required_services: Optional[List[str]] + required_services: Optional[SequenceNotStr[str]] """A list of ContainerizedService names to be started when a Devbox is created. A valid ContainerizedService must be specified in Blueprint to be started. From c4ea7e921ccce43e1a0c00e53dc9f66f0c1c57ed Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 02:00:35 +0000 Subject: [PATCH 845/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 6225bdc74..3f9351b29 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 100 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2027ff4b25ad2b5574b2ce497f5d0d02ad8804816ffd6b4e36511e2fa955d0cf.yml openapi_spec_hash: 54a5a26e9c0b179d2f2a532268d3d711 -config_hash: b97411af91b8ec0b8b066358c29091b4 +config_hash: ca2bcf0cc299c9d5cba1b16fb49a0d25 From 3403641e0e728a6c406ea948b35f9794e93605c2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 02:59:24 +0000 Subject: [PATCH 846/993] feat: improve future compat with pydantic v3 --- src/runloop_api_client/_base_client.py | 6 +- src/runloop_api_client/_compat.py | 96 ++++++------- src/runloop_api_client/_models.py | 80 +++++------ src/runloop_api_client/_utils/__init__.py | 10 +- src/runloop_api_client/_utils/_compat.py | 45 ++++++ .../_utils/_datetime_parse.py | 136 ++++++++++++++++++ src/runloop_api_client/_utils/_transform.py | 6 +- src/runloop_api_client/_utils/_typing.py | 2 +- src/runloop_api_client/_utils/_utils.py | 1 - src/runloop_api_client/types/__init__.py | 8 +- tests/test_models.py | 48 +++---- tests/test_transform.py | 16 +-- tests/test_utils/test_datetime_parse.py | 110 ++++++++++++++ tests/utils.py | 8 +- 14 files changed, 436 insertions(+), 136 deletions(-) create mode 100644 src/runloop_api_client/_utils/_compat.py create mode 100644 src/runloop_api_client/_utils/_datetime_parse.py create mode 100644 tests/test_utils/test_datetime_parse.py diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index 4090e2164..5233ec37d 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -59,7 +59,7 @@ ModelBuilderProtocol, ) from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping -from ._compat import PYDANTIC_V2, model_copy, model_dump +from ._compat import PYDANTIC_V1, model_copy, model_dump from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type from ._response import ( APIResponse, @@ -232,7 +232,7 @@ def _set_private_attributes( model: Type[_T], options: FinalRequestOptions, ) -> None: - if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None: + if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None: self.__pydantic_private__ = {} self._model = model @@ -320,7 +320,7 @@ def _set_private_attributes( client: AsyncAPIClient, options: FinalRequestOptions, ) -> None: - if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None: + if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None: self.__pydantic_private__ = {} self._model = model diff --git a/src/runloop_api_client/_compat.py b/src/runloop_api_client/_compat.py index 92d9ee61e..bdef67f04 100644 --- a/src/runloop_api_client/_compat.py +++ b/src/runloop_api_client/_compat.py @@ -12,14 +12,13 @@ _T = TypeVar("_T") _ModelT = TypeVar("_ModelT", bound=pydantic.BaseModel) -# --------------- Pydantic v2 compatibility --------------- +# --------------- Pydantic v2, v3 compatibility --------------- # Pyright incorrectly reports some of our functions as overriding a method when they don't # pyright: reportIncompatibleMethodOverride=false -PYDANTIC_V2 = pydantic.VERSION.startswith("2.") +PYDANTIC_V1 = pydantic.VERSION.startswith("1.") -# v1 re-exports if TYPE_CHECKING: def parse_date(value: date | StrBytesIntFloat) -> date: # noqa: ARG001 @@ -44,90 +43,92 @@ def is_typeddict(type_: type[Any]) -> bool: # noqa: ARG001 ... else: - if PYDANTIC_V2: - from pydantic.v1.typing import ( + # v1 re-exports + if PYDANTIC_V1: + from pydantic.typing import ( get_args as get_args, is_union as is_union, get_origin as get_origin, is_typeddict as is_typeddict, is_literal_type as is_literal_type, ) - from pydantic.v1.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime + from pydantic.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime else: - from pydantic.typing import ( + from ._utils import ( get_args as get_args, is_union as is_union, get_origin as get_origin, + parse_date as parse_date, is_typeddict as is_typeddict, + parse_datetime as parse_datetime, is_literal_type as is_literal_type, ) - from pydantic.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime # refactored config if TYPE_CHECKING: from pydantic import ConfigDict as ConfigDict else: - if PYDANTIC_V2: - from pydantic import ConfigDict - else: + if PYDANTIC_V1: # TODO: provide an error message here? ConfigDict = None + else: + from pydantic import ConfigDict as ConfigDict # renamed methods / properties def parse_obj(model: type[_ModelT], value: object) -> _ModelT: - if PYDANTIC_V2: - return model.model_validate(value) - else: + if PYDANTIC_V1: return cast(_ModelT, model.parse_obj(value)) # pyright: ignore[reportDeprecated, reportUnnecessaryCast] + else: + return model.model_validate(value) def field_is_required(field: FieldInfo) -> bool: - if PYDANTIC_V2: - return field.is_required() - return field.required # type: ignore + if PYDANTIC_V1: + return field.required # type: ignore + return field.is_required() def field_get_default(field: FieldInfo) -> Any: value = field.get_default() - if PYDANTIC_V2: - from pydantic_core import PydanticUndefined - - if value == PydanticUndefined: - return None + if PYDANTIC_V1: return value + from pydantic_core import PydanticUndefined + + if value == PydanticUndefined: + return None return value def field_outer_type(field: FieldInfo) -> Any: - if PYDANTIC_V2: - return field.annotation - return field.outer_type_ # type: ignore + if PYDANTIC_V1: + return field.outer_type_ # type: ignore + return field.annotation def get_model_config(model: type[pydantic.BaseModel]) -> Any: - if PYDANTIC_V2: - return model.model_config - return model.__config__ # type: ignore + if PYDANTIC_V1: + return model.__config__ # type: ignore + return model.model_config def get_model_fields(model: type[pydantic.BaseModel]) -> dict[str, FieldInfo]: - if PYDANTIC_V2: - return model.model_fields - return model.__fields__ # type: ignore + if PYDANTIC_V1: + return model.__fields__ # type: ignore + return model.model_fields def model_copy(model: _ModelT, *, deep: bool = False) -> _ModelT: - if PYDANTIC_V2: - return model.model_copy(deep=deep) - return model.copy(deep=deep) # type: ignore + if PYDANTIC_V1: + return model.copy(deep=deep) # type: ignore + return model.model_copy(deep=deep) def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str: - if PYDANTIC_V2: - return model.model_dump_json(indent=indent) - return model.json(indent=indent) # type: ignore + if PYDANTIC_V1: + return model.json(indent=indent) # type: ignore + return model.model_dump_json(indent=indent) def model_dump( @@ -139,14 +140,14 @@ def model_dump( warnings: bool = True, mode: Literal["json", "python"] = "python", ) -> dict[str, Any]: - if PYDANTIC_V2 or hasattr(model, "model_dump"): + if (not PYDANTIC_V1) or hasattr(model, "model_dump"): return model.model_dump( mode=mode, exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, # warnings are not supported in Pydantic v1 - warnings=warnings if PYDANTIC_V2 else True, + warnings=True if PYDANTIC_V1 else warnings, ) return cast( "dict[str, Any]", @@ -159,9 +160,9 @@ def model_dump( def model_parse(model: type[_ModelT], data: Any) -> _ModelT: - if PYDANTIC_V2: - return model.model_validate(data) - return model.parse_obj(data) # pyright: ignore[reportDeprecated] + if PYDANTIC_V1: + return model.parse_obj(data) # pyright: ignore[reportDeprecated] + return model.model_validate(data) # generic models @@ -170,17 +171,16 @@ def model_parse(model: type[_ModelT], data: Any) -> _ModelT: class GenericModel(pydantic.BaseModel): ... else: - if PYDANTIC_V2: + if PYDANTIC_V1: + import pydantic.generics + + class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel): ... + else: # there no longer needs to be a distinction in v2 but # we still have to create our own subclass to avoid # inconsistent MRO ordering errors class GenericModel(pydantic.BaseModel): ... - else: - import pydantic.generics - - class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel): ... - # cached properties if TYPE_CHECKING: diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index 92f7c10bc..3a6017ef2 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -50,7 +50,7 @@ strip_annotated_type, ) from ._compat import ( - PYDANTIC_V2, + PYDANTIC_V1, ConfigDict, GenericModel as BaseGenericModel, get_args, @@ -81,11 +81,7 @@ class _ConfigProtocol(Protocol): class BaseModel(pydantic.BaseModel): - if PYDANTIC_V2: - model_config: ClassVar[ConfigDict] = ConfigDict( - extra="allow", defer_build=coerce_boolean(os.environ.get("DEFER_PYDANTIC_BUILD", "true")) - ) - else: + if PYDANTIC_V1: @property @override @@ -95,6 +91,10 @@ def model_fields_set(self) -> set[str]: class Config(pydantic.BaseConfig): # pyright: ignore[reportDeprecated] extra: Any = pydantic.Extra.allow # type: ignore + else: + model_config: ClassVar[ConfigDict] = ConfigDict( + extra="allow", defer_build=coerce_boolean(os.environ.get("DEFER_PYDANTIC_BUILD", "true")) + ) def to_dict( self, @@ -215,25 +215,25 @@ def construct( # pyright: ignore[reportIncompatibleMethodOverride] if key not in model_fields: parsed = construct_type(value=value, type_=extra_field_type) if extra_field_type is not None else value - if PYDANTIC_V2: - _extra[key] = parsed - else: + if PYDANTIC_V1: _fields_set.add(key) fields_values[key] = parsed + else: + _extra[key] = parsed object.__setattr__(m, "__dict__", fields_values) - if PYDANTIC_V2: - # these properties are copied from Pydantic's `model_construct()` method - object.__setattr__(m, "__pydantic_private__", None) - object.__setattr__(m, "__pydantic_extra__", _extra) - object.__setattr__(m, "__pydantic_fields_set__", _fields_set) - else: + if PYDANTIC_V1: # init_private_attributes() does not exist in v2 m._init_private_attributes() # type: ignore # copied from Pydantic v1's `construct()` method object.__setattr__(m, "__fields_set__", _fields_set) + else: + # these properties are copied from Pydantic's `model_construct()` method + object.__setattr__(m, "__pydantic_private__", None) + object.__setattr__(m, "__pydantic_extra__", _extra) + object.__setattr__(m, "__pydantic_fields_set__", _fields_set) return m @@ -243,7 +243,7 @@ def construct( # pyright: ignore[reportIncompatibleMethodOverride] # although not in practice model_construct = construct - if not PYDANTIC_V2: + if PYDANTIC_V1: # we define aliases for some of the new pydantic v2 methods so # that we can just document these methods without having to specify # a specific pydantic version as some users may not know which @@ -363,10 +363,10 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object: if value is None: return field_get_default(field) - if PYDANTIC_V2: - type_ = field.annotation - else: + if PYDANTIC_V1: type_ = cast(type, field.outer_type_) # type: ignore + else: + type_ = field.annotation # type: ignore if type_ is None: raise RuntimeError(f"Unexpected field type is None for {key}") @@ -375,7 +375,7 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object: def _get_extra_fields_type(cls: type[pydantic.BaseModel]) -> type | None: - if not PYDANTIC_V2: + if PYDANTIC_V1: # TODO return None @@ -628,30 +628,30 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, for variant in get_args(union): variant = strip_annotated_type(variant) if is_basemodel_type(variant): - if PYDANTIC_V2: - field = _extract_field_schema_pv2(variant, discriminator_field_name) - if not field: + if PYDANTIC_V1: + field_info = cast("dict[str, FieldInfo]", variant.__fields__).get(discriminator_field_name) # pyright: ignore[reportDeprecated, reportUnnecessaryCast] + if not field_info: continue # Note: if one variant defines an alias then they all should - discriminator_alias = field.get("serialization_alias") - - field_schema = field["schema"] + discriminator_alias = field_info.alias - if field_schema["type"] == "literal": - for entry in cast("LiteralSchema", field_schema)["expected"]: + if (annotation := getattr(field_info, "annotation", None)) and is_literal_type(annotation): + for entry in get_args(annotation): if isinstance(entry, str): mapping[entry] = variant else: - field_info = cast("dict[str, FieldInfo]", variant.__fields__).get(discriminator_field_name) # pyright: ignore[reportDeprecated, reportUnnecessaryCast] - if not field_info: + field = _extract_field_schema_pv2(variant, discriminator_field_name) + if not field: continue # Note: if one variant defines an alias then they all should - discriminator_alias = field_info.alias + discriminator_alias = field.get("serialization_alias") - if (annotation := getattr(field_info, "annotation", None)) and is_literal_type(annotation): - for entry in get_args(annotation): + field_schema = field["schema"] + + if field_schema["type"] == "literal": + for entry in cast("LiteralSchema", field_schema)["expected"]: if isinstance(entry, str): mapping[entry] = variant @@ -714,7 +714,7 @@ class GenericModel(BaseGenericModel, BaseModel): pass -if PYDANTIC_V2: +if not PYDANTIC_V1: from pydantic import TypeAdapter as _TypeAdapter _CachedTypeAdapter = cast("TypeAdapter[object]", lru_cache(maxsize=None)(_TypeAdapter)) @@ -782,12 +782,12 @@ class FinalRequestOptions(pydantic.BaseModel): json_data: Union[Body, None] = None extra_json: Union[AnyMapping, None] = None - if PYDANTIC_V2: - model_config: ClassVar[ConfigDict] = ConfigDict(arbitrary_types_allowed=True) - else: + if PYDANTIC_V1: class Config(pydantic.BaseConfig): # pyright: ignore[reportDeprecated] arbitrary_types_allowed: bool = True + else: + model_config: ClassVar[ConfigDict] = ConfigDict(arbitrary_types_allowed=True) def get_max_retries(self, max_retries: int) -> int: if isinstance(self.max_retries, NotGiven): @@ -820,9 +820,9 @@ def construct( # type: ignore key: strip_not_given(value) for key, value in values.items() } - if PYDANTIC_V2: - return super().model_construct(_fields_set, **kwargs) - return cast(FinalRequestOptions, super().construct(_fields_set, **kwargs)) # pyright: ignore[reportDeprecated] + if PYDANTIC_V1: + return cast(FinalRequestOptions, super().construct(_fields_set, **kwargs)) # pyright: ignore[reportDeprecated] + return super().model_construct(_fields_set, **kwargs) if not TYPE_CHECKING: # type checkers incorrectly complain about this assignment diff --git a/src/runloop_api_client/_utils/__init__.py b/src/runloop_api_client/_utils/__init__.py index ca547ce52..dc64e29a1 100644 --- a/src/runloop_api_client/_utils/__init__.py +++ b/src/runloop_api_client/_utils/__init__.py @@ -10,7 +10,6 @@ lru_cache as lru_cache, is_mapping as is_mapping, is_tuple_t as is_tuple_t, - parse_date as parse_date, is_iterable as is_iterable, is_sequence as is_sequence, coerce_float as coerce_float, @@ -23,7 +22,6 @@ coerce_boolean as coerce_boolean, coerce_integer as coerce_integer, file_from_path as file_from_path, - parse_datetime as parse_datetime, strip_not_given as strip_not_given, deepcopy_minimal as deepcopy_minimal, get_async_library as get_async_library, @@ -32,6 +30,13 @@ maybe_coerce_boolean as maybe_coerce_boolean, maybe_coerce_integer as maybe_coerce_integer, ) +from ._compat import ( + get_args as get_args, + is_union as is_union, + get_origin as get_origin, + is_typeddict as is_typeddict, + is_literal_type as is_literal_type, +) from ._typing import ( is_list_type as is_list_type, is_union_type as is_union_type, @@ -56,3 +61,4 @@ function_has_argument as function_has_argument, assert_signatures_in_sync as assert_signatures_in_sync, ) +from ._datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime diff --git a/src/runloop_api_client/_utils/_compat.py b/src/runloop_api_client/_utils/_compat.py new file mode 100644 index 000000000..dd703233c --- /dev/null +++ b/src/runloop_api_client/_utils/_compat.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +import sys +import typing_extensions +from typing import Any, Type, Union, Literal, Optional +from datetime import date, datetime +from typing_extensions import get_args as _get_args, get_origin as _get_origin + +from .._types import StrBytesIntFloat +from ._datetime_parse import parse_date as _parse_date, parse_datetime as _parse_datetime + +_LITERAL_TYPES = {Literal, typing_extensions.Literal} + + +def get_args(tp: type[Any]) -> tuple[Any, ...]: + return _get_args(tp) + + +def get_origin(tp: type[Any]) -> type[Any] | None: + return _get_origin(tp) + + +def is_union(tp: Optional[Type[Any]]) -> bool: + if sys.version_info < (3, 10): + return tp is Union # type: ignore[comparison-overlap] + else: + import types + + return tp is Union or tp is types.UnionType + + +def is_typeddict(tp: Type[Any]) -> bool: + return typing_extensions.is_typeddict(tp) + + +def is_literal_type(tp: Type[Any]) -> bool: + return get_origin(tp) in _LITERAL_TYPES + + +def parse_date(value: Union[date, StrBytesIntFloat]) -> date: + return _parse_date(value) + + +def parse_datetime(value: Union[datetime, StrBytesIntFloat]) -> datetime: + return _parse_datetime(value) diff --git a/src/runloop_api_client/_utils/_datetime_parse.py b/src/runloop_api_client/_utils/_datetime_parse.py new file mode 100644 index 000000000..7cb9d9e66 --- /dev/null +++ b/src/runloop_api_client/_utils/_datetime_parse.py @@ -0,0 +1,136 @@ +""" +This file contains code from https://github.com/pydantic/pydantic/blob/main/pydantic/v1/datetime_parse.py +without the Pydantic v1 specific errors. +""" + +from __future__ import annotations + +import re +from typing import Dict, Union, Optional +from datetime import date, datetime, timezone, timedelta + +from .._types import StrBytesIntFloat + +date_expr = r"(?P\d{4})-(?P\d{1,2})-(?P\d{1,2})" +time_expr = ( + r"(?P\d{1,2}):(?P\d{1,2})" + r"(?::(?P\d{1,2})(?:\.(?P\d{1,6})\d{0,6})?)?" + r"(?PZ|[+-]\d{2}(?::?\d{2})?)?$" +) + +date_re = re.compile(f"{date_expr}$") +datetime_re = re.compile(f"{date_expr}[T ]{time_expr}") + + +EPOCH = datetime(1970, 1, 1) +# if greater than this, the number is in ms, if less than or equal it's in seconds +# (in seconds this is 11th October 2603, in ms it's 20th August 1970) +MS_WATERSHED = int(2e10) +# slightly more than datetime.max in ns - (datetime.max - EPOCH).total_seconds() * 1e9 +MAX_NUMBER = int(3e20) + + +def _get_numeric(value: StrBytesIntFloat, native_expected_type: str) -> Union[None, int, float]: + if isinstance(value, (int, float)): + return value + try: + return float(value) + except ValueError: + return None + except TypeError: + raise TypeError(f"invalid type; expected {native_expected_type}, string, bytes, int or float") from None + + +def _from_unix_seconds(seconds: Union[int, float]) -> datetime: + if seconds > MAX_NUMBER: + return datetime.max + elif seconds < -MAX_NUMBER: + return datetime.min + + while abs(seconds) > MS_WATERSHED: + seconds /= 1000 + dt = EPOCH + timedelta(seconds=seconds) + return dt.replace(tzinfo=timezone.utc) + + +def _parse_timezone(value: Optional[str]) -> Union[None, int, timezone]: + if value == "Z": + return timezone.utc + elif value is not None: + offset_mins = int(value[-2:]) if len(value) > 3 else 0 + offset = 60 * int(value[1:3]) + offset_mins + if value[0] == "-": + offset = -offset + return timezone(timedelta(minutes=offset)) + else: + return None + + +def parse_datetime(value: Union[datetime, StrBytesIntFloat]) -> datetime: + """ + Parse a datetime/int/float/string and return a datetime.datetime. + + This function supports time zone offsets. When the input contains one, + the output uses a timezone with a fixed offset from UTC. + + Raise ValueError if the input is well formatted but not a valid datetime. + Raise ValueError if the input isn't well formatted. + """ + if isinstance(value, datetime): + return value + + number = _get_numeric(value, "datetime") + if number is not None: + return _from_unix_seconds(number) + + if isinstance(value, bytes): + value = value.decode() + + assert not isinstance(value, (float, int)) + + match = datetime_re.match(value) + if match is None: + raise ValueError("invalid datetime format") + + kw = match.groupdict() + if kw["microsecond"]: + kw["microsecond"] = kw["microsecond"].ljust(6, "0") + + tzinfo = _parse_timezone(kw.pop("tzinfo")) + kw_: Dict[str, Union[None, int, timezone]] = {k: int(v) for k, v in kw.items() if v is not None} + kw_["tzinfo"] = tzinfo + + return datetime(**kw_) # type: ignore + + +def parse_date(value: Union[date, StrBytesIntFloat]) -> date: + """ + Parse a date/int/float/string and return a datetime.date. + + Raise ValueError if the input is well formatted but not a valid date. + Raise ValueError if the input isn't well formatted. + """ + if isinstance(value, date): + if isinstance(value, datetime): + return value.date() + else: + return value + + number = _get_numeric(value, "date") + if number is not None: + return _from_unix_seconds(number).date() + + if isinstance(value, bytes): + value = value.decode() + + assert not isinstance(value, (float, int)) + match = date_re.match(value) + if match is None: + raise ValueError("invalid date format") + + kw = {k: int(v) for k, v in match.groupdict().items()} + + try: + return date(**kw) + except ValueError: + raise ValueError("invalid date format") from None diff --git a/src/runloop_api_client/_utils/_transform.py b/src/runloop_api_client/_utils/_transform.py index f0bcefd49..c19124f0d 100644 --- a/src/runloop_api_client/_utils/_transform.py +++ b/src/runloop_api_client/_utils/_transform.py @@ -19,6 +19,7 @@ is_sequence, ) from .._files import is_base64_file_input +from ._compat import get_origin, is_typeddict from ._typing import ( is_list_type, is_union_type, @@ -29,7 +30,6 @@ is_annotated_type, strip_annotated_type, ) -from .._compat import get_origin, model_dump, is_typeddict _T = TypeVar("_T") @@ -169,6 +169,8 @@ def _transform_recursive( Defaults to the same value as the `annotation` argument. """ + from .._compat import model_dump + if inner_type is None: inner_type = annotation @@ -333,6 +335,8 @@ async def _async_transform_recursive( Defaults to the same value as the `annotation` argument. """ + from .._compat import model_dump + if inner_type is None: inner_type = annotation diff --git a/src/runloop_api_client/_utils/_typing.py b/src/runloop_api_client/_utils/_typing.py index 845cd6b28..193109f3a 100644 --- a/src/runloop_api_client/_utils/_typing.py +++ b/src/runloop_api_client/_utils/_typing.py @@ -15,7 +15,7 @@ from ._utils import lru_cache from .._types import InheritsGeneric -from .._compat import is_union as _is_union +from ._compat import is_union as _is_union def is_annotated_type(typ: type) -> bool: diff --git a/src/runloop_api_client/_utils/_utils.py b/src/runloop_api_client/_utils/_utils.py index ea3cf3f2c..f0818595d 100644 --- a/src/runloop_api_client/_utils/_utils.py +++ b/src/runloop_api_client/_utils/_utils.py @@ -22,7 +22,6 @@ import sniffio from .._types import NotGiven, FileTypes, NotGivenOr, HeadersLike -from .._compat import parse_date as parse_date, parse_datetime as parse_datetime _T = TypeVar("_T") _TupleT = TypeVar("_TupleT", bound=Tuple[object, ...]) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 31f7c8ca5..e57d0b026 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -98,9 +98,9 @@ # This ensures that, when building the deferred (due to cyclical references) model schema, # Pydantic can resolve the necessary references. # See: https://github.com/pydantic/pydantic/issues/11250 for more context. -if _compat.PYDANTIC_V2: - devboxes.code_segment_info_response.CodeSegmentInfoResponse.model_rebuild(_parent_namespace_depth=0) - devboxes.document_symbol.DocumentSymbol.model_rebuild(_parent_namespace_depth=0) -else: +if _compat.PYDANTIC_V1: devboxes.code_segment_info_response.CodeSegmentInfoResponse.update_forward_refs() # type: ignore devboxes.document_symbol.DocumentSymbol.update_forward_refs() # type: ignore +else: + devboxes.code_segment_info_response.CodeSegmentInfoResponse.model_rebuild(_parent_namespace_depth=0) + devboxes.document_symbol.DocumentSymbol.model_rebuild(_parent_namespace_depth=0) diff --git a/tests/test_models.py b/tests/test_models.py index b11d9b63d..87683d2ad 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -8,7 +8,7 @@ from pydantic import Field from runloop_api_client._utils import PropertyInfo -from runloop_api_client._compat import PYDANTIC_V2, parse_obj, model_dump, model_json +from runloop_api_client._compat import PYDANTIC_V1, parse_obj, model_dump, model_json from runloop_api_client._models import BaseModel, construct_type @@ -294,12 +294,12 @@ class Model(BaseModel): assert cast(bool, m.foo) is True m = Model.construct(foo={"name": 3}) - if PYDANTIC_V2: - assert isinstance(m.foo, Submodel1) - assert m.foo.name == 3 # type: ignore - else: + if PYDANTIC_V1: assert isinstance(m.foo, Submodel2) assert m.foo.name == "3" + else: + assert isinstance(m.foo, Submodel1) + assert m.foo.name == 3 # type: ignore def test_list_of_unions() -> None: @@ -426,10 +426,10 @@ class Model(BaseModel): expected = datetime(2019, 12, 27, 18, 11, 19, 117000, tzinfo=timezone.utc) - if PYDANTIC_V2: - expected_json = '{"created_at":"2019-12-27T18:11:19.117000Z"}' - else: + if PYDANTIC_V1: expected_json = '{"created_at": "2019-12-27T18:11:19.117000+00:00"}' + else: + expected_json = '{"created_at":"2019-12-27T18:11:19.117000Z"}' model = Model.construct(created_at="2019-12-27T18:11:19.117Z") assert model.created_at == expected @@ -531,7 +531,7 @@ class Model2(BaseModel): assert m4.to_dict(mode="python") == {"created_at": datetime.fromisoformat(time_str)} assert m4.to_dict(mode="json") == {"created_at": time_str} - if not PYDANTIC_V2: + if PYDANTIC_V1: with pytest.raises(ValueError, match="warnings is only supported in Pydantic v2"): m.to_dict(warnings=False) @@ -556,7 +556,7 @@ class Model(BaseModel): assert m3.model_dump() == {"foo": None} assert m3.model_dump(exclude_none=True) == {} - if not PYDANTIC_V2: + if PYDANTIC_V1: with pytest.raises(ValueError, match="round_trip is only supported in Pydantic v2"): m.model_dump(round_trip=True) @@ -580,10 +580,10 @@ class Model(BaseModel): assert json.loads(m.to_json()) == {"FOO": "hello"} assert json.loads(m.to_json(use_api_names=False)) == {"foo": "hello"} - if PYDANTIC_V2: - assert m.to_json(indent=None) == '{"FOO":"hello"}' - else: + if PYDANTIC_V1: assert m.to_json(indent=None) == '{"FOO": "hello"}' + else: + assert m.to_json(indent=None) == '{"FOO":"hello"}' m2 = Model() assert json.loads(m2.to_json()) == {} @@ -595,7 +595,7 @@ class Model(BaseModel): assert json.loads(m3.to_json()) == {"FOO": None} assert json.loads(m3.to_json(exclude_none=True)) == {} - if not PYDANTIC_V2: + if PYDANTIC_V1: with pytest.raises(ValueError, match="warnings is only supported in Pydantic v2"): m.to_json(warnings=False) @@ -622,7 +622,7 @@ class Model(BaseModel): assert json.loads(m3.model_dump_json()) == {"foo": None} assert json.loads(m3.model_dump_json(exclude_none=True)) == {} - if not PYDANTIC_V2: + if PYDANTIC_V1: with pytest.raises(ValueError, match="round_trip is only supported in Pydantic v2"): m.model_dump_json(round_trip=True) @@ -679,12 +679,12 @@ class B(BaseModel): ) assert isinstance(m, A) assert m.type == "a" - if PYDANTIC_V2: - assert m.data == 100 # type: ignore[comparison-overlap] - else: + if PYDANTIC_V1: # pydantic v1 automatically converts inputs to strings # if the expected type is a str assert m.data == "100" + else: + assert m.data == 100 # type: ignore[comparison-overlap] def test_discriminated_unions_unknown_variant() -> None: @@ -768,12 +768,12 @@ class B(BaseModel): ) assert isinstance(m, A) assert m.foo_type == "a" - if PYDANTIC_V2: - assert m.data == 100 # type: ignore[comparison-overlap] - else: + if PYDANTIC_V1: # pydantic v1 automatically converts inputs to strings # if the expected type is a str assert m.data == "100" + else: + assert m.data == 100 # type: ignore[comparison-overlap] def test_discriminated_unions_overlapping_discriminators_invalid_data() -> None: @@ -833,7 +833,7 @@ class B(BaseModel): assert UnionType.__discriminator__ is discriminator -@pytest.mark.skipif(not PYDANTIC_V2, reason="TypeAliasType is not supported in Pydantic v1") +@pytest.mark.skipif(PYDANTIC_V1, reason="TypeAliasType is not supported in Pydantic v1") def test_type_alias_type() -> None: Alias = TypeAliasType("Alias", str) # pyright: ignore @@ -849,7 +849,7 @@ class Model(BaseModel): assert m.union == "bar" -@pytest.mark.skipif(not PYDANTIC_V2, reason="TypeAliasType is not supported in Pydantic v1") +@pytest.mark.skipif(PYDANTIC_V1, reason="TypeAliasType is not supported in Pydantic v1") def test_field_named_cls() -> None: class Model(BaseModel): cls: str @@ -936,7 +936,7 @@ class Type2(BaseModel): assert isinstance(model.value, InnerType2) -@pytest.mark.skipif(not PYDANTIC_V2, reason="this is only supported in pydantic v2 for now") +@pytest.mark.skipif(PYDANTIC_V1, reason="this is only supported in pydantic v2 for now") def test_extra_properties() -> None: class Item(BaseModel): prop: int diff --git a/tests/test_transform.py b/tests/test_transform.py index bc6003b5f..ad9fa8b24 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -15,7 +15,7 @@ parse_datetime, async_transform as _async_transform, ) -from runloop_api_client._compat import PYDANTIC_V2 +from runloop_api_client._compat import PYDANTIC_V1 from runloop_api_client._models import BaseModel _T = TypeVar("_T") @@ -189,7 +189,7 @@ class DateModel(BaseModel): @pytest.mark.asyncio async def test_iso8601_format(use_async: bool) -> None: dt = datetime.fromisoformat("2023-02-23T14:16:36.337692+00:00") - tz = "Z" if PYDANTIC_V2 else "+00:00" + tz = "+00:00" if PYDANTIC_V1 else "Z" assert await transform({"foo": dt}, DatetimeDict, use_async) == {"foo": "2023-02-23T14:16:36.337692+00:00"} # type: ignore[comparison-overlap] assert await transform(DatetimeModel(foo=dt), Any, use_async) == {"foo": "2023-02-23T14:16:36.337692" + tz} # type: ignore[comparison-overlap] @@ -297,11 +297,11 @@ async def test_pydantic_unknown_field(use_async: bool) -> None: @pytest.mark.asyncio async def test_pydantic_mismatched_types(use_async: bool) -> None: model = MyModel.construct(foo=True) - if PYDANTIC_V2: + if PYDANTIC_V1: + params = await transform(model, Any, use_async) + else: with pytest.warns(UserWarning): params = await transform(model, Any, use_async) - else: - params = await transform(model, Any, use_async) assert cast(Any, params) == {"foo": True} @@ -309,11 +309,11 @@ async def test_pydantic_mismatched_types(use_async: bool) -> None: @pytest.mark.asyncio async def test_pydantic_mismatched_object_type(use_async: bool) -> None: model = MyModel.construct(foo=MyModel.construct(hello="world")) - if PYDANTIC_V2: + if PYDANTIC_V1: + params = await transform(model, Any, use_async) + else: with pytest.warns(UserWarning): params = await transform(model, Any, use_async) - else: - params = await transform(model, Any, use_async) assert cast(Any, params) == {"foo": {"hello": "world"}} diff --git a/tests/test_utils/test_datetime_parse.py b/tests/test_utils/test_datetime_parse.py new file mode 100644 index 000000000..f8eb5c9fe --- /dev/null +++ b/tests/test_utils/test_datetime_parse.py @@ -0,0 +1,110 @@ +""" +Copied from https://github.com/pydantic/pydantic/blob/v1.10.22/tests/test_datetime_parse.py +with modifications so it works without pydantic v1 imports. +""" + +from typing import Type, Union +from datetime import date, datetime, timezone, timedelta + +import pytest + +from runloop_api_client._utils import parse_date, parse_datetime + + +def create_tz(minutes: int) -> timezone: + return timezone(timedelta(minutes=minutes)) + + +@pytest.mark.parametrize( + "value,result", + [ + # Valid inputs + ("1494012444.883309", date(2017, 5, 5)), + (b"1494012444.883309", date(2017, 5, 5)), + (1_494_012_444.883_309, date(2017, 5, 5)), + ("1494012444", date(2017, 5, 5)), + (1_494_012_444, date(2017, 5, 5)), + (0, date(1970, 1, 1)), + ("2012-04-23", date(2012, 4, 23)), + (b"2012-04-23", date(2012, 4, 23)), + ("2012-4-9", date(2012, 4, 9)), + (date(2012, 4, 9), date(2012, 4, 9)), + (datetime(2012, 4, 9, 12, 15), date(2012, 4, 9)), + # Invalid inputs + ("x20120423", ValueError), + ("2012-04-56", ValueError), + (19_999_999_999, date(2603, 10, 11)), # just before watershed + (20_000_000_001, date(1970, 8, 20)), # just after watershed + (1_549_316_052, date(2019, 2, 4)), # nowish in s + (1_549_316_052_104, date(2019, 2, 4)), # nowish in ms + (1_549_316_052_104_324, date(2019, 2, 4)), # nowish in μs + (1_549_316_052_104_324_096, date(2019, 2, 4)), # nowish in ns + ("infinity", date(9999, 12, 31)), + ("inf", date(9999, 12, 31)), + (float("inf"), date(9999, 12, 31)), + ("infinity ", date(9999, 12, 31)), + (int("1" + "0" * 100), date(9999, 12, 31)), + (1e1000, date(9999, 12, 31)), + ("-infinity", date(1, 1, 1)), + ("-inf", date(1, 1, 1)), + ("nan", ValueError), + ], +) +def test_date_parsing(value: Union[str, bytes, int, float], result: Union[date, Type[Exception]]) -> None: + if type(result) == type and issubclass(result, Exception): # pyright: ignore[reportUnnecessaryIsInstance] + with pytest.raises(result): + parse_date(value) + else: + assert parse_date(value) == result + + +@pytest.mark.parametrize( + "value,result", + [ + # Valid inputs + # values in seconds + ("1494012444.883309", datetime(2017, 5, 5, 19, 27, 24, 883_309, tzinfo=timezone.utc)), + (1_494_012_444.883_309, datetime(2017, 5, 5, 19, 27, 24, 883_309, tzinfo=timezone.utc)), + ("1494012444", datetime(2017, 5, 5, 19, 27, 24, tzinfo=timezone.utc)), + (b"1494012444", datetime(2017, 5, 5, 19, 27, 24, tzinfo=timezone.utc)), + (1_494_012_444, datetime(2017, 5, 5, 19, 27, 24, tzinfo=timezone.utc)), + # values in ms + ("1494012444000.883309", datetime(2017, 5, 5, 19, 27, 24, 883, tzinfo=timezone.utc)), + ("-1494012444000.883309", datetime(1922, 8, 29, 4, 32, 35, 999117, tzinfo=timezone.utc)), + (1_494_012_444_000, datetime(2017, 5, 5, 19, 27, 24, tzinfo=timezone.utc)), + ("2012-04-23T09:15:00", datetime(2012, 4, 23, 9, 15)), + ("2012-4-9 4:8:16", datetime(2012, 4, 9, 4, 8, 16)), + ("2012-04-23T09:15:00Z", datetime(2012, 4, 23, 9, 15, 0, 0, timezone.utc)), + ("2012-4-9 4:8:16-0320", datetime(2012, 4, 9, 4, 8, 16, 0, create_tz(-200))), + ("2012-04-23T10:20:30.400+02:30", datetime(2012, 4, 23, 10, 20, 30, 400_000, create_tz(150))), + ("2012-04-23T10:20:30.400+02", datetime(2012, 4, 23, 10, 20, 30, 400_000, create_tz(120))), + ("2012-04-23T10:20:30.400-02", datetime(2012, 4, 23, 10, 20, 30, 400_000, create_tz(-120))), + (b"2012-04-23T10:20:30.400-02", datetime(2012, 4, 23, 10, 20, 30, 400_000, create_tz(-120))), + (datetime(2017, 5, 5), datetime(2017, 5, 5)), + (0, datetime(1970, 1, 1, 0, 0, 0, tzinfo=timezone.utc)), + # Invalid inputs + ("x20120423091500", ValueError), + ("2012-04-56T09:15:90", ValueError), + ("2012-04-23T11:05:00-25:00", ValueError), + (19_999_999_999, datetime(2603, 10, 11, 11, 33, 19, tzinfo=timezone.utc)), # just before watershed + (20_000_000_001, datetime(1970, 8, 20, 11, 33, 20, 1000, tzinfo=timezone.utc)), # just after watershed + (1_549_316_052, datetime(2019, 2, 4, 21, 34, 12, 0, tzinfo=timezone.utc)), # nowish in s + (1_549_316_052_104, datetime(2019, 2, 4, 21, 34, 12, 104_000, tzinfo=timezone.utc)), # nowish in ms + (1_549_316_052_104_324, datetime(2019, 2, 4, 21, 34, 12, 104_324, tzinfo=timezone.utc)), # nowish in μs + (1_549_316_052_104_324_096, datetime(2019, 2, 4, 21, 34, 12, 104_324, tzinfo=timezone.utc)), # nowish in ns + ("infinity", datetime(9999, 12, 31, 23, 59, 59, 999999)), + ("inf", datetime(9999, 12, 31, 23, 59, 59, 999999)), + ("inf ", datetime(9999, 12, 31, 23, 59, 59, 999999)), + (1e50, datetime(9999, 12, 31, 23, 59, 59, 999999)), + (float("inf"), datetime(9999, 12, 31, 23, 59, 59, 999999)), + ("-infinity", datetime(1, 1, 1, 0, 0)), + ("-inf", datetime(1, 1, 1, 0, 0)), + ("nan", ValueError), + ], +) +def test_datetime_parsing(value: Union[str, bytes, int, float], result: Union[datetime, Type[Exception]]) -> None: + if type(result) == type and issubclass(result, Exception): # pyright: ignore[reportUnnecessaryIsInstance] + with pytest.raises(result): + parse_datetime(value) + else: + assert parse_datetime(value) == result diff --git a/tests/utils.py b/tests/utils.py index 44d940e25..606067e05 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -19,7 +19,7 @@ is_annotated_type, is_type_alias_type, ) -from runloop_api_client._compat import PYDANTIC_V2, field_outer_type, get_model_fields +from runloop_api_client._compat import PYDANTIC_V1, field_outer_type, get_model_fields from runloop_api_client._models import BaseModel BaseModelT = TypeVar("BaseModelT", bound=BaseModel) @@ -28,12 +28,12 @@ def assert_matches_model(model: type[BaseModelT], value: BaseModelT, *, path: list[str]) -> bool: for name, field in get_model_fields(model).items(): field_value = getattr(value, name) - if PYDANTIC_V2: - allow_none = False - else: + if PYDANTIC_V1: # in v1 nullability was structured differently # https://docs.pydantic.dev/2.0/migration/#required-optional-and-nullable-fields allow_none = getattr(field, "allow_none", False) + else: + allow_none = False assert_matches_type( field_outer_type(field), From 841cb19ed96f77e5990a7020ef91c7e259f6e2a6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 19:24:34 +0000 Subject: [PATCH 847/993] feat(api): api update --- .stats.yml | 8 +- api.md | 9 +- .../resources/blueprints.py | 28 ++++ .../resources/devboxes/executions.py | 124 ++++++++++++++++- .../types/blueprint_build_parameters.py | 8 ++ .../types/blueprint_create_params.py | 8 ++ .../types/blueprint_preview_params.py | 8 ++ .../types/blueprint_view.py | 5 + src/runloop_api_client/types/devbox_view.py | 2 +- .../types/devboxes/__init__.py | 3 + .../types/devboxes/execution_kill_params.py | 14 ++ .../execution_stream_updates_params.py | 14 ++ .../types/devboxes/execution_update_chunk.py | 40 ++++++ .../api_resources/devboxes/test_executions.py | 130 ++++++++++++++++++ tests/api_resources/test_blueprints.py | 4 + 15 files changed, 396 insertions(+), 9 deletions(-) create mode 100644 src/runloop_api_client/types/devboxes/execution_kill_params.py create mode 100644 src/runloop_api_client/types/devboxes/execution_stream_updates_params.py create mode 100644 src/runloop_api_client/types/devboxes/execution_update_chunk.py diff --git a/.stats.yml b/.stats.yml index 3f9351b29..900ce23a3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 100 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-2027ff4b25ad2b5574b2ce497f5d0d02ad8804816ffd6b4e36511e2fa955d0cf.yml -openapi_spec_hash: 54a5a26e9c0b179d2f2a532268d3d711 -config_hash: ca2bcf0cc299c9d5cba1b16fb49a0d25 +configured_endpoints: 101 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6b4c63a026f224ec02ccd715e063e07107b545bb859218afaac2b3df84cd227a.yml +openapi_spec_hash: 76072cd766a9c45cff8890bb2bb8b1d5 +config_hash: a8ac5e38099129b07ae4decb0774719d diff --git a/api.md b/api.md index 8116fd462..b08ff9fca 100644 --- a/api.md +++ b/api.md @@ -251,12 +251,19 @@ Methods: ## Executions +Types: + +```python +from runloop_api_client.types.devboxes import ExecutionUpdateChunk +``` + Methods: - client.devboxes.executions.retrieve(execution_id, \*, devbox_id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.execute_sync(id, \*\*params) -> DevboxExecutionDetailView -- client.devboxes.executions.kill(execution_id, \*, devbox_id) -> DevboxAsyncExecutionDetailView +- client.devboxes.executions.kill(execution_id, \*, devbox_id, \*\*params) -> DevboxAsyncExecutionDetailView +- client.devboxes.executions.stream_updates(execution_id, \*, devbox_id, \*\*params) -> DevboxAsyncExecutionDetailView # Scenarios diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index 5b50d7688..0fe1679a8 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -58,6 +58,7 @@ def create( *, name: str, base_blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, + base_blueprint_name: Optional[str] | NotGiven = NOT_GIVEN, code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, dockerfile: Optional[str] | NotGiven = NOT_GIVEN, file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, @@ -86,6 +87,11 @@ def create( base_blueprint_id: (Optional) ID of previously built blueprint to use as a base blueprint for this build. + base_blueprint_name: (Optional) Name of previously built blueprint to use as a base blueprint for + this build. When set, this will load the latest successfully built Blueprint + with the given name. Only one of (base_blueprint_id, base_blueprint_name) should + be specified. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -118,6 +124,7 @@ def create( { "name": name, "base_blueprint_id": base_blueprint_id, + "base_blueprint_name": base_blueprint_name, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, @@ -351,6 +358,7 @@ def preview( *, name: str, base_blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, + base_blueprint_name: Optional[str] | NotGiven = NOT_GIVEN, code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, dockerfile: Optional[str] | NotGiven = NOT_GIVEN, file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, @@ -377,6 +385,11 @@ def preview( base_blueprint_id: (Optional) ID of previously built blueprint to use as a base blueprint for this build. + base_blueprint_name: (Optional) Name of previously built blueprint to use as a base blueprint for + this build. When set, this will load the latest successfully built Blueprint + with the given name. Only one of (base_blueprint_id, base_blueprint_name) should + be specified. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -409,6 +422,7 @@ def preview( { "name": name, "base_blueprint_id": base_blueprint_id, + "base_blueprint_name": base_blueprint_name, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, @@ -455,6 +469,7 @@ async def create( *, name: str, base_blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, + base_blueprint_name: Optional[str] | NotGiven = NOT_GIVEN, code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, dockerfile: Optional[str] | NotGiven = NOT_GIVEN, file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, @@ -483,6 +498,11 @@ async def create( base_blueprint_id: (Optional) ID of previously built blueprint to use as a base blueprint for this build. + base_blueprint_name: (Optional) Name of previously built blueprint to use as a base blueprint for + this build. When set, this will load the latest successfully built Blueprint + with the given name. Only one of (base_blueprint_id, base_blueprint_name) should + be specified. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -515,6 +535,7 @@ async def create( { "name": name, "base_blueprint_id": base_blueprint_id, + "base_blueprint_name": base_blueprint_name, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, @@ -748,6 +769,7 @@ async def preview( *, name: str, base_blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, + base_blueprint_name: Optional[str] | NotGiven = NOT_GIVEN, code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, dockerfile: Optional[str] | NotGiven = NOT_GIVEN, file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, @@ -774,6 +796,11 @@ async def preview( base_blueprint_id: (Optional) ID of previously built blueprint to use as a base blueprint for this build. + base_blueprint_name: (Optional) Name of previously built blueprint to use as a base blueprint for + this build. When set, this will load the latest successfully built Blueprint + with the given name. Only one of (base_blueprint_id, base_blueprint_name) should + be specified. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -806,6 +833,7 @@ async def preview( { "name": name, "base_blueprint_id": base_blueprint_id, + "base_blueprint_name": base_blueprint_name, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index 864aa7937..38243cfb2 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -17,9 +17,17 @@ async_to_streamed_response_wrapper, ) from ..._constants import DEFAULT_TIMEOUT +from ..._streaming import Stream, AsyncStream from ..._base_client import make_request_options -from ...types.devboxes import execution_retrieve_params, execution_execute_sync_params, execution_execute_async_params +from ...types.devboxes import ( + execution_kill_params, + execution_retrieve_params, + execution_execute_sync_params, + execution_execute_async_params, + execution_stream_updates_params, +) from ...types.devbox_execution_detail_view import DevboxExecutionDetailView +from ...types.devboxes.execution_update_chunk import ExecutionUpdateChunk from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView __all__ = ["ExecutionsResource", "AsyncExecutionsResource"] @@ -214,6 +222,7 @@ def kill( execution_id: str, *, devbox_id: str, + kill_process_group: Optional[bool] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -224,7 +233,7 @@ def kill( ) -> DevboxAsyncExecutionDetailView: """ Kill a previously launched asynchronous execution if it is still running by - killing the launched process. + killing the launched process. Optionally kill the entire process group. Args: extra_headers: Send extra headers @@ -243,6 +252,7 @@ def kill( raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") return self._post( f"/v1/devboxes/{devbox_id}/executions/{execution_id}/kill", + body=maybe_transform({"kill_process_group": kill_process_group}, execution_kill_params.ExecutionKillParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -253,6 +263,51 @@ def kill( cast_to=DevboxAsyncExecutionDetailView, ) + def stream_updates( + self, + execution_id: str, + *, + devbox_id: str, + offset: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Stream[ExecutionUpdateChunk]: + """ + Tails the logs for the given execution with SSE streaming + + Args: + offset: The byte offset to start the stream from + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not devbox_id: + raise ValueError(f"Expected a non-empty value for `devbox_id` but received {devbox_id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + return self._get( + f"/v1/devboxes/{devbox_id}/executions/{execution_id}/stream_updates", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"offset": offset}, execution_stream_updates_params.ExecutionStreamUpdatesParams), + ), + cast_to=DevboxAsyncExecutionDetailView, + stream=True, + stream_cls=Stream[ExecutionUpdateChunk], + ) + class AsyncExecutionsResource(AsyncAPIResource): @cached_property @@ -445,6 +500,7 @@ async def kill( execution_id: str, *, devbox_id: str, + kill_process_group: Optional[bool] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -455,7 +511,7 @@ async def kill( ) -> DevboxAsyncExecutionDetailView: """ Kill a previously launched asynchronous execution if it is still running by - killing the launched process. + killing the launched process. Optionally kill the entire process group. Args: extra_headers: Send extra headers @@ -474,6 +530,9 @@ async def kill( raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") return await self._post( f"/v1/devboxes/{devbox_id}/executions/{execution_id}/kill", + body=await async_maybe_transform( + {"kill_process_group": kill_process_group}, execution_kill_params.ExecutionKillParams + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -484,6 +543,53 @@ async def kill( cast_to=DevboxAsyncExecutionDetailView, ) + async def stream_updates( + self, + execution_id: str, + *, + devbox_id: str, + offset: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncStream[ExecutionUpdateChunk]: + """ + Tails the logs for the given execution with SSE streaming + + Args: + offset: The byte offset to start the stream from + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not devbox_id: + raise ValueError(f"Expected a non-empty value for `devbox_id` but received {devbox_id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + return await self._get( + f"/v1/devboxes/{devbox_id}/executions/{execution_id}/stream_updates", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + {"offset": offset}, execution_stream_updates_params.ExecutionStreamUpdatesParams + ), + ), + cast_to=DevboxAsyncExecutionDetailView, + stream=True, + stream_cls=AsyncStream[ExecutionUpdateChunk], + ) + class ExecutionsResourceWithRawResponse: def __init__(self, executions: ExecutionsResource) -> None: @@ -501,6 +607,9 @@ def __init__(self, executions: ExecutionsResource) -> None: self.kill = to_raw_response_wrapper( executions.kill, ) + self.stream_updates = to_raw_response_wrapper( + executions.stream_updates, + ) class AsyncExecutionsResourceWithRawResponse: @@ -519,6 +628,9 @@ def __init__(self, executions: AsyncExecutionsResource) -> None: self.kill = async_to_raw_response_wrapper( executions.kill, ) + self.stream_updates = async_to_raw_response_wrapper( + executions.stream_updates, + ) class ExecutionsResourceWithStreamingResponse: @@ -537,6 +649,9 @@ def __init__(self, executions: ExecutionsResource) -> None: self.kill = to_streamed_response_wrapper( executions.kill, ) + self.stream_updates = to_streamed_response_wrapper( + executions.stream_updates, + ) class AsyncExecutionsResourceWithStreamingResponse: @@ -555,3 +670,6 @@ def __init__(self, executions: AsyncExecutionsResource) -> None: self.kill = async_to_streamed_response_wrapper( executions.kill, ) + self.stream_updates = async_to_streamed_response_wrapper( + executions.stream_updates, + ) diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index 9d6b25504..a0a6b69d1 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -50,6 +50,14 @@ class BlueprintBuildParameters(BaseModel): build. """ + base_blueprint_name: Optional[str] = None + """ + (Optional) Name of previously built blueprint to use as a base blueprint for + this build. When set, this will load the latest successfully built Blueprint + with the given name. Only one of (base_blueprint_id, base_blueprint_name) should + be specified. + """ + code_mounts: Optional[List[CodeMountParameters]] = None """A list of code mounts to be included in the Blueprint.""" diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index fb3e2ee49..214e3ef67 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -22,6 +22,14 @@ class BlueprintCreateParams(TypedDict, total=False): build. """ + base_blueprint_name: Optional[str] + """ + (Optional) Name of previously built blueprint to use as a base blueprint for + this build. When set, this will load the latest successfully built Blueprint + with the given name. Only one of (base_blueprint_id, base_blueprint_name) should + be specified. + """ + code_mounts: Optional[Iterable[CodeMountParameters]] """A list of code mounts to be included in the Blueprint.""" diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index eb3ba757b..9efca9c68 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -22,6 +22,14 @@ class BlueprintPreviewParams(TypedDict, total=False): build. """ + base_blueprint_name: Optional[str] + """ + (Optional) Name of previously built blueprint to use as a base blueprint for + this build. When set, this will load the latest successfully built Blueprint + with the given name. Only one of (base_blueprint_id, base_blueprint_name) should + be specified. + """ + code_mounts: Optional[Iterable[CodeMountParameters]] """A list of code mounts to be included in the Blueprint.""" diff --git a/src/runloop_api_client/types/blueprint_view.py b/src/runloop_api_client/types/blueprint_view.py index 7c6b9ee77..2dce4446c 100644 --- a/src/runloop_api_client/types/blueprint_view.py +++ b/src/runloop_api_client/types/blueprint_view.py @@ -68,6 +68,11 @@ class BlueprintView(BaseModel): Services can be explicitly started when creating a Devbox. """ + devbox_capabilities: Optional[ + List[Literal["unknown", "computer_usage", "browser_usage", "language_server", "docker_in_docker"]] + ] = None + """Capabilities that will be available on Devbox.""" + failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "build_failed"]] = None """The failure reason if the Blueprint build failed, if any.""" diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index dc4904eae..5724e118f 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -33,7 +33,7 @@ class DevboxView(BaseModel): id: str """The ID of the Devbox.""" - capabilities: List[Literal["unknown", "computer_usage", "browser_usage", "language_server"]] + capabilities: List[Literal["unknown", "computer_usage", "browser_usage", "language_server", "docker_in_docker"]] """A list of capability groups this devbox has access to. This allows devboxes to be compatible with certain tools sets like computer diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 2d5c61a93..43e642744 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -46,11 +46,13 @@ from .browser_create_params import BrowserCreateParams as BrowserCreateParams from .code_actions_response import CodeActionsResponse as CodeActionsResponse from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView +from .execution_kill_params import ExecutionKillParams as ExecutionKillParams from .lsp_formatting_params import LspFormattingParams as LspFormattingParams from .lsp_references_params import LspReferencesParams as LspReferencesParams from .watched_file_response import WatchedFileResponse as WatchedFileResponse from .code_description_param import CodeDescriptionParam as CodeDescriptionParam from .computer_create_params import ComputerCreateParams as ComputerCreateParams +from .execution_update_chunk import ExecutionUpdateChunk as ExecutionUpdateChunk from .file_contents_response import FileContentsResponse as FileContentsResponse from .health_status_response import HealthStatusResponse as HealthStatusResponse from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams @@ -75,6 +77,7 @@ from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams +from .execution_stream_updates_params import ExecutionStreamUpdatesParams as ExecutionStreamUpdatesParams from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse from .computer_mouse_interaction_params import ComputerMouseInteractionParams as ComputerMouseInteractionParams diff --git a/src/runloop_api_client/types/devboxes/execution_kill_params.py b/src/runloop_api_client/types/devboxes/execution_kill_params.py new file mode 100644 index 000000000..384da945c --- /dev/null +++ b/src/runloop_api_client/types/devboxes/execution_kill_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +__all__ = ["ExecutionKillParams"] + + +class ExecutionKillParams(TypedDict, total=False): + devbox_id: Required[str] + + kill_process_group: Optional[bool] diff --git a/src/runloop_api_client/types/devboxes/execution_stream_updates_params.py b/src/runloop_api_client/types/devboxes/execution_stream_updates_params.py new file mode 100644 index 000000000..3473cbc2c --- /dev/null +++ b/src/runloop_api_client/types/devboxes/execution_stream_updates_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["ExecutionStreamUpdatesParams"] + + +class ExecutionStreamUpdatesParams(TypedDict, total=False): + devbox_id: Required[str] + + offset: str + """The byte offset to start the stream from""" diff --git a/src/runloop_api_client/types/devboxes/execution_update_chunk.py b/src/runloop_api_client/types/devboxes/execution_update_chunk.py new file mode 100644 index 000000000..f5366d0cb --- /dev/null +++ b/src/runloop_api_client/types/devboxes/execution_update_chunk.py @@ -0,0 +1,40 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ExecutionUpdateChunk"] + + +class ExecutionUpdateChunk(BaseModel): + devbox_id: str + """Devbox id where command was executed.""" + + execution_id: str + """Ephemeral id of the execution in progress.""" + + status: Literal["queued", "running", "completed"] + """Current status of the execution.""" + + exit_status: Optional[int] = None + """Exit code of command execution. + + This field will remain unset until the execution has completed. + """ + + shell_name: Optional[str] = None + """Shell name.""" + + stderr: Optional[str] = None + """Standard error generated by command. + + This field will remain unset until the execution has completed. + """ + + stdout: Optional[str] = None + """Standard out generated by command. + + This field will remain unset until the execution has completed. + """ diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index 32da6909f..36ce77d7d 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -184,6 +184,15 @@ def test_method_kill(self, client: Runloop) -> None: ) assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + @parametrize + def test_method_kill_with_all_params(self, client: Runloop) -> None: + execution = client.devboxes.executions.kill( + execution_id="execution_id", + devbox_id="devbox_id", + kill_process_group=True, + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + @parametrize def test_raw_response_kill(self, client: Runloop) -> None: response = client.devboxes.executions.with_raw_response.kill( @@ -224,6 +233,62 @@ def test_path_params_kill(self, client: Runloop) -> None: devbox_id="devbox_id", ) + @parametrize + def test_method_stream_updates(self, client: Runloop) -> None: + execution_stream = client.devboxes.executions.stream_updates( + execution_id="execution_id", + devbox_id="devbox_id", + ) + execution_stream.response.close() + + @parametrize + def test_method_stream_updates_with_all_params(self, client: Runloop) -> None: + execution_stream = client.devboxes.executions.stream_updates( + execution_id="execution_id", + devbox_id="devbox_id", + offset="offset", + ) + execution_stream.response.close() + + @parametrize + def test_raw_response_stream_updates(self, client: Runloop) -> None: + response = client.devboxes.executions.with_raw_response.stream_updates( + execution_id="execution_id", + devbox_id="devbox_id", + ) + + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + stream = response.parse() + stream.close() + + @parametrize + def test_streaming_response_stream_updates(self, client: Runloop) -> None: + with client.devboxes.executions.with_streaming_response.stream_updates( + execution_id="execution_id", + devbox_id="devbox_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + stream = response.parse() + stream.close() + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_stream_updates(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `devbox_id` but received ''"): + client.devboxes.executions.with_raw_response.stream_updates( + execution_id="execution_id", + devbox_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + client.devboxes.executions.with_raw_response.stream_updates( + execution_id="", + devbox_id="devbox_id", + ) + class TestAsyncExecutions: parametrize = pytest.mark.parametrize( @@ -397,6 +462,15 @@ async def test_method_kill(self, async_client: AsyncRunloop) -> None: ) assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + @parametrize + async def test_method_kill_with_all_params(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.kill( + execution_id="execution_id", + devbox_id="devbox_id", + kill_process_group=True, + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + @parametrize async def test_raw_response_kill(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.executions.with_raw_response.kill( @@ -436,3 +510,59 @@ async def test_path_params_kill(self, async_client: AsyncRunloop) -> None: execution_id="", devbox_id="devbox_id", ) + + @parametrize + async def test_method_stream_updates(self, async_client: AsyncRunloop) -> None: + execution_stream = await async_client.devboxes.executions.stream_updates( + execution_id="execution_id", + devbox_id="devbox_id", + ) + await execution_stream.response.aclose() + + @parametrize + async def test_method_stream_updates_with_all_params(self, async_client: AsyncRunloop) -> None: + execution_stream = await async_client.devboxes.executions.stream_updates( + execution_id="execution_id", + devbox_id="devbox_id", + offset="offset", + ) + await execution_stream.response.aclose() + + @parametrize + async def test_raw_response_stream_updates(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.executions.with_raw_response.stream_updates( + execution_id="execution_id", + devbox_id="devbox_id", + ) + + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + stream = await response.parse() + await stream.close() + + @parametrize + async def test_streaming_response_stream_updates(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.executions.with_streaming_response.stream_updates( + execution_id="execution_id", + devbox_id="devbox_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + stream = await response.parse() + await stream.close() + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_stream_updates(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `devbox_id` but received ''"): + await async_client.devboxes.executions.with_raw_response.stream_updates( + execution_id="execution_id", + devbox_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + await async_client.devboxes.executions.with_raw_response.stream_updates( + execution_id="", + devbox_id="devbox_id", + ) diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 0ac239ecb..5f33036ce 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -34,6 +34,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: blueprint = client.blueprints.create( name="name", base_blueprint_id="base_blueprint_id", + base_blueprint_name="base_blueprint_name", code_mounts=[ { "repo_name": "repo_name", @@ -299,6 +300,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: blueprint = client.blueprints.preview( name="name", base_blueprint_id="base_blueprint_id", + base_blueprint_name="base_blueprint_name", code_mounts=[ { "repo_name": "repo_name", @@ -388,6 +390,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - blueprint = await async_client.blueprints.create( name="name", base_blueprint_id="base_blueprint_id", + base_blueprint_name="base_blueprint_name", code_mounts=[ { "repo_name": "repo_name", @@ -653,6 +656,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) blueprint = await async_client.blueprints.preview( name="name", base_blueprint_id="base_blueprint_id", + base_blueprint_name="base_blueprint_name", code_mounts=[ { "repo_name": "repo_name", From a7e439639cab30466a93c0d6dbb45a6ef39daf93 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 20:34:02 +0000 Subject: [PATCH 848/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2afb750c5..2fbefb942 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.57.0" + ".": "0.58.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 51054cc0c..763fac5fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.57.0" +version = "0.58.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 23715c2d3..d2b85015b 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.57.0" # x-release-please-version +__version__ = "0.58.0" # x-release-please-version From 9b7cd95b1c50c2a54e11c604028e0759c43964d9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Sep 2025 15:03:26 +0000 Subject: [PATCH 849/993] chore(internal): codegen related update --- mypy.ini | 50 ------------------------------------------------ pyproject.toml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 50 deletions(-) delete mode 100644 mypy.ini diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index 0a62aa9d6..000000000 --- a/mypy.ini +++ /dev/null @@ -1,50 +0,0 @@ -[mypy] -pretty = True -show_error_codes = True - -# Exclude _files.py because mypy isn't smart enough to apply -# the correct type narrowing and as this is an internal module -# it's fine to just use Pyright. -# -# We also exclude our `tests` as mypy doesn't always infer -# types correctly and Pyright will still catch any type errors. -exclude = ^(src/runloop_api_client/_files\.py|_dev/.*\.py|tests/.*)$ - -strict_equality = True -implicit_reexport = True -check_untyped_defs = True -no_implicit_optional = True - -warn_return_any = True -warn_unreachable = True -warn_unused_configs = True - -# Turn these options off as it could cause conflicts -# with the Pyright options. -warn_unused_ignores = False -warn_redundant_casts = False - -disallow_any_generics = True -disallow_untyped_defs = True -disallow_untyped_calls = True -disallow_subclassing_any = True -disallow_incomplete_defs = True -disallow_untyped_decorators = True -cache_fine_grained = True - -# By default, mypy reports an error if you assign a value to the result -# of a function call that doesn't return anything. We do this in our test -# cases: -# ``` -# result = ... -# assert result is None -# ``` -# Changing this codegen to make mypy happy would increase complexity -# and would not be worth it. -disable_error_code = func-returns-value,overload-cannot-match - -# https://github.com/python/mypy/issues/12162 -[mypy.overrides] -module = "black.files.*" -ignore_errors = true -ignore_missing_imports = true diff --git a/pyproject.toml b/pyproject.toml index 763fac5fe..4fd52522d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -157,6 +157,58 @@ reportOverlappingOverload = false reportImportCycles = false reportPrivateUsage = false +[tool.mypy] +pretty = true +show_error_codes = true + +# Exclude _files.py because mypy isn't smart enough to apply +# the correct type narrowing and as this is an internal module +# it's fine to just use Pyright. +# +# We also exclude our `tests` as mypy doesn't always infer +# types correctly and Pyright will still catch any type errors. +exclude = ['src/runloop_api_client/_files.py', '_dev/.*.py', 'tests/.*'] + +strict_equality = true +implicit_reexport = true +check_untyped_defs = true +no_implicit_optional = true + +warn_return_any = true +warn_unreachable = true +warn_unused_configs = true + +# Turn these options off as it could cause conflicts +# with the Pyright options. +warn_unused_ignores = false +warn_redundant_casts = false + +disallow_any_generics = true +disallow_untyped_defs = true +disallow_untyped_calls = true +disallow_subclassing_any = true +disallow_incomplete_defs = true +disallow_untyped_decorators = true +cache_fine_grained = true + +# By default, mypy reports an error if you assign a value to the result +# of a function call that doesn't return anything. We do this in our test +# cases: +# ``` +# result = ... +# assert result is None +# ``` +# Changing this codegen to make mypy happy would increase complexity +# and would not be worth it. +disable_error_code = "func-returns-value,overload-cannot-match" + +# https://github.com/python/mypy/issues/12162 +[[tool.mypy.overrides]] +module = "black.files.*" +ignore_errors = true +ignore_missing_imports = true + + [tool.ruff] line-length = 120 output-format = "grouped" From 7147d31868a6d5e7538e94d271fa5eeb6e0ab513 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Sep 2025 23:03:35 +0000 Subject: [PATCH 850/993] feat(api): api update --- .stats.yml | 8 +- api.md | 9 +- .../resources/devboxes/executions.py | 162 +++++++++++++++--- .../types/devboxes/__init__.py | 14 +- ...execution_stream_stderr_updates_params.py} | 4 +- ...xecution_stream_stderr_updates_response.py | 7 + .../execution_stream_stdout_updates_params.py | 14 ++ ...xecution_stream_stdout_updates_response.py | 7 + .../types/devboxes/execution_update_chunk.py | 40 ----- .../api_resources/devboxes/test_executions.py | 156 ++++++++++++++--- 10 files changed, 325 insertions(+), 96 deletions(-) rename src/runloop_api_client/types/devboxes/{execution_stream_updates_params.py => execution_stream_stderr_updates_params.py} (70%) create mode 100644 src/runloop_api_client/types/devboxes/execution_stream_stderr_updates_response.py create mode 100644 src/runloop_api_client/types/devboxes/execution_stream_stdout_updates_params.py create mode 100644 src/runloop_api_client/types/devboxes/execution_stream_stdout_updates_response.py delete mode 100644 src/runloop_api_client/types/devboxes/execution_update_chunk.py diff --git a/.stats.yml b/.stats.yml index 900ce23a3..3d29bf629 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 101 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6b4c63a026f224ec02ccd715e063e07107b545bb859218afaac2b3df84cd227a.yml -openapi_spec_hash: 76072cd766a9c45cff8890bb2bb8b1d5 -config_hash: a8ac5e38099129b07ae4decb0774719d +configured_endpoints: 102 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d709c5c5b17fec3a155d3367a00e123712be9fabdc802d7f2069b77b79883057.yml +openapi_spec_hash: 7a92b2d1612b211cc7507bdc49adf657 +config_hash: 3b21dd730a91da5e18dd16ab3e1870a8 diff --git a/api.md b/api.md index b08ff9fca..76a9b6e0b 100644 --- a/api.md +++ b/api.md @@ -254,7 +254,11 @@ Methods: Types: ```python -from runloop_api_client.types.devboxes import ExecutionUpdateChunk +from runloop_api_client.types.devboxes import ( + ExecutionUpdateChunk, + ExecutionStreamStderrUpdatesResponse, + ExecutionStreamStdoutUpdatesResponse, +) ``` Methods: @@ -263,7 +267,8 @@ Methods: - client.devboxes.executions.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.executions.kill(execution_id, \*, devbox_id, \*\*params) -> DevboxAsyncExecutionDetailView -- client.devboxes.executions.stream_updates(execution_id, \*, devbox_id, \*\*params) -> DevboxAsyncExecutionDetailView +- client.devboxes.executions.stream_stderr_updates(execution_id, \*, devbox_id, \*\*params) -> str +- client.devboxes.executions.stream_stdout_updates(execution_id, \*, devbox_id, \*\*params) -> str # Scenarios diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index 38243cfb2..06e676017 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -24,11 +24,13 @@ execution_retrieve_params, execution_execute_sync_params, execution_execute_async_params, - execution_stream_updates_params, + execution_stream_stderr_updates_params, + execution_stream_stdout_updates_params, ) from ...types.devbox_execution_detail_view import DevboxExecutionDetailView -from ...types.devboxes.execution_update_chunk import ExecutionUpdateChunk from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView +from ...types.devboxes.execution_stream_stderr_updates_response import ExecutionStreamStderrUpdatesResponse +from ...types.devboxes.execution_stream_stdout_updates_response import ExecutionStreamStdoutUpdatesResponse __all__ = ["ExecutionsResource", "AsyncExecutionsResource"] @@ -263,7 +265,7 @@ def kill( cast_to=DevboxAsyncExecutionDetailView, ) - def stream_updates( + def stream_stderr_updates( self, execution_id: str, *, @@ -275,9 +277,9 @@ def stream_updates( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Stream[ExecutionUpdateChunk]: + ) -> Stream[ExecutionStreamStderrUpdatesResponse]: """ - Tails the logs for the given execution with SSE streaming + Tails the stderr logs for the given execution with SSE streaming Args: offset: The byte offset to start the stream from @@ -294,18 +296,69 @@ def stream_updates( raise ValueError(f"Expected a non-empty value for `devbox_id` but received {devbox_id!r}") if not execution_id: raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + extra_headers = {"Accept": "text/plain", **(extra_headers or {})} return self._get( - f"/v1/devboxes/{devbox_id}/executions/{execution_id}/stream_updates", + f"/v1/devboxes/{devbox_id}/executions/{execution_id}/stream_stderr_updates", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform({"offset": offset}, execution_stream_updates_params.ExecutionStreamUpdatesParams), + query=maybe_transform( + {"offset": offset}, execution_stream_stderr_updates_params.ExecutionStreamStderrUpdatesParams + ), ), - cast_to=DevboxAsyncExecutionDetailView, + cast_to=str, stream=True, - stream_cls=Stream[ExecutionUpdateChunk], + stream_cls=Stream[ExecutionStreamStderrUpdatesResponse], + ) + + def stream_stdout_updates( + self, + execution_id: str, + *, + devbox_id: str, + offset: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> Stream[ExecutionStreamStdoutUpdatesResponse]: + """ + Tails the stdout logs for the given execution with SSE streaming + + Args: + offset: The byte offset to start the stream from + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not devbox_id: + raise ValueError(f"Expected a non-empty value for `devbox_id` but received {devbox_id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + extra_headers = {"Accept": "text/plain", **(extra_headers or {})} + return self._get( + f"/v1/devboxes/{devbox_id}/executions/{execution_id}/stream_stdout_updates", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + {"offset": offset}, execution_stream_stdout_updates_params.ExecutionStreamStdoutUpdatesParams + ), + ), + cast_to=str, + stream=True, + stream_cls=Stream[ExecutionStreamStdoutUpdatesResponse], ) @@ -543,7 +596,7 @@ async def kill( cast_to=DevboxAsyncExecutionDetailView, ) - async def stream_updates( + async def stream_stderr_updates( self, execution_id: str, *, @@ -555,9 +608,9 @@ async def stream_updates( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncStream[ExecutionUpdateChunk]: + ) -> AsyncStream[ExecutionStreamStderrUpdatesResponse]: """ - Tails the logs for the given execution with SSE streaming + Tails the stderr logs for the given execution with SSE streaming Args: offset: The byte offset to start the stream from @@ -574,20 +627,69 @@ async def stream_updates( raise ValueError(f"Expected a non-empty value for `devbox_id` but received {devbox_id!r}") if not execution_id: raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + extra_headers = {"Accept": "text/plain", **(extra_headers or {})} return await self._get( - f"/v1/devboxes/{devbox_id}/executions/{execution_id}/stream_updates", + f"/v1/devboxes/{devbox_id}/executions/{execution_id}/stream_stderr_updates", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=await async_maybe_transform( - {"offset": offset}, execution_stream_updates_params.ExecutionStreamUpdatesParams + {"offset": offset}, execution_stream_stderr_updates_params.ExecutionStreamStderrUpdatesParams ), ), - cast_to=DevboxAsyncExecutionDetailView, + cast_to=str, + stream=True, + stream_cls=AsyncStream[ExecutionStreamStderrUpdatesResponse], + ) + + async def stream_stdout_updates( + self, + execution_id: str, + *, + devbox_id: str, + offset: str | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncStream[ExecutionStreamStdoutUpdatesResponse]: + """ + Tails the stdout logs for the given execution with SSE streaming + + Args: + offset: The byte offset to start the stream from + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not devbox_id: + raise ValueError(f"Expected a non-empty value for `devbox_id` but received {devbox_id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + extra_headers = {"Accept": "text/plain", **(extra_headers or {})} + return await self._get( + f"/v1/devboxes/{devbox_id}/executions/{execution_id}/stream_stdout_updates", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + {"offset": offset}, execution_stream_stdout_updates_params.ExecutionStreamStdoutUpdatesParams + ), + ), + cast_to=str, stream=True, - stream_cls=AsyncStream[ExecutionUpdateChunk], + stream_cls=AsyncStream[ExecutionStreamStdoutUpdatesResponse], ) @@ -607,8 +709,11 @@ def __init__(self, executions: ExecutionsResource) -> None: self.kill = to_raw_response_wrapper( executions.kill, ) - self.stream_updates = to_raw_response_wrapper( - executions.stream_updates, + self.stream_stderr_updates = to_raw_response_wrapper( + executions.stream_stderr_updates, + ) + self.stream_stdout_updates = to_raw_response_wrapper( + executions.stream_stdout_updates, ) @@ -628,8 +733,11 @@ def __init__(self, executions: AsyncExecutionsResource) -> None: self.kill = async_to_raw_response_wrapper( executions.kill, ) - self.stream_updates = async_to_raw_response_wrapper( - executions.stream_updates, + self.stream_stderr_updates = async_to_raw_response_wrapper( + executions.stream_stderr_updates, + ) + self.stream_stdout_updates = async_to_raw_response_wrapper( + executions.stream_stdout_updates, ) @@ -649,8 +757,11 @@ def __init__(self, executions: ExecutionsResource) -> None: self.kill = to_streamed_response_wrapper( executions.kill, ) - self.stream_updates = to_streamed_response_wrapper( - executions.stream_updates, + self.stream_stderr_updates = to_streamed_response_wrapper( + executions.stream_stderr_updates, + ) + self.stream_stdout_updates = to_streamed_response_wrapper( + executions.stream_stdout_updates, ) @@ -670,6 +781,9 @@ def __init__(self, executions: AsyncExecutionsResource) -> None: self.kill = async_to_streamed_response_wrapper( executions.kill, ) - self.stream_updates = async_to_streamed_response_wrapper( - executions.stream_updates, + self.stream_stderr_updates = async_to_streamed_response_wrapper( + executions.stream_stderr_updates, + ) + self.stream_stdout_updates = async_to_streamed_response_wrapper( + executions.stream_stdout_updates, ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 43e642744..7ee0b171d 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -52,7 +52,6 @@ from .watched_file_response import WatchedFileResponse as WatchedFileResponse from .code_description_param import CodeDescriptionParam as CodeDescriptionParam from .computer_create_params import ComputerCreateParams as ComputerCreateParams -from .execution_update_chunk import ExecutionUpdateChunk as ExecutionUpdateChunk from .file_contents_response import FileContentsResponse as FileContentsResponse from .health_status_response import HealthStatusResponse as HealthStatusResponse from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams @@ -77,7 +76,6 @@ from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .execution_stream_updates_params import ExecutionStreamUpdatesParams as ExecutionStreamUpdatesParams from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse from .computer_mouse_interaction_params import ComputerMouseInteractionParams as ComputerMouseInteractionParams @@ -91,6 +89,18 @@ from .computer_keyboard_interaction_response import ( ComputerKeyboardInteractionResponse as ComputerKeyboardInteractionResponse, ) +from .execution_stream_stderr_updates_params import ( + ExecutionStreamStderrUpdatesParams as ExecutionStreamStderrUpdatesParams, +) +from .execution_stream_stdout_updates_params import ( + ExecutionStreamStdoutUpdatesParams as ExecutionStreamStdoutUpdatesParams, +) +from .execution_stream_stderr_updates_response import ( + ExecutionStreamStderrUpdatesResponse as ExecutionStreamStderrUpdatesResponse, +) +from .execution_stream_stdout_updates_response import ( + ExecutionStreamStdoutUpdatesResponse as ExecutionStreamStdoutUpdatesResponse, +) from .lsp_get_code_actions_for_diagnostic_params import ( LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, ) diff --git a/src/runloop_api_client/types/devboxes/execution_stream_updates_params.py b/src/runloop_api_client/types/devboxes/execution_stream_stderr_updates_params.py similarity index 70% rename from src/runloop_api_client/types/devboxes/execution_stream_updates_params.py rename to src/runloop_api_client/types/devboxes/execution_stream_stderr_updates_params.py index 3473cbc2c..b82639556 100644 --- a/src/runloop_api_client/types/devboxes/execution_stream_updates_params.py +++ b/src/runloop_api_client/types/devboxes/execution_stream_stderr_updates_params.py @@ -4,10 +4,10 @@ from typing_extensions import Required, TypedDict -__all__ = ["ExecutionStreamUpdatesParams"] +__all__ = ["ExecutionStreamStderrUpdatesParams"] -class ExecutionStreamUpdatesParams(TypedDict, total=False): +class ExecutionStreamStderrUpdatesParams(TypedDict, total=False): devbox_id: Required[str] offset: str diff --git a/src/runloop_api_client/types/devboxes/execution_stream_stderr_updates_response.py b/src/runloop_api_client/types/devboxes/execution_stream_stderr_updates_response.py new file mode 100644 index 000000000..1f7ec2adc --- /dev/null +++ b/src/runloop_api_client/types/devboxes/execution_stream_stderr_updates_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["ExecutionStreamStderrUpdatesResponse"] + +ExecutionStreamStderrUpdatesResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/execution_stream_stdout_updates_params.py b/src/runloop_api_client/types/devboxes/execution_stream_stdout_updates_params.py new file mode 100644 index 000000000..7296156b0 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/execution_stream_stdout_updates_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["ExecutionStreamStdoutUpdatesParams"] + + +class ExecutionStreamStdoutUpdatesParams(TypedDict, total=False): + devbox_id: Required[str] + + offset: str + """The byte offset to start the stream from""" diff --git a/src/runloop_api_client/types/devboxes/execution_stream_stdout_updates_response.py b/src/runloop_api_client/types/devboxes/execution_stream_stdout_updates_response.py new file mode 100644 index 000000000..da6e2bd20 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/execution_stream_stdout_updates_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["ExecutionStreamStdoutUpdatesResponse"] + +ExecutionStreamStdoutUpdatesResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/execution_update_chunk.py b/src/runloop_api_client/types/devboxes/execution_update_chunk.py deleted file mode 100644 index f5366d0cb..000000000 --- a/src/runloop_api_client/types/devboxes/execution_update_chunk.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["ExecutionUpdateChunk"] - - -class ExecutionUpdateChunk(BaseModel): - devbox_id: str - """Devbox id where command was executed.""" - - execution_id: str - """Ephemeral id of the execution in progress.""" - - status: Literal["queued", "running", "completed"] - """Current status of the execution.""" - - exit_status: Optional[int] = None - """Exit code of command execution. - - This field will remain unset until the execution has completed. - """ - - shell_name: Optional[str] = None - """Shell name.""" - - stderr: Optional[str] = None - """Standard error generated by command. - - This field will remain unset until the execution has completed. - """ - - stdout: Optional[str] = None - """Standard out generated by command. - - This field will remain unset until the execution has completed. - """ diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index 36ce77d7d..e9a6c3ee0 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -234,16 +234,16 @@ def test_path_params_kill(self, client: Runloop) -> None: ) @parametrize - def test_method_stream_updates(self, client: Runloop) -> None: - execution_stream = client.devboxes.executions.stream_updates( + def test_method_stream_stderr_updates(self, client: Runloop) -> None: + execution_stream = client.devboxes.executions.stream_stderr_updates( execution_id="execution_id", devbox_id="devbox_id", ) execution_stream.response.close() @parametrize - def test_method_stream_updates_with_all_params(self, client: Runloop) -> None: - execution_stream = client.devboxes.executions.stream_updates( + def test_method_stream_stderr_updates_with_all_params(self, client: Runloop) -> None: + execution_stream = client.devboxes.executions.stream_stderr_updates( execution_id="execution_id", devbox_id="devbox_id", offset="offset", @@ -251,8 +251,8 @@ def test_method_stream_updates_with_all_params(self, client: Runloop) -> None: execution_stream.response.close() @parametrize - def test_raw_response_stream_updates(self, client: Runloop) -> None: - response = client.devboxes.executions.with_raw_response.stream_updates( + def test_raw_response_stream_stderr_updates(self, client: Runloop) -> None: + response = client.devboxes.executions.with_raw_response.stream_stderr_updates( execution_id="execution_id", devbox_id="devbox_id", ) @@ -262,8 +262,8 @@ def test_raw_response_stream_updates(self, client: Runloop) -> None: stream.close() @parametrize - def test_streaming_response_stream_updates(self, client: Runloop) -> None: - with client.devboxes.executions.with_streaming_response.stream_updates( + def test_streaming_response_stream_stderr_updates(self, client: Runloop) -> None: + with client.devboxes.executions.with_streaming_response.stream_stderr_updates( execution_id="execution_id", devbox_id="devbox_id", ) as response: @@ -276,15 +276,71 @@ def test_streaming_response_stream_updates(self, client: Runloop) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_stream_updates(self, client: Runloop) -> None: + def test_path_params_stream_stderr_updates(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `devbox_id` but received ''"): - client.devboxes.executions.with_raw_response.stream_updates( + client.devboxes.executions.with_raw_response.stream_stderr_updates( execution_id="execution_id", devbox_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): - client.devboxes.executions.with_raw_response.stream_updates( + client.devboxes.executions.with_raw_response.stream_stderr_updates( + execution_id="", + devbox_id="devbox_id", + ) + + @parametrize + def test_method_stream_stdout_updates(self, client: Runloop) -> None: + execution_stream = client.devboxes.executions.stream_stdout_updates( + execution_id="execution_id", + devbox_id="devbox_id", + ) + execution_stream.response.close() + + @parametrize + def test_method_stream_stdout_updates_with_all_params(self, client: Runloop) -> None: + execution_stream = client.devboxes.executions.stream_stdout_updates( + execution_id="execution_id", + devbox_id="devbox_id", + offset="offset", + ) + execution_stream.response.close() + + @parametrize + def test_raw_response_stream_stdout_updates(self, client: Runloop) -> None: + response = client.devboxes.executions.with_raw_response.stream_stdout_updates( + execution_id="execution_id", + devbox_id="devbox_id", + ) + + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + stream = response.parse() + stream.close() + + @parametrize + def test_streaming_response_stream_stdout_updates(self, client: Runloop) -> None: + with client.devboxes.executions.with_streaming_response.stream_stdout_updates( + execution_id="execution_id", + devbox_id="devbox_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + stream = response.parse() + stream.close() + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_stream_stdout_updates(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `devbox_id` but received ''"): + client.devboxes.executions.with_raw_response.stream_stdout_updates( + execution_id="execution_id", + devbox_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + client.devboxes.executions.with_raw_response.stream_stdout_updates( execution_id="", devbox_id="devbox_id", ) @@ -512,16 +568,72 @@ async def test_path_params_kill(self, async_client: AsyncRunloop) -> None: ) @parametrize - async def test_method_stream_updates(self, async_client: AsyncRunloop) -> None: - execution_stream = await async_client.devboxes.executions.stream_updates( + async def test_method_stream_stderr_updates(self, async_client: AsyncRunloop) -> None: + execution_stream = await async_client.devboxes.executions.stream_stderr_updates( + execution_id="execution_id", + devbox_id="devbox_id", + ) + await execution_stream.response.aclose() + + @parametrize + async def test_method_stream_stderr_updates_with_all_params(self, async_client: AsyncRunloop) -> None: + execution_stream = await async_client.devboxes.executions.stream_stderr_updates( + execution_id="execution_id", + devbox_id="devbox_id", + offset="offset", + ) + await execution_stream.response.aclose() + + @parametrize + async def test_raw_response_stream_stderr_updates(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.executions.with_raw_response.stream_stderr_updates( + execution_id="execution_id", + devbox_id="devbox_id", + ) + + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + stream = await response.parse() + await stream.close() + + @parametrize + async def test_streaming_response_stream_stderr_updates(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.executions.with_streaming_response.stream_stderr_updates( + execution_id="execution_id", + devbox_id="devbox_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + stream = await response.parse() + await stream.close() + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_stream_stderr_updates(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `devbox_id` but received ''"): + await async_client.devboxes.executions.with_raw_response.stream_stderr_updates( + execution_id="execution_id", + devbox_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + await async_client.devboxes.executions.with_raw_response.stream_stderr_updates( + execution_id="", + devbox_id="devbox_id", + ) + + @parametrize + async def test_method_stream_stdout_updates(self, async_client: AsyncRunloop) -> None: + execution_stream = await async_client.devboxes.executions.stream_stdout_updates( execution_id="execution_id", devbox_id="devbox_id", ) await execution_stream.response.aclose() @parametrize - async def test_method_stream_updates_with_all_params(self, async_client: AsyncRunloop) -> None: - execution_stream = await async_client.devboxes.executions.stream_updates( + async def test_method_stream_stdout_updates_with_all_params(self, async_client: AsyncRunloop) -> None: + execution_stream = await async_client.devboxes.executions.stream_stdout_updates( execution_id="execution_id", devbox_id="devbox_id", offset="offset", @@ -529,8 +641,8 @@ async def test_method_stream_updates_with_all_params(self, async_client: AsyncRu await execution_stream.response.aclose() @parametrize - async def test_raw_response_stream_updates(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.executions.with_raw_response.stream_updates( + async def test_raw_response_stream_stdout_updates(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.executions.with_raw_response.stream_stdout_updates( execution_id="execution_id", devbox_id="devbox_id", ) @@ -540,8 +652,8 @@ async def test_raw_response_stream_updates(self, async_client: AsyncRunloop) -> await stream.close() @parametrize - async def test_streaming_response_stream_updates(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.executions.with_streaming_response.stream_updates( + async def test_streaming_response_stream_stdout_updates(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.executions.with_streaming_response.stream_stdout_updates( execution_id="execution_id", devbox_id="devbox_id", ) as response: @@ -554,15 +666,15 @@ async def test_streaming_response_stream_updates(self, async_client: AsyncRunloo assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_stream_updates(self, async_client: AsyncRunloop) -> None: + async def test_path_params_stream_stdout_updates(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `devbox_id` but received ''"): - await async_client.devboxes.executions.with_raw_response.stream_updates( + await async_client.devboxes.executions.with_raw_response.stream_stdout_updates( execution_id="execution_id", devbox_id="", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): - await async_client.devboxes.executions.with_raw_response.stream_updates( + await async_client.devboxes.executions.with_raw_response.stream_stdout_updates( execution_id="", devbox_id="devbox_id", ) From 52023e3345ae3094dab18295a0fa82e8c8ba71b2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 6 Sep 2025 03:46:08 +0000 Subject: [PATCH 851/993] chore(tests): simplify `get_platform` test `nest_asyncio` is archived and broken on some platforms so it's not worth keeping in our test suite. --- pyproject.toml | 1 - requirements-dev.lock | 1 - tests/test_client.py | 53 +++++-------------------------------------- 3 files changed, 6 insertions(+), 49 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4fd52522d..76b41fa9e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,6 @@ dev-dependencies = [ "dirty-equals>=0.6.0", "importlib-metadata>=6.7.0", "rich>=13.7.1", - "nest_asyncio==1.6.0", "pytest-xdist>=3.6.1", ] diff --git a/requirements-dev.lock b/requirements-dev.lock index de857a2d6..2a74d01aa 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -75,7 +75,6 @@ multidict==6.4.4 mypy==1.14.1 mypy-extensions==1.0.0 # via mypy -nest-asyncio==1.6.0 nodeenv==1.8.0 # via pyright nox==2023.4.22 diff --git a/tests/test_client.py b/tests/test_client.py index cb84f9ebe..ca53896b3 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -6,13 +6,10 @@ import os import sys import json -import time import asyncio import inspect -import subprocess import tracemalloc from typing import Any, Union, cast -from textwrap import dedent from unittest import mock from typing_extensions import Literal @@ -23,14 +20,17 @@ from runloop_api_client import Runloop, AsyncRunloop, APIResponseValidationError from runloop_api_client._types import Omit +from runloop_api_client._utils import asyncify from runloop_api_client._models import BaseModel, FinalRequestOptions from runloop_api_client._exceptions import RunloopError, APIStatusError, APITimeoutError, APIResponseValidationError from runloop_api_client._base_client import ( DEFAULT_TIMEOUT, HTTPX_DEFAULT_TIMEOUT, BaseClient, + OtherPlatform, DefaultHttpxClient, DefaultAsyncHttpxClient, + get_platform, make_request_options, ) @@ -1727,50 +1727,9 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: assert response.http_request.headers.get("x-stainless-retry-count") == "42" - def test_get_platform(self) -> None: - # A previous implementation of asyncify could leave threads unterminated when - # used with nest_asyncio. - # - # Since nest_asyncio.apply() is global and cannot be un-applied, this - # test is run in a separate process to avoid affecting other tests. - test_code = dedent(""" - import asyncio - import nest_asyncio - import threading - - from runloop_api_client._utils import asyncify - from runloop_api_client._base_client import get_platform - - async def test_main() -> None: - result = await asyncify(get_platform)() - print(result) - for thread in threading.enumerate(): - print(thread.name) - - nest_asyncio.apply() - asyncio.run(test_main()) - """) - with subprocess.Popen( - [sys.executable, "-c", test_code], - text=True, - ) as process: - timeout = 10 # seconds - - start_time = time.monotonic() - while True: - return_code = process.poll() - if return_code is not None: - if return_code != 0: - raise AssertionError("calling get_platform using asyncify resulted in a non-zero exit code") - - # success - break - - if time.monotonic() - start_time > timeout: - process.kill() - raise AssertionError("calling get_platform using asyncify resulted in a hung process") - - time.sleep(0.1) + async def test_get_platform(self) -> None: + platform = await asyncify(get_platform)() + assert isinstance(platform, (str, OtherPlatform)) async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly From 5afac96e00dac39534f9c2d2c6f331eff7d37ed4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 19:51:53 +0000 Subject: [PATCH 852/993] feat(api): api update --- .stats.yml | 6 ++-- api.md | 10 ++---- .../resources/devboxes/executions.py | 31 ++++++++----------- .../types/devboxes/__init__.py | 7 +---- ...xecution_stream_stderr_updates_response.py | 7 ----- ...xecution_stream_stdout_updates_response.py | 7 ----- .../types/devboxes/execution_update_chunk.py | 15 +++++++++ 7 files changed, 35 insertions(+), 48 deletions(-) delete mode 100644 src/runloop_api_client/types/devboxes/execution_stream_stderr_updates_response.py delete mode 100644 src/runloop_api_client/types/devboxes/execution_stream_stdout_updates_response.py create mode 100644 src/runloop_api_client/types/devboxes/execution_update_chunk.py diff --git a/.stats.yml b/.stats.yml index 3d29bf629..3426ad757 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d709c5c5b17fec3a155d3367a00e123712be9fabdc802d7f2069b77b79883057.yml -openapi_spec_hash: 7a92b2d1612b211cc7507bdc49adf657 -config_hash: 3b21dd730a91da5e18dd16ab3e1870a8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-aa2f6b7bd5f38374ef743af2f5399fc37358408730dcbb1305e181bb91a2e903.yml +openapi_spec_hash: a3f793428f6b5de9a59ba8c80ee8bbea +config_hash: a74944d06979c9df5e08aee874ae5caa diff --git a/api.md b/api.md index 76a9b6e0b..3e3613b5b 100644 --- a/api.md +++ b/api.md @@ -254,11 +254,7 @@ Methods: Types: ```python -from runloop_api_client.types.devboxes import ( - ExecutionUpdateChunk, - ExecutionStreamStderrUpdatesResponse, - ExecutionStreamStdoutUpdatesResponse, -) +from runloop_api_client.types.devboxes import ExecutionUpdateChunk ``` Methods: @@ -267,8 +263,8 @@ Methods: - client.devboxes.executions.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.executions.kill(execution_id, \*, devbox_id, \*\*params) -> DevboxAsyncExecutionDetailView -- client.devboxes.executions.stream_stderr_updates(execution_id, \*, devbox_id, \*\*params) -> str -- client.devboxes.executions.stream_stdout_updates(execution_id, \*, devbox_id, \*\*params) -> str +- client.devboxes.executions.stream_stderr_updates(execution_id, \*, devbox_id, \*\*params) -> ExecutionUpdateChunk +- client.devboxes.executions.stream_stdout_updates(execution_id, \*, devbox_id, \*\*params) -> ExecutionUpdateChunk # Scenarios diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index 06e676017..e13f9e6f5 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -28,9 +28,8 @@ execution_stream_stdout_updates_params, ) from ...types.devbox_execution_detail_view import DevboxExecutionDetailView +from ...types.devboxes.execution_update_chunk import ExecutionUpdateChunk from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView -from ...types.devboxes.execution_stream_stderr_updates_response import ExecutionStreamStderrUpdatesResponse -from ...types.devboxes.execution_stream_stdout_updates_response import ExecutionStreamStdoutUpdatesResponse __all__ = ["ExecutionsResource", "AsyncExecutionsResource"] @@ -277,7 +276,7 @@ def stream_stderr_updates( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Stream[ExecutionStreamStderrUpdatesResponse]: + ) -> Stream[ExecutionUpdateChunk]: """ Tails the stderr logs for the given execution with SSE streaming @@ -296,7 +295,6 @@ def stream_stderr_updates( raise ValueError(f"Expected a non-empty value for `devbox_id` but received {devbox_id!r}") if not execution_id: raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") - extra_headers = {"Accept": "text/plain", **(extra_headers or {})} return self._get( f"/v1/devboxes/{devbox_id}/executions/{execution_id}/stream_stderr_updates", options=make_request_options( @@ -308,9 +306,9 @@ def stream_stderr_updates( {"offset": offset}, execution_stream_stderr_updates_params.ExecutionStreamStderrUpdatesParams ), ), - cast_to=str, + cast_to=ExecutionUpdateChunk, stream=True, - stream_cls=Stream[ExecutionStreamStderrUpdatesResponse], + stream_cls=Stream[ExecutionUpdateChunk], ) def stream_stdout_updates( @@ -325,7 +323,7 @@ def stream_stdout_updates( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Stream[ExecutionStreamStdoutUpdatesResponse]: + ) -> Stream[ExecutionUpdateChunk]: """ Tails the stdout logs for the given execution with SSE streaming @@ -344,7 +342,6 @@ def stream_stdout_updates( raise ValueError(f"Expected a non-empty value for `devbox_id` but received {devbox_id!r}") if not execution_id: raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") - extra_headers = {"Accept": "text/plain", **(extra_headers or {})} return self._get( f"/v1/devboxes/{devbox_id}/executions/{execution_id}/stream_stdout_updates", options=make_request_options( @@ -356,9 +353,9 @@ def stream_stdout_updates( {"offset": offset}, execution_stream_stdout_updates_params.ExecutionStreamStdoutUpdatesParams ), ), - cast_to=str, + cast_to=ExecutionUpdateChunk, stream=True, - stream_cls=Stream[ExecutionStreamStdoutUpdatesResponse], + stream_cls=Stream[ExecutionUpdateChunk], ) @@ -608,7 +605,7 @@ async def stream_stderr_updates( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncStream[ExecutionStreamStderrUpdatesResponse]: + ) -> AsyncStream[ExecutionUpdateChunk]: """ Tails the stderr logs for the given execution with SSE streaming @@ -627,7 +624,6 @@ async def stream_stderr_updates( raise ValueError(f"Expected a non-empty value for `devbox_id` but received {devbox_id!r}") if not execution_id: raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") - extra_headers = {"Accept": "text/plain", **(extra_headers or {})} return await self._get( f"/v1/devboxes/{devbox_id}/executions/{execution_id}/stream_stderr_updates", options=make_request_options( @@ -639,9 +635,9 @@ async def stream_stderr_updates( {"offset": offset}, execution_stream_stderr_updates_params.ExecutionStreamStderrUpdatesParams ), ), - cast_to=str, + cast_to=ExecutionUpdateChunk, stream=True, - stream_cls=AsyncStream[ExecutionStreamStderrUpdatesResponse], + stream_cls=AsyncStream[ExecutionUpdateChunk], ) async def stream_stdout_updates( @@ -656,7 +652,7 @@ async def stream_stdout_updates( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncStream[ExecutionStreamStdoutUpdatesResponse]: + ) -> AsyncStream[ExecutionUpdateChunk]: """ Tails the stdout logs for the given execution with SSE streaming @@ -675,7 +671,6 @@ async def stream_stdout_updates( raise ValueError(f"Expected a non-empty value for `devbox_id` but received {devbox_id!r}") if not execution_id: raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") - extra_headers = {"Accept": "text/plain", **(extra_headers or {})} return await self._get( f"/v1/devboxes/{devbox_id}/executions/{execution_id}/stream_stdout_updates", options=make_request_options( @@ -687,9 +682,9 @@ async def stream_stdout_updates( {"offset": offset}, execution_stream_stdout_updates_params.ExecutionStreamStdoutUpdatesParams ), ), - cast_to=str, + cast_to=ExecutionUpdateChunk, stream=True, - stream_cls=AsyncStream[ExecutionStreamStdoutUpdatesResponse], + stream_cls=AsyncStream[ExecutionUpdateChunk], ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 7ee0b171d..472d68e9a 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -52,6 +52,7 @@ from .watched_file_response import WatchedFileResponse as WatchedFileResponse from .code_description_param import CodeDescriptionParam as CodeDescriptionParam from .computer_create_params import ComputerCreateParams as ComputerCreateParams +from .execution_update_chunk import ExecutionUpdateChunk as ExecutionUpdateChunk from .file_contents_response import FileContentsResponse as FileContentsResponse from .health_status_response import HealthStatusResponse as HealthStatusResponse from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams @@ -95,12 +96,6 @@ from .execution_stream_stdout_updates_params import ( ExecutionStreamStdoutUpdatesParams as ExecutionStreamStdoutUpdatesParams, ) -from .execution_stream_stderr_updates_response import ( - ExecutionStreamStderrUpdatesResponse as ExecutionStreamStderrUpdatesResponse, -) -from .execution_stream_stdout_updates_response import ( - ExecutionStreamStdoutUpdatesResponse as ExecutionStreamStdoutUpdatesResponse, -) from .lsp_get_code_actions_for_diagnostic_params import ( LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, ) diff --git a/src/runloop_api_client/types/devboxes/execution_stream_stderr_updates_response.py b/src/runloop_api_client/types/devboxes/execution_stream_stderr_updates_response.py deleted file mode 100644 index 1f7ec2adc..000000000 --- a/src/runloop_api_client/types/devboxes/execution_stream_stderr_updates_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["ExecutionStreamStderrUpdatesResponse"] - -ExecutionStreamStderrUpdatesResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/execution_stream_stdout_updates_response.py b/src/runloop_api_client/types/devboxes/execution_stream_stdout_updates_response.py deleted file mode 100644 index da6e2bd20..000000000 --- a/src/runloop_api_client/types/devboxes/execution_stream_stdout_updates_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["ExecutionStreamStdoutUpdatesResponse"] - -ExecutionStreamStdoutUpdatesResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/execution_update_chunk.py b/src/runloop_api_client/types/devboxes/execution_update_chunk.py new file mode 100644 index 000000000..eda7add55 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/execution_update_chunk.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["ExecutionUpdateChunk"] + + +class ExecutionUpdateChunk(BaseModel): + output: str + """The latest log stream chunk.""" + + offset: Optional[int] = None + """The byte offset of this chunk of log stream.""" From a5b43eaedc1ee489cf0c2c262a5f467803a81734 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 22:35:09 +0000 Subject: [PATCH 853/993] feat(api): api update --- .stats.yml | 6 +++--- api.md | 1 + src/runloop_api_client/resources/devboxes/executions.py | 6 ++++++ .../types/devboxes/execution_kill_params.py | 4 ++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3426ad757..1eaf9aeec 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-aa2f6b7bd5f38374ef743af2f5399fc37358408730dcbb1305e181bb91a2e903.yml -openapi_spec_hash: a3f793428f6b5de9a59ba8c80ee8bbea -config_hash: a74944d06979c9df5e08aee874ae5caa +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a8e2289b32b616e0bd7e15995a6553d0335bd21e30617a013d07450f8f5a7a20.yml +openapi_spec_hash: cd13a7af1ffe64c7ce8753f87786e01f +config_hash: 457068371129b47b67f0f2d6b8267368 diff --git a/api.md b/api.md index 3e3613b5b..92ea63321 100644 --- a/api.md +++ b/api.md @@ -72,6 +72,7 @@ Types: from runloop_api_client.types import ( DevboxAsyncExecutionDetailView, DevboxExecutionDetailView, + DevboxKillExecutionRequest, DevboxListView, DevboxSnapshotListView, DevboxSnapshotView, diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index e13f9e6f5..69ee58b0f 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -237,6 +237,9 @@ def kill( killing the launched process. Optionally kill the entire process group. Args: + kill_process_group: Whether to kill the entire process group (default: false). If true, kills all + processes in the same process group as the target process. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -564,6 +567,9 @@ async def kill( killing the launched process. Optionally kill the entire process group. Args: + kill_process_group: Whether to kill the entire process group (default: false). If true, kills all + processes in the same process group as the target process. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request diff --git a/src/runloop_api_client/types/devboxes/execution_kill_params.py b/src/runloop_api_client/types/devboxes/execution_kill_params.py index 384da945c..0df5c8615 100644 --- a/src/runloop_api_client/types/devboxes/execution_kill_params.py +++ b/src/runloop_api_client/types/devboxes/execution_kill_params.py @@ -12,3 +12,7 @@ class ExecutionKillParams(TypedDict, total=False): devbox_id: Required[str] kill_process_group: Optional[bool] + """Whether to kill the entire process group (default: false). + + If true, kills all processes in the same process group as the target process. + """ From 7e9e8cd9800a72e6b413050a9021204319980d85 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 20:04:42 +0000 Subject: [PATCH 854/993] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1eaf9aeec..62b714b4b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 102 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-a8e2289b32b616e0bd7e15995a6553d0335bd21e30617a013d07450f8f5a7a20.yml -openapi_spec_hash: cd13a7af1ffe64c7ce8753f87786e01f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-0cb966ca566f4f3d7f8b4d3c37b24b4a117760dba194cb2c4f2bb4e3620027de.yml +openapi_spec_hash: c969887eb721b42a423e662127270d57 config_hash: 457068371129b47b67f0f2d6b8267368 From f71a0e613a12cceea0ad87c410a2715c3c5eb964 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 20:05:08 +0000 Subject: [PATCH 855/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2fbefb942..85c311828 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.58.0" + ".": "0.59.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 76b41fa9e..720acb4e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.58.0" +version = "0.59.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index d2b85015b..533907a8a 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.58.0" # x-release-please-version +__version__ = "0.59.0" # x-release-please-version From 09b259a43bb6f41b35379ddab33294273ac94cbd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 20:38:22 +0000 Subject: [PATCH 856/993] feat(api): api update --- .stats.yml | 4 +- api.md | 1 + .../resources/devboxes/devboxes.py | 145 ++++++++++++++++++ src/runloop_api_client/types/__init__.py | 1 + .../types/devbox_execute_params.py | 28 ++++ tests/api_resources/test_devboxes.py | 112 ++++++++++++++ 6 files changed, 289 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/types/devbox_execute_params.py diff --git a/.stats.yml b/.stats.yml index 62b714b4b..1e5d0d22d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 102 +configured_endpoints: 103 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-0cb966ca566f4f3d7f8b4d3c37b24b4a117760dba194cb2c4f2bb4e3620027de.yml openapi_spec_hash: c969887eb721b42a423e662127270d57 -config_hash: 457068371129b47b67f0f2d6b8267368 +config_hash: b9de5d96e095a7e749a8c1fc3536c308 diff --git a/api.md b/api.md index 92ea63321..c1fb93e0e 100644 --- a/api.md +++ b/api.md @@ -93,6 +93,7 @@ Methods: - client.devboxes.create_tunnel(id, \*\*params) -> DevboxTunnelView - client.devboxes.delete_disk_snapshot(id) -> object - client.devboxes.download_file(id, \*\*params) -> BinaryAPIResponse +- client.devboxes.execute(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.keep_alive(id) -> object diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 7ddfd92f3..cbadea715 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -27,6 +27,7 @@ devbox_list_params, devbox_create_params, devbox_update_params, + devbox_execute_params, devbox_upload_file_params, devbox_execute_sync_params, devbox_create_tunnel_params, @@ -572,6 +573,72 @@ def download_file( cast_to=BinaryAPIResponse, ) + def execute( + self, + id: str, + *, + command: str, + command_id: str, + shell_name: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> DevboxAsyncExecutionDetailView: + """ + Execute a command with a known command ID on a devbox, optimistically waiting + for it to complete within the specified timeout. If it completes in time, return + the result. If not, return a status indicating the command is still running. + + Args: + command: The command to execute via the Devbox shell. By default, commands are run from + the user home directory unless shell_name is specified. If shell_name is + specified the command is run from the directory based on the recent state of the + persistent shell. + + command_id: The command ID for idempotency and tracking + + shell_name: The name of the persistent shell to create or use if already created. When using + a persistent shell, the command will run from the directory at the end of the + previous command and environment variables will be preserved. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT: + timeout = 600 + return self._post( + f"/v1/devboxes/{id}/execute", + body=maybe_transform( + { + "command": command, + "command_id": command_id, + "shell_name": shell_name, + }, + devbox_execute_params.DevboxExecuteParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + def execute_async( self, id: str, @@ -1715,6 +1782,72 @@ async def download_file( cast_to=AsyncBinaryAPIResponse, ) + async def execute( + self, + id: str, + *, + command: str, + command_id: str, + shell_name: Optional[str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> DevboxAsyncExecutionDetailView: + """ + Execute a command with a known command ID on a devbox, optimistically waiting + for it to complete within the specified timeout. If it completes in time, return + the result. If not, return a status indicating the command is still running. + + Args: + command: The command to execute via the Devbox shell. By default, commands are run from + the user home directory unless shell_name is specified. If shell_name is + specified the command is run from the directory based on the recent state of the + persistent shell. + + command_id: The command ID for idempotency and tracking + + shell_name: The name of the persistent shell to create or use if already created. When using + a persistent shell, the command will run from the directory at the end of the + previous command and environment variables will be preserved. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT: + timeout = 600 + return await self._post( + f"/v1/devboxes/{id}/execute", + body=await async_maybe_transform( + { + "command": command, + "command_id": command_id, + "shell_name": shell_name, + }, + devbox_execute_params.DevboxExecuteParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + async def execute_async( self, id: str, @@ -2424,6 +2557,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.download_file, BinaryAPIResponse, ) + self.execute = to_raw_response_wrapper( + devboxes.execute, + ) self.execute_async = to_raw_response_wrapper( devboxes.execute_async, ) @@ -2518,6 +2654,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.download_file, AsyncBinaryAPIResponse, ) + self.execute = async_to_raw_response_wrapper( + devboxes.execute, + ) self.execute_async = async_to_raw_response_wrapper( devboxes.execute_async, ) @@ -2612,6 +2751,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.download_file, StreamedBinaryAPIResponse, ) + self.execute = to_streamed_response_wrapper( + devboxes.execute, + ) self.execute_async = to_streamed_response_wrapper( devboxes.execute_async, ) @@ -2706,6 +2848,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.download_file, AsyncStreamedBinaryAPIResponse, ) + self.execute = async_to_streamed_response_wrapper( + devboxes.execute, + ) self.execute_async = async_to_streamed_response_wrapper( devboxes.execute_async, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index e57d0b026..8b097686f 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -41,6 +41,7 @@ from .secret_update_params import SecretUpdateParams as SecretUpdateParams from .benchmark_list_params import BenchmarkListParams as BenchmarkListParams from .blueprint_list_params import BlueprintListParams as BlueprintListParams +from .devbox_execute_params import DevboxExecuteParams as DevboxExecuteParams from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView from .object_download_params import ObjectDownloadParams as ObjectDownloadParams from .repository_list_params import RepositoryListParams as RepositoryListParams diff --git a/src/runloop_api_client/types/devbox_execute_params.py b/src/runloop_api_client/types/devbox_execute_params.py new file mode 100644 index 000000000..6ac9d3632 --- /dev/null +++ b/src/runloop_api_client/types/devbox_execute_params.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +__all__ = ["DevboxExecuteParams"] + + +class DevboxExecuteParams(TypedDict, total=False): + command: Required[str] + """The command to execute via the Devbox shell. + + By default, commands are run from the user home directory unless shell_name is + specified. If shell_name is specified the command is run from the directory + based on the recent state of the persistent shell. + """ + + command_id: Required[str] + """The command ID for idempotency and tracking""" + + shell_name: Optional[str] + """The name of the persistent shell to create or use if already created. + + When using a persistent shell, the command will run from the directory at the + end of the previous command and environment variables will be preserved. + """ diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 4842d4b2f..c0d4e6dac 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -401,6 +401,62 @@ def test_path_params_download_file(self, client: Runloop) -> None: path="path", ) + @parametrize + def test_method_execute(self, client: Runloop) -> None: + devbox = client.devboxes.execute( + id="id", + command="command", + command_id="command_id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_method_execute_with_all_params(self, client: Runloop) -> None: + devbox = client.devboxes.execute( + id="id", + command="command", + command_id="command_id", + shell_name="shell_name", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_raw_response_execute(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.execute( + id="id", + command="command", + command_id="command_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + def test_streaming_response_execute(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.execute( + id="id", + command="command", + command_id="command_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_execute(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.execute( + id="", + command="command", + command_id="command_id", + ) + @parametrize def test_method_execute_async(self, client: Runloop) -> None: devbox = client.devboxes.execute_async( @@ -1335,6 +1391,62 @@ async def test_path_params_download_file(self, async_client: AsyncRunloop) -> No path="path", ) + @parametrize + async def test_method_execute(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.execute( + id="id", + command="command", + command_id="command_id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_method_execute_with_all_params(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.execute( + id="id", + command="command", + command_id="command_id", + shell_name="shell_name", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_raw_response_execute(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.execute( + id="id", + command="command", + command_id="command_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_execute(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.execute( + id="id", + command="command", + command_id="command_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_execute(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.execute( + id="", + command="command", + command_id="command_id", + ) + @parametrize async def test_method_execute_async(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.execute_async( From 2c7589180a0275e31846642c03f43baee415d341 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 22:13:13 +0000 Subject: [PATCH 857/993] feat(api): api update --- .stats.yml | 4 +- api.md | 1 + .../resources/devboxes/devboxes.py | 135 +++++++++++++++++- src/runloop_api_client/types/__init__.py | 1 + .../types/devbox_wait_for_command_params.py | 29 ++++ tests/api_resources/test_devboxes.py | 102 +++++++++++++ 6 files changed, 269 insertions(+), 3 deletions(-) create mode 100644 src/runloop_api_client/types/devbox_wait_for_command_params.py diff --git a/.stats.yml b/.stats.yml index 1e5d0d22d..921c7c927 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 103 +configured_endpoints: 104 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-0cb966ca566f4f3d7f8b4d3c37b24b4a117760dba194cb2c4f2bb4e3620027de.yml openapi_spec_hash: c969887eb721b42a423e662127270d57 -config_hash: b9de5d96e095a7e749a8c1fc3536c308 +config_hash: 98a0f112ecc9445456962dab3136d7b6 diff --git a/api.md b/api.md index c1fb93e0e..3d509e099 100644 --- a/api.md +++ b/api.md @@ -106,6 +106,7 @@ Methods: - client.devboxes.snapshot_disk_async(id, \*\*params) -> DevboxSnapshotView - client.devboxes.suspend(id) -> DevboxView - client.devboxes.upload_file(id, \*\*params) -> object +- client.devboxes.wait_for_command(id, \*\*params) -> DevboxView - client.devboxes.write_file_contents(id, \*\*params) -> DevboxExecutionDetailView ## DiskSnapshots diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index cbadea715..f4d9e4165 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Mapping, Iterable, Optional, cast +from typing import Dict, List, Mapping, Iterable, Optional, cast from typing_extensions import Literal import httpx @@ -35,6 +35,7 @@ devbox_execute_async_params, devbox_remove_tunnel_params, devbox_snapshot_disk_params, + devbox_wait_for_command_params, devbox_read_file_contents_params, devbox_list_disk_snapshots_params, devbox_snapshot_disk_async_params, @@ -1260,6 +1261,66 @@ def upload_file( cast_to=object, ) + def wait_for_command( + self, + id: str, + *, + statuses: List[ + Literal[ + "provisioning", "initializing", "running", "suspending", "suspended", "resuming", "failure", "shutdown" + ] + ], + timeout_seconds: Optional[int] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> DevboxView: + """ + Polls the Devbox's status until it reaches one of the desired statuses or times + out. + + Args: + statuses: The Devbox statuses to wait for. At least one status must be provided. The + devbox will be returned as soon as it reaches any of the provided statuses. + + timeout_seconds: (Optional) Timeout in seconds to wait for the status, up to 30 seconds. Defaults + to 10 seconds. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/wait_for_status", + body=maybe_transform( + { + "statuses": statuses, + "timeout_seconds": timeout_seconds, + }, + devbox_wait_for_command_params.DevboxWaitForCommandParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=DevboxView, + ) + def write_file_contents( self, id: str, @@ -2469,6 +2530,66 @@ async def upload_file( cast_to=object, ) + async def wait_for_command( + self, + id: str, + *, + statuses: List[ + Literal[ + "provisioning", "initializing", "running", "suspending", "suspended", "resuming", "failure", "shutdown" + ] + ], + timeout_seconds: Optional[int] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> DevboxView: + """ + Polls the Devbox's status until it reaches one of the desired statuses or times + out. + + Args: + statuses: The Devbox statuses to wait for. At least one status must be provided. The + devbox will be returned as soon as it reaches any of the provided statuses. + + timeout_seconds: (Optional) Timeout in seconds to wait for the status, up to 30 seconds. Defaults + to 10 seconds. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/wait_for_status", + body=await async_maybe_transform( + { + "statuses": statuses, + "timeout_seconds": timeout_seconds, + }, + devbox_wait_for_command_params.DevboxWaitForCommandParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=DevboxView, + ) + async def write_file_contents( self, id: str, @@ -2596,6 +2717,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.upload_file = to_raw_response_wrapper( devboxes.upload_file, ) + self.wait_for_command = to_raw_response_wrapper( + devboxes.wait_for_command, + ) self.write_file_contents = to_raw_response_wrapper( devboxes.write_file_contents, ) @@ -2693,6 +2817,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.upload_file = async_to_raw_response_wrapper( devboxes.upload_file, ) + self.wait_for_command = async_to_raw_response_wrapper( + devboxes.wait_for_command, + ) self.write_file_contents = async_to_raw_response_wrapper( devboxes.write_file_contents, ) @@ -2790,6 +2917,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.upload_file = to_streamed_response_wrapper( devboxes.upload_file, ) + self.wait_for_command = to_streamed_response_wrapper( + devboxes.wait_for_command, + ) self.write_file_contents = to_streamed_response_wrapper( devboxes.write_file_contents, ) @@ -2887,6 +3017,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.upload_file = async_to_streamed_response_wrapper( devboxes.upload_file, ) + self.wait_for_command = async_to_streamed_response_wrapper( + devboxes.wait_for_command, + ) self.write_file_contents = async_to_streamed_response_wrapper( devboxes.write_file_contents, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 8b097686f..4bae9f954 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -86,6 +86,7 @@ from .scoring_contract_update_param import ScoringContractUpdateParam as ScoringContractUpdateParam from .blueprint_build_logs_list_view import BlueprintBuildLogsListView as BlueprintBuildLogsListView from .devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse as DevboxCreateSSHKeyResponse +from .devbox_wait_for_command_params import DevboxWaitForCommandParams as DevboxWaitForCommandParams from .repository_connection_list_view import RepositoryConnectionListView as RepositoryConnectionListView from .repository_inspection_list_view import RepositoryInspectionListView as RepositoryInspectionListView from .devbox_read_file_contents_params import DevboxReadFileContentsParams as DevboxReadFileContentsParams diff --git a/src/runloop_api_client/types/devbox_wait_for_command_params.py b/src/runloop_api_client/types/devbox_wait_for_command_params.py new file mode 100644 index 000000000..fa50a1f87 --- /dev/null +++ b/src/runloop_api_client/types/devbox_wait_for_command_params.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["DevboxWaitForCommandParams"] + + +class DevboxWaitForCommandParams(TypedDict, total=False): + statuses: Required[ + List[ + Literal[ + "provisioning", "initializing", "running", "suspending", "suspended", "resuming", "failure", "shutdown" + ] + ] + ] + """The Devbox statuses to wait for. + + At least one status must be provided. The devbox will be returned as soon as it + reaches any of the provided statuses. + """ + + timeout_seconds: Optional[int] + """(Optional) Timeout in seconds to wait for the status, up to 30 seconds. + + Defaults to 10 seconds. + """ diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index c0d4e6dac..09dc30160 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -976,6 +976,57 @@ def test_path_params_upload_file(self, client: Runloop) -> None: path="path", ) + @parametrize + def test_method_wait_for_command(self, client: Runloop) -> None: + devbox = client.devboxes.wait_for_command( + id="id", + statuses=["provisioning"], + ) + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + def test_method_wait_for_command_with_all_params(self, client: Runloop) -> None: + devbox = client.devboxes.wait_for_command( + id="id", + statuses=["provisioning"], + timeout_seconds=0, + ) + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + def test_raw_response_wait_for_command(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.wait_for_command( + id="id", + statuses=["provisioning"], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + def test_streaming_response_wait_for_command(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.wait_for_command( + id="id", + statuses=["provisioning"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_wait_for_command(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.wait_for_command( + id="", + statuses=["provisioning"], + ) + @parametrize def test_method_write_file_contents(self, client: Runloop) -> None: devbox = client.devboxes.write_file_contents( @@ -1966,6 +2017,57 @@ async def test_path_params_upload_file(self, async_client: AsyncRunloop) -> None path="path", ) + @parametrize + async def test_method_wait_for_command(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.wait_for_command( + id="id", + statuses=["provisioning"], + ) + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + async def test_method_wait_for_command_with_all_params(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.wait_for_command( + id="id", + statuses=["provisioning"], + timeout_seconds=0, + ) + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + async def test_raw_response_wait_for_command(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.wait_for_command( + id="id", + statuses=["provisioning"], + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_wait_for_command(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.wait_for_command( + id="id", + statuses=["provisioning"], + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_wait_for_command(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.wait_for_command( + id="", + statuses=["provisioning"], + ) + @parametrize async def test_method_write_file_contents(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.write_file_contents( From bb3241b8535bedeb5dc781be9a9ebda1c9a92310 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 10 Sep 2025 17:43:55 +0000 Subject: [PATCH 858/993] feat(api): api update --- .stats.yml | 2 +- api.md | 2 +- .../resources/devboxes/devboxes.py | 68 +++++++-------- .../types/devbox_wait_for_command_params.py | 20 ++--- tests/api_resources/test_devboxes.py | 84 ++++++++++++------- 5 files changed, 98 insertions(+), 78 deletions(-) diff --git a/.stats.yml b/.stats.yml index 921c7c927..00e38fa1c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 104 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-0cb966ca566f4f3d7f8b4d3c37b24b4a117760dba194cb2c4f2bb4e3620027de.yml openapi_spec_hash: c969887eb721b42a423e662127270d57 -config_hash: 98a0f112ecc9445456962dab3136d7b6 +config_hash: 3a4634de0976f3fbd7f3a5c4911d2add diff --git a/api.md b/api.md index 3d509e099..3f1aa295f 100644 --- a/api.md +++ b/api.md @@ -106,7 +106,7 @@ Methods: - client.devboxes.snapshot_disk_async(id, \*\*params) -> DevboxSnapshotView - client.devboxes.suspend(id) -> DevboxView - client.devboxes.upload_file(id, \*\*params) -> object -- client.devboxes.wait_for_command(id, \*\*params) -> DevboxView +- client.devboxes.wait_for_command(execution_id, \*, devbox_id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.write_file_contents(id, \*\*params) -> DevboxExecutionDetailView ## DiskSnapshots diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index f4d9e4165..90a130cfb 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -1263,13 +1263,10 @@ def upload_file( def wait_for_command( self, - id: str, + execution_id: str, *, - statuses: List[ - Literal[ - "provisioning", "initializing", "running", "suspending", "suspended", "resuming", "failure", "shutdown" - ] - ], + devbox_id: str, + statuses: List[Literal["queued", "running", "completed"]], timeout_seconds: Optional[int] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1278,17 +1275,18 @@ def wait_for_command( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> DevboxView: + ) -> DevboxAsyncExecutionDetailView: """ - Polls the Devbox's status until it reaches one of the desired statuses or times - out. + Polls the asynchronous execution's status until it reaches one of the desired + statuses or times out. Defaults to 60 seconds. Args: - statuses: The Devbox statuses to wait for. At least one status must be provided. The - devbox will be returned as soon as it reaches any of the provided statuses. + statuses: The command execution statuses to wait for. At least one status must be + provided. The command will be returned as soon as it reaches any of the provided + statuses. - timeout_seconds: (Optional) Timeout in seconds to wait for the status, up to 30 seconds. Defaults - to 10 seconds. + timeout_seconds: (Optional) Timeout in seconds to wait for the status, up to 60 seconds. Defaults + to 60 seconds. extra_headers: Send extra headers @@ -1300,10 +1298,12 @@ def wait_for_command( idempotency_key: Specify a custom idempotency key for this request """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not devbox_id: + raise ValueError(f"Expected a non-empty value for `devbox_id` but received {devbox_id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") return self._post( - f"/v1/devboxes/{id}/wait_for_status", + f"/v1/devboxes/{devbox_id}/executions/{execution_id}/wait_for_status", body=maybe_transform( { "statuses": statuses, @@ -1318,7 +1318,7 @@ def wait_for_command( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=DevboxView, + cast_to=DevboxAsyncExecutionDetailView, ) def write_file_contents( @@ -2532,13 +2532,10 @@ async def upload_file( async def wait_for_command( self, - id: str, + execution_id: str, *, - statuses: List[ - Literal[ - "provisioning", "initializing", "running", "suspending", "suspended", "resuming", "failure", "shutdown" - ] - ], + devbox_id: str, + statuses: List[Literal["queued", "running", "completed"]], timeout_seconds: Optional[int] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2547,17 +2544,18 @@ async def wait_for_command( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> DevboxView: + ) -> DevboxAsyncExecutionDetailView: """ - Polls the Devbox's status until it reaches one of the desired statuses or times - out. + Polls the asynchronous execution's status until it reaches one of the desired + statuses or times out. Defaults to 60 seconds. Args: - statuses: The Devbox statuses to wait for. At least one status must be provided. The - devbox will be returned as soon as it reaches any of the provided statuses. + statuses: The command execution statuses to wait for. At least one status must be + provided. The command will be returned as soon as it reaches any of the provided + statuses. - timeout_seconds: (Optional) Timeout in seconds to wait for the status, up to 30 seconds. Defaults - to 10 seconds. + timeout_seconds: (Optional) Timeout in seconds to wait for the status, up to 60 seconds. Defaults + to 60 seconds. extra_headers: Send extra headers @@ -2569,10 +2567,12 @@ async def wait_for_command( idempotency_key: Specify a custom idempotency key for this request """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + if not devbox_id: + raise ValueError(f"Expected a non-empty value for `devbox_id` but received {devbox_id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") return await self._post( - f"/v1/devboxes/{id}/wait_for_status", + f"/v1/devboxes/{devbox_id}/executions/{execution_id}/wait_for_status", body=await async_maybe_transform( { "statuses": statuses, @@ -2587,7 +2587,7 @@ async def wait_for_command( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=DevboxView, + cast_to=DevboxAsyncExecutionDetailView, ) async def write_file_contents( diff --git a/src/runloop_api_client/types/devbox_wait_for_command_params.py b/src/runloop_api_client/types/devbox_wait_for_command_params.py index fa50a1f87..93cf7e1e5 100644 --- a/src/runloop_api_client/types/devbox_wait_for_command_params.py +++ b/src/runloop_api_client/types/devbox_wait_for_command_params.py @@ -9,21 +9,17 @@ class DevboxWaitForCommandParams(TypedDict, total=False): - statuses: Required[ - List[ - Literal[ - "provisioning", "initializing", "running", "suspending", "suspended", "resuming", "failure", "shutdown" - ] - ] - ] - """The Devbox statuses to wait for. - - At least one status must be provided. The devbox will be returned as soon as it + devbox_id: Required[str] + + statuses: Required[List[Literal["queued", "running", "completed"]]] + """The command execution statuses to wait for. + + At least one status must be provided. The command will be returned as soon as it reaches any of the provided statuses. """ timeout_seconds: Optional[int] - """(Optional) Timeout in seconds to wait for the status, up to 30 seconds. + """(Optional) Timeout in seconds to wait for the status, up to 60 seconds. - Defaults to 10 seconds. + Defaults to 60 seconds. """ diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 09dc30160..061bb366f 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -979,52 +979,64 @@ def test_path_params_upload_file(self, client: Runloop) -> None: @parametrize def test_method_wait_for_command(self, client: Runloop) -> None: devbox = client.devboxes.wait_for_command( - id="id", - statuses=["provisioning"], + execution_id="execution_id", + devbox_id="devbox_id", + statuses=["queued"], ) - assert_matches_type(DevboxView, devbox, path=["response"]) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) @parametrize def test_method_wait_for_command_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.wait_for_command( - id="id", - statuses=["provisioning"], + execution_id="execution_id", + devbox_id="devbox_id", + statuses=["queued"], timeout_seconds=0, ) - assert_matches_type(DevboxView, devbox, path=["response"]) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) @parametrize def test_raw_response_wait_for_command(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.wait_for_command( - id="id", - statuses=["provisioning"], + execution_id="execution_id", + devbox_id="devbox_id", + statuses=["queued"], ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert_matches_type(DevboxView, devbox, path=["response"]) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) @parametrize def test_streaming_response_wait_for_command(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.wait_for_command( - id="id", - statuses=["provisioning"], + execution_id="execution_id", + devbox_id="devbox_id", + statuses=["queued"], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = response.parse() - assert_matches_type(DevboxView, devbox, path=["response"]) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_wait_for_command(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `devbox_id` but received ''"): client.devboxes.with_raw_response.wait_for_command( - id="", - statuses=["provisioning"], + execution_id="execution_id", + devbox_id="", + statuses=["queued"], + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + client.devboxes.with_raw_response.wait_for_command( + execution_id="", + devbox_id="devbox_id", + statuses=["queued"], ) @parametrize @@ -2020,52 +2032,64 @@ async def test_path_params_upload_file(self, async_client: AsyncRunloop) -> None @parametrize async def test_method_wait_for_command(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.wait_for_command( - id="id", - statuses=["provisioning"], + execution_id="execution_id", + devbox_id="devbox_id", + statuses=["queued"], ) - assert_matches_type(DevboxView, devbox, path=["response"]) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) @parametrize async def test_method_wait_for_command_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.wait_for_command( - id="id", - statuses=["provisioning"], + execution_id="execution_id", + devbox_id="devbox_id", + statuses=["queued"], timeout_seconds=0, ) - assert_matches_type(DevboxView, devbox, path=["response"]) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) @parametrize async def test_raw_response_wait_for_command(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.wait_for_command( - id="id", - statuses=["provisioning"], + execution_id="execution_id", + devbox_id="devbox_id", + statuses=["queued"], ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert_matches_type(DevboxView, devbox, path=["response"]) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) @parametrize async def test_streaming_response_wait_for_command(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.wait_for_command( - id="id", - statuses=["provisioning"], + execution_id="execution_id", + devbox_id="devbox_id", + statuses=["queued"], ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" devbox = await response.parse() - assert_matches_type(DevboxView, devbox, path=["response"]) + assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_wait_for_command(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `devbox_id` but received ''"): await async_client.devboxes.with_raw_response.wait_for_command( - id="", - statuses=["provisioning"], + execution_id="execution_id", + devbox_id="", + statuses=["queued"], + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + await async_client.devboxes.with_raw_response.wait_for_command( + execution_id="", + devbox_id="devbox_id", + statuses=["queued"], ) @parametrize From 1208bd54f6f57dce30a196188c68f5175d51d811 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 10 Sep 2025 20:48:47 +0000 Subject: [PATCH 859/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 00e38fa1c..bfc06aa5b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 104 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-0cb966ca566f4f3d7f8b4d3c37b24b4a117760dba194cb2c4f2bb4e3620027de.yml openapi_spec_hash: c969887eb721b42a423e662127270d57 -config_hash: 3a4634de0976f3fbd7f3a5c4911d2add +config_hash: 103c1928ef462db5a22f26ca92caf7fe From 97435981b8c41aca93b99ff45e9c7fbf464c751b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 10 Sep 2025 21:17:39 +0000 Subject: [PATCH 860/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 85c311828..284ce936c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.59.0" + ".": "0.60.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 720acb4e6..abb26cdfe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.59.0" +version = "0.60.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 533907a8a..23fb0da51 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.59.0" # x-release-please-version +__version__ = "0.60.0" # x-release-please-version From 873d71cacc8496173f31d041f9d4c2fa3af8c185 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 11 Sep 2025 18:37:21 +0000 Subject: [PATCH 861/993] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index bfc06aa5b..00e38fa1c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 104 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-0cb966ca566f4f3d7f8b4d3c37b24b4a117760dba194cb2c4f2bb4e3620027de.yml openapi_spec_hash: c969887eb721b42a423e662127270d57 -config_hash: 103c1928ef462db5a22f26ca92caf7fe +config_hash: 3a4634de0976f3fbd7f3a5c4911d2add From 1fa77c18ea0ec383198ab06605040efed71531c2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Sep 2025 02:32:38 +0000 Subject: [PATCH 862/993] chore(internal): update pydantic dependency --- requirements-dev.lock | 7 +++++-- requirements.lock | 7 +++++-- src/runloop_api_client/_models.py | 14 ++++++++++---- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index 2a74d01aa..53b125c3c 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -88,9 +88,9 @@ pluggy==1.5.0 propcache==0.3.1 # via aiohttp # via yarl -pydantic==2.10.3 +pydantic==2.11.9 # via runloop-api-client -pydantic-core==2.27.1 +pydantic-core==2.33.2 # via pydantic pygments==2.18.0 # via rich @@ -126,6 +126,9 @@ typing-extensions==4.12.2 # via pydantic-core # via pyright # via runloop-api-client + # via typing-inspection +typing-inspection==0.4.1 + # via pydantic virtualenv==20.24.5 # via nox yarl==1.20.0 diff --git a/requirements.lock b/requirements.lock index d96106522..281973f09 100644 --- a/requirements.lock +++ b/requirements.lock @@ -55,9 +55,9 @@ multidict==6.4.4 propcache==0.3.1 # via aiohttp # via yarl -pydantic==2.10.3 +pydantic==2.11.9 # via runloop-api-client -pydantic-core==2.27.1 +pydantic-core==2.33.2 # via pydantic sniffio==1.3.0 # via anyio @@ -68,5 +68,8 @@ typing-extensions==4.12.2 # via pydantic # via pydantic-core # via runloop-api-client + # via typing-inspection +typing-inspection==0.4.1 + # via pydantic yarl==1.20.0 # via aiohttp diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index 3a6017ef2..6a3cd1d26 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -256,7 +256,7 @@ def model_dump( mode: Literal["json", "python"] | str = "python", include: IncEx | None = None, exclude: IncEx | None = None, - by_alias: bool = False, + by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, @@ -264,6 +264,7 @@ def model_dump( warnings: bool | Literal["none", "warn", "error"] = True, context: dict[str, Any] | None = None, serialize_as_any: bool = False, + fallback: Callable[[Any], Any] | None = None, ) -> dict[str, Any]: """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump @@ -295,10 +296,12 @@ def model_dump( raise ValueError("context is only supported in Pydantic v2") if serialize_as_any != False: raise ValueError("serialize_as_any is only supported in Pydantic v2") + if fallback is not None: + raise ValueError("fallback is only supported in Pydantic v2") dumped = super().dict( # pyright: ignore[reportDeprecated] include=include, exclude=exclude, - by_alias=by_alias, + by_alias=by_alias if by_alias is not None else False, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, exclude_none=exclude_none, @@ -313,13 +316,14 @@ def model_dump_json( indent: int | None = None, include: IncEx | None = None, exclude: IncEx | None = None, - by_alias: bool = False, + by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, round_trip: bool = False, warnings: bool | Literal["none", "warn", "error"] = True, context: dict[str, Any] | None = None, + fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False, ) -> str: """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json @@ -348,11 +352,13 @@ def model_dump_json( raise ValueError("context is only supported in Pydantic v2") if serialize_as_any != False: raise ValueError("serialize_as_any is only supported in Pydantic v2") + if fallback is not None: + raise ValueError("fallback is only supported in Pydantic v2") return super().json( # type: ignore[reportDeprecated] indent=indent, include=include, exclude=exclude, - by_alias=by_alias, + by_alias=by_alias if by_alias is not None else False, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, exclude_none=exclude_none, From 4b72189a85ae7d6432f0941c5fdb21937bc45f42 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Sep 2025 02:37:24 +0000 Subject: [PATCH 863/993] chore(types): change optional parameter type from NotGiven to Omit --- src/runloop_api_client/__init__.py | 4 +- src/runloop_api_client/_base_client.py | 18 +- src/runloop_api_client/_client.py | 16 +- src/runloop_api_client/_qs.py | 14 +- src/runloop_api_client/_types.py | 29 ++- src/runloop_api_client/_utils/_transform.py | 4 +- src/runloop_api_client/_utils/_utils.py | 8 +- .../resources/benchmarks/benchmarks.py | 114 ++++----- .../resources/benchmarks/runs.py | 48 ++-- .../resources/blueprints.py | 126 +++++----- .../resources/devboxes/browsers.py | 14 +- .../resources/devboxes/computers.py | 38 +-- .../resources/devboxes/devboxes.py | 218 +++++++++--------- .../resources/devboxes/disk_snapshots.py | 46 ++-- .../resources/devboxes/executions.py | 50 ++-- .../resources/devboxes/logs.py | 14 +- .../resources/devboxes/lsp.py | 86 +++---- src/runloop_api_client/resources/objects.py | 86 +++---- .../resources/repositories.py | 58 ++--- .../resources/scenarios/runs.py | 38 +-- .../resources/scenarios/scenarios.py | 130 +++++------ .../resources/scenarios/scorers.py | 34 +-- src/runloop_api_client/resources/secrets.py | 22 +- tests/test_transform.py | 11 +- 24 files changed, 620 insertions(+), 606 deletions(-) diff --git a/src/runloop_api_client/__init__.py b/src/runloop_api_client/__init__.py index 2c679e1f1..d6be57db2 100644 --- a/src/runloop_api_client/__init__.py +++ b/src/runloop_api_client/__init__.py @@ -3,7 +3,7 @@ import typing as _t from . import types -from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes +from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given from ._utils import file_from_path from ._client import Client, Stream, Runloop, Timeout, Transport, AsyncClient, AsyncStream, AsyncRunloop, RequestOptions from ._models import BaseModel @@ -38,7 +38,9 @@ "ProxiesTypes", "NotGiven", "NOT_GIVEN", + "not_given", "Omit", + "omit", "RunloopError", "APIError", "APIStatusError", diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index 5233ec37d..f639d4201 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -42,7 +42,6 @@ from ._qs import Querystring from ._files import to_httpx_files, async_to_httpx_files from ._types import ( - NOT_GIVEN, Body, Omit, Query, @@ -57,6 +56,7 @@ RequestOptions, HttpxRequestFiles, ModelBuilderProtocol, + not_given, ) from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping from ._compat import PYDANTIC_V1, model_copy, model_dump @@ -145,9 +145,9 @@ def __init__( def __init__( self, *, - url: URL | NotGiven = NOT_GIVEN, - json: Body | NotGiven = NOT_GIVEN, - params: Query | NotGiven = NOT_GIVEN, + url: URL | NotGiven = not_given, + json: Body | NotGiven = not_given, + params: Query | NotGiven = not_given, ) -> None: self.url = url self.json = json @@ -595,7 +595,7 @@ def _maybe_override_cast_to(self, cast_to: type[ResponseT], options: FinalReques # we internally support defining a temporary header to override the # default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response` # see _response.py for implementation details - override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, NOT_GIVEN) + override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, not_given) if is_given(override_cast_to): options.headers = headers return cast(Type[ResponseT], override_cast_to) @@ -825,7 +825,7 @@ def __init__( version: str, base_url: str | URL, max_retries: int = DEFAULT_MAX_RETRIES, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.Client | None = None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, @@ -1356,7 +1356,7 @@ def __init__( base_url: str | URL, _strict_response_validation: bool, max_retries: int = DEFAULT_MAX_RETRIES, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.AsyncClient | None = None, custom_headers: Mapping[str, str] | None = None, custom_query: Mapping[str, object] | None = None, @@ -1818,8 +1818,8 @@ def make_request_options( extra_query: Query | None = None, extra_body: Body | None = None, idempotency_key: str | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - post_parser: PostParser | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + post_parser: PostParser | NotGiven = not_given, ) -> RequestOptions: """Create a dict of type RequestOptions without keys of NotGiven values.""" options: RequestOptions = {} diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index ace01b2ee..5ffec7733 100644 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Union, Mapping +from typing import Any, Mapping from typing_extensions import Self, override import httpx @@ -11,13 +11,13 @@ from . import _exceptions from ._qs import Querystring from ._types import ( - NOT_GIVEN, Omit, Timeout, NotGiven, Transport, ProxiesTypes, RequestOptions, + not_given, ) from ._utils import is_given, get_async_library from ._version import __version__ @@ -55,7 +55,7 @@ def __init__( *, bearer_token: str | None = None, base_url: str | httpx.URL | None = None, - timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, max_retries: int = DEFAULT_MAX_RETRIES, default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, @@ -138,9 +138,9 @@ def copy( *, bearer_token: str | None = None, base_url: str | httpx.URL | None = None, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.Client | None = None, - max_retries: int | NotGiven = NOT_GIVEN, + max_retries: int | NotGiven = not_given, default_headers: Mapping[str, str] | None = None, set_default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, @@ -237,7 +237,7 @@ def __init__( *, bearer_token: str | None = None, base_url: str | httpx.URL | None = None, - timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, max_retries: int = DEFAULT_MAX_RETRIES, default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, @@ -320,9 +320,9 @@ def copy( *, bearer_token: str | None = None, base_url: str | httpx.URL | None = None, - timeout: float | Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | Timeout | None | NotGiven = not_given, http_client: httpx.AsyncClient | None = None, - max_retries: int | NotGiven = NOT_GIVEN, + max_retries: int | NotGiven = not_given, default_headers: Mapping[str, str] | None = None, set_default_headers: Mapping[str, str] | None = None, default_query: Mapping[str, object] | None = None, diff --git a/src/runloop_api_client/_qs.py b/src/runloop_api_client/_qs.py index 274320ca5..ada6fd3f7 100644 --- a/src/runloop_api_client/_qs.py +++ b/src/runloop_api_client/_qs.py @@ -4,7 +4,7 @@ from urllib.parse import parse_qs, urlencode from typing_extensions import Literal, get_args -from ._types import NOT_GIVEN, NotGiven, NotGivenOr +from ._types import NotGiven, not_given from ._utils import flatten _T = TypeVar("_T") @@ -41,8 +41,8 @@ def stringify( self, params: Params, *, - array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, - nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + array_format: ArrayFormat | NotGiven = not_given, + nested_format: NestedFormat | NotGiven = not_given, ) -> str: return urlencode( self.stringify_items( @@ -56,8 +56,8 @@ def stringify_items( self, params: Params, *, - array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, - nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + array_format: ArrayFormat | NotGiven = not_given, + nested_format: NestedFormat | NotGiven = not_given, ) -> list[tuple[str, str]]: opts = Options( qs=self, @@ -143,8 +143,8 @@ def __init__( self, qs: Querystring = _qs, *, - array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN, - nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN, + array_format: ArrayFormat | NotGiven = not_given, + nested_format: NestedFormat | NotGiven = not_given, ) -> None: self.array_format = qs.array_format if isinstance(array_format, NotGiven) else array_format self.nested_format = qs.nested_format if isinstance(nested_format, NotGiven) else nested_format diff --git a/src/runloop_api_client/_types.py b/src/runloop_api_client/_types.py index 46042bd52..a2a12e84e 100644 --- a/src/runloop_api_client/_types.py +++ b/src/runloop_api_client/_types.py @@ -117,18 +117,21 @@ class RequestOptions(TypedDict, total=False): # Sentinel class used until PEP 0661 is accepted class NotGiven: """ - A sentinel singleton class used to distinguish omitted keyword arguments - from those passed in with the value None (which may have different behavior). + For parameters with a meaningful None value, we need to distinguish between + the user explicitly passing None, and the user not passing the parameter at + all. + + User code shouldn't need to use not_given directly. For example: ```py - def get(timeout: Union[int, NotGiven, None] = NotGiven()) -> Response: ... + def create(timeout: Timeout | None | NotGiven = not_given): ... - get(timeout=1) # 1s timeout - get(timeout=None) # No timeout - get() # Default timeout behavior, which may not be statically known at the method definition. + create(timeout=1) # 1s timeout + create(timeout=None) # No timeout + create() # Default timeout behavior ``` """ @@ -140,13 +143,14 @@ def __repr__(self) -> str: return "NOT_GIVEN" -NotGivenOr = Union[_T, NotGiven] +not_given = NotGiven() +# for backwards compatibility: NOT_GIVEN = NotGiven() class Omit: - """In certain situations you need to be able to represent a case where a default value has - to be explicitly removed and `None` is not an appropriate substitute, for example: + """ + To explicitly omit something from being sent in a request, use `omit`. ```py # as the default `Content-Type` header is `application/json` that will be sent @@ -156,8 +160,8 @@ class Omit: # to look something like: 'multipart/form-data; boundary=0d8382fcf5f8c3be01ca2e11002d2983' client.post(..., headers={"Content-Type": "multipart/form-data"}) - # instead you can remove the default `application/json` header by passing Omit - client.post(..., headers={"Content-Type": Omit()}) + # instead you can remove the default `application/json` header by passing omit + client.post(..., headers={"Content-Type": omit}) ``` """ @@ -165,6 +169,9 @@ def __bool__(self) -> Literal[False]: return False +omit = Omit() + + @runtime_checkable class ModelBuilderProtocol(Protocol): @classmethod diff --git a/src/runloop_api_client/_utils/_transform.py b/src/runloop_api_client/_utils/_transform.py index c19124f0d..520754920 100644 --- a/src/runloop_api_client/_utils/_transform.py +++ b/src/runloop_api_client/_utils/_transform.py @@ -268,7 +268,7 @@ def _transform_typeddict( annotations = get_type_hints(expected_type, include_extras=True) for key, value in data.items(): if not is_given(value): - # we don't need to include `NotGiven` values here as they'll + # we don't need to include omitted values here as they'll # be stripped out before the request is sent anyway continue @@ -434,7 +434,7 @@ async def _async_transform_typeddict( annotations = get_type_hints(expected_type, include_extras=True) for key, value in data.items(): if not is_given(value): - # we don't need to include `NotGiven` values here as they'll + # we don't need to include omitted values here as they'll # be stripped out before the request is sent anyway continue diff --git a/src/runloop_api_client/_utils/_utils.py b/src/runloop_api_client/_utils/_utils.py index f0818595d..50d59269a 100644 --- a/src/runloop_api_client/_utils/_utils.py +++ b/src/runloop_api_client/_utils/_utils.py @@ -21,7 +21,7 @@ import sniffio -from .._types import NotGiven, FileTypes, NotGivenOr, HeadersLike +from .._types import Omit, NotGiven, FileTypes, HeadersLike _T = TypeVar("_T") _TupleT = TypeVar("_TupleT", bound=Tuple[object, ...]) @@ -63,7 +63,7 @@ def _extract_items( try: key = path[index] except IndexError: - if isinstance(obj, NotGiven): + if not is_given(obj): # no value was provided - we can safely ignore return [] @@ -126,8 +126,8 @@ def _extract_items( return [] -def is_given(obj: NotGivenOr[_T]) -> TypeGuard[_T]: - return not isinstance(obj, NotGiven) +def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]: + return not isinstance(obj, NotGiven) and not isinstance(obj, Omit) # Type safe methods for narrowing types with TypeVars. diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py index 12de4d42a..c30885e9e 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -22,7 +22,7 @@ benchmark_definitions_params, benchmark_list_public_params, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -70,18 +70,18 @@ def create( self, *, name: str, - attribution: Optional[str] | NotGiven = NOT_GIVEN, - description: Optional[str] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - required_environment_variables: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - required_secret_names: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - scenario_ids: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + attribution: Optional[str] | Omit = omit, + description: Optional[str] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + required_environment_variables: Optional[SequenceNotStr[str]] | Omit = omit, + required_secret_names: SequenceNotStr[str] | Omit = omit, + scenario_ids: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BenchmarkView: """ @@ -148,7 +148,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BenchmarkView: """ Get a previously created Benchmark. @@ -177,18 +177,18 @@ def update( id: str, *, name: str, - attribution: Optional[str] | NotGiven = NOT_GIVEN, - description: Optional[str] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - required_environment_variables: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - required_secret_names: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - scenario_ids: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + attribution: Optional[str] | Omit = omit, + description: Optional[str] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + required_environment_variables: Optional[SequenceNotStr[str]] | Omit = omit, + required_secret_names: SequenceNotStr[str] | Omit = omit, + scenario_ids: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BenchmarkView: """ @@ -251,14 +251,14 @@ def update( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncBenchmarksCursorIDPage[BenchmarkView]: """ List all Benchmarks matching filter. @@ -299,14 +299,14 @@ def definitions( self, id: str, *, - limit: int | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScenarioDefinitionListView: """ Get scenario definitions for a previously created Benchmark. @@ -347,14 +347,14 @@ def definitions( def list_public( self, *, - limit: int | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncBenchmarksCursorIDPage[BenchmarkView]: """ List all public benchmarks matching filter. @@ -395,15 +395,15 @@ def start_run( self, *, benchmark_id: str, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - run_name: Optional[str] | NotGiven = NOT_GIVEN, - run_profile: Optional[RunProfile] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | Omit = omit, + run_name: Optional[str] | Omit = omit, + run_profile: Optional[RunProfile] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BenchmarkRunView: """ @@ -478,18 +478,18 @@ async def create( self, *, name: str, - attribution: Optional[str] | NotGiven = NOT_GIVEN, - description: Optional[str] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - required_environment_variables: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - required_secret_names: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - scenario_ids: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + attribution: Optional[str] | Omit = omit, + description: Optional[str] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + required_environment_variables: Optional[SequenceNotStr[str]] | Omit = omit, + required_secret_names: SequenceNotStr[str] | Omit = omit, + scenario_ids: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BenchmarkView: """ @@ -556,7 +556,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BenchmarkView: """ Get a previously created Benchmark. @@ -585,18 +585,18 @@ async def update( id: str, *, name: str, - attribution: Optional[str] | NotGiven = NOT_GIVEN, - description: Optional[str] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - required_environment_variables: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - required_secret_names: SequenceNotStr[str] | NotGiven = NOT_GIVEN, - scenario_ids: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + attribution: Optional[str] | Omit = omit, + description: Optional[str] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + required_environment_variables: Optional[SequenceNotStr[str]] | Omit = omit, + required_secret_names: SequenceNotStr[str] | Omit = omit, + scenario_ids: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BenchmarkView: """ @@ -659,14 +659,14 @@ async def update( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[BenchmarkView, AsyncBenchmarksCursorIDPage[BenchmarkView]]: """ List all Benchmarks matching filter. @@ -707,14 +707,14 @@ async def definitions( self, id: str, *, - limit: int | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScenarioDefinitionListView: """ Get scenario definitions for a previously created Benchmark. @@ -755,14 +755,14 @@ async def definitions( def list_public( self, *, - limit: int | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[BenchmarkView, AsyncBenchmarksCursorIDPage[BenchmarkView]]: """ List all public benchmarks matching filter. @@ -803,15 +803,15 @@ async def start_run( self, *, benchmark_id: str, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - run_name: Optional[str] | NotGiven = NOT_GIVEN, - run_profile: Optional[RunProfile] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | Omit = omit, + run_name: Optional[str] | Omit = omit, + run_profile: Optional[RunProfile] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BenchmarkRunView: """ diff --git a/src/runloop_api_client/resources/benchmarks/runs.py b/src/runloop_api_client/resources/benchmarks/runs.py index ce86a527c..6d69d160b 100644 --- a/src/runloop_api_client/resources/benchmarks/runs.py +++ b/src/runloop_api_client/resources/benchmarks/runs.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -54,7 +54,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BenchmarkRunView: """ Get a BenchmarkRun given ID. @@ -81,15 +81,15 @@ def retrieve( def list( self, *, - benchmark_id: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + benchmark_id: str | Omit = omit, + limit: int | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncBenchmarkRunsCursorIDPage[BenchmarkRunView]: """ List all BenchmarkRuns matching filter. @@ -138,7 +138,7 @@ def cancel( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BenchmarkRunView: """ @@ -178,7 +178,7 @@ def complete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BenchmarkRunView: """ @@ -213,16 +213,15 @@ def list_scenario_runs( self, id: str, *, - limit: int | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, - state: Literal["running", "scoring", "scored", "completed", "canceled", "timeout", "failed"] - | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + starting_after: str | Omit = omit, + state: Literal["running", "scoring", "scored", "completed", "canceled", "timeout", "failed"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncBenchmarkRunsCursorIDPage[ScenarioRunView]: """ List started scenario runs for a benchmark run. @@ -294,7 +293,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BenchmarkRunView: """ Get a BenchmarkRun given ID. @@ -321,15 +320,15 @@ async def retrieve( def list( self, *, - benchmark_id: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + benchmark_id: str | Omit = omit, + limit: int | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[BenchmarkRunView, AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView]]: """ List all BenchmarkRuns matching filter. @@ -378,7 +377,7 @@ async def cancel( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BenchmarkRunView: """ @@ -418,7 +417,7 @@ async def complete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BenchmarkRunView: """ @@ -453,16 +452,15 @@ def list_scenario_runs( self, id: str, *, - limit: int | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, - state: Literal["running", "scoring", "scored", "completed", "canceled", "timeout", "failed"] - | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + starting_after: str | Omit = omit, + state: Literal["running", "scoring", "scored", "completed", "canceled", "timeout", "failed"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ScenarioRunView, AsyncBenchmarkRunsCursorIDPage[ScenarioRunView]]: """ List started scenario runs for a benchmark run. diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index 0fe1679a8..d92cbd36b 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -12,7 +12,7 @@ blueprint_preview_params, blueprint_list_public_params, ) -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr +from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -57,21 +57,21 @@ def create( self, *, name: str, - base_blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, - base_blueprint_name: Optional[str] | NotGiven = NOT_GIVEN, - code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, - dockerfile: Optional[str] | NotGiven = NOT_GIVEN, - file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - services: Optional[Iterable[blueprint_create_params.Service]] | NotGiven = NOT_GIVEN, - system_setup_commands: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + base_blueprint_id: Optional[str] | Omit = omit, + base_blueprint_name: Optional[str] | Omit = omit, + code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, + dockerfile: Optional[str] | Omit = omit, + file_mounts: Optional[Dict[str, str]] | Omit = omit, + launch_parameters: Optional[LaunchParameters] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit, + system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BlueprintView: """Starts build of custom defined container Blueprint. @@ -154,7 +154,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BlueprintView: """ Get the details of a previously created Blueprint including the build status. @@ -181,15 +181,15 @@ def retrieve( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + name: str | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncBlueprintsCursorIDPage[BlueprintView]: """ List all Blueprints or filter by name. @@ -238,7 +238,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> object: """ @@ -272,15 +272,15 @@ def delete( def list_public( self, *, - limit: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + name: str | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncBlueprintsCursorIDPage[BlueprintView]: """ List all public Blueprints that are available to all users. @@ -329,7 +329,7 @@ def logs( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BlueprintBuildLogsListView: """ Get all logs from the building of a Blueprint. @@ -357,21 +357,21 @@ def preview( self, *, name: str, - base_blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, - base_blueprint_name: Optional[str] | NotGiven = NOT_GIVEN, - code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, - dockerfile: Optional[str] | NotGiven = NOT_GIVEN, - file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - services: Optional[Iterable[blueprint_preview_params.Service]] | NotGiven = NOT_GIVEN, - system_setup_commands: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + base_blueprint_id: Optional[str] | Omit = omit, + base_blueprint_name: Optional[str] | Omit = omit, + code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, + dockerfile: Optional[str] | Omit = omit, + file_mounts: Optional[Dict[str, str]] | Omit = omit, + launch_parameters: Optional[LaunchParameters] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + services: Optional[Iterable[blueprint_preview_params.Service]] | Omit = omit, + system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BlueprintPreviewView: """Preview building a Blueprint with the specified configuration. @@ -468,21 +468,21 @@ async def create( self, *, name: str, - base_blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, - base_blueprint_name: Optional[str] | NotGiven = NOT_GIVEN, - code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, - dockerfile: Optional[str] | NotGiven = NOT_GIVEN, - file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - services: Optional[Iterable[blueprint_create_params.Service]] | NotGiven = NOT_GIVEN, - system_setup_commands: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + base_blueprint_id: Optional[str] | Omit = omit, + base_blueprint_name: Optional[str] | Omit = omit, + code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, + dockerfile: Optional[str] | Omit = omit, + file_mounts: Optional[Dict[str, str]] | Omit = omit, + launch_parameters: Optional[LaunchParameters] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit, + system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BlueprintView: """Starts build of custom defined container Blueprint. @@ -565,7 +565,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BlueprintView: """ Get the details of a previously created Blueprint including the build status. @@ -592,15 +592,15 @@ async def retrieve( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + name: str | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[BlueprintView, AsyncBlueprintsCursorIDPage[BlueprintView]]: """ List all Blueprints or filter by name. @@ -649,7 +649,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> object: """ @@ -683,15 +683,15 @@ async def delete( def list_public( self, *, - limit: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + name: str | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[BlueprintView, AsyncBlueprintsCursorIDPage[BlueprintView]]: """ List all public Blueprints that are available to all users. @@ -740,7 +740,7 @@ async def logs( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BlueprintBuildLogsListView: """ Get all logs from the building of a Blueprint. @@ -768,21 +768,21 @@ async def preview( self, *, name: str, - base_blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, - base_blueprint_name: Optional[str] | NotGiven = NOT_GIVEN, - code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, - dockerfile: Optional[str] | NotGiven = NOT_GIVEN, - file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - services: Optional[Iterable[blueprint_preview_params.Service]] | NotGiven = NOT_GIVEN, - system_setup_commands: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, + base_blueprint_id: Optional[str] | Omit = omit, + base_blueprint_name: Optional[str] | Omit = omit, + code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, + dockerfile: Optional[str] | Omit = omit, + file_mounts: Optional[Dict[str, str]] | Omit = omit, + launch_parameters: Optional[LaunchParameters] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + services: Optional[Iterable[blueprint_preview_params.Service]] | Omit = omit, + system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BlueprintPreviewView: """Preview building a Blueprint with the specified configuration. diff --git a/src/runloop_api_client/resources/devboxes/browsers.py b/src/runloop_api_client/resources/devboxes/browsers.py index 9a2c1c9f5..517857f56 100644 --- a/src/runloop_api_client/resources/devboxes/browsers.py +++ b/src/runloop_api_client/resources/devboxes/browsers.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -46,13 +46,13 @@ def with_streaming_response(self) -> BrowsersResourceWithStreamingResponse: def create( self, *, - name: Optional[str] | NotGiven = NOT_GIVEN, + name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BrowserView: """Create a Devbox that has a managed Browser and begin the boot process. @@ -96,7 +96,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BrowserView: """ Get Browser Details. @@ -144,13 +144,13 @@ def with_streaming_response(self) -> AsyncBrowsersResourceWithStreamingResponse: async def create( self, *, - name: Optional[str] | NotGiven = NOT_GIVEN, + name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BrowserView: """Create a Devbox that has a managed Browser and begin the boot process. @@ -194,7 +194,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BrowserView: """ Get Browser Details. diff --git a/src/runloop_api_client/resources/devboxes/computers.py b/src/runloop_api_client/resources/devboxes/computers.py index b08c90c02..be051db2e 100644 --- a/src/runloop_api_client/resources/devboxes/computers.py +++ b/src/runloop_api_client/resources/devboxes/computers.py @@ -7,7 +7,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -55,14 +55,14 @@ def with_streaming_response(self) -> ComputersResourceWithStreamingResponse: def create( self, *, - display_dimensions: Optional[computer_create_params.DisplayDimensions] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, + display_dimensions: Optional[computer_create_params.DisplayDimensions] | Omit = omit, + name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ComputerView: """Create a Computer and begin the boot process. @@ -116,7 +116,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ComputerView: """ Get Computer Details. @@ -145,13 +145,13 @@ def keyboard_interaction( id: str, *, action: Literal["key", "type"], - text: Optional[str] | NotGiven = NOT_GIVEN, + text: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ComputerKeyboardInteractionResponse: """ @@ -199,13 +199,13 @@ def mouse_interaction( id: str, *, action: Literal["mouse_move", "left_click", "left_click_drag", "right_click", "middle_click", "double_click"], - coordinate: Optional[computer_mouse_interaction_params.Coordinate] | NotGiven = NOT_GIVEN, + coordinate: Optional[computer_mouse_interaction_params.Coordinate] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ComputerMouseInteractionResponse: """ @@ -260,7 +260,7 @@ def screen_interaction( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ComputerScreenInteractionResponse: """ @@ -321,14 +321,14 @@ def with_streaming_response(self) -> AsyncComputersResourceWithStreamingResponse async def create( self, *, - display_dimensions: Optional[computer_create_params.DisplayDimensions] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, + display_dimensions: Optional[computer_create_params.DisplayDimensions] | Omit = omit, + name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ComputerView: """Create a Computer and begin the boot process. @@ -382,7 +382,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ComputerView: """ Get Computer Details. @@ -411,13 +411,13 @@ async def keyboard_interaction( id: str, *, action: Literal["key", "type"], - text: Optional[str] | NotGiven = NOT_GIVEN, + text: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ComputerKeyboardInteractionResponse: """ @@ -465,13 +465,13 @@ async def mouse_interaction( id: str, *, action: Literal["mouse_move", "left_click", "left_click_drag", "right_click", "middle_click", "double_click"], - coordinate: Optional[computer_mouse_interaction_params.Coordinate] | NotGiven = NOT_GIVEN, + coordinate: Optional[computer_mouse_interaction_params.Coordinate] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ComputerMouseInteractionResponse: """ @@ -526,7 +526,7 @@ async def screen_interaction( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ComputerScreenInteractionResponse: """ diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 90a130cfb..287071b8a 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -41,7 +41,7 @@ devbox_snapshot_disk_async_params, devbox_write_file_contents_params, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes +from ..._types import Body, Omit, Query, Headers, NotGiven, FileTypes, omit, not_given from ..._utils import is_given, extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform from .browsers import ( BrowsersResource, @@ -158,24 +158,24 @@ def with_streaming_response(self) -> DevboxesResourceWithStreamingResponse: def create( self, *, - blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, - blueprint_name: Optional[str] | NotGiven = NOT_GIVEN, - code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, - entrypoint: Optional[str] | NotGiven = NOT_GIVEN, - environment_variables: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, - repo_connection_id: Optional[str] | NotGiven = NOT_GIVEN, - secrets: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - snapshot_id: Optional[str] | NotGiven = NOT_GIVEN, + blueprint_id: Optional[str] | Omit = omit, + blueprint_name: Optional[str] | Omit = omit, + code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, + entrypoint: Optional[str] | Omit = omit, + environment_variables: Optional[Dict[str, str]] | Omit = omit, + file_mounts: Optional[Dict[str, str]] | Omit = omit, + launch_parameters: Optional[LaunchParameters] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + name: Optional[str] | Omit = omit, + repo_connection_id: Optional[str] | Omit = omit, + secrets: Optional[Dict[str, str]] | Omit = omit, + snapshot_id: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxView: """Create a Devbox and begin the boot process. @@ -269,7 +269,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DevboxView: """ Get the latest details and status of a Devbox. @@ -297,14 +297,14 @@ def update( self, id: str, *, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | Omit = omit, + name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxView: """ @@ -350,18 +350,18 @@ def update( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + starting_after: str | Omit = omit, status: Literal[ "provisioning", "initializing", "running", "suspending", "suspended", "resuming", "failure", "shutdown" ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncDevboxesCursorIDPage[DevboxView]: """ List all Devboxes while optionally filtering by status. @@ -410,7 +410,7 @@ def create_ssh_key( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxCreateSSHKeyResponse: """ @@ -451,7 +451,7 @@ def create_tunnel( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxTunnelView: """ @@ -494,7 +494,7 @@ def delete_disk_snapshot( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> object: """ @@ -535,7 +535,7 @@ def download_file( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BinaryAPIResponse: """ @@ -580,13 +580,13 @@ def execute( *, command: str, command_id: str, - shell_name: Optional[str] | NotGiven = NOT_GIVEN, + shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxAsyncExecutionDetailView: """ @@ -645,13 +645,13 @@ def execute_async( id: str, *, command: str, - shell_name: Optional[str] | NotGiven = NOT_GIVEN, + shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxAsyncExecutionDetailView: """ @@ -704,13 +704,13 @@ def execute_sync( id: str, *, command: str, - shell_name: Optional[str] | NotGiven = NOT_GIVEN, + shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxExecutionDetailView: """ @@ -769,7 +769,7 @@ def keep_alive( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> object: """ @@ -804,17 +804,17 @@ def keep_alive( def list_disk_snapshots( self, *, - devbox_id: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - metadata_key: str | NotGiven = NOT_GIVEN, - metadata_key_in: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + devbox_id: str | Omit = omit, + limit: int | Omit = omit, + metadata_key: str | Omit = omit, + metadata_key_in: str | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView]: """ List all snapshots of a Devbox while optionally filtering by Devbox ID and @@ -872,7 +872,7 @@ def read_file_contents( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> str: """Read file contents from a file on a Devbox as a UTF-8. @@ -925,7 +925,7 @@ def remove_tunnel( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> object: """ @@ -968,7 +968,7 @@ def resume( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxView: """Resume a suspended Devbox with the disk state captured as suspend time. @@ -1011,7 +1011,7 @@ def shutdown( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxView: """Shutdown a running Devbox. @@ -1049,14 +1049,14 @@ def snapshot_disk( self, id: str, *, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | Omit = omit, + name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxSnapshotView: """ @@ -1105,14 +1105,14 @@ def snapshot_disk_async( self, id: str, *, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | Omit = omit, + name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxSnapshotView: """ @@ -1165,7 +1165,7 @@ def suspend( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxView: """ @@ -1203,13 +1203,13 @@ def upload_file( id: str, *, path: str, - file: FileTypes | NotGiven = NOT_GIVEN, + file: FileTypes | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> object: """Upload file contents of any type (binary, text, etc) to a Devbox. @@ -1267,13 +1267,13 @@ def wait_for_command( *, devbox_id: str, statuses: List[Literal["queued", "running", "completed"]], - timeout_seconds: Optional[int] | NotGiven = NOT_GIVEN, + timeout_seconds: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxAsyncExecutionDetailView: """ @@ -1332,7 +1332,7 @@ def write_file_contents( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxExecutionDetailView: """Write UTF-8 string contents to a file at path on the Devbox. @@ -1427,24 +1427,24 @@ def with_streaming_response(self) -> AsyncDevboxesResourceWithStreamingResponse: async def create( self, *, - blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, - blueprint_name: Optional[str] | NotGiven = NOT_GIVEN, - code_mounts: Optional[Iterable[CodeMountParameters]] | NotGiven = NOT_GIVEN, - entrypoint: Optional[str] | NotGiven = NOT_GIVEN, - environment_variables: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - file_mounts: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - launch_parameters: Optional[LaunchParameters] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, - repo_connection_id: Optional[str] | NotGiven = NOT_GIVEN, - secrets: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - snapshot_id: Optional[str] | NotGiven = NOT_GIVEN, + blueprint_id: Optional[str] | Omit = omit, + blueprint_name: Optional[str] | Omit = omit, + code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, + entrypoint: Optional[str] | Omit = omit, + environment_variables: Optional[Dict[str, str]] | Omit = omit, + file_mounts: Optional[Dict[str, str]] | Omit = omit, + launch_parameters: Optional[LaunchParameters] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + name: Optional[str] | Omit = omit, + repo_connection_id: Optional[str] | Omit = omit, + secrets: Optional[Dict[str, str]] | Omit = omit, + snapshot_id: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxView: """Create a Devbox and begin the boot process. @@ -1538,7 +1538,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DevboxView: """ Get the latest details and status of a Devbox. @@ -1566,14 +1566,14 @@ async def update( self, id: str, *, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | Omit = omit, + name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxView: """ @@ -1619,18 +1619,18 @@ async def update( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + starting_after: str | Omit = omit, status: Literal[ "provisioning", "initializing", "running", "suspending", "suspended", "resuming", "failure", "shutdown" ] - | NotGiven = NOT_GIVEN, + | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DevboxView, AsyncDevboxesCursorIDPage[DevboxView]]: """ List all Devboxes while optionally filtering by status. @@ -1679,7 +1679,7 @@ async def create_ssh_key( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxCreateSSHKeyResponse: """ @@ -1720,7 +1720,7 @@ async def create_tunnel( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxTunnelView: """ @@ -1763,7 +1763,7 @@ async def delete_disk_snapshot( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> object: """ @@ -1804,7 +1804,7 @@ async def download_file( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> AsyncBinaryAPIResponse: """ @@ -1849,13 +1849,13 @@ async def execute( *, command: str, command_id: str, - shell_name: Optional[str] | NotGiven = NOT_GIVEN, + shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxAsyncExecutionDetailView: """ @@ -1914,13 +1914,13 @@ async def execute_async( id: str, *, command: str, - shell_name: Optional[str] | NotGiven = NOT_GIVEN, + shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxAsyncExecutionDetailView: """ @@ -1973,13 +1973,13 @@ async def execute_sync( id: str, *, command: str, - shell_name: Optional[str] | NotGiven = NOT_GIVEN, + shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxExecutionDetailView: """ @@ -2038,7 +2038,7 @@ async def keep_alive( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> object: """ @@ -2073,17 +2073,17 @@ async def keep_alive( def list_disk_snapshots( self, *, - devbox_id: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - metadata_key: str | NotGiven = NOT_GIVEN, - metadata_key_in: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + devbox_id: str | Omit = omit, + limit: int | Omit = omit, + metadata_key: str | Omit = omit, + metadata_key_in: str | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DevboxSnapshotView, AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView]]: """ List all snapshots of a Devbox while optionally filtering by Devbox ID and @@ -2141,7 +2141,7 @@ async def read_file_contents( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> str: """Read file contents from a file on a Devbox as a UTF-8. @@ -2194,7 +2194,7 @@ async def remove_tunnel( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> object: """ @@ -2237,7 +2237,7 @@ async def resume( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxView: """Resume a suspended Devbox with the disk state captured as suspend time. @@ -2280,7 +2280,7 @@ async def shutdown( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxView: """Shutdown a running Devbox. @@ -2318,14 +2318,14 @@ async def snapshot_disk( self, id: str, *, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | Omit = omit, + name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxSnapshotView: """ @@ -2374,14 +2374,14 @@ async def snapshot_disk_async( self, id: str, *, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | Omit = omit, + name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxSnapshotView: """ @@ -2434,7 +2434,7 @@ async def suspend( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxView: """ @@ -2472,13 +2472,13 @@ async def upload_file( id: str, *, path: str, - file: FileTypes | NotGiven = NOT_GIVEN, + file: FileTypes | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> object: """Upload file contents of any type (binary, text, etc) to a Devbox. @@ -2536,13 +2536,13 @@ async def wait_for_command( *, devbox_id: str, statuses: List[Literal["queued", "running", "completed"]], - timeout_seconds: Optional[int] | NotGiven = NOT_GIVEN, + timeout_seconds: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxAsyncExecutionDetailView: """ @@ -2601,7 +2601,7 @@ async def write_file_contents( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxExecutionDetailView: """Write UTF-8 string contents to a file at path on the Devbox. diff --git a/src/runloop_api_client/resources/devboxes/disk_snapshots.py b/src/runloop_api_client/resources/devboxes/disk_snapshots.py index 3b8b2313e..38a91fd8d 100644 --- a/src/runloop_api_client/resources/devboxes/disk_snapshots.py +++ b/src/runloop_api_client/resources/devboxes/disk_snapshots.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -49,14 +49,14 @@ def update( self, id: str, *, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | Omit = omit, + name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxSnapshotView: """Updates disk snapshot metadata via update vs patch. @@ -103,17 +103,17 @@ def update( def list( self, *, - devbox_id: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - metadata_key: str | NotGiven = NOT_GIVEN, - metadata_key_in: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + devbox_id: str | Omit = omit, + limit: int | Omit = omit, + metadata_key: str | Omit = omit, + metadata_key_in: str | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView]: """ List all snapshots of a Devbox while optionally filtering by Devbox ID and @@ -170,7 +170,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> object: """ @@ -210,7 +210,7 @@ def query_status( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DevboxSnapshotAsyncStatusView: """ Get the current status of an asynchronous disk snapshot operation, including @@ -260,14 +260,14 @@ async def update( self, id: str, *, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | Omit = omit, + name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxSnapshotView: """Updates disk snapshot metadata via update vs patch. @@ -314,17 +314,17 @@ async def update( def list( self, *, - devbox_id: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - metadata_key: str | NotGiven = NOT_GIVEN, - metadata_key_in: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + devbox_id: str | Omit = omit, + limit: int | Omit = omit, + metadata_key: str | Omit = omit, + metadata_key_in: str | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DevboxSnapshotView, AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView]]: """ List all snapshots of a Devbox while optionally filtering by Devbox ID and @@ -381,7 +381,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> object: """ @@ -421,7 +421,7 @@ async def query_status( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DevboxSnapshotAsyncStatusView: """ Get the current status of an asynchronous disk snapshot operation, including diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index 69ee58b0f..16552dc5d 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -6,7 +6,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import is_given, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -59,13 +59,13 @@ def retrieve( execution_id: str, *, devbox_id: str, - last_n: str | NotGiven = NOT_GIVEN, + last_n: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DevboxAsyncExecutionDetailView: """ Get the latest status of a previously launched asynchronous execuction including @@ -103,13 +103,13 @@ def execute_async( id: str, *, command: str, - shell_name: Optional[str] | NotGiven = NOT_GIVEN, + shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxAsyncExecutionDetailView: """ @@ -162,13 +162,13 @@ def execute_sync( id: str, *, command: str, - shell_name: Optional[str] | NotGiven = NOT_GIVEN, + shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxExecutionDetailView: """ @@ -223,13 +223,13 @@ def kill( execution_id: str, *, devbox_id: str, - kill_process_group: Optional[bool] | NotGiven = NOT_GIVEN, + kill_process_group: Optional[bool] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxAsyncExecutionDetailView: """ @@ -272,13 +272,13 @@ def stream_stderr_updates( execution_id: str, *, devbox_id: str, - offset: str | NotGiven = NOT_GIVEN, + offset: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Stream[ExecutionUpdateChunk]: """ Tails the stderr logs for the given execution with SSE streaming @@ -319,13 +319,13 @@ def stream_stdout_updates( execution_id: str, *, devbox_id: str, - offset: str | NotGiven = NOT_GIVEN, + offset: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Stream[ExecutionUpdateChunk]: """ Tails the stdout logs for the given execution with SSE streaming @@ -387,13 +387,13 @@ async def retrieve( execution_id: str, *, devbox_id: str, - last_n: str | NotGiven = NOT_GIVEN, + last_n: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DevboxAsyncExecutionDetailView: """ Get the latest status of a previously launched asynchronous execuction including @@ -433,13 +433,13 @@ async def execute_async( id: str, *, command: str, - shell_name: Optional[str] | NotGiven = NOT_GIVEN, + shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxAsyncExecutionDetailView: """ @@ -492,13 +492,13 @@ async def execute_sync( id: str, *, command: str, - shell_name: Optional[str] | NotGiven = NOT_GIVEN, + shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxExecutionDetailView: """ @@ -553,13 +553,13 @@ async def kill( execution_id: str, *, devbox_id: str, - kill_process_group: Optional[bool] | NotGiven = NOT_GIVEN, + kill_process_group: Optional[bool] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxAsyncExecutionDetailView: """ @@ -604,13 +604,13 @@ async def stream_stderr_updates( execution_id: str, *, devbox_id: str, - offset: str | NotGiven = NOT_GIVEN, + offset: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncStream[ExecutionUpdateChunk]: """ Tails the stderr logs for the given execution with SSE streaming @@ -651,13 +651,13 @@ async def stream_stdout_updates( execution_id: str, *, devbox_id: str, - offset: str | NotGiven = NOT_GIVEN, + offset: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncStream[ExecutionUpdateChunk]: """ Tails the stdout logs for the given execution with SSE streaming diff --git a/src/runloop_api_client/resources/devboxes/logs.py b/src/runloop_api_client/resources/devboxes/logs.py index c3302e2fb..19d2c06e1 100644 --- a/src/runloop_api_client/resources/devboxes/logs.py +++ b/src/runloop_api_client/resources/devboxes/logs.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -45,14 +45,14 @@ def list( self, id: str, *, - execution_id: str | NotGiven = NOT_GIVEN, - shell_name: str | NotGiven = NOT_GIVEN, + execution_id: str | Omit = omit, + shell_name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DevboxLogsListView: """ Get all logs from a running or completed Devbox. @@ -115,14 +115,14 @@ async def list( self, id: str, *, - execution_id: str | NotGiven = NOT_GIVEN, - shell_name: str | NotGiven = NOT_GIVEN, + execution_id: str | Omit = omit, + shell_name: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DevboxLogsListView: """ Get all logs from a running or completed Devbox. diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py index 9de56eda2..e41ded6cb 100644 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ b/src/runloop_api_client/resources/devboxes/lsp.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -82,16 +82,16 @@ def apply_code_action( id: str, *, title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - kind: str | NotGiven = NOT_GIVEN, + command: BaseCommandParam | Omit = omit, + edit: BaseWorkspaceEditParam | Omit = omit, + is_preferred: bool | Omit = omit, + kind: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> CodeActionApplicationResult: """ @@ -138,14 +138,14 @@ def code_actions( id: str, *, uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, + context: CodeActionContextParam | Omit = omit, + range: RangeParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> CodeActionsResponse: """Get code actions for a part of a document. @@ -220,7 +220,7 @@ def diagnostics( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DiagnosticsResponse: """ @@ -262,7 +262,7 @@ def document_symbols( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DocumentSymbolResponse: """ @@ -304,7 +304,7 @@ def file( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> FileContentsResponse: """ @@ -348,7 +348,7 @@ def file_definition( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> FileDefinitionResponse: """ @@ -397,7 +397,7 @@ def files( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LspFilesResponse: """ Get a list of all files being watched by the language server @@ -431,7 +431,7 @@ def formatting( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> FormattingResponse: """ @@ -475,7 +475,7 @@ def get_code_actions_for_diagnostic( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> LspGetCodeActionsForDiagnosticResponse: """ @@ -519,13 +519,13 @@ def get_code_segment_info( *, symbol_name: str, uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, + symbol_type: SymbolType | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> CodeSegmentInfoResponse: """ @@ -577,7 +577,7 @@ def get_signature_help( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> SignatureHelpResponse: """ @@ -626,7 +626,7 @@ def health( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HealthStatusResponse: """ This method provides a health check for the language server, including its @@ -663,7 +663,7 @@ def references( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ReferencesResponse: """Get references for a given symbol. @@ -716,7 +716,7 @@ def set_watch_directory( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> str: """ @@ -775,16 +775,16 @@ async def apply_code_action( id: str, *, title: str, - command: BaseCommandParam | NotGiven = NOT_GIVEN, - edit: BaseWorkspaceEditParam | NotGiven = NOT_GIVEN, - is_preferred: bool | NotGiven = NOT_GIVEN, - kind: str | NotGiven = NOT_GIVEN, + command: BaseCommandParam | Omit = omit, + edit: BaseWorkspaceEditParam | Omit = omit, + is_preferred: bool | Omit = omit, + kind: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> CodeActionApplicationResult: """ @@ -831,14 +831,14 @@ async def code_actions( id: str, *, uri: str, - context: CodeActionContextParam | NotGiven = NOT_GIVEN, - range: RangeParam | NotGiven = NOT_GIVEN, + context: CodeActionContextParam | Omit = omit, + range: RangeParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> CodeActionsResponse: """Get code actions for a part of a document. @@ -913,7 +913,7 @@ async def diagnostics( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DiagnosticsResponse: """ @@ -955,7 +955,7 @@ async def document_symbols( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DocumentSymbolResponse: """ @@ -997,7 +997,7 @@ async def file( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> FileContentsResponse: """ @@ -1041,7 +1041,7 @@ async def file_definition( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> FileDefinitionResponse: """ @@ -1090,7 +1090,7 @@ async def files( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LspFilesResponse: """ Get a list of all files being watched by the language server @@ -1124,7 +1124,7 @@ async def formatting( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> FormattingResponse: """ @@ -1168,7 +1168,7 @@ async def get_code_actions_for_diagnostic( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> LspGetCodeActionsForDiagnosticResponse: """ @@ -1212,13 +1212,13 @@ async def get_code_segment_info( *, symbol_name: str, uri: FileUri, - symbol_type: SymbolType | NotGiven = NOT_GIVEN, + symbol_type: SymbolType | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> CodeSegmentInfoResponse: """ @@ -1270,7 +1270,7 @@ async def get_signature_help( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> SignatureHelpResponse: """ @@ -1319,7 +1319,7 @@ async def health( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> HealthStatusResponse: """ This method provides a health check for the language server, including its @@ -1356,7 +1356,7 @@ async def references( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ReferencesResponse: """Get references for a given symbol. @@ -1409,7 +1409,7 @@ async def set_watch_directory( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> str: """ diff --git a/src/runloop_api_client/resources/objects.py b/src/runloop_api_client/resources/objects.py index 56ffb29fe..3f83830e6 100644 --- a/src/runloop_api_client/resources/objects.py +++ b/src/runloop_api_client/resources/objects.py @@ -8,7 +8,7 @@ import httpx from ..types import object_list_params, object_create_params, object_download_params, object_list_public_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -51,13 +51,13 @@ def create( *, content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"], name: str, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ObjectView: """Create a new Object with content and metadata. @@ -111,7 +111,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ObjectView: """ Retrieve a specific Object by its unique identifier. @@ -138,18 +138,18 @@ def retrieve( def list( self, *, - content_type: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, + content_type: str | Omit = omit, + limit: int | Omit = omit, + name: str | Omit = omit, + search: str | Omit = omit, + starting_after: str | Omit = omit, + state: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncObjectsCursorIDPage[ObjectView]: """ List all Objects for the authenticated account with pagination support. @@ -207,7 +207,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ObjectView: """Delete an existing Object by ID. @@ -249,7 +249,7 @@ def complete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ObjectView: """ @@ -285,13 +285,13 @@ def download( self, id: str, *, - duration_seconds: int | NotGiven = NOT_GIVEN, + duration_seconds: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ObjectDownloadURLView: """Generate a presigned download URL for an Object. @@ -328,18 +328,18 @@ def download( def list_public( self, *, - content_type: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, + content_type: str | Omit = omit, + limit: int | Omit = omit, + name: str | Omit = omit, + search: str | Omit = omit, + starting_after: str | Omit = omit, + state: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncObjectsCursorIDPage[ObjectView]: """ List all public Objects with pagination support. @@ -414,13 +414,13 @@ async def create( *, content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"], name: str, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + metadata: Optional[Dict[str, str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ObjectView: """Create a new Object with content and metadata. @@ -474,7 +474,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ObjectView: """ Retrieve a specific Object by its unique identifier. @@ -501,18 +501,18 @@ async def retrieve( def list( self, *, - content_type: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, + content_type: str | Omit = omit, + limit: int | Omit = omit, + name: str | Omit = omit, + search: str | Omit = omit, + starting_after: str | Omit = omit, + state: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ObjectView, AsyncObjectsCursorIDPage[ObjectView]]: """ List all Objects for the authenticated account with pagination support. @@ -570,7 +570,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ObjectView: """Delete an existing Object by ID. @@ -612,7 +612,7 @@ async def complete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ObjectView: """ @@ -648,13 +648,13 @@ async def download( self, id: str, *, - duration_seconds: int | NotGiven = NOT_GIVEN, + duration_seconds: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ObjectDownloadURLView: """Generate a presigned download URL for an Object. @@ -691,18 +691,18 @@ async def download( def list_public( self, *, - content_type: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - search: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, - state: str | NotGiven = NOT_GIVEN, + content_type: str | Omit = omit, + limit: int | Omit = omit, + name: str | Omit = omit, + search: str | Omit = omit, + starting_after: str | Omit = omit, + state: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ObjectView, AsyncObjectsCursorIDPage[ObjectView]]: """ List all public Objects with pagination support. diff --git a/src/runloop_api_client/resources/repositories.py b/src/runloop_api_client/resources/repositories.py index b580da7a2..99c484ba1 100644 --- a/src/runloop_api_client/resources/repositories.py +++ b/src/runloop_api_client/resources/repositories.py @@ -7,7 +7,7 @@ import httpx from ..types import repository_list_params, repository_create_params, repository_refresh_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -50,14 +50,14 @@ def create( *, name: str, owner: str, - blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, - github_auth_token: Optional[str] | NotGiven = NOT_GIVEN, + blueprint_id: Optional[str] | Omit = omit, + github_auth_token: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> RepositoryConnectionView: """ @@ -113,7 +113,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RepositoryConnectionView: """ Get Repository Connection details including latest inspection status and @@ -141,16 +141,16 @@ def retrieve( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - owner: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + name: str | Omit = omit, + owner: str | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncRepositoriesCursorIDPage[RepositoryConnectionView]: """ List all available repository connections. @@ -202,7 +202,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> object: """ @@ -243,7 +243,7 @@ def list_inspections( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RepositoryInspectionListView: """ List all inspections of a repository connection including automatically @@ -272,14 +272,14 @@ def refresh( self, id: str, *, - blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, - github_auth_token: Optional[str] | NotGiven = NOT_GIVEN, + blueprint_id: Optional[str] | Omit = omit, + github_auth_token: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> object: """ @@ -348,14 +348,14 @@ async def create( *, name: str, owner: str, - blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, - github_auth_token: Optional[str] | NotGiven = NOT_GIVEN, + blueprint_id: Optional[str] | Omit = omit, + github_auth_token: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> RepositoryConnectionView: """ @@ -411,7 +411,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RepositoryConnectionView: """ Get Repository Connection details including latest inspection status and @@ -439,16 +439,16 @@ async def retrieve( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - owner: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + name: str | Omit = omit, + owner: str | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[RepositoryConnectionView, AsyncRepositoriesCursorIDPage[RepositoryConnectionView]]: """ List all available repository connections. @@ -500,7 +500,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> object: """ @@ -541,7 +541,7 @@ async def list_inspections( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> RepositoryInspectionListView: """ List all inspections of a repository connection including automatically @@ -570,14 +570,14 @@ async def refresh( self, id: str, *, - blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, - github_auth_token: Optional[str] | NotGiven = NOT_GIVEN, + blueprint_id: Optional[str] | Omit = omit, + github_auth_token: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> object: """ diff --git a/src/runloop_api_client/resources/scenarios/runs.py b/src/runloop_api_client/resources/scenarios/runs.py index d1dee1d15..8af1a46a4 100644 --- a/src/runloop_api_client/resources/scenarios/runs.py +++ b/src/runloop_api_client/resources/scenarios/runs.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -59,7 +59,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScenarioRunView: """ Get a ScenarioRun given ID. @@ -86,15 +86,15 @@ def retrieve( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - scenario_id: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + scenario_id: str | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncBenchmarkRunsCursorIDPage[ScenarioRunView]: """ List all ScenarioRuns matching filter. @@ -143,7 +143,7 @@ def cancel( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ScenarioRunView: """Cancel a currently running Scenario run. @@ -185,7 +185,7 @@ def complete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ScenarioRunView: """Complete a currently running ScenarioRun. @@ -227,7 +227,7 @@ def download_logs( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BinaryAPIResponse: """ @@ -269,7 +269,7 @@ def score( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ScenarioRunView: """ @@ -330,7 +330,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScenarioRunView: """ Get a ScenarioRun given ID. @@ -357,15 +357,15 @@ async def retrieve( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - scenario_id: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + scenario_id: str | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ScenarioRunView, AsyncBenchmarkRunsCursorIDPage[ScenarioRunView]]: """ List all ScenarioRuns matching filter. @@ -414,7 +414,7 @@ async def cancel( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ScenarioRunView: """Cancel a currently running Scenario run. @@ -456,7 +456,7 @@ async def complete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ScenarioRunView: """Complete a currently running ScenarioRun. @@ -498,7 +498,7 @@ async def download_logs( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> AsyncBinaryAPIResponse: """ @@ -540,7 +540,7 @@ async def score( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ScenarioRunView: """ diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index 5ee3c70b5..d5ade7543 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -30,7 +30,7 @@ ScorersResourceWithStreamingResponse, AsyncScorersResourceWithStreamingResponse, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, SequenceNotStr +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -88,18 +88,18 @@ def create( input_context: InputContextParam, name: str, scoring_contract: ScoringContractParam, - environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - reference_output: Optional[str] | NotGiven = NOT_GIVEN, - required_environment_variables: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - required_secret_names: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] | NotGiven = NOT_GIVEN, + environment_parameters: Optional[ScenarioEnvironmentParam] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + reference_output: Optional[str] | Omit = omit, + required_environment_variables: Optional[SequenceNotStr[str]] | Omit = omit, + required_secret_names: Optional[SequenceNotStr[str]] | Omit = omit, + validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ScenarioView: """ @@ -175,7 +175,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScenarioView: """ Get a previously created scenario. @@ -203,21 +203,21 @@ def update( self, id: str, *, - environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, - input_context: Optional[InputContextUpdateParam] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, - reference_output: Optional[str] | NotGiven = NOT_GIVEN, - required_environment_variables: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - required_secret_names: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - scoring_contract: Optional[ScoringContractUpdateParam] | NotGiven = NOT_GIVEN, - validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] | NotGiven = NOT_GIVEN, + environment_parameters: Optional[ScenarioEnvironmentParam] | Omit = omit, + input_context: Optional[InputContextUpdateParam] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + name: Optional[str] | Omit = omit, + reference_output: Optional[str] | Omit = omit, + required_environment_variables: Optional[SequenceNotStr[str]] | Omit = omit, + required_secret_names: Optional[SequenceNotStr[str]] | Omit = omit, + scoring_contract: Optional[ScoringContractUpdateParam] | Omit = omit, + validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ScenarioView: """ @@ -287,16 +287,16 @@ def update( def list( self, *, - benchmark_id: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + benchmark_id: str | Omit = omit, + limit: int | Omit = omit, + name: str | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncScenariosCursorIDPage[ScenarioView]: """ List all Scenarios matching filter. @@ -342,15 +342,15 @@ def list( def list_public( self, *, - limit: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + name: str | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncScenariosCursorIDPage[ScenarioView]: """ List all public scenarios matching filter. @@ -394,16 +394,16 @@ def start_run( self, *, scenario_id: str, - benchmark_run_id: Optional[str] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - run_name: Optional[str] | NotGiven = NOT_GIVEN, - run_profile: Optional[RunProfile] | NotGiven = NOT_GIVEN, + benchmark_run_id: Optional[str] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + run_name: Optional[str] | Omit = omit, + run_profile: Optional[RunProfile] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ScenarioRunView: """ @@ -487,18 +487,18 @@ async def create( input_context: InputContextParam, name: str, scoring_contract: ScoringContractParam, - environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - reference_output: Optional[str] | NotGiven = NOT_GIVEN, - required_environment_variables: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - required_secret_names: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] | NotGiven = NOT_GIVEN, + environment_parameters: Optional[ScenarioEnvironmentParam] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + reference_output: Optional[str] | Omit = omit, + required_environment_variables: Optional[SequenceNotStr[str]] | Omit = omit, + required_secret_names: Optional[SequenceNotStr[str]] | Omit = omit, + validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ScenarioView: """ @@ -574,7 +574,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScenarioView: """ Get a previously created scenario. @@ -602,21 +602,21 @@ async def update( self, id: str, *, - environment_parameters: Optional[ScenarioEnvironmentParam] | NotGiven = NOT_GIVEN, - input_context: Optional[InputContextUpdateParam] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - name: Optional[str] | NotGiven = NOT_GIVEN, - reference_output: Optional[str] | NotGiven = NOT_GIVEN, - required_environment_variables: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - required_secret_names: Optional[SequenceNotStr[str]] | NotGiven = NOT_GIVEN, - scoring_contract: Optional[ScoringContractUpdateParam] | NotGiven = NOT_GIVEN, - validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] | NotGiven = NOT_GIVEN, + environment_parameters: Optional[ScenarioEnvironmentParam] | Omit = omit, + input_context: Optional[InputContextUpdateParam] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + name: Optional[str] | Omit = omit, + reference_output: Optional[str] | Omit = omit, + required_environment_variables: Optional[SequenceNotStr[str]] | Omit = omit, + required_secret_names: Optional[SequenceNotStr[str]] | Omit = omit, + scoring_contract: Optional[ScoringContractUpdateParam] | Omit = omit, + validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ScenarioView: """ @@ -686,16 +686,16 @@ async def update( def list( self, *, - benchmark_id: str | NotGiven = NOT_GIVEN, - limit: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + benchmark_id: str | Omit = omit, + limit: int | Omit = omit, + name: str | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ScenarioView, AsyncScenariosCursorIDPage[ScenarioView]]: """ List all Scenarios matching filter. @@ -741,15 +741,15 @@ def list( def list_public( self, *, - limit: int | NotGiven = NOT_GIVEN, - name: str | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + name: str | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ScenarioView, AsyncScenariosCursorIDPage[ScenarioView]]: """ List all public scenarios matching filter. @@ -793,16 +793,16 @@ async def start_run( self, *, scenario_id: str, - benchmark_run_id: Optional[str] | NotGiven = NOT_GIVEN, - metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, - run_name: Optional[str] | NotGiven = NOT_GIVEN, - run_profile: Optional[RunProfile] | NotGiven = NOT_GIVEN, + benchmark_run_id: Optional[str] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + run_name: Optional[str] | Omit = omit, + run_profile: Optional[RunProfile] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ScenarioRunView: """ diff --git a/src/runloop_api_client/resources/scenarios/scorers.py b/src/runloop_api_client/resources/scenarios/scorers.py index 56236b184..5b083f8e4 100644 --- a/src/runloop_api_client/resources/scenarios/scorers.py +++ b/src/runloop_api_client/resources/scenarios/scorers.py @@ -4,7 +4,7 @@ import httpx -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource @@ -57,7 +57,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ScorerCreateResponse: """ @@ -107,7 +107,7 @@ def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScorerRetrieveResponse: """ Retrieve Scenario Scorer. @@ -142,7 +142,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ScorerUpdateResponse: """ @@ -188,14 +188,14 @@ def update( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncScenarioScorersCursorIDPage[ScorerListResponse]: """ List all Scenario Scorers matching filter. @@ -237,13 +237,13 @@ def validate( id: str, *, scoring_context: object, - environment_parameters: ScenarioEnvironmentParam | NotGiven = NOT_GIVEN, + environment_parameters: ScenarioEnvironmentParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ScorerValidateResponse: """ @@ -316,7 +316,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ScorerCreateResponse: """ @@ -366,7 +366,7 @@ async def retrieve( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ScorerRetrieveResponse: """ Retrieve Scenario Scorer. @@ -401,7 +401,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ScorerUpdateResponse: """ @@ -447,14 +447,14 @@ async def update( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, - starting_after: str | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, + starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ScorerListResponse, AsyncScenarioScorersCursorIDPage[ScorerListResponse]]: """ List all Scenario Scorers matching filter. @@ -496,13 +496,13 @@ async def validate( id: str, *, scoring_context: object, - environment_parameters: ScenarioEnvironmentParam | NotGiven = NOT_GIVEN, + environment_parameters: ScenarioEnvironmentParam | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ScorerValidateResponse: """ diff --git a/src/runloop_api_client/resources/secrets.py b/src/runloop_api_client/resources/secrets.py index e70e67f98..8e170fca2 100644 --- a/src/runloop_api_client/resources/secrets.py +++ b/src/runloop_api_client/resources/secrets.py @@ -5,7 +5,7 @@ import httpx from ..types import secret_list_params, secret_create_params, secret_update_params -from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource @@ -52,7 +52,7 @@ def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> SecretView: """Create a new Secret with a globally unique name and value. @@ -106,7 +106,7 @@ def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> SecretView: """Update the value of an existing Secret by name. @@ -146,13 +146,13 @@ def update( def list( self, *, - limit: int | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecretListView: """List all Secrets for the authenticated account. @@ -191,7 +191,7 @@ def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> SecretView: """Delete an existing Secret by name. @@ -255,7 +255,7 @@ async def create( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> SecretView: """Create a new Secret with a globally unique name and value. @@ -309,7 +309,7 @@ async def update( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> SecretView: """Update the value of an existing Secret by name. @@ -349,13 +349,13 @@ async def update( async def list( self, *, - limit: int | NotGiven = NOT_GIVEN, + limit: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SecretListView: """List all Secrets for the authenticated account. @@ -394,7 +394,7 @@ async def delete( extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> SecretView: """Delete an existing Secret by name. diff --git a/tests/test_transform.py b/tests/test_transform.py index ad9fa8b24..5256aad7b 100644 --- a/tests/test_transform.py +++ b/tests/test_transform.py @@ -8,7 +8,7 @@ import pytest -from runloop_api_client._types import NOT_GIVEN, Base64FileInput +from runloop_api_client._types import Base64FileInput, omit, not_given from runloop_api_client._utils import ( PropertyInfo, transform as _transform, @@ -450,4 +450,11 @@ async def test_transform_skipping(use_async: bool) -> None: @pytest.mark.asyncio async def test_strips_notgiven(use_async: bool) -> None: assert await transform({"foo_bar": "bar"}, Foo1, use_async) == {"fooBar": "bar"} - assert await transform({"foo_bar": NOT_GIVEN}, Foo1, use_async) == {} + assert await transform({"foo_bar": not_given}, Foo1, use_async) == {} + + +@parametrize +@pytest.mark.asyncio +async def test_strips_omit(use_async: bool) -> None: + assert await transform({"foo_bar": "bar"}, Foo1, use_async) == {"fooBar": "bar"} + assert await transform({"foo_bar": omit}, Foo1, use_async) == {} From 4c6069794f8f935f877671136da8bd67659d8c4c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 20 Sep 2025 02:41:04 +0000 Subject: [PATCH 864/993] chore: do not install brew dependencies in ./scripts/bootstrap by default --- scripts/bootstrap | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/bootstrap b/scripts/bootstrap index e84fe62c3..b430fee36 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,10 +4,18 @@ set -e cd "$(dirname "$0")/.." -if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then brew bundle check >/dev/null 2>&1 || { - echo "==> Installing Homebrew dependencies…" - brew bundle + echo -n "==> Install Homebrew dependencies? (y/N): " + read -r response + case "$response" in + [yY][eE][sS]|[yY]) + brew bundle + ;; + *) + ;; + esac + echo } fi From 60ed68655089ccfede7156100ba48083f25af900 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Sep 2025 19:45:45 +0000 Subject: [PATCH 865/993] feat(api): api update --- .stats.yml | 8 +- api.md | 82 - .../resources/devboxes/__init__.py | 14 - .../resources/devboxes/devboxes.py | 69 +- .../resources/devboxes/executions.py | 27 +- .../resources/devboxes/lsp.py | 1635 ----------------- src/runloop_api_client/types/__init__.py | 13 - .../types/blueprint_view.py | 6 +- .../types/devbox_execute_params.py | 6 + src/runloop_api_client/types/devbox_view.py | 2 +- .../types/devboxes/__init__.py | 72 - .../types/devboxes/base_code_action.py | 23 - .../types/devboxes/base_command.py | 15 - .../types/devboxes/base_command_param.py | 16 - .../types/devboxes/base_diagnostic.py | 22 - .../types/devboxes/base_diagnostic_param.py | 24 - .../types/devboxes/base_location.py | 12 - .../types/devboxes/base_markup_content.py | 11 - .../devboxes/base_parameter_information.py | 17 - .../types/devboxes/base_range.py | 23 - .../types/devboxes/base_range_param.py | 25 - .../types/devboxes/base_signature.py | 20 - .../types/devboxes/base_workspace_edit.py | 13 - .../devboxes/base_workspace_edit_param.py | 14 - .../code_action_application_result.py | 17 - .../devboxes/code_action_context_param.py | 38 - .../types/devboxes/code_action_kind.py | 7 - .../devboxes/code_action_trigger_kind.py | 7 - .../types/devboxes/code_actions_response.py | 13 - .../types/devboxes/code_description_param.py | 18 - .../devboxes/code_segment_info_response.py | 46 - .../types/devboxes/diagnostic_param.py | 68 - .../diagnostic_related_information_param.py | 21 - .../types/devboxes/diagnostic_severity.py | 7 - .../types/devboxes/diagnostic_tag.py | 7 - .../types/devboxes/diagnostics_response.py | 14 - .../types/devboxes/document_symbol.py | 58 - .../devboxes/document_symbol_response.py | 26 - .../types/devboxes/document_uri.py | 7 - .../types/devboxes/file_contents_response.py | 16 - .../devboxes/file_definition_response.py | 10 - .../types/devboxes/file_path.py | 7 - .../types/devboxes/file_uri.py | 7 - .../types/devboxes/formatting_response.py | 10 - .../types/devboxes/health_status_response.py | 23 - .../types/devboxes/integer.py | 7 - .../types/devboxes/l_sp_any_param.py | 9 - .../types/devboxes/location_param.py | 37 - .../devboxes/lsp_apply_code_action_params.py | 23 - .../types/devboxes/lsp_code_actions_params.py | 40 - .../types/devboxes/lsp_diagnostics_params.py | 13 - .../devboxes/lsp_document_symbols_params.py | 13 - .../devboxes/lsp_file_definition_params.py | 15 - .../types/devboxes/lsp_file_params.py | 13 - .../types/devboxes/lsp_files_response.py | 10 - .../types/devboxes/lsp_formatting_params.py | 13 - ..._get_code_actions_for_diagnostic_params.py | 15 - ...et_code_actions_for_diagnostic_response.py | 10 - .../lsp_get_code_segment_info_params.py | 19 - .../devboxes/lsp_get_signature_help_params.py | 15 - .../types/devboxes/lsp_references_params.py | 15 - .../lsp_set_watch_directory_params.py | 13 - .../lsp_set_watch_directory_response.py | 7 - .../types/devboxes/position.py | 37 - .../types/devboxes/position_param.py | 33 - .../types/devboxes/range.py | 25 - .../types/devboxes/range_param.py | 21 - .../devboxes/record_string_text_edit_array.py | 10 - .../record_string_text_edit_array_param.py | 12 - .../types/devboxes/references_response.py | 10 - .../types/devboxes/signature_help_response.py | 18 - .../types/devboxes/symbol_kind.py | 9 - .../types/devboxes/symbol_tag.py | 7 - .../types/devboxes/symbol_type.py | 7 - .../types/devboxes/text_edit.py | 28 - .../types/devboxes/text_edit_param.py | 25 - src/runloop_api_client/types/devboxes/u_ri.py | 7 - .../types/devboxes/uinteger.py | 7 - .../types/devboxes/watched_file_response.py | 15 - .../api_resources/devboxes/test_executions.py | 120 +- tests/api_resources/devboxes/test_lsp.py | 1616 ---------------- tests/api_resources/test_devboxes.py | 122 +- 82 files changed, 200 insertions(+), 4812 deletions(-) delete mode 100644 src/runloop_api_client/resources/devboxes/lsp.py delete mode 100644 src/runloop_api_client/types/devboxes/base_code_action.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command.py delete mode 100644 src/runloop_api_client/types/devboxes/base_command_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic.py delete mode 100644 src/runloop_api_client/types/devboxes/base_diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_location.py delete mode 100644 src/runloop_api_client/types/devboxes/base_markup_content.py delete mode 100644 src/runloop_api_client/types/devboxes/base_parameter_information.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range.py delete mode 100644 src/runloop_api_client/types/devboxes/base_range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/base_signature.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/base_workspace_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_application_result.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_context_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_action_trigger_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/code_actions_response.py delete mode 100644 src/runloop_api_client/types/devboxes/code_description_param.py delete mode 100644 src/runloop_api_client/types/devboxes/code_segment_info_response.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_severity.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostic_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/diagnostics_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol.py delete mode 100644 src/runloop_api_client/types/devboxes/document_symbol_response.py delete mode 100644 src/runloop_api_client/types/devboxes/document_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/file_contents_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_definition_response.py delete mode 100644 src/runloop_api_client/types/devboxes/file_path.py delete mode 100644 src/runloop_api_client/types/devboxes/file_uri.py delete mode 100644 src/runloop_api_client/types/devboxes/formatting_response.py delete mode 100644 src/runloop_api_client/types/devboxes/health_status_response.py delete mode 100644 src/runloop_api_client/types/devboxes/integer.py delete mode 100644 src/runloop_api_client/types/devboxes/l_sp_any_param.py delete mode 100644 src/runloop_api_client/types/devboxes/location_param.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_code_actions_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_definition_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_file_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_files_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_formatting_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_references_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py delete mode 100644 src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py delete mode 100644 src/runloop_api_client/types/devboxes/position.py delete mode 100644 src/runloop_api_client/types/devboxes/position_param.py delete mode 100644 src/runloop_api_client/types/devboxes/range.py delete mode 100644 src/runloop_api_client/types/devboxes/range_param.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array.py delete mode 100644 src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py delete mode 100644 src/runloop_api_client/types/devboxes/references_response.py delete mode 100644 src/runloop_api_client/types/devboxes/signature_help_response.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_kind.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_tag.py delete mode 100644 src/runloop_api_client/types/devboxes/symbol_type.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit.py delete mode 100644 src/runloop_api_client/types/devboxes/text_edit_param.py delete mode 100644 src/runloop_api_client/types/devboxes/u_ri.py delete mode 100644 src/runloop_api_client/types/devboxes/uinteger.py delete mode 100644 src/runloop_api_client/types/devboxes/watched_file_response.py delete mode 100644 tests/api_resources/devboxes/test_lsp.py diff --git a/.stats.yml b/.stats.yml index 00e38fa1c..e6e2b8c0d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 104 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-0cb966ca566f4f3d7f8b4d3c37b24b4a117760dba194cb2c4f2bb4e3620027de.yml -openapi_spec_hash: c969887eb721b42a423e662127270d57 -config_hash: 3a4634de0976f3fbd7f3a5c4911d2add +configured_endpoints: 90 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1749c364b895f7e1551fbb4037d18c64f89948017f56eaf68b6cb0e978250944.yml +openapi_spec_hash: 0623287e228035fbeca1a66c3253b9b1 +config_hash: 4c7b6a602579b69f9d533f0f0fef5ded diff --git a/api.md b/api.md index 3f1aa295f..f9eb24816 100644 --- a/api.md +++ b/api.md @@ -158,88 +158,6 @@ Methods: - client.devboxes.computers.mouse_interaction(id, \*\*params) -> ComputerMouseInteractionResponse - client.devboxes.computers.screen_interaction(id, \*\*params) -> ComputerScreenInteractionResponse -## Lsp - -Types: - -```python -from runloop_api_client.types.devboxes import ( - BaseCodeAction, - BaseCommand, - BaseDiagnostic, - BaseLocation, - BaseMarkupContent, - BaseParameterInformation, - BaseRange, - BaseSignature, - BaseWorkspaceEdit, - CodeActionApplicationResult, - CodeActionContext, - CodeActionKind, - CodeActionsForDiagnosticRequestBody, - CodeActionsRequestBody, - CodeActionsResponse, - CodeActionTriggerKind, - CodeDescription, - CodeSegmentInfoRequestBody, - CodeSegmentInfoResponse, - Diagnostic, - DiagnosticRelatedInformation, - DiagnosticSeverity, - DiagnosticsResponse, - DiagnosticTag, - DocumentSymbol, - DocumentSymbolResponse, - DocumentUri, - FileContentsResponse, - FileDefinitionRequestBody, - FileDefinitionResponse, - FilePath, - FileRequestBody, - FileUri, - FormattingResponse, - HealthStatusResponse, - Integer, - Location, - LSpAny, - Position, - Range, - RecordStringTextEditArray, - ReferencesRequestBody, - ReferencesResponse, - SetWatchDirectoryRequestBody, - SignatureHelpRequestBody, - SignatureHelpResponse, - SymbolKind, - SymbolTag, - SymbolType, - TextEdit, - Uinteger, - URi, - WatchedFileResponse, - LspFilesResponse, - LspGetCodeActionsForDiagnosticResponse, - LspSetWatchDirectoryResponse, -) -``` - -Methods: - -- client.devboxes.lsp.apply_code_action(id, \*\*params) -> CodeActionApplicationResult -- client.devboxes.lsp.code_actions(id, \*\*params) -> CodeActionsResponse -- client.devboxes.lsp.diagnostics(id, \*\*params) -> DiagnosticsResponse -- client.devboxes.lsp.document_symbols(id, \*\*params) -> DocumentSymbolResponse -- client.devboxes.lsp.file(id, \*\*params) -> FileContentsResponse -- client.devboxes.lsp.file_definition(id, \*\*params) -> FileDefinitionResponse -- client.devboxes.lsp.files(id) -> LspFilesResponse -- client.devboxes.lsp.formatting(id, \*\*params) -> FormattingResponse -- client.devboxes.lsp.get_code_actions_for_diagnostic(id, \*\*params) -> LspGetCodeActionsForDiagnosticResponse -- client.devboxes.lsp.get_code_segment_info(id, \*\*params) -> CodeSegmentInfoResponse -- client.devboxes.lsp.get_signature_help(id, \*\*params) -> SignatureHelpResponse -- client.devboxes.lsp.health(id) -> HealthStatusResponse -- client.devboxes.lsp.references(id, \*\*params) -> ReferencesResponse -- client.devboxes.lsp.set_watch_directory(id, \*\*params) -> str - ## Logs Types: diff --git a/src/runloop_api_client/resources/devboxes/__init__.py b/src/runloop_api_client/resources/devboxes/__init__.py index acdd589f0..164104c7b 100644 --- a/src/runloop_api_client/resources/devboxes/__init__.py +++ b/src/runloop_api_client/resources/devboxes/__init__.py @@ -1,13 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -76,12 +68,6 @@ "AsyncComputersResourceWithRawResponse", "ComputersResourceWithStreamingResponse", "AsyncComputersResourceWithStreamingResponse", - "LspResource", - "AsyncLspResource", - "LspResourceWithRawResponse", - "AsyncLspResourceWithRawResponse", - "LspResourceWithStreamingResponse", - "AsyncLspResourceWithStreamingResponse", "LogsResource", "AsyncLogsResource", "LogsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 287071b8a..33c226954 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -2,19 +2,12 @@ from __future__ import annotations +import typing_extensions from typing import Dict, List, Mapping, Iterable, Optional, cast from typing_extensions import Literal import httpx -from .lsp import ( - LspResource, - AsyncLspResource, - LspResourceWithRawResponse, - AsyncLspResourceWithRawResponse, - LspResourceWithStreamingResponse, - AsyncLspResourceWithStreamingResponse, -) from .logs import ( LogsResource, AsyncLogsResource, @@ -124,10 +117,6 @@ def browsers(self) -> BrowsersResource: def computers(self) -> ComputersResource: return ComputersResource(self._client) - @cached_property - def lsp(self) -> LspResource: - return LspResource(self._client) - @cached_property def logs(self) -> LogsResource: return LogsResource(self._client) @@ -580,6 +569,7 @@ def execute( *, command: str, command_id: str, + optimistic_timeout: Optional[int] | Omit = omit, shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -602,6 +592,9 @@ def execute( command_id: The command ID for idempotency and tracking + optimistic_timeout: Timeout in seconds to wait for command completion. Operation is not killed. Max + is 600 seconds. + shell_name: The name of the persistent shell to create or use if already created. When using a persistent shell, the command will run from the directory at the end of the previous command and environment variables will be preserved. @@ -626,6 +619,7 @@ def execute( { "command": command, "command_id": command_id, + "optimistic_timeout": optimistic_timeout, "shell_name": shell_name, }, devbox_execute_params.DevboxExecuteParams, @@ -699,6 +693,7 @@ def execute_async( cast_to=DevboxAsyncExecutionDetailView, ) + @typing_extensions.deprecated("deprecated") def execute_sync( self, id: str, @@ -1393,10 +1388,6 @@ def browsers(self) -> AsyncBrowsersResource: def computers(self) -> AsyncComputersResource: return AsyncComputersResource(self._client) - @cached_property - def lsp(self) -> AsyncLspResource: - return AsyncLspResource(self._client) - @cached_property def logs(self) -> AsyncLogsResource: return AsyncLogsResource(self._client) @@ -1849,6 +1840,7 @@ async def execute( *, command: str, command_id: str, + optimistic_timeout: Optional[int] | Omit = omit, shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1871,6 +1863,9 @@ async def execute( command_id: The command ID for idempotency and tracking + optimistic_timeout: Timeout in seconds to wait for command completion. Operation is not killed. Max + is 600 seconds. + shell_name: The name of the persistent shell to create or use if already created. When using a persistent shell, the command will run from the directory at the end of the previous command and environment variables will be preserved. @@ -1895,6 +1890,7 @@ async def execute( { "command": command, "command_id": command_id, + "optimistic_timeout": optimistic_timeout, "shell_name": shell_name, }, devbox_execute_params.DevboxExecuteParams, @@ -1968,6 +1964,7 @@ async def execute_async( cast_to=DevboxAsyncExecutionDetailView, ) + @typing_extensions.deprecated("deprecated") async def execute_sync( self, id: str, @@ -2684,8 +2681,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.execute_async = to_raw_response_wrapper( devboxes.execute_async, ) - self.execute_sync = to_raw_response_wrapper( - devboxes.execute_sync, + self.execute_sync = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + devboxes.execute_sync, # pyright: ignore[reportDeprecated], + ) ) self.keep_alive = to_raw_response_wrapper( devboxes.keep_alive, @@ -2736,10 +2735,6 @@ def browsers(self) -> BrowsersResourceWithRawResponse: def computers(self) -> ComputersResourceWithRawResponse: return ComputersResourceWithRawResponse(self._devboxes.computers) - @cached_property - def lsp(self) -> LspResourceWithRawResponse: - return LspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithRawResponse: return LogsResourceWithRawResponse(self._devboxes.logs) @@ -2784,8 +2779,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.execute_async = async_to_raw_response_wrapper( devboxes.execute_async, ) - self.execute_sync = async_to_raw_response_wrapper( - devboxes.execute_sync, + self.execute_sync = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + devboxes.execute_sync, # pyright: ignore[reportDeprecated], + ) ) self.keep_alive = async_to_raw_response_wrapper( devboxes.keep_alive, @@ -2836,10 +2833,6 @@ def browsers(self) -> AsyncBrowsersResourceWithRawResponse: def computers(self) -> AsyncComputersResourceWithRawResponse: return AsyncComputersResourceWithRawResponse(self._devboxes.computers) - @cached_property - def lsp(self) -> AsyncLspResourceWithRawResponse: - return AsyncLspResourceWithRawResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithRawResponse: return AsyncLogsResourceWithRawResponse(self._devboxes.logs) @@ -2884,8 +2877,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.execute_async = to_streamed_response_wrapper( devboxes.execute_async, ) - self.execute_sync = to_streamed_response_wrapper( - devboxes.execute_sync, + self.execute_sync = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + devboxes.execute_sync, # pyright: ignore[reportDeprecated], + ) ) self.keep_alive = to_streamed_response_wrapper( devboxes.keep_alive, @@ -2936,10 +2931,6 @@ def browsers(self) -> BrowsersResourceWithStreamingResponse: def computers(self) -> ComputersResourceWithStreamingResponse: return ComputersResourceWithStreamingResponse(self._devboxes.computers) - @cached_property - def lsp(self) -> LspResourceWithStreamingResponse: - return LspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> LogsResourceWithStreamingResponse: return LogsResourceWithStreamingResponse(self._devboxes.logs) @@ -2984,8 +2975,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.execute_async = async_to_streamed_response_wrapper( devboxes.execute_async, ) - self.execute_sync = async_to_streamed_response_wrapper( - devboxes.execute_sync, + self.execute_sync = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + devboxes.execute_sync, # pyright: ignore[reportDeprecated], + ) ) self.keep_alive = async_to_streamed_response_wrapper( devboxes.keep_alive, @@ -3036,10 +3029,6 @@ def browsers(self) -> AsyncBrowsersResourceWithStreamingResponse: def computers(self) -> AsyncComputersResourceWithStreamingResponse: return AsyncComputersResourceWithStreamingResponse(self._devboxes.computers) - @cached_property - def lsp(self) -> AsyncLspResourceWithStreamingResponse: - return AsyncLspResourceWithStreamingResponse(self._devboxes.lsp) - @cached_property def logs(self) -> AsyncLogsResourceWithStreamingResponse: return AsyncLogsResourceWithStreamingResponse(self._devboxes.logs) diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index 16552dc5d..69106a3bf 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Optional import httpx @@ -157,6 +158,7 @@ def execute_async( cast_to=DevboxAsyncExecutionDetailView, ) + @typing_extensions.deprecated("deprecated") def execute_sync( self, id: str, @@ -487,6 +489,7 @@ async def execute_async( cast_to=DevboxAsyncExecutionDetailView, ) + @typing_extensions.deprecated("deprecated") async def execute_sync( self, id: str, @@ -704,8 +707,10 @@ def __init__(self, executions: ExecutionsResource) -> None: self.execute_async = to_raw_response_wrapper( executions.execute_async, ) - self.execute_sync = to_raw_response_wrapper( - executions.execute_sync, + self.execute_sync = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + executions.execute_sync, # pyright: ignore[reportDeprecated], + ) ) self.kill = to_raw_response_wrapper( executions.kill, @@ -728,8 +733,10 @@ def __init__(self, executions: AsyncExecutionsResource) -> None: self.execute_async = async_to_raw_response_wrapper( executions.execute_async, ) - self.execute_sync = async_to_raw_response_wrapper( - executions.execute_sync, + self.execute_sync = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + executions.execute_sync, # pyright: ignore[reportDeprecated], + ) ) self.kill = async_to_raw_response_wrapper( executions.kill, @@ -752,8 +759,10 @@ def __init__(self, executions: ExecutionsResource) -> None: self.execute_async = to_streamed_response_wrapper( executions.execute_async, ) - self.execute_sync = to_streamed_response_wrapper( - executions.execute_sync, + self.execute_sync = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + executions.execute_sync, # pyright: ignore[reportDeprecated], + ) ) self.kill = to_streamed_response_wrapper( executions.kill, @@ -776,8 +785,10 @@ def __init__(self, executions: AsyncExecutionsResource) -> None: self.execute_async = async_to_streamed_response_wrapper( executions.execute_async, ) - self.execute_sync = async_to_streamed_response_wrapper( - executions.execute_sync, + self.execute_sync = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + executions.execute_sync, # pyright: ignore[reportDeprecated], + ) ) self.kill = async_to_streamed_response_wrapper( executions.kill, diff --git a/src/runloop_api_client/resources/devboxes/lsp.py b/src/runloop_api_client/resources/devboxes/lsp.py deleted file mode 100644 index e41ded6cb..000000000 --- a/src/runloop_api_client/resources/devboxes/lsp.py +++ /dev/null @@ -1,1635 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import httpx - -from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ..._base_client import make_request_options -from ...types.devboxes import ( - FileUri, - FilePath, - SymbolType, - lsp_file_params, - lsp_formatting_params, - lsp_references_params, - lsp_diagnostics_params, - lsp_code_actions_params, - lsp_file_definition_params, - lsp_document_symbols_params, - lsp_apply_code_action_params, - lsp_get_signature_help_params, - lsp_set_watch_directory_params, - lsp_get_code_segment_info_params, - lsp_get_code_actions_for_diagnostic_params, -) -from ...types.devboxes.file_uri import FileUri -from ...types.devboxes.file_path import FilePath -from ...types.devboxes.range_param import RangeParam -from ...types.devboxes.symbol_type import SymbolType -from ...types.devboxes.base_command_param import BaseCommandParam -from ...types.devboxes.lsp_files_response import LspFilesResponse -from ...types.devboxes.formatting_response import FormattingResponse -from ...types.devboxes.references_response import ReferencesResponse -from ...types.devboxes.diagnostics_response import DiagnosticsResponse -from ...types.devboxes.base_diagnostic_param import BaseDiagnosticParam -from ...types.devboxes.code_actions_response import CodeActionsResponse -from ...types.devboxes.file_contents_response import FileContentsResponse -from ...types.devboxes.health_status_response import HealthStatusResponse -from ...types.devboxes.signature_help_response import SignatureHelpResponse -from ...types.devboxes.document_symbol_response import DocumentSymbolResponse -from ...types.devboxes.file_definition_response import FileDefinitionResponse -from ...types.devboxes.base_workspace_edit_param import BaseWorkspaceEditParam -from ...types.devboxes.code_action_context_param import CodeActionContextParam -from ...types.devboxes.code_segment_info_response import CodeSegmentInfoResponse -from ...types.devboxes.code_action_application_result import CodeActionApplicationResult -from ...types.devboxes.lsp_get_code_actions_for_diagnostic_response import LspGetCodeActionsForDiagnosticResponse - -__all__ = ["LspResource", "AsyncLspResource"] - - -class LspResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> LspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return LspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> LspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return LspResourceWithStreamingResponse(self) - - def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | Omit = omit, - edit: BaseWorkspaceEditParam | Omit = omit, - is_preferred: bool | Omit = omit, - kind: str | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - "kind": kind, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=CodeActionApplicationResult, - ) - - def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | Omit = omit, - range: RangeParam | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> CodeActionsResponse: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=CodeActionsResponse, - ) - - def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=DiagnosticsResponse, - ) - - def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> DocumentSymbolResponse: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=DocumentSymbolResponse, - ) - - def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file", - body=maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=FileContentsResponse, - ) - - def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> FileDefinitionResponse: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=FileDefinitionResponse, - ) - - def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> FormattingResponse: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=FormattingResponse, - ) - - def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=CodeSegmentInfoResponse, - ) - - def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=SignatureHelpResponse, - ) - - def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> ReferencesResponse: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/references", - body=maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=ReferencesResponse, - ) - - def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=str, - ) - - -class AsyncLspResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncLspResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncLspResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncLspResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncLspResourceWithStreamingResponse(self) - - async def apply_code_action( - self, - id: str, - *, - title: str, - command: BaseCommandParam | Omit = omit, - edit: BaseWorkspaceEditParam | Omit = omit, - is_preferred: bool | Omit = omit, - kind: str | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> CodeActionApplicationResult: - """ - Apply a code action to a given code segment not all code actions are supported - yet - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/apply-code-action", - body=await async_maybe_transform( - { - "title": title, - "command": command, - "edit": edit, - "is_preferred": is_preferred, - "kind": kind, - }, - lsp_apply_code_action_params.LspApplyCodeActionParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=CodeActionApplicationResult, - ) - - async def code_actions( - self, - id: str, - *, - uri: str, - context: CodeActionContextParam | Omit = omit, - range: RangeParam | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> CodeActionsResponse: - """Get code actions for a part of a document. - - This method calls the - `getCodeActions` method of the `LanguageService` class, which in turn - communicates with the TypeScript language server to retrieve code actions for a - given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction - - Args: - context: Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - - range: A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/code-actions", - body=await async_maybe_transform( - { - "uri": uri, - "context": context, - "range": range, - }, - lsp_code_actions_params.LspCodeActionsParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=CodeActionsResponse, - ) - - async def diagnostics( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> DiagnosticsResponse: - """ - Get diagnostics for a given file URI from the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/diagnostics", - body=await async_maybe_transform({"uri": uri}, lsp_diagnostics_params.LspDiagnosticsParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=DiagnosticsResponse, - ) - - async def document_symbols( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> DocumentSymbolResponse: - """ - Get document symbols for a given document. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/document-symbols", - body=await async_maybe_transform({"uri": uri}, lsp_document_symbols_params.LspDocumentSymbolsParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=DocumentSymbolResponse, - ) - - async def file( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> FileContentsResponse: - """ - Get the contents of a file at a given path relative to the root directory - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file", - body=await async_maybe_transform({"path": path}, lsp_file_params.LspFileParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=FileContentsResponse, - ) - - async def file_definition( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> FileDefinitionResponse: - """ - Get the definition of a symbol at a given position in a file - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/file-definition", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_file_definition_params.LspFileDefinitionParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=FileDefinitionResponse, - ) - - async def files( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> LspFilesResponse: - """ - Get a list of all files being watched by the language server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/files", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LspFilesResponse, - ) - - async def formatting( - self, - id: str, - *, - uri: FileUri, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> FormattingResponse: - """ - Get formatting changes for a given document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/formatting", - body=await async_maybe_transform({"uri": uri}, lsp_formatting_params.LspFormattingParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=FormattingResponse, - ) - - async def get_code_actions_for_diagnostic( - self, - id: str, - *, - diagnostic: BaseDiagnosticParam, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> LspGetCodeActionsForDiagnosticResponse: - """ - Get a list of code actions for a given diagnostic - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-actions-for-diagnostic", - body=await async_maybe_transform( - { - "diagnostic": diagnostic, - "uri": uri, - }, - lsp_get_code_actions_for_diagnostic_params.LspGetCodeActionsForDiagnosticParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=LspGetCodeActionsForDiagnosticResponse, - ) - - async def get_code_segment_info( - self, - id: str, - *, - symbol_name: str, - uri: FileUri, - symbol_type: SymbolType | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> CodeSegmentInfoResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-code-segment-info", - body=await async_maybe_transform( - { - "symbol_name": symbol_name, - "uri": uri, - "symbol_type": symbol_type, - }, - lsp_get_code_segment_info_params.LspGetCodeSegmentInfoParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=CodeSegmentInfoResponse, - ) - - async def get_signature_help( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> SignatureHelpResponse: - """ - Get the symbol, reference, and diagnostic information for a given code segment - in a file at a given depth - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/get-signature-help", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_get_signature_help_params.LspGetSignatureHelpParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=SignatureHelpResponse, - ) - - async def health( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> HealthStatusResponse: - """ - This method provides a health check for the language server, including its - status, uptime, the directory being watched, and the name of the module. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/devboxes/{id}/lsp/health", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=HealthStatusResponse, - ) - - async def references( - self, - id: str, - *, - character: float, - line: float, - uri: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> ReferencesResponse: - """Get references for a given symbol. - - This method calls the `getReferences` method - of the `LanguageService` class, which in turn communicates with the TypeScript - language server to retrieve references for a given symbol in the document. - https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/references", - body=await async_maybe_transform( - { - "character": character, - "line": line, - "uri": uri, - }, - lsp_references_params.LspReferencesParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=ReferencesResponse, - ) - - async def set_watch_directory( - self, - id: str, - *, - path: FilePath, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> str: - """ - Set the watch directory for the language server to a new path and restart the - server - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/lsp/set-watch-directory", - body=await async_maybe_transform({"path": path}, lsp_set_watch_directory_params.LspSetWatchDirectoryParams), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=str, - ) - - -class LspResourceWithRawResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = to_raw_response_wrapper( - lsp.files, - ) - self.formatting = to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_raw_response_wrapper( - lsp.health, - ) - self.references = to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithRawResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_raw_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_raw_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_raw_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_raw_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_raw_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_raw_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_raw_response_wrapper( - lsp.files, - ) - self.formatting = async_to_raw_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_raw_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_raw_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_raw_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_raw_response_wrapper( - lsp.health, - ) - self.references = async_to_raw_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_raw_response_wrapper( - lsp.set_watch_directory, - ) - - -class LspResourceWithStreamingResponse: - def __init__(self, lsp: LspResource) -> None: - self._lsp = lsp - - self.apply_code_action = to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = to_streamed_response_wrapper( - lsp.health, - ) - self.references = to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = to_streamed_response_wrapper( - lsp.set_watch_directory, - ) - - -class AsyncLspResourceWithStreamingResponse: - def __init__(self, lsp: AsyncLspResource) -> None: - self._lsp = lsp - - self.apply_code_action = async_to_streamed_response_wrapper( - lsp.apply_code_action, - ) - self.code_actions = async_to_streamed_response_wrapper( - lsp.code_actions, - ) - self.diagnostics = async_to_streamed_response_wrapper( - lsp.diagnostics, - ) - self.document_symbols = async_to_streamed_response_wrapper( - lsp.document_symbols, - ) - self.file = async_to_streamed_response_wrapper( - lsp.file, - ) - self.file_definition = async_to_streamed_response_wrapper( - lsp.file_definition, - ) - self.files = async_to_streamed_response_wrapper( - lsp.files, - ) - self.formatting = async_to_streamed_response_wrapper( - lsp.formatting, - ) - self.get_code_actions_for_diagnostic = async_to_streamed_response_wrapper( - lsp.get_code_actions_for_diagnostic, - ) - self.get_code_segment_info = async_to_streamed_response_wrapper( - lsp.get_code_segment_info, - ) - self.get_signature_help = async_to_streamed_response_wrapper( - lsp.get_signature_help, - ) - self.health = async_to_streamed_response_wrapper( - lsp.health, - ) - self.references = async_to_streamed_response_wrapper( - lsp.references, - ) - self.set_watch_directory = async_to_streamed_response_wrapper( - lsp.set_watch_directory, - ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 4bae9f954..d53235820 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -2,8 +2,6 @@ from __future__ import annotations -from . import devboxes -from .. import _compat from .shared import ( AfterIdle as AfterIdle, RunProfile as RunProfile, @@ -95,14 +93,3 @@ from .devbox_write_file_contents_params import DevboxWriteFileContentsParams as DevboxWriteFileContentsParams from .devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView as DevboxAsyncExecutionDetailView from .devbox_read_file_contents_response import DevboxReadFileContentsResponse as DevboxReadFileContentsResponse - -# Rebuild cyclical models only after all modules are imported. -# This ensures that, when building the deferred (due to cyclical references) model schema, -# Pydantic can resolve the necessary references. -# See: https://github.com/pydantic/pydantic/issues/11250 for more context. -if _compat.PYDANTIC_V1: - devboxes.code_segment_info_response.CodeSegmentInfoResponse.update_forward_refs() # type: ignore - devboxes.document_symbol.DocumentSymbol.update_forward_refs() # type: ignore -else: - devboxes.code_segment_info_response.CodeSegmentInfoResponse.model_rebuild(_parent_namespace_depth=0) - devboxes.document_symbol.DocumentSymbol.model_rebuild(_parent_namespace_depth=0) diff --git a/src/runloop_api_client/types/blueprint_view.py b/src/runloop_api_client/types/blueprint_view.py index 2dce4446c..2d0e32881 100644 --- a/src/runloop_api_client/types/blueprint_view.py +++ b/src/runloop_api_client/types/blueprint_view.py @@ -68,9 +68,9 @@ class BlueprintView(BaseModel): Services can be explicitly started when creating a Devbox. """ - devbox_capabilities: Optional[ - List[Literal["unknown", "computer_usage", "browser_usage", "language_server", "docker_in_docker"]] - ] = None + devbox_capabilities: Optional[List[Literal["unknown", "computer_usage", "browser_usage", "docker_in_docker"]]] = ( + None + ) """Capabilities that will be available on Devbox.""" failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "build_failed"]] = None diff --git a/src/runloop_api_client/types/devbox_execute_params.py b/src/runloop_api_client/types/devbox_execute_params.py index 6ac9d3632..8ddea07c2 100644 --- a/src/runloop_api_client/types/devbox_execute_params.py +++ b/src/runloop_api_client/types/devbox_execute_params.py @@ -20,6 +20,12 @@ class DevboxExecuteParams(TypedDict, total=False): command_id: Required[str] """The command ID for idempotency and tracking""" + optimistic_timeout: Optional[int] + """Timeout in seconds to wait for command completion. + + Operation is not killed. Max is 600 seconds. + """ + shell_name: Optional[str] """The name of the persistent shell to create or use if already created. diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 5724e118f..e00d846b6 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -33,7 +33,7 @@ class DevboxView(BaseModel): id: str """The ID of the Devbox.""" - capabilities: List[Literal["unknown", "computer_usage", "browser_usage", "language_server", "docker_in_docker"]] + capabilities: List[Literal["unknown", "computer_usage", "browser_usage", "docker_in_docker"]] """A list of capability groups this devbox has access to. This allows devboxes to be compatible with certain tools sets like computer diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 472d68e9a..9b7f0134d 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -2,91 +2,25 @@ from __future__ import annotations -from .u_ri import URi as URi -from .range import Range as Range -from .integer import Integer as Integer -from .file_uri import FileUri as FileUri -from .position import Position as Position -from .uinteger import Uinteger as Uinteger -from .file_path import FilePath as FilePath -from .text_edit import TextEdit as TextEdit -from .base_range import BaseRange as BaseRange -from .symbol_tag import SymbolTag as SymbolTag -from .range_param import RangeParam as RangeParam -from .symbol_kind import SymbolKind as SymbolKind -from .symbol_type import SymbolType as SymbolType -from .base_command import BaseCommand as BaseCommand from .browser_view import BrowserView as BrowserView -from .document_uri import DocumentUri as DocumentUri -from .base_location import BaseLocation as BaseLocation from .computer_view import ComputerView as ComputerView -from .base_signature import BaseSignature as BaseSignature -from .diagnostic_tag import DiagnosticTag as DiagnosticTag -from .l_sp_any_param import LSpAnyParam as LSpAnyParam -from .location_param import LocationParam as LocationParam -from .position_param import PositionParam as PositionParam -from .base_diagnostic import BaseDiagnostic as BaseDiagnostic -from .document_symbol import DocumentSymbol as DocumentSymbol from .log_list_params import LogListParams as LogListParams -from .lsp_file_params import LspFileParams as LspFileParams -from .text_edit_param import TextEditParam as TextEditParam -from .base_code_action import BaseCodeAction as BaseCodeAction -from .base_range_param import BaseRangeParam as BaseRangeParam -from .code_action_kind import CodeActionKind as CodeActionKind -from .diagnostic_param import DiagnosticParam as DiagnosticParam -from .base_command_param import BaseCommandParam as BaseCommandParam -from .lsp_files_response import LspFilesResponse as LspFilesResponse -from .base_markup_content import BaseMarkupContent as BaseMarkupContent -from .base_workspace_edit import BaseWorkspaceEdit as BaseWorkspaceEdit -from .diagnostic_severity import DiagnosticSeverity as DiagnosticSeverity -from .formatting_response import FormattingResponse as FormattingResponse -from .references_response import ReferencesResponse as ReferencesResponse -from .diagnostics_response import DiagnosticsResponse as DiagnosticsResponse -from .base_diagnostic_param import BaseDiagnosticParam as BaseDiagnosticParam from .browser_create_params import BrowserCreateParams as BrowserCreateParams -from .code_actions_response import CodeActionsResponse as CodeActionsResponse from .devbox_logs_list_view import DevboxLogsListView as DevboxLogsListView from .execution_kill_params import ExecutionKillParams as ExecutionKillParams -from .lsp_formatting_params import LspFormattingParams as LspFormattingParams -from .lsp_references_params import LspReferencesParams as LspReferencesParams -from .watched_file_response import WatchedFileResponse as WatchedFileResponse -from .code_description_param import CodeDescriptionParam as CodeDescriptionParam from .computer_create_params import ComputerCreateParams as ComputerCreateParams from .execution_update_chunk import ExecutionUpdateChunk as ExecutionUpdateChunk -from .file_contents_response import FileContentsResponse as FileContentsResponse -from .health_status_response import HealthStatusResponse as HealthStatusResponse -from .lsp_diagnostics_params import LspDiagnosticsParams as LspDiagnosticsParams -from .lsp_code_actions_params import LspCodeActionsParams as LspCodeActionsParams -from .signature_help_response import SignatureHelpResponse as SignatureHelpResponse -from .code_action_trigger_kind import CodeActionTriggerKind as CodeActionTriggerKind -from .document_symbol_response import DocumentSymbolResponse as DocumentSymbolResponse -from .file_definition_response import FileDefinitionResponse as FileDefinitionResponse -from .base_workspace_edit_param import BaseWorkspaceEditParam as BaseWorkspaceEditParam -from .code_action_context_param import CodeActionContextParam as CodeActionContextParam from .disk_snapshot_list_params import DiskSnapshotListParams as DiskSnapshotListParams from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams -from .base_parameter_information import BaseParameterInformation as BaseParameterInformation -from .code_segment_info_response import CodeSegmentInfoResponse as CodeSegmentInfoResponse -from .lsp_file_definition_params import LspFileDefinitionParams as LspFileDefinitionParams from .disk_snapshot_update_params import DiskSnapshotUpdateParams as DiskSnapshotUpdateParams -from .lsp_document_symbols_params import LspDocumentSymbolsParams as LspDocumentSymbolsParams -from .lsp_apply_code_action_params import LspApplyCodeActionParams as LspApplyCodeActionParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams -from .lsp_get_signature_help_params import LspGetSignatureHelpParams as LspGetSignatureHelpParams -from .record_string_text_edit_array import RecordStringTextEditArray as RecordStringTextEditArray -from .code_action_application_result import CodeActionApplicationResult as CodeActionApplicationResult from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams -from .lsp_set_watch_directory_params import LspSetWatchDirectoryParams as LspSetWatchDirectoryParams -from .lsp_get_code_segment_info_params import LspGetCodeSegmentInfoParams as LspGetCodeSegmentInfoParams -from .lsp_set_watch_directory_response import LspSetWatchDirectoryResponse as LspSetWatchDirectoryResponse from .computer_mouse_interaction_params import ComputerMouseInteractionParams as ComputerMouseInteractionParams from .devbox_snapshot_async_status_view import DevboxSnapshotAsyncStatusView as DevboxSnapshotAsyncStatusView from .computer_screen_interaction_params import ComputerScreenInteractionParams as ComputerScreenInteractionParams from .computer_mouse_interaction_response import ComputerMouseInteractionResponse as ComputerMouseInteractionResponse -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam as RecordStringTextEditArrayParam from .computer_keyboard_interaction_params import ComputerKeyboardInteractionParams as ComputerKeyboardInteractionParams from .computer_screen_interaction_response import ComputerScreenInteractionResponse as ComputerScreenInteractionResponse -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam as DiagnosticRelatedInformationParam from .computer_keyboard_interaction_response import ( ComputerKeyboardInteractionResponse as ComputerKeyboardInteractionResponse, ) @@ -96,9 +30,3 @@ from .execution_stream_stdout_updates_params import ( ExecutionStreamStdoutUpdatesParams as ExecutionStreamStdoutUpdatesParams, ) -from .lsp_get_code_actions_for_diagnostic_params import ( - LspGetCodeActionsForDiagnosticParams as LspGetCodeActionsForDiagnosticParams, -) -from .lsp_get_code_actions_for_diagnostic_response import ( - LspGetCodeActionsForDiagnosticResponse as LspGetCodeActionsForDiagnosticResponse, -) diff --git a/src/runloop_api_client/types/devboxes/base_code_action.py b/src/runloop_api_client/types/devboxes/base_code_action.py deleted file mode 100644 index 163ac4822..000000000 --- a/src/runloop_api_client/types/devboxes/base_code_action.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_command import BaseCommand -from .base_workspace_edit import BaseWorkspaceEdit - -__all__ = ["BaseCodeAction"] - - -class BaseCodeAction(BaseModel): - title: str - - command: Optional[BaseCommand] = None - - edit: Optional[BaseWorkspaceEdit] = None - - is_preferred: Optional[bool] = FieldInfo(alias="isPreferred", default=None) - - kind: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_command.py b/src/runloop_api_client/types/devboxes/base_command.py deleted file mode 100644 index 7defd0e9a..000000000 --- a/src/runloop_api_client/types/devboxes/base_command.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from ..._models import BaseModel - -__all__ = ["BaseCommand"] - - -class BaseCommand(BaseModel): - command: str - - title: str - - arguments: Optional[List[object]] = None diff --git a/src/runloop_api_client/types/devboxes/base_command_param.py b/src/runloop_api_client/types/devboxes/base_command_param.py deleted file mode 100644 index fe17f38f6..000000000 --- a/src/runloop_api_client/types/devboxes/base_command_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Iterable -from typing_extensions import Required, TypedDict - -__all__ = ["BaseCommandParam"] - - -class BaseCommandParam(TypedDict, total=False): - command: Required[str] - - title: Required[str] - - arguments: Iterable[object] diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic.py b/src/runloop_api_client/types/devboxes/base_diagnostic.py deleted file mode 100644 index 83249c034..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic.py +++ /dev/null @@ -1,22 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional - -from ..._models import BaseModel -from .base_range import BaseRange -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnostic"] - - -class BaseDiagnostic(BaseModel): - message: str - - range: BaseRange - - code: Union[float, str, None] = None - - severity: Optional[DiagnosticSeverity] = None - """The diagnostic's severity.""" - - source: Optional[str] = None diff --git a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py b/src/runloop_api_client/types/devboxes/base_diagnostic_param.py deleted file mode 100644 index b74f7435e..000000000 --- a/src/runloop_api_client/types/devboxes/base_diagnostic_param.py +++ /dev/null @@ -1,24 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Required, TypedDict - -from .base_range_param import BaseRangeParam -from .diagnostic_severity import DiagnosticSeverity - -__all__ = ["BaseDiagnosticParam"] - - -class BaseDiagnosticParam(TypedDict, total=False): - message: Required[str] - - range: Required[BaseRangeParam] - - code: Union[float, str] - - severity: DiagnosticSeverity - """The diagnostic's severity.""" - - source: str diff --git a/src/runloop_api_client/types/devboxes/base_location.py b/src/runloop_api_client/types/devboxes/base_location.py deleted file mode 100644 index 716a7cc0a..000000000 --- a/src/runloop_api_client/types/devboxes/base_location.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from ..._models import BaseModel -from .base_range import BaseRange - -__all__ = ["BaseLocation"] - - -class BaseLocation(BaseModel): - range: BaseRange - - uri: str diff --git a/src/runloop_api_client/types/devboxes/base_markup_content.py b/src/runloop_api_client/types/devboxes/base_markup_content.py deleted file mode 100644 index 8a00ea75d..000000000 --- a/src/runloop_api_client/types/devboxes/base_markup_content.py +++ /dev/null @@ -1,11 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from ..._models import BaseModel - -__all__ = ["BaseMarkupContent"] - - -class BaseMarkupContent(BaseModel): - kind: str - - value: str diff --git a/src/runloop_api_client/types/devboxes/base_parameter_information.py b/src/runloop_api_client/types/devboxes/base_parameter_information.py deleted file mode 100644 index 0075870f3..000000000 --- a/src/runloop_api_client/types/devboxes/base_parameter_information.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent - -__all__ = ["BaseParameterInformation", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseParameterInformation(BaseModel): - label: str - - documentation: Optional[Documentation] = None diff --git a/src/runloop_api_client/types/devboxes/base_range.py b/src/runloop_api_client/types/devboxes/base_range.py deleted file mode 100644 index a15dd11d4..000000000 --- a/src/runloop_api_client/types/devboxes/base_range.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from ..._models import BaseModel - -__all__ = ["BaseRange", "End", "Start"] - - -class End(BaseModel): - character: float - - line: float - - -class Start(BaseModel): - character: float - - line: float - - -class BaseRange(BaseModel): - end: End - - start: Start diff --git a/src/runloop_api_client/types/devboxes/base_range_param.py b/src/runloop_api_client/types/devboxes/base_range_param.py deleted file mode 100644 index d97e7fdee..000000000 --- a/src/runloop_api_client/types/devboxes/base_range_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["BaseRangeParam", "End", "Start"] - - -class End(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class Start(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - -class BaseRangeParam(TypedDict, total=False): - end: Required[End] - - start: Required[Start] diff --git a/src/runloop_api_client/types/devboxes/base_signature.py b/src/runloop_api_client/types/devboxes/base_signature.py deleted file mode 100644 index 7c1df775f..000000000 --- a/src/runloop_api_client/types/devboxes/base_signature.py +++ /dev/null @@ -1,20 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from typing_extensions import TypeAlias - -from ..._models import BaseModel -from .base_markup_content import BaseMarkupContent -from .base_parameter_information import BaseParameterInformation - -__all__ = ["BaseSignature", "Documentation"] - -Documentation: TypeAlias = Union[str, BaseMarkupContent] - - -class BaseSignature(BaseModel): - label: str - - documentation: Optional[Documentation] = None - - parameters: Optional[List[BaseParameterInformation]] = None diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit.py b/src/runloop_api_client/types/devboxes/base_workspace_edit.py deleted file mode 100644 index db5a77fa4..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from .record_string_text_edit_array import RecordStringTextEditArray - -__all__ = ["BaseWorkspaceEdit"] - - -class BaseWorkspaceEdit(BaseModel): - changes: Optional[RecordStringTextEditArray] = None - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py b/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py deleted file mode 100644 index 89a933497..000000000 --- a/src/runloop_api_client/types/devboxes/base_workspace_edit_param.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -from .record_string_text_edit_array_param import RecordStringTextEditArrayParam - -__all__ = ["BaseWorkspaceEditParam"] - - -class BaseWorkspaceEditParam(TypedDict, total=False): - changes: RecordStringTextEditArrayParam - """Construct a type with a set of properties K of type T""" diff --git a/src/runloop_api_client/types/devboxes/code_action_application_result.py b/src/runloop_api_client/types/devboxes/code_action_application_result.py deleted file mode 100644 index 49a2ad557..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_application_result.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["CodeActionApplicationResult"] - - -class CodeActionApplicationResult(BaseModel): - success: bool - - error: Optional[str] = None - - files_changed: Optional[List[str]] = FieldInfo(alias="filesChanged", default=None) diff --git a/src/runloop_api_client/types/devboxes/code_action_context_param.py b/src/runloop_api_client/types/devboxes/code_action_context_param.py deleted file mode 100644 index 94238f551..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_context_param.py +++ /dev/null @@ -1,38 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Union, Iterable -from typing_extensions import Required, Annotated, TypeAlias, TypedDict - -from ..._types import SequenceNotStr -from ..._utils import PropertyInfo -from .code_action_kind import CodeActionKind -from .diagnostic_param import DiagnosticParam -from .code_action_trigger_kind import CodeActionTriggerKind - -__all__ = ["CodeActionContextParam"] - - -class CodeActionContextParamTyped(TypedDict, total=False): - diagnostics: Required[Iterable[DiagnosticParam]] - """ - An array of diagnostics known on the client side overlapping the range provided - to the `textDocument/codeAction` request. They are provided so that the server - knows which errors are currently presented to the user for the given range. - There is no guarantee that these accurately reflect the error state of the - resource. The primary parameter to compute code actions is the provided range. - """ - - only: SequenceNotStr[CodeActionKind] - """Requested kind of actions to return. - - Actions not of this kind are filtered out by the client before being shown. So - servers can omit computing them. - """ - - trigger_kind: Annotated[CodeActionTriggerKind, PropertyInfo(alias="triggerKind")] - """The reason why code actions were requested.""" - - -CodeActionContextParam: TypeAlias = Union[CodeActionContextParamTyped, Dict[str, object]] diff --git a/src/runloop_api_client/types/devboxes/code_action_kind.py b/src/runloop_api_client/types/devboxes/code_action_kind.py deleted file mode 100644 index 2878d6335..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["CodeActionKind"] - -CodeActionKind: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py b/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py deleted file mode 100644 index f365d75f8..000000000 --- a/src/runloop_api_client/types/devboxes/code_action_trigger_kind.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["CodeActionTriggerKind"] - -CodeActionTriggerKind: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/code_actions_response.py b/src/runloop_api_client/types/devboxes/code_actions_response.py deleted file mode 100644 index 97aabe75f..000000000 --- a/src/runloop_api_client/types/devboxes/code_actions_response.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union -from typing_extensions import TypeAlias - -from .base_command import BaseCommand -from .base_code_action import BaseCodeAction - -__all__ = ["CodeActionsResponse", "CodeActionsResponseItem"] - -CodeActionsResponseItem: TypeAlias = Union[BaseCodeAction, BaseCommand] - -CodeActionsResponse: TypeAlias = List[CodeActionsResponseItem] diff --git a/src/runloop_api_client/types/devboxes/code_description_param.py b/src/runloop_api_client/types/devboxes/code_description_param.py deleted file mode 100644 index f41c8f514..000000000 --- a/src/runloop_api_client/types/devboxes/code_description_param.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Union -from typing_extensions import Required, TypeAlias, TypedDict - -from .u_ri import URi - -__all__ = ["CodeDescriptionParam"] - - -class CodeDescriptionParamTyped(TypedDict, total=False): - href: Required[URi] - """An URI to open with more information about the diagnostic error.""" - - -CodeDescriptionParam: TypeAlias = Union[CodeDescriptionParamTyped, Dict[str, object]] diff --git a/src/runloop_api_client/types/devboxes/code_segment_info_response.py b/src/runloop_api_client/types/devboxes/code_segment_info_response.py deleted file mode 100644 index 0e931bd28..000000000 --- a/src/runloop_api_client/types/devboxes/code_segment_info_response.py +++ /dev/null @@ -1,46 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import List, Optional - -from .file_uri import FileUri -from ..._models import BaseModel -from .base_range import BaseRange -from .base_location import BaseLocation -from .base_diagnostic import BaseDiagnostic -from .base_code_action import BaseCodeAction -from .signature_help_response import SignatureHelpResponse - -__all__ = ["CodeSegmentInfoResponse", "Hover"] - - -class Hover(BaseModel): - contents: object - - range: Optional[BaseRange] = None - - -class CodeSegmentInfoResponse(BaseModel): - actions: List[BaseCodeAction] - - diagnostics: List[BaseDiagnostic] - - references: List[BaseLocation] - - symbol: "DocumentSymbol" - """ - Represents programming constructs like variables, classes, interfaces etc. that - appear in a document. Document symbols can be hierarchical and they have two - ranges: one that encloses its definition and one that points to its most - interesting range, e.g. the range of an identifier. - """ - - uri: FileUri - - hover: Optional[Hover] = None - - signature: Optional[SignatureHelpResponse] = None - - -from .document_symbol import DocumentSymbol diff --git a/src/runloop_api_client/types/devboxes/diagnostic_param.py b/src/runloop_api_client/types/devboxes/diagnostic_param.py deleted file mode 100644 index e163b5c83..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_param.py +++ /dev/null @@ -1,68 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Union, Iterable -from typing_extensions import Required, Annotated, TypeAlias, TypedDict - -from .integer import Integer -from ..._utils import PropertyInfo -from .range_param import RangeParam -from .diagnostic_tag import DiagnosticTag -from .l_sp_any_param import LSpAnyParam -from .diagnostic_severity import DiagnosticSeverity -from .code_description_param import CodeDescriptionParam -from .diagnostic_related_information_param import DiagnosticRelatedInformationParam - -__all__ = ["DiagnosticParam"] - - -class DiagnosticParamTyped(TypedDict, total=False): - message: Required[str] - """The diagnostic's message. It usually appears in the user interface""" - - range: Required[RangeParam] - """The range at which the message applies""" - - code: Union[Integer, str] - """The diagnostic's code, which usually appear in the user interface.""" - - code_description: Annotated[CodeDescriptionParam, PropertyInfo(alias="codeDescription")] - """ - An optional property to describe the error code. Requires the code field (above) - to be present/not null. - """ - - data: LSpAnyParam - """ - A data entry field that is preserved between a `textDocument/publishDiagnostics` - notification and `textDocument/codeAction` request. - """ - - related_information: Annotated[ - Iterable[DiagnosticRelatedInformationParam], PropertyInfo(alias="relatedInformation") - ] - """An array of related diagnostic information, e.g. - - when symbol-names within a scope collide all definitions can be marked via this - property. - """ - - severity: DiagnosticSeverity - """The diagnostic's severity. - - Can be omitted. If omitted it is up to the client to interpret diagnostics as - error, warning, info or hint. - """ - - source: str - """A human-readable string describing the source of this diagnostic, e.g. - - 'typescript' or 'super lint'. It usually appears in the user interface. - """ - - tags: Iterable[DiagnosticTag] - """Additional metadata about the diagnostic.""" - - -DiagnosticParam: TypeAlias = Union[DiagnosticParamTyped, Dict[str, object]] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py b/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py deleted file mode 100644 index 8f654af15..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_related_information_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Union -from typing_extensions import Required, TypeAlias, TypedDict - -from .location_param import LocationParam - -__all__ = ["DiagnosticRelatedInformationParam"] - - -class DiagnosticRelatedInformationParamTyped(TypedDict, total=False): - location: Required[LocationParam] - """The location of this related diagnostic information.""" - - message: Required[str] - """The message of this related diagnostic information.""" - - -DiagnosticRelatedInformationParam: TypeAlias = Union[DiagnosticRelatedInformationParamTyped, Dict[str, object]] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_severity.py b/src/runloop_api_client/types/devboxes/diagnostic_severity.py deleted file mode 100644 index 34bb1dfe6..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_severity.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticSeverity"] - -DiagnosticSeverity: TypeAlias = Literal[1, 2, 3, 4] diff --git a/src/runloop_api_client/types/devboxes/diagnostic_tag.py b/src/runloop_api_client/types/devboxes/diagnostic_tag.py deleted file mode 100644 index 693d4f6e4..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostic_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["DiagnosticTag"] - -DiagnosticTag: TypeAlias = Literal[1, 2] diff --git a/src/runloop_api_client/types/devboxes/diagnostics_response.py b/src/runloop_api_client/types/devboxes/diagnostics_response.py deleted file mode 100644 index 1b75b2741..000000000 --- a/src/runloop_api_client/types/devboxes/diagnostics_response.py +++ /dev/null @@ -1,14 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel -from .base_diagnostic import BaseDiagnostic - -__all__ = ["DiagnosticsResponse"] - - -class DiagnosticsResponse(BaseModel): - diagnostics: List[BaseDiagnostic] - - uri: str diff --git a/src/runloop_api_client/types/devboxes/document_symbol.py b/src/runloop_api_client/types/devboxes/document_symbol.py deleted file mode 100644 index 39eb3e0ce..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import TYPE_CHECKING, Dict, List, Optional - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel -from .symbol_tag import SymbolTag -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbol"] - - -class DocumentSymbol(BaseModel): - kind: SymbolKind - """The kind of this symbol.""" - - name: str - """The name of this symbol. - - Will be displayed in the user interface and therefore must not be an empty - string or a string only consisting of white spaces. - """ - - range: Range - """ - The range enclosing this symbol not including leading/trailing whitespace but - everything else like comments. This information is typically used to determine - if the clients cursor is inside the symbol to reveal in the symbol in the UI. - """ - - selection_range: Range = FieldInfo(alias="selectionRange") - """ - The range that should be selected and revealed when this symbol is being picked, - e.g the name of a function. Must be contained by the `range`. - """ - - children: Optional[List["DocumentSymbol"]] = None - """Children of this symbol, e.g. properties of a class.""" - - deprecated: Optional[bool] = None - """Indicates if this symbol is deprecated.""" - - detail: Optional[str] = None - """More detail for this symbol, e.g the signature of a function.""" - - tags: Optional[List[SymbolTag]] = None - """Tags for this document symbol.""" - - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - if TYPE_CHECKING: - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... diff --git a/src/runloop_api_client/types/devboxes/document_symbol_response.py b/src/runloop_api_client/types/devboxes/document_symbol_response.py deleted file mode 100644 index afb469589..000000000 --- a/src/runloop_api_client/types/devboxes/document_symbol_response.py +++ /dev/null @@ -1,26 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_range import BaseRange -from .symbol_kind import SymbolKind - -__all__ = ["DocumentSymbolResponse", "DocumentSymbolResponseItem"] - - -class DocumentSymbolResponseItem(BaseModel): - kind: SymbolKind - """A symbol kind.""" - - name: str - - range: BaseRange - - selection_range: BaseRange = FieldInfo(alias="selectionRange") - - -DocumentSymbolResponse: TypeAlias = List[DocumentSymbolResponseItem] diff --git a/src/runloop_api_client/types/devboxes/document_uri.py b/src/runloop_api_client/types/devboxes/document_uri.py deleted file mode 100644 index 0b7ae87a3..000000000 --- a/src/runloop_api_client/types/devboxes/document_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["DocumentUri"] - -DocumentUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_contents_response.py b/src/runloop_api_client/types/devboxes/file_contents_response.py deleted file mode 100644 index b862022e5..000000000 --- a/src/runloop_api_client/types/devboxes/file_contents_response.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .file_path import FilePath - -__all__ = ["FileContentsResponse"] - - -class FileContentsResponse(BaseModel): - contents: str - - full_path: str = FieldInfo(alias="fullPath") - - path: FilePath diff --git a/src/runloop_api_client/types/devboxes/file_definition_response.py b/src/runloop_api_client/types/devboxes/file_definition_response.py deleted file mode 100644 index 11d40a035..000000000 --- a/src/runloop_api_client/types/devboxes/file_definition_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_location import BaseLocation - -__all__ = ["FileDefinitionResponse"] - -FileDefinitionResponse: TypeAlias = List[BaseLocation] diff --git a/src/runloop_api_client/types/devboxes/file_path.py b/src/runloop_api_client/types/devboxes/file_path.py deleted file mode 100644 index 008c01f66..000000000 --- a/src/runloop_api_client/types/devboxes/file_path.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FilePath"] - -FilePath: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/file_uri.py b/src/runloop_api_client/types/devboxes/file_uri.py deleted file mode 100644 index 293323d00..000000000 --- a/src/runloop_api_client/types/devboxes/file_uri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["FileUri"] - -FileUri: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/formatting_response.py b/src/runloop_api_client/types/devboxes/formatting_response.py deleted file mode 100644 index 4802ebcc2..000000000 --- a/src/runloop_api_client/types/devboxes/formatting_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["FormattingResponse"] - -FormattingResponse: TypeAlias = List[TextEdit] diff --git a/src/runloop_api_client/types/devboxes/health_status_response.py b/src/runloop_api_client/types/devboxes/health_status_response.py deleted file mode 100644 index 5b02dd9af..000000000 --- a/src/runloop_api_client/types/devboxes/health_status_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["HealthStatusResponse"] - - -class HealthStatusResponse(BaseModel): - dirty_files: List[str] = FieldInfo(alias="dirtyFiles") - - module_name: str = FieldInfo(alias="moduleName") - - pending_work: Dict[str, object] = FieldInfo(alias="pendingWork") - - status: str - - uptime: str - - watch_directory: str = FieldInfo(alias="watchDirectory") diff --git a/src/runloop_api_client/types/devboxes/integer.py b/src/runloop_api_client/types/devboxes/integer.py deleted file mode 100644 index 2ff55a8c7..000000000 --- a/src/runloop_api_client/types/devboxes/integer.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Integer"] - -Integer: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/l_sp_any_param.py b/src/runloop_api_client/types/devboxes/l_sp_any_param.py deleted file mode 100644 index 1fe0adec1..000000000 --- a/src/runloop_api_client/types/devboxes/l_sp_any_param.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypeAlias - -__all__ = ["LSpAnyParam"] - -LSpAnyParam: TypeAlias = object diff --git a/src/runloop_api_client/types/devboxes/location_param.py b/src/runloop_api_client/types/devboxes/location_param.py deleted file mode 100644 index 22443458e..000000000 --- a/src/runloop_api_client/types/devboxes/location_param.py +++ /dev/null @@ -1,37 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Union -from typing_extensions import Required, TypeAlias, TypedDict - -from .range_param import RangeParam -from .document_uri import DocumentUri - -__all__ = ["LocationParam"] - - -class LocationParamTyped(TypedDict, total=False): - range: Required[RangeParam] - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ - - uri: Required[DocumentUri] - """A tagging type for string properties that are actually document URIs.""" - - -LocationParam: TypeAlias = Union[LocationParamTyped, Dict[str, object]] diff --git a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py b/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py deleted file mode 100644 index 533006b14..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_apply_code_action_params.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .base_command_param import BaseCommandParam -from .base_workspace_edit_param import BaseWorkspaceEditParam - -__all__ = ["LspApplyCodeActionParams"] - - -class LspApplyCodeActionParams(TypedDict, total=False): - title: Required[str] - - command: BaseCommandParam - - edit: BaseWorkspaceEditParam - - is_preferred: Annotated[bool, PropertyInfo(alias="isPreferred")] - - kind: str diff --git a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py b/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py deleted file mode 100644 index f59f19457..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_code_actions_params.py +++ /dev/null @@ -1,40 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .range_param import RangeParam -from .code_action_context_param import CodeActionContextParam - -__all__ = ["LspCodeActionsParams"] - - -class LspCodeActionsParams(TypedDict, total=False): - uri: Required[str] - - context: CodeActionContextParam - """ - Contains additional diagnostic information about the context in which a {@link - CodeActionProvider.provideCodeActions code action} is run. The CodeActionContext - namespace provides helper functions to work with {@link CodeActionContext} - literals. - """ - - range: RangeParam - """A range in a text document expressed as (zero-based) start and end positions. - - If you want to specify a range that contains a line including the line ending - character(s) then use an end position denoting the start of the next line. For - example: - - ```ts - { - start: { line: 5, character: 23 } - end : { line 6, character : 0 } - } - ``` - - The Range namespace provides helper functions to work with {@link Range} - literals. - """ diff --git a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py b/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py deleted file mode 100644 index 103f7c1c1..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_diagnostics_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDiagnosticsParams"] - - -class LspDiagnosticsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py b/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py deleted file mode 100644 index f1c85e223..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_document_symbols_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspDocumentSymbolsParams"] - - -class LspDocumentSymbolsParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py b/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py deleted file mode 100644 index ea8b647cc..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_definition_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspFileDefinitionParams"] - - -class LspFileDefinitionParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_file_params.py b/src/runloop_api_client/types/devboxes/lsp_file_params.py deleted file mode 100644 index f3caba3d8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_file_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspFileParams"] - - -class LspFileParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_files_response.py b/src/runloop_api_client/types/devboxes/lsp_files_response.py deleted file mode 100644 index 699491a0a..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_files_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .watched_file_response import WatchedFileResponse - -__all__ = ["LspFilesResponse"] - -LspFilesResponse: TypeAlias = List[WatchedFileResponse] diff --git a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py b/src/runloop_api_client/types/devboxes/lsp_formatting_params.py deleted file mode 100644 index 4ffecaee8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_formatting_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_uri import FileUri - -__all__ = ["LspFormattingParams"] - - -class LspFormattingParams(TypedDict, total=False): - uri: Required[FileUri] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py deleted file mode 100644 index 03d24fa27..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .base_diagnostic_param import BaseDiagnosticParam - -__all__ = ["LspGetCodeActionsForDiagnosticParams"] - - -class LspGetCodeActionsForDiagnosticParams(TypedDict, total=False): - diagnostic: Required[BaseDiagnosticParam] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py b/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py deleted file mode 100644 index fac1c53a8..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_actions_for_diagnostic_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_code_action import BaseCodeAction - -__all__ = ["LspGetCodeActionsForDiagnosticResponse"] - -LspGetCodeActionsForDiagnosticResponse: TypeAlias = List[BaseCodeAction] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py b/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py deleted file mode 100644 index d26cafc31..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_code_segment_info_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo -from .file_uri import FileUri -from .symbol_type import SymbolType - -__all__ = ["LspGetCodeSegmentInfoParams"] - - -class LspGetCodeSegmentInfoParams(TypedDict, total=False): - symbol_name: Required[Annotated[str, PropertyInfo(alias="symbolName")]] - - uri: Required[FileUri] - - symbol_type: Annotated[SymbolType, PropertyInfo(alias="symbolType")] diff --git a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py b/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py deleted file mode 100644 index c15382de0..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_get_signature_help_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspGetSignatureHelpParams"] - - -class LspGetSignatureHelpParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_references_params.py b/src/runloop_api_client/types/devboxes/lsp_references_params.py deleted file mode 100644 index f84058b8b..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_references_params.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["LspReferencesParams"] - - -class LspReferencesParams(TypedDict, total=False): - character: Required[float] - - line: Required[float] - - uri: Required[str] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py deleted file mode 100644 index 88abae178..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_params.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from .file_path import FilePath - -__all__ = ["LspSetWatchDirectoryParams"] - - -class LspSetWatchDirectoryParams(TypedDict, total=False): - path: Required[FilePath] diff --git a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py b/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py deleted file mode 100644 index 575252b7f..000000000 --- a/src/runloop_api_client/types/devboxes/lsp_set_watch_directory_response.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["LspSetWatchDirectoryResponse"] - -LspSetWatchDirectoryResponse: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/position.py b/src/runloop_api_client/types/devboxes/position.py deleted file mode 100644 index 25937dec2..000000000 --- a/src/runloop_api_client/types/devboxes/position.py +++ /dev/null @@ -1,37 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import TYPE_CHECKING, Dict - -from pydantic import Field as FieldInfo - -from .uinteger import Uinteger -from ..._models import BaseModel - -__all__ = ["Position"] - - -class Position(BaseModel): - character: Uinteger - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Uinteger - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ - - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - if TYPE_CHECKING: - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... diff --git a/src/runloop_api_client/types/devboxes/position_param.py b/src/runloop_api_client/types/devboxes/position_param.py deleted file mode 100644 index 65432122a..000000000 --- a/src/runloop_api_client/types/devboxes/position_param.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Union -from typing_extensions import Required, TypeAlias, TypedDict - -from .uinteger import Uinteger - -__all__ = ["PositionParam"] - - -class PositionParamTyped(TypedDict, total=False): - character: Required[Uinteger] - """Character offset on a line in a document (zero-based). - - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. - - If the character value is greater than the line length it defaults back to the - line length. - """ - - line: Required[Uinteger] - """Line position in a document (zero-based). - - If a line number is greater than the number of lines in a document, it defaults - back to the number of lines in the document. If a line number is negative, it - defaults to 0. - """ - - -PositionParam: TypeAlias = Union[PositionParamTyped, Dict[str, object]] diff --git a/src/runloop_api_client/types/devboxes/range.py b/src/runloop_api_client/types/devboxes/range.py deleted file mode 100644 index b7b4717e5..000000000 --- a/src/runloop_api_client/types/devboxes/range.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import TYPE_CHECKING, Dict - -from pydantic import Field as FieldInfo - -from .position import Position -from ..._models import BaseModel - -__all__ = ["Range"] - - -class Range(BaseModel): - end: Position - """The range's end position.""" - - start: Position - """The range's start position.""" - - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - if TYPE_CHECKING: - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... diff --git a/src/runloop_api_client/types/devboxes/range_param.py b/src/runloop_api_client/types/devboxes/range_param.py deleted file mode 100644 index 2f267a048..000000000 --- a/src/runloop_api_client/types/devboxes/range_param.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Union -from typing_extensions import Required, TypeAlias, TypedDict - -from .position_param import PositionParam - -__all__ = ["RangeParam"] - - -class RangeParamTyped(TypedDict, total=False): - end: Required[PositionParam] - """The range's end position.""" - - start: Required[PositionParam] - """The range's start position.""" - - -RangeParam: TypeAlias = Union[RangeParamTyped, Dict[str, object]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py deleted file mode 100644 index 84efd3ea0..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import TypeAlias - -from .text_edit import TextEdit - -__all__ = ["RecordStringTextEditArray"] - -RecordStringTextEditArray: TypeAlias = Dict[str, List[TextEdit]] diff --git a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py b/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py deleted file mode 100644 index 19e7cf731..000000000 --- a/src/runloop_api_client/types/devboxes/record_string_text_edit_array_param.py +++ /dev/null @@ -1,12 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Iterable -from typing_extensions import TypeAlias - -from .text_edit_param import TextEditParam - -__all__ = ["RecordStringTextEditArrayParam"] - -RecordStringTextEditArrayParam: TypeAlias = Dict[str, Iterable[TextEditParam]] diff --git a/src/runloop_api_client/types/devboxes/references_response.py b/src/runloop_api_client/types/devboxes/references_response.py deleted file mode 100644 index 59fc2d3de..000000000 --- a/src/runloop_api_client/types/devboxes/references_response.py +++ /dev/null @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .base_location import BaseLocation - -__all__ = ["ReferencesResponse"] - -ReferencesResponse: TypeAlias = List[BaseLocation] diff --git a/src/runloop_api_client/types/devboxes/signature_help_response.py b/src/runloop_api_client/types/devboxes/signature_help_response.py deleted file mode 100644 index 1cf0ac4cb..000000000 --- a/src/runloop_api_client/types/devboxes/signature_help_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel -from .base_signature import BaseSignature - -__all__ = ["SignatureHelpResponse"] - - -class SignatureHelpResponse(BaseModel): - signatures: List[BaseSignature] - - active_parameter: Optional[float] = FieldInfo(alias="activeParameter", default=None) - - active_signature: Optional[float] = FieldInfo(alias="activeSignature", default=None) diff --git a/src/runloop_api_client/types/devboxes/symbol_kind.py b/src/runloop_api_client/types/devboxes/symbol_kind.py deleted file mode 100644 index d21c01515..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_kind.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolKind"] - -SymbolKind: TypeAlias = Literal[ - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 -] diff --git a/src/runloop_api_client/types/devboxes/symbol_tag.py b/src/runloop_api_client/types/devboxes/symbol_tag.py deleted file mode 100644 index 0779efce5..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_tag.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolTag"] - -SymbolTag: TypeAlias = Literal[1] diff --git a/src/runloop_api_client/types/devboxes/symbol_type.py b/src/runloop_api_client/types/devboxes/symbol_type.py deleted file mode 100644 index 1623bacf2..000000000 --- a/src/runloop_api_client/types/devboxes/symbol_type.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal, TypeAlias - -__all__ = ["SymbolType"] - -SymbolType: TypeAlias = Literal["function", "variable", "class", "interface", "type"] diff --git a/src/runloop_api_client/types/devboxes/text_edit.py b/src/runloop_api_client/types/devboxes/text_edit.py deleted file mode 100644 index 3f1c860a8..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit.py +++ /dev/null @@ -1,28 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import TYPE_CHECKING, Dict - -from pydantic import Field as FieldInfo - -from .range import Range -from ..._models import BaseModel - -__all__ = ["TextEdit"] - - -class TextEdit(BaseModel): - new_text: str = FieldInfo(alias="newText") - """The string to be inserted. For delete operations use an empty string.""" - - range: Range - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ - - __pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] - if TYPE_CHECKING: - # Stub to indicate that arbitrary properties are accepted. - # To access properties that are not valid identifiers you can use `getattr`, e.g. - # `getattr(obj, '$type')` - def __getattr__(self, attr: str) -> object: ... diff --git a/src/runloop_api_client/types/devboxes/text_edit_param.py b/src/runloop_api_client/types/devboxes/text_edit_param.py deleted file mode 100644 index f0d710195..000000000 --- a/src/runloop_api_client/types/devboxes/text_edit_param.py +++ /dev/null @@ -1,25 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Dict, Union -from typing_extensions import Required, Annotated, TypeAlias, TypedDict - -from ..._utils import PropertyInfo -from .range_param import RangeParam - -__all__ = ["TextEditParam"] - - -class TextEditParamTyped(TypedDict, total=False): - new_text: Required[Annotated[str, PropertyInfo(alias="newText")]] - """The string to be inserted. For delete operations use an empty string.""" - - range: Required[RangeParam] - """The range of the text document to be manipulated. - - To insert text into a document create a range where start === end. - """ - - -TextEditParam: TypeAlias = Union[TextEditParamTyped, Dict[str, object]] diff --git a/src/runloop_api_client/types/devboxes/u_ri.py b/src/runloop_api_client/types/devboxes/u_ri.py deleted file mode 100644 index 132a3bd29..000000000 --- a/src/runloop_api_client/types/devboxes/u_ri.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["URi"] - -URi: TypeAlias = str diff --git a/src/runloop_api_client/types/devboxes/uinteger.py b/src/runloop_api_client/types/devboxes/uinteger.py deleted file mode 100644 index b1f8376cb..000000000 --- a/src/runloop_api_client/types/devboxes/uinteger.py +++ /dev/null @@ -1,7 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import TypeAlias - -__all__ = ["Uinteger"] - -Uinteger: TypeAlias = float diff --git a/src/runloop_api_client/types/devboxes/watched_file_response.py b/src/runloop_api_client/types/devboxes/watched_file_response.py deleted file mode 100644 index 9ef69585a..000000000 --- a/src/runloop_api_client/types/devboxes/watched_file_response.py +++ /dev/null @@ -1,15 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from pydantic import Field as FieldInfo - -from ..._models import BaseModel - -__all__ = ["WatchedFileResponse"] - - -class WatchedFileResponse(BaseModel): - filename: str - - full_path: str = FieldInfo(alias="fullPath") - - path: str diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index e9a6c3ee0..d8955edd6 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -11,6 +11,8 @@ from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types import DevboxExecutionDetailView, DevboxAsyncExecutionDetailView +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -127,27 +129,32 @@ def test_path_params_execute_async(self, client: Runloop) -> None: @parametrize def test_method_execute_sync(self, client: Runloop) -> None: - execution = client.devboxes.executions.execute_sync( - id="id", - command="command", - ) + with pytest.warns(DeprecationWarning): + execution = client.devboxes.executions.execute_sync( + id="id", + command="command", + ) + assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) @parametrize def test_method_execute_sync_with_all_params(self, client: Runloop) -> None: - execution = client.devboxes.executions.execute_sync( - id="id", - command="command", - shell_name="shell_name", - ) + with pytest.warns(DeprecationWarning): + execution = client.devboxes.executions.execute_sync( + id="id", + command="command", + shell_name="shell_name", + ) + assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) @parametrize def test_raw_response_execute_sync(self, client: Runloop) -> None: - response = client.devboxes.executions.with_raw_response.execute_sync( - id="id", - command="command", - ) + with pytest.warns(DeprecationWarning): + response = client.devboxes.executions.with_raw_response.execute_sync( + id="id", + command="command", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -156,25 +163,27 @@ def test_raw_response_execute_sync(self, client: Runloop) -> None: @parametrize def test_streaming_response_execute_sync(self, client: Runloop) -> None: - with client.devboxes.executions.with_streaming_response.execute_sync( - id="id", - command="command", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.devboxes.executions.with_streaming_response.execute_sync( + id="id", + command="command", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - execution = response.parse() - assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) + execution = response.parse() + assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_execute_sync(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.executions.with_raw_response.execute_sync( - id="", - command="command", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.executions.with_raw_response.execute_sync( + id="", + command="command", + ) @parametrize def test_method_kill(self, client: Runloop) -> None: @@ -461,27 +470,32 @@ async def test_path_params_execute_async(self, async_client: AsyncRunloop) -> No @parametrize async def test_method_execute_sync(self, async_client: AsyncRunloop) -> None: - execution = await async_client.devboxes.executions.execute_sync( - id="id", - command="command", - ) + with pytest.warns(DeprecationWarning): + execution = await async_client.devboxes.executions.execute_sync( + id="id", + command="command", + ) + assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) @parametrize async def test_method_execute_sync_with_all_params(self, async_client: AsyncRunloop) -> None: - execution = await async_client.devboxes.executions.execute_sync( - id="id", - command="command", - shell_name="shell_name", - ) + with pytest.warns(DeprecationWarning): + execution = await async_client.devboxes.executions.execute_sync( + id="id", + command="command", + shell_name="shell_name", + ) + assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) @parametrize async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.executions.with_raw_response.execute_sync( - id="id", - command="command", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.devboxes.executions.with_raw_response.execute_sync( + id="id", + command="command", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -490,25 +504,27 @@ async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> No @parametrize async def test_streaming_response_execute_sync(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.executions.with_streaming_response.execute_sync( - id="id", - command="command", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.devboxes.executions.with_streaming_response.execute_sync( + id="id", + command="command", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - execution = await response.parse() - assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) + execution = await response.parse() + assert_matches_type(DevboxExecutionDetailView, execution, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.executions.with_raw_response.execute_sync( - id="", - command="command", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.executions.with_raw_response.execute_sync( + id="", + command="command", + ) @parametrize async def test_method_kill(self, async_client: AsyncRunloop) -> None: diff --git a/tests/api_resources/devboxes/test_lsp.py b/tests/api_resources/devboxes/test_lsp.py deleted file mode 100644 index fe9a479b1..000000000 --- a/tests/api_resources/devboxes/test_lsp.py +++ /dev/null @@ -1,1616 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types.devboxes import ( - LspFilesResponse, - FormattingResponse, - ReferencesResponse, - CodeActionsResponse, - DiagnosticsResponse, - FileContentsResponse, - HealthStatusResponse, - SignatureHelpResponse, - DocumentSymbolResponse, - FileDefinitionResponse, - CodeSegmentInfoResponse, - CodeActionApplicationResult, - LspGetCodeActionsForDiagnosticResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestLsp: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_apply_code_action(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_method_apply_code_action_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - kind="kind", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_raw_response_apply_code_action(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - def test_streaming_response_apply_code_action(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_apply_code_action(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - def test_method_code_actions(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(CodeActionsResponse, lsp, path=["response"]) - - @parametrize - def test_method_code_actions_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "string"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "string", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(CodeActionsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_code_actions(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeActionsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_code_actions(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeActionsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_code_actions(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - def test_method_diagnostics(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.diagnostics( - id="id", - uri="string", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_diagnostics(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_diagnostics(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_diagnostics(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="string", - ) - - @parametrize - def test_method_document_symbols(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.document_symbols( - id="id", - uri="string", - ) - assert_matches_type(DocumentSymbolResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_document_symbols(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(DocumentSymbolResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_document_symbols(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(DocumentSymbolResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_document_symbols(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="string", - ) - - @parametrize - def test_method_file(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file( - id="id", - path="string", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file( - id="id", - path="string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file( - id="id", - path="string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file( - id="", - path="string", - ) - - @parametrize - def test_method_file_definition(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(FileDefinitionResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_file_definition(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FileDefinitionResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_file_definition(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FileDefinitionResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_file_definition(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_files(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_files(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_files(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_files(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - def test_method_formatting(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.formatting( - id="id", - uri="string", - ) - assert_matches_type(FormattingResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_formatting(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(FormattingResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_formatting(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(FormattingResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_formatting(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="string", - ) - - @parametrize - def test_method_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_actions_for_diagnostic_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_actions_for_diagnostic(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - def test_method_get_code_segment_info(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="string", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_method_get_code_segment_info_with_all_params(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="string", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_code_segment_info(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_code_segment_info(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_code_segment_info(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="string", - ) - - @parametrize - def test_method_get_signature_help(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_get_signature_help(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_get_signature_help(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get_signature_help(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_health(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_health(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_health(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_health(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - def test_method_references(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(ReferencesResponse, lsp, path=["response"]) - - @parametrize - def test_raw_response_references(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(ReferencesResponse, lsp, path=["response"]) - - @parametrize - def test_streaming_response_references(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(ReferencesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_references(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - def test_method_set_watch_directory(self, client: Runloop) -> None: - lsp = client.devboxes.lsp.set_watch_directory( - id="id", - path="string", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_raw_response_set_watch_directory(self, client: Runloop) -> None: - response = client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - def test_streaming_response_set_watch_directory(self, client: Runloop) -> None: - with client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_set_watch_directory(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="string", - ) - - -class TestAsyncLsp: - parametrize = pytest.mark.parametrize( - "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] - ) - - @parametrize - async def test_method_apply_code_action(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_method_apply_code_action_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.apply_code_action( - id="id", - title="title", - command={ - "command": "command", - "title": "title", - "arguments": [{}], - }, - edit={ - "changes": { - "foo": [ - { - "new_text": "newText", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - } - ] - } - }, - is_preferred=True, - kind="kind", - ) - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_raw_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="id", - title="title", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_apply_code_action(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.apply_code_action( - id="id", - title="title", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionApplicationResult, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_apply_code_action(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.apply_code_action( - id="", - title="title", - ) - - @parametrize - async def test_method_code_actions(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - ) - assert_matches_type(CodeActionsResponse, lsp, path=["response"]) - - @parametrize - async def test_method_code_actions_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.code_actions( - id="id", - uri="uri", - context={ - "diagnostics": [ - { - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "code_description": {"href": "string"}, - "data": {}, - "related_information": [ - { - "location": { - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "uri": "string", - }, - "message": "message", - } - ], - "severity": 1, - "source": "source", - "tags": [1], - } - ], - "only": ["string"], - "trigger_kind": 1, - }, - range={ - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - ) - assert_matches_type(CodeActionsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_code_actions(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.code_actions( - id="id", - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeActionsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_code_actions(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.code_actions( - id="id", - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeActionsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_code_actions(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.code_actions( - id="", - uri="uri", - ) - - @parametrize - async def test_method_diagnostics(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.diagnostics( - id="id", - uri="string", - ) - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_diagnostics(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="id", - uri="string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_diagnostics(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.diagnostics( - id="id", - uri="string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DiagnosticsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_diagnostics(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.diagnostics( - id="", - uri="string", - ) - - @parametrize - async def test_method_document_symbols(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.document_symbols( - id="id", - uri="string", - ) - assert_matches_type(DocumentSymbolResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_document_symbols(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="id", - uri="string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(DocumentSymbolResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_document_symbols(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.document_symbols( - id="id", - uri="string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(DocumentSymbolResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_document_symbols(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.document_symbols( - id="", - uri="string", - ) - - @parametrize - async def test_method_file(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file( - id="id", - path="string", - ) - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file( - id="id", - path="string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file( - id="id", - path="string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileContentsResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file( - id="", - path="string", - ) - - @parametrize - async def test_method_file_definition(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(FileDefinitionResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_file_definition(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FileDefinitionResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_file_definition(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.file_definition( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FileDefinitionResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_file_definition(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.file_definition( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_files(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.files( - "id", - ) - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_files(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.files( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_files(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.files( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspFilesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_files(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.files( - "", - ) - - @parametrize - async def test_method_formatting(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.formatting( - id="id", - uri="string", - ) - assert_matches_type(FormattingResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_formatting(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.formatting( - id="id", - uri="string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(FormattingResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_formatting(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.formatting( - id="id", - uri="string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(FormattingResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_formatting(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.formatting( - id="", - uri="string", - ) - - @parametrize - async def test_method_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_actions_for_diagnostic_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - "code": 0, - "severity": 1, - "source": "source", - }, - uri="uri", - ) - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_actions_for_diagnostic( - id="id", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(LspGetCodeActionsForDiagnosticResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_actions_for_diagnostic(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_actions_for_diagnostic( - id="", - diagnostic={ - "message": "message", - "range": { - "end": { - "character": 0, - "line": 0, - }, - "start": { - "character": 0, - "line": 0, - }, - }, - }, - uri="uri", - ) - - @parametrize - async def test_method_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="string", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_method_get_code_segment_info_with_all_params(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="string", - symbol_type="function", - ) - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_code_segment_info( - id="id", - symbol_name="symbolName", - uri="string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(CodeSegmentInfoResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_code_segment_info(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_code_segment_info( - id="", - symbol_name="symbolName", - uri="string", - ) - - @parametrize - async def test_method_get_signature_help(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_get_signature_help(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.get_signature_help( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(SignatureHelpResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get_signature_help(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.get_signature_help( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_health(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.health( - "id", - ) - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_health(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.health( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_health(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.health( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(HealthStatusResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_health(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.health( - "", - ) - - @parametrize - async def test_method_references(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.references( - id="id", - character=0, - line=0, - uri="uri", - ) - assert_matches_type(ReferencesResponse, lsp, path=["response"]) - - @parametrize - async def test_raw_response_references(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(ReferencesResponse, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_references(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.references( - id="id", - character=0, - line=0, - uri="uri", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(ReferencesResponse, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_references(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.references( - id="", - character=0, - line=0, - uri="uri", - ) - - @parametrize - async def test_method_set_watch_directory(self, async_client: AsyncRunloop) -> None: - lsp = await async_client.devboxes.lsp.set_watch_directory( - id="id", - path="string", - ) - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_raw_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="id", - path="string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - @parametrize - async def test_streaming_response_set_watch_directory(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.lsp.with_streaming_response.set_watch_directory( - id="id", - path="string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - lsp = await response.parse() - assert_matches_type(str, lsp, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_set_watch_directory(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.lsp.with_raw_response.set_watch_directory( - id="", - path="string", - ) diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 061bb366f..8fddd5bd4 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -32,6 +32,8 @@ AsyncDiskSnapshotsCursorIDPage, ) +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -416,6 +418,7 @@ def test_method_execute_with_all_params(self, client: Runloop) -> None: id="id", command="command", command_id="command_id", + optimistic_timeout=0, shell_name="shell_name", ) assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) @@ -510,27 +513,32 @@ def test_path_params_execute_async(self, client: Runloop) -> None: @parametrize def test_method_execute_sync(self, client: Runloop) -> None: - devbox = client.devboxes.execute_sync( - id="id", - command="command", - ) + with pytest.warns(DeprecationWarning): + devbox = client.devboxes.execute_sync( + id="id", + command="command", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize def test_method_execute_sync_with_all_params(self, client: Runloop) -> None: - devbox = client.devboxes.execute_sync( - id="id", - command="command", - shell_name="shell_name", - ) + with pytest.warns(DeprecationWarning): + devbox = client.devboxes.execute_sync( + id="id", + command="command", + shell_name="shell_name", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize def test_raw_response_execute_sync(self, client: Runloop) -> None: - response = client.devboxes.with_raw_response.execute_sync( - id="id", - command="command", - ) + with pytest.warns(DeprecationWarning): + response = client.devboxes.with_raw_response.execute_sync( + id="id", + command="command", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -539,25 +547,27 @@ def test_raw_response_execute_sync(self, client: Runloop) -> None: @parametrize def test_streaming_response_execute_sync(self, client: Runloop) -> None: - with client.devboxes.with_streaming_response.execute_sync( - id="id", - command="command", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.devboxes.with_streaming_response.execute_sync( + id="id", + command="command", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - devbox = response.parse() - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + devbox = response.parse() + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_execute_sync(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.with_raw_response.execute_sync( - id="", - command="command", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.execute_sync( + id="", + command="command", + ) @parametrize def test_method_keep_alive(self, client: Runloop) -> None: @@ -1469,6 +1479,7 @@ async def test_method_execute_with_all_params(self, async_client: AsyncRunloop) id="id", command="command", command_id="command_id", + optimistic_timeout=0, shell_name="shell_name", ) assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) @@ -1563,27 +1574,32 @@ async def test_path_params_execute_async(self, async_client: AsyncRunloop) -> No @parametrize async def test_method_execute_sync(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.execute_sync( - id="id", - command="command", - ) + with pytest.warns(DeprecationWarning): + devbox = await async_client.devboxes.execute_sync( + id="id", + command="command", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize async def test_method_execute_sync_with_all_params(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.execute_sync( - id="id", - command="command", - shell_name="shell_name", - ) + with pytest.warns(DeprecationWarning): + devbox = await async_client.devboxes.execute_sync( + id="id", + command="command", + shell_name="shell_name", + ) + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) @parametrize async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.with_raw_response.execute_sync( - id="id", - command="command", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.devboxes.with_raw_response.execute_sync( + id="id", + command="command", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1592,25 +1608,27 @@ async def test_raw_response_execute_sync(self, async_client: AsyncRunloop) -> No @parametrize async def test_streaming_response_execute_sync(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.with_streaming_response.execute_sync( - id="id", - command="command", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.devboxes.with_streaming_response.execute_sync( + id="id", + command="command", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - devbox = await response.parse() - assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) + devbox = await response.parse() + assert_matches_type(DevboxExecutionDetailView, devbox, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.with_raw_response.execute_sync( - id="", - command="command", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.execute_sync( + id="", + command="command", + ) @parametrize async def test_method_keep_alive(self, async_client: AsyncRunloop) -> None: From ea5472ac9d9242b89457dc88d0fdcac0e4c50c0e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 17:33:52 +0000 Subject: [PATCH 866/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 284ce936c..2b417b30d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.60.0" + ".": "0.60.1" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index abb26cdfe..fff76f3fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.60.0" +version = "0.60.1" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 23fb0da51..1867701a4 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.60.0" # x-release-please-version +__version__ = "0.60.1" # x-release-please-version From 081c372baef5c42a712db561d70d2531142183ae Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 17:44:12 +0000 Subject: [PATCH 867/993] feat(api): api update --- .stats.yml | 4 ++-- src/runloop_api_client/resources/blueprints.py | 16 ++++++++++++++++ .../resources/scenarios/scenarios.py | 8 ++++---- .../types/blueprint_build_parameters.py | 3 +++ .../types/blueprint_create_params.py | 3 +++ .../types/blueprint_preview_params.py | 3 +++ src/runloop_api_client/types/blueprint_view.py | 3 +++ src/runloop_api_client/types/devbox_view.py | 18 ++++++++++++------ .../types/scenario_create_params.py | 2 +- .../types/scenario_update_params.py | 2 +- src/runloop_api_client/types/scenario_view.py | 2 +- tests/api_resources/test_blueprints.py | 4 ++++ tests/api_resources/test_scenarios.py | 8 ++++---- 13 files changed, 57 insertions(+), 19 deletions(-) diff --git a/.stats.yml b/.stats.yml index e6e2b8c0d..b04b0d217 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 90 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1749c364b895f7e1551fbb4037d18c64f89948017f56eaf68b6cb0e978250944.yml -openapi_spec_hash: 0623287e228035fbeca1a66c3253b9b1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-9b2e136aedff0713e8d50d6c53a930cd2c3583dcac1a9fce552cf25bb0d29214.yml +openapi_spec_hash: 81e1da702f2dfb28bbe1bfab0d5d8cbd config_hash: 4c7b6a602579b69f9d533f0f0fef5ded diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index d92cbd36b..2e429ed10 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -59,6 +59,7 @@ def create( name: str, base_blueprint_id: Optional[str] | Omit = omit, base_blueprint_name: Optional[str] | Omit = omit, + build_args: Optional[Dict[str, str]] | Omit = omit, code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, @@ -92,6 +93,8 @@ def create( with the given name. Only one of (base_blueprint_id, base_blueprint_name) should be specified. + build_args: (Optional) Arbitrary Docker build args to pass during build. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -125,6 +128,7 @@ def create( "name": name, "base_blueprint_id": base_blueprint_id, "base_blueprint_name": base_blueprint_name, + "build_args": build_args, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, @@ -359,6 +363,7 @@ def preview( name: str, base_blueprint_id: Optional[str] | Omit = omit, base_blueprint_name: Optional[str] | Omit = omit, + build_args: Optional[Dict[str, str]] | Omit = omit, code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, @@ -390,6 +395,8 @@ def preview( with the given name. Only one of (base_blueprint_id, base_blueprint_name) should be specified. + build_args: (Optional) Arbitrary Docker build args to pass during build. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -423,6 +430,7 @@ def preview( "name": name, "base_blueprint_id": base_blueprint_id, "base_blueprint_name": base_blueprint_name, + "build_args": build_args, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, @@ -470,6 +478,7 @@ async def create( name: str, base_blueprint_id: Optional[str] | Omit = omit, base_blueprint_name: Optional[str] | Omit = omit, + build_args: Optional[Dict[str, str]] | Omit = omit, code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, @@ -503,6 +512,8 @@ async def create( with the given name. Only one of (base_blueprint_id, base_blueprint_name) should be specified. + build_args: (Optional) Arbitrary Docker build args to pass during build. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -536,6 +547,7 @@ async def create( "name": name, "base_blueprint_id": base_blueprint_id, "base_blueprint_name": base_blueprint_name, + "build_args": build_args, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, @@ -770,6 +782,7 @@ async def preview( name: str, base_blueprint_id: Optional[str] | Omit = omit, base_blueprint_name: Optional[str] | Omit = omit, + build_args: Optional[Dict[str, str]] | Omit = omit, code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, @@ -801,6 +814,8 @@ async def preview( with the given name. Only one of (base_blueprint_id, base_blueprint_name) should be specified. + build_args: (Optional) Arbitrary Docker build args to pass during build. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -834,6 +849,7 @@ async def preview( "name": name, "base_blueprint_id": base_blueprint_id, "base_blueprint_name": base_blueprint_name, + "build_args": build_args, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index d5ade7543..d56441030 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -93,7 +93,7 @@ def create( reference_output: Optional[str] | Omit = omit, required_environment_variables: Optional[SequenceNotStr[str]] | Omit = omit, required_secret_names: Optional[SequenceNotStr[str]] | Omit = omit, - validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] | Omit = omit, + validation_type: Optional[Literal["UNSPECIFIED", "FORWARD", "REVERSE", "EVALUATION"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -211,7 +211,7 @@ def update( required_environment_variables: Optional[SequenceNotStr[str]] | Omit = omit, required_secret_names: Optional[SequenceNotStr[str]] | Omit = omit, scoring_contract: Optional[ScoringContractUpdateParam] | Omit = omit, - validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] | Omit = omit, + validation_type: Optional[Literal["UNSPECIFIED", "FORWARD", "REVERSE", "EVALUATION"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -492,7 +492,7 @@ async def create( reference_output: Optional[str] | Omit = omit, required_environment_variables: Optional[SequenceNotStr[str]] | Omit = omit, required_secret_names: Optional[SequenceNotStr[str]] | Omit = omit, - validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] | Omit = omit, + validation_type: Optional[Literal["UNSPECIFIED", "FORWARD", "REVERSE", "EVALUATION"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -610,7 +610,7 @@ async def update( required_environment_variables: Optional[SequenceNotStr[str]] | Omit = omit, required_secret_names: Optional[SequenceNotStr[str]] | Omit = omit, scoring_contract: Optional[ScoringContractUpdateParam] | Omit = omit, - validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] | Omit = omit, + validation_type: Optional[Literal["UNSPECIFIED", "FORWARD", "REVERSE", "EVALUATION"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index a0a6b69d1..b2d042701 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -58,6 +58,9 @@ class BlueprintBuildParameters(BaseModel): be specified. """ + build_args: Optional[Dict[str, str]] = None + """(Optional) Arbitrary Docker build args to pass during build.""" + code_mounts: Optional[List[CodeMountParameters]] = None """A list of code mounts to be included in the Blueprint.""" diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index 214e3ef67..80d32de9a 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -30,6 +30,9 @@ class BlueprintCreateParams(TypedDict, total=False): be specified. """ + build_args: Optional[Dict[str, str]] + """(Optional) Arbitrary Docker build args to pass during build.""" + code_mounts: Optional[Iterable[CodeMountParameters]] """A list of code mounts to be included in the Blueprint.""" diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index 9efca9c68..a9d8d1918 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -30,6 +30,9 @@ class BlueprintPreviewParams(TypedDict, total=False): be specified. """ + build_args: Optional[Dict[str, str]] + """(Optional) Arbitrary Docker build args to pass during build.""" + code_mounts: Optional[Iterable[CodeMountParameters]] """A list of code mounts to be included in the Blueprint.""" diff --git a/src/runloop_api_client/types/blueprint_view.py b/src/runloop_api_client/types/blueprint_view.py index 2d0e32881..b63763e42 100644 --- a/src/runloop_api_client/types/blueprint_view.py +++ b/src/runloop_api_client/types/blueprint_view.py @@ -62,6 +62,9 @@ class BlueprintView(BaseModel): base_blueprint_id: Optional[str] = None """The ID of the base Blueprint.""" + build_finish_time_ms: Optional[int] = None + """Build completion time of the Blueprint (Unix timestamp milliseconds).""" + containerized_services: Optional[List[ContainerizedService]] = None """List of ContainerizedServices available in the Blueprint. diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index e00d846b6..68240f25d 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -43,6 +43,12 @@ class DevboxView(BaseModel): create_time_ms: int """Creation time of the Devbox (Unix timestamp milliseconds).""" + end_time_ms: Optional[int] = None + """The time the Devbox finished execution (Unix timestamp milliseconds). + + Present if the Devbox is in a terminal state. + """ + launch_parameters: LaunchParameters """The launch parameters used to create the Devbox.""" @@ -63,15 +69,15 @@ class DevboxView(BaseModel): a Blueprint. """ - end_time_ms: Optional[int] = None - """The time the Devbox finished execution (Unix timestamp milliseconds). - - Present if the Devbox is in a terminal state. - """ - failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "execution_failed"]] = None """The failure reason if the Devbox failed, if the Devbox has a 'failure' status.""" + initiator_id: Optional[str] = None + """The ID of the initiator that created the Devbox.""" + + initiator_type: Optional[Literal["unknown", "api", "scenario"]] = None + """The type of initiator that created the Devbox.""" + name: Optional[str] = None """The name of the Devbox.""" diff --git a/src/runloop_api_client/types/scenario_create_params.py b/src/runloop_api_client/types/scenario_create_params.py index b8f6910e0..464f9bad2 100644 --- a/src/runloop_api_client/types/scenario_create_params.py +++ b/src/runloop_api_client/types/scenario_create_params.py @@ -49,5 +49,5 @@ class ScenarioCreateParams(TypedDict, total=False): scenario will fail to start. """ - validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] + validation_type: Optional[Literal["UNSPECIFIED", "FORWARD", "REVERSE", "EVALUATION"]] """Validation strategy.""" diff --git a/src/runloop_api_client/types/scenario_update_params.py b/src/runloop_api_client/types/scenario_update_params.py index 4dcb6ee5c..908988961 100644 --- a/src/runloop_api_client/types/scenario_update_params.py +++ b/src/runloop_api_client/types/scenario_update_params.py @@ -42,5 +42,5 @@ class ScenarioUpdateParams(TypedDict, total=False): scoring_contract: Optional[ScoringContractUpdateParam] """The scoring contract for the Scenario.""" - validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] + validation_type: Optional[Literal["UNSPECIFIED", "FORWARD", "REVERSE", "EVALUATION"]] """Validation strategy.""" diff --git a/src/runloop_api_client/types/scenario_view.py b/src/runloop_api_client/types/scenario_view.py index 230bda36c..58c0dbb26 100644 --- a/src/runloop_api_client/types/scenario_view.py +++ b/src/runloop_api_client/types/scenario_view.py @@ -53,5 +53,5 @@ class ScenarioView(BaseModel): If any required secrets are missing, the scenario will fail to start. """ - validation_type: Optional[Literal["FORWARD", "REVERSE", "EVALUATION"]] = None + validation_type: Optional[Literal["UNSPECIFIED", "FORWARD", "REVERSE", "EVALUATION"]] = None """Validation strategy.""" diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 5f33036ce..0e6eb9eba 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -35,6 +35,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: name="name", base_blueprint_id="base_blueprint_id", base_blueprint_name="base_blueprint_name", + build_args={"foo": "string"}, code_mounts=[ { "repo_name": "repo_name", @@ -301,6 +302,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: name="name", base_blueprint_id="base_blueprint_id", base_blueprint_name="base_blueprint_name", + build_args={"foo": "string"}, code_mounts=[ { "repo_name": "repo_name", @@ -391,6 +393,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - name="name", base_blueprint_id="base_blueprint_id", base_blueprint_name="base_blueprint_name", + build_args={"foo": "string"}, code_mounts=[ { "repo_name": "repo_name", @@ -657,6 +660,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) name="name", base_blueprint_id="base_blueprint_id", base_blueprint_name="base_blueprint_name", + build_args={"foo": "string"}, code_mounts=[ { "repo_name": "repo_name", diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index 0896213f7..be50c0a77 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -92,7 +92,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: reference_output="reference_output", required_environment_variables=["string"], required_secret_names=["string"], - validation_type="FORWARD", + validation_type="UNSPECIFIED", ) assert_matches_type(ScenarioView, scenario, path=["response"]) @@ -244,7 +244,7 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: } ] }, - validation_type="FORWARD", + validation_type="UNSPECIFIED", ) assert_matches_type(ScenarioView, scenario, path=["response"]) @@ -490,7 +490,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - reference_output="reference_output", required_environment_variables=["string"], required_secret_names=["string"], - validation_type="FORWARD", + validation_type="UNSPECIFIED", ) assert_matches_type(ScenarioView, scenario, path=["response"]) @@ -642,7 +642,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - } ] }, - validation_type="FORWARD", + validation_type="UNSPECIFIED", ) assert_matches_type(ScenarioView, scenario, path=["response"]) From dbbbf07dd966a97a6f6a01531bc05380ccde9f82 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 20:52:35 +0000 Subject: [PATCH 868/993] feat(api): api update --- .devcontainer/Dockerfile | 3 +- .devcontainer/devcontainer.json | 4 +- .github/workflows/ci.yml | 39 +- .github/workflows/publish-pypi.yml | 11 +- .stats.yml | 2 +- Brewfile | 2 +- CONTRIBUTING.md | 22 +- bin/publish-pypi | 5 +- noxfile.py | 9 - pyproject.toml | 51 +- requirements-dev.lock | 186 +-- requirements.lock | 75 - scripts/bootstrap | 11 +- scripts/format | 10 +- scripts/lint | 12 +- scripts/test | 23 +- src/runloop_api_client/_client.py | 361 ++++- uv.lock | 2332 ++++++++++++++++++++++++++++ 18 files changed, 2804 insertions(+), 354 deletions(-) delete mode 100644 noxfile.py delete mode 100644 requirements.lock create mode 100644 uv.lock diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index ff261bad7..62c2d13f5 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -3,7 +3,6 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} USER vscode -RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.44.0" RYE_INSTALL_OPTION="--yes" bash -ENV PATH=/home/vscode/.rye/shims:$PATH +COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ RUN echo "[[ -d .venv ]] && source .venv/bin/activate || export PATH=\$PATH" >> /home/vscode/.bashrc diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c17fdc169..e01283d8c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,7 +7,7 @@ "context": ".." }, - "postStartCommand": "rye sync --all-features", + "postStartCommand": "uv sync --all-extras", "customizations": { "vscode": { @@ -20,7 +20,7 @@ "python.defaultInterpreterPath": ".venv/bin/python", "python.typeChecking": "basic", "terminal.integrated.env.linux": { - "PATH": "/home/vscode/.rye/shims:${env:PATH}" + "PATH": "${env:PATH}" } } } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4c594677..72f3d7525 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,16 +21,13 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Rye - run: | - curl -sSf https://rye.astral.sh/get | bash - echo "$HOME/.rye/shims" >> $GITHUB_PATH - env: - RYE_VERSION: '0.44.0' - RYE_INSTALL_OPTION: '--yes' + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + version: '0.8.11' - name: Install dependencies - run: rye sync --all-features + run: uv sync --all-extras - name: Run lints run: ./scripts/lint @@ -46,19 +43,16 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Rye - run: | - curl -sSf https://rye.astral.sh/get | bash - echo "$HOME/.rye/shims" >> $GITHUB_PATH - env: - RYE_VERSION: '0.44.0' - RYE_INSTALL_OPTION: '--yes' + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + version: '0.8.11' - name: Install dependencies - run: rye sync --all-features + run: uv sync --all-extras - name: Run build - run: rye build + run: uv build - name: Get GitHub OIDC Token if: github.repository == 'stainless-sdks/runloop-python' @@ -83,13 +77,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Rye - run: | - curl -sSf https://rye.astral.sh/get | bash - echo "$HOME/.rye/shims" >> $GITHUB_PATH - env: - RYE_VERSION: '0.44.0' - RYE_INSTALL_OPTION: '--yes' + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + version: '0.8.11' - name: Bootstrap run: ./scripts/bootstrap diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index fbcdea446..12ad177a5 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -16,13 +16,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Rye - run: | - curl -sSf https://rye.astral.sh/get | bash - echo "$HOME/.rye/shims" >> $GITHUB_PATH - env: - RYE_VERSION: '0.44.0' - RYE_INSTALL_OPTION: '--yes' + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + version: '0.8.11' - name: Publish to PyPI run: | diff --git a/.stats.yml b/.stats.yml index b04b0d217..be3e247e2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 90 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-9b2e136aedff0713e8d50d6c53a930cd2c3583dcac1a9fce552cf25bb0d29214.yml openapi_spec_hash: 81e1da702f2dfb28bbe1bfab0d5d8cbd -config_hash: 4c7b6a602579b69f9d533f0f0fef5ded +config_hash: 5b2602a56850cf0d0e50da298d1c6916 diff --git a/Brewfile b/Brewfile index 492ca37bb..c43041cef 100644 --- a/Brewfile +++ b/Brewfile @@ -1,2 +1,2 @@ -brew "rye" +brew "uv" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 67732aae5..c428d61d5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,32 +1,32 @@ ## Setting up the environment -### With Rye +### With `uv` -We use [Rye](https://rye.astral.sh/) to manage dependencies because it will automatically provision a Python environment with the expected Python version. To set it up, run: +We use [uv](https://docs.astral.sh/uv/) to manage dependencies because it will automatically provision a Python environment with the expected Python version. To set it up, run: ```sh $ ./scripts/bootstrap ``` -Or [install Rye manually](https://rye.astral.sh/guide/installation/) and run: +Or [install uv manually](https://docs.astral.sh/uv/getting-started/installation/) and run: ```sh -$ rye sync --all-features +$ uv sync --all-extras ``` -You can then run scripts using `rye run python script.py` or by activating the virtual environment: +You can then run scripts using `uv run python script.py` or by manually activating the virtual environment: ```sh -# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work +# manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work $ source .venv/bin/activate -# now you can omit the `rye run` prefix +# now you can omit the `uv run` prefix $ python script.py ``` -### Without Rye +### Without `uv` -Alternatively if you don't want to install `Rye`, you can stick with the standard `pip` setup by ensuring you have the Python version specified in `.python-version`, create a virtual environment however you desire and then install dependencies using this command: +Alternatively if you don't want to install `uv`, you can stick with the standard `pip` setup by ensuring you have the Python version specified in `.python-version`, create a virtual environment however you desire and then install dependencies using this command: ```sh $ pip install -r requirements-dev.lock @@ -45,7 +45,7 @@ All files in the `examples/` directory are not modified by the generator and can ```py # add an example to examples/.py -#!/usr/bin/env -S rye run python +#!/usr/bin/env -S uv run python … ``` @@ -72,7 +72,7 @@ Building this package will create two files in the `dist/` directory, a `.tar.gz To create a distributable version of the library, all you have to do is run this command: ```sh -$ rye build +$ uv build # or $ python -m build ``` diff --git a/bin/publish-pypi b/bin/publish-pypi index 826054e92..e72ca2fa4 100644 --- a/bin/publish-pypi +++ b/bin/publish-pypi @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -eux +rm -rf dist mkdir -p dist -rye build --clean -rye publish --yes --token=$PYPI_TOKEN +uv build +uv publish --token=$PYPI_TOKEN diff --git a/noxfile.py b/noxfile.py deleted file mode 100644 index 53bca7ff2..000000000 --- a/noxfile.py +++ /dev/null @@ -1,9 +0,0 @@ -import nox - - -@nox.session(reuse_venv=True, name="test-pydantic-v1") -def test_pydantic_v1(session: nox.Session) -> None: - session.install("-r", "requirements-dev.lock") - session.install("pydantic<2") - - session.run("pytest", "--showlocals", "--ignore=tests/functional", *session.posargs) diff --git a/pyproject.toml b/pyproject.toml index fff76f3fa..4754b5c31 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,10 +41,19 @@ Repository = "https://github.com/runloopai/api-client-python" [project.optional-dependencies] aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"] -[tool.rye] +[tool.uv] managed = true -# version pins are in requirements-dev.lock -dev-dependencies = [ +required-version = ">=0.5.0" +conflicts = [ + [ + { group = "pydantic-v1" }, + { group = "pydantic-v2" }, + ], +] + +[dependency-groups] +# version pins are in uv.lock +dev = [ "pyright==1.1.399", "mypy", "respx", @@ -52,41 +61,17 @@ dev-dependencies = [ "pytest-asyncio", "ruff", "time-machine", - "nox", "dirty-equals>=0.6.0", "importlib-metadata>=6.7.0", "rich>=13.7.1", "pytest-xdist>=3.6.1", ] - -[tool.rye.scripts] -format = { chain = [ - "format:ruff", - "format:docs", - "fix:ruff", - # run formatting again to fix any inconsistencies when imports are stripped - "format:ruff", -]} -"format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md" -"format:ruff" = "ruff format" - -"lint" = { chain = [ - "check:ruff", - "typecheck", - "check:importable", -]} -"check:ruff" = "ruff check ." -"fix:ruff" = "ruff check --fix ." - -"check:importable" = "python -c 'import runloop_api_client'" - -typecheck = { chain = [ - "typecheck:pyright", - "typecheck:mypy" -]} -"typecheck:pyright" = "pyright" -"typecheck:verify-types" = "pyright --verifytypes runloop_api_client --ignoreexternal" -"typecheck:mypy" = "mypy ." +pydantic-v1 = [ + "pydantic>=1.9.0,<2", +] +pydantic-v2 = [ + "pydantic>=2,<3", +] [build-system] requires = ["hatchling==1.26.3", "hatch-fancy-pypi-readme"] diff --git a/requirements-dev.lock b/requirements-dev.lock index 53b125c3c..16e3c6ed7 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -1,137 +1,117 @@ -# generated by rye -# use `rye lock` or `rye sync` to update this lockfile -# -# last locked with the following flags: -# pre: false -# features: [] -# all-features: true -# with-sources: false -# generate-hashes: false -# universal: false - --e file:. -aiohappyeyeballs==2.6.1 - # via aiohttp -aiohttp==3.12.8 - # via httpx-aiohttp - # via runloop-api-client -aiosignal==1.3.2 - # via aiohttp -annotated-types==0.6.0 +# This file was autogenerated by uv via the following command: +# uv export -o requirements-dev.lock --no-hashes +-e . +annotated-types==0.7.0 # via pydantic -anyio==4.4.0 - # via httpx - # via runloop-api-client -argcomplete==3.1.2 - # via nox -async-timeout==5.0.1 - # via aiohttp -attrs==25.3.0 - # via aiohttp -certifi==2023.7.22 - # via httpcore - # via httpx -colorlog==6.7.0 - # via nox -dirty-equals==0.6.0 -distlib==0.3.7 - # via virtualenv -distro==1.8.0 - # via runloop-api-client -exceptiongroup==1.2.2 - # via anyio +anyio==4.5.2 ; python_full_version < '3.9' + # via + # httpx + # runloop-api-client +anyio==4.8.0 ; python_full_version >= '3.9' + # via + # httpx + # runloop-api-client +certifi==2024.12.14 + # via + # httpcore + # httpx +colorama==0.4.6 ; sys_platform == 'win32' # via pytest +dirty-equals==0.9.0 +distro==1.9.0 + # via runloop-api-client +exceptiongroup==1.2.2 ; python_full_version < '3.11' + # via + # anyio + # pytest execnet==2.1.1 # via pytest-xdist -filelock==3.12.4 - # via virtualenv -frozenlist==1.6.2 - # via aiohttp - # via aiosignal h11==0.16.0 # via httpcore httpcore==1.0.9 # via httpx httpx==0.28.1 - # via httpx-aiohttp - # via respx - # via runloop-api-client -httpx-aiohttp==0.1.8 - # via runloop-api-client -idna==3.4 - # via anyio - # via httpx - # via yarl -importlib-metadata==7.0.0 + # via + # respx + # runloop-api-client +idna==3.10 + # via + # anyio + # httpx +importlib-metadata==8.5.0 ; python_full_version < '3.9' +importlib-metadata==8.6.1 ; python_full_version >= '3.9' iniconfig==2.0.0 # via pytest markdown-it-py==3.0.0 # via rich mdurl==0.1.2 # via markdown-it-py -multidict==6.4.4 - # via aiohttp - # via yarl mypy==1.14.1 mypy-extensions==1.0.0 # via mypy -nodeenv==1.8.0 +nodeenv==1.9.1 # via pyright -nox==2023.4.22 -packaging==23.2 - # via nox +packaging==24.2 # via pytest -platformdirs==3.11.0 - # via virtualenv pluggy==1.5.0 # via pytest -propcache==0.3.1 - # via aiohttp - # via yarl -pydantic==2.11.9 +pydantic==2.10.6 ; python_full_version < '3.9' + # via runloop-api-client +pydantic==2.11.9 ; python_full_version >= '3.9' # via runloop-api-client -pydantic-core==2.33.2 +pydantic-core==2.27.2 ; python_full_version < '3.9' # via pydantic -pygments==2.18.0 - # via rich +pydantic-core==2.33.2 ; python_full_version >= '3.9' + # via pydantic +pygments==2.19.1 + # via + # pytest + # rich pyright==1.1.399 -pytest==8.3.3 - # via pytest-asyncio - # via pytest-xdist +pytest==8.3.5 ; python_full_version < '3.9' + # via + # pytest-asyncio + # pytest-xdist +pytest==8.4.1 ; python_full_version >= '3.9' + # via + # pytest-asyncio + # pytest-xdist pytest-asyncio==0.24.0 -pytest-xdist==3.7.0 -python-dateutil==2.8.2 +pytest-xdist==3.6.1 ; python_full_version < '3.9' +pytest-xdist==3.7.0 ; python_full_version >= '3.9' +python-dateutil==2.9.0.post0 # via time-machine -pytz==2023.3.post1 +pytz==2024.2 ; python_full_version < '3.9' # via dirty-equals respx==0.22.0 -rich==13.7.1 +rich==13.9.4 ruff==0.9.4 -setuptools==68.2.2 - # via nodeenv -six==1.16.0 +six==1.17.0 # via python-dateutil -sniffio==1.3.0 - # via anyio - # via runloop-api-client -time-machine==2.9.0 -tomli==2.0.2 - # via mypy - # via pytest +sniffio==1.3.1 + # via + # anyio + # runloop-api-client +time-machine==2.15.0 ; python_full_version < '3.9' +time-machine==2.16.0 ; python_full_version >= '3.9' +tomli==2.2.1 ; python_full_version < '3.11' + # via + # mypy + # pytest typing-extensions==4.12.2 - # via anyio - # via multidict - # via mypy + # via + # annotated-types + # anyio + # mypy + # pydantic + # pydantic-core + # pyright + # rich + # runloop-api-client + # typing-inspection +typing-inspection==0.4.1 ; python_full_version >= '3.9' # via pydantic - # via pydantic-core - # via pyright - # via runloop-api-client - # via typing-inspection -typing-inspection==0.4.1 - # via pydantic -virtualenv==20.24.5 - # via nox -yarl==1.20.0 - # via aiohttp -zipp==3.17.0 +zipp==3.20.2 ; python_full_version < '3.9' + # via importlib-metadata +zipp==3.21.0 ; python_full_version >= '3.9' # via importlib-metadata diff --git a/requirements.lock b/requirements.lock deleted file mode 100644 index 281973f09..000000000 --- a/requirements.lock +++ /dev/null @@ -1,75 +0,0 @@ -# generated by rye -# use `rye lock` or `rye sync` to update this lockfile -# -# last locked with the following flags: -# pre: false -# features: [] -# all-features: true -# with-sources: false -# generate-hashes: false -# universal: false - --e file:. -aiohappyeyeballs==2.6.1 - # via aiohttp -aiohttp==3.12.8 - # via httpx-aiohttp - # via runloop-api-client -aiosignal==1.3.2 - # via aiohttp -annotated-types==0.6.0 - # via pydantic -anyio==4.4.0 - # via httpx - # via runloop-api-client -async-timeout==5.0.1 - # via aiohttp -attrs==25.3.0 - # via aiohttp -certifi==2023.7.22 - # via httpcore - # via httpx -distro==1.8.0 - # via runloop-api-client -exceptiongroup==1.2.2 - # via anyio -frozenlist==1.6.2 - # via aiohttp - # via aiosignal -h11==0.16.0 - # via httpcore -httpcore==1.0.9 - # via httpx -httpx==0.28.1 - # via httpx-aiohttp - # via runloop-api-client -httpx-aiohttp==0.1.8 - # via runloop-api-client -idna==3.4 - # via anyio - # via httpx - # via yarl -multidict==6.4.4 - # via aiohttp - # via yarl -propcache==0.3.1 - # via aiohttp - # via yarl -pydantic==2.11.9 - # via runloop-api-client -pydantic-core==2.33.2 - # via pydantic -sniffio==1.3.0 - # via anyio - # via runloop-api-client -typing-extensions==4.12.2 - # via anyio - # via multidict - # via pydantic - # via pydantic-core - # via runloop-api-client - # via typing-inspection -typing-inspection==0.4.1 - # via pydantic -yarl==1.20.0 - # via aiohttp diff --git a/scripts/bootstrap b/scripts/bootstrap index b430fee36..4638ec694 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -19,9 +19,12 @@ if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] } fi -echo "==> Installing Python dependencies…" +echo "==> Installing Python…" +uv python install -# experimental uv support makes installations significantly faster -rye config --set-bool behavior.use-uv=true +echo "==> Installing Python dependencies…" +uv sync --all-extras -rye sync --all-features +echo "==> Exporting Python dependencies…" +# note: `--no-hashes` is required because of https://github.com/pypa/pip/issues/4995 +uv export -o requirements-dev.lock --no-hashes diff --git a/scripts/format b/scripts/format index 667ec2d7a..1d2f9c6e6 100755 --- a/scripts/format +++ b/scripts/format @@ -4,5 +4,11 @@ set -e cd "$(dirname "$0")/.." -echo "==> Running formatters" -rye run format +echo "==> Running ruff" +uv run ruff format +uv run ruff check --fix . +# run formatting again to fix any inconsistencies when imports are stripped +uv run ruff format + +echo "==> Formatting docs" +uv run python scripts/utils/ruffen-docs.py README.md api.md diff --git a/scripts/lint b/scripts/lint index 6736f5cfd..54325086b 100755 --- a/scripts/lint +++ b/scripts/lint @@ -4,8 +4,14 @@ set -e cd "$(dirname "$0")/.." -echo "==> Running lints" -rye run lint +echo "==> Running ruff" +uv run ruff check . + +echo "==> Running pyright" +uv run pyright + +echo "==> Running mypy" +uv run mypy . echo "==> Making sure it imports" -rye run python -c 'import runloop_api_client' +uv run python -c 'import runloop_api_client' diff --git a/scripts/test b/scripts/test index dbeda2d21..aa1bdc949 100755 --- a/scripts/test +++ b/scripts/test @@ -54,8 +54,23 @@ fi export DEFER_PYDANTIC_BUILD=false -echo "==> Running tests" -rye run pytest "$@" +function run_tests() { + echo "==> Running tests with Pydantic v2" + uv run --isolated --all-extras pytest "$@" -echo "==> Running Pydantic v1 tests" -rye run nox -s test-pydantic-v1 -- "$@" + echo "==> Running tests with Pydantic v1" + uv run --isolated --all-extras --group=pydantic-v1 pytest "$@" +} + +# If UV_PYTHON is already set in the environment, just run the command once +if [[ -n "$UV_PYTHON" ]]; then + run_tests "$@" +else + # If UV_PYTHON is not set, run the command for min and max versions + + echo "==> Running tests for Python 3.8" + UV_PYTHON=3.8 run_tests "$@" + + echo "==> Running tests for Python 3.13" + UV_PYTHON=3.13 run_tests "$@" +fi diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index 5ffec7733..bdfccf7e5 100644 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, Mapping +from typing import TYPE_CHECKING, Any, Mapping from typing_extensions import Self, override import httpx @@ -20,8 +20,8 @@ not_given, ) from ._utils import is_given, get_async_library +from ._compat import cached_property from ._version import __version__ -from .resources import objects, secrets, blueprints, repositories from ._streaming import Stream as Stream, AsyncStream as AsyncStream from ._exceptions import RunloopError, APIStatusError from ._base_client import ( @@ -29,24 +29,21 @@ SyncAPIClient, AsyncAPIClient, ) -from .resources.devboxes import devboxes -from .resources.scenarios import scenarios -from .resources.benchmarks import benchmarks + +if TYPE_CHECKING: + from .resources import objects, secrets, devboxes, scenarios, benchmarks, blueprints, repositories + from .resources.objects import ObjectsResource, AsyncObjectsResource + from .resources.secrets import SecretsResource, AsyncSecretsResource + from .resources.blueprints import BlueprintsResource, AsyncBlueprintsResource + from .resources.repositories import RepositoriesResource, AsyncRepositoriesResource + from .resources.devboxes.devboxes import DevboxesResource, AsyncDevboxesResource + from .resources.scenarios.scenarios import ScenariosResource, AsyncScenariosResource + from .resources.benchmarks.benchmarks import BenchmarksResource, AsyncBenchmarksResource __all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Runloop", "AsyncRunloop", "Client", "AsyncClient"] class Runloop(SyncAPIClient): - benchmarks: benchmarks.BenchmarksResource - blueprints: blueprints.BlueprintsResource - devboxes: devboxes.DevboxesResource - scenarios: scenarios.ScenariosResource - objects: objects.ObjectsResource - repositories: repositories.RepositoriesResource - secrets: secrets.SecretsResource - with_raw_response: RunloopWithRawResponse - with_streaming_response: RunloopWithStreamedResponse - # client options bearer_token: str @@ -103,15 +100,55 @@ def __init__( self._idempotency_header = "x-request-id" - self.benchmarks = benchmarks.BenchmarksResource(self) - self.blueprints = blueprints.BlueprintsResource(self) - self.devboxes = devboxes.DevboxesResource(self) - self.scenarios = scenarios.ScenariosResource(self) - self.objects = objects.ObjectsResource(self) - self.repositories = repositories.RepositoriesResource(self) - self.secrets = secrets.SecretsResource(self) - self.with_raw_response = RunloopWithRawResponse(self) - self.with_streaming_response = RunloopWithStreamedResponse(self) + @cached_property + def benchmarks(self) -> BenchmarksResource: + from .resources.benchmarks import BenchmarksResource + + return BenchmarksResource(self) + + @cached_property + def blueprints(self) -> BlueprintsResource: + from .resources.blueprints import BlueprintsResource + + return BlueprintsResource(self) + + @cached_property + def devboxes(self) -> DevboxesResource: + from .resources.devboxes import DevboxesResource + + return DevboxesResource(self) + + @cached_property + def scenarios(self) -> ScenariosResource: + from .resources.scenarios import ScenariosResource + + return ScenariosResource(self) + + @cached_property + def objects(self) -> ObjectsResource: + from .resources.objects import ObjectsResource + + return ObjectsResource(self) + + @cached_property + def repositories(self) -> RepositoriesResource: + from .resources.repositories import RepositoriesResource + + return RepositoriesResource(self) + + @cached_property + def secrets(self) -> SecretsResource: + from .resources.secrets import SecretsResource + + return SecretsResource(self) + + @cached_property + def with_raw_response(self) -> RunloopWithRawResponse: + return RunloopWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> RunloopWithStreamedResponse: + return RunloopWithStreamedResponse(self) @property @override @@ -219,16 +256,6 @@ def _make_status_error( class AsyncRunloop(AsyncAPIClient): - benchmarks: benchmarks.AsyncBenchmarksResource - blueprints: blueprints.AsyncBlueprintsResource - devboxes: devboxes.AsyncDevboxesResource - scenarios: scenarios.AsyncScenariosResource - objects: objects.AsyncObjectsResource - repositories: repositories.AsyncRepositoriesResource - secrets: secrets.AsyncSecretsResource - with_raw_response: AsyncRunloopWithRawResponse - with_streaming_response: AsyncRunloopWithStreamedResponse - # client options bearer_token: str @@ -285,15 +312,55 @@ def __init__( self._idempotency_header = "x-request-id" - self.benchmarks = benchmarks.AsyncBenchmarksResource(self) - self.blueprints = blueprints.AsyncBlueprintsResource(self) - self.devboxes = devboxes.AsyncDevboxesResource(self) - self.scenarios = scenarios.AsyncScenariosResource(self) - self.objects = objects.AsyncObjectsResource(self) - self.repositories = repositories.AsyncRepositoriesResource(self) - self.secrets = secrets.AsyncSecretsResource(self) - self.with_raw_response = AsyncRunloopWithRawResponse(self) - self.with_streaming_response = AsyncRunloopWithStreamedResponse(self) + @cached_property + def benchmarks(self) -> AsyncBenchmarksResource: + from .resources.benchmarks import AsyncBenchmarksResource + + return AsyncBenchmarksResource(self) + + @cached_property + def blueprints(self) -> AsyncBlueprintsResource: + from .resources.blueprints import AsyncBlueprintsResource + + return AsyncBlueprintsResource(self) + + @cached_property + def devboxes(self) -> AsyncDevboxesResource: + from .resources.devboxes import AsyncDevboxesResource + + return AsyncDevboxesResource(self) + + @cached_property + def scenarios(self) -> AsyncScenariosResource: + from .resources.scenarios import AsyncScenariosResource + + return AsyncScenariosResource(self) + + @cached_property + def objects(self) -> AsyncObjectsResource: + from .resources.objects import AsyncObjectsResource + + return AsyncObjectsResource(self) + + @cached_property + def repositories(self) -> AsyncRepositoriesResource: + from .resources.repositories import AsyncRepositoriesResource + + return AsyncRepositoriesResource(self) + + @cached_property + def secrets(self) -> AsyncSecretsResource: + from .resources.secrets import AsyncSecretsResource + + return AsyncSecretsResource(self) + + @cached_property + def with_raw_response(self) -> AsyncRunloopWithRawResponse: + return AsyncRunloopWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRunloopWithStreamedResponse: + return AsyncRunloopWithStreamedResponse(self) @property @override @@ -401,47 +468,199 @@ def _make_status_error( class RunloopWithRawResponse: + _client: Runloop + def __init__(self, client: Runloop) -> None: - self.benchmarks = benchmarks.BenchmarksResourceWithRawResponse(client.benchmarks) - self.blueprints = blueprints.BlueprintsResourceWithRawResponse(client.blueprints) - self.devboxes = devboxes.DevboxesResourceWithRawResponse(client.devboxes) - self.scenarios = scenarios.ScenariosResourceWithRawResponse(client.scenarios) - self.objects = objects.ObjectsResourceWithRawResponse(client.objects) - self.repositories = repositories.RepositoriesResourceWithRawResponse(client.repositories) - self.secrets = secrets.SecretsResourceWithRawResponse(client.secrets) + self._client = client + + @cached_property + def benchmarks(self) -> benchmarks.BenchmarksResourceWithRawResponse: + from .resources.benchmarks import BenchmarksResourceWithRawResponse + + return BenchmarksResourceWithRawResponse(self._client.benchmarks) + + @cached_property + def blueprints(self) -> blueprints.BlueprintsResourceWithRawResponse: + from .resources.blueprints import BlueprintsResourceWithRawResponse + + return BlueprintsResourceWithRawResponse(self._client.blueprints) + + @cached_property + def devboxes(self) -> devboxes.DevboxesResourceWithRawResponse: + from .resources.devboxes import DevboxesResourceWithRawResponse + + return DevboxesResourceWithRawResponse(self._client.devboxes) + + @cached_property + def scenarios(self) -> scenarios.ScenariosResourceWithRawResponse: + from .resources.scenarios import ScenariosResourceWithRawResponse + + return ScenariosResourceWithRawResponse(self._client.scenarios) + + @cached_property + def objects(self) -> objects.ObjectsResourceWithRawResponse: + from .resources.objects import ObjectsResourceWithRawResponse + + return ObjectsResourceWithRawResponse(self._client.objects) + + @cached_property + def repositories(self) -> repositories.RepositoriesResourceWithRawResponse: + from .resources.repositories import RepositoriesResourceWithRawResponse + + return RepositoriesResourceWithRawResponse(self._client.repositories) + + @cached_property + def secrets(self) -> secrets.SecretsResourceWithRawResponse: + from .resources.secrets import SecretsResourceWithRawResponse + + return SecretsResourceWithRawResponse(self._client.secrets) class AsyncRunloopWithRawResponse: + _client: AsyncRunloop + def __init__(self, client: AsyncRunloop) -> None: - self.benchmarks = benchmarks.AsyncBenchmarksResourceWithRawResponse(client.benchmarks) - self.blueprints = blueprints.AsyncBlueprintsResourceWithRawResponse(client.blueprints) - self.devboxes = devboxes.AsyncDevboxesResourceWithRawResponse(client.devboxes) - self.scenarios = scenarios.AsyncScenariosResourceWithRawResponse(client.scenarios) - self.objects = objects.AsyncObjectsResourceWithRawResponse(client.objects) - self.repositories = repositories.AsyncRepositoriesResourceWithRawResponse(client.repositories) - self.secrets = secrets.AsyncSecretsResourceWithRawResponse(client.secrets) + self._client = client + + @cached_property + def benchmarks(self) -> benchmarks.AsyncBenchmarksResourceWithRawResponse: + from .resources.benchmarks import AsyncBenchmarksResourceWithRawResponse + + return AsyncBenchmarksResourceWithRawResponse(self._client.benchmarks) + + @cached_property + def blueprints(self) -> blueprints.AsyncBlueprintsResourceWithRawResponse: + from .resources.blueprints import AsyncBlueprintsResourceWithRawResponse + + return AsyncBlueprintsResourceWithRawResponse(self._client.blueprints) + + @cached_property + def devboxes(self) -> devboxes.AsyncDevboxesResourceWithRawResponse: + from .resources.devboxes import AsyncDevboxesResourceWithRawResponse + + return AsyncDevboxesResourceWithRawResponse(self._client.devboxes) + + @cached_property + def scenarios(self) -> scenarios.AsyncScenariosResourceWithRawResponse: + from .resources.scenarios import AsyncScenariosResourceWithRawResponse + + return AsyncScenariosResourceWithRawResponse(self._client.scenarios) + + @cached_property + def objects(self) -> objects.AsyncObjectsResourceWithRawResponse: + from .resources.objects import AsyncObjectsResourceWithRawResponse + + return AsyncObjectsResourceWithRawResponse(self._client.objects) + + @cached_property + def repositories(self) -> repositories.AsyncRepositoriesResourceWithRawResponse: + from .resources.repositories import AsyncRepositoriesResourceWithRawResponse + + return AsyncRepositoriesResourceWithRawResponse(self._client.repositories) + + @cached_property + def secrets(self) -> secrets.AsyncSecretsResourceWithRawResponse: + from .resources.secrets import AsyncSecretsResourceWithRawResponse + + return AsyncSecretsResourceWithRawResponse(self._client.secrets) class RunloopWithStreamedResponse: + _client: Runloop + def __init__(self, client: Runloop) -> None: - self.benchmarks = benchmarks.BenchmarksResourceWithStreamingResponse(client.benchmarks) - self.blueprints = blueprints.BlueprintsResourceWithStreamingResponse(client.blueprints) - self.devboxes = devboxes.DevboxesResourceWithStreamingResponse(client.devboxes) - self.scenarios = scenarios.ScenariosResourceWithStreamingResponse(client.scenarios) - self.objects = objects.ObjectsResourceWithStreamingResponse(client.objects) - self.repositories = repositories.RepositoriesResourceWithStreamingResponse(client.repositories) - self.secrets = secrets.SecretsResourceWithStreamingResponse(client.secrets) + self._client = client + + @cached_property + def benchmarks(self) -> benchmarks.BenchmarksResourceWithStreamingResponse: + from .resources.benchmarks import BenchmarksResourceWithStreamingResponse + + return BenchmarksResourceWithStreamingResponse(self._client.benchmarks) + + @cached_property + def blueprints(self) -> blueprints.BlueprintsResourceWithStreamingResponse: + from .resources.blueprints import BlueprintsResourceWithStreamingResponse + + return BlueprintsResourceWithStreamingResponse(self._client.blueprints) + + @cached_property + def devboxes(self) -> devboxes.DevboxesResourceWithStreamingResponse: + from .resources.devboxes import DevboxesResourceWithStreamingResponse + + return DevboxesResourceWithStreamingResponse(self._client.devboxes) + + @cached_property + def scenarios(self) -> scenarios.ScenariosResourceWithStreamingResponse: + from .resources.scenarios import ScenariosResourceWithStreamingResponse + + return ScenariosResourceWithStreamingResponse(self._client.scenarios) + + @cached_property + def objects(self) -> objects.ObjectsResourceWithStreamingResponse: + from .resources.objects import ObjectsResourceWithStreamingResponse + + return ObjectsResourceWithStreamingResponse(self._client.objects) + + @cached_property + def repositories(self) -> repositories.RepositoriesResourceWithStreamingResponse: + from .resources.repositories import RepositoriesResourceWithStreamingResponse + + return RepositoriesResourceWithStreamingResponse(self._client.repositories) + + @cached_property + def secrets(self) -> secrets.SecretsResourceWithStreamingResponse: + from .resources.secrets import SecretsResourceWithStreamingResponse + + return SecretsResourceWithStreamingResponse(self._client.secrets) class AsyncRunloopWithStreamedResponse: + _client: AsyncRunloop + def __init__(self, client: AsyncRunloop) -> None: - self.benchmarks = benchmarks.AsyncBenchmarksResourceWithStreamingResponse(client.benchmarks) - self.blueprints = blueprints.AsyncBlueprintsResourceWithStreamingResponse(client.blueprints) - self.devboxes = devboxes.AsyncDevboxesResourceWithStreamingResponse(client.devboxes) - self.scenarios = scenarios.AsyncScenariosResourceWithStreamingResponse(client.scenarios) - self.objects = objects.AsyncObjectsResourceWithStreamingResponse(client.objects) - self.repositories = repositories.AsyncRepositoriesResourceWithStreamingResponse(client.repositories) - self.secrets = secrets.AsyncSecretsResourceWithStreamingResponse(client.secrets) + self._client = client + + @cached_property + def benchmarks(self) -> benchmarks.AsyncBenchmarksResourceWithStreamingResponse: + from .resources.benchmarks import AsyncBenchmarksResourceWithStreamingResponse + + return AsyncBenchmarksResourceWithStreamingResponse(self._client.benchmarks) + + @cached_property + def blueprints(self) -> blueprints.AsyncBlueprintsResourceWithStreamingResponse: + from .resources.blueprints import AsyncBlueprintsResourceWithStreamingResponse + + return AsyncBlueprintsResourceWithStreamingResponse(self._client.blueprints) + + @cached_property + def devboxes(self) -> devboxes.AsyncDevboxesResourceWithStreamingResponse: + from .resources.devboxes import AsyncDevboxesResourceWithStreamingResponse + + return AsyncDevboxesResourceWithStreamingResponse(self._client.devboxes) + + @cached_property + def scenarios(self) -> scenarios.AsyncScenariosResourceWithStreamingResponse: + from .resources.scenarios import AsyncScenariosResourceWithStreamingResponse + + return AsyncScenariosResourceWithStreamingResponse(self._client.scenarios) + + @cached_property + def objects(self) -> objects.AsyncObjectsResourceWithStreamingResponse: + from .resources.objects import AsyncObjectsResourceWithStreamingResponse + + return AsyncObjectsResourceWithStreamingResponse(self._client.objects) + + @cached_property + def repositories(self) -> repositories.AsyncRepositoriesResourceWithStreamingResponse: + from .resources.repositories import AsyncRepositoriesResourceWithStreamingResponse + + return AsyncRepositoriesResourceWithStreamingResponse(self._client.repositories) + + @cached_property + def secrets(self) -> secrets.AsyncSecretsResourceWithStreamingResponse: + from .resources.secrets import AsyncSecretsResourceWithStreamingResponse + + return AsyncSecretsResourceWithStreamingResponse(self._client.secrets) Client = Runloop diff --git a/uv.lock b/uv.lock new file mode 100644 index 000000000..a0d75fc8b --- /dev/null +++ b/uv.lock @@ -0,0 +1,2332 @@ +version = 1 +revision = 3 +requires-python = ">=3.8" +resolution-markers = [ + "python_full_version >= '3.9'", + "python_full_version < '3.9'", +] +conflicts = [[ + { package = "runloop-api-client", group = "pydantic-v1" }, + { package = "runloop-api-client", group = "pydantic-v2" }, +]] + +[[package]] +name = "aiohappyeyeballs" +version = "2.4.4" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.9'", +] +sdist = { url = "https://files.pythonhosted.org/packages/7f/55/e4373e888fdacb15563ef6fa9fa8c8252476ea071e96fb46defac9f18bf2/aiohappyeyeballs-2.4.4.tar.gz", hash = "sha256:5fdd7d87889c63183afc18ce9271f9b0a7d32c2303e394468dd45d514a757745", size = 21977, upload-time = "2024-11-30T18:44:00.701Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b9/74/fbb6559de3607b3300b9be3cc64e97548d55678e44623db17820dbd20002/aiohappyeyeballs-2.4.4-py3-none-any.whl", hash = "sha256:a980909d50efcd44795c4afeca523296716d50cd756ddca6af8c65b996e27de8", size = 14756, upload-time = "2024-11-30T18:43:39.849Z" }, +] + +[[package]] +name = "aiohappyeyeballs" +version = "2.6.1" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.9'", +] +sdist = { url = "https://files.pythonhosted.org/packages/26/30/f84a107a9c4331c14b2b586036f40965c128aa4fee4dda5d3d51cb14ad54/aiohappyeyeballs-2.6.1.tar.gz", hash = "sha256:c3f9d0113123803ccadfdf3f0faa505bc78e6a72d1cc4806cbd719826e943558", size = 22760, upload-time = "2025-03-12T01:42:48.764Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0f/15/5bf3b99495fb160b63f95972b81750f18f7f4e02ad051373b669d17d44f2/aiohappyeyeballs-2.6.1-py3-none-any.whl", hash = "sha256:f349ba8f4b75cb25c99c5c2d84e997e485204d2902a9597802b0371f09331fb8", size = 15265, upload-time = "2025-03-12T01:42:47.083Z" }, +] + +[[package]] +name = "aiohttp" +version = "3.10.11" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.9'", +] +dependencies = [ + { name = "aiohappyeyeballs", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "aiosignal", version = "1.3.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "async-timeout", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "attrs", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "frozenlist", version = "1.5.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "multidict", version = "6.1.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "yarl", version = "1.15.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/25/a8/8e2ba36c6e3278d62e0c88aa42bb92ddbef092ac363b390dab4421da5cf5/aiohttp-3.10.11.tar.gz", hash = "sha256:9dc2b8f3dcab2e39e0fa309c8da50c3b55e6f34ab25f1a71d3288f24924d33a7", size = 7551886, upload-time = "2024-11-13T16:40:33.335Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/11/c7/575f9e82d7ef13cb1b45b9db8a5b8fadb35107fb12e33809356ae0155223/aiohttp-3.10.11-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:5077b1a5f40ffa3ba1f40d537d3bec4383988ee51fbba6b74aa8fb1bc466599e", size = 588218, upload-time = "2024-11-13T16:36:38.461Z" }, + { url = "https://files.pythonhosted.org/packages/12/7b/a800dadbd9a47b7f921bfddcd531371371f39b9cd05786c3638bfe2e1175/aiohttp-3.10.11-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:8d6a14a4d93b5b3c2891fca94fa9d41b2322a68194422bef0dd5ec1e57d7d298", size = 400815, upload-time = "2024-11-13T16:36:40.547Z" }, + { url = "https://files.pythonhosted.org/packages/cb/28/7dbd53ab10b0ded397feed914880f39ce075bd39393b8dfc322909754a0a/aiohttp-3.10.11-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ffbfde2443696345e23a3c597049b1dd43049bb65337837574205e7368472177", size = 392099, upload-time = "2024-11-13T16:36:43.918Z" }, + { url = "https://files.pythonhosted.org/packages/6a/2e/c6390f49e67911711c2229740e261c501685fe7201f7f918d6ff2fd1cfb0/aiohttp-3.10.11-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:20b3d9e416774d41813bc02fdc0663379c01817b0874b932b81c7f777f67b217", size = 1224854, upload-time = "2024-11-13T16:36:46.473Z" }, + { url = "https://files.pythonhosted.org/packages/69/68/c96afae129201bff4edbece52b3e1abf3a8af57529a42700669458b00b9f/aiohttp-3.10.11-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2b943011b45ee6bf74b22245c6faab736363678e910504dd7531a58c76c9015a", size = 1259641, upload-time = "2024-11-13T16:36:48.28Z" }, + { url = "https://files.pythonhosted.org/packages/63/89/bedd01456442747946114a8c2f30ff1b23d3b2ea0c03709f854c4f354a5a/aiohttp-3.10.11-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:48bc1d924490f0d0b3658fe5c4b081a4d56ebb58af80a6729d4bd13ea569797a", size = 1295412, upload-time = "2024-11-13T16:36:50.286Z" }, + { url = "https://files.pythonhosted.org/packages/9b/4d/942198e2939efe7bfa484781590f082135e9931b8bcafb4bba62cf2d8f2f/aiohttp-3.10.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e12eb3f4b1f72aaaf6acd27d045753b18101524f72ae071ae1c91c1cd44ef115", size = 1218311, upload-time = "2024-11-13T16:36:53.721Z" }, + { url = "https://files.pythonhosted.org/packages/a3/5b/8127022912f1fa72dfc39cf37c36f83e0b56afc3b93594b1cf377b6e4ffc/aiohttp-3.10.11-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f14ebc419a568c2eff3c1ed35f634435c24ead2fe19c07426af41e7adb68713a", size = 1189448, upload-time = "2024-11-13T16:36:55.844Z" }, + { url = "https://files.pythonhosted.org/packages/af/12/752878033c8feab3362c0890a4d24e9895921729a53491f6f6fad64d3287/aiohttp-3.10.11-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:72b191cdf35a518bfc7ca87d770d30941decc5aaf897ec8b484eb5cc8c7706f3", size = 1186484, upload-time = "2024-11-13T16:36:58.472Z" }, + { url = "https://files.pythonhosted.org/packages/61/24/1d91c304fca47d5e5002ca23abab9b2196ac79d5c531258e048195b435b2/aiohttp-3.10.11-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:5ab2328a61fdc86424ee540d0aeb8b73bbcad7351fb7cf7a6546fc0bcffa0038", size = 1183864, upload-time = "2024-11-13T16:37:00.737Z" }, + { url = "https://files.pythonhosted.org/packages/c1/70/022d28b898314dac4cb5dd52ead2a372563c8590b1eaab9c5ed017eefb1e/aiohttp-3.10.11-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:aa93063d4af05c49276cf14e419550a3f45258b6b9d1f16403e777f1addf4519", size = 1241460, upload-time = "2024-11-13T16:37:03.175Z" }, + { url = "https://files.pythonhosted.org/packages/c3/15/2b43853330f82acf180602de0f68be62a2838d25d03d2ed40fecbe82479e/aiohttp-3.10.11-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:30283f9d0ce420363c24c5c2421e71a738a2155f10adbb1a11a4d4d6d2715cfc", size = 1258521, upload-time = "2024-11-13T16:37:06.013Z" }, + { url = "https://files.pythonhosted.org/packages/28/38/9ef2076cb06dcc155e7f02275f5da403a3e7c9327b6b075e999f0eb73613/aiohttp-3.10.11-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e5358addc8044ee49143c546d2182c15b4ac3a60be01c3209374ace05af5733d", size = 1207329, upload-time = "2024-11-13T16:37:08.091Z" }, + { url = "https://files.pythonhosted.org/packages/c2/5f/c5329d67a2c83d8ae17a84e11dec14da5773520913bfc191caaf4cd57e50/aiohttp-3.10.11-cp310-cp310-win32.whl", hash = "sha256:e1ffa713d3ea7cdcd4aea9cddccab41edf6882fa9552940344c44e59652e1120", size = 363835, upload-time = "2024-11-13T16:37:10.017Z" }, + { url = "https://files.pythonhosted.org/packages/0f/c6/ca5d70eea2fdbe283dbc1e7d30649a1a5371b2a2a9150db192446f645789/aiohttp-3.10.11-cp310-cp310-win_amd64.whl", hash = "sha256:778cbd01f18ff78b5dd23c77eb82987ee4ba23408cbed233009fd570dda7e674", size = 382169, upload-time = "2024-11-13T16:37:12.603Z" }, + { url = "https://files.pythonhosted.org/packages/73/96/221ec59bc38395a6c205cbe8bf72c114ce92694b58abc8c3c6b7250efa7f/aiohttp-3.10.11-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:80ff08556c7f59a7972b1e8919f62e9c069c33566a6d28586771711e0eea4f07", size = 587742, upload-time = "2024-11-13T16:37:14.469Z" }, + { url = "https://files.pythonhosted.org/packages/24/17/4e606c969b19de5c31a09b946bd4c37e30c5288ca91d4790aa915518846e/aiohttp-3.10.11-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2c8f96e9ee19f04c4914e4e7a42a60861066d3e1abf05c726f38d9d0a466e695", size = 400357, upload-time = "2024-11-13T16:37:16.482Z" }, + { url = "https://files.pythonhosted.org/packages/a2/e5/433f59b87ba69736e446824710dd7f26fcd05b24c6647cb1e76554ea5d02/aiohttp-3.10.11-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:fb8601394d537da9221947b5d6e62b064c9a43e88a1ecd7414d21a1a6fba9c24", size = 392099, upload-time = "2024-11-13T16:37:20.013Z" }, + { url = "https://files.pythonhosted.org/packages/d2/a3/3be340f5063970bb9e47f065ee8151edab639d9c2dce0d9605a325ab035d/aiohttp-3.10.11-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2ea224cf7bc2d8856d6971cea73b1d50c9c51d36971faf1abc169a0d5f85a382", size = 1300367, upload-time = "2024-11-13T16:37:22.645Z" }, + { url = "https://files.pythonhosted.org/packages/ba/7d/a3043918466cbee9429792ebe795f92f70eeb40aee4ccbca14c38ee8fa4d/aiohttp-3.10.11-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:db9503f79e12d5d80b3efd4d01312853565c05367493379df76d2674af881caa", size = 1339448, upload-time = "2024-11-13T16:37:24.834Z" }, + { url = "https://files.pythonhosted.org/packages/2c/60/192b378bd9d1ae67716b71ae63c3e97c48b134aad7675915a10853a0b7de/aiohttp-3.10.11-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0f449a50cc33f0384f633894d8d3cd020e3ccef81879c6e6245c3c375c448625", size = 1374875, upload-time = "2024-11-13T16:37:26.799Z" }, + { url = "https://files.pythonhosted.org/packages/e0/d7/cd58bd17f5277d9cc32ecdbb0481ca02c52fc066412de413aa01268dc9b4/aiohttp-3.10.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:82052be3e6d9e0c123499127782a01a2b224b8af8c62ab46b3f6197035ad94e9", size = 1285626, upload-time = "2024-11-13T16:37:29.02Z" }, + { url = "https://files.pythonhosted.org/packages/bb/b2/da4953643b7dcdcd29cc99f98209f3653bf02023d95ce8a8fd57ffba0f15/aiohttp-3.10.11-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:20063c7acf1eec550c8eb098deb5ed9e1bb0521613b03bb93644b810986027ac", size = 1246120, upload-time = "2024-11-13T16:37:31.268Z" }, + { url = "https://files.pythonhosted.org/packages/6c/22/1217b3c773055f0cb172e3b7108274a74c0fe9900c716362727303931cbb/aiohttp-3.10.11-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:489cced07a4c11488f47aab1f00d0c572506883f877af100a38f1fedaa884c3a", size = 1265177, upload-time = "2024-11-13T16:37:33.348Z" }, + { url = "https://files.pythonhosted.org/packages/63/5e/3827ad7e61544ed1e73e4fdea7bb87ea35ac59a362d7eb301feb5e859780/aiohttp-3.10.11-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:ea9b3bab329aeaa603ed3bf605f1e2a6f36496ad7e0e1aa42025f368ee2dc07b", size = 1257238, upload-time = "2024-11-13T16:37:35.753Z" }, + { url = "https://files.pythonhosted.org/packages/53/31/951f78751d403da6086b662760e6e8b08201b0dcf5357969f48261b4d0e1/aiohttp-3.10.11-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:ca117819d8ad113413016cb29774b3f6d99ad23c220069789fc050267b786c16", size = 1315944, upload-time = "2024-11-13T16:37:38.317Z" }, + { url = "https://files.pythonhosted.org/packages/0d/79/06ef7a2a69880649261818b135b245de5a4e89fed5a6987c8645428563fc/aiohttp-3.10.11-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:2dfb612dcbe70fb7cdcf3499e8d483079b89749c857a8f6e80263b021745c730", size = 1332065, upload-time = "2024-11-13T16:37:40.725Z" }, + { url = "https://files.pythonhosted.org/packages/10/39/a273857c2d0bbf2152a4201fbf776931c2dac74aa399c6683ed4c286d1d1/aiohttp-3.10.11-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f9b615d3da0d60e7d53c62e22b4fd1c70f4ae5993a44687b011ea3a2e49051b8", size = 1291882, upload-time = "2024-11-13T16:37:43.209Z" }, + { url = "https://files.pythonhosted.org/packages/49/39/7aa387f88403febc96e0494101763afaa14d342109329a01b413b2bac075/aiohttp-3.10.11-cp311-cp311-win32.whl", hash = "sha256:29103f9099b6068bbdf44d6a3d090e0a0b2be6d3c9f16a070dd9d0d910ec08f9", size = 363409, upload-time = "2024-11-13T16:37:45.143Z" }, + { url = "https://files.pythonhosted.org/packages/6f/e9/8eb3dc095ce48499d867ad461d02f1491686b79ad92e4fad4df582f6be7b/aiohttp-3.10.11-cp311-cp311-win_amd64.whl", hash = "sha256:236b28ceb79532da85d59aa9b9bf873b364e27a0acb2ceaba475dc61cffb6f3f", size = 382644, upload-time = "2024-11-13T16:37:47.685Z" }, + { url = "https://files.pythonhosted.org/packages/01/16/077057ef3bd684dbf9a8273a5299e182a8d07b4b252503712ff8b5364fd1/aiohttp-3.10.11-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:7480519f70e32bfb101d71fb9a1f330fbd291655a4c1c922232a48c458c52710", size = 584830, upload-time = "2024-11-13T16:37:49.608Z" }, + { url = "https://files.pythonhosted.org/packages/2c/cf/348b93deb9597c61a51b6682e81f7c7d79290249e886022ef0705d858d90/aiohttp-3.10.11-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:f65267266c9aeb2287a6622ee2bb39490292552f9fbf851baabc04c9f84e048d", size = 397090, upload-time = "2024-11-13T16:37:51.539Z" }, + { url = "https://files.pythonhosted.org/packages/70/bf/903df5cd739dfaf5b827b3d8c9d68ff4fcea16a0ca1aeb948c9da30f56c8/aiohttp-3.10.11-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7400a93d629a0608dc1d6c55f1e3d6e07f7375745aaa8bd7f085571e4d1cee97", size = 392361, upload-time = "2024-11-13T16:37:53.586Z" }, + { url = "https://files.pythonhosted.org/packages/fb/97/e4792675448a2ac5bd56f377a095233b805dd1315235c940c8ba5624e3cb/aiohttp-3.10.11-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f34b97e4b11b8d4eb2c3a4f975be626cc8af99ff479da7de49ac2c6d02d35725", size = 1309839, upload-time = "2024-11-13T16:37:55.68Z" }, + { url = "https://files.pythonhosted.org/packages/96/d0/ba19b1260da6fbbda4d5b1550d8a53ba3518868f2c143d672aedfdbc6172/aiohttp-3.10.11-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1e7b825da878464a252ccff2958838f9caa82f32a8dbc334eb9b34a026e2c636", size = 1348116, upload-time = "2024-11-13T16:37:58.232Z" }, + { url = "https://files.pythonhosted.org/packages/b3/b9/15100ee7113a2638bfdc91aecc54641609a92a7ce4fe533ebeaa8d43ff93/aiohttp-3.10.11-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f9f92a344c50b9667827da308473005f34767b6a2a60d9acff56ae94f895f385", size = 1391402, upload-time = "2024-11-13T16:38:00.522Z" }, + { url = "https://files.pythonhosted.org/packages/c5/36/831522618ac0dcd0b28f327afd18df7fb6bbf3eaf302f912a40e87714846/aiohttp-3.10.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc6f1ab987a27b83c5268a17218463c2ec08dbb754195113867a27b166cd6087", size = 1304239, upload-time = "2024-11-13T16:38:04.195Z" }, + { url = "https://files.pythonhosted.org/packages/60/9f/b7230d0c48b076500ae57adb717aa0656432acd3d8febb1183dedfaa4e75/aiohttp-3.10.11-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1dc0f4ca54842173d03322793ebcf2c8cc2d34ae91cc762478e295d8e361e03f", size = 1256565, upload-time = "2024-11-13T16:38:07.218Z" }, + { url = "https://files.pythonhosted.org/packages/63/c2/35c7b4699f4830b3b0a5c3d5619df16dca8052ae8b488e66065902d559f6/aiohttp-3.10.11-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:7ce6a51469bfaacff146e59e7fb61c9c23006495d11cc24c514a455032bcfa03", size = 1269285, upload-time = "2024-11-13T16:38:09.396Z" }, + { url = "https://files.pythonhosted.org/packages/51/48/bc20ea753909bdeb09f9065260aefa7453e3a57f6a51f56f5216adc1a5e7/aiohttp-3.10.11-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:aad3cd91d484d065ede16f3cf15408254e2469e3f613b241a1db552c5eb7ab7d", size = 1276716, upload-time = "2024-11-13T16:38:12.039Z" }, + { url = "https://files.pythonhosted.org/packages/0c/7b/a8708616b3810f55ead66f8e189afa9474795760473aea734bbea536cd64/aiohttp-3.10.11-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:f4df4b8ca97f658c880fb4b90b1d1ec528315d4030af1ec763247ebfd33d8b9a", size = 1315023, upload-time = "2024-11-13T16:38:15.155Z" }, + { url = "https://files.pythonhosted.org/packages/2a/d6/dfe9134a921e05b01661a127a37b7d157db93428905450e32f9898eef27d/aiohttp-3.10.11-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:2e4e18a0a2d03531edbc06c366954e40a3f8d2a88d2b936bbe78a0c75a3aab3e", size = 1342735, upload-time = "2024-11-13T16:38:17.539Z" }, + { url = "https://files.pythonhosted.org/packages/ca/1a/3bd7f18e3909eabd57e5d17ecdbf5ea4c5828d91341e3676a07de7c76312/aiohttp-3.10.11-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:6ce66780fa1a20e45bc753cda2a149daa6dbf1561fc1289fa0c308391c7bc0a4", size = 1302618, upload-time = "2024-11-13T16:38:19.865Z" }, + { url = "https://files.pythonhosted.org/packages/cf/51/d063133781cda48cfdd1e11fc8ef45ab3912b446feba41556385b3ae5087/aiohttp-3.10.11-cp312-cp312-win32.whl", hash = "sha256:a919c8957695ea4c0e7a3e8d16494e3477b86f33067478f43106921c2fef15bb", size = 360497, upload-time = "2024-11-13T16:38:21.996Z" }, + { url = "https://files.pythonhosted.org/packages/55/4e/f29def9ed39826fe8f85955f2e42fe5cc0cbe3ebb53c97087f225368702e/aiohttp-3.10.11-cp312-cp312-win_amd64.whl", hash = "sha256:b5e29706e6389a2283a91611c91bf24f218962717c8f3b4e528ef529d112ee27", size = 380577, upload-time = "2024-11-13T16:38:24.247Z" }, + { url = "https://files.pythonhosted.org/packages/1f/63/654c185dfe3cf5d4a0d35b6ee49ee6ca91922c694eaa90732e1ba4b40ef1/aiohttp-3.10.11-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:703938e22434d7d14ec22f9f310559331f455018389222eed132808cd8f44127", size = 577381, upload-time = "2024-11-13T16:38:26.708Z" }, + { url = "https://files.pythonhosted.org/packages/4e/c4/ee9c350acb202ba2eb0c44b0f84376b05477e870444192a9f70e06844c28/aiohttp-3.10.11-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:9bc50b63648840854e00084c2b43035a62e033cb9b06d8c22b409d56eb098413", size = 393289, upload-time = "2024-11-13T16:38:29.207Z" }, + { url = "https://files.pythonhosted.org/packages/3d/7c/30d161a7e3b208cef1b922eacf2bbb8578b7e5a62266a6a2245a1dd044dc/aiohttp-3.10.11-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5f0463bf8b0754bc744e1feb61590706823795041e63edf30118a6f0bf577461", size = 388859, upload-time = "2024-11-13T16:38:31.567Z" }, + { url = "https://files.pythonhosted.org/packages/79/10/8d050e04be447d3d39e5a4a910fa289d930120cebe1b893096bd3ee29063/aiohttp-3.10.11-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f6c6dec398ac5a87cb3a407b068e1106b20ef001c344e34154616183fe684288", size = 1280983, upload-time = "2024-11-13T16:38:33.738Z" }, + { url = "https://files.pythonhosted.org/packages/31/b3/977eca40afe643dcfa6b8d8bb9a93f4cba1d8ed1ead22c92056b08855c7a/aiohttp-3.10.11-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bcaf2d79104d53d4dcf934f7ce76d3d155302d07dae24dff6c9fffd217568067", size = 1317132, upload-time = "2024-11-13T16:38:35.999Z" }, + { url = "https://files.pythonhosted.org/packages/1a/43/b5ee8e697ed0f96a2b3d80b3058fa7590cda508e9cd256274246ba1cf37a/aiohttp-3.10.11-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:25fd5470922091b5a9aeeb7e75be609e16b4fba81cdeaf12981393fb240dd10e", size = 1362630, upload-time = "2024-11-13T16:38:39.016Z" }, + { url = "https://files.pythonhosted.org/packages/28/20/3ae8e993b2990fa722987222dea74d6bac9331e2f530d086f309b4aa8847/aiohttp-3.10.11-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bbde2ca67230923a42161b1f408c3992ae6e0be782dca0c44cb3206bf330dee1", size = 1276865, upload-time = "2024-11-13T16:38:41.423Z" }, + { url = "https://files.pythonhosted.org/packages/02/08/1afb0ab7dcff63333b683e998e751aa2547d1ff897b577d2244b00e6fe38/aiohttp-3.10.11-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:249c8ff8d26a8b41a0f12f9df804e7c685ca35a207e2410adbd3e924217b9006", size = 1230448, upload-time = "2024-11-13T16:38:43.962Z" }, + { url = "https://files.pythonhosted.org/packages/c6/fd/ccd0ff842c62128d164ec09e3dd810208a84d79cd402358a3038ae91f3e9/aiohttp-3.10.11-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:878ca6a931ee8c486a8f7b432b65431d095c522cbeb34892bee5be97b3481d0f", size = 1244626, upload-time = "2024-11-13T16:38:47.089Z" }, + { url = "https://files.pythonhosted.org/packages/9f/75/30e9537ab41ed7cb062338d8df7c4afb0a715b3551cd69fc4ea61cfa5a95/aiohttp-3.10.11-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:8663f7777ce775f0413324be0d96d9730959b2ca73d9b7e2c2c90539139cbdd6", size = 1243608, upload-time = "2024-11-13T16:38:49.47Z" }, + { url = "https://files.pythonhosted.org/packages/c2/e0/3e7a62d99b9080793affddc12a82b11c9bc1312916ad849700d2bddf9786/aiohttp-3.10.11-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:6cd3f10b01f0c31481fba8d302b61603a2acb37b9d30e1d14e0f5a58b7b18a31", size = 1286158, upload-time = "2024-11-13T16:38:51.947Z" }, + { url = "https://files.pythonhosted.org/packages/71/b8/df67886802e71e976996ed9324eb7dc379e53a7d972314e9c7fe3f6ac6bc/aiohttp-3.10.11-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:4e8d8aad9402d3aa02fdc5ca2fe68bcb9fdfe1f77b40b10410a94c7f408b664d", size = 1313636, upload-time = "2024-11-13T16:38:54.424Z" }, + { url = "https://files.pythonhosted.org/packages/3c/3b/aea9c3e70ff4e030f46902df28b4cdf486695f4d78fd9c6698827e2bafab/aiohttp-3.10.11-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:38e3c4f80196b4f6c3a85d134a534a56f52da9cb8d8e7af1b79a32eefee73a00", size = 1273772, upload-time = "2024-11-13T16:38:56.846Z" }, + { url = "https://files.pythonhosted.org/packages/e9/9e/4b4c5705270d1c4ee146516ad288af720798d957ba46504aaf99b86e85d9/aiohttp-3.10.11-cp313-cp313-win32.whl", hash = "sha256:fc31820cfc3b2863c6e95e14fcf815dc7afe52480b4dc03393c4873bb5599f71", size = 358679, upload-time = "2024-11-13T16:38:59.787Z" }, + { url = "https://files.pythonhosted.org/packages/28/1d/18ef37549901db94717d4389eb7be807acbfbdeab48a73ff2993fc909118/aiohttp-3.10.11-cp313-cp313-win_amd64.whl", hash = "sha256:4996ff1345704ffdd6d75fb06ed175938c133425af616142e7187f28dc75f14e", size = 378073, upload-time = "2024-11-13T16:39:02.065Z" }, + { url = "https://files.pythonhosted.org/packages/dd/f2/59165bee7bba0b0634525834c622f152a30715a1d8280f6291a0cb86b1e6/aiohttp-3.10.11-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:74baf1a7d948b3d640badeac333af581a367ab916b37e44cf90a0334157cdfd2", size = 592135, upload-time = "2024-11-13T16:39:04.774Z" }, + { url = "https://files.pythonhosted.org/packages/2e/0e/b3555c504745af66efbf89d16811148ff12932b86fad529d115538fe2739/aiohttp-3.10.11-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:473aebc3b871646e1940c05268d451f2543a1d209f47035b594b9d4e91ce8339", size = 402913, upload-time = "2024-11-13T16:39:08.065Z" }, + { url = "https://files.pythonhosted.org/packages/31/bb/2890a3c77126758ef58536ca9f7476a12ba2021e0cd074108fb99b8c8747/aiohttp-3.10.11-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:c2f746a6968c54ab2186574e15c3f14f3e7f67aef12b761e043b33b89c5b5f95", size = 394013, upload-time = "2024-11-13T16:39:10.638Z" }, + { url = "https://files.pythonhosted.org/packages/74/82/0ab5199b473558846d72901a714b6afeb6f6a6a6a4c3c629e2c107418afd/aiohttp-3.10.11-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d110cabad8360ffa0dec8f6ec60e43286e9d251e77db4763a87dcfe55b4adb92", size = 1255578, upload-time = "2024-11-13T16:39:13.14Z" }, + { url = "https://files.pythonhosted.org/packages/f8/b2/f232477dd3c0e95693a903c4815bfb8d831f6a1a67e27ad14d30a774eeda/aiohttp-3.10.11-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e0099c7d5d7afff4202a0c670e5b723f7718810000b4abcbc96b064129e64bc7", size = 1298780, upload-time = "2024-11-13T16:39:15.721Z" }, + { url = "https://files.pythonhosted.org/packages/34/8c/11972235a6b53d5b69098f2ee6629ff8f99cd9592dcaa620c7868deb5673/aiohttp-3.10.11-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0316e624b754dbbf8c872b62fe6dcb395ef20c70e59890dfa0de9eafccd2849d", size = 1336093, upload-time = "2024-11-13T16:39:19.11Z" }, + { url = "https://files.pythonhosted.org/packages/03/be/7ad9a6cd2312221cf7b6837d8e2d8e4660fbd4f9f15bccf79ef857f41f4d/aiohttp-3.10.11-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5a5f7ab8baf13314e6b2485965cbacb94afff1e93466ac4d06a47a81c50f9cca", size = 1250296, upload-time = "2024-11-13T16:39:22.363Z" }, + { url = "https://files.pythonhosted.org/packages/bb/8d/a3885a582d9fc481bccb155d082f83a7a846942e36e4a4bba061e3d6b95e/aiohttp-3.10.11-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c891011e76041e6508cbfc469dd1a8ea09bc24e87e4c204e05f150c4c455a5fa", size = 1215020, upload-time = "2024-11-13T16:39:25.205Z" }, + { url = "https://files.pythonhosted.org/packages/bb/e7/09a1736b7264316dc3738492d9b559f2a54b985660f21d76095c9890a62e/aiohttp-3.10.11-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:9208299251370ee815473270c52cd3f7069ee9ed348d941d574d1457d2c73e8b", size = 1210591, upload-time = "2024-11-13T16:39:28.311Z" }, + { url = "https://files.pythonhosted.org/packages/58/b1/ee684631f6af98065d49ac8416db7a8e74ea33e1378bc75952ab0522342f/aiohttp-3.10.11-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:459f0f32c8356e8125f45eeff0ecf2b1cb6db1551304972702f34cd9e6c44658", size = 1211255, upload-time = "2024-11-13T16:39:30.799Z" }, + { url = "https://files.pythonhosted.org/packages/8f/55/e21e312fd6c581f244dd2ed077ccb784aade07c19416a6316b1453f02c4e/aiohttp-3.10.11-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:14cdc8c1810bbd4b4b9f142eeee23cda528ae4e57ea0923551a9af4820980e39", size = 1278114, upload-time = "2024-11-13T16:39:34.141Z" }, + { url = "https://files.pythonhosted.org/packages/d8/7f/ff6df0e90df6759693f52720ebedbfa10982d97aa1fd02c6ca917a6399ea/aiohttp-3.10.11-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:971aa438a29701d4b34e4943e91b5e984c3ae6ccbf80dd9efaffb01bd0b243a9", size = 1292714, upload-time = "2024-11-13T16:39:37.216Z" }, + { url = "https://files.pythonhosted.org/packages/3a/45/63f35367dfffae41e7abd0603f92708b5b3655fda55c08388ac2c7fb127b/aiohttp-3.10.11-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:9a309c5de392dfe0f32ee57fa43ed8fc6ddf9985425e84bd51ed66bb16bce3a7", size = 1233734, upload-time = "2024-11-13T16:39:40.599Z" }, + { url = "https://files.pythonhosted.org/packages/ec/ee/74b0696c0e84e06c43beab9302f353d97dc9f0cccd7ccf3ee648411b849b/aiohttp-3.10.11-cp38-cp38-win32.whl", hash = "sha256:9ec1628180241d906a0840b38f162a3215114b14541f1a8711c368a8739a9be4", size = 365350, upload-time = "2024-11-13T16:39:43.852Z" }, + { url = "https://files.pythonhosted.org/packages/21/0c/74c895688db09a2852056abf32d128991ec2fb41e5f57a1fe0928e15151c/aiohttp-3.10.11-cp38-cp38-win_amd64.whl", hash = "sha256:9c6e0ffd52c929f985c7258f83185d17c76d4275ad22e90aa29f38e211aacbec", size = 384542, upload-time = "2024-11-13T16:39:47.093Z" }, + { url = "https://files.pythonhosted.org/packages/cc/df/aa0d1548db818395a372b5f90e62072677ce786d6b19680c49dd4da3825f/aiohttp-3.10.11-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:cdc493a2e5d8dc79b2df5bec9558425bcd39aff59fc949810cbd0832e294b106", size = 589833, upload-time = "2024-11-13T16:39:49.72Z" }, + { url = "https://files.pythonhosted.org/packages/75/7c/d11145784b3fa29c0421a3883a4b91ee8c19acb40332b1d2e39f47be4e5b/aiohttp-3.10.11-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b3e70f24e7d0405be2348da9d5a7836936bf3a9b4fd210f8c37e8d48bc32eca6", size = 401685, upload-time = "2024-11-13T16:39:52.263Z" }, + { url = "https://files.pythonhosted.org/packages/e2/67/1b5f93babeb060cb683d23104b243be1d6299fe6cd807dcb56cf67d2e62c/aiohttp-3.10.11-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:968b8fb2a5eee2770eda9c7b5581587ef9b96fbdf8dcabc6b446d35ccc69df01", size = 392957, upload-time = "2024-11-13T16:39:54.668Z" }, + { url = "https://files.pythonhosted.org/packages/e1/4d/441df53aafd8dd97b8cfe9e467c641fa19cb5113e7601a7f77f2124518e0/aiohttp-3.10.11-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:deef4362af9493d1382ef86732ee2e4cbc0d7c005947bd54ad1a9a16dd59298e", size = 1229754, upload-time = "2024-11-13T16:39:57.166Z" }, + { url = "https://files.pythonhosted.org/packages/4d/cc/f1397a2501b95cb94580de7051395e85af95a1e27aed1f8af73459ddfa22/aiohttp-3.10.11-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:686b03196976e327412a1b094f4120778c7c4b9cff9bce8d2fdfeca386b89829", size = 1266246, upload-time = "2024-11-13T16:40:00.723Z" }, + { url = "https://files.pythonhosted.org/packages/c2/b5/7d33dae7630b4e9f90d634c6a90cb0923797e011b71cd9b10fe685aec3f6/aiohttp-3.10.11-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3bf6d027d9d1d34e1c2e1645f18a6498c98d634f8e373395221121f1c258ace8", size = 1301720, upload-time = "2024-11-13T16:40:04.111Z" }, + { url = "https://files.pythonhosted.org/packages/51/36/f917bcc63bc489aa3f534fa81efbf895fa5286745dcd8bbd0eb9dbc923a1/aiohttp-3.10.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:099fd126bf960f96d34a760e747a629c27fb3634da5d05c7ef4d35ef4ea519fc", size = 1221527, upload-time = "2024-11-13T16:40:06.851Z" }, + { url = "https://files.pythonhosted.org/packages/32/c2/1a303a072b4763d99d4b0664a3a8b952869e3fbb660d4239826bd0c56cc1/aiohttp-3.10.11-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c73c4d3dae0b4644bc21e3de546530531d6cdc88659cdeb6579cd627d3c206aa", size = 1192309, upload-time = "2024-11-13T16:40:09.65Z" }, + { url = "https://files.pythonhosted.org/packages/62/ef/d62f705dc665382b78ef171e5ba2616c395220ac7c1f452f0d2dcad3f9f5/aiohttp-3.10.11-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:0c5580f3c51eea91559db3facd45d72e7ec970b04528b4709b1f9c2555bd6d0b", size = 1189481, upload-time = "2024-11-13T16:40:12.77Z" }, + { url = "https://files.pythonhosted.org/packages/40/22/3e3eb4f97e5c4f52ccd198512b583c0c9135aa4e989c7ade97023c4cd282/aiohttp-3.10.11-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:fdf6429f0caabfd8a30c4e2eaecb547b3c340e4730ebfe25139779b9815ba138", size = 1187877, upload-time = "2024-11-13T16:40:15.985Z" }, + { url = "https://files.pythonhosted.org/packages/b5/73/77475777fbe2b3efaceb49db2859f1a22c96fd5869d736e80375db05bbf4/aiohttp-3.10.11-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:d97187de3c276263db3564bb9d9fad9e15b51ea10a371ffa5947a5ba93ad6777", size = 1246006, upload-time = "2024-11-13T16:40:19.17Z" }, + { url = "https://files.pythonhosted.org/packages/ef/f7/5b060d19065473da91838b63d8fd4d20ef8426a7d905cc8f9cd11eabd780/aiohttp-3.10.11-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:0acafb350cfb2eba70eb5d271f55e08bd4502ec35e964e18ad3e7d34d71f7261", size = 1260403, upload-time = "2024-11-13T16:40:21.761Z" }, + { url = "https://files.pythonhosted.org/packages/6c/ea/e9ad224815cd83c8dfda686d2bafa2cab5b93d7232e09470a8d2a158acde/aiohttp-3.10.11-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:c13ed0c779911c7998a58e7848954bd4d63df3e3575f591e321b19a2aec8df9f", size = 1208643, upload-time = "2024-11-13T16:40:24.803Z" }, + { url = "https://files.pythonhosted.org/packages/ba/c1/e1c6bba72f379adbd52958601a8642546ed0807964afba3b1b5b8cfb1bc0/aiohttp-3.10.11-cp39-cp39-win32.whl", hash = "sha256:22b7c540c55909140f63ab4f54ec2c20d2635c0289cdd8006da46f3327f971b9", size = 364419, upload-time = "2024-11-13T16:40:27.817Z" }, + { url = "https://files.pythonhosted.org/packages/30/24/50862e06e86cd263c60661e00b9d2c8d7fdece4fe95454ed5aa21ecf8036/aiohttp-3.10.11-cp39-cp39-win_amd64.whl", hash = "sha256:7b26b1551e481012575dab8e3727b16fe7dd27eb2711d2e63ced7368756268fb", size = 382857, upload-time = "2024-11-13T16:40:30.427Z" }, +] + +[[package]] +name = "aiohttp" +version = "3.12.13" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.9'", +] +dependencies = [ + { name = "aiohappyeyeballs", version = "2.6.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "aiosignal", version = "1.4.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "async-timeout", marker = "(python_full_version >= '3.9' and python_full_version < '3.11') or (python_full_version < '3.9' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2') or (python_full_version >= '3.11' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "attrs", marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "frozenlist", version = "1.7.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "multidict", version = "6.6.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "propcache", version = "0.3.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "yarl", version = "1.20.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/42/6e/ab88e7cb2a4058bed2f7870276454f85a7c56cd6da79349eb314fc7bbcaa/aiohttp-3.12.13.tar.gz", hash = "sha256:47e2da578528264a12e4e3dd8dd72a7289e5f812758fe086473fab037a10fcce", size = 7819160, upload-time = "2025-06-14T15:15:41.354Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8b/2d/27e4347660723738b01daa3f5769d56170f232bf4695dd4613340da135bb/aiohttp-3.12.13-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:5421af8f22a98f640261ee48aae3a37f0c41371e99412d55eaf2f8a46d5dad29", size = 702090, upload-time = "2025-06-14T15:12:58.938Z" }, + { url = "https://files.pythonhosted.org/packages/10/0b/4a8e0468ee8f2b9aff3c05f2c3a6be1dfc40b03f68a91b31041d798a9510/aiohttp-3.12.13-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0fcda86f6cb318ba36ed8f1396a6a4a3fd8f856f84d426584392083d10da4de0", size = 478440, upload-time = "2025-06-14T15:13:02.981Z" }, + { url = "https://files.pythonhosted.org/packages/b9/c8/2086df2f9a842b13feb92d071edf756be89250f404f10966b7bc28317f17/aiohttp-3.12.13-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:4cd71c9fb92aceb5a23c4c39d8ecc80389c178eba9feab77f19274843eb9412d", size = 466215, upload-time = "2025-06-14T15:13:04.817Z" }, + { url = "https://files.pythonhosted.org/packages/a7/3d/d23e5bd978bc8012a65853959b13bd3b55c6e5afc172d89c26ad6624c52b/aiohttp-3.12.13-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:34ebf1aca12845066c963016655dac897651e1544f22a34c9b461ac3b4b1d3aa", size = 1648271, upload-time = "2025-06-14T15:13:06.532Z" }, + { url = "https://files.pythonhosted.org/packages/31/31/e00122447bb137591c202786062f26dd383574c9f5157144127077d5733e/aiohttp-3.12.13-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:893a4639694c5b7edd4bdd8141be296042b6806e27cc1d794e585c43010cc294", size = 1622329, upload-time = "2025-06-14T15:13:08.394Z" }, + { url = "https://files.pythonhosted.org/packages/04/01/caef70be3ac38986969045f21f5fb802ce517b3f371f0615206bf8aa6423/aiohttp-3.12.13-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:663d8ee3ffb3494502ebcccb49078faddbb84c1d870f9c1dd5a29e85d1f747ce", size = 1694734, upload-time = "2025-06-14T15:13:09.979Z" }, + { url = "https://files.pythonhosted.org/packages/3f/15/328b71fedecf69a9fd2306549b11c8966e420648a3938d75d3ed5bcb47f6/aiohttp-3.12.13-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f0f8f6a85a0006ae2709aa4ce05749ba2cdcb4b43d6c21a16c8517c16593aabe", size = 1737049, upload-time = "2025-06-14T15:13:11.672Z" }, + { url = "https://files.pythonhosted.org/packages/e6/7a/d85866a642158e1147c7da5f93ad66b07e5452a84ec4258e5f06b9071e92/aiohttp-3.12.13-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1582745eb63df267c92d8b61ca655a0ce62105ef62542c00a74590f306be8cb5", size = 1641715, upload-time = "2025-06-14T15:13:13.548Z" }, + { url = "https://files.pythonhosted.org/packages/14/57/3588800d5d2f5f3e1cb6e7a72747d1abc1e67ba5048e8b845183259c2e9b/aiohttp-3.12.13-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d59227776ee2aa64226f7e086638baa645f4b044f2947dbf85c76ab11dcba073", size = 1581836, upload-time = "2025-06-14T15:13:15.086Z" }, + { url = "https://files.pythonhosted.org/packages/2f/55/c913332899a916d85781aa74572f60fd98127449b156ad9c19e23135b0e4/aiohttp-3.12.13-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:06b07c418bde1c8e737d8fa67741072bd3f5b0fb66cf8c0655172188c17e5fa6", size = 1625685, upload-time = "2025-06-14T15:13:17.163Z" }, + { url = "https://files.pythonhosted.org/packages/4c/34/26cded195f3bff128d6a6d58d7a0be2ae7d001ea029e0fe9008dcdc6a009/aiohttp-3.12.13-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:9445c1842680efac0f81d272fd8db7163acfcc2b1436e3f420f4c9a9c5a50795", size = 1636471, upload-time = "2025-06-14T15:13:19.086Z" }, + { url = "https://files.pythonhosted.org/packages/19/21/70629ca006820fccbcec07f3cd5966cbd966e2d853d6da55339af85555b9/aiohttp-3.12.13-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:09c4767af0b0b98c724f5d47f2bf33395c8986995b0a9dab0575ca81a554a8c0", size = 1611923, upload-time = "2025-06-14T15:13:20.997Z" }, + { url = "https://files.pythonhosted.org/packages/31/80/7fa3f3bebf533aa6ae6508b51ac0de9965e88f9654fa679cc1a29d335a79/aiohttp-3.12.13-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:f3854fbde7a465318ad8d3fc5bef8f059e6d0a87e71a0d3360bb56c0bf87b18a", size = 1691511, upload-time = "2025-06-14T15:13:22.54Z" }, + { url = "https://files.pythonhosted.org/packages/0f/7a/359974653a3cdd3e9cee8ca10072a662c3c0eb46a359c6a1f667b0296e2f/aiohttp-3.12.13-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:2332b4c361c05ecd381edb99e2a33733f3db906739a83a483974b3df70a51b40", size = 1714751, upload-time = "2025-06-14T15:13:24.366Z" }, + { url = "https://files.pythonhosted.org/packages/2d/24/0aa03d522171ce19064347afeefadb008be31ace0bbb7d44ceb055700a14/aiohttp-3.12.13-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:1561db63fa1b658cd94325d303933553ea7d89ae09ff21cc3bcd41b8521fbbb6", size = 1643090, upload-time = "2025-06-14T15:13:26.231Z" }, + { url = "https://files.pythonhosted.org/packages/86/2e/7d4b0026a41e4b467e143221c51b279083b7044a4b104054f5c6464082ff/aiohttp-3.12.13-cp310-cp310-win32.whl", hash = "sha256:a0be857f0b35177ba09d7c472825d1b711d11c6d0e8a2052804e3b93166de1ad", size = 427526, upload-time = "2025-06-14T15:13:27.988Z" }, + { url = "https://files.pythonhosted.org/packages/17/de/34d998da1e7f0de86382160d039131e9b0af1962eebfe53dda2b61d250e7/aiohttp-3.12.13-cp310-cp310-win_amd64.whl", hash = "sha256:fcc30ad4fb5cb41a33953292d45f54ef4066746d625992aeac33b8c681173178", size = 450734, upload-time = "2025-06-14T15:13:29.394Z" }, + { url = "https://files.pythonhosted.org/packages/6a/65/5566b49553bf20ffed6041c665a5504fb047cefdef1b701407b8ce1a47c4/aiohttp-3.12.13-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:7c229b1437aa2576b99384e4be668af1db84b31a45305d02f61f5497cfa6f60c", size = 709401, upload-time = "2025-06-14T15:13:30.774Z" }, + { url = "https://files.pythonhosted.org/packages/14/b5/48e4cc61b54850bdfafa8fe0b641ab35ad53d8e5a65ab22b310e0902fa42/aiohttp-3.12.13-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:04076d8c63471e51e3689c93940775dc3d12d855c0c80d18ac5a1c68f0904358", size = 481669, upload-time = "2025-06-14T15:13:32.316Z" }, + { url = "https://files.pythonhosted.org/packages/04/4f/e3f95c8b2a20a0437d51d41d5ccc4a02970d8ad59352efb43ea2841bd08e/aiohttp-3.12.13-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:55683615813ce3601640cfaa1041174dc956d28ba0511c8cbd75273eb0587014", size = 469933, upload-time = "2025-06-14T15:13:34.104Z" }, + { url = "https://files.pythonhosted.org/packages/41/c9/c5269f3b6453b1cfbd2cfbb6a777d718c5f086a3727f576c51a468b03ae2/aiohttp-3.12.13-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:921bc91e602d7506d37643e77819cb0b840d4ebb5f8d6408423af3d3bf79a7b7", size = 1740128, upload-time = "2025-06-14T15:13:35.604Z" }, + { url = "https://files.pythonhosted.org/packages/6f/49/a3f76caa62773d33d0cfaa842bdf5789a78749dbfe697df38ab1badff369/aiohttp-3.12.13-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e72d17fe0974ddeae8ed86db297e23dba39c7ac36d84acdbb53df2e18505a013", size = 1688796, upload-time = "2025-06-14T15:13:37.125Z" }, + { url = "https://files.pythonhosted.org/packages/ad/e4/556fccc4576dc22bf18554b64cc873b1a3e5429a5bdb7bbef7f5d0bc7664/aiohttp-3.12.13-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0653d15587909a52e024a261943cf1c5bdc69acb71f411b0dd5966d065a51a47", size = 1787589, upload-time = "2025-06-14T15:13:38.745Z" }, + { url = "https://files.pythonhosted.org/packages/b9/3d/d81b13ed48e1a46734f848e26d55a7391708421a80336e341d2aef3b6db2/aiohttp-3.12.13-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a77b48997c66722c65e157c06c74332cdf9c7ad00494b85ec43f324e5c5a9b9a", size = 1826635, upload-time = "2025-06-14T15:13:40.733Z" }, + { url = "https://files.pythonhosted.org/packages/75/a5/472e25f347da88459188cdaadd1f108f6292f8a25e62d226e63f860486d1/aiohttp-3.12.13-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d6946bae55fd36cfb8e4092c921075cde029c71c7cb571d72f1079d1e4e013bc", size = 1729095, upload-time = "2025-06-14T15:13:42.312Z" }, + { url = "https://files.pythonhosted.org/packages/b9/fe/322a78b9ac1725bfc59dfc301a5342e73d817592828e4445bd8f4ff83489/aiohttp-3.12.13-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4f95db8c8b219bcf294a53742c7bda49b80ceb9d577c8e7aa075612b7f39ffb7", size = 1666170, upload-time = "2025-06-14T15:13:44.884Z" }, + { url = "https://files.pythonhosted.org/packages/7a/77/ec80912270e231d5e3839dbd6c065472b9920a159ec8a1895cf868c2708e/aiohttp-3.12.13-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:03d5eb3cfb4949ab4c74822fb3326cd9655c2b9fe22e4257e2100d44215b2e2b", size = 1714444, upload-time = "2025-06-14T15:13:46.401Z" }, + { url = "https://files.pythonhosted.org/packages/21/b2/fb5aedbcb2b58d4180e58500e7c23ff8593258c27c089abfbcc7db65bd40/aiohttp-3.12.13-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:6383dd0ffa15515283c26cbf41ac8e6705aab54b4cbb77bdb8935a713a89bee9", size = 1709604, upload-time = "2025-06-14T15:13:48.377Z" }, + { url = "https://files.pythonhosted.org/packages/e3/15/a94c05f7c4dc8904f80b6001ad6e07e035c58a8ebfcc15e6b5d58500c858/aiohttp-3.12.13-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:6548a411bc8219b45ba2577716493aa63b12803d1e5dc70508c539d0db8dbf5a", size = 1689786, upload-time = "2025-06-14T15:13:50.401Z" }, + { url = "https://files.pythonhosted.org/packages/1d/fd/0d2e618388f7a7a4441eed578b626bda9ec6b5361cd2954cfc5ab39aa170/aiohttp-3.12.13-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:81b0fcbfe59a4ca41dc8f635c2a4a71e63f75168cc91026c61be665945739e2d", size = 1783389, upload-time = "2025-06-14T15:13:51.945Z" }, + { url = "https://files.pythonhosted.org/packages/a6/6b/6986d0c75996ef7e64ff7619b9b7449b1d1cbbe05c6755e65d92f1784fe9/aiohttp-3.12.13-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:6a83797a0174e7995e5edce9dcecc517c642eb43bc3cba296d4512edf346eee2", size = 1803853, upload-time = "2025-06-14T15:13:53.533Z" }, + { url = "https://files.pythonhosted.org/packages/21/65/cd37b38f6655d95dd07d496b6d2f3924f579c43fd64b0e32b547b9c24df5/aiohttp-3.12.13-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:a5734d8469a5633a4e9ffdf9983ff7cdb512524645c7a3d4bc8a3de45b935ac3", size = 1716909, upload-time = "2025-06-14T15:13:55.148Z" }, + { url = "https://files.pythonhosted.org/packages/fd/20/2de7012427dc116714c38ca564467f6143aec3d5eca3768848d62aa43e62/aiohttp-3.12.13-cp311-cp311-win32.whl", hash = "sha256:fef8d50dfa482925bb6b4c208b40d8e9fa54cecba923dc65b825a72eed9a5dbd", size = 427036, upload-time = "2025-06-14T15:13:57.076Z" }, + { url = "https://files.pythonhosted.org/packages/f8/b6/98518bcc615ef998a64bef371178b9afc98ee25895b4f476c428fade2220/aiohttp-3.12.13-cp311-cp311-win_amd64.whl", hash = "sha256:9a27da9c3b5ed9d04c36ad2df65b38a96a37e9cfba6f1381b842d05d98e6afe9", size = 451427, upload-time = "2025-06-14T15:13:58.505Z" }, + { url = "https://files.pythonhosted.org/packages/b4/6a/ce40e329788013cd190b1d62bbabb2b6a9673ecb6d836298635b939562ef/aiohttp-3.12.13-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0aa580cf80558557285b49452151b9c69f2fa3ad94c5c9e76e684719a8791b73", size = 700491, upload-time = "2025-06-14T15:14:00.048Z" }, + { url = "https://files.pythonhosted.org/packages/28/d9/7150d5cf9163e05081f1c5c64a0cdf3c32d2f56e2ac95db2a28fe90eca69/aiohttp-3.12.13-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b103a7e414b57e6939cc4dece8e282cfb22043efd0c7298044f6594cf83ab347", size = 475104, upload-time = "2025-06-14T15:14:01.691Z" }, + { url = "https://files.pythonhosted.org/packages/f8/91/d42ba4aed039ce6e449b3e2db694328756c152a79804e64e3da5bc19dffc/aiohttp-3.12.13-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:78f64e748e9e741d2eccff9597d09fb3cd962210e5b5716047cbb646dc8fe06f", size = 467948, upload-time = "2025-06-14T15:14:03.561Z" }, + { url = "https://files.pythonhosted.org/packages/99/3b/06f0a632775946981d7c4e5a865cddb6e8dfdbaed2f56f9ade7bb4a1039b/aiohttp-3.12.13-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:29c955989bf4c696d2ededc6b0ccb85a73623ae6e112439398935362bacfaaf6", size = 1714742, upload-time = "2025-06-14T15:14:05.558Z" }, + { url = "https://files.pythonhosted.org/packages/92/a6/2552eebad9ec5e3581a89256276009e6a974dc0793632796af144df8b740/aiohttp-3.12.13-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:d640191016763fab76072c87d8854a19e8e65d7a6fcfcbf017926bdbbb30a7e5", size = 1697393, upload-time = "2025-06-14T15:14:07.194Z" }, + { url = "https://files.pythonhosted.org/packages/d8/9f/bd08fdde114b3fec7a021381b537b21920cdd2aa29ad48c5dffd8ee314f1/aiohttp-3.12.13-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4dc507481266b410dede95dd9f26c8d6f5a14315372cc48a6e43eac652237d9b", size = 1752486, upload-time = "2025-06-14T15:14:08.808Z" }, + { url = "https://files.pythonhosted.org/packages/f7/e1/affdea8723aec5bd0959171b5490dccd9a91fcc505c8c26c9f1dca73474d/aiohttp-3.12.13-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8a94daa873465d518db073bd95d75f14302e0208a08e8c942b2f3f1c07288a75", size = 1798643, upload-time = "2025-06-14T15:14:10.767Z" }, + { url = "https://files.pythonhosted.org/packages/f3/9d/666d856cc3af3a62ae86393baa3074cc1d591a47d89dc3bf16f6eb2c8d32/aiohttp-3.12.13-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:177f52420cde4ce0bb9425a375d95577fe082cb5721ecb61da3049b55189e4e6", size = 1718082, upload-time = "2025-06-14T15:14:12.38Z" }, + { url = "https://files.pythonhosted.org/packages/f3/ce/3c185293843d17be063dada45efd2712bb6bf6370b37104b4eda908ffdbd/aiohttp-3.12.13-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0f7df1f620ec40f1a7fbcb99ea17d7326ea6996715e78f71a1c9a021e31b96b8", size = 1633884, upload-time = "2025-06-14T15:14:14.415Z" }, + { url = "https://files.pythonhosted.org/packages/3a/5b/f3413f4b238113be35dfd6794e65029250d4b93caa0974ca572217745bdb/aiohttp-3.12.13-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3062d4ad53b36e17796dce1c0d6da0ad27a015c321e663657ba1cc7659cfc710", size = 1694943, upload-time = "2025-06-14T15:14:16.48Z" }, + { url = "https://files.pythonhosted.org/packages/82/c8/0e56e8bf12081faca85d14a6929ad5c1263c146149cd66caa7bc12255b6d/aiohttp-3.12.13-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:8605e22d2a86b8e51ffb5253d9045ea73683d92d47c0b1438e11a359bdb94462", size = 1716398, upload-time = "2025-06-14T15:14:18.589Z" }, + { url = "https://files.pythonhosted.org/packages/ea/f3/33192b4761f7f9b2f7f4281365d925d663629cfaea093a64b658b94fc8e1/aiohttp-3.12.13-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:54fbbe6beafc2820de71ece2198458a711e224e116efefa01b7969f3e2b3ddae", size = 1657051, upload-time = "2025-06-14T15:14:20.223Z" }, + { url = "https://files.pythonhosted.org/packages/5e/0b/26ddd91ca8f84c48452431cb4c5dd9523b13bc0c9766bda468e072ac9e29/aiohttp-3.12.13-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:050bd277dfc3768b606fd4eae79dd58ceda67d8b0b3c565656a89ae34525d15e", size = 1736611, upload-time = "2025-06-14T15:14:21.988Z" }, + { url = "https://files.pythonhosted.org/packages/c3/8d/e04569aae853302648e2c138a680a6a2f02e374c5b6711732b29f1e129cc/aiohttp-3.12.13-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:2637a60910b58f50f22379b6797466c3aa6ae28a6ab6404e09175ce4955b4e6a", size = 1764586, upload-time = "2025-06-14T15:14:23.979Z" }, + { url = "https://files.pythonhosted.org/packages/ac/98/c193c1d1198571d988454e4ed75adc21c55af247a9fda08236602921c8c8/aiohttp-3.12.13-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e986067357550d1aaa21cfe9897fa19e680110551518a5a7cf44e6c5638cb8b5", size = 1724197, upload-time = "2025-06-14T15:14:25.692Z" }, + { url = "https://files.pythonhosted.org/packages/e7/9e/07bb8aa11eec762c6b1ff61575eeeb2657df11ab3d3abfa528d95f3e9337/aiohttp-3.12.13-cp312-cp312-win32.whl", hash = "sha256:ac941a80aeea2aaae2875c9500861a3ba356f9ff17b9cb2dbfb5cbf91baaf5bf", size = 421771, upload-time = "2025-06-14T15:14:27.364Z" }, + { url = "https://files.pythonhosted.org/packages/52/66/3ce877e56ec0813069cdc9607cd979575859c597b6fb9b4182c6d5f31886/aiohttp-3.12.13-cp312-cp312-win_amd64.whl", hash = "sha256:671f41e6146a749b6c81cb7fd07f5a8356d46febdaaaf07b0e774ff04830461e", size = 447869, upload-time = "2025-06-14T15:14:29.05Z" }, + { url = "https://files.pythonhosted.org/packages/11/0f/db19abdf2d86aa1deec3c1e0e5ea46a587b97c07a16516b6438428b3a3f8/aiohttp-3.12.13-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:d4a18e61f271127465bdb0e8ff36e8f02ac4a32a80d8927aa52371e93cd87938", size = 694910, upload-time = "2025-06-14T15:14:30.604Z" }, + { url = "https://files.pythonhosted.org/packages/d5/81/0ab551e1b5d7f1339e2d6eb482456ccbe9025605b28eed2b1c0203aaaade/aiohttp-3.12.13-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:532542cb48691179455fab429cdb0d558b5e5290b033b87478f2aa6af5d20ace", size = 472566, upload-time = "2025-06-14T15:14:32.275Z" }, + { url = "https://files.pythonhosted.org/packages/34/3f/6b7d336663337672d29b1f82d1f252ec1a040fe2d548f709d3f90fa2218a/aiohttp-3.12.13-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:d7eea18b52f23c050ae9db5d01f3d264ab08f09e7356d6f68e3f3ac2de9dfabb", size = 464856, upload-time = "2025-06-14T15:14:34.132Z" }, + { url = "https://files.pythonhosted.org/packages/26/7f/32ca0f170496aa2ab9b812630fac0c2372c531b797e1deb3deb4cea904bd/aiohttp-3.12.13-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ad7c8e5c25f2a26842a7c239de3f7b6bfb92304593ef997c04ac49fb703ff4d7", size = 1703683, upload-time = "2025-06-14T15:14:36.034Z" }, + { url = "https://files.pythonhosted.org/packages/ec/53/d5513624b33a811c0abea8461e30a732294112318276ce3dbf047dbd9d8b/aiohttp-3.12.13-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:6af355b483e3fe9d7336d84539fef460120c2f6e50e06c658fe2907c69262d6b", size = 1684946, upload-time = "2025-06-14T15:14:38Z" }, + { url = "https://files.pythonhosted.org/packages/37/72/4c237dd127827b0247dc138d3ebd49c2ded6114c6991bbe969058575f25f/aiohttp-3.12.13-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a95cf9f097498f35c88e3609f55bb47b28a5ef67f6888f4390b3d73e2bac6177", size = 1737017, upload-time = "2025-06-14T15:14:39.951Z" }, + { url = "https://files.pythonhosted.org/packages/0d/67/8a7eb3afa01e9d0acc26e1ef847c1a9111f8b42b82955fcd9faeb84edeb4/aiohttp-3.12.13-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b8ed8c38a1c584fe99a475a8f60eefc0b682ea413a84c6ce769bb19a7ff1c5ef", size = 1786390, upload-time = "2025-06-14T15:14:42.151Z" }, + { url = "https://files.pythonhosted.org/packages/48/19/0377df97dd0176ad23cd8cad4fd4232cfeadcec6c1b7f036315305c98e3f/aiohttp-3.12.13-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7a0b9170d5d800126b5bc89d3053a2363406d6e327afb6afaeda2d19ee8bb103", size = 1708719, upload-time = "2025-06-14T15:14:44.039Z" }, + { url = "https://files.pythonhosted.org/packages/61/97/ade1982a5c642b45f3622255173e40c3eed289c169f89d00eeac29a89906/aiohttp-3.12.13-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:372feeace612ef8eb41f05ae014a92121a512bd5067db8f25101dd88a8db11da", size = 1622424, upload-time = "2025-06-14T15:14:45.945Z" }, + { url = "https://files.pythonhosted.org/packages/99/ab/00ad3eea004e1d07ccc406e44cfe2b8da5acb72f8c66aeeb11a096798868/aiohttp-3.12.13-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a946d3702f7965d81f7af7ea8fb03bb33fe53d311df48a46eeca17e9e0beed2d", size = 1675447, upload-time = "2025-06-14T15:14:47.911Z" }, + { url = "https://files.pythonhosted.org/packages/3f/fe/74e5ce8b2ccaba445fe0087abc201bfd7259431d92ae608f684fcac5d143/aiohttp-3.12.13-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:a0c4725fae86555bbb1d4082129e21de7264f4ab14baf735278c974785cd2041", size = 1707110, upload-time = "2025-06-14T15:14:50.334Z" }, + { url = "https://files.pythonhosted.org/packages/ef/c4/39af17807f694f7a267bd8ab1fbacf16ad66740862192a6c8abac2bff813/aiohttp-3.12.13-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:9b28ea2f708234f0a5c44eb6c7d9eb63a148ce3252ba0140d050b091b6e842d1", size = 1649706, upload-time = "2025-06-14T15:14:52.378Z" }, + { url = "https://files.pythonhosted.org/packages/38/e8/f5a0a5f44f19f171d8477059aa5f28a158d7d57fe1a46c553e231f698435/aiohttp-3.12.13-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:d4f5becd2a5791829f79608c6f3dc745388162376f310eb9c142c985f9441cc1", size = 1725839, upload-time = "2025-06-14T15:14:54.617Z" }, + { url = "https://files.pythonhosted.org/packages/fd/ac/81acc594c7f529ef4419d3866913f628cd4fa9cab17f7bf410a5c3c04c53/aiohttp-3.12.13-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:60f2ce6b944e97649051d5f5cc0f439360690b73909230e107fd45a359d3e911", size = 1759311, upload-time = "2025-06-14T15:14:56.597Z" }, + { url = "https://files.pythonhosted.org/packages/38/0d/aabe636bd25c6ab7b18825e5a97d40024da75152bec39aa6ac8b7a677630/aiohttp-3.12.13-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:69fc1909857401b67bf599c793f2183fbc4804717388b0b888f27f9929aa41f3", size = 1708202, upload-time = "2025-06-14T15:14:58.598Z" }, + { url = "https://files.pythonhosted.org/packages/1f/ab/561ef2d8a223261683fb95a6283ad0d36cb66c87503f3a7dde7afe208bb2/aiohttp-3.12.13-cp313-cp313-win32.whl", hash = "sha256:7d7e68787a2046b0e44ba5587aa723ce05d711e3a3665b6b7545328ac8e3c0dd", size = 420794, upload-time = "2025-06-14T15:15:00.939Z" }, + { url = "https://files.pythonhosted.org/packages/9d/47/b11d0089875a23bff0abd3edb5516bcd454db3fefab8604f5e4b07bd6210/aiohttp-3.12.13-cp313-cp313-win_amd64.whl", hash = "sha256:5a178390ca90419bfd41419a809688c368e63c86bd725e1186dd97f6b89c2706", size = 446735, upload-time = "2025-06-14T15:15:02.858Z" }, + { url = "https://files.pythonhosted.org/packages/05/7e/0f6b2b4797ac364b6ecc9176bb2dd24d4a9aeaa77ecb093c7f87e44dfbd6/aiohttp-3.12.13-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:36f6c973e003dc9b0bb4e8492a643641ea8ef0e97ff7aaa5c0f53d68839357b4", size = 704988, upload-time = "2025-06-14T15:15:04.705Z" }, + { url = "https://files.pythonhosted.org/packages/52/38/d51ea984c777b203959030895c1c8b1f9aac754f8e919e4942edce05958e/aiohttp-3.12.13-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6cbfc73179bd67c229eb171e2e3745d2afd5c711ccd1e40a68b90427f282eab1", size = 479967, upload-time = "2025-06-14T15:15:06.575Z" }, + { url = "https://files.pythonhosted.org/packages/9d/0a/62f1c2914840eb2184939e773b65e1e5d6b651b78134798263467f0d2467/aiohttp-3.12.13-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1e8b27b2d414f7e3205aa23bb4a692e935ef877e3a71f40d1884f6e04fd7fa74", size = 467373, upload-time = "2025-06-14T15:15:08.788Z" }, + { url = "https://files.pythonhosted.org/packages/7b/4e/327a4b56bb940afb03ee45d5fd1ef7dae5ed6617889d61ed8abf0548310b/aiohttp-3.12.13-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eabded0c2b2ef56243289112c48556c395d70150ce4220d9008e6b4b3dd15690", size = 1642326, upload-time = "2025-06-14T15:15:10.74Z" }, + { url = "https://files.pythonhosted.org/packages/55/5d/f0277aad4d85a56cd6102335d5111c7c6d1f98cb760aa485e4fe11a24f52/aiohttp-3.12.13-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:003038e83f1a3ff97409999995ec02fe3008a1d675478949643281141f54751d", size = 1616820, upload-time = "2025-06-14T15:15:12.77Z" }, + { url = "https://files.pythonhosted.org/packages/f2/ff/909193459a6d32ee806d9f7ae2342c940ee97d2c1416140c5aec3bd6bfc0/aiohttp-3.12.13-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1b6f46613031dbc92bdcaad9c4c22c7209236ec501f9c0c5f5f0b6a689bf50f3", size = 1690448, upload-time = "2025-06-14T15:15:14.754Z" }, + { url = "https://files.pythonhosted.org/packages/45/e7/14d09183849e9bd69d8d5bf7df0ab7603996b83b00540e0890eeefa20e1e/aiohttp-3.12.13-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c332c6bb04650d59fb94ed96491f43812549a3ba6e7a16a218e612f99f04145e", size = 1729763, upload-time = "2025-06-14T15:15:16.783Z" }, + { url = "https://files.pythonhosted.org/packages/55/01/07b980d6226574cc2d157fa4978a3d77270a4e860193a579630a81b30e30/aiohttp-3.12.13-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3fea41a2c931fb582cb15dc86a3037329e7b941df52b487a9f8b5aa960153cbd", size = 1636002, upload-time = "2025-06-14T15:15:18.871Z" }, + { url = "https://files.pythonhosted.org/packages/73/cf/20a1f75ca3d8e48065412e80b79bb1c349e26a4fa51d660be186a9c0c1e3/aiohttp-3.12.13-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:846104f45d18fb390efd9b422b27d8f3cf8853f1218c537f36e71a385758c896", size = 1571003, upload-time = "2025-06-14T15:15:20.95Z" }, + { url = "https://files.pythonhosted.org/packages/e1/99/09520d83e5964d6267074be9c66698e2003dfe8c66465813f57b029dec8c/aiohttp-3.12.13-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:5d6c85ac7dd350f8da2520bac8205ce99df4435b399fa7f4dc4a70407073e390", size = 1618964, upload-time = "2025-06-14T15:15:23.155Z" }, + { url = "https://files.pythonhosted.org/packages/3a/01/c68f2c7632441fbbfc4a835e003e61eb1d63531857b0a2b73c9698846fa8/aiohttp-3.12.13-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:5a1ecce0ed281bec7da8550da052a6b89552db14d0a0a45554156f085a912f48", size = 1629103, upload-time = "2025-06-14T15:15:25.209Z" }, + { url = "https://files.pythonhosted.org/packages/fb/fe/f9540bf12fa443d8870ecab70260c02140ed8b4c37884a2e1050bdd689a2/aiohttp-3.12.13-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:5304d74867028cca8f64f1cc1215eb365388033c5a691ea7aa6b0dc47412f495", size = 1605745, upload-time = "2025-06-14T15:15:27.604Z" }, + { url = "https://files.pythonhosted.org/packages/91/d7/526f1d16ca01e0c995887097b31e39c2e350dc20c1071e9b2dcf63a86fcd/aiohttp-3.12.13-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:64d1f24ee95a2d1e094a4cd7a9b7d34d08db1bbcb8aa9fb717046b0a884ac294", size = 1693348, upload-time = "2025-06-14T15:15:30.151Z" }, + { url = "https://files.pythonhosted.org/packages/cd/0a/c103fdaab6fbde7c5f10450b5671dca32cea99800b1303ee8194a799bbb9/aiohttp-3.12.13-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:119c79922a7001ca6a9e253228eb39b793ea994fd2eccb79481c64b5f9d2a055", size = 1709023, upload-time = "2025-06-14T15:15:32.881Z" }, + { url = "https://files.pythonhosted.org/packages/2f/bc/b8d14e754b5e0bf9ecf6df4b930f2cbd6eaaafcdc1b2f9271968747fb6e3/aiohttp-3.12.13-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:bb18f00396d22e2f10cd8825d671d9f9a3ba968d708a559c02a627536b36d91c", size = 1638691, upload-time = "2025-06-14T15:15:35.033Z" }, + { url = "https://files.pythonhosted.org/packages/a4/7b/44b77bf4c48d95d81af5c57e79337d0d51350a85a84e9997a99a6205c441/aiohttp-3.12.13-cp39-cp39-win32.whl", hash = "sha256:0022de47ef63fd06b065d430ac79c6b0bd24cdae7feaf0e8c6bac23b805a23a8", size = 428365, upload-time = "2025-06-14T15:15:37.369Z" }, + { url = "https://files.pythonhosted.org/packages/e5/cb/aaa022eb993e7d51928dc22d743ed17addb40142250e829701c5e6679615/aiohttp-3.12.13-cp39-cp39-win_amd64.whl", hash = "sha256:29e08111ccf81b2734ae03f1ad1cb03b9615e7d8f616764f22f71209c094f122", size = 451652, upload-time = "2025-06-14T15:15:39.079Z" }, +] + +[[package]] +name = "aiosignal" +version = "1.3.1" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.9'", +] +dependencies = [ + { name = "frozenlist", version = "1.5.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ae/67/0952ed97a9793b4958e5736f6d2b346b414a2cd63e82d05940032f45b32f/aiosignal-1.3.1.tar.gz", hash = "sha256:54cd96e15e1649b75d6c87526a6ff0b6c1b0dd3459f43d9ca11d48c339b68cfc", size = 19422, upload-time = "2022-11-08T16:03:58.806Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/76/ac/a7305707cb852b7e16ff80eaf5692309bde30e2b1100a1fcacdc8f731d97/aiosignal-1.3.1-py3-none-any.whl", hash = "sha256:f8376fb07dd1e86a584e4fcdec80b36b7f81aac666ebc724e2c090300dd83b17", size = 7617, upload-time = "2022-11-08T16:03:57.483Z" }, +] + +[[package]] +name = "aiosignal" +version = "1.4.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.9'", +] +dependencies = [ + { name = "frozenlist", version = "1.7.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "typing-extensions", marker = "(python_full_version >= '3.9' and python_full_version < '3.13') or (python_full_version < '3.9' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2') or (python_full_version >= '3.13' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/61/62/06741b579156360248d1ec624842ad0edf697050bbaf7c3e46394e106ad1/aiosignal-1.4.0.tar.gz", hash = "sha256:f47eecd9468083c2029cc99945502cb7708b082c232f9aca65da147157b251c7", size = 25007, upload-time = "2025-07-03T22:54:43.528Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fb/76/641ae371508676492379f16e2fa48f4e2c11741bd63c48be4b12a6b09cba/aiosignal-1.4.0-py3-none-any.whl", hash = "sha256:053243f8b92b990551949e63930a839ff0cf0b0ebbe0597b0f3fb19e1a0fe82e", size = 7490, upload-time = "2025-07-03T22:54:42.156Z" }, +] + +[[package]] +name = "annotated-types" +version = "0.7.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions", marker = "(python_full_version < '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081, upload-time = "2024-05-20T21:33:25.928Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643, upload-time = "2024-05-20T21:33:24.1Z" }, +] + +[[package]] +name = "anyio" +version = "4.5.2" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.9'", +] +dependencies = [ + { name = "exceptiongroup", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "idna", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "sniffio", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "typing-extensions", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/4d/f9/9a7ce600ebe7804daf90d4d48b1c0510a4561ddce43a596be46676f82343/anyio-4.5.2.tar.gz", hash = "sha256:23009af4ed04ce05991845451e11ef02fc7c5ed29179ac9a420e5ad0ac7ddc5b", size = 171293, upload-time = "2024-10-13T22:18:03.307Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1b/b4/f7e396030e3b11394436358ca258a81d6010106582422f23443c16ca1873/anyio-4.5.2-py3-none-any.whl", hash = "sha256:c011ee36bc1e8ba40e5a81cb9df91925c218fe9b778554e0b56a21e1b5d4716f", size = 89766, upload-time = "2024-10-13T22:18:01.524Z" }, +] + +[[package]] +name = "anyio" +version = "4.8.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.9'", +] +dependencies = [ + { name = "exceptiongroup", marker = "(python_full_version >= '3.9' and python_full_version < '3.11') or (python_full_version < '3.9' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2') or (python_full_version >= '3.11' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "idna", marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "sniffio", marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "typing-extensions", marker = "(python_full_version >= '3.9' and python_full_version < '3.13') or (python_full_version < '3.9' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2') or (python_full_version >= '3.13' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a3/73/199a98fc2dae33535d6b8e8e6ec01f8c1d76c9adb096c6b7d64823038cde/anyio-4.8.0.tar.gz", hash = "sha256:1d9fe889df5212298c0c0723fa20479d1b94883a2df44bd3897aa91083316f7a", size = 181126, upload-time = "2025-01-05T13:13:11.095Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/46/eb/e7f063ad1fec6b3178a3cd82d1a3c4de82cccf283fc42746168188e1cdd5/anyio-4.8.0-py3-none-any.whl", hash = "sha256:b5011f270ab5eb0abf13385f851315585cc37ef330dd88e27ec3d34d651fd47a", size = 96041, upload-time = "2025-01-05T13:13:07.985Z" }, +] + +[[package]] +name = "async-timeout" +version = "5.0.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a5/ae/136395dfbfe00dfc94da3f3e136d0b13f394cba8f4841120e34226265780/async_timeout-5.0.1.tar.gz", hash = "sha256:d9321a7a3d5a6a5e187e824d2fa0793ce379a202935782d555d6e9d2735677d3", size = 9274, upload-time = "2024-11-06T16:41:39.6Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fe/ba/e2081de779ca30d473f21f5b30e0e737c438205440784c7dfc81efc2b029/async_timeout-5.0.1-py3-none-any.whl", hash = "sha256:39e3809566ff85354557ec2398b55e096c8364bacac9405a7a1fa429e77fe76c", size = 6233, upload-time = "2024-11-06T16:41:37.9Z" }, +] + +[[package]] +name = "attrs" +version = "25.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/5a/b0/1367933a8532ee6ff8d63537de4f1177af4bff9f3e829baf7331f595bb24/attrs-25.3.0.tar.gz", hash = "sha256:75d7cefc7fb576747b2c81b4442d4d4a1ce0900973527c011d1030fd3bf4af1b", size = 812032, upload-time = "2025-03-13T11:10:22.779Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/77/06/bb80f5f86020c4551da315d78b3ab75e8228f89f0162f2c3a819e407941a/attrs-25.3.0-py3-none-any.whl", hash = "sha256:427318ce031701fea540783410126f03899a97ffc6f61596ad581ac2e40e3bc3", size = 63815, upload-time = "2025-03-13T11:10:21.14Z" }, +] + +[[package]] +name = "certifi" +version = "2024.12.14" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/0f/bd/1d41ee578ce09523c81a15426705dd20969f5abf006d1afe8aeff0dd776a/certifi-2024.12.14.tar.gz", hash = "sha256:b650d30f370c2b724812bee08008be0c4163b163ddaec3f2546c1caf65f191db", size = 166010, upload-time = "2024-12-14T13:52:38.02Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a5/32/8f6669fc4798494966bf446c8c4a162e0b5d893dff088afddf76414f70e1/certifi-2024.12.14-py3-none-any.whl", hash = "sha256:1275f7a45be9464efc1173084eaa30f866fe2e47d389406136d332ed4967ec56", size = 164927, upload-time = "2024-12-14T13:52:36.114Z" }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, +] + +[[package]] +name = "dirty-equals" +version = "0.9.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pytz", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b0/99/133892f401ced5a27e641a473c547d5fbdb39af8f85dac8a9d633ea3e7a7/dirty_equals-0.9.0.tar.gz", hash = "sha256:17f515970b04ed7900b733c95fd8091f4f85e52f1fb5f268757f25c858eb1f7b", size = 50412, upload-time = "2025-01-11T23:23:40.491Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/77/0c/03cc99bf3b6328604b10829de3460f2b2ad3373200c45665c38508e550c6/dirty_equals-0.9.0-py3-none-any.whl", hash = "sha256:ff4d027f5cfa1b69573af00f7ba9043ea652dbdce3fe5cbe828e478c7346db9c", size = 28226, upload-time = "2025-01-11T23:23:37.489Z" }, +] + +[[package]] +name = "distro" +version = "1.9.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/fc/f8/98eea607f65de6527f8a2e8885fc8015d3e6f5775df186e443e0964a11c3/distro-1.9.0.tar.gz", hash = "sha256:2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed", size = 60722, upload-time = "2023-12-24T09:54:32.31Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/12/b3/231ffd4ab1fc9d679809f356cebee130ac7daa00d6d6f3206dd4fd137e9e/distro-1.9.0-py3-none-any.whl", hash = "sha256:7bffd925d65168f85027d8da9af6bddab658135b840670a223589bc0c8ef02b2", size = 20277, upload-time = "2023-12-24T09:54:30.421Z" }, +] + +[[package]] +name = "exceptiongroup" +version = "1.2.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/09/35/2495c4ac46b980e4ca1f6ad6db102322ef3ad2410b79fdde159a4b0f3b92/exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc", size = 28883, upload-time = "2024-07-12T22:26:00.161Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/02/cc/b7e31358aac6ed1ef2bb790a9746ac2c69bcb3c8588b41616914eb106eaf/exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b", size = 16453, upload-time = "2024-07-12T22:25:58.476Z" }, +] + +[[package]] +name = "execnet" +version = "2.1.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/bb/ff/b4c0dc78fbe20c3e59c0c7334de0c27eb4001a2b2017999af398bf730817/execnet-2.1.1.tar.gz", hash = "sha256:5189b52c6121c24feae288166ab41b32549c7e2348652736540b9e6e7d4e72e3", size = 166524, upload-time = "2024-04-08T09:04:19.245Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/43/09/2aea36ff60d16dd8879bdb2f5b3ee0ba8d08cbbdcdfe870e695ce3784385/execnet-2.1.1-py3-none-any.whl", hash = "sha256:26dee51f1b80cebd6d0ca8e74dd8745419761d3bef34163928cbebbdc4749fdc", size = 40612, upload-time = "2024-04-08T09:04:17.414Z" }, +] + +[[package]] +name = "frozenlist" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.9'", +] +sdist = { url = "https://files.pythonhosted.org/packages/8f/ed/0f4cec13a93c02c47ec32d81d11c0c1efbadf4a471e3f3ce7cad366cbbd3/frozenlist-1.5.0.tar.gz", hash = "sha256:81d5af29e61b9c8348e876d442253723928dce6433e0e76cd925cd83f1b4b817", size = 39930, upload-time = "2024-10-23T09:48:29.903Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/54/79/29d44c4af36b2b240725dce566b20f63f9b36ef267aaaa64ee7466f4f2f8/frozenlist-1.5.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:5b6a66c18b5b9dd261ca98dffcb826a525334b2f29e7caa54e182255c5f6a65a", size = 94451, upload-time = "2024-10-23T09:46:20.558Z" }, + { url = "https://files.pythonhosted.org/packages/47/47/0c999aeace6ead8a44441b4f4173e2261b18219e4ad1fe9a479871ca02fc/frozenlist-1.5.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d1b3eb7b05ea246510b43a7e53ed1653e55c2121019a97e60cad7efb881a97bb", size = 54301, upload-time = "2024-10-23T09:46:21.759Z" }, + { url = "https://files.pythonhosted.org/packages/8d/60/107a38c1e54176d12e06e9d4b5d755b677d71d1219217cee063911b1384f/frozenlist-1.5.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:15538c0cbf0e4fa11d1e3a71f823524b0c46299aed6e10ebb4c2089abd8c3bec", size = 52213, upload-time = "2024-10-23T09:46:22.993Z" }, + { url = "https://files.pythonhosted.org/packages/17/62/594a6829ac5679c25755362a9dc93486a8a45241394564309641425d3ff6/frozenlist-1.5.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e79225373c317ff1e35f210dd5f1344ff31066ba8067c307ab60254cd3a78ad5", size = 240946, upload-time = "2024-10-23T09:46:24.661Z" }, + { url = "https://files.pythonhosted.org/packages/7e/75/6c8419d8f92c80dd0ee3f63bdde2702ce6398b0ac8410ff459f9b6f2f9cb/frozenlist-1.5.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9272fa73ca71266702c4c3e2d4a28553ea03418e591e377a03b8e3659d94fa76", size = 264608, upload-time = "2024-10-23T09:46:26.017Z" }, + { url = "https://files.pythonhosted.org/packages/88/3e/82a6f0b84bc6fb7e0be240e52863c6d4ab6098cd62e4f5b972cd31e002e8/frozenlist-1.5.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:498524025a5b8ba81695761d78c8dd7382ac0b052f34e66939c42df860b8ff17", size = 261361, upload-time = "2024-10-23T09:46:27.787Z" }, + { url = "https://files.pythonhosted.org/packages/fd/85/14e5f9ccac1b64ff2f10c927b3ffdf88772aea875882406f9ba0cec8ad84/frozenlist-1.5.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:92b5278ed9d50fe610185ecd23c55d8b307d75ca18e94c0e7de328089ac5dcba", size = 231649, upload-time = "2024-10-23T09:46:28.992Z" }, + { url = "https://files.pythonhosted.org/packages/ee/59/928322800306f6529d1852323014ee9008551e9bb027cc38d276cbc0b0e7/frozenlist-1.5.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f3c8c1dacd037df16e85227bac13cca58c30da836c6f936ba1df0c05d046d8d", size = 241853, upload-time = "2024-10-23T09:46:30.211Z" }, + { url = "https://files.pythonhosted.org/packages/7d/bd/e01fa4f146a6f6c18c5d34cab8abdc4013774a26c4ff851128cd1bd3008e/frozenlist-1.5.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f2ac49a9bedb996086057b75bf93538240538c6d9b38e57c82d51f75a73409d2", size = 243652, upload-time = "2024-10-23T09:46:31.758Z" }, + { url = "https://files.pythonhosted.org/packages/a5/bd/e4771fd18a8ec6757033f0fa903e447aecc3fbba54e3630397b61596acf0/frozenlist-1.5.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e66cc454f97053b79c2ab09c17fbe3c825ea6b4de20baf1be28919460dd7877f", size = 241734, upload-time = "2024-10-23T09:46:33.044Z" }, + { url = "https://files.pythonhosted.org/packages/21/13/c83821fa5544af4f60c5d3a65d054af3213c26b14d3f5f48e43e5fb48556/frozenlist-1.5.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:5a3ba5f9a0dfed20337d3e966dc359784c9f96503674c2faf015f7fe8e96798c", size = 260959, upload-time = "2024-10-23T09:46:34.916Z" }, + { url = "https://files.pythonhosted.org/packages/71/f3/1f91c9a9bf7ed0e8edcf52698d23f3c211d8d00291a53c9f115ceb977ab1/frozenlist-1.5.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:6321899477db90bdeb9299ac3627a6a53c7399c8cd58d25da094007402b039ab", size = 262706, upload-time = "2024-10-23T09:46:36.159Z" }, + { url = "https://files.pythonhosted.org/packages/4c/22/4a256fdf5d9bcb3ae32622c796ee5ff9451b3a13a68cfe3f68e2c95588ce/frozenlist-1.5.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:76e4753701248476e6286f2ef492af900ea67d9706a0155335a40ea21bf3b2f5", size = 250401, upload-time = "2024-10-23T09:46:37.327Z" }, + { url = "https://files.pythonhosted.org/packages/af/89/c48ebe1f7991bd2be6d5f4ed202d94960c01b3017a03d6954dd5fa9ea1e8/frozenlist-1.5.0-cp310-cp310-win32.whl", hash = "sha256:977701c081c0241d0955c9586ffdd9ce44f7a7795df39b9151cd9a6fd0ce4cfb", size = 45498, upload-time = "2024-10-23T09:46:38.552Z" }, + { url = "https://files.pythonhosted.org/packages/28/2f/cc27d5f43e023d21fe5c19538e08894db3d7e081cbf582ad5ed366c24446/frozenlist-1.5.0-cp310-cp310-win_amd64.whl", hash = "sha256:189f03b53e64144f90990d29a27ec4f7997d91ed3d01b51fa39d2dbe77540fd4", size = 51622, upload-time = "2024-10-23T09:46:39.513Z" }, + { url = "https://files.pythonhosted.org/packages/79/43/0bed28bf5eb1c9e4301003b74453b8e7aa85fb293b31dde352aac528dafc/frozenlist-1.5.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:fd74520371c3c4175142d02a976aee0b4cb4a7cc912a60586ffd8d5929979b30", size = 94987, upload-time = "2024-10-23T09:46:40.487Z" }, + { url = "https://files.pythonhosted.org/packages/bb/bf/b74e38f09a246e8abbe1e90eb65787ed745ccab6eaa58b9c9308e052323d/frozenlist-1.5.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2f3f7a0fbc219fb4455264cae4d9f01ad41ae6ee8524500f381de64ffaa077d5", size = 54584, upload-time = "2024-10-23T09:46:41.463Z" }, + { url = "https://files.pythonhosted.org/packages/2c/31/ab01375682f14f7613a1ade30149f684c84f9b8823a4391ed950c8285656/frozenlist-1.5.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f47c9c9028f55a04ac254346e92977bf0f166c483c74b4232bee19a6697e4778", size = 52499, upload-time = "2024-10-23T09:46:42.451Z" }, + { url = "https://files.pythonhosted.org/packages/98/a8/d0ac0b9276e1404f58fec3ab6e90a4f76b778a49373ccaf6a563f100dfbc/frozenlist-1.5.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0996c66760924da6e88922756d99b47512a71cfd45215f3570bf1e0b694c206a", size = 276357, upload-time = "2024-10-23T09:46:44.166Z" }, + { url = "https://files.pythonhosted.org/packages/ad/c9/c7761084fa822f07dac38ac29f841d4587570dd211e2262544aa0b791d21/frozenlist-1.5.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a2fe128eb4edeabe11896cb6af88fca5346059f6c8d807e3b910069f39157869", size = 287516, upload-time = "2024-10-23T09:46:45.369Z" }, + { url = "https://files.pythonhosted.org/packages/a1/ff/cd7479e703c39df7bdab431798cef89dc75010d8aa0ca2514c5b9321db27/frozenlist-1.5.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1a8ea951bbb6cacd492e3948b8da8c502a3f814f5d20935aae74b5df2b19cf3d", size = 283131, upload-time = "2024-10-23T09:46:46.654Z" }, + { url = "https://files.pythonhosted.org/packages/59/a0/370941beb47d237eca4fbf27e4e91389fd68699e6f4b0ebcc95da463835b/frozenlist-1.5.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:de537c11e4aa01d37db0d403b57bd6f0546e71a82347a97c6a9f0dcc532b3a45", size = 261320, upload-time = "2024-10-23T09:46:47.825Z" }, + { url = "https://files.pythonhosted.org/packages/b8/5f/c10123e8d64867bc9b4f2f510a32042a306ff5fcd7e2e09e5ae5100ee333/frozenlist-1.5.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c2623347b933fcb9095841f1cc5d4ff0b278addd743e0e966cb3d460278840d", size = 274877, upload-time = "2024-10-23T09:46:48.989Z" }, + { url = "https://files.pythonhosted.org/packages/fa/79/38c505601ae29d4348f21706c5d89755ceded02a745016ba2f58bd5f1ea6/frozenlist-1.5.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:cee6798eaf8b1416ef6909b06f7dc04b60755206bddc599f52232606e18179d3", size = 269592, upload-time = "2024-10-23T09:46:50.235Z" }, + { url = "https://files.pythonhosted.org/packages/19/e2/39f3a53191b8204ba9f0bb574b926b73dd2efba2a2b9d2d730517e8f7622/frozenlist-1.5.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:f5f9da7f5dbc00a604fe74aa02ae7c98bcede8a3b8b9666f9f86fc13993bc71a", size = 265934, upload-time = "2024-10-23T09:46:51.829Z" }, + { url = "https://files.pythonhosted.org/packages/d5/c9/3075eb7f7f3a91f1a6b00284af4de0a65a9ae47084930916f5528144c9dd/frozenlist-1.5.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:90646abbc7a5d5c7c19461d2e3eeb76eb0b204919e6ece342feb6032c9325ae9", size = 283859, upload-time = "2024-10-23T09:46:52.947Z" }, + { url = "https://files.pythonhosted.org/packages/05/f5/549f44d314c29408b962fa2b0e69a1a67c59379fb143b92a0a065ffd1f0f/frozenlist-1.5.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:bdac3c7d9b705d253b2ce370fde941836a5f8b3c5c2b8fd70940a3ea3af7f4f2", size = 287560, upload-time = "2024-10-23T09:46:54.162Z" }, + { url = "https://files.pythonhosted.org/packages/9d/f8/cb09b3c24a3eac02c4c07a9558e11e9e244fb02bf62c85ac2106d1eb0c0b/frozenlist-1.5.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:03d33c2ddbc1816237a67f66336616416e2bbb6beb306e5f890f2eb22b959cdf", size = 277150, upload-time = "2024-10-23T09:46:55.361Z" }, + { url = "https://files.pythonhosted.org/packages/37/48/38c2db3f54d1501e692d6fe058f45b6ad1b358d82cd19436efab80cfc965/frozenlist-1.5.0-cp311-cp311-win32.whl", hash = "sha256:237f6b23ee0f44066219dae14c70ae38a63f0440ce6750f868ee08775073f942", size = 45244, upload-time = "2024-10-23T09:46:56.578Z" }, + { url = "https://files.pythonhosted.org/packages/ca/8c/2ddffeb8b60a4bce3b196c32fcc30d8830d4615e7b492ec2071da801b8ad/frozenlist-1.5.0-cp311-cp311-win_amd64.whl", hash = "sha256:0cc974cc93d32c42e7b0f6cf242a6bd941c57c61b618e78b6c0a96cb72788c1d", size = 51634, upload-time = "2024-10-23T09:46:57.6Z" }, + { url = "https://files.pythonhosted.org/packages/79/73/fa6d1a96ab7fd6e6d1c3500700963eab46813847f01ef0ccbaa726181dd5/frozenlist-1.5.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:31115ba75889723431aa9a4e77d5f398f5cf976eea3bdf61749731f62d4a4a21", size = 94026, upload-time = "2024-10-23T09:46:58.601Z" }, + { url = "https://files.pythonhosted.org/packages/ab/04/ea8bf62c8868b8eada363f20ff1b647cf2e93377a7b284d36062d21d81d1/frozenlist-1.5.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7437601c4d89d070eac8323f121fcf25f88674627505334654fd027b091db09d", size = 54150, upload-time = "2024-10-23T09:46:59.608Z" }, + { url = "https://files.pythonhosted.org/packages/d0/9a/8e479b482a6f2070b26bda572c5e6889bb3ba48977e81beea35b5ae13ece/frozenlist-1.5.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7948140d9f8ece1745be806f2bfdf390127cf1a763b925c4a805c603df5e697e", size = 51927, upload-time = "2024-10-23T09:47:00.625Z" }, + { url = "https://files.pythonhosted.org/packages/e3/12/2aad87deb08a4e7ccfb33600871bbe8f0e08cb6d8224371387f3303654d7/frozenlist-1.5.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:feeb64bc9bcc6b45c6311c9e9b99406660a9c05ca8a5b30d14a78555088b0b3a", size = 282647, upload-time = "2024-10-23T09:47:01.992Z" }, + { url = "https://files.pythonhosted.org/packages/77/f2/07f06b05d8a427ea0060a9cef6e63405ea9e0d761846b95ef3fb3be57111/frozenlist-1.5.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:683173d371daad49cffb8309779e886e59c2f369430ad28fe715f66d08d4ab1a", size = 289052, upload-time = "2024-10-23T09:47:04.039Z" }, + { url = "https://files.pythonhosted.org/packages/bd/9f/8bf45a2f1cd4aa401acd271b077989c9267ae8463e7c8b1eb0d3f561b65e/frozenlist-1.5.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7d57d8f702221405a9d9b40f9da8ac2e4a1a8b5285aac6100f3393675f0a85ee", size = 291719, upload-time = "2024-10-23T09:47:05.58Z" }, + { url = "https://files.pythonhosted.org/packages/41/d1/1f20fd05a6c42d3868709b7604c9f15538a29e4f734c694c6bcfc3d3b935/frozenlist-1.5.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:30c72000fbcc35b129cb09956836c7d7abf78ab5416595e4857d1cae8d6251a6", size = 267433, upload-time = "2024-10-23T09:47:07.807Z" }, + { url = "https://files.pythonhosted.org/packages/af/f2/64b73a9bb86f5a89fb55450e97cd5c1f84a862d4ff90d9fd1a73ab0f64a5/frozenlist-1.5.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:000a77d6034fbad9b6bb880f7ec073027908f1b40254b5d6f26210d2dab1240e", size = 283591, upload-time = "2024-10-23T09:47:09.645Z" }, + { url = "https://files.pythonhosted.org/packages/29/e2/ffbb1fae55a791fd6c2938dd9ea779509c977435ba3940b9f2e8dc9d5316/frozenlist-1.5.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:5d7f5a50342475962eb18b740f3beecc685a15b52c91f7d975257e13e029eca9", size = 273249, upload-time = "2024-10-23T09:47:10.808Z" }, + { url = "https://files.pythonhosted.org/packages/2e/6e/008136a30798bb63618a114b9321b5971172a5abddff44a100c7edc5ad4f/frozenlist-1.5.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:87f724d055eb4785d9be84e9ebf0f24e392ddfad00b3fe036e43f489fafc9039", size = 271075, upload-time = "2024-10-23T09:47:11.938Z" }, + { url = "https://files.pythonhosted.org/packages/ae/f0/4e71e54a026b06724cec9b6c54f0b13a4e9e298cc8db0f82ec70e151f5ce/frozenlist-1.5.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:6e9080bb2fb195a046e5177f10d9d82b8a204c0736a97a153c2466127de87784", size = 285398, upload-time = "2024-10-23T09:47:14.071Z" }, + { url = "https://files.pythonhosted.org/packages/4d/36/70ec246851478b1c0b59f11ef8ade9c482ff447c1363c2bd5fad45098b12/frozenlist-1.5.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:9b93d7aaa36c966fa42efcaf716e6b3900438632a626fb09c049f6a2f09fc631", size = 294445, upload-time = "2024-10-23T09:47:15.318Z" }, + { url = "https://files.pythonhosted.org/packages/37/e0/47f87544055b3349b633a03c4d94b405956cf2437f4ab46d0928b74b7526/frozenlist-1.5.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:52ef692a4bc60a6dd57f507429636c2af8b6046db8b31b18dac02cbc8f507f7f", size = 280569, upload-time = "2024-10-23T09:47:17.149Z" }, + { url = "https://files.pythonhosted.org/packages/f9/7c/490133c160fb6b84ed374c266f42800e33b50c3bbab1652764e6e1fc498a/frozenlist-1.5.0-cp312-cp312-win32.whl", hash = "sha256:29d94c256679247b33a3dc96cce0f93cbc69c23bf75ff715919332fdbb6a32b8", size = 44721, upload-time = "2024-10-23T09:47:19.012Z" }, + { url = "https://files.pythonhosted.org/packages/b1/56/4e45136ffc6bdbfa68c29ca56ef53783ef4c2fd395f7cbf99a2624aa9aaa/frozenlist-1.5.0-cp312-cp312-win_amd64.whl", hash = "sha256:8969190d709e7c48ea386db202d708eb94bdb29207a1f269bab1196ce0dcca1f", size = 51329, upload-time = "2024-10-23T09:47:20.177Z" }, + { url = "https://files.pythonhosted.org/packages/da/3b/915f0bca8a7ea04483622e84a9bd90033bab54bdf485479556c74fd5eaf5/frozenlist-1.5.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:7a1a048f9215c90973402e26c01d1cff8a209e1f1b53f72b95c13db61b00f953", size = 91538, upload-time = "2024-10-23T09:47:21.176Z" }, + { url = "https://files.pythonhosted.org/packages/c7/d1/a7c98aad7e44afe5306a2b068434a5830f1470675f0e715abb86eb15f15b/frozenlist-1.5.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:dd47a5181ce5fcb463b5d9e17ecfdb02b678cca31280639255ce9d0e5aa67af0", size = 52849, upload-time = "2024-10-23T09:47:22.439Z" }, + { url = "https://files.pythonhosted.org/packages/3a/c8/76f23bf9ab15d5f760eb48701909645f686f9c64fbb8982674c241fbef14/frozenlist-1.5.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1431d60b36d15cda188ea222033eec8e0eab488f39a272461f2e6d9e1a8e63c2", size = 50583, upload-time = "2024-10-23T09:47:23.44Z" }, + { url = "https://files.pythonhosted.org/packages/1f/22/462a3dd093d11df623179d7754a3b3269de3b42de2808cddef50ee0f4f48/frozenlist-1.5.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6482a5851f5d72767fbd0e507e80737f9c8646ae7fd303def99bfe813f76cf7f", size = 265636, upload-time = "2024-10-23T09:47:24.82Z" }, + { url = "https://files.pythonhosted.org/packages/80/cf/e075e407fc2ae7328155a1cd7e22f932773c8073c1fc78016607d19cc3e5/frozenlist-1.5.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:44c49271a937625619e862baacbd037a7ef86dd1ee215afc298a417ff3270608", size = 270214, upload-time = "2024-10-23T09:47:26.156Z" }, + { url = "https://files.pythonhosted.org/packages/a1/58/0642d061d5de779f39c50cbb00df49682832923f3d2ebfb0fedf02d05f7f/frozenlist-1.5.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:12f78f98c2f1c2429d42e6a485f433722b0061d5c0b0139efa64f396efb5886b", size = 273905, upload-time = "2024-10-23T09:47:27.741Z" }, + { url = "https://files.pythonhosted.org/packages/ab/66/3fe0f5f8f2add5b4ab7aa4e199f767fd3b55da26e3ca4ce2cc36698e50c4/frozenlist-1.5.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ce3aa154c452d2467487765e3adc730a8c153af77ad84096bc19ce19a2400840", size = 250542, upload-time = "2024-10-23T09:47:28.938Z" }, + { url = "https://files.pythonhosted.org/packages/f6/b8/260791bde9198c87a465224e0e2bb62c4e716f5d198fc3a1dacc4895dbd1/frozenlist-1.5.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9b7dc0c4338e6b8b091e8faf0db3168a37101943e687f373dce00959583f7439", size = 267026, upload-time = "2024-10-23T09:47:30.283Z" }, + { url = "https://files.pythonhosted.org/packages/2e/a4/3d24f88c527f08f8d44ade24eaee83b2627793fa62fa07cbb7ff7a2f7d42/frozenlist-1.5.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:45e0896250900b5aa25180f9aec243e84e92ac84bd4a74d9ad4138ef3f5c97de", size = 257690, upload-time = "2024-10-23T09:47:32.388Z" }, + { url = "https://files.pythonhosted.org/packages/de/9a/d311d660420b2beeff3459b6626f2ab4fb236d07afbdac034a4371fe696e/frozenlist-1.5.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:561eb1c9579d495fddb6da8959fd2a1fca2c6d060d4113f5844b433fc02f2641", size = 253893, upload-time = "2024-10-23T09:47:34.274Z" }, + { url = "https://files.pythonhosted.org/packages/c6/23/e491aadc25b56eabd0f18c53bb19f3cdc6de30b2129ee0bc39cd387cd560/frozenlist-1.5.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:df6e2f325bfee1f49f81aaac97d2aa757c7646534a06f8f577ce184afe2f0a9e", size = 267006, upload-time = "2024-10-23T09:47:35.499Z" }, + { url = "https://files.pythonhosted.org/packages/08/c4/ab918ce636a35fb974d13d666dcbe03969592aeca6c3ab3835acff01f79c/frozenlist-1.5.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:140228863501b44b809fb39ec56b5d4071f4d0aa6d216c19cbb08b8c5a7eadb9", size = 276157, upload-time = "2024-10-23T09:47:37.522Z" }, + { url = "https://files.pythonhosted.org/packages/c0/29/3b7a0bbbbe5a34833ba26f686aabfe982924adbdcafdc294a7a129c31688/frozenlist-1.5.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:7707a25d6a77f5d27ea7dc7d1fc608aa0a478193823f88511ef5e6b8a48f9d03", size = 264642, upload-time = "2024-10-23T09:47:38.75Z" }, + { url = "https://files.pythonhosted.org/packages/ab/42/0595b3dbffc2e82d7fe658c12d5a5bafcd7516c6bf2d1d1feb5387caa9c1/frozenlist-1.5.0-cp313-cp313-win32.whl", hash = "sha256:31a9ac2b38ab9b5a8933b693db4939764ad3f299fcaa931a3e605bc3460e693c", size = 44914, upload-time = "2024-10-23T09:47:40.145Z" }, + { url = "https://files.pythonhosted.org/packages/17/c4/b7db1206a3fea44bf3b838ca61deb6f74424a8a5db1dd53ecb21da669be6/frozenlist-1.5.0-cp313-cp313-win_amd64.whl", hash = "sha256:11aabdd62b8b9c4b84081a3c246506d1cddd2dd93ff0ad53ede5defec7886b28", size = 51167, upload-time = "2024-10-23T09:47:41.812Z" }, + { url = "https://files.pythonhosted.org/packages/33/b5/00fcbe8e7e7e172829bf4addc8227d8f599a3d5def3a4e9aa2b54b3145aa/frozenlist-1.5.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:dd94994fc91a6177bfaafd7d9fd951bc8689b0a98168aa26b5f543868548d3ca", size = 95648, upload-time = "2024-10-23T09:47:43.118Z" }, + { url = "https://files.pythonhosted.org/packages/1e/69/e4a32fc4b2fa8e9cb6bcb1bad9c7eeb4b254bc34da475b23f93264fdc306/frozenlist-1.5.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2d0da8bbec082bf6bf18345b180958775363588678f64998c2b7609e34719b10", size = 54888, upload-time = "2024-10-23T09:47:44.832Z" }, + { url = "https://files.pythonhosted.org/packages/76/a3/c08322a91e73d1199901a77ce73971cffa06d3c74974270ff97aed6e152a/frozenlist-1.5.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:73f2e31ea8dd7df61a359b731716018c2be196e5bb3b74ddba107f694fbd7604", size = 52975, upload-time = "2024-10-23T09:47:46.579Z" }, + { url = "https://files.pythonhosted.org/packages/fc/60/a315321d8ada167b578ff9d2edc147274ead6129523b3a308501b6621b4f/frozenlist-1.5.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:828afae9f17e6de596825cf4228ff28fbdf6065974e5ac1410cecc22f699d2b3", size = 241912, upload-time = "2024-10-23T09:47:47.687Z" }, + { url = "https://files.pythonhosted.org/packages/bd/d0/1f0980987bca4f94f9e8bae01980b23495ffc2e5049a3da4d9b7d2762bee/frozenlist-1.5.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f1577515d35ed5649d52ab4319db757bb881ce3b2b796d7283e6634d99ace307", size = 259433, upload-time = "2024-10-23T09:47:49.339Z" }, + { url = "https://files.pythonhosted.org/packages/28/e7/d00600c072eec8f18a606e281afdf0e8606e71a4882104d0438429b02468/frozenlist-1.5.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2150cc6305a2c2ab33299453e2968611dacb970d2283a14955923062c8d00b10", size = 255576, upload-time = "2024-10-23T09:47:50.519Z" }, + { url = "https://files.pythonhosted.org/packages/82/71/993c5f45dba7be347384ddec1ebc1b4d998291884e7690c06aa6ba755211/frozenlist-1.5.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a72b7a6e3cd2725eff67cd64c8f13335ee18fc3c7befc05aed043d24c7b9ccb9", size = 233349, upload-time = "2024-10-23T09:47:53.197Z" }, + { url = "https://files.pythonhosted.org/packages/66/30/f9c006223feb2ac87f1826b57f2367b60aacc43092f562dab60d2312562e/frozenlist-1.5.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c16d2fa63e0800723139137d667e1056bee1a1cf7965153d2d104b62855e9b99", size = 243126, upload-time = "2024-10-23T09:47:54.432Z" }, + { url = "https://files.pythonhosted.org/packages/b5/34/e4219c9343f94b81068d0018cbe37948e66c68003b52bf8a05e9509d09ec/frozenlist-1.5.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:17dcc32fc7bda7ce5875435003220a457bcfa34ab7924a49a1c19f55b6ee185c", size = 241261, upload-time = "2024-10-23T09:47:56.01Z" }, + { url = "https://files.pythonhosted.org/packages/48/96/9141758f6a19f2061a51bb59b9907c92f9bda1ac7b2baaf67a6e352b280f/frozenlist-1.5.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:97160e245ea33d8609cd2b8fd997c850b56db147a304a262abc2b3be021a9171", size = 240203, upload-time = "2024-10-23T09:47:57.337Z" }, + { url = "https://files.pythonhosted.org/packages/f9/71/0ef5970e68d181571a050958e84c76a061ca52f9c6f50257d9bfdd84c7f7/frozenlist-1.5.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:f1e6540b7fa044eee0bb5111ada694cf3dc15f2b0347ca125ee9ca984d5e9e6e", size = 267539, upload-time = "2024-10-23T09:47:58.874Z" }, + { url = "https://files.pythonhosted.org/packages/ab/bd/6e7d450c5d993b413591ad9cdab6dcdfa2c6ab2cd835b2b5c1cfeb0323bf/frozenlist-1.5.0-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:91d6c171862df0a6c61479d9724f22efb6109111017c87567cfeb7b5d1449fdf", size = 268518, upload-time = "2024-10-23T09:48:00.771Z" }, + { url = "https://files.pythonhosted.org/packages/cc/3d/5a7c4dfff1ae57ca2cbbe9041521472ecd9446d49e7044a0e9bfd0200fd0/frozenlist-1.5.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:c1fac3e2ace2eb1052e9f7c7db480818371134410e1f5c55d65e8f3ac6d1407e", size = 248114, upload-time = "2024-10-23T09:48:02.625Z" }, + { url = "https://files.pythonhosted.org/packages/f7/41/2342ec4c714349793f1a1e7bd5c4aeec261e24e697fa9a5499350c3a2415/frozenlist-1.5.0-cp38-cp38-win32.whl", hash = "sha256:b97f7b575ab4a8af9b7bc1d2ef7f29d3afee2226bd03ca3875c16451ad5a7723", size = 45648, upload-time = "2024-10-23T09:48:03.895Z" }, + { url = "https://files.pythonhosted.org/packages/0c/90/85bb3547c327f5975078c1be018478d5e8d250a540c828f8f31a35d2a1bd/frozenlist-1.5.0-cp38-cp38-win_amd64.whl", hash = "sha256:374ca2dabdccad8e2a76d40b1d037f5bd16824933bf7bcea3e59c891fd4a0923", size = 51930, upload-time = "2024-10-23T09:48:05.293Z" }, + { url = "https://files.pythonhosted.org/packages/da/4d/d94ff0fb0f5313902c132817c62d19cdc5bdcd0c195d392006ef4b779fc6/frozenlist-1.5.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:9bbcdfaf4af7ce002694a4e10a0159d5a8d20056a12b05b45cea944a4953f972", size = 95319, upload-time = "2024-10-23T09:48:06.405Z" }, + { url = "https://files.pythonhosted.org/packages/8c/1b/d90e554ca2b483d31cb2296e393f72c25bdc38d64526579e95576bfda587/frozenlist-1.5.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1893f948bf6681733aaccf36c5232c231e3b5166d607c5fa77773611df6dc336", size = 54749, upload-time = "2024-10-23T09:48:07.48Z" }, + { url = "https://files.pythonhosted.org/packages/f8/66/7fdecc9ef49f8db2aa4d9da916e4ecf357d867d87aea292efc11e1b2e932/frozenlist-1.5.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2b5e23253bb709ef57a8e95e6ae48daa9ac5f265637529e4ce6b003a37b2621f", size = 52718, upload-time = "2024-10-23T09:48:08.725Z" }, + { url = "https://files.pythonhosted.org/packages/08/04/e2fddc92135276e07addbc1cf413acffa0c2d848b3e54cacf684e146df49/frozenlist-1.5.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0f253985bb515ecd89629db13cb58d702035ecd8cfbca7d7a7e29a0e6d39af5f", size = 241756, upload-time = "2024-10-23T09:48:09.843Z" }, + { url = "https://files.pythonhosted.org/packages/c6/52/be5ff200815d8a341aee5b16b6b707355e0ca3652953852238eb92b120c2/frozenlist-1.5.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:04a5c6babd5e8fb7d3c871dc8b321166b80e41b637c31a995ed844a6139942b6", size = 267718, upload-time = "2024-10-23T09:48:11.828Z" }, + { url = "https://files.pythonhosted.org/packages/88/be/4bd93a58be57a3722fc544c36debdf9dcc6758f761092e894d78f18b8f20/frozenlist-1.5.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a9fe0f1c29ba24ba6ff6abf688cb0b7cf1efab6b6aa6adc55441773c252f7411", size = 263494, upload-time = "2024-10-23T09:48:13.424Z" }, + { url = "https://files.pythonhosted.org/packages/32/ba/58348b90193caa096ce9e9befea6ae67f38dabfd3aacb47e46137a6250a8/frozenlist-1.5.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:226d72559fa19babe2ccd920273e767c96a49b9d3d38badd7c91a0fdeda8ea08", size = 232838, upload-time = "2024-10-23T09:48:14.792Z" }, + { url = "https://files.pythonhosted.org/packages/f6/33/9f152105227630246135188901373c4f322cc026565ca6215b063f4c82f4/frozenlist-1.5.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15b731db116ab3aedec558573c1a5eec78822b32292fe4f2f0345b7f697745c2", size = 242912, upload-time = "2024-10-23T09:48:16.249Z" }, + { url = "https://files.pythonhosted.org/packages/a0/10/3db38fb3ccbafadd80a1b0d6800c987b0e3fe3ef2d117c6ced0246eea17a/frozenlist-1.5.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:366d8f93e3edfe5a918c874702f78faac300209a4d5bf38352b2c1bdc07a766d", size = 244763, upload-time = "2024-10-23T09:48:17.781Z" }, + { url = "https://files.pythonhosted.org/packages/e2/cd/1df468fdce2f66a4608dffe44c40cdc35eeaa67ef7fd1d813f99a9a37842/frozenlist-1.5.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:1b96af8c582b94d381a1c1f51ffaedeb77c821c690ea5f01da3d70a487dd0a9b", size = 242841, upload-time = "2024-10-23T09:48:19.507Z" }, + { url = "https://files.pythonhosted.org/packages/ee/5f/16097a5ca0bb6b6779c02cc9379c72fe98d56115d4c54d059fb233168fb6/frozenlist-1.5.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:c03eff4a41bd4e38415cbed054bbaff4a075b093e2394b6915dca34a40d1e38b", size = 263407, upload-time = "2024-10-23T09:48:21.467Z" }, + { url = "https://files.pythonhosted.org/packages/0f/f7/58cd220ee1c2248ee65a32f5b4b93689e3fe1764d85537eee9fc392543bc/frozenlist-1.5.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:50cf5e7ee9b98f22bdecbabf3800ae78ddcc26e4a435515fc72d97903e8488e0", size = 265083, upload-time = "2024-10-23T09:48:22.725Z" }, + { url = "https://files.pythonhosted.org/packages/62/b8/49768980caabf81ac4a2d156008f7cbd0107e6b36d08a313bb31035d9201/frozenlist-1.5.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:1e76bfbc72353269c44e0bc2cfe171900fbf7f722ad74c9a7b638052afe6a00c", size = 251564, upload-time = "2024-10-23T09:48:24.272Z" }, + { url = "https://files.pythonhosted.org/packages/cb/83/619327da3b86ef957ee7a0cbf3c166a09ed1e87a3f7f1ff487d7d0284683/frozenlist-1.5.0-cp39-cp39-win32.whl", hash = "sha256:666534d15ba8f0fda3f53969117383d5dc021266b3c1a42c9ec4855e4b58b9d3", size = 45691, upload-time = "2024-10-23T09:48:26.317Z" }, + { url = "https://files.pythonhosted.org/packages/8b/28/407bc34a745151ed2322c690b6e7d83d7101472e81ed76e1ebdac0b70a78/frozenlist-1.5.0-cp39-cp39-win_amd64.whl", hash = "sha256:5c28f4b5dbef8a0d8aad0d4de24d1e9e981728628afaf4ea0792f5d0939372f0", size = 51767, upload-time = "2024-10-23T09:48:27.427Z" }, + { url = "https://files.pythonhosted.org/packages/c6/c8/a5be5b7550c10858fcf9b0ea054baccab474da77d37f1e828ce043a3a5d4/frozenlist-1.5.0-py3-none-any.whl", hash = "sha256:d994863bba198a4a518b467bb971c56e1db3f180a25c6cf7bb1949c267f748c3", size = 11901, upload-time = "2024-10-23T09:48:28.851Z" }, +] + +[[package]] +name = "frozenlist" +version = "1.7.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.9'", +] +sdist = { url = "https://files.pythonhosted.org/packages/79/b1/b64018016eeb087db503b038296fd782586432b9c077fc5c7839e9cb6ef6/frozenlist-1.7.0.tar.gz", hash = "sha256:2e310d81923c2437ea8670467121cc3e9b0f76d3043cc1d2331d56c7fb7a3a8f", size = 45078, upload-time = "2025-06-09T23:02:35.538Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/af/36/0da0a49409f6b47cc2d060dc8c9040b897b5902a8a4e37d9bc1deb11f680/frozenlist-1.7.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:cc4df77d638aa2ed703b878dd093725b72a824c3c546c076e8fdf276f78ee84a", size = 81304, upload-time = "2025-06-09T22:59:46.226Z" }, + { url = "https://files.pythonhosted.org/packages/77/f0/77c11d13d39513b298e267b22eb6cb559c103d56f155aa9a49097221f0b6/frozenlist-1.7.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:716a9973a2cc963160394f701964fe25012600f3d311f60c790400b00e568b61", size = 47735, upload-time = "2025-06-09T22:59:48.133Z" }, + { url = "https://files.pythonhosted.org/packages/37/12/9d07fa18971a44150593de56b2f2947c46604819976784bcf6ea0d5db43b/frozenlist-1.7.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a0fd1bad056a3600047fb9462cff4c5322cebc59ebf5d0a3725e0ee78955001d", size = 46775, upload-time = "2025-06-09T22:59:49.564Z" }, + { url = "https://files.pythonhosted.org/packages/70/34/f73539227e06288fcd1f8a76853e755b2b48bca6747e99e283111c18bcd4/frozenlist-1.7.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3789ebc19cb811163e70fe2bd354cea097254ce6e707ae42e56f45e31e96cb8e", size = 224644, upload-time = "2025-06-09T22:59:51.35Z" }, + { url = "https://files.pythonhosted.org/packages/fb/68/c1d9c2f4a6e438e14613bad0f2973567586610cc22dcb1e1241da71de9d3/frozenlist-1.7.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:af369aa35ee34f132fcfad5be45fbfcde0e3a5f6a1ec0712857f286b7d20cca9", size = 222125, upload-time = "2025-06-09T22:59:52.884Z" }, + { url = "https://files.pythonhosted.org/packages/b9/d0/98e8f9a515228d708344d7c6986752be3e3192d1795f748c24bcf154ad99/frozenlist-1.7.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ac64b6478722eeb7a3313d494f8342ef3478dff539d17002f849101b212ef97c", size = 233455, upload-time = "2025-06-09T22:59:54.74Z" }, + { url = "https://files.pythonhosted.org/packages/79/df/8a11bcec5600557f40338407d3e5bea80376ed1c01a6c0910fcfdc4b8993/frozenlist-1.7.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f89f65d85774f1797239693cef07ad4c97fdd0639544bad9ac4b869782eb1981", size = 227339, upload-time = "2025-06-09T22:59:56.187Z" }, + { url = "https://files.pythonhosted.org/packages/50/82/41cb97d9c9a5ff94438c63cc343eb7980dac4187eb625a51bdfdb7707314/frozenlist-1.7.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1073557c941395fdfcfac13eb2456cb8aad89f9de27bae29fabca8e563b12615", size = 212969, upload-time = "2025-06-09T22:59:57.604Z" }, + { url = "https://files.pythonhosted.org/packages/13/47/f9179ee5ee4f55629e4f28c660b3fdf2775c8bfde8f9c53f2de2d93f52a9/frozenlist-1.7.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1ed8d2fa095aae4bdc7fdd80351009a48d286635edffee66bf865e37a9125c50", size = 222862, upload-time = "2025-06-09T22:59:59.498Z" }, + { url = "https://files.pythonhosted.org/packages/1a/52/df81e41ec6b953902c8b7e3a83bee48b195cb0e5ec2eabae5d8330c78038/frozenlist-1.7.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:24c34bea555fe42d9f928ba0a740c553088500377448febecaa82cc3e88aa1fa", size = 222492, upload-time = "2025-06-09T23:00:01.026Z" }, + { url = "https://files.pythonhosted.org/packages/84/17/30d6ea87fa95a9408245a948604b82c1a4b8b3e153cea596421a2aef2754/frozenlist-1.7.0-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:69cac419ac6a6baad202c85aaf467b65ac860ac2e7f2ac1686dc40dbb52f6577", size = 238250, upload-time = "2025-06-09T23:00:03.401Z" }, + { url = "https://files.pythonhosted.org/packages/8f/00/ecbeb51669e3c3df76cf2ddd66ae3e48345ec213a55e3887d216eb4fbab3/frozenlist-1.7.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:960d67d0611f4c87da7e2ae2eacf7ea81a5be967861e0c63cf205215afbfac59", size = 218720, upload-time = "2025-06-09T23:00:05.282Z" }, + { url = "https://files.pythonhosted.org/packages/1a/c0/c224ce0e0eb31cc57f67742071bb470ba8246623c1823a7530be0e76164c/frozenlist-1.7.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:41be2964bd4b15bf575e5daee5a5ce7ed3115320fb3c2b71fca05582ffa4dc9e", size = 232585, upload-time = "2025-06-09T23:00:07.962Z" }, + { url = "https://files.pythonhosted.org/packages/55/3c/34cb694abf532f31f365106deebdeac9e45c19304d83cf7d51ebbb4ca4d1/frozenlist-1.7.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:46d84d49e00c9429238a7ce02dc0be8f6d7cd0cd405abd1bebdc991bf27c15bd", size = 234248, upload-time = "2025-06-09T23:00:09.428Z" }, + { url = "https://files.pythonhosted.org/packages/98/c0/2052d8b6cecda2e70bd81299e3512fa332abb6dcd2969b9c80dfcdddbf75/frozenlist-1.7.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:15900082e886edb37480335d9d518cec978afc69ccbc30bd18610b7c1b22a718", size = 221621, upload-time = "2025-06-09T23:00:11.32Z" }, + { url = "https://files.pythonhosted.org/packages/c5/bf/7dcebae315436903b1d98ffb791a09d674c88480c158aa171958a3ac07f0/frozenlist-1.7.0-cp310-cp310-win32.whl", hash = "sha256:400ddd24ab4e55014bba442d917203c73b2846391dd42ca5e38ff52bb18c3c5e", size = 39578, upload-time = "2025-06-09T23:00:13.526Z" }, + { url = "https://files.pythonhosted.org/packages/8f/5f/f69818f017fa9a3d24d1ae39763e29b7f60a59e46d5f91b9c6b21622f4cd/frozenlist-1.7.0-cp310-cp310-win_amd64.whl", hash = "sha256:6eb93efb8101ef39d32d50bce242c84bcbddb4f7e9febfa7b524532a239b4464", size = 43830, upload-time = "2025-06-09T23:00:14.98Z" }, + { url = "https://files.pythonhosted.org/packages/34/7e/803dde33760128acd393a27eb002f2020ddb8d99d30a44bfbaab31c5f08a/frozenlist-1.7.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:aa51e147a66b2d74de1e6e2cf5921890de6b0f4820b257465101d7f37b49fb5a", size = 82251, upload-time = "2025-06-09T23:00:16.279Z" }, + { url = "https://files.pythonhosted.org/packages/75/a9/9c2c5760b6ba45eae11334db454c189d43d34a4c0b489feb2175e5e64277/frozenlist-1.7.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:9b35db7ce1cd71d36ba24f80f0c9e7cff73a28d7a74e91fe83e23d27c7828750", size = 48183, upload-time = "2025-06-09T23:00:17.698Z" }, + { url = "https://files.pythonhosted.org/packages/47/be/4038e2d869f8a2da165f35a6befb9158c259819be22eeaf9c9a8f6a87771/frozenlist-1.7.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:34a69a85e34ff37791e94542065c8416c1afbf820b68f720452f636d5fb990cd", size = 47107, upload-time = "2025-06-09T23:00:18.952Z" }, + { url = "https://files.pythonhosted.org/packages/79/26/85314b8a83187c76a37183ceed886381a5f992975786f883472fcb6dc5f2/frozenlist-1.7.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4a646531fa8d82c87fe4bb2e596f23173caec9185bfbca5d583b4ccfb95183e2", size = 237333, upload-time = "2025-06-09T23:00:20.275Z" }, + { url = "https://files.pythonhosted.org/packages/1f/fd/e5b64f7d2c92a41639ffb2ad44a6a82f347787abc0c7df5f49057cf11770/frozenlist-1.7.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:79b2ffbba483f4ed36a0f236ccb85fbb16e670c9238313709638167670ba235f", size = 231724, upload-time = "2025-06-09T23:00:21.705Z" }, + { url = "https://files.pythonhosted.org/packages/20/fb/03395c0a43a5976af4bf7534759d214405fbbb4c114683f434dfdd3128ef/frozenlist-1.7.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a26f205c9ca5829cbf82bb2a84b5c36f7184c4316617d7ef1b271a56720d6b30", size = 245842, upload-time = "2025-06-09T23:00:23.148Z" }, + { url = "https://files.pythonhosted.org/packages/d0/15/c01c8e1dffdac5d9803507d824f27aed2ba76b6ed0026fab4d9866e82f1f/frozenlist-1.7.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bcacfad3185a623fa11ea0e0634aac7b691aa925d50a440f39b458e41c561d98", size = 239767, upload-time = "2025-06-09T23:00:25.103Z" }, + { url = "https://files.pythonhosted.org/packages/14/99/3f4c6fe882c1f5514b6848aa0a69b20cb5e5d8e8f51a339d48c0e9305ed0/frozenlist-1.7.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:72c1b0fe8fe451b34f12dce46445ddf14bd2a5bcad7e324987194dc8e3a74c86", size = 224130, upload-time = "2025-06-09T23:00:27.061Z" }, + { url = "https://files.pythonhosted.org/packages/4d/83/220a374bd7b2aeba9d0725130665afe11de347d95c3620b9b82cc2fcab97/frozenlist-1.7.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:61d1a5baeaac6c0798ff6edfaeaa00e0e412d49946c53fae8d4b8e8b3566c4ae", size = 235301, upload-time = "2025-06-09T23:00:29.02Z" }, + { url = "https://files.pythonhosted.org/packages/03/3c/3e3390d75334a063181625343e8daab61b77e1b8214802cc4e8a1bb678fc/frozenlist-1.7.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:7edf5c043c062462f09b6820de9854bf28cc6cc5b6714b383149745e287181a8", size = 234606, upload-time = "2025-06-09T23:00:30.514Z" }, + { url = "https://files.pythonhosted.org/packages/23/1e/58232c19608b7a549d72d9903005e2d82488f12554a32de2d5fb59b9b1ba/frozenlist-1.7.0-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:d50ac7627b3a1bd2dcef6f9da89a772694ec04d9a61b66cf87f7d9446b4a0c31", size = 248372, upload-time = "2025-06-09T23:00:31.966Z" }, + { url = "https://files.pythonhosted.org/packages/c0/a4/e4a567e01702a88a74ce8a324691e62a629bf47d4f8607f24bf1c7216e7f/frozenlist-1.7.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:ce48b2fece5aeb45265bb7a58259f45027db0abff478e3077e12b05b17fb9da7", size = 229860, upload-time = "2025-06-09T23:00:33.375Z" }, + { url = "https://files.pythonhosted.org/packages/73/a6/63b3374f7d22268b41a9db73d68a8233afa30ed164c46107b33c4d18ecdd/frozenlist-1.7.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:fe2365ae915a1fafd982c146754e1de6ab3478def8a59c86e1f7242d794f97d5", size = 245893, upload-time = "2025-06-09T23:00:35.002Z" }, + { url = "https://files.pythonhosted.org/packages/6d/eb/d18b3f6e64799a79673c4ba0b45e4cfbe49c240edfd03a68be20002eaeaa/frozenlist-1.7.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:45a6f2fdbd10e074e8814eb98b05292f27bad7d1883afbe009d96abdcf3bc898", size = 246323, upload-time = "2025-06-09T23:00:36.468Z" }, + { url = "https://files.pythonhosted.org/packages/5a/f5/720f3812e3d06cd89a1d5db9ff6450088b8f5c449dae8ffb2971a44da506/frozenlist-1.7.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:21884e23cffabb157a9dd7e353779077bf5b8f9a58e9b262c6caad2ef5f80a56", size = 233149, upload-time = "2025-06-09T23:00:37.963Z" }, + { url = "https://files.pythonhosted.org/packages/69/68/03efbf545e217d5db8446acfd4c447c15b7c8cf4dbd4a58403111df9322d/frozenlist-1.7.0-cp311-cp311-win32.whl", hash = "sha256:284d233a8953d7b24f9159b8a3496fc1ddc00f4db99c324bd5fb5f22d8698ea7", size = 39565, upload-time = "2025-06-09T23:00:39.753Z" }, + { url = "https://files.pythonhosted.org/packages/58/17/fe61124c5c333ae87f09bb67186d65038834a47d974fc10a5fadb4cc5ae1/frozenlist-1.7.0-cp311-cp311-win_amd64.whl", hash = "sha256:387cbfdcde2f2353f19c2f66bbb52406d06ed77519ac7ee21be0232147c2592d", size = 44019, upload-time = "2025-06-09T23:00:40.988Z" }, + { url = "https://files.pythonhosted.org/packages/ef/a2/c8131383f1e66adad5f6ecfcce383d584ca94055a34d683bbb24ac5f2f1c/frozenlist-1.7.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:3dbf9952c4bb0e90e98aec1bd992b3318685005702656bc6f67c1a32b76787f2", size = 81424, upload-time = "2025-06-09T23:00:42.24Z" }, + { url = "https://files.pythonhosted.org/packages/4c/9d/02754159955088cb52567337d1113f945b9e444c4960771ea90eb73de8db/frozenlist-1.7.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:1f5906d3359300b8a9bb194239491122e6cf1444c2efb88865426f170c262cdb", size = 47952, upload-time = "2025-06-09T23:00:43.481Z" }, + { url = "https://files.pythonhosted.org/packages/01/7a/0046ef1bd6699b40acd2067ed6d6670b4db2f425c56980fa21c982c2a9db/frozenlist-1.7.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:3dabd5a8f84573c8d10d8859a50ea2dec01eea372031929871368c09fa103478", size = 46688, upload-time = "2025-06-09T23:00:44.793Z" }, + { url = "https://files.pythonhosted.org/packages/d6/a2/a910bafe29c86997363fb4c02069df4ff0b5bc39d33c5198b4e9dd42d8f8/frozenlist-1.7.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aa57daa5917f1738064f302bf2626281a1cb01920c32f711fbc7bc36111058a8", size = 243084, upload-time = "2025-06-09T23:00:46.125Z" }, + { url = "https://files.pythonhosted.org/packages/64/3e/5036af9d5031374c64c387469bfcc3af537fc0f5b1187d83a1cf6fab1639/frozenlist-1.7.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c193dda2b6d49f4c4398962810fa7d7c78f032bf45572b3e04dd5249dff27e08", size = 233524, upload-time = "2025-06-09T23:00:47.73Z" }, + { url = "https://files.pythonhosted.org/packages/06/39/6a17b7c107a2887e781a48ecf20ad20f1c39d94b2a548c83615b5b879f28/frozenlist-1.7.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bfe2b675cf0aaa6d61bf8fbffd3c274b3c9b7b1623beb3809df8a81399a4a9c4", size = 248493, upload-time = "2025-06-09T23:00:49.742Z" }, + { url = "https://files.pythonhosted.org/packages/be/00/711d1337c7327d88c44d91dd0f556a1c47fb99afc060ae0ef66b4d24793d/frozenlist-1.7.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8fc5d5cda37f62b262405cf9652cf0856839c4be8ee41be0afe8858f17f4c94b", size = 244116, upload-time = "2025-06-09T23:00:51.352Z" }, + { url = "https://files.pythonhosted.org/packages/24/fe/74e6ec0639c115df13d5850e75722750adabdc7de24e37e05a40527ca539/frozenlist-1.7.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b0d5ce521d1dd7d620198829b87ea002956e4319002ef0bc8d3e6d045cb4646e", size = 224557, upload-time = "2025-06-09T23:00:52.855Z" }, + { url = "https://files.pythonhosted.org/packages/8d/db/48421f62a6f77c553575201e89048e97198046b793f4a089c79a6e3268bd/frozenlist-1.7.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:488d0a7d6a0008ca0db273c542098a0fa9e7dfaa7e57f70acef43f32b3f69dca", size = 241820, upload-time = "2025-06-09T23:00:54.43Z" }, + { url = "https://files.pythonhosted.org/packages/1d/fa/cb4a76bea23047c8462976ea7b7a2bf53997a0ca171302deae9d6dd12096/frozenlist-1.7.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:15a7eaba63983d22c54d255b854e8108e7e5f3e89f647fc854bd77a237e767df", size = 236542, upload-time = "2025-06-09T23:00:56.409Z" }, + { url = "https://files.pythonhosted.org/packages/5d/32/476a4b5cfaa0ec94d3f808f193301debff2ea42288a099afe60757ef6282/frozenlist-1.7.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:1eaa7e9c6d15df825bf255649e05bd8a74b04a4d2baa1ae46d9c2d00b2ca2cb5", size = 249350, upload-time = "2025-06-09T23:00:58.468Z" }, + { url = "https://files.pythonhosted.org/packages/8d/ba/9a28042f84a6bf8ea5dbc81cfff8eaef18d78b2a1ad9d51c7bc5b029ad16/frozenlist-1.7.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:e4389e06714cfa9d47ab87f784a7c5be91d3934cd6e9a7b85beef808297cc025", size = 225093, upload-time = "2025-06-09T23:01:00.015Z" }, + { url = "https://files.pythonhosted.org/packages/bc/29/3a32959e68f9cf000b04e79ba574527c17e8842e38c91d68214a37455786/frozenlist-1.7.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:73bd45e1488c40b63fe5a7df892baf9e2a4d4bb6409a2b3b78ac1c6236178e01", size = 245482, upload-time = "2025-06-09T23:01:01.474Z" }, + { url = "https://files.pythonhosted.org/packages/80/e8/edf2f9e00da553f07f5fa165325cfc302dead715cab6ac8336a5f3d0adc2/frozenlist-1.7.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:99886d98e1643269760e5fe0df31e5ae7050788dd288947f7f007209b8c33f08", size = 249590, upload-time = "2025-06-09T23:01:02.961Z" }, + { url = "https://files.pythonhosted.org/packages/1c/80/9a0eb48b944050f94cc51ee1c413eb14a39543cc4f760ed12657a5a3c45a/frozenlist-1.7.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:290a172aae5a4c278c6da8a96222e6337744cd9c77313efe33d5670b9f65fc43", size = 237785, upload-time = "2025-06-09T23:01:05.095Z" }, + { url = "https://files.pythonhosted.org/packages/f3/74/87601e0fb0369b7a2baf404ea921769c53b7ae00dee7dcfe5162c8c6dbf0/frozenlist-1.7.0-cp312-cp312-win32.whl", hash = "sha256:426c7bc70e07cfebc178bc4c2bf2d861d720c4fff172181eeb4a4c41d4ca2ad3", size = 39487, upload-time = "2025-06-09T23:01:06.54Z" }, + { url = "https://files.pythonhosted.org/packages/0b/15/c026e9a9fc17585a9d461f65d8593d281fedf55fbf7eb53f16c6df2392f9/frozenlist-1.7.0-cp312-cp312-win_amd64.whl", hash = "sha256:563b72efe5da92e02eb68c59cb37205457c977aa7a449ed1b37e6939e5c47c6a", size = 43874, upload-time = "2025-06-09T23:01:07.752Z" }, + { url = "https://files.pythonhosted.org/packages/24/90/6b2cebdabdbd50367273c20ff6b57a3dfa89bd0762de02c3a1eb42cb6462/frozenlist-1.7.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ee80eeda5e2a4e660651370ebffd1286542b67e268aa1ac8d6dbe973120ef7ee", size = 79791, upload-time = "2025-06-09T23:01:09.368Z" }, + { url = "https://files.pythonhosted.org/packages/83/2e/5b70b6a3325363293fe5fc3ae74cdcbc3e996c2a11dde2fd9f1fb0776d19/frozenlist-1.7.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:d1a81c85417b914139e3a9b995d4a1c84559afc839a93cf2cb7f15e6e5f6ed2d", size = 47165, upload-time = "2025-06-09T23:01:10.653Z" }, + { url = "https://files.pythonhosted.org/packages/f4/25/a0895c99270ca6966110f4ad98e87e5662eab416a17e7fd53c364bf8b954/frozenlist-1.7.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:cbb65198a9132ebc334f237d7b0df163e4de83fb4f2bdfe46c1e654bdb0c5d43", size = 45881, upload-time = "2025-06-09T23:01:12.296Z" }, + { url = "https://files.pythonhosted.org/packages/19/7c/71bb0bbe0832793c601fff68cd0cf6143753d0c667f9aec93d3c323f4b55/frozenlist-1.7.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dab46c723eeb2c255a64f9dc05b8dd601fde66d6b19cdb82b2e09cc6ff8d8b5d", size = 232409, upload-time = "2025-06-09T23:01:13.641Z" }, + { url = "https://files.pythonhosted.org/packages/c0/45/ed2798718910fe6eb3ba574082aaceff4528e6323f9a8570be0f7028d8e9/frozenlist-1.7.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:6aeac207a759d0dedd2e40745575ae32ab30926ff4fa49b1635def65806fddee", size = 225132, upload-time = "2025-06-09T23:01:15.264Z" }, + { url = "https://files.pythonhosted.org/packages/ba/e2/8417ae0f8eacb1d071d4950f32f229aa6bf68ab69aab797b72a07ea68d4f/frozenlist-1.7.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bd8c4e58ad14b4fa7802b8be49d47993182fdd4023393899632c88fd8cd994eb", size = 237638, upload-time = "2025-06-09T23:01:16.752Z" }, + { url = "https://files.pythonhosted.org/packages/f8/b7/2ace5450ce85f2af05a871b8c8719b341294775a0a6c5585d5e6170f2ce7/frozenlist-1.7.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:04fb24d104f425da3540ed83cbfc31388a586a7696142004c577fa61c6298c3f", size = 233539, upload-time = "2025-06-09T23:01:18.202Z" }, + { url = "https://files.pythonhosted.org/packages/46/b9/6989292c5539553dba63f3c83dc4598186ab2888f67c0dc1d917e6887db6/frozenlist-1.7.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6a5c505156368e4ea6b53b5ac23c92d7edc864537ff911d2fb24c140bb175e60", size = 215646, upload-time = "2025-06-09T23:01:19.649Z" }, + { url = "https://files.pythonhosted.org/packages/72/31/bc8c5c99c7818293458fe745dab4fd5730ff49697ccc82b554eb69f16a24/frozenlist-1.7.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8bd7eb96a675f18aa5c553eb7ddc24a43c8c18f22e1f9925528128c052cdbe00", size = 232233, upload-time = "2025-06-09T23:01:21.175Z" }, + { url = "https://files.pythonhosted.org/packages/59/52/460db4d7ba0811b9ccb85af996019f5d70831f2f5f255f7cc61f86199795/frozenlist-1.7.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:05579bf020096fe05a764f1f84cd104a12f78eaab68842d036772dc6d4870b4b", size = 227996, upload-time = "2025-06-09T23:01:23.098Z" }, + { url = "https://files.pythonhosted.org/packages/ba/c9/f4b39e904c03927b7ecf891804fd3b4df3db29b9e487c6418e37988d6e9d/frozenlist-1.7.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:376b6222d114e97eeec13d46c486facd41d4f43bab626b7c3f6a8b4e81a5192c", size = 242280, upload-time = "2025-06-09T23:01:24.808Z" }, + { url = "https://files.pythonhosted.org/packages/b8/33/3f8d6ced42f162d743e3517781566b8481322be321b486d9d262adf70bfb/frozenlist-1.7.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:0aa7e176ebe115379b5b1c95b4096fb1c17cce0847402e227e712c27bdb5a949", size = 217717, upload-time = "2025-06-09T23:01:26.28Z" }, + { url = "https://files.pythonhosted.org/packages/3e/e8/ad683e75da6ccef50d0ab0c2b2324b32f84fc88ceee778ed79b8e2d2fe2e/frozenlist-1.7.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:3fbba20e662b9c2130dc771e332a99eff5da078b2b2648153a40669a6d0e36ca", size = 236644, upload-time = "2025-06-09T23:01:27.887Z" }, + { url = "https://files.pythonhosted.org/packages/b2/14/8d19ccdd3799310722195a72ac94ddc677541fb4bef4091d8e7775752360/frozenlist-1.7.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:f3f4410a0a601d349dd406b5713fec59b4cee7e71678d5b17edda7f4655a940b", size = 238879, upload-time = "2025-06-09T23:01:29.524Z" }, + { url = "https://files.pythonhosted.org/packages/ce/13/c12bf657494c2fd1079a48b2db49fa4196325909249a52d8f09bc9123fd7/frozenlist-1.7.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e2cdfaaec6a2f9327bf43c933c0319a7c429058e8537c508964a133dffee412e", size = 232502, upload-time = "2025-06-09T23:01:31.287Z" }, + { url = "https://files.pythonhosted.org/packages/d7/8b/e7f9dfde869825489382bc0d512c15e96d3964180c9499efcec72e85db7e/frozenlist-1.7.0-cp313-cp313-win32.whl", hash = "sha256:5fc4df05a6591c7768459caba1b342d9ec23fa16195e744939ba5914596ae3e1", size = 39169, upload-time = "2025-06-09T23:01:35.503Z" }, + { url = "https://files.pythonhosted.org/packages/35/89/a487a98d94205d85745080a37860ff5744b9820a2c9acbcdd9440bfddf98/frozenlist-1.7.0-cp313-cp313-win_amd64.whl", hash = "sha256:52109052b9791a3e6b5d1b65f4b909703984b770694d3eb64fad124c835d7cba", size = 43219, upload-time = "2025-06-09T23:01:36.784Z" }, + { url = "https://files.pythonhosted.org/packages/56/d5/5c4cf2319a49eddd9dd7145e66c4866bdc6f3dbc67ca3d59685149c11e0d/frozenlist-1.7.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:a6f86e4193bb0e235ef6ce3dde5cbabed887e0b11f516ce8a0f4d3b33078ec2d", size = 84345, upload-time = "2025-06-09T23:01:38.295Z" }, + { url = "https://files.pythonhosted.org/packages/a4/7d/ec2c1e1dc16b85bc9d526009961953df9cec8481b6886debb36ec9107799/frozenlist-1.7.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:82d664628865abeb32d90ae497fb93df398a69bb3434463d172b80fc25b0dd7d", size = 48880, upload-time = "2025-06-09T23:01:39.887Z" }, + { url = "https://files.pythonhosted.org/packages/69/86/f9596807b03de126e11e7d42ac91e3d0b19a6599c714a1989a4e85eeefc4/frozenlist-1.7.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:912a7e8375a1c9a68325a902f3953191b7b292aa3c3fb0d71a216221deca460b", size = 48498, upload-time = "2025-06-09T23:01:41.318Z" }, + { url = "https://files.pythonhosted.org/packages/5e/cb/df6de220f5036001005f2d726b789b2c0b65f2363b104bbc16f5be8084f8/frozenlist-1.7.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9537c2777167488d539bc5de2ad262efc44388230e5118868e172dd4a552b146", size = 292296, upload-time = "2025-06-09T23:01:42.685Z" }, + { url = "https://files.pythonhosted.org/packages/83/1f/de84c642f17c8f851a2905cee2dae401e5e0daca9b5ef121e120e19aa825/frozenlist-1.7.0-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:f34560fb1b4c3e30ba35fa9a13894ba39e5acfc5f60f57d8accde65f46cc5e74", size = 273103, upload-time = "2025-06-09T23:01:44.166Z" }, + { url = "https://files.pythonhosted.org/packages/88/3c/c840bfa474ba3fa13c772b93070893c6e9d5c0350885760376cbe3b6c1b3/frozenlist-1.7.0-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:acd03d224b0175f5a850edc104ac19040d35419eddad04e7cf2d5986d98427f1", size = 292869, upload-time = "2025-06-09T23:01:45.681Z" }, + { url = "https://files.pythonhosted.org/packages/a6/1c/3efa6e7d5a39a1d5ef0abeb51c48fb657765794a46cf124e5aca2c7a592c/frozenlist-1.7.0-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f2038310bc582f3d6a09b3816ab01737d60bf7b1ec70f5356b09e84fb7408ab1", size = 291467, upload-time = "2025-06-09T23:01:47.234Z" }, + { url = "https://files.pythonhosted.org/packages/4f/00/d5c5e09d4922c395e2f2f6b79b9a20dab4b67daaf78ab92e7729341f61f6/frozenlist-1.7.0-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b8c05e4c8e5f36e5e088caa1bf78a687528f83c043706640a92cb76cd6999384", size = 266028, upload-time = "2025-06-09T23:01:48.819Z" }, + { url = "https://files.pythonhosted.org/packages/4e/27/72765be905619dfde25a7f33813ac0341eb6b076abede17a2e3fbfade0cb/frozenlist-1.7.0-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:765bb588c86e47d0b68f23c1bee323d4b703218037765dcf3f25c838c6fecceb", size = 284294, upload-time = "2025-06-09T23:01:50.394Z" }, + { url = "https://files.pythonhosted.org/packages/88/67/c94103a23001b17808eb7dd1200c156bb69fb68e63fcf0693dde4cd6228c/frozenlist-1.7.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:32dc2e08c67d86d0969714dd484fd60ff08ff81d1a1e40a77dd34a387e6ebc0c", size = 281898, upload-time = "2025-06-09T23:01:52.234Z" }, + { url = "https://files.pythonhosted.org/packages/42/34/a3e2c00c00f9e2a9db5653bca3fec306349e71aff14ae45ecc6d0951dd24/frozenlist-1.7.0-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:c0303e597eb5a5321b4de9c68e9845ac8f290d2ab3f3e2c864437d3c5a30cd65", size = 290465, upload-time = "2025-06-09T23:01:53.788Z" }, + { url = "https://files.pythonhosted.org/packages/bb/73/f89b7fbce8b0b0c095d82b008afd0590f71ccb3dee6eee41791cf8cd25fd/frozenlist-1.7.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:a47f2abb4e29b3a8d0b530f7c3598badc6b134562b1a5caee867f7c62fee51e3", size = 266385, upload-time = "2025-06-09T23:01:55.769Z" }, + { url = "https://files.pythonhosted.org/packages/cd/45/e365fdb554159462ca12df54bc59bfa7a9a273ecc21e99e72e597564d1ae/frozenlist-1.7.0-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:3d688126c242a6fabbd92e02633414d40f50bb6002fa4cf995a1d18051525657", size = 288771, upload-time = "2025-06-09T23:01:57.4Z" }, + { url = "https://files.pythonhosted.org/packages/00/11/47b6117002a0e904f004d70ec5194fe9144f117c33c851e3d51c765962d0/frozenlist-1.7.0-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:4e7e9652b3d367c7bd449a727dc79d5043f48b88d0cbfd4f9f1060cf2b414104", size = 288206, upload-time = "2025-06-09T23:01:58.936Z" }, + { url = "https://files.pythonhosted.org/packages/40/37/5f9f3c3fd7f7746082ec67bcdc204db72dad081f4f83a503d33220a92973/frozenlist-1.7.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:1a85e345b4c43db8b842cab1feb41be5cc0b10a1830e6295b69d7310f99becaf", size = 282620, upload-time = "2025-06-09T23:02:00.493Z" }, + { url = "https://files.pythonhosted.org/packages/0b/31/8fbc5af2d183bff20f21aa743b4088eac4445d2bb1cdece449ae80e4e2d1/frozenlist-1.7.0-cp313-cp313t-win32.whl", hash = "sha256:3a14027124ddb70dfcee5148979998066897e79f89f64b13328595c4bdf77c81", size = 43059, upload-time = "2025-06-09T23:02:02.072Z" }, + { url = "https://files.pythonhosted.org/packages/bb/ed/41956f52105b8dbc26e457c5705340c67c8cc2b79f394b79bffc09d0e938/frozenlist-1.7.0-cp313-cp313t-win_amd64.whl", hash = "sha256:3bf8010d71d4507775f658e9823210b7427be36625b387221642725b515dcf3e", size = 47516, upload-time = "2025-06-09T23:02:03.779Z" }, + { url = "https://files.pythonhosted.org/packages/dd/b1/ee59496f51cd244039330015d60f13ce5a54a0f2bd8d79e4a4a375ab7469/frozenlist-1.7.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:cea3dbd15aea1341ea2de490574a4a37ca080b2ae24e4b4f4b51b9057b4c3630", size = 82434, upload-time = "2025-06-09T23:02:05.195Z" }, + { url = "https://files.pythonhosted.org/packages/75/e1/d518391ce36a6279b3fa5bc14327dde80bcb646bb50d059c6ca0756b8d05/frozenlist-1.7.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7d536ee086b23fecc36c2073c371572374ff50ef4db515e4e503925361c24f71", size = 48232, upload-time = "2025-06-09T23:02:07.728Z" }, + { url = "https://files.pythonhosted.org/packages/b7/8d/a0d04f28b6e821a9685c22e67b5fb798a5a7b68752f104bfbc2dccf080c4/frozenlist-1.7.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:dfcebf56f703cb2e346315431699f00db126d158455e513bd14089d992101e44", size = 47186, upload-time = "2025-06-09T23:02:09.243Z" }, + { url = "https://files.pythonhosted.org/packages/93/3a/a5334c0535c8b7c78eeabda1579179e44fe3d644e07118e59a2276dedaf1/frozenlist-1.7.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:974c5336e61d6e7eb1ea5b929cb645e882aadab0095c5a6974a111e6479f8878", size = 226617, upload-time = "2025-06-09T23:02:10.949Z" }, + { url = "https://files.pythonhosted.org/packages/0a/67/8258d971f519dc3f278c55069a775096cda6610a267b53f6248152b72b2f/frozenlist-1.7.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c70db4a0ab5ab20878432c40563573229a7ed9241506181bba12f6b7d0dc41cb", size = 224179, upload-time = "2025-06-09T23:02:12.603Z" }, + { url = "https://files.pythonhosted.org/packages/fc/89/8225905bf889b97c6d935dd3aeb45668461e59d415cb019619383a8a7c3b/frozenlist-1.7.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1137b78384eebaf70560a36b7b229f752fb64d463d38d1304939984d5cb887b6", size = 235783, upload-time = "2025-06-09T23:02:14.678Z" }, + { url = "https://files.pythonhosted.org/packages/54/6e/ef52375aa93d4bc510d061df06205fa6dcfd94cd631dd22956b09128f0d4/frozenlist-1.7.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e793a9f01b3e8b5c0bc646fb59140ce0efcc580d22a3468d70766091beb81b35", size = 229210, upload-time = "2025-06-09T23:02:16.313Z" }, + { url = "https://files.pythonhosted.org/packages/ee/55/62c87d1a6547bfbcd645df10432c129100c5bd0fd92a384de6e3378b07c1/frozenlist-1.7.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:74739ba8e4e38221d2c5c03d90a7e542cb8ad681915f4ca8f68d04f810ee0a87", size = 215994, upload-time = "2025-06-09T23:02:17.9Z" }, + { url = "https://files.pythonhosted.org/packages/45/d2/263fea1f658b8ad648c7d94d18a87bca7e8c67bd6a1bbf5445b1bd5b158c/frozenlist-1.7.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1e63344c4e929b1a01e29bc184bbb5fd82954869033765bfe8d65d09e336a677", size = 225122, upload-time = "2025-06-09T23:02:19.479Z" }, + { url = "https://files.pythonhosted.org/packages/7b/22/7145e35d12fb368d92124f679bea87309495e2e9ddf14c6533990cb69218/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2ea2a7369eb76de2217a842f22087913cdf75f63cf1307b9024ab82dfb525938", size = 224019, upload-time = "2025-06-09T23:02:20.969Z" }, + { url = "https://files.pythonhosted.org/packages/44/1e/7dae8c54301beb87bcafc6144b9a103bfd2c8f38078c7902984c9a0c4e5b/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:836b42f472a0e006e02499cef9352ce8097f33df43baaba3e0a28a964c26c7d2", size = 239925, upload-time = "2025-06-09T23:02:22.466Z" }, + { url = "https://files.pythonhosted.org/packages/4b/1e/99c93e54aa382e949a98976a73b9b20c3aae6d9d893f31bbe4991f64e3a8/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:e22b9a99741294b2571667c07d9f8cceec07cb92aae5ccda39ea1b6052ed4319", size = 220881, upload-time = "2025-06-09T23:02:24.521Z" }, + { url = "https://files.pythonhosted.org/packages/5e/9c/ca5105fa7fb5abdfa8837581be790447ae051da75d32f25c8f81082ffc45/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:9a19e85cc503d958abe5218953df722748d87172f71b73cf3c9257a91b999890", size = 234046, upload-time = "2025-06-09T23:02:26.206Z" }, + { url = "https://files.pythonhosted.org/packages/8d/4d/e99014756093b4ddbb67fb8f0df11fe7a415760d69ace98e2ac6d5d43402/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:f22dac33bb3ee8fe3e013aa7b91dc12f60d61d05b7fe32191ffa84c3aafe77bd", size = 235756, upload-time = "2025-06-09T23:02:27.79Z" }, + { url = "https://files.pythonhosted.org/packages/8b/72/a19a40bcdaa28a51add2aaa3a1a294ec357f36f27bd836a012e070c5e8a5/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:9ccec739a99e4ccf664ea0775149f2749b8a6418eb5b8384b4dc0a7d15d304cb", size = 222894, upload-time = "2025-06-09T23:02:29.848Z" }, + { url = "https://files.pythonhosted.org/packages/08/49/0042469993e023a758af81db68c76907cd29e847d772334d4d201cbe9a42/frozenlist-1.7.0-cp39-cp39-win32.whl", hash = "sha256:b3950f11058310008a87757f3eee16a8e1ca97979833239439586857bc25482e", size = 39848, upload-time = "2025-06-09T23:02:31.413Z" }, + { url = "https://files.pythonhosted.org/packages/5a/45/827d86ee475c877f5f766fbc23fb6acb6fada9e52f1c9720e2ba3eae32da/frozenlist-1.7.0-cp39-cp39-win_amd64.whl", hash = "sha256:43a82fce6769c70f2f5a06248b614a7d268080a9d20f7457ef10ecee5af82b63", size = 44102, upload-time = "2025-06-09T23:02:32.808Z" }, + { url = "https://files.pythonhosted.org/packages/ee/45/b82e3c16be2182bff01179db177fe144d58b5dc787a7d4492c6ed8b9317f/frozenlist-1.7.0-py3-none-any.whl", hash = "sha256:9a5af342e34f7e97caf8c995864c7a396418ae2859cc6fdf1b1073020d516a7e", size = 13106, upload-time = "2025-06-09T23:02:34.204Z" }, +] + +[[package]] +name = "h11" +version = "0.16.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, +] + +[[package]] +name = "httpcore" +version = "1.0.9" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "certifi" }, + { name = "h11" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8", size = 85484, upload-time = "2025-04-24T22:06:22.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55", size = 78784, upload-time = "2025-04-24T22:06:20.566Z" }, +] + +[[package]] +name = "httpx" +version = "0.28.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio", version = "4.5.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "anyio", version = "4.8.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "certifi" }, + { name = "httpcore" }, + { name = "idna" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc", size = 141406, upload-time = "2024-12-06T15:37:23.222Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2a/39/e50c7c3a983047577ee07d2a9e53faf5a69493943ec3f6a384bdc792deb2/httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad", size = 73517, upload-time = "2024-12-06T15:37:21.509Z" }, +] + +[[package]] +name = "httpx-aiohttp" +version = "0.1.8" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "aiohttp", version = "3.10.11", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "aiohttp", version = "3.12.13", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "httpx" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/37/19/ae2d2bf1f57fdd23c8ad83675599fb5c407fa13bc20e90f00cffa4dea3aa/httpx_aiohttp-0.1.8.tar.gz", hash = "sha256:756c5e74cdb568c3248ba63fe82bfe8bbe64b928728720f7eaac64b3cf46f308", size = 25401, upload-time = "2025-07-04T10:40:32.329Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/54/7a/514c484b88cc4ebbcd2e27e92b86019c0c5bb920582f5fbb10b7e6c78574/httpx_aiohttp-0.1.8-py3-none-any.whl", hash = "sha256:b7bd958d1331f3759a38a0ba22ad29832cb63ca69498c17735228055bf78fa7e", size = 6180, upload-time = "2025-07-04T10:40:31.522Z" }, +] + +[[package]] +name = "idna" +version = "3.10" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f1/70/7703c29685631f5a7590aa73f1f1d3fa9a380e654b86af429e0934a32f7d/idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9", size = 190490, upload-time = "2024-09-15T18:07:39.745Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/76/c6/c88e154df9c4e1a2a66ccf0005a88dfb2650c1dffb6f5ce603dfbd452ce3/idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3", size = 70442, upload-time = "2024-09-15T18:07:37.964Z" }, +] + +[[package]] +name = "importlib-metadata" +version = "8.5.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.9'", +] +dependencies = [ + { name = "zipp", version = "3.20.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/cd/12/33e59336dca5be0c398a7482335911a33aa0e20776128f038019f1a95f1b/importlib_metadata-8.5.0.tar.gz", hash = "sha256:71522656f0abace1d072b9e5481a48f07c138e00f079c38c8f883823f9c26bd7", size = 55304, upload-time = "2024-09-11T14:56:08.937Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a0/d9/a1e041c5e7caa9a05c925f4bdbdfb7f006d1f74996af53467bc394c97be7/importlib_metadata-8.5.0-py3-none-any.whl", hash = "sha256:45e54197d28b7a7f1559e60b95e7c567032b602131fbd588f1497f47880aa68b", size = 26514, upload-time = "2024-09-11T14:56:07.019Z" }, +] + +[[package]] +name = "importlib-metadata" +version = "8.6.1" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.9'", +] +dependencies = [ + { name = "zipp", version = "3.21.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/33/08/c1395a292bb23fd03bdf572a1357c5a733d3eecbab877641ceacab23db6e/importlib_metadata-8.6.1.tar.gz", hash = "sha256:310b41d755445d74569f993ccfc22838295d9fe005425094fad953d7f15c8580", size = 55767, upload-time = "2025-01-20T22:21:30.429Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/79/9d/0fb148dc4d6fa4a7dd1d8378168d9b4cd8d4560a6fbf6f0121c5fc34eb68/importlib_metadata-8.6.1-py3-none-any.whl", hash = "sha256:02a89390c1e15fdfdc0d7c6b25cb3e62650d0494005c97d6f148bf5b9787525e", size = 26971, upload-time = "2025-01-20T22:21:29.177Z" }, +] + +[[package]] +name = "iniconfig" +version = "2.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", size = 4646, upload-time = "2023-01-07T11:08:11.254Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374", size = 5892, upload-time = "2023-01-07T11:08:09.864Z" }, +] + +[[package]] +name = "markdown-it-py" +version = "3.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mdurl" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/38/71/3b932df36c1a044d397a1f92d1cf91ee0a503d91e470cbd670aa66b07ed0/markdown-it-py-3.0.0.tar.gz", hash = "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb", size = 74596, upload-time = "2023-06-03T06:41:14.443Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/42/d7/1ec15b46af6af88f19b8e5ffea08fa375d433c998b8a7639e76935c14f1f/markdown_it_py-3.0.0-py3-none-any.whl", hash = "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1", size = 87528, upload-time = "2023-06-03T06:41:11.019Z" }, +] + +[[package]] +name = "mdurl" +version = "0.1.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" }, +] + +[[package]] +name = "multidict" +version = "6.1.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.9'", +] +dependencies = [ + { name = "typing-extensions", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/d6/be/504b89a5e9ca731cd47487e91c469064f8ae5af93b7259758dcfc2b9c848/multidict-6.1.0.tar.gz", hash = "sha256:22ae2ebf9b0c69d206c003e2f6a914ea33f0a932d4aa16f236afc049d9958f4a", size = 64002, upload-time = "2024-09-09T23:49:38.163Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/29/68/259dee7fd14cf56a17c554125e534f6274c2860159692a414d0b402b9a6d/multidict-6.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:3380252550e372e8511d49481bd836264c009adb826b23fefcc5dd3c69692f60", size = 48628, upload-time = "2024-09-09T23:47:18.278Z" }, + { url = "https://files.pythonhosted.org/packages/50/79/53ba256069fe5386a4a9e80d4e12857ced9de295baf3e20c68cdda746e04/multidict-6.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:99f826cbf970077383d7de805c0681799491cb939c25450b9b5b3ced03ca99f1", size = 29327, upload-time = "2024-09-09T23:47:20.224Z" }, + { url = "https://files.pythonhosted.org/packages/ff/10/71f1379b05b196dae749b5ac062e87273e3f11634f447ebac12a571d90ae/multidict-6.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a114d03b938376557927ab23f1e950827c3b893ccb94b62fd95d430fd0e5cf53", size = 29689, upload-time = "2024-09-09T23:47:21.667Z" }, + { url = "https://files.pythonhosted.org/packages/71/45/70bac4f87438ded36ad4793793c0095de6572d433d98575a5752629ef549/multidict-6.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b1c416351ee6271b2f49b56ad7f308072f6f44b37118d69c2cad94f3fa8a40d5", size = 126639, upload-time = "2024-09-09T23:47:23.333Z" }, + { url = "https://files.pythonhosted.org/packages/80/cf/17f35b3b9509b4959303c05379c4bfb0d7dd05c3306039fc79cf035bbac0/multidict-6.1.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6b5d83030255983181005e6cfbac1617ce9746b219bc2aad52201ad121226581", size = 134315, upload-time = "2024-09-09T23:47:24.99Z" }, + { url = "https://files.pythonhosted.org/packages/ef/1f/652d70ab5effb33c031510a3503d4d6efc5ec93153562f1ee0acdc895a57/multidict-6.1.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3e97b5e938051226dc025ec80980c285b053ffb1e25a3db2a3aa3bc046bf7f56", size = 129471, upload-time = "2024-09-09T23:47:26.305Z" }, + { url = "https://files.pythonhosted.org/packages/a6/64/2dd6c4c681688c0165dea3975a6a4eab4944ea30f35000f8b8af1df3148c/multidict-6.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d618649d4e70ac6efcbba75be98b26ef5078faad23592f9b51ca492953012429", size = 124585, upload-time = "2024-09-09T23:47:27.958Z" }, + { url = "https://files.pythonhosted.org/packages/87/56/e6ee5459894c7e554b57ba88f7257dc3c3d2d379cb15baaa1e265b8c6165/multidict-6.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:10524ebd769727ac77ef2278390fb0068d83f3acb7773792a5080f2b0abf7748", size = 116957, upload-time = "2024-09-09T23:47:29.376Z" }, + { url = "https://files.pythonhosted.org/packages/36/9e/616ce5e8d375c24b84f14fc263c7ef1d8d5e8ef529dbc0f1df8ce71bb5b8/multidict-6.1.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:ff3827aef427c89a25cc96ded1759271a93603aba9fb977a6d264648ebf989db", size = 128609, upload-time = "2024-09-09T23:47:31.038Z" }, + { url = "https://files.pythonhosted.org/packages/8c/4f/4783e48a38495d000f2124020dc96bacc806a4340345211b1ab6175a6cb4/multidict-6.1.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:06809f4f0f7ab7ea2cabf9caca7d79c22c0758b58a71f9d32943ae13c7ace056", size = 123016, upload-time = "2024-09-09T23:47:32.47Z" }, + { url = "https://files.pythonhosted.org/packages/3e/b3/4950551ab8fc39862ba5e9907dc821f896aa829b4524b4deefd3e12945ab/multidict-6.1.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:f179dee3b863ab1c59580ff60f9d99f632f34ccb38bf67a33ec6b3ecadd0fd76", size = 133542, upload-time = "2024-09-09T23:47:34.103Z" }, + { url = "https://files.pythonhosted.org/packages/96/4d/f0ce6ac9914168a2a71df117935bb1f1781916acdecbb43285e225b484b8/multidict-6.1.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:aaed8b0562be4a0876ee3b6946f6869b7bcdb571a5d1496683505944e268b160", size = 130163, upload-time = "2024-09-09T23:47:35.716Z" }, + { url = "https://files.pythonhosted.org/packages/be/72/17c9f67e7542a49dd252c5ae50248607dfb780bcc03035907dafefb067e3/multidict-6.1.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:3c8b88a2ccf5493b6c8da9076fb151ba106960a2df90c2633f342f120751a9e7", size = 126832, upload-time = "2024-09-09T23:47:37.116Z" }, + { url = "https://files.pythonhosted.org/packages/71/9f/72d719e248cbd755c8736c6d14780533a1606ffb3fbb0fbd77da9f0372da/multidict-6.1.0-cp310-cp310-win32.whl", hash = "sha256:4a9cb68166a34117d6646c0023c7b759bf197bee5ad4272f420a0141d7eb03a0", size = 26402, upload-time = "2024-09-09T23:47:38.863Z" }, + { url = "https://files.pythonhosted.org/packages/04/5a/d88cd5d00a184e1ddffc82aa2e6e915164a6d2641ed3606e766b5d2f275a/multidict-6.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:20b9b5fbe0b88d0bdef2012ef7dee867f874b72528cf1d08f1d59b0e3850129d", size = 28800, upload-time = "2024-09-09T23:47:40.056Z" }, + { url = "https://files.pythonhosted.org/packages/93/13/df3505a46d0cd08428e4c8169a196131d1b0c4b515c3649829258843dde6/multidict-6.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:3efe2c2cb5763f2f1b275ad2bf7a287d3f7ebbef35648a9726e3b69284a4f3d6", size = 48570, upload-time = "2024-09-09T23:47:41.36Z" }, + { url = "https://files.pythonhosted.org/packages/f0/e1/a215908bfae1343cdb72f805366592bdd60487b4232d039c437fe8f5013d/multidict-6.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c7053d3b0353a8b9de430a4f4b4268ac9a4fb3481af37dfe49825bf45ca24156", size = 29316, upload-time = "2024-09-09T23:47:42.612Z" }, + { url = "https://files.pythonhosted.org/packages/70/0f/6dc70ddf5d442702ed74f298d69977f904960b82368532c88e854b79f72b/multidict-6.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:27e5fc84ccef8dfaabb09d82b7d179c7cf1a3fbc8a966f8274fcb4ab2eb4cadb", size = 29640, upload-time = "2024-09-09T23:47:44.028Z" }, + { url = "https://files.pythonhosted.org/packages/d8/6d/9c87b73a13d1cdea30b321ef4b3824449866bd7f7127eceed066ccb9b9ff/multidict-6.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0e2b90b43e696f25c62656389d32236e049568b39320e2735d51f08fd362761b", size = 131067, upload-time = "2024-09-09T23:47:45.617Z" }, + { url = "https://files.pythonhosted.org/packages/cc/1e/1b34154fef373371fd6c65125b3d42ff5f56c7ccc6bfff91b9b3c60ae9e0/multidict-6.1.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d83a047959d38a7ff552ff94be767b7fd79b831ad1cd9920662db05fec24fe72", size = 138507, upload-time = "2024-09-09T23:47:47.429Z" }, + { url = "https://files.pythonhosted.org/packages/fb/e0/0bc6b2bac6e461822b5f575eae85da6aae76d0e2a79b6665d6206b8e2e48/multidict-6.1.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d1a9dd711d0877a1ece3d2e4fea11a8e75741ca21954c919406b44e7cf971304", size = 133905, upload-time = "2024-09-09T23:47:48.878Z" }, + { url = "https://files.pythonhosted.org/packages/ba/af/73d13b918071ff9b2205fcf773d316e0f8fefb4ec65354bbcf0b10908cc6/multidict-6.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec2abea24d98246b94913b76a125e855eb5c434f7c46546046372fe60f666351", size = 129004, upload-time = "2024-09-09T23:47:50.124Z" }, + { url = "https://files.pythonhosted.org/packages/74/21/23960627b00ed39643302d81bcda44c9444ebcdc04ee5bedd0757513f259/multidict-6.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4867cafcbc6585e4b678876c489b9273b13e9fff9f6d6d66add5e15d11d926cb", size = 121308, upload-time = "2024-09-09T23:47:51.97Z" }, + { url = "https://files.pythonhosted.org/packages/8b/5c/cf282263ffce4a596ed0bb2aa1a1dddfe1996d6a62d08842a8d4b33dca13/multidict-6.1.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:5b48204e8d955c47c55b72779802b219a39acc3ee3d0116d5080c388970b76e3", size = 132608, upload-time = "2024-09-09T23:47:53.201Z" }, + { url = "https://files.pythonhosted.org/packages/d7/3e/97e778c041c72063f42b290888daff008d3ab1427f5b09b714f5a8eff294/multidict-6.1.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:d8fff389528cad1618fb4b26b95550327495462cd745d879a8c7c2115248e399", size = 127029, upload-time = "2024-09-09T23:47:54.435Z" }, + { url = "https://files.pythonhosted.org/packages/47/ac/3efb7bfe2f3aefcf8d103e9a7162572f01936155ab2f7ebcc7c255a23212/multidict-6.1.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:a7a9541cd308eed5e30318430a9c74d2132e9a8cb46b901326272d780bf2d423", size = 137594, upload-time = "2024-09-09T23:47:55.659Z" }, + { url = "https://files.pythonhosted.org/packages/42/9b/6c6e9e8dc4f915fc90a9b7798c44a30773dea2995fdcb619870e705afe2b/multidict-6.1.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:da1758c76f50c39a2efd5e9859ce7d776317eb1dd34317c8152ac9251fc574a3", size = 134556, upload-time = "2024-09-09T23:47:56.98Z" }, + { url = "https://files.pythonhosted.org/packages/1d/10/8e881743b26aaf718379a14ac58572a240e8293a1c9d68e1418fb11c0f90/multidict-6.1.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:c943a53e9186688b45b323602298ab727d8865d8c9ee0b17f8d62d14b56f0753", size = 130993, upload-time = "2024-09-09T23:47:58.163Z" }, + { url = "https://files.pythonhosted.org/packages/45/84/3eb91b4b557442802d058a7579e864b329968c8d0ea57d907e7023c677f2/multidict-6.1.0-cp311-cp311-win32.whl", hash = "sha256:90f8717cb649eea3504091e640a1b8568faad18bd4b9fcd692853a04475a4b80", size = 26405, upload-time = "2024-09-09T23:47:59.391Z" }, + { url = "https://files.pythonhosted.org/packages/9f/0b/ad879847ecbf6d27e90a6eabb7eff6b62c129eefe617ea45eae7c1f0aead/multidict-6.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:82176036e65644a6cc5bd619f65f6f19781e8ec2e5330f51aa9ada7504cc1926", size = 28795, upload-time = "2024-09-09T23:48:00.359Z" }, + { url = "https://files.pythonhosted.org/packages/fd/16/92057c74ba3b96d5e211b553895cd6dc7cc4d1e43d9ab8fafc727681ef71/multidict-6.1.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:b04772ed465fa3cc947db808fa306d79b43e896beb677a56fb2347ca1a49c1fa", size = 48713, upload-time = "2024-09-09T23:48:01.893Z" }, + { url = "https://files.pythonhosted.org/packages/94/3d/37d1b8893ae79716179540b89fc6a0ee56b4a65fcc0d63535c6f5d96f217/multidict-6.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:6180c0ae073bddeb5a97a38c03f30c233e0a4d39cd86166251617d1bbd0af436", size = 29516, upload-time = "2024-09-09T23:48:03.463Z" }, + { url = "https://files.pythonhosted.org/packages/a2/12/adb6b3200c363062f805275b4c1e656be2b3681aada66c80129932ff0bae/multidict-6.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:071120490b47aa997cca00666923a83f02c7fbb44f71cf7f136df753f7fa8761", size = 29557, upload-time = "2024-09-09T23:48:04.905Z" }, + { url = "https://files.pythonhosted.org/packages/47/e9/604bb05e6e5bce1e6a5cf80a474e0f072e80d8ac105f1b994a53e0b28c42/multidict-6.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:50b3a2710631848991d0bf7de077502e8994c804bb805aeb2925a981de58ec2e", size = 130170, upload-time = "2024-09-09T23:48:06.862Z" }, + { url = "https://files.pythonhosted.org/packages/7e/13/9efa50801785eccbf7086b3c83b71a4fb501a4d43549c2f2f80b8787d69f/multidict-6.1.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b58c621844d55e71c1b7f7c498ce5aa6985d743a1a59034c57a905b3f153c1ef", size = 134836, upload-time = "2024-09-09T23:48:08.537Z" }, + { url = "https://files.pythonhosted.org/packages/bf/0f/93808b765192780d117814a6dfcc2e75de6dcc610009ad408b8814dca3ba/multidict-6.1.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:55b6d90641869892caa9ca42ff913f7ff1c5ece06474fbd32fb2cf6834726c95", size = 133475, upload-time = "2024-09-09T23:48:09.865Z" }, + { url = "https://files.pythonhosted.org/packages/d3/c8/529101d7176fe7dfe1d99604e48d69c5dfdcadb4f06561f465c8ef12b4df/multidict-6.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4b820514bfc0b98a30e3d85462084779900347e4d49267f747ff54060cc33925", size = 131049, upload-time = "2024-09-09T23:48:11.115Z" }, + { url = "https://files.pythonhosted.org/packages/ca/0c/fc85b439014d5a58063e19c3a158a889deec399d47b5269a0f3b6a2e28bc/multidict-6.1.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:10a9b09aba0c5b48c53761b7c720aaaf7cf236d5fe394cd399c7ba662d5f9966", size = 120370, upload-time = "2024-09-09T23:48:12.78Z" }, + { url = "https://files.pythonhosted.org/packages/db/46/d4416eb20176492d2258fbd47b4abe729ff3b6e9c829ea4236f93c865089/multidict-6.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1e16bf3e5fc9f44632affb159d30a437bfe286ce9e02754759be5536b169b305", size = 125178, upload-time = "2024-09-09T23:48:14.295Z" }, + { url = "https://files.pythonhosted.org/packages/5b/46/73697ad7ec521df7de5531a32780bbfd908ded0643cbe457f981a701457c/multidict-6.1.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:76f364861c3bfc98cbbcbd402d83454ed9e01a5224bb3a28bf70002a230f73e2", size = 119567, upload-time = "2024-09-09T23:48:16.284Z" }, + { url = "https://files.pythonhosted.org/packages/cd/ed/51f060e2cb0e7635329fa6ff930aa5cffa17f4c7f5c6c3ddc3500708e2f2/multidict-6.1.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:820c661588bd01a0aa62a1283f20d2be4281b086f80dad9e955e690c75fb54a2", size = 129822, upload-time = "2024-09-09T23:48:17.835Z" }, + { url = "https://files.pythonhosted.org/packages/df/9e/ee7d1954b1331da3eddea0c4e08d9142da5f14b1321c7301f5014f49d492/multidict-6.1.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:0e5f362e895bc5b9e67fe6e4ded2492d8124bdf817827f33c5b46c2fe3ffaca6", size = 128656, upload-time = "2024-09-09T23:48:19.576Z" }, + { url = "https://files.pythonhosted.org/packages/77/00/8538f11e3356b5d95fa4b024aa566cde7a38aa7a5f08f4912b32a037c5dc/multidict-6.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:3ec660d19bbc671e3a6443325f07263be452c453ac9e512f5eb935e7d4ac28b3", size = 125360, upload-time = "2024-09-09T23:48:20.957Z" }, + { url = "https://files.pythonhosted.org/packages/be/05/5d334c1f2462d43fec2363cd00b1c44c93a78c3925d952e9a71caf662e96/multidict-6.1.0-cp312-cp312-win32.whl", hash = "sha256:58130ecf8f7b8112cdb841486404f1282b9c86ccb30d3519faf301b2e5659133", size = 26382, upload-time = "2024-09-09T23:48:22.351Z" }, + { url = "https://files.pythonhosted.org/packages/a3/bf/f332a13486b1ed0496d624bcc7e8357bb8053823e8cd4b9a18edc1d97e73/multidict-6.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:188215fc0aafb8e03341995e7c4797860181562380f81ed0a87ff455b70bf1f1", size = 28529, upload-time = "2024-09-09T23:48:23.478Z" }, + { url = "https://files.pythonhosted.org/packages/22/67/1c7c0f39fe069aa4e5d794f323be24bf4d33d62d2a348acdb7991f8f30db/multidict-6.1.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:d569388c381b24671589335a3be6e1d45546c2988c2ebe30fdcada8457a31008", size = 48771, upload-time = "2024-09-09T23:48:24.594Z" }, + { url = "https://files.pythonhosted.org/packages/3c/25/c186ee7b212bdf0df2519eacfb1981a017bda34392c67542c274651daf23/multidict-6.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:052e10d2d37810b99cc170b785945421141bf7bb7d2f8799d431e7db229c385f", size = 29533, upload-time = "2024-09-09T23:48:26.187Z" }, + { url = "https://files.pythonhosted.org/packages/67/5e/04575fd837e0958e324ca035b339cea174554f6f641d3fb2b4f2e7ff44a2/multidict-6.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f90c822a402cb865e396a504f9fc8173ef34212a342d92e362ca498cad308e28", size = 29595, upload-time = "2024-09-09T23:48:27.305Z" }, + { url = "https://files.pythonhosted.org/packages/d3/b2/e56388f86663810c07cfe4a3c3d87227f3811eeb2d08450b9e5d19d78876/multidict-6.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b225d95519a5bf73860323e633a664b0d85ad3d5bede6d30d95b35d4dfe8805b", size = 130094, upload-time = "2024-09-09T23:48:28.544Z" }, + { url = "https://files.pythonhosted.org/packages/6c/ee/30ae9b4186a644d284543d55d491fbd4239b015d36b23fea43b4c94f7052/multidict-6.1.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:23bfd518810af7de1116313ebd9092cb9aa629beb12f6ed631ad53356ed6b86c", size = 134876, upload-time = "2024-09-09T23:48:30.098Z" }, + { url = "https://files.pythonhosted.org/packages/84/c7/70461c13ba8ce3c779503c70ec9d0345ae84de04521c1f45a04d5f48943d/multidict-6.1.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5c09fcfdccdd0b57867577b719c69e347a436b86cd83747f179dbf0cc0d4c1f3", size = 133500, upload-time = "2024-09-09T23:48:31.793Z" }, + { url = "https://files.pythonhosted.org/packages/4a/9f/002af221253f10f99959561123fae676148dd730e2daa2cd053846a58507/multidict-6.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bf6bea52ec97e95560af5ae576bdac3aa3aae0b6758c6efa115236d9e07dae44", size = 131099, upload-time = "2024-09-09T23:48:33.193Z" }, + { url = "https://files.pythonhosted.org/packages/82/42/d1c7a7301d52af79d88548a97e297f9d99c961ad76bbe6f67442bb77f097/multidict-6.1.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:57feec87371dbb3520da6192213c7d6fc892d5589a93db548331954de8248fd2", size = 120403, upload-time = "2024-09-09T23:48:34.942Z" }, + { url = "https://files.pythonhosted.org/packages/68/f3/471985c2c7ac707547553e8f37cff5158030d36bdec4414cb825fbaa5327/multidict-6.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0c3f390dc53279cbc8ba976e5f8035eab997829066756d811616b652b00a23a3", size = 125348, upload-time = "2024-09-09T23:48:36.222Z" }, + { url = "https://files.pythonhosted.org/packages/67/2c/e6df05c77e0e433c214ec1d21ddd203d9a4770a1f2866a8ca40a545869a0/multidict-6.1.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:59bfeae4b25ec05b34f1956eaa1cb38032282cd4dfabc5056d0a1ec4d696d3aa", size = 119673, upload-time = "2024-09-09T23:48:37.588Z" }, + { url = "https://files.pythonhosted.org/packages/c5/cd/bc8608fff06239c9fb333f9db7743a1b2eafe98c2666c9a196e867a3a0a4/multidict-6.1.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:b2f59caeaf7632cc633b5cf6fc449372b83bbdf0da4ae04d5be36118e46cc0aa", size = 129927, upload-time = "2024-09-09T23:48:39.128Z" }, + { url = "https://files.pythonhosted.org/packages/44/8e/281b69b7bc84fc963a44dc6e0bbcc7150e517b91df368a27834299a526ac/multidict-6.1.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:37bb93b2178e02b7b618893990941900fd25b6b9ac0fa49931a40aecdf083fe4", size = 128711, upload-time = "2024-09-09T23:48:40.55Z" }, + { url = "https://files.pythonhosted.org/packages/12/a4/63e7cd38ed29dd9f1881d5119f272c898ca92536cdb53ffe0843197f6c85/multidict-6.1.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4e9f48f58c2c523d5a06faea47866cd35b32655c46b443f163d08c6d0ddb17d6", size = 125519, upload-time = "2024-09-09T23:48:42.446Z" }, + { url = "https://files.pythonhosted.org/packages/38/e0/4f5855037a72cd8a7a2f60a3952d9aa45feedb37ae7831642102604e8a37/multidict-6.1.0-cp313-cp313-win32.whl", hash = "sha256:3a37ffb35399029b45c6cc33640a92bef403c9fd388acce75cdc88f58bd19a81", size = 26426, upload-time = "2024-09-09T23:48:43.936Z" }, + { url = "https://files.pythonhosted.org/packages/7e/a5/17ee3a4db1e310b7405f5d25834460073a8ccd86198ce044dfaf69eac073/multidict-6.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:e9aa71e15d9d9beaad2c6b9319edcdc0a49a43ef5c0a4c8265ca9ee7d6c67774", size = 28531, upload-time = "2024-09-09T23:48:45.122Z" }, + { url = "https://files.pythonhosted.org/packages/3e/6a/af41f3aaf5f00fd86cc7d470a2f5b25299b0c84691163b8757f4a1a205f2/multidict-6.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:db7457bac39421addd0c8449933ac32d8042aae84a14911a757ae6ca3eef1392", size = 48597, upload-time = "2024-09-09T23:48:46.391Z" }, + { url = "https://files.pythonhosted.org/packages/d9/d6/3d4082760ed11b05734f8bf32a0615b99e7d9d2b3730ad698a4d7377c00a/multidict-6.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d094ddec350a2fb899fec68d8353c78233debde9b7d8b4beeafa70825f1c281a", size = 29338, upload-time = "2024-09-09T23:48:47.891Z" }, + { url = "https://files.pythonhosted.org/packages/9d/7f/5d1ce7f47d44393d429922910afbe88fcd29ee3069babbb47507a4c3a7ea/multidict-6.1.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:5845c1fd4866bb5dd3125d89b90e57ed3138241540897de748cdf19de8a2fca2", size = 29562, upload-time = "2024-09-09T23:48:49.254Z" }, + { url = "https://files.pythonhosted.org/packages/ce/ec/c425257671af9308a9b626e2e21f7f43841616e4551de94eb3c92aca75b2/multidict-6.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9079dfc6a70abe341f521f78405b8949f96db48da98aeb43f9907f342f627cdc", size = 130980, upload-time = "2024-09-09T23:48:50.606Z" }, + { url = "https://files.pythonhosted.org/packages/d8/d7/d4220ad2633a89b314593e9b85b5bc9287a7c563c7f9108a4a68d9da5374/multidict-6.1.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3914f5aaa0f36d5d60e8ece6a308ee1c9784cd75ec8151062614657a114c4478", size = 136694, upload-time = "2024-09-09T23:48:52.042Z" }, + { url = "https://files.pythonhosted.org/packages/a1/2a/13e554db5830c8d40185a2e22aa8325516a5de9634c3fb2caf3886a829b3/multidict-6.1.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c08be4f460903e5a9d0f76818db3250f12e9c344e79314d1d570fc69d7f4eae4", size = 131616, upload-time = "2024-09-09T23:48:54.283Z" }, + { url = "https://files.pythonhosted.org/packages/2e/a9/83692e37d8152f104333132105b67100aabfb2e96a87f6bed67f566035a7/multidict-6.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d093be959277cb7dee84b801eb1af388b6ad3ca6a6b6bf1ed7585895789d027d", size = 129664, upload-time = "2024-09-09T23:48:55.785Z" }, + { url = "https://files.pythonhosted.org/packages/cc/1c/1718cd518fb9da7e8890d9d1611c1af0ea5e60f68ff415d026e38401ed36/multidict-6.1.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3702ea6872c5a2a4eeefa6ffd36b042e9773f05b1f37ae3ef7264b1163c2dcf6", size = 121855, upload-time = "2024-09-09T23:48:57.333Z" }, + { url = "https://files.pythonhosted.org/packages/2b/92/f6ed67514b0e3894198f0eb42dcde22f0851ea35f4561a1e4acf36c7b1be/multidict-6.1.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:2090f6a85cafc5b2db085124d752757c9d251548cedabe9bd31afe6363e0aff2", size = 127928, upload-time = "2024-09-09T23:48:58.778Z" }, + { url = "https://files.pythonhosted.org/packages/f7/30/c66954115a4dc4dc3c84e02c8ae11bb35a43d79ef93122c3c3a40c4d459b/multidict-6.1.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:f67f217af4b1ff66c68a87318012de788dd95fcfeb24cc889011f4e1c7454dfd", size = 122793, upload-time = "2024-09-09T23:49:00.244Z" }, + { url = "https://files.pythonhosted.org/packages/62/c9/d386d01b43871e8e1631eb7b3695f6af071b7ae1ab716caf371100f0eb24/multidict-6.1.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:189f652a87e876098bbc67b4da1049afb5f5dfbaa310dd67c594b01c10388db6", size = 132762, upload-time = "2024-09-09T23:49:02.188Z" }, + { url = "https://files.pythonhosted.org/packages/69/ff/f70cb0a2f7a358acf48e32139ce3a150ff18c961ee9c714cc8c0dc7e3584/multidict-6.1.0-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:6bb5992037f7a9eff7991ebe4273ea7f51f1c1c511e6a2ce511d0e7bdb754492", size = 127872, upload-time = "2024-09-09T23:49:04.389Z" }, + { url = "https://files.pythonhosted.org/packages/89/5b/abea7db3ba4cd07752a9b560f9275a11787cd13f86849b5d99c1ceea921d/multidict-6.1.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:ac10f4c2b9e770c4e393876e35a7046879d195cd123b4f116d299d442b335bcd", size = 126161, upload-time = "2024-09-09T23:49:06.306Z" }, + { url = "https://files.pythonhosted.org/packages/22/03/acc77a4667cca4462ee974fc39990803e58fa573d5a923d6e82b7ef6da7e/multidict-6.1.0-cp38-cp38-win32.whl", hash = "sha256:e27bbb6d14416713a8bd7aaa1313c0fc8d44ee48d74497a0ff4c3a1b6ccb5167", size = 26338, upload-time = "2024-09-09T23:49:07.782Z" }, + { url = "https://files.pythonhosted.org/packages/90/bf/3d0c1cc9c8163abc24625fae89c0ade1ede9bccb6eceb79edf8cff3cca46/multidict-6.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:22f3105d4fb15c8f57ff3959a58fcab6ce36814486500cd7485651230ad4d4ef", size = 28736, upload-time = "2024-09-09T23:49:09.126Z" }, + { url = "https://files.pythonhosted.org/packages/e7/c9/9e153a6572b38ac5ff4434113af38acf8d5e9957897cdb1f513b3d6614ed/multidict-6.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:4e18b656c5e844539d506a0a06432274d7bd52a7487e6828c63a63d69185626c", size = 48550, upload-time = "2024-09-09T23:49:10.475Z" }, + { url = "https://files.pythonhosted.org/packages/76/f5/79565ddb629eba6c7f704f09a09df085c8dc04643b12506f10f718cee37a/multidict-6.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:a185f876e69897a6f3325c3f19f26a297fa058c5e456bfcff8015e9a27e83ae1", size = 29298, upload-time = "2024-09-09T23:49:12.119Z" }, + { url = "https://files.pythonhosted.org/packages/60/1b/9851878b704bc98e641a3e0bce49382ae9e05743dac6d97748feb5b7baba/multidict-6.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ab7c4ceb38d91570a650dba194e1ca87c2b543488fe9309b4212694174fd539c", size = 29641, upload-time = "2024-09-09T23:49:13.714Z" }, + { url = "https://files.pythonhosted.org/packages/89/87/d451d45aab9e422cb0fb2f7720c31a4c1d3012c740483c37f642eba568fb/multidict-6.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e617fb6b0b6953fffd762669610c1c4ffd05632c138d61ac7e14ad187870669c", size = 126202, upload-time = "2024-09-09T23:49:15.238Z" }, + { url = "https://files.pythonhosted.org/packages/fa/b4/27cbe9f3e2e469359887653f2e45470272eef7295139916cc21107c6b48c/multidict-6.1.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:16e5f4bf4e603eb1fdd5d8180f1a25f30056f22e55ce51fb3d6ad4ab29f7d96f", size = 133925, upload-time = "2024-09-09T23:49:16.786Z" }, + { url = "https://files.pythonhosted.org/packages/4d/a3/afc841899face8adfd004235ce759a37619f6ec99eafd959650c5ce4df57/multidict-6.1.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f4c035da3f544b1882bac24115f3e2e8760f10a0107614fc9839fd232200b875", size = 129039, upload-time = "2024-09-09T23:49:18.381Z" }, + { url = "https://files.pythonhosted.org/packages/5e/41/0d0fb18c1ad574f807196f5f3d99164edf9de3e169a58c6dc2d6ed5742b9/multidict-6.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:957cf8e4b6e123a9eea554fa7ebc85674674b713551de587eb318a2df3e00255", size = 124072, upload-time = "2024-09-09T23:49:20.115Z" }, + { url = "https://files.pythonhosted.org/packages/00/22/defd7a2e71a44e6e5b9a5428f972e5b572e7fe28e404dfa6519bbf057c93/multidict-6.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:483a6aea59cb89904e1ceabd2b47368b5600fb7de78a6e4a2c2987b2d256cf30", size = 116532, upload-time = "2024-09-09T23:49:21.685Z" }, + { url = "https://files.pythonhosted.org/packages/91/25/f7545102def0b1d456ab6449388eed2dfd822debba1d65af60194904a23a/multidict-6.1.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:87701f25a2352e5bf7454caa64757642734da9f6b11384c1f9d1a8e699758057", size = 128173, upload-time = "2024-09-09T23:49:23.657Z" }, + { url = "https://files.pythonhosted.org/packages/45/79/3dbe8d35fc99f5ea610813a72ab55f426cb9cf482f860fa8496e5409be11/multidict-6.1.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:682b987361e5fd7a139ed565e30d81fd81e9629acc7d925a205366877d8c8657", size = 122654, upload-time = "2024-09-09T23:49:25.7Z" }, + { url = "https://files.pythonhosted.org/packages/97/cb/209e735eeab96e1b160825b5d0b36c56d3862abff828fc43999bb957dcad/multidict-6.1.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:ce2186a7df133a9c895dea3331ddc5ddad42cdd0d1ea2f0a51e5d161e4762f28", size = 133197, upload-time = "2024-09-09T23:49:27.906Z" }, + { url = "https://files.pythonhosted.org/packages/e4/3a/a13808a7ada62808afccea67837a79d00ad6581440015ef00f726d064c2d/multidict-6.1.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:9f636b730f7e8cb19feb87094949ba54ee5357440b9658b2a32a5ce4bce53972", size = 129754, upload-time = "2024-09-09T23:49:29.508Z" }, + { url = "https://files.pythonhosted.org/packages/77/dd/8540e139eafb240079242da8f8ffdf9d3f4b4ad1aac5a786cd4050923783/multidict-6.1.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:73eae06aa53af2ea5270cc066dcaf02cc60d2994bbb2c4ef5764949257d10f43", size = 126402, upload-time = "2024-09-09T23:49:31.243Z" }, + { url = "https://files.pythonhosted.org/packages/86/99/e82e1a275d8b1ea16d3a251474262258dbbe41c05cce0c01bceda1fc8ea5/multidict-6.1.0-cp39-cp39-win32.whl", hash = "sha256:1ca0083e80e791cffc6efce7660ad24af66c8d4079d2a750b29001b53ff59ada", size = 26421, upload-time = "2024-09-09T23:49:32.648Z" }, + { url = "https://files.pythonhosted.org/packages/86/1c/9fa630272355af7e4446a2c7550c259f11ee422ab2d30ff90a0a71cf3d9e/multidict-6.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:aa466da5b15ccea564bdab9c89175c762bc12825f4659c11227f515cee76fa4a", size = 28791, upload-time = "2024-09-09T23:49:34.725Z" }, + { url = "https://files.pythonhosted.org/packages/99/b7/b9e70fde2c0f0c9af4cc5277782a89b66d35948ea3369ec9f598358c3ac5/multidict-6.1.0-py3-none-any.whl", hash = "sha256:48e171e52d1c4d33888e529b999e5900356b9ae588c2f09a52dcefb158b27506", size = 10051, upload-time = "2024-09-09T23:49:36.506Z" }, +] + +[[package]] +name = "multidict" +version = "6.6.3" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.9'", +] +dependencies = [ + { name = "typing-extensions", marker = "(python_full_version >= '3.9' and python_full_version < '3.11') or (python_full_version < '3.9' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2') or (python_full_version >= '3.11' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/3d/2c/5dad12e82fbdf7470f29bff2171484bf07cb3b16ada60a6589af8f376440/multidict-6.6.3.tar.gz", hash = "sha256:798a9eb12dab0a6c2e29c1de6f3468af5cb2da6053a20dfa3344907eed0937cc", size = 101006, upload-time = "2025-06-30T15:53:46.929Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0b/67/414933982bce2efce7cbcb3169eaaf901e0f25baec69432b4874dfb1f297/multidict-6.6.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a2be5b7b35271f7fff1397204ba6708365e3d773579fe2a30625e16c4b4ce817", size = 77017, upload-time = "2025-06-30T15:50:58.931Z" }, + { url = "https://files.pythonhosted.org/packages/8a/fe/d8a3ee1fad37dc2ef4f75488b0d9d4f25bf204aad8306cbab63d97bff64a/multidict-6.6.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:12f4581d2930840295c461764b9a65732ec01250b46c6b2c510d7ee68872b140", size = 44897, upload-time = "2025-06-30T15:51:00.999Z" }, + { url = "https://files.pythonhosted.org/packages/1f/e0/265d89af8c98240265d82b8cbcf35897f83b76cd59ee3ab3879050fd8c45/multidict-6.6.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:dd7793bab517e706c9ed9d7310b06c8672fd0aeee5781bfad612f56b8e0f7d14", size = 44574, upload-time = "2025-06-30T15:51:02.449Z" }, + { url = "https://files.pythonhosted.org/packages/e6/05/6b759379f7e8e04ccc97cfb2a5dcc5cdbd44a97f072b2272dc51281e6a40/multidict-6.6.3-cp310-cp310-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:72d8815f2cd3cf3df0f83cac3f3ef801d908b2d90409ae28102e0553af85545a", size = 225729, upload-time = "2025-06-30T15:51:03.794Z" }, + { url = "https://files.pythonhosted.org/packages/4e/f5/8d5a15488edd9a91fa4aad97228d785df208ed6298580883aa3d9def1959/multidict-6.6.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:531e331a2ee53543ab32b16334e2deb26f4e6b9b28e41f8e0c87e99a6c8e2d69", size = 242515, upload-time = "2025-06-30T15:51:05.002Z" }, + { url = "https://files.pythonhosted.org/packages/6e/b5/a8f317d47d0ac5bb746d6d8325885c8967c2a8ce0bb57be5399e3642cccb/multidict-6.6.3-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:42ca5aa9329a63be8dc49040f63817d1ac980e02eeddba763a9ae5b4027b9c9c", size = 222224, upload-time = "2025-06-30T15:51:06.148Z" }, + { url = "https://files.pythonhosted.org/packages/76/88/18b2a0d5e80515fa22716556061189c2853ecf2aa2133081ebbe85ebea38/multidict-6.6.3-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:208b9b9757060b9faa6f11ab4bc52846e4f3c2fb8b14d5680c8aac80af3dc751", size = 253124, upload-time = "2025-06-30T15:51:07.375Z" }, + { url = "https://files.pythonhosted.org/packages/62/bf/ebfcfd6b55a1b05ef16d0775ae34c0fe15e8dab570d69ca9941073b969e7/multidict-6.6.3-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:acf6b97bd0884891af6a8b43d0f586ab2fcf8e717cbd47ab4bdddc09e20652d8", size = 251529, upload-time = "2025-06-30T15:51:08.691Z" }, + { url = "https://files.pythonhosted.org/packages/44/11/780615a98fd3775fc309d0234d563941af69ade2df0bb82c91dda6ddaea1/multidict-6.6.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:68e9e12ed00e2089725669bdc88602b0b6f8d23c0c95e52b95f0bc69f7fe9b55", size = 241627, upload-time = "2025-06-30T15:51:10.605Z" }, + { url = "https://files.pythonhosted.org/packages/28/3d/35f33045e21034b388686213752cabc3a1b9d03e20969e6fa8f1b1d82db1/multidict-6.6.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:05db2f66c9addb10cfa226e1acb363450fab2ff8a6df73c622fefe2f5af6d4e7", size = 239351, upload-time = "2025-06-30T15:51:12.18Z" }, + { url = "https://files.pythonhosted.org/packages/6e/cc/ff84c03b95b430015d2166d9aae775a3985d757b94f6635010d0038d9241/multidict-6.6.3-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:0db58da8eafb514db832a1b44f8fa7906fdd102f7d982025f816a93ba45e3dcb", size = 233429, upload-time = "2025-06-30T15:51:13.533Z" }, + { url = "https://files.pythonhosted.org/packages/2e/f0/8cd49a0b37bdea673a4b793c2093f2f4ba8e7c9d6d7c9bd672fd6d38cd11/multidict-6.6.3-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:14117a41c8fdb3ee19c743b1c027da0736fdb79584d61a766da53d399b71176c", size = 243094, upload-time = "2025-06-30T15:51:14.815Z" }, + { url = "https://files.pythonhosted.org/packages/96/19/5d9a0cfdafe65d82b616a45ae950975820289069f885328e8185e64283c2/multidict-6.6.3-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:877443eaaabcd0b74ff32ebeed6f6176c71850feb7d6a1d2db65945256ea535c", size = 248957, upload-time = "2025-06-30T15:51:16.076Z" }, + { url = "https://files.pythonhosted.org/packages/e6/dc/c90066151da87d1e489f147b9b4327927241e65f1876702fafec6729c014/multidict-6.6.3-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:70b72e749a4f6e7ed8fb334fa8d8496384840319512746a5f42fa0aec79f4d61", size = 243590, upload-time = "2025-06-30T15:51:17.413Z" }, + { url = "https://files.pythonhosted.org/packages/ec/39/458afb0cccbb0ee9164365273be3e039efddcfcb94ef35924b7dbdb05db0/multidict-6.6.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:43571f785b86afd02b3855c5ac8e86ec921b760298d6f82ff2a61daf5a35330b", size = 237487, upload-time = "2025-06-30T15:51:19.039Z" }, + { url = "https://files.pythonhosted.org/packages/35/38/0016adac3990426610a081787011177e661875546b434f50a26319dc8372/multidict-6.6.3-cp310-cp310-win32.whl", hash = "sha256:20c5a0c3c13a15fd5ea86c42311859f970070e4e24de5a550e99d7c271d76318", size = 41390, upload-time = "2025-06-30T15:51:20.362Z" }, + { url = "https://files.pythonhosted.org/packages/f3/d2/17897a8f3f2c5363d969b4c635aa40375fe1f09168dc09a7826780bfb2a4/multidict-6.6.3-cp310-cp310-win_amd64.whl", hash = "sha256:ab0a34a007704c625e25a9116c6770b4d3617a071c8a7c30cd338dfbadfe6485", size = 45954, upload-time = "2025-06-30T15:51:21.383Z" }, + { url = "https://files.pythonhosted.org/packages/2d/5f/d4a717c1e457fe44072e33fa400d2b93eb0f2819c4d669381f925b7cba1f/multidict-6.6.3-cp310-cp310-win_arm64.whl", hash = "sha256:769841d70ca8bdd140a715746199fc6473414bd02efd678d75681d2d6a8986c5", size = 42981, upload-time = "2025-06-30T15:51:22.809Z" }, + { url = "https://files.pythonhosted.org/packages/08/f0/1a39863ced51f639c81a5463fbfa9eb4df59c20d1a8769ab9ef4ca57ae04/multidict-6.6.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:18f4eba0cbac3546b8ae31e0bbc55b02c801ae3cbaf80c247fcdd89b456ff58c", size = 76445, upload-time = "2025-06-30T15:51:24.01Z" }, + { url = "https://files.pythonhosted.org/packages/c9/0e/a7cfa451c7b0365cd844e90b41e21fab32edaa1e42fc0c9f68461ce44ed7/multidict-6.6.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ef43b5dd842382329e4797c46f10748d8c2b6e0614f46b4afe4aee9ac33159df", size = 44610, upload-time = "2025-06-30T15:51:25.158Z" }, + { url = "https://files.pythonhosted.org/packages/c6/bb/a14a4efc5ee748cc1904b0748be278c31b9295ce5f4d2ef66526f410b94d/multidict-6.6.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:bf9bd1fd5eec01494e0f2e8e446a74a85d5e49afb63d75a9934e4a5423dba21d", size = 44267, upload-time = "2025-06-30T15:51:26.326Z" }, + { url = "https://files.pythonhosted.org/packages/c2/f8/410677d563c2d55e063ef74fe578f9d53fe6b0a51649597a5861f83ffa15/multidict-6.6.3-cp311-cp311-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:5bd8d6f793a787153956cd35e24f60485bf0651c238e207b9a54f7458b16d539", size = 230004, upload-time = "2025-06-30T15:51:27.491Z" }, + { url = "https://files.pythonhosted.org/packages/fd/df/2b787f80059314a98e1ec6a4cc7576244986df3e56b3c755e6fc7c99e038/multidict-6.6.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1bf99b4daf908c73856bd87ee0a2499c3c9a3d19bb04b9c6025e66af3fd07462", size = 247196, upload-time = "2025-06-30T15:51:28.762Z" }, + { url = "https://files.pythonhosted.org/packages/05/f2/f9117089151b9a8ab39f9019620d10d9718eec2ac89e7ca9d30f3ec78e96/multidict-6.6.3-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0b9e59946b49dafaf990fd9c17ceafa62976e8471a14952163d10a7a630413a9", size = 225337, upload-time = "2025-06-30T15:51:30.025Z" }, + { url = "https://files.pythonhosted.org/packages/93/2d/7115300ec5b699faa152c56799b089a53ed69e399c3c2d528251f0aeda1a/multidict-6.6.3-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e2db616467070d0533832d204c54eea6836a5e628f2cb1e6dfd8cd6ba7277cb7", size = 257079, upload-time = "2025-06-30T15:51:31.716Z" }, + { url = "https://files.pythonhosted.org/packages/15/ea/ff4bab367623e39c20d3b07637225c7688d79e4f3cc1f3b9f89867677f9a/multidict-6.6.3-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:7394888236621f61dcdd25189b2768ae5cc280f041029a5bcf1122ac63df79f9", size = 255461, upload-time = "2025-06-30T15:51:33.029Z" }, + { url = "https://files.pythonhosted.org/packages/74/07/2c9246cda322dfe08be85f1b8739646f2c4c5113a1422d7a407763422ec4/multidict-6.6.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f114d8478733ca7388e7c7e0ab34b72547476b97009d643644ac33d4d3fe1821", size = 246611, upload-time = "2025-06-30T15:51:34.47Z" }, + { url = "https://files.pythonhosted.org/packages/a8/62/279c13d584207d5697a752a66ffc9bb19355a95f7659140cb1b3cf82180e/multidict-6.6.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:cdf22e4db76d323bcdc733514bf732e9fb349707c98d341d40ebcc6e9318ef3d", size = 243102, upload-time = "2025-06-30T15:51:36.525Z" }, + { url = "https://files.pythonhosted.org/packages/69/cc/e06636f48c6d51e724a8bc8d9e1db5f136fe1df066d7cafe37ef4000f86a/multidict-6.6.3-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:e995a34c3d44ab511bfc11aa26869b9d66c2d8c799fa0e74b28a473a692532d6", size = 238693, upload-time = "2025-06-30T15:51:38.278Z" }, + { url = "https://files.pythonhosted.org/packages/89/a4/66c9d8fb9acf3b226cdd468ed009537ac65b520aebdc1703dd6908b19d33/multidict-6.6.3-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:766a4a5996f54361d8d5a9050140aa5362fe48ce51c755a50c0bc3706460c430", size = 246582, upload-time = "2025-06-30T15:51:39.709Z" }, + { url = "https://files.pythonhosted.org/packages/cf/01/c69e0317be556e46257826d5449feb4e6aa0d18573e567a48a2c14156f1f/multidict-6.6.3-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:3893a0d7d28a7fe6ca7a1f760593bc13038d1d35daf52199d431b61d2660602b", size = 253355, upload-time = "2025-06-30T15:51:41.013Z" }, + { url = "https://files.pythonhosted.org/packages/c0/da/9cc1da0299762d20e626fe0042e71b5694f9f72d7d3f9678397cbaa71b2b/multidict-6.6.3-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:934796c81ea996e61914ba58064920d6cad5d99140ac3167901eb932150e2e56", size = 247774, upload-time = "2025-06-30T15:51:42.291Z" }, + { url = "https://files.pythonhosted.org/packages/e6/91/b22756afec99cc31105ddd4a52f95ab32b1a4a58f4d417979c570c4a922e/multidict-6.6.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9ed948328aec2072bc00f05d961ceadfd3e9bfc2966c1319aeaf7b7c21219183", size = 242275, upload-time = "2025-06-30T15:51:43.642Z" }, + { url = "https://files.pythonhosted.org/packages/be/f1/adcc185b878036a20399d5be5228f3cbe7f823d78985d101d425af35c800/multidict-6.6.3-cp311-cp311-win32.whl", hash = "sha256:9f5b28c074c76afc3e4c610c488e3493976fe0e596dd3db6c8ddfbb0134dcac5", size = 41290, upload-time = "2025-06-30T15:51:45.264Z" }, + { url = "https://files.pythonhosted.org/packages/e0/d4/27652c1c6526ea6b4f5ddd397e93f4232ff5de42bea71d339bc6a6cc497f/multidict-6.6.3-cp311-cp311-win_amd64.whl", hash = "sha256:bc7f6fbc61b1c16050a389c630da0b32fc6d4a3d191394ab78972bf5edc568c2", size = 45942, upload-time = "2025-06-30T15:51:46.377Z" }, + { url = "https://files.pythonhosted.org/packages/16/18/23f4932019804e56d3c2413e237f866444b774b0263bcb81df2fdecaf593/multidict-6.6.3-cp311-cp311-win_arm64.whl", hash = "sha256:d4e47d8faffaae822fb5cba20937c048d4f734f43572e7079298a6c39fb172cb", size = 42880, upload-time = "2025-06-30T15:51:47.561Z" }, + { url = "https://files.pythonhosted.org/packages/0e/a0/6b57988ea102da0623ea814160ed78d45a2645e4bbb499c2896d12833a70/multidict-6.6.3-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:056bebbeda16b2e38642d75e9e5310c484b7c24e3841dc0fb943206a72ec89d6", size = 76514, upload-time = "2025-06-30T15:51:48.728Z" }, + { url = "https://files.pythonhosted.org/packages/07/7a/d1e92665b0850c6c0508f101f9cf0410c1afa24973e1115fe9c6a185ebf7/multidict-6.6.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:e5f481cccb3c5c5e5de5d00b5141dc589c1047e60d07e85bbd7dea3d4580d63f", size = 45394, upload-time = "2025-06-30T15:51:49.986Z" }, + { url = "https://files.pythonhosted.org/packages/52/6f/dd104490e01be6ef8bf9573705d8572f8c2d2c561f06e3826b081d9e6591/multidict-6.6.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:10bea2ee839a759ee368b5a6e47787f399b41e70cf0c20d90dfaf4158dfb4e55", size = 43590, upload-time = "2025-06-30T15:51:51.331Z" }, + { url = "https://files.pythonhosted.org/packages/44/fe/06e0e01b1b0611e6581b7fd5a85b43dacc08b6cea3034f902f383b0873e5/multidict-6.6.3-cp312-cp312-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:2334cfb0fa9549d6ce2c21af2bfbcd3ac4ec3646b1b1581c88e3e2b1779ec92b", size = 237292, upload-time = "2025-06-30T15:51:52.584Z" }, + { url = "https://files.pythonhosted.org/packages/ce/71/4f0e558fb77696b89c233c1ee2d92f3e1d5459070a0e89153c9e9e804186/multidict-6.6.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b8fee016722550a2276ca2cb5bb624480e0ed2bd49125b2b73b7010b9090e888", size = 258385, upload-time = "2025-06-30T15:51:53.913Z" }, + { url = "https://files.pythonhosted.org/packages/e3/25/cca0e68228addad24903801ed1ab42e21307a1b4b6dd2cf63da5d3ae082a/multidict-6.6.3-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e5511cb35f5c50a2db21047c875eb42f308c5583edf96bd8ebf7d770a9d68f6d", size = 242328, upload-time = "2025-06-30T15:51:55.672Z" }, + { url = "https://files.pythonhosted.org/packages/6e/a3/46f2d420d86bbcb8fe660b26a10a219871a0fbf4d43cb846a4031533f3e0/multidict-6.6.3-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:712b348f7f449948e0a6c4564a21c7db965af900973a67db432d724619b3c680", size = 268057, upload-time = "2025-06-30T15:51:57.037Z" }, + { url = "https://files.pythonhosted.org/packages/9e/73/1c743542fe00794a2ec7466abd3f312ccb8fad8dff9f36d42e18fb1ec33e/multidict-6.6.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:e4e15d2138ee2694e038e33b7c3da70e6b0ad8868b9f8094a72e1414aeda9c1a", size = 269341, upload-time = "2025-06-30T15:51:59.111Z" }, + { url = "https://files.pythonhosted.org/packages/a4/11/6ec9dcbe2264b92778eeb85407d1df18812248bf3506a5a1754bc035db0c/multidict-6.6.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8df25594989aebff8a130f7899fa03cbfcc5d2b5f4a461cf2518236fe6f15961", size = 256081, upload-time = "2025-06-30T15:52:00.533Z" }, + { url = "https://files.pythonhosted.org/packages/9b/2b/631b1e2afeb5f1696846d747d36cda075bfdc0bc7245d6ba5c319278d6c4/multidict-6.6.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:159ca68bfd284a8860f8d8112cf0521113bffd9c17568579e4d13d1f1dc76b65", size = 253581, upload-time = "2025-06-30T15:52:02.43Z" }, + { url = "https://files.pythonhosted.org/packages/bf/0e/7e3b93f79efeb6111d3bf9a1a69e555ba1d07ad1c11bceb56b7310d0d7ee/multidict-6.6.3-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:e098c17856a8c9ade81b4810888c5ad1914099657226283cab3062c0540b0643", size = 250750, upload-time = "2025-06-30T15:52:04.26Z" }, + { url = "https://files.pythonhosted.org/packages/ad/9e/086846c1d6601948e7de556ee464a2d4c85e33883e749f46b9547d7b0704/multidict-6.6.3-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:67c92ed673049dec52d7ed39f8cf9ebbadf5032c774058b4406d18c8f8fe7063", size = 251548, upload-time = "2025-06-30T15:52:06.002Z" }, + { url = "https://files.pythonhosted.org/packages/8c/7b/86ec260118e522f1a31550e87b23542294880c97cfbf6fb18cc67b044c66/multidict-6.6.3-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:bd0578596e3a835ef451784053cfd327d607fc39ea1a14812139339a18a0dbc3", size = 262718, upload-time = "2025-06-30T15:52:07.707Z" }, + { url = "https://files.pythonhosted.org/packages/8c/bd/22ce8f47abb0be04692c9fc4638508b8340987b18691aa7775d927b73f72/multidict-6.6.3-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:346055630a2df2115cd23ae271910b4cae40f4e336773550dca4889b12916e75", size = 259603, upload-time = "2025-06-30T15:52:09.58Z" }, + { url = "https://files.pythonhosted.org/packages/07/9c/91b7ac1691be95cd1f4a26e36a74b97cda6aa9820632d31aab4410f46ebd/multidict-6.6.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:555ff55a359302b79de97e0468e9ee80637b0de1fce77721639f7cd9440b3a10", size = 251351, upload-time = "2025-06-30T15:52:10.947Z" }, + { url = "https://files.pythonhosted.org/packages/6f/5c/4d7adc739884f7a9fbe00d1eac8c034023ef8bad71f2ebe12823ca2e3649/multidict-6.6.3-cp312-cp312-win32.whl", hash = "sha256:73ab034fb8d58ff85c2bcbadc470efc3fafeea8affcf8722855fb94557f14cc5", size = 41860, upload-time = "2025-06-30T15:52:12.334Z" }, + { url = "https://files.pythonhosted.org/packages/6a/a3/0fbc7afdf7cb1aa12a086b02959307848eb6bcc8f66fcb66c0cb57e2a2c1/multidict-6.6.3-cp312-cp312-win_amd64.whl", hash = "sha256:04cbcce84f63b9af41bad04a54d4cc4e60e90c35b9e6ccb130be2d75b71f8c17", size = 45982, upload-time = "2025-06-30T15:52:13.6Z" }, + { url = "https://files.pythonhosted.org/packages/b8/95/8c825bd70ff9b02462dc18d1295dd08d3e9e4eb66856d292ffa62cfe1920/multidict-6.6.3-cp312-cp312-win_arm64.whl", hash = "sha256:0f1130b896ecb52d2a1e615260f3ea2af55fa7dc3d7c3003ba0c3121a759b18b", size = 43210, upload-time = "2025-06-30T15:52:14.893Z" }, + { url = "https://files.pythonhosted.org/packages/52/1d/0bebcbbb4f000751fbd09957257903d6e002943fc668d841a4cf2fb7f872/multidict-6.6.3-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:540d3c06d48507357a7d57721e5094b4f7093399a0106c211f33540fdc374d55", size = 75843, upload-time = "2025-06-30T15:52:16.155Z" }, + { url = "https://files.pythonhosted.org/packages/07/8f/cbe241b0434cfe257f65c2b1bcf9e8d5fb52bc708c5061fb29b0fed22bdf/multidict-6.6.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:9c19cea2a690f04247d43f366d03e4eb110a0dc4cd1bbeee4d445435428ed35b", size = 45053, upload-time = "2025-06-30T15:52:17.429Z" }, + { url = "https://files.pythonhosted.org/packages/32/d2/0b3b23f9dbad5b270b22a3ac3ea73ed0a50ef2d9a390447061178ed6bdb8/multidict-6.6.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:7af039820cfd00effec86bda5d8debef711a3e86a1d3772e85bea0f243a4bd65", size = 43273, upload-time = "2025-06-30T15:52:19.346Z" }, + { url = "https://files.pythonhosted.org/packages/fd/fe/6eb68927e823999e3683bc49678eb20374ba9615097d085298fd5b386564/multidict-6.6.3-cp313-cp313-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:500b84f51654fdc3944e936f2922114349bf8fdcac77c3092b03449f0e5bc2b3", size = 237124, upload-time = "2025-06-30T15:52:20.773Z" }, + { url = "https://files.pythonhosted.org/packages/e7/ab/320d8507e7726c460cb77117848b3834ea0d59e769f36fdae495f7669929/multidict-6.6.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f3fc723ab8a5c5ed6c50418e9bfcd8e6dceba6c271cee6728a10a4ed8561520c", size = 256892, upload-time = "2025-06-30T15:52:22.242Z" }, + { url = "https://files.pythonhosted.org/packages/76/60/38ee422db515ac69834e60142a1a69111ac96026e76e8e9aa347fd2e4591/multidict-6.6.3-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:94c47ea3ade005b5976789baaed66d4de4480d0a0bf31cef6edaa41c1e7b56a6", size = 240547, upload-time = "2025-06-30T15:52:23.736Z" }, + { url = "https://files.pythonhosted.org/packages/27/fb/905224fde2dff042b030c27ad95a7ae744325cf54b890b443d30a789b80e/multidict-6.6.3-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:dbc7cf464cc6d67e83e136c9f55726da3a30176f020a36ead246eceed87f1cd8", size = 266223, upload-time = "2025-06-30T15:52:25.185Z" }, + { url = "https://files.pythonhosted.org/packages/76/35/dc38ab361051beae08d1a53965e3e1a418752fc5be4d3fb983c5582d8784/multidict-6.6.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:900eb9f9da25ada070f8ee4a23f884e0ee66fe4e1a38c3af644256a508ad81ca", size = 267262, upload-time = "2025-06-30T15:52:26.969Z" }, + { url = "https://files.pythonhosted.org/packages/1f/a3/0a485b7f36e422421b17e2bbb5a81c1af10eac1d4476f2ff92927c730479/multidict-6.6.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7c6df517cf177da5d47ab15407143a89cd1a23f8b335f3a28d57e8b0a3dbb884", size = 254345, upload-time = "2025-06-30T15:52:28.467Z" }, + { url = "https://files.pythonhosted.org/packages/b4/59/bcdd52c1dab7c0e0d75ff19cac751fbd5f850d1fc39172ce809a74aa9ea4/multidict-6.6.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:4ef421045f13879e21c994b36e728d8e7d126c91a64b9185810ab51d474f27e7", size = 252248, upload-time = "2025-06-30T15:52:29.938Z" }, + { url = "https://files.pythonhosted.org/packages/bb/a4/2d96aaa6eae8067ce108d4acee6f45ced5728beda55c0f02ae1072c730d1/multidict-6.6.3-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:6c1e61bb4f80895c081790b6b09fa49e13566df8fbff817da3f85b3a8192e36b", size = 250115, upload-time = "2025-06-30T15:52:31.416Z" }, + { url = "https://files.pythonhosted.org/packages/25/d2/ed9f847fa5c7d0677d4f02ea2c163d5e48573de3f57bacf5670e43a5ffaa/multidict-6.6.3-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:e5e8523bb12d7623cd8300dbd91b9e439a46a028cd078ca695eb66ba31adee3c", size = 249649, upload-time = "2025-06-30T15:52:32.996Z" }, + { url = "https://files.pythonhosted.org/packages/1f/af/9155850372563fc550803d3f25373308aa70f59b52cff25854086ecb4a79/multidict-6.6.3-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:ef58340cc896219e4e653dade08fea5c55c6df41bcc68122e3be3e9d873d9a7b", size = 261203, upload-time = "2025-06-30T15:52:34.521Z" }, + { url = "https://files.pythonhosted.org/packages/36/2f/c6a728f699896252cf309769089568a33c6439626648843f78743660709d/multidict-6.6.3-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:fc9dc435ec8699e7b602b94fe0cd4703e69273a01cbc34409af29e7820f777f1", size = 258051, upload-time = "2025-06-30T15:52:35.999Z" }, + { url = "https://files.pythonhosted.org/packages/d0/60/689880776d6b18fa2b70f6cc74ff87dd6c6b9b47bd9cf74c16fecfaa6ad9/multidict-6.6.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:9e864486ef4ab07db5e9cb997bad2b681514158d6954dd1958dfb163b83d53e6", size = 249601, upload-time = "2025-06-30T15:52:37.473Z" }, + { url = "https://files.pythonhosted.org/packages/75/5e/325b11f2222a549019cf2ef879c1f81f94a0d40ace3ef55cf529915ba6cc/multidict-6.6.3-cp313-cp313-win32.whl", hash = "sha256:5633a82fba8e841bc5c5c06b16e21529573cd654f67fd833650a215520a6210e", size = 41683, upload-time = "2025-06-30T15:52:38.927Z" }, + { url = "https://files.pythonhosted.org/packages/b1/ad/cf46e73f5d6e3c775cabd2a05976547f3f18b39bee06260369a42501f053/multidict-6.6.3-cp313-cp313-win_amd64.whl", hash = "sha256:e93089c1570a4ad54c3714a12c2cef549dc9d58e97bcded193d928649cab78e9", size = 45811, upload-time = "2025-06-30T15:52:40.207Z" }, + { url = "https://files.pythonhosted.org/packages/c5/c9/2e3fe950db28fb7c62e1a5f46e1e38759b072e2089209bc033c2798bb5ec/multidict-6.6.3-cp313-cp313-win_arm64.whl", hash = "sha256:c60b401f192e79caec61f166da9c924e9f8bc65548d4246842df91651e83d600", size = 43056, upload-time = "2025-06-30T15:52:41.575Z" }, + { url = "https://files.pythonhosted.org/packages/3a/58/aaf8114cf34966e084a8cc9517771288adb53465188843d5a19862cb6dc3/multidict-6.6.3-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:02fd8f32d403a6ff13864b0851f1f523d4c988051eea0471d4f1fd8010f11134", size = 82811, upload-time = "2025-06-30T15:52:43.281Z" }, + { url = "https://files.pythonhosted.org/packages/71/af/5402e7b58a1f5b987a07ad98f2501fdba2a4f4b4c30cf114e3ce8db64c87/multidict-6.6.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:f3aa090106b1543f3f87b2041eef3c156c8da2aed90c63a2fbed62d875c49c37", size = 48304, upload-time = "2025-06-30T15:52:45.026Z" }, + { url = "https://files.pythonhosted.org/packages/39/65/ab3c8cafe21adb45b24a50266fd747147dec7847425bc2a0f6934b3ae9ce/multidict-6.6.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:e924fb978615a5e33ff644cc42e6aa241effcf4f3322c09d4f8cebde95aff5f8", size = 46775, upload-time = "2025-06-30T15:52:46.459Z" }, + { url = "https://files.pythonhosted.org/packages/49/ba/9fcc1b332f67cc0c0c8079e263bfab6660f87fe4e28a35921771ff3eea0d/multidict-6.6.3-cp313-cp313t-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:b9fe5a0e57c6dbd0e2ce81ca66272282c32cd11d31658ee9553849d91289e1c1", size = 229773, upload-time = "2025-06-30T15:52:47.88Z" }, + { url = "https://files.pythonhosted.org/packages/a4/14/0145a251f555f7c754ce2dcbcd012939bbd1f34f066fa5d28a50e722a054/multidict-6.6.3-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b24576f208793ebae00280c59927c3b7c2a3b1655e443a25f753c4611bc1c373", size = 250083, upload-time = "2025-06-30T15:52:49.366Z" }, + { url = "https://files.pythonhosted.org/packages/9e/d4/d5c0bd2bbb173b586c249a151a26d2fb3ec7d53c96e42091c9fef4e1f10c/multidict-6.6.3-cp313-cp313t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:135631cb6c58eac37d7ac0df380294fecdc026b28837fa07c02e459c7fb9c54e", size = 228980, upload-time = "2025-06-30T15:52:50.903Z" }, + { url = "https://files.pythonhosted.org/packages/21/32/c9a2d8444a50ec48c4733ccc67254100c10e1c8ae8e40c7a2d2183b59b97/multidict-6.6.3-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:274d416b0df887aef98f19f21578653982cfb8a05b4e187d4a17103322eeaf8f", size = 257776, upload-time = "2025-06-30T15:52:52.764Z" }, + { url = "https://files.pythonhosted.org/packages/68/d0/14fa1699f4ef629eae08ad6201c6b476098f5efb051b296f4c26be7a9fdf/multidict-6.6.3-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:e252017a817fad7ce05cafbe5711ed40faeb580e63b16755a3a24e66fa1d87c0", size = 256882, upload-time = "2025-06-30T15:52:54.596Z" }, + { url = "https://files.pythonhosted.org/packages/da/88/84a27570fbe303c65607d517a5f147cd2fc046c2d1da02b84b17b9bdc2aa/multidict-6.6.3-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2e4cc8d848cd4fe1cdee28c13ea79ab0ed37fc2e89dd77bac86a2e7959a8c3bc", size = 247816, upload-time = "2025-06-30T15:52:56.175Z" }, + { url = "https://files.pythonhosted.org/packages/1c/60/dca352a0c999ce96a5d8b8ee0b2b9f729dcad2e0b0c195f8286269a2074c/multidict-6.6.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9e236a7094b9c4c1b7585f6b9cca34b9d833cf079f7e4c49e6a4a6ec9bfdc68f", size = 245341, upload-time = "2025-06-30T15:52:57.752Z" }, + { url = "https://files.pythonhosted.org/packages/50/ef/433fa3ed06028f03946f3993223dada70fb700f763f70c00079533c34578/multidict-6.6.3-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:e0cb0ab69915c55627c933f0b555a943d98ba71b4d1c57bc0d0a66e2567c7471", size = 235854, upload-time = "2025-06-30T15:52:59.74Z" }, + { url = "https://files.pythonhosted.org/packages/1b/1f/487612ab56fbe35715320905215a57fede20de7db40a261759690dc80471/multidict-6.6.3-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:81ef2f64593aba09c5212a3d0f8c906a0d38d710a011f2f42759704d4557d3f2", size = 243432, upload-time = "2025-06-30T15:53:01.602Z" }, + { url = "https://files.pythonhosted.org/packages/da/6f/ce8b79de16cd885c6f9052c96a3671373d00c59b3ee635ea93e6e81b8ccf/multidict-6.6.3-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:b9cbc60010de3562545fa198bfc6d3825df430ea96d2cc509c39bd71e2e7d648", size = 252731, upload-time = "2025-06-30T15:53:03.517Z" }, + { url = "https://files.pythonhosted.org/packages/bb/fe/a2514a6aba78e5abefa1624ca85ae18f542d95ac5cde2e3815a9fbf369aa/multidict-6.6.3-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:70d974eaaa37211390cd02ef93b7e938de564bbffa866f0b08d07e5e65da783d", size = 247086, upload-time = "2025-06-30T15:53:05.48Z" }, + { url = "https://files.pythonhosted.org/packages/8c/22/b788718d63bb3cce752d107a57c85fcd1a212c6c778628567c9713f9345a/multidict-6.6.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:3713303e4a6663c6d01d648a68f2848701001f3390a030edaaf3fc949c90bf7c", size = 243338, upload-time = "2025-06-30T15:53:07.522Z" }, + { url = "https://files.pythonhosted.org/packages/22/d6/fdb3d0670819f2228f3f7d9af613d5e652c15d170c83e5f1c94fbc55a25b/multidict-6.6.3-cp313-cp313t-win32.whl", hash = "sha256:639ecc9fe7cd73f2495f62c213e964843826f44505a3e5d82805aa85cac6f89e", size = 47812, upload-time = "2025-06-30T15:53:09.263Z" }, + { url = "https://files.pythonhosted.org/packages/b6/d6/a9d2c808f2c489ad199723197419207ecbfbc1776f6e155e1ecea9c883aa/multidict-6.6.3-cp313-cp313t-win_amd64.whl", hash = "sha256:9f97e181f344a0ef3881b573d31de8542cc0dbc559ec68c8f8b5ce2c2e91646d", size = 53011, upload-time = "2025-06-30T15:53:11.038Z" }, + { url = "https://files.pythonhosted.org/packages/f2/40/b68001cba8188dd267590a111f9661b6256debc327137667e832bf5d66e8/multidict-6.6.3-cp313-cp313t-win_arm64.whl", hash = "sha256:ce8b7693da41a3c4fde5871c738a81490cea5496c671d74374c8ab889e1834fb", size = 45254, upload-time = "2025-06-30T15:53:12.421Z" }, + { url = "https://files.pythonhosted.org/packages/d2/64/ba29bd6dfc895e592b2f20f92378e692ac306cf25dd0be2f8e0a0f898edb/multidict-6.6.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:c8161b5a7778d3137ea2ee7ae8a08cce0010de3b00ac671c5ebddeaa17cefd22", size = 76959, upload-time = "2025-06-30T15:53:13.827Z" }, + { url = "https://files.pythonhosted.org/packages/ca/cd/872ae4c134257dacebff59834983c1615d6ec863b6e3d360f3203aad8400/multidict-6.6.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1328201ee930f069961ae707d59c6627ac92e351ed5b92397cf534d1336ce557", size = 44864, upload-time = "2025-06-30T15:53:15.658Z" }, + { url = "https://files.pythonhosted.org/packages/15/35/d417d8f62f2886784b76df60522d608aba39dfc83dd53b230ca71f2d4c53/multidict-6.6.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b1db4d2093d6b235de76932febf9d50766cf49a5692277b2c28a501c9637f616", size = 44540, upload-time = "2025-06-30T15:53:17.208Z" }, + { url = "https://files.pythonhosted.org/packages/85/59/25cddf781f12cddb2386baa29744a3fdd160eb705539b48065f0cffd86d5/multidict-6.6.3-cp39-cp39-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:53becb01dd8ebd19d1724bebe369cfa87e4e7f29abbbe5c14c98ce4c383e16cd", size = 224075, upload-time = "2025-06-30T15:53:18.705Z" }, + { url = "https://files.pythonhosted.org/packages/c4/21/4055b6a527954c572498a8068c26bd3b75f2b959080e17e12104b592273c/multidict-6.6.3-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:41bb9d1d4c303886e2d85bade86e59885112a7f4277af5ad47ab919a2251f306", size = 240535, upload-time = "2025-06-30T15:53:20.359Z" }, + { url = "https://files.pythonhosted.org/packages/58/98/17f1f80bdba0b2fef49cf4ba59cebf8a81797f745f547abb5c9a4039df62/multidict-6.6.3-cp39-cp39-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:775b464d31dac90f23192af9c291dc9f423101857e33e9ebf0020a10bfcf4144", size = 219361, upload-time = "2025-06-30T15:53:22.371Z" }, + { url = "https://files.pythonhosted.org/packages/f8/0e/a5e595fdd0820069f0c29911d5dc9dc3a75ec755ae733ce59a4e6962ae42/multidict-6.6.3-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:d04d01f0a913202205a598246cf77826fe3baa5a63e9f6ccf1ab0601cf56eca0", size = 251207, upload-time = "2025-06-30T15:53:24.307Z" }, + { url = "https://files.pythonhosted.org/packages/66/9e/0f51e4cffea2daf24c137feabc9ec848ce50f8379c9badcbac00b41ab55e/multidict-6.6.3-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d25594d3b38a2e6cabfdcafef339f754ca6e81fbbdb6650ad773ea9775af35ab", size = 249749, upload-time = "2025-06-30T15:53:26.056Z" }, + { url = "https://files.pythonhosted.org/packages/49/a0/a7cfc13c9a71ceb8c1c55457820733af9ce01e121139271f7b13e30c29d2/multidict-6.6.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:35712f1748d409e0707b165bf49f9f17f9e28ae85470c41615778f8d4f7d9609", size = 239202, upload-time = "2025-06-30T15:53:28.096Z" }, + { url = "https://files.pythonhosted.org/packages/c7/50/7ae0d1149ac71cab6e20bb7faf2a1868435974994595dadfdb7377f7140f/multidict-6.6.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:1c8082e5814b662de8589d6a06c17e77940d5539080cbab9fe6794b5241b76d9", size = 237269, upload-time = "2025-06-30T15:53:30.124Z" }, + { url = "https://files.pythonhosted.org/packages/b4/ac/2d0bf836c9c63a57360d57b773359043b371115e1c78ff648993bf19abd0/multidict-6.6.3-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:61af8a4b771f1d4d000b3168c12c3120ccf7284502a94aa58c68a81f5afac090", size = 232961, upload-time = "2025-06-30T15:53:31.766Z" }, + { url = "https://files.pythonhosted.org/packages/85/e1/68a65f069df298615591e70e48bfd379c27d4ecb252117c18bf52eebc237/multidict-6.6.3-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:448e4a9afccbf297577f2eaa586f07067441e7b63c8362a3540ba5a38dc0f14a", size = 240863, upload-time = "2025-06-30T15:53:33.488Z" }, + { url = "https://files.pythonhosted.org/packages/ae/ab/702f1baca649f88ea1dc6259fc2aa4509f4ad160ba48c8e61fbdb4a5a365/multidict-6.6.3-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:233ad16999afc2bbd3e534ad8dbe685ef8ee49a37dbc2cdc9514e57b6d589ced", size = 246800, upload-time = "2025-06-30T15:53:35.21Z" }, + { url = "https://files.pythonhosted.org/packages/5e/0b/726e690bfbf887985a8710ef2f25f1d6dd184a35bd3b36429814f810a2fc/multidict-6.6.3-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:bb933c891cd4da6bdcc9733d048e994e22e1883287ff7540c2a0f3b117605092", size = 242034, upload-time = "2025-06-30T15:53:36.913Z" }, + { url = "https://files.pythonhosted.org/packages/73/bb/839486b27bcbcc2e0d875fb9d4012b4b6aa99639137343106aa7210e047a/multidict-6.6.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:37b09ca60998e87734699e88c2363abfd457ed18cfbf88e4009a4e83788e63ed", size = 235377, upload-time = "2025-06-30T15:53:38.618Z" }, + { url = "https://files.pythonhosted.org/packages/e3/46/574d75ab7b9ae8690fe27e89f5fcd0121633112b438edfb9ed2be8be096b/multidict-6.6.3-cp39-cp39-win32.whl", hash = "sha256:f54cb79d26d0cd420637d184af38f0668558f3c4bbe22ab7ad830e67249f2e0b", size = 41420, upload-time = "2025-06-30T15:53:40.309Z" }, + { url = "https://files.pythonhosted.org/packages/78/c3/8b3bc755508b777868349f4bfa844d3d31832f075ee800a3d6f1807338c5/multidict-6.6.3-cp39-cp39-win_amd64.whl", hash = "sha256:295adc9c0551e5d5214b45cf29ca23dbc28c2d197a9c30d51aed9e037cb7c578", size = 46124, upload-time = "2025-06-30T15:53:41.984Z" }, + { url = "https://files.pythonhosted.org/packages/b2/30/5a66e7e4550e80975faee5b5dd9e9bd09194d2fd8f62363119b9e46e204b/multidict-6.6.3-cp39-cp39-win_arm64.whl", hash = "sha256:15332783596f227db50fb261c2c251a58ac3873c457f3a550a95d5c0aa3c770d", size = 42973, upload-time = "2025-06-30T15:53:43.505Z" }, + { url = "https://files.pythonhosted.org/packages/d8/30/9aec301e9772b098c1f5c0ca0279237c9766d94b97802e9888010c64b0ed/multidict-6.6.3-py3-none-any.whl", hash = "sha256:8db10f29c7541fc5da4defd8cd697e1ca429db743fa716325f236079b96f775a", size = 12313, upload-time = "2025-06-30T15:53:45.437Z" }, +] + +[[package]] +name = "mypy" +version = "1.14.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mypy-extensions" }, + { name = "tomli", marker = "python_full_version < '3.11' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b9/eb/2c92d8ea1e684440f54fa49ac5d9a5f19967b7b472a281f419e69a8d228e/mypy-1.14.1.tar.gz", hash = "sha256:7ec88144fe9b510e8475ec2f5f251992690fcf89ccb4500b214b4226abcd32d6", size = 3216051, upload-time = "2024-12-30T16:39:07.335Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9b/7a/87ae2adb31d68402da6da1e5f30c07ea6063e9f09b5e7cfc9dfa44075e74/mypy-1.14.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:52686e37cf13d559f668aa398dd7ddf1f92c5d613e4f8cb262be2fb4fedb0fcb", size = 11211002, upload-time = "2024-12-30T16:37:22.435Z" }, + { url = "https://files.pythonhosted.org/packages/e1/23/eada4c38608b444618a132be0d199b280049ded278b24cbb9d3fc59658e4/mypy-1.14.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1fb545ca340537d4b45d3eecdb3def05e913299ca72c290326be19b3804b39c0", size = 10358400, upload-time = "2024-12-30T16:37:53.526Z" }, + { url = "https://files.pythonhosted.org/packages/43/c9/d6785c6f66241c62fd2992b05057f404237deaad1566545e9f144ced07f5/mypy-1.14.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:90716d8b2d1f4cd503309788e51366f07c56635a3309b0f6a32547eaaa36a64d", size = 12095172, upload-time = "2024-12-30T16:37:50.332Z" }, + { url = "https://files.pythonhosted.org/packages/c3/62/daa7e787770c83c52ce2aaf1a111eae5893de9e004743f51bfcad9e487ec/mypy-1.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2ae753f5c9fef278bcf12e1a564351764f2a6da579d4a81347e1d5a15819997b", size = 12828732, upload-time = "2024-12-30T16:37:29.96Z" }, + { url = "https://files.pythonhosted.org/packages/1b/a2/5fb18318a3637f29f16f4e41340b795da14f4751ef4f51c99ff39ab62e52/mypy-1.14.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e0fe0f5feaafcb04505bcf439e991c6d8f1bf8b15f12b05feeed96e9e7bf1427", size = 13012197, upload-time = "2024-12-30T16:38:05.037Z" }, + { url = "https://files.pythonhosted.org/packages/28/99/e153ce39105d164b5f02c06c35c7ba958aaff50a2babba7d080988b03fe7/mypy-1.14.1-cp310-cp310-win_amd64.whl", hash = "sha256:7d54bd85b925e501c555a3227f3ec0cfc54ee8b6930bd6141ec872d1c572f81f", size = 9780836, upload-time = "2024-12-30T16:37:19.726Z" }, + { url = "https://files.pythonhosted.org/packages/da/11/a9422850fd506edbcdc7f6090682ecceaf1f87b9dd847f9df79942da8506/mypy-1.14.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f995e511de847791c3b11ed90084a7a0aafdc074ab88c5a9711622fe4751138c", size = 11120432, upload-time = "2024-12-30T16:37:11.533Z" }, + { url = "https://files.pythonhosted.org/packages/b6/9e/47e450fd39078d9c02d620545b2cb37993a8a8bdf7db3652ace2f80521ca/mypy-1.14.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d64169ec3b8461311f8ce2fd2eb5d33e2d0f2c7b49116259c51d0d96edee48d1", size = 10279515, upload-time = "2024-12-30T16:37:40.724Z" }, + { url = "https://files.pythonhosted.org/packages/01/b5/6c8d33bd0f851a7692a8bfe4ee75eb82b6983a3cf39e5e32a5d2a723f0c1/mypy-1.14.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ba24549de7b89b6381b91fbc068d798192b1b5201987070319889e93038967a8", size = 12025791, upload-time = "2024-12-30T16:36:58.73Z" }, + { url = "https://files.pythonhosted.org/packages/f0/4c/e10e2c46ea37cab5c471d0ddaaa9a434dc1d28650078ac1b56c2d7b9b2e4/mypy-1.14.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:183cf0a45457d28ff9d758730cd0210419ac27d4d3f285beda038c9083363b1f", size = 12749203, upload-time = "2024-12-30T16:37:03.741Z" }, + { url = "https://files.pythonhosted.org/packages/88/55/beacb0c69beab2153a0f57671ec07861d27d735a0faff135a494cd4f5020/mypy-1.14.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f2a0ecc86378f45347f586e4163d1769dd81c5a223d577fe351f26b179e148b1", size = 12885900, upload-time = "2024-12-30T16:37:57.948Z" }, + { url = "https://files.pythonhosted.org/packages/a2/75/8c93ff7f315c4d086a2dfcde02f713004357d70a163eddb6c56a6a5eff40/mypy-1.14.1-cp311-cp311-win_amd64.whl", hash = "sha256:ad3301ebebec9e8ee7135d8e3109ca76c23752bac1e717bc84cd3836b4bf3eae", size = 9777869, upload-time = "2024-12-30T16:37:33.428Z" }, + { url = "https://files.pythonhosted.org/packages/43/1b/b38c079609bb4627905b74fc6a49849835acf68547ac33d8ceb707de5f52/mypy-1.14.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:30ff5ef8519bbc2e18b3b54521ec319513a26f1bba19a7582e7b1f58a6e69f14", size = 11266668, upload-time = "2024-12-30T16:38:02.211Z" }, + { url = "https://files.pythonhosted.org/packages/6b/75/2ed0d2964c1ffc9971c729f7a544e9cd34b2cdabbe2d11afd148d7838aa2/mypy-1.14.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:cb9f255c18052343c70234907e2e532bc7e55a62565d64536dbc7706a20b78b9", size = 10254060, upload-time = "2024-12-30T16:37:46.131Z" }, + { url = "https://files.pythonhosted.org/packages/a1/5f/7b8051552d4da3c51bbe8fcafffd76a6823779101a2b198d80886cd8f08e/mypy-1.14.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8b4e3413e0bddea671012b063e27591b953d653209e7a4fa5e48759cda77ca11", size = 11933167, upload-time = "2024-12-30T16:37:43.534Z" }, + { url = "https://files.pythonhosted.org/packages/04/90/f53971d3ac39d8b68bbaab9a4c6c58c8caa4d5fd3d587d16f5927eeeabe1/mypy-1.14.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:553c293b1fbdebb6c3c4030589dab9fafb6dfa768995a453d8a5d3b23784af2e", size = 12864341, upload-time = "2024-12-30T16:37:36.249Z" }, + { url = "https://files.pythonhosted.org/packages/03/d2/8bc0aeaaf2e88c977db41583559319f1821c069e943ada2701e86d0430b7/mypy-1.14.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fad79bfe3b65fe6a1efaed97b445c3d37f7be9fdc348bdb2d7cac75579607c89", size = 12972991, upload-time = "2024-12-30T16:37:06.743Z" }, + { url = "https://files.pythonhosted.org/packages/6f/17/07815114b903b49b0f2cf7499f1c130e5aa459411596668267535fe9243c/mypy-1.14.1-cp312-cp312-win_amd64.whl", hash = "sha256:8fa2220e54d2946e94ab6dbb3ba0a992795bd68b16dc852db33028df2b00191b", size = 9879016, upload-time = "2024-12-30T16:37:15.02Z" }, + { url = "https://files.pythonhosted.org/packages/9e/15/bb6a686901f59222275ab228453de741185f9d54fecbaacec041679496c6/mypy-1.14.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:92c3ed5afb06c3a8e188cb5da4984cab9ec9a77ba956ee419c68a388b4595255", size = 11252097, upload-time = "2024-12-30T16:37:25.144Z" }, + { url = "https://files.pythonhosted.org/packages/f8/b3/8b0f74dfd072c802b7fa368829defdf3ee1566ba74c32a2cb2403f68024c/mypy-1.14.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:dbec574648b3e25f43d23577309b16534431db4ddc09fda50841f1e34e64ed34", size = 10239728, upload-time = "2024-12-30T16:38:08.634Z" }, + { url = "https://files.pythonhosted.org/packages/c5/9b/4fd95ab20c52bb5b8c03cc49169be5905d931de17edfe4d9d2986800b52e/mypy-1.14.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8c6d94b16d62eb3e947281aa7347d78236688e21081f11de976376cf010eb31a", size = 11924965, upload-time = "2024-12-30T16:38:12.132Z" }, + { url = "https://files.pythonhosted.org/packages/56/9d/4a236b9c57f5d8f08ed346914b3f091a62dd7e19336b2b2a0d85485f82ff/mypy-1.14.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d4b19b03fdf54f3c5b2fa474c56b4c13c9dbfb9a2db4370ede7ec11a2c5927d9", size = 12867660, upload-time = "2024-12-30T16:38:17.342Z" }, + { url = "https://files.pythonhosted.org/packages/40/88/a61a5497e2f68d9027de2bb139c7bb9abaeb1be1584649fa9d807f80a338/mypy-1.14.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:0c911fde686394753fff899c409fd4e16e9b294c24bfd5e1ea4675deae1ac6fd", size = 12969198, upload-time = "2024-12-30T16:38:32.839Z" }, + { url = "https://files.pythonhosted.org/packages/54/da/3d6fc5d92d324701b0c23fb413c853892bfe0e1dbe06c9138037d459756b/mypy-1.14.1-cp313-cp313-win_amd64.whl", hash = "sha256:8b21525cb51671219f5307be85f7e646a153e5acc656e5cebf64bfa076c50107", size = 9885276, upload-time = "2024-12-30T16:38:20.828Z" }, + { url = "https://files.pythonhosted.org/packages/39/02/1817328c1372be57c16148ce7d2bfcfa4a796bedaed897381b1aad9b267c/mypy-1.14.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:7084fb8f1128c76cd9cf68fe5971b37072598e7c31b2f9f95586b65c741a9d31", size = 11143050, upload-time = "2024-12-30T16:38:29.743Z" }, + { url = "https://files.pythonhosted.org/packages/b9/07/99db9a95ece5e58eee1dd87ca456a7e7b5ced6798fd78182c59c35a7587b/mypy-1.14.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:8f845a00b4f420f693f870eaee5f3e2692fa84cc8514496114649cfa8fd5e2c6", size = 10321087, upload-time = "2024-12-30T16:38:14.739Z" }, + { url = "https://files.pythonhosted.org/packages/9a/eb/85ea6086227b84bce79b3baf7f465b4732e0785830726ce4a51528173b71/mypy-1.14.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:44bf464499f0e3a2d14d58b54674dee25c031703b2ffc35064bd0df2e0fac319", size = 12066766, upload-time = "2024-12-30T16:38:47.038Z" }, + { url = "https://files.pythonhosted.org/packages/4b/bb/f01bebf76811475d66359c259eabe40766d2f8ac8b8250d4e224bb6df379/mypy-1.14.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c99f27732c0b7dc847adb21c9d47ce57eb48fa33a17bc6d7d5c5e9f9e7ae5bac", size = 12787111, upload-time = "2024-12-30T16:39:02.444Z" }, + { url = "https://files.pythonhosted.org/packages/2f/c9/84837ff891edcb6dcc3c27d85ea52aab0c4a34740ff5f0ccc0eb87c56139/mypy-1.14.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:bce23c7377b43602baa0bd22ea3265c49b9ff0b76eb315d6c34721af4cdf1d9b", size = 12974331, upload-time = "2024-12-30T16:38:23.849Z" }, + { url = "https://files.pythonhosted.org/packages/84/5f/901e18464e6a13f8949b4909535be3fa7f823291b8ab4e4b36cfe57d6769/mypy-1.14.1-cp38-cp38-win_amd64.whl", hash = "sha256:8edc07eeade7ebc771ff9cf6b211b9a7d93687ff892150cb5692e4f4272b0837", size = 9763210, upload-time = "2024-12-30T16:38:36.299Z" }, + { url = "https://files.pythonhosted.org/packages/ca/1f/186d133ae2514633f8558e78cd658070ba686c0e9275c5a5c24a1e1f0d67/mypy-1.14.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3888a1816d69f7ab92092f785a462944b3ca16d7c470d564165fe703b0970c35", size = 11200493, upload-time = "2024-12-30T16:38:26.935Z" }, + { url = "https://files.pythonhosted.org/packages/af/fc/4842485d034e38a4646cccd1369f6b1ccd7bc86989c52770d75d719a9941/mypy-1.14.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:46c756a444117c43ee984bd055db99e498bc613a70bbbc120272bd13ca579fbc", size = 10357702, upload-time = "2024-12-30T16:38:50.623Z" }, + { url = "https://files.pythonhosted.org/packages/b4/e6/457b83f2d701e23869cfec013a48a12638f75b9d37612a9ddf99072c1051/mypy-1.14.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:27fc248022907e72abfd8e22ab1f10e903915ff69961174784a3900a8cba9ad9", size = 12091104, upload-time = "2024-12-30T16:38:53.735Z" }, + { url = "https://files.pythonhosted.org/packages/f1/bf/76a569158db678fee59f4fd30b8e7a0d75bcbaeef49edd882a0d63af6d66/mypy-1.14.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:499d6a72fb7e5de92218db961f1a66d5f11783f9ae549d214617edab5d4dbdbb", size = 12830167, upload-time = "2024-12-30T16:38:56.437Z" }, + { url = "https://files.pythonhosted.org/packages/43/bc/0bc6b694b3103de9fed61867f1c8bd33336b913d16831431e7cb48ef1c92/mypy-1.14.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:57961db9795eb566dc1d1b4e9139ebc4c6b0cb6e7254ecde69d1552bf7613f60", size = 13013834, upload-time = "2024-12-30T16:38:59.204Z" }, + { url = "https://files.pythonhosted.org/packages/b0/79/5f5ec47849b6df1e6943d5fd8e6632fbfc04b4fd4acfa5a5a9535d11b4e2/mypy-1.14.1-cp39-cp39-win_amd64.whl", hash = "sha256:07ba89fdcc9451f2ebb02853deb6aaaa3d2239a236669a63ab3801bbf923ef5c", size = 9781231, upload-time = "2024-12-30T16:39:05.124Z" }, + { url = "https://files.pythonhosted.org/packages/a0/b5/32dd67b69a16d088e533962e5044e51004176a9952419de0370cdaead0f8/mypy-1.14.1-py3-none-any.whl", hash = "sha256:b66a60cc4073aeb8ae00057f9c1f64d49e90f918fbcef9a977eb121da8b8f1d1", size = 2752905, upload-time = "2024-12-30T16:38:42.021Z" }, +] + +[[package]] +name = "mypy-extensions" +version = "1.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/98/a4/1ab47638b92648243faf97a5aeb6ea83059cc3624972ab6b8d2316078d3f/mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782", size = 4433, upload-time = "2023-02-04T12:11:27.157Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2a/e2/5d3f6ada4297caebe1a2add3b126fe800c96f56dbe5d1988a2cbe0b267aa/mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d", size = 4695, upload-time = "2023-02-04T12:11:25.002Z" }, +] + +[[package]] +name = "nodeenv" +version = "1.9.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/43/16/fc88b08840de0e0a72a2f9d8c6bae36be573e475a6326ae854bcc549fc45/nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f", size = 47437, upload-time = "2024-06-04T18:44:11.171Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d2/1d/1b658dbd2b9fa9c4c9f32accbfc0205d532c8c6194dc0f2a4c0428e7128a/nodeenv-1.9.1-py2.py3-none-any.whl", hash = "sha256:ba11c9782d29c27c70ffbdda2d7415098754709be8a7056d79a737cd901155c9", size = 22314, upload-time = "2024-06-04T18:44:08.352Z" }, +] + +[[package]] +name = "packaging" +version = "24.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950, upload-time = "2024-11-08T09:47:47.202Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451, upload-time = "2024-11-08T09:47:44.722Z" }, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955, upload-time = "2024-04-20T21:34:42.531Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556, upload-time = "2024-04-20T21:34:40.434Z" }, +] + +[[package]] +name = "propcache" +version = "0.2.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.9'", +] +sdist = { url = "https://files.pythonhosted.org/packages/a9/4d/5e5a60b78dbc1d464f8a7bbaeb30957257afdc8512cbb9dfd5659304f5cd/propcache-0.2.0.tar.gz", hash = "sha256:df81779732feb9d01e5d513fad0122efb3d53bbc75f61b2a4f29a020bc985e70", size = 40951, upload-time = "2024-10-07T12:56:36.896Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3a/08/1963dfb932b8d74d5b09098507b37e9b96c835ba89ab8aad35aa330f4ff3/propcache-0.2.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:c5869b8fd70b81835a6f187c5fdbe67917a04d7e52b6e7cc4e5fe39d55c39d58", size = 80712, upload-time = "2024-10-07T12:54:02.193Z" }, + { url = "https://files.pythonhosted.org/packages/e6/59/49072aba9bf8a8ed958e576182d46f038e595b17ff7408bc7e8807e721e1/propcache-0.2.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:952e0d9d07609d9c5be361f33b0d6d650cd2bae393aabb11d9b719364521984b", size = 46301, upload-time = "2024-10-07T12:54:03.576Z" }, + { url = "https://files.pythonhosted.org/packages/33/a2/6b1978c2e0d80a678e2c483f45e5443c15fe5d32c483902e92a073314ef1/propcache-0.2.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:33ac8f098df0585c0b53009f039dfd913b38c1d2edafed0cedcc0c32a05aa110", size = 45581, upload-time = "2024-10-07T12:54:05.415Z" }, + { url = "https://files.pythonhosted.org/packages/43/95/55acc9adff8f997c7572f23d41993042290dfb29e404cdadb07039a4386f/propcache-0.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:97e48e8875e6c13909c800fa344cd54cc4b2b0db1d5f911f840458a500fde2c2", size = 208659, upload-time = "2024-10-07T12:54:06.742Z" }, + { url = "https://files.pythonhosted.org/packages/bd/2c/ef7371ff715e6cd19ea03fdd5637ecefbaa0752fee5b0f2fe8ea8407ee01/propcache-0.2.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:388f3217649d6d59292b722d940d4d2e1e6a7003259eb835724092a1cca0203a", size = 222613, upload-time = "2024-10-07T12:54:08.204Z" }, + { url = "https://files.pythonhosted.org/packages/5e/1c/fef251f79fd4971a413fa4b1ae369ee07727b4cc2c71e2d90dfcde664fbb/propcache-0.2.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f571aea50ba5623c308aa146eb650eebf7dbe0fd8c5d946e28343cb3b5aad577", size = 221067, upload-time = "2024-10-07T12:54:10.449Z" }, + { url = "https://files.pythonhosted.org/packages/8d/e7/22e76ae6fc5a1708bdce92bdb49de5ebe89a173db87e4ef597d6bbe9145a/propcache-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3dfafb44f7bb35c0c06eda6b2ab4bfd58f02729e7c4045e179f9a861b07c9850", size = 208920, upload-time = "2024-10-07T12:54:11.903Z" }, + { url = "https://files.pythonhosted.org/packages/04/3e/f10aa562781bcd8a1e0b37683a23bef32bdbe501d9cc7e76969becaac30d/propcache-0.2.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a3ebe9a75be7ab0b7da2464a77bb27febcb4fab46a34f9288f39d74833db7f61", size = 200050, upload-time = "2024-10-07T12:54:13.292Z" }, + { url = "https://files.pythonhosted.org/packages/d0/98/8ac69f638358c5f2a0043809c917802f96f86026e86726b65006830f3dc6/propcache-0.2.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d2f0d0f976985f85dfb5f3d685697ef769faa6b71993b46b295cdbbd6be8cc37", size = 202346, upload-time = "2024-10-07T12:54:14.644Z" }, + { url = "https://files.pythonhosted.org/packages/ee/78/4acfc5544a5075d8e660af4d4e468d60c418bba93203d1363848444511ad/propcache-0.2.0-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:a3dc1a4b165283bd865e8f8cb5f0c64c05001e0718ed06250d8cac9bec115b48", size = 199750, upload-time = "2024-10-07T12:54:16.286Z" }, + { url = "https://files.pythonhosted.org/packages/a2/8f/90ada38448ca2e9cf25adc2fe05d08358bda1b9446f54a606ea38f41798b/propcache-0.2.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:9e0f07b42d2a50c7dd2d8675d50f7343d998c64008f1da5fef888396b7f84630", size = 201279, upload-time = "2024-10-07T12:54:17.752Z" }, + { url = "https://files.pythonhosted.org/packages/08/31/0e299f650f73903da851f50f576ef09bfffc8e1519e6a2f1e5ed2d19c591/propcache-0.2.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:e63e3e1e0271f374ed489ff5ee73d4b6e7c60710e1f76af5f0e1a6117cd26394", size = 211035, upload-time = "2024-10-07T12:54:19.109Z" }, + { url = "https://files.pythonhosted.org/packages/85/3e/e356cc6b09064bff1c06d0b2413593e7c925726f0139bc7acef8a21e87a8/propcache-0.2.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:56bb5c98f058a41bb58eead194b4db8c05b088c93d94d5161728515bd52b052b", size = 215565, upload-time = "2024-10-07T12:54:20.578Z" }, + { url = "https://files.pythonhosted.org/packages/8b/54/4ef7236cd657e53098bd05aa59cbc3cbf7018fba37b40eaed112c3921e51/propcache-0.2.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:7665f04d0c7f26ff8bb534e1c65068409bf4687aa2534faf7104d7182debb336", size = 207604, upload-time = "2024-10-07T12:54:22.588Z" }, + { url = "https://files.pythonhosted.org/packages/1f/27/d01d7799c068443ee64002f0655d82fb067496897bf74b632e28ee6a32cf/propcache-0.2.0-cp310-cp310-win32.whl", hash = "sha256:7cf18abf9764746b9c8704774d8b06714bcb0a63641518a3a89c7f85cc02c2ad", size = 40526, upload-time = "2024-10-07T12:54:23.867Z" }, + { url = "https://files.pythonhosted.org/packages/bb/44/6c2add5eeafb7f31ff0d25fbc005d930bea040a1364cf0f5768750ddf4d1/propcache-0.2.0-cp310-cp310-win_amd64.whl", hash = "sha256:cfac69017ef97db2438efb854edf24f5a29fd09a536ff3a992b75990720cdc99", size = 44958, upload-time = "2024-10-07T12:54:24.983Z" }, + { url = "https://files.pythonhosted.org/packages/e0/1c/71eec730e12aec6511e702ad0cd73c2872eccb7cad39de8ba3ba9de693ef/propcache-0.2.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:63f13bf09cc3336eb04a837490b8f332e0db41da66995c9fd1ba04552e516354", size = 80811, upload-time = "2024-10-07T12:54:26.165Z" }, + { url = "https://files.pythonhosted.org/packages/89/c3/7e94009f9a4934c48a371632197406a8860b9f08e3f7f7d922ab69e57a41/propcache-0.2.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:608cce1da6f2672a56b24a015b42db4ac612ee709f3d29f27a00c943d9e851de", size = 46365, upload-time = "2024-10-07T12:54:28.034Z" }, + { url = "https://files.pythonhosted.org/packages/c0/1d/c700d16d1d6903aeab28372fe9999762f074b80b96a0ccc953175b858743/propcache-0.2.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:466c219deee4536fbc83c08d09115249db301550625c7fef1c5563a584c9bc87", size = 45602, upload-time = "2024-10-07T12:54:29.148Z" }, + { url = "https://files.pythonhosted.org/packages/2e/5e/4a3e96380805bf742712e39a4534689f4cddf5fa2d3a93f22e9fd8001b23/propcache-0.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fc2db02409338bf36590aa985a461b2c96fce91f8e7e0f14c50c5fcc4f229016", size = 236161, upload-time = "2024-10-07T12:54:31.557Z" }, + { url = "https://files.pythonhosted.org/packages/a5/85/90132481183d1436dff6e29f4fa81b891afb6cb89a7306f32ac500a25932/propcache-0.2.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a6ed8db0a556343d566a5c124ee483ae113acc9a557a807d439bcecc44e7dfbb", size = 244938, upload-time = "2024-10-07T12:54:33.051Z" }, + { url = "https://files.pythonhosted.org/packages/4a/89/c893533cb45c79c970834274e2d0f6d64383ec740be631b6a0a1d2b4ddc0/propcache-0.2.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:91997d9cb4a325b60d4e3f20967f8eb08dfcb32b22554d5ef78e6fd1dda743a2", size = 243576, upload-time = "2024-10-07T12:54:34.497Z" }, + { url = "https://files.pythonhosted.org/packages/8c/56/98c2054c8526331a05f205bf45cbb2cda4e58e56df70e76d6a509e5d6ec6/propcache-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c7dde9e533c0a49d802b4f3f218fa9ad0a1ce21f2c2eb80d5216565202acab4", size = 236011, upload-time = "2024-10-07T12:54:35.903Z" }, + { url = "https://files.pythonhosted.org/packages/2d/0c/8b8b9f8a6e1abd869c0fa79b907228e7abb966919047d294ef5df0d136cf/propcache-0.2.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ffcad6c564fe6b9b8916c1aefbb37a362deebf9394bd2974e9d84232e3e08504", size = 224834, upload-time = "2024-10-07T12:54:37.238Z" }, + { url = "https://files.pythonhosted.org/packages/18/bb/397d05a7298b7711b90e13108db697732325cafdcd8484c894885c1bf109/propcache-0.2.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:97a58a28bcf63284e8b4d7b460cbee1edaab24634e82059c7b8c09e65284f178", size = 224946, upload-time = "2024-10-07T12:54:38.72Z" }, + { url = "https://files.pythonhosted.org/packages/25/19/4fc08dac19297ac58135c03770b42377be211622fd0147f015f78d47cd31/propcache-0.2.0-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:945db8ee295d3af9dbdbb698cce9bbc5c59b5c3fe328bbc4387f59a8a35f998d", size = 217280, upload-time = "2024-10-07T12:54:40.089Z" }, + { url = "https://files.pythonhosted.org/packages/7e/76/c79276a43df2096ce2aba07ce47576832b1174c0c480fe6b04bd70120e59/propcache-0.2.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:39e104da444a34830751715f45ef9fc537475ba21b7f1f5b0f4d71a3b60d7fe2", size = 220088, upload-time = "2024-10-07T12:54:41.726Z" }, + { url = "https://files.pythonhosted.org/packages/c3/9a/8a8cf428a91b1336b883f09c8b884e1734c87f724d74b917129a24fe2093/propcache-0.2.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:c5ecca8f9bab618340c8e848d340baf68bcd8ad90a8ecd7a4524a81c1764b3db", size = 233008, upload-time = "2024-10-07T12:54:43.742Z" }, + { url = "https://files.pythonhosted.org/packages/25/7b/768a8969abd447d5f0f3333df85c6a5d94982a1bc9a89c53c154bf7a8b11/propcache-0.2.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:c436130cc779806bdf5d5fae0d848713105472b8566b75ff70048c47d3961c5b", size = 237719, upload-time = "2024-10-07T12:54:45.065Z" }, + { url = "https://files.pythonhosted.org/packages/ed/0d/e5d68ccc7976ef8b57d80613ac07bbaf0614d43f4750cf953f0168ef114f/propcache-0.2.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:191db28dc6dcd29d1a3e063c3be0b40688ed76434622c53a284e5427565bbd9b", size = 227729, upload-time = "2024-10-07T12:54:46.405Z" }, + { url = "https://files.pythonhosted.org/packages/05/64/17eb2796e2d1c3d0c431dc5f40078d7282f4645af0bb4da9097fbb628c6c/propcache-0.2.0-cp311-cp311-win32.whl", hash = "sha256:5f2564ec89058ee7c7989a7b719115bdfe2a2fb8e7a4543b8d1c0cc4cf6478c1", size = 40473, upload-time = "2024-10-07T12:54:47.694Z" }, + { url = "https://files.pythonhosted.org/packages/83/c5/e89fc428ccdc897ade08cd7605f174c69390147526627a7650fb883e0cd0/propcache-0.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:6e2e54267980349b723cff366d1e29b138b9a60fa376664a157a342689553f71", size = 44921, upload-time = "2024-10-07T12:54:48.935Z" }, + { url = "https://files.pythonhosted.org/packages/7c/46/a41ca1097769fc548fc9216ec4c1471b772cc39720eb47ed7e38ef0006a9/propcache-0.2.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:2ee7606193fb267be4b2e3b32714f2d58cad27217638db98a60f9efb5efeccc2", size = 80800, upload-time = "2024-10-07T12:54:50.409Z" }, + { url = "https://files.pythonhosted.org/packages/75/4f/93df46aab9cc473498ff56be39b5f6ee1e33529223d7a4d8c0a6101a9ba2/propcache-0.2.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:91ee8fc02ca52e24bcb77b234f22afc03288e1dafbb1f88fe24db308910c4ac7", size = 46443, upload-time = "2024-10-07T12:54:51.634Z" }, + { url = "https://files.pythonhosted.org/packages/0b/17/308acc6aee65d0f9a8375e36c4807ac6605d1f38074b1581bd4042b9fb37/propcache-0.2.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2e900bad2a8456d00a113cad8c13343f3b1f327534e3589acc2219729237a2e8", size = 45676, upload-time = "2024-10-07T12:54:53.454Z" }, + { url = "https://files.pythonhosted.org/packages/65/44/626599d2854d6c1d4530b9a05e7ff2ee22b790358334b475ed7c89f7d625/propcache-0.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f52a68c21363c45297aca15561812d542f8fc683c85201df0bebe209e349f793", size = 246191, upload-time = "2024-10-07T12:54:55.438Z" }, + { url = "https://files.pythonhosted.org/packages/f2/df/5d996d7cb18df076debae7d76ac3da085c0575a9f2be6b1f707fe227b54c/propcache-0.2.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1e41d67757ff4fbc8ef2af99b338bfb955010444b92929e9e55a6d4dcc3c4f09", size = 251791, upload-time = "2024-10-07T12:54:57.441Z" }, + { url = "https://files.pythonhosted.org/packages/2e/6d/9f91e5dde8b1f662f6dd4dff36098ed22a1ef4e08e1316f05f4758f1576c/propcache-0.2.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a64e32f8bd94c105cc27f42d3b658902b5bcc947ece3c8fe7bc1b05982f60e89", size = 253434, upload-time = "2024-10-07T12:54:58.857Z" }, + { url = "https://files.pythonhosted.org/packages/3c/e9/1b54b7e26f50b3e0497cd13d3483d781d284452c2c50dd2a615a92a087a3/propcache-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:55346705687dbd7ef0d77883ab4f6fabc48232f587925bdaf95219bae072491e", size = 248150, upload-time = "2024-10-07T12:55:00.19Z" }, + { url = "https://files.pythonhosted.org/packages/a7/ef/a35bf191c8038fe3ce9a414b907371c81d102384eda5dbafe6f4dce0cf9b/propcache-0.2.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:00181262b17e517df2cd85656fcd6b4e70946fe62cd625b9d74ac9977b64d8d9", size = 233568, upload-time = "2024-10-07T12:55:01.723Z" }, + { url = "https://files.pythonhosted.org/packages/97/d9/d00bb9277a9165a5e6d60f2142cd1a38a750045c9c12e47ae087f686d781/propcache-0.2.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6994984550eaf25dd7fc7bd1b700ff45c894149341725bb4edc67f0ffa94efa4", size = 229874, upload-time = "2024-10-07T12:55:03.962Z" }, + { url = "https://files.pythonhosted.org/packages/8e/78/c123cf22469bdc4b18efb78893e69c70a8b16de88e6160b69ca6bdd88b5d/propcache-0.2.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:56295eb1e5f3aecd516d91b00cfd8bf3a13991de5a479df9e27dd569ea23959c", size = 225857, upload-time = "2024-10-07T12:55:06.439Z" }, + { url = "https://files.pythonhosted.org/packages/31/1b/fd6b2f1f36d028820d35475be78859d8c89c8f091ad30e377ac49fd66359/propcache-0.2.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:439e76255daa0f8151d3cb325f6dd4a3e93043e6403e6491813bcaaaa8733887", size = 227604, upload-time = "2024-10-07T12:55:08.254Z" }, + { url = "https://files.pythonhosted.org/packages/99/36/b07be976edf77a07233ba712e53262937625af02154353171716894a86a6/propcache-0.2.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:f6475a1b2ecb310c98c28d271a30df74f9dd436ee46d09236a6b750a7599ce57", size = 238430, upload-time = "2024-10-07T12:55:09.766Z" }, + { url = "https://files.pythonhosted.org/packages/0d/64/5822f496c9010e3966e934a011ac08cac8734561842bc7c1f65586e0683c/propcache-0.2.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:3444cdba6628accf384e349014084b1cacd866fbb88433cd9d279d90a54e0b23", size = 244814, upload-time = "2024-10-07T12:55:11.145Z" }, + { url = "https://files.pythonhosted.org/packages/fd/bd/8657918a35d50b18a9e4d78a5df7b6c82a637a311ab20851eef4326305c1/propcache-0.2.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:4a9d9b4d0a9b38d1c391bb4ad24aa65f306c6f01b512e10a8a34a2dc5675d348", size = 235922, upload-time = "2024-10-07T12:55:12.508Z" }, + { url = "https://files.pythonhosted.org/packages/a8/6f/ec0095e1647b4727db945213a9f395b1103c442ef65e54c62e92a72a3f75/propcache-0.2.0-cp312-cp312-win32.whl", hash = "sha256:69d3a98eebae99a420d4b28756c8ce6ea5a29291baf2dc9ff9414b42676f61d5", size = 40177, upload-time = "2024-10-07T12:55:13.814Z" }, + { url = "https://files.pythonhosted.org/packages/20/a2/bd0896fdc4f4c1db46d9bc361c8c79a9bf08ccc08ba054a98e38e7ba1557/propcache-0.2.0-cp312-cp312-win_amd64.whl", hash = "sha256:ad9c9b99b05f163109466638bd30ada1722abb01bbb85c739c50b6dc11f92dc3", size = 44446, upload-time = "2024-10-07T12:55:14.972Z" }, + { url = "https://files.pythonhosted.org/packages/a8/a7/5f37b69197d4f558bfef5b4bceaff7c43cc9b51adf5bd75e9081d7ea80e4/propcache-0.2.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ecddc221a077a8132cf7c747d5352a15ed763b674c0448d811f408bf803d9ad7", size = 78120, upload-time = "2024-10-07T12:55:16.179Z" }, + { url = "https://files.pythonhosted.org/packages/c8/cd/48ab2b30a6b353ecb95a244915f85756d74f815862eb2ecc7a518d565b48/propcache-0.2.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:0e53cb83fdd61cbd67202735e6a6687a7b491c8742dfc39c9e01e80354956763", size = 45127, upload-time = "2024-10-07T12:55:18.275Z" }, + { url = "https://files.pythonhosted.org/packages/a5/ba/0a1ef94a3412aab057bd996ed5f0ac7458be5bf469e85c70fa9ceb43290b/propcache-0.2.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:92fe151145a990c22cbccf9ae15cae8ae9eddabfc949a219c9f667877e40853d", size = 44419, upload-time = "2024-10-07T12:55:19.487Z" }, + { url = "https://files.pythonhosted.org/packages/b4/6c/ca70bee4f22fa99eacd04f4d2f1699be9d13538ccf22b3169a61c60a27fa/propcache-0.2.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d6a21ef516d36909931a2967621eecb256018aeb11fc48656e3257e73e2e247a", size = 229611, upload-time = "2024-10-07T12:55:21.377Z" }, + { url = "https://files.pythonhosted.org/packages/19/70/47b872a263e8511ca33718d96a10c17d3c853aefadeb86dc26e8421184b9/propcache-0.2.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3f88a4095e913f98988f5b338c1d4d5d07dbb0b6bad19892fd447484e483ba6b", size = 234005, upload-time = "2024-10-07T12:55:22.898Z" }, + { url = "https://files.pythonhosted.org/packages/4f/be/3b0ab8c84a22e4a3224719099c1229ddfdd8a6a1558cf75cb55ee1e35c25/propcache-0.2.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5a5b3bb545ead161be780ee85a2b54fdf7092815995661947812dde94a40f6fb", size = 237270, upload-time = "2024-10-07T12:55:24.354Z" }, + { url = "https://files.pythonhosted.org/packages/04/d8/f071bb000d4b8f851d312c3c75701e586b3f643fe14a2e3409b1b9ab3936/propcache-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:67aeb72e0f482709991aa91345a831d0b707d16b0257e8ef88a2ad246a7280bf", size = 231877, upload-time = "2024-10-07T12:55:25.774Z" }, + { url = "https://files.pythonhosted.org/packages/93/e7/57a035a1359e542bbb0a7df95aad6b9871ebee6dce2840cb157a415bd1f3/propcache-0.2.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3c997f8c44ec9b9b0bcbf2d422cc00a1d9b9c681f56efa6ca149a941e5560da2", size = 217848, upload-time = "2024-10-07T12:55:27.148Z" }, + { url = "https://files.pythonhosted.org/packages/f0/93/d1dea40f112ec183398fb6c42fde340edd7bab202411c4aa1a8289f461b6/propcache-0.2.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:2a66df3d4992bc1d725b9aa803e8c5a66c010c65c741ad901e260ece77f58d2f", size = 216987, upload-time = "2024-10-07T12:55:29.294Z" }, + { url = "https://files.pythonhosted.org/packages/62/4c/877340871251145d3522c2b5d25c16a1690ad655fbab7bb9ece6b117e39f/propcache-0.2.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:3ebbcf2a07621f29638799828b8d8668c421bfb94c6cb04269130d8de4fb7136", size = 212451, upload-time = "2024-10-07T12:55:30.643Z" }, + { url = "https://files.pythonhosted.org/packages/7c/bb/a91b72efeeb42906ef58ccf0cdb87947b54d7475fee3c93425d732f16a61/propcache-0.2.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:1235c01ddaa80da8235741e80815ce381c5267f96cc49b1477fdcf8c047ef325", size = 212879, upload-time = "2024-10-07T12:55:32.024Z" }, + { url = "https://files.pythonhosted.org/packages/9b/7f/ee7fea8faac57b3ec5d91ff47470c6c5d40d7f15d0b1fccac806348fa59e/propcache-0.2.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:3947483a381259c06921612550867b37d22e1df6d6d7e8361264b6d037595f44", size = 222288, upload-time = "2024-10-07T12:55:33.401Z" }, + { url = "https://files.pythonhosted.org/packages/ff/d7/acd67901c43d2e6b20a7a973d9d5fd543c6e277af29b1eb0e1f7bd7ca7d2/propcache-0.2.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:d5bed7f9805cc29c780f3aee05de3262ee7ce1f47083cfe9f77471e9d6777e83", size = 228257, upload-time = "2024-10-07T12:55:35.381Z" }, + { url = "https://files.pythonhosted.org/packages/8d/6f/6272ecc7a8daad1d0754cfc6c8846076a8cb13f810005c79b15ce0ef0cf2/propcache-0.2.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e4a91d44379f45f5e540971d41e4626dacd7f01004826a18cb048e7da7e96544", size = 221075, upload-time = "2024-10-07T12:55:36.789Z" }, + { url = "https://files.pythonhosted.org/packages/7c/bd/c7a6a719a6b3dd8b3aeadb3675b5783983529e4a3185946aa444d3e078f6/propcache-0.2.0-cp313-cp313-win32.whl", hash = "sha256:f902804113e032e2cdf8c71015651c97af6418363bea8d78dc0911d56c335032", size = 39654, upload-time = "2024-10-07T12:55:38.762Z" }, + { url = "https://files.pythonhosted.org/packages/88/e7/0eef39eff84fa3e001b44de0bd41c7c0e3432e7648ffd3d64955910f002d/propcache-0.2.0-cp313-cp313-win_amd64.whl", hash = "sha256:8f188cfcc64fb1266f4684206c9de0e80f54622c3f22a910cbd200478aeae61e", size = 43705, upload-time = "2024-10-07T12:55:39.921Z" }, + { url = "https://files.pythonhosted.org/packages/b4/94/2c3d64420fd58ed462e2b416386d48e72dec027cf7bb572066cf3866e939/propcache-0.2.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:53d1bd3f979ed529f0805dd35ddaca330f80a9a6d90bc0121d2ff398f8ed8861", size = 82315, upload-time = "2024-10-07T12:55:41.166Z" }, + { url = "https://files.pythonhosted.org/packages/73/b7/9e2a17d9a126f2012b22ddc5d0979c28ca75104e24945214790c1d787015/propcache-0.2.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:83928404adf8fb3d26793665633ea79b7361efa0287dfbd372a7e74311d51ee6", size = 47188, upload-time = "2024-10-07T12:55:42.316Z" }, + { url = "https://files.pythonhosted.org/packages/80/ef/18af27caaae5589c08bb5a461cfa136b83b7e7983be604f2140d91f92b97/propcache-0.2.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:77a86c261679ea5f3896ec060be9dc8e365788248cc1e049632a1be682442063", size = 46314, upload-time = "2024-10-07T12:55:43.544Z" }, + { url = "https://files.pythonhosted.org/packages/fa/df/8dbd3e472baf73251c0fbb571a3f0a4e3a40c52a1c8c2a6c46ab08736ff9/propcache-0.2.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:218db2a3c297a3768c11a34812e63b3ac1c3234c3a086def9c0fee50d35add1f", size = 212874, upload-time = "2024-10-07T12:55:44.823Z" }, + { url = "https://files.pythonhosted.org/packages/7c/57/5d4d783ac594bd56434679b8643673ae12de1ce758116fd8912a7f2313ec/propcache-0.2.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7735e82e3498c27bcb2d17cb65d62c14f1100b71723b68362872bca7d0913d90", size = 224578, upload-time = "2024-10-07T12:55:46.253Z" }, + { url = "https://files.pythonhosted.org/packages/66/27/072be8ad434c9a3aa1b561f527984ea0ed4ac072fd18dfaaa2aa2d6e6a2b/propcache-0.2.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:20a617c776f520c3875cf4511e0d1db847a076d720714ae35ffe0df3e440be68", size = 222636, upload-time = "2024-10-07T12:55:47.608Z" }, + { url = "https://files.pythonhosted.org/packages/c3/f1/69a30ff0928d07f50bdc6f0147fd9a08e80904fd3fdb711785e518de1021/propcache-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:67b69535c870670c9f9b14a75d28baa32221d06f6b6fa6f77a0a13c5a7b0a5b9", size = 213573, upload-time = "2024-10-07T12:55:49.82Z" }, + { url = "https://files.pythonhosted.org/packages/a8/2e/c16716ae113fe0a3219978df3665a6fea049d81d50bd28c4ae72a4c77567/propcache-0.2.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4569158070180c3855e9c0791c56be3ceeb192defa2cdf6a3f39e54319e56b89", size = 205438, upload-time = "2024-10-07T12:55:51.231Z" }, + { url = "https://files.pythonhosted.org/packages/e1/df/80e2c5cd5ed56a7bfb1aa58cedb79617a152ae43de7c0a7e800944a6b2e2/propcache-0.2.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:db47514ffdbd91ccdc7e6f8407aac4ee94cc871b15b577c1c324236b013ddd04", size = 202352, upload-time = "2024-10-07T12:55:52.596Z" }, + { url = "https://files.pythonhosted.org/packages/0f/4e/79f665fa04839f30ffb2903211c718b9660fbb938ac7a4df79525af5aeb3/propcache-0.2.0-cp38-cp38-musllinux_1_2_armv7l.whl", hash = "sha256:2a60ad3e2553a74168d275a0ef35e8c0a965448ffbc3b300ab3a5bb9956c2162", size = 200476, upload-time = "2024-10-07T12:55:54.016Z" }, + { url = "https://files.pythonhosted.org/packages/a9/39/b9ea7b011521dd7cfd2f89bb6b8b304f3c789ea6285445bc145bebc83094/propcache-0.2.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:662dd62358bdeaca0aee5761de8727cfd6861432e3bb828dc2a693aa0471a563", size = 201581, upload-time = "2024-10-07T12:55:56.246Z" }, + { url = "https://files.pythonhosted.org/packages/e4/81/e8e96c97aa0b675a14e37b12ca9c9713b15cfacf0869e64bf3ab389fabf1/propcache-0.2.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:25a1f88b471b3bc911d18b935ecb7115dff3a192b6fef46f0bfaf71ff4f12418", size = 225628, upload-time = "2024-10-07T12:55:57.686Z" }, + { url = "https://files.pythonhosted.org/packages/eb/99/15f998c502c214f6c7f51462937605d514a8943a9a6c1fa10f40d2710976/propcache-0.2.0-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:f60f0ac7005b9f5a6091009b09a419ace1610e163fa5deaba5ce3484341840e7", size = 229270, upload-time = "2024-10-07T12:55:59.065Z" }, + { url = "https://files.pythonhosted.org/packages/ff/3a/a9f1a0c0e5b994b8f1a1c71bea56bb3e9eeec821cb4dd61e14051c4ba00b/propcache-0.2.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:74acd6e291f885678631b7ebc85d2d4aec458dd849b8c841b57ef04047833bed", size = 207771, upload-time = "2024-10-07T12:56:00.393Z" }, + { url = "https://files.pythonhosted.org/packages/ff/3e/6103906a66d6713f32880cf6a5ba84a1406b4d66e1b9389bb9b8e1789f9e/propcache-0.2.0-cp38-cp38-win32.whl", hash = "sha256:d9b6ddac6408194e934002a69bcaadbc88c10b5f38fb9307779d1c629181815d", size = 41015, upload-time = "2024-10-07T12:56:01.953Z" }, + { url = "https://files.pythonhosted.org/packages/37/23/a30214b4c1f2bea24cc1197ef48d67824fbc41d5cf5472b17c37fef6002c/propcache-0.2.0-cp38-cp38-win_amd64.whl", hash = "sha256:676135dcf3262c9c5081cc8f19ad55c8a64e3f7282a21266d05544450bffc3a5", size = 45749, upload-time = "2024-10-07T12:56:03.095Z" }, + { url = "https://files.pythonhosted.org/packages/38/05/797e6738c9f44ab5039e3ff329540c934eabbe8ad7e63c305c75844bc86f/propcache-0.2.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:25c8d773a62ce0451b020c7b29a35cfbc05de8b291163a7a0f3b7904f27253e6", size = 81903, upload-time = "2024-10-07T12:56:04.651Z" }, + { url = "https://files.pythonhosted.org/packages/9f/84/8d5edb9a73e1a56b24dd8f2adb6aac223109ff0e8002313d52e5518258ba/propcache-0.2.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:375a12d7556d462dc64d70475a9ee5982465fbb3d2b364f16b86ba9135793638", size = 46960, upload-time = "2024-10-07T12:56:06.38Z" }, + { url = "https://files.pythonhosted.org/packages/e7/77/388697bedda984af0d12d68e536b98129b167282da3401965c8450de510e/propcache-0.2.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1ec43d76b9677637a89d6ab86e1fef70d739217fefa208c65352ecf0282be957", size = 46133, upload-time = "2024-10-07T12:56:07.606Z" }, + { url = "https://files.pythonhosted.org/packages/e2/dc/60d444610bc5b1d7a758534f58362b1bcee736a785473f8a39c91f05aad1/propcache-0.2.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f45eec587dafd4b2d41ac189c2156461ebd0c1082d2fe7013571598abb8505d1", size = 211105, upload-time = "2024-10-07T12:56:08.826Z" }, + { url = "https://files.pythonhosted.org/packages/bc/c6/40eb0dd1de6f8e84f454615ab61f68eb4a58f9d63d6f6eaf04300ac0cc17/propcache-0.2.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bc092ba439d91df90aea38168e11f75c655880c12782facf5cf9c00f3d42b562", size = 226613, upload-time = "2024-10-07T12:56:11.184Z" }, + { url = "https://files.pythonhosted.org/packages/de/b6/e078b5e9de58e20db12135eb6a206b4b43cb26c6b62ee0fe36ac40763a64/propcache-0.2.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fa1076244f54bb76e65e22cb6910365779d5c3d71d1f18b275f1dfc7b0d71b4d", size = 225587, upload-time = "2024-10-07T12:56:15.294Z" }, + { url = "https://files.pythonhosted.org/packages/ce/4e/97059dd24494d1c93d1efb98bb24825e1930265b41858dd59c15cb37a975/propcache-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:682a7c79a2fbf40f5dbb1eb6bfe2cd865376deeac65acf9beb607505dced9e12", size = 211826, upload-time = "2024-10-07T12:56:16.997Z" }, + { url = "https://files.pythonhosted.org/packages/fc/23/4dbf726602a989d2280fe130a9b9dd71faa8d3bb8cd23d3261ff3c23f692/propcache-0.2.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8e40876731f99b6f3c897b66b803c9e1c07a989b366c6b5b475fafd1f7ba3fb8", size = 203140, upload-time = "2024-10-07T12:56:18.368Z" }, + { url = "https://files.pythonhosted.org/packages/5b/ce/f3bff82c885dbd9ae9e43f134d5b02516c3daa52d46f7a50e4f52ef9121f/propcache-0.2.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:363ea8cd3c5cb6679f1c2f5f1f9669587361c062e4899fce56758efa928728f8", size = 208841, upload-time = "2024-10-07T12:56:19.859Z" }, + { url = "https://files.pythonhosted.org/packages/29/d7/19a4d3b4c7e95d08f216da97035d0b103d0c90411c6f739d47088d2da1f0/propcache-0.2.0-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:140fbf08ab3588b3468932974a9331aff43c0ab8a2ec2c608b6d7d1756dbb6cb", size = 203315, upload-time = "2024-10-07T12:56:21.256Z" }, + { url = "https://files.pythonhosted.org/packages/db/87/5748212a18beb8d4ab46315c55ade8960d1e2cdc190764985b2d229dd3f4/propcache-0.2.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:e70fac33e8b4ac63dfc4c956fd7d85a0b1139adcfc0d964ce288b7c527537fea", size = 204724, upload-time = "2024-10-07T12:56:23.644Z" }, + { url = "https://files.pythonhosted.org/packages/84/2a/c3d2f989fc571a5bad0fabcd970669ccb08c8f9b07b037ecddbdab16a040/propcache-0.2.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:b33d7a286c0dc1a15f5fc864cc48ae92a846df287ceac2dd499926c3801054a6", size = 215514, upload-time = "2024-10-07T12:56:25.733Z" }, + { url = "https://files.pythonhosted.org/packages/c9/1f/4c44c133b08bc5f776afcb8f0833889c2636b8a83e07ea1d9096c1e401b0/propcache-0.2.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:f6d5749fdd33d90e34c2efb174c7e236829147a2713334d708746e94c4bde40d", size = 220063, upload-time = "2024-10-07T12:56:28.497Z" }, + { url = "https://files.pythonhosted.org/packages/2e/25/280d0a3bdaee68db74c0acd9a472e59e64b516735b59cffd3a326ff9058a/propcache-0.2.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:22aa8f2272d81d9317ff5756bb108021a056805ce63dd3630e27d042c8092798", size = 211620, upload-time = "2024-10-07T12:56:29.891Z" }, + { url = "https://files.pythonhosted.org/packages/28/8c/266898981b7883c1563c35954f9ce9ced06019fdcc487a9520150c48dc91/propcache-0.2.0-cp39-cp39-win32.whl", hash = "sha256:73e4b40ea0eda421b115248d7e79b59214411109a5bc47d0d48e4c73e3b8fcf9", size = 41049, upload-time = "2024-10-07T12:56:31.246Z" }, + { url = "https://files.pythonhosted.org/packages/af/53/a3e5b937f58e757a940716b88105ec4c211c42790c1ea17052b46dc16f16/propcache-0.2.0-cp39-cp39-win_amd64.whl", hash = "sha256:9517d5e9e0731957468c29dbfd0f976736a0e55afaea843726e887f36fe017df", size = 45587, upload-time = "2024-10-07T12:56:33.416Z" }, + { url = "https://files.pythonhosted.org/packages/3d/b6/e6d98278f2d49b22b4d033c9f792eda783b9ab2094b041f013fc69bcde87/propcache-0.2.0-py3-none-any.whl", hash = "sha256:2ccc28197af5313706511fab3a8b66dcd6da067a1331372c82ea1cb74285e036", size = 11603, upload-time = "2024-10-07T12:56:35.137Z" }, +] + +[[package]] +name = "propcache" +version = "0.3.2" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.9'", +] +sdist = { url = "https://files.pythonhosted.org/packages/a6/16/43264e4a779dd8588c21a70f0709665ee8f611211bdd2c87d952cfa7c776/propcache-0.3.2.tar.gz", hash = "sha256:20d7d62e4e7ef05f221e0db2856b979540686342e7dd9973b815599c7057e168", size = 44139, upload-time = "2025-06-09T22:56:06.081Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ab/14/510deed325e262afeb8b360043c5d7c960da7d3ecd6d6f9496c9c56dc7f4/propcache-0.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:22d9962a358aedbb7a2e36187ff273adeaab9743373a272976d2e348d08c7770", size = 73178, upload-time = "2025-06-09T22:53:40.126Z" }, + { url = "https://files.pythonhosted.org/packages/cd/4e/ad52a7925ff01c1325653a730c7ec3175a23f948f08626a534133427dcff/propcache-0.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0d0fda578d1dc3f77b6b5a5dce3b9ad69a8250a891760a548df850a5e8da87f3", size = 43133, upload-time = "2025-06-09T22:53:41.965Z" }, + { url = "https://files.pythonhosted.org/packages/63/7c/e9399ba5da7780871db4eac178e9c2e204c23dd3e7d32df202092a1ed400/propcache-0.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3def3da3ac3ce41562d85db655d18ebac740cb3fa4367f11a52b3da9d03a5cc3", size = 43039, upload-time = "2025-06-09T22:53:43.268Z" }, + { url = "https://files.pythonhosted.org/packages/22/e1/58da211eb8fdc6fc854002387d38f415a6ca5f5c67c1315b204a5d3e9d7a/propcache-0.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9bec58347a5a6cebf239daba9bda37dffec5b8d2ce004d9fe4edef3d2815137e", size = 201903, upload-time = "2025-06-09T22:53:44.872Z" }, + { url = "https://files.pythonhosted.org/packages/c4/0a/550ea0f52aac455cb90111c8bab995208443e46d925e51e2f6ebdf869525/propcache-0.3.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:55ffda449a507e9fbd4aca1a7d9aa6753b07d6166140e5a18d2ac9bc49eac220", size = 213362, upload-time = "2025-06-09T22:53:46.707Z" }, + { url = "https://files.pythonhosted.org/packages/5a/af/9893b7d878deda9bb69fcf54600b247fba7317761b7db11fede6e0f28bd0/propcache-0.3.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:64a67fb39229a8a8491dd42f864e5e263155e729c2e7ff723d6e25f596b1e8cb", size = 210525, upload-time = "2025-06-09T22:53:48.547Z" }, + { url = "https://files.pythonhosted.org/packages/7c/bb/38fd08b278ca85cde36d848091ad2b45954bc5f15cce494bb300b9285831/propcache-0.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9da1cf97b92b51253d5b68cf5a2b9e0dafca095e36b7f2da335e27dc6172a614", size = 198283, upload-time = "2025-06-09T22:53:50.067Z" }, + { url = "https://files.pythonhosted.org/packages/78/8c/9fe55bd01d362bafb413dfe508c48753111a1e269737fa143ba85693592c/propcache-0.3.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5f559e127134b07425134b4065be45b166183fdcb433cb6c24c8e4149056ad50", size = 191872, upload-time = "2025-06-09T22:53:51.438Z" }, + { url = "https://files.pythonhosted.org/packages/54/14/4701c33852937a22584e08abb531d654c8bcf7948a8f87ad0a4822394147/propcache-0.3.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:aff2e4e06435d61f11a428360a932138d0ec288b0a31dd9bd78d200bd4a2b339", size = 199452, upload-time = "2025-06-09T22:53:53.229Z" }, + { url = "https://files.pythonhosted.org/packages/16/44/447f2253d859602095356007657ee535e0093215ea0b3d1d6a41d16e5201/propcache-0.3.2-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:4927842833830942a5d0a56e6f4839bc484785b8e1ce8d287359794818633ba0", size = 191567, upload-time = "2025-06-09T22:53:54.541Z" }, + { url = "https://files.pythonhosted.org/packages/f2/b3/e4756258749bb2d3b46defcff606a2f47410bab82be5824a67e84015b267/propcache-0.3.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:6107ddd08b02654a30fb8ad7a132021759d750a82578b94cd55ee2772b6ebea2", size = 193015, upload-time = "2025-06-09T22:53:56.44Z" }, + { url = "https://files.pythonhosted.org/packages/1e/df/e6d3c7574233164b6330b9fd697beeac402afd367280e6dc377bb99b43d9/propcache-0.3.2-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:70bd8b9cd6b519e12859c99f3fc9a93f375ebd22a50296c3a295028bea73b9e7", size = 204660, upload-time = "2025-06-09T22:53:57.839Z" }, + { url = "https://files.pythonhosted.org/packages/b2/53/e4d31dd5170b4a0e2e6b730f2385a96410633b4833dc25fe5dffd1f73294/propcache-0.3.2-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:2183111651d710d3097338dd1893fcf09c9f54e27ff1a8795495a16a469cc90b", size = 206105, upload-time = "2025-06-09T22:53:59.638Z" }, + { url = "https://files.pythonhosted.org/packages/7f/fe/74d54cf9fbe2a20ff786e5f7afcfde446588f0cf15fb2daacfbc267b866c/propcache-0.3.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:fb075ad271405dcad8e2a7ffc9a750a3bf70e533bd86e89f0603e607b93aa64c", size = 196980, upload-time = "2025-06-09T22:54:01.071Z" }, + { url = "https://files.pythonhosted.org/packages/22/ec/c469c9d59dada8a7679625e0440b544fe72e99311a4679c279562051f6fc/propcache-0.3.2-cp310-cp310-win32.whl", hash = "sha256:404d70768080d3d3bdb41d0771037da19d8340d50b08e104ca0e7f9ce55fce70", size = 37679, upload-time = "2025-06-09T22:54:03.003Z" }, + { url = "https://files.pythonhosted.org/packages/38/35/07a471371ac89d418f8d0b699c75ea6dca2041fbda360823de21f6a9ce0a/propcache-0.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:7435d766f978b4ede777002e6b3b6641dd229cd1da8d3d3106a45770365f9ad9", size = 41459, upload-time = "2025-06-09T22:54:04.134Z" }, + { url = "https://files.pythonhosted.org/packages/80/8d/e8b436717ab9c2cfc23b116d2c297305aa4cd8339172a456d61ebf5669b8/propcache-0.3.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:0b8d2f607bd8f80ddc04088bc2a037fdd17884a6fcadc47a96e334d72f3717be", size = 74207, upload-time = "2025-06-09T22:54:05.399Z" }, + { url = "https://files.pythonhosted.org/packages/d6/29/1e34000e9766d112171764b9fa3226fa0153ab565d0c242c70e9945318a7/propcache-0.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:06766d8f34733416e2e34f46fea488ad5d60726bb9481d3cddf89a6fa2d9603f", size = 43648, upload-time = "2025-06-09T22:54:08.023Z" }, + { url = "https://files.pythonhosted.org/packages/46/92/1ad5af0df781e76988897da39b5f086c2bf0f028b7f9bd1f409bb05b6874/propcache-0.3.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a2dc1f4a1df4fecf4e6f68013575ff4af84ef6f478fe5344317a65d38a8e6dc9", size = 43496, upload-time = "2025-06-09T22:54:09.228Z" }, + { url = "https://files.pythonhosted.org/packages/b3/ce/e96392460f9fb68461fabab3e095cb00c8ddf901205be4eae5ce246e5b7e/propcache-0.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:be29c4f4810c5789cf10ddf6af80b041c724e629fa51e308a7a0fb19ed1ef7bf", size = 217288, upload-time = "2025-06-09T22:54:10.466Z" }, + { url = "https://files.pythonhosted.org/packages/c5/2a/866726ea345299f7ceefc861a5e782b045545ae6940851930a6adaf1fca6/propcache-0.3.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:59d61f6970ecbd8ff2e9360304d5c8876a6abd4530cb752c06586849ac8a9dc9", size = 227456, upload-time = "2025-06-09T22:54:11.828Z" }, + { url = "https://files.pythonhosted.org/packages/de/03/07d992ccb6d930398689187e1b3c718339a1c06b8b145a8d9650e4726166/propcache-0.3.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:62180e0b8dbb6b004baec00a7983e4cc52f5ada9cd11f48c3528d8cfa7b96a66", size = 225429, upload-time = "2025-06-09T22:54:13.823Z" }, + { url = "https://files.pythonhosted.org/packages/5d/e6/116ba39448753b1330f48ab8ba927dcd6cf0baea8a0ccbc512dfb49ba670/propcache-0.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c144ca294a204c470f18cf4c9d78887810d04a3e2fbb30eea903575a779159df", size = 213472, upload-time = "2025-06-09T22:54:15.232Z" }, + { url = "https://files.pythonhosted.org/packages/a6/85/f01f5d97e54e428885a5497ccf7f54404cbb4f906688a1690cd51bf597dc/propcache-0.3.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c5c2a784234c28854878d68978265617aa6dc0780e53d44b4d67f3651a17a9a2", size = 204480, upload-time = "2025-06-09T22:54:17.104Z" }, + { url = "https://files.pythonhosted.org/packages/e3/79/7bf5ab9033b8b8194cc3f7cf1aaa0e9c3256320726f64a3e1f113a812dce/propcache-0.3.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:5745bc7acdafa978ca1642891b82c19238eadc78ba2aaa293c6863b304e552d7", size = 214530, upload-time = "2025-06-09T22:54:18.512Z" }, + { url = "https://files.pythonhosted.org/packages/31/0b/bd3e0c00509b609317df4a18e6b05a450ef2d9a963e1d8bc9c9415d86f30/propcache-0.3.2-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:c0075bf773d66fa8c9d41f66cc132ecc75e5bb9dd7cce3cfd14adc5ca184cb95", size = 205230, upload-time = "2025-06-09T22:54:19.947Z" }, + { url = "https://files.pythonhosted.org/packages/7a/23/fae0ff9b54b0de4e819bbe559508da132d5683c32d84d0dc2ccce3563ed4/propcache-0.3.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:5f57aa0847730daceff0497f417c9de353c575d8da3579162cc74ac294c5369e", size = 206754, upload-time = "2025-06-09T22:54:21.716Z" }, + { url = "https://files.pythonhosted.org/packages/b7/7f/ad6a3c22630aaa5f618b4dc3c3598974a72abb4c18e45a50b3cdd091eb2f/propcache-0.3.2-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:eef914c014bf72d18efb55619447e0aecd5fb7c2e3fa7441e2e5d6099bddff7e", size = 218430, upload-time = "2025-06-09T22:54:23.17Z" }, + { url = "https://files.pythonhosted.org/packages/5b/2c/ba4f1c0e8a4b4c75910742f0d333759d441f65a1c7f34683b4a74c0ee015/propcache-0.3.2-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:2a4092e8549031e82facf3decdbc0883755d5bbcc62d3aea9d9e185549936dcf", size = 223884, upload-time = "2025-06-09T22:54:25.539Z" }, + { url = "https://files.pythonhosted.org/packages/88/e4/ebe30fc399e98572019eee82ad0caf512401661985cbd3da5e3140ffa1b0/propcache-0.3.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:85871b050f174bc0bfb437efbdb68aaf860611953ed12418e4361bc9c392749e", size = 211480, upload-time = "2025-06-09T22:54:26.892Z" }, + { url = "https://files.pythonhosted.org/packages/96/0a/7d5260b914e01d1d0906f7f38af101f8d8ed0dc47426219eeaf05e8ea7c2/propcache-0.3.2-cp311-cp311-win32.whl", hash = "sha256:36c8d9b673ec57900c3554264e630d45980fd302458e4ac801802a7fd2ef7897", size = 37757, upload-time = "2025-06-09T22:54:28.241Z" }, + { url = "https://files.pythonhosted.org/packages/e1/2d/89fe4489a884bc0da0c3278c552bd4ffe06a1ace559db5ef02ef24ab446b/propcache-0.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:e53af8cb6a781b02d2ea079b5b853ba9430fcbe18a8e3ce647d5982a3ff69f39", size = 41500, upload-time = "2025-06-09T22:54:29.4Z" }, + { url = "https://files.pythonhosted.org/packages/a8/42/9ca01b0a6f48e81615dca4765a8f1dd2c057e0540f6116a27dc5ee01dfb6/propcache-0.3.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:8de106b6c84506b31c27168582cd3cb3000a6412c16df14a8628e5871ff83c10", size = 73674, upload-time = "2025-06-09T22:54:30.551Z" }, + { url = "https://files.pythonhosted.org/packages/af/6e/21293133beb550f9c901bbece755d582bfaf2176bee4774000bd4dd41884/propcache-0.3.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:28710b0d3975117239c76600ea351934ac7b5ff56e60953474342608dbbb6154", size = 43570, upload-time = "2025-06-09T22:54:32.296Z" }, + { url = "https://files.pythonhosted.org/packages/0c/c8/0393a0a3a2b8760eb3bde3c147f62b20044f0ddac81e9d6ed7318ec0d852/propcache-0.3.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ce26862344bdf836650ed2487c3d724b00fbfec4233a1013f597b78c1cb73615", size = 43094, upload-time = "2025-06-09T22:54:33.929Z" }, + { url = "https://files.pythonhosted.org/packages/37/2c/489afe311a690399d04a3e03b069225670c1d489eb7b044a566511c1c498/propcache-0.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bca54bd347a253af2cf4544bbec232ab982f4868de0dd684246b67a51bc6b1db", size = 226958, upload-time = "2025-06-09T22:54:35.186Z" }, + { url = "https://files.pythonhosted.org/packages/9d/ca/63b520d2f3d418c968bf596839ae26cf7f87bead026b6192d4da6a08c467/propcache-0.3.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:55780d5e9a2ddc59711d727226bb1ba83a22dd32f64ee15594b9392b1f544eb1", size = 234894, upload-time = "2025-06-09T22:54:36.708Z" }, + { url = "https://files.pythonhosted.org/packages/11/60/1d0ed6fff455a028d678df30cc28dcee7af77fa2b0e6962ce1df95c9a2a9/propcache-0.3.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:035e631be25d6975ed87ab23153db6a73426a48db688070d925aa27e996fe93c", size = 233672, upload-time = "2025-06-09T22:54:38.062Z" }, + { url = "https://files.pythonhosted.org/packages/37/7c/54fd5301ef38505ab235d98827207176a5c9b2aa61939b10a460ca53e123/propcache-0.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ee6f22b6eaa39297c751d0e80c0d3a454f112f5c6481214fcf4c092074cecd67", size = 224395, upload-time = "2025-06-09T22:54:39.634Z" }, + { url = "https://files.pythonhosted.org/packages/ee/1a/89a40e0846f5de05fdc6779883bf46ba980e6df4d2ff8fb02643de126592/propcache-0.3.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7ca3aee1aa955438c4dba34fc20a9f390e4c79967257d830f137bd5a8a32ed3b", size = 212510, upload-time = "2025-06-09T22:54:41.565Z" }, + { url = "https://files.pythonhosted.org/packages/5e/33/ca98368586c9566a6b8d5ef66e30484f8da84c0aac3f2d9aec6d31a11bd5/propcache-0.3.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:7a4f30862869fa2b68380d677cc1c5fcf1e0f2b9ea0cf665812895c75d0ca3b8", size = 222949, upload-time = "2025-06-09T22:54:43.038Z" }, + { url = "https://files.pythonhosted.org/packages/ba/11/ace870d0aafe443b33b2f0b7efdb872b7c3abd505bfb4890716ad7865e9d/propcache-0.3.2-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:b77ec3c257d7816d9f3700013639db7491a434644c906a2578a11daf13176251", size = 217258, upload-time = "2025-06-09T22:54:44.376Z" }, + { url = "https://files.pythonhosted.org/packages/5b/d2/86fd6f7adffcfc74b42c10a6b7db721d1d9ca1055c45d39a1a8f2a740a21/propcache-0.3.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:cab90ac9d3f14b2d5050928483d3d3b8fb6b4018893fc75710e6aa361ecb2474", size = 213036, upload-time = "2025-06-09T22:54:46.243Z" }, + { url = "https://files.pythonhosted.org/packages/07/94/2d7d1e328f45ff34a0a284cf5a2847013701e24c2a53117e7c280a4316b3/propcache-0.3.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:0b504d29f3c47cf6b9e936c1852246c83d450e8e063d50562115a6be6d3a2535", size = 227684, upload-time = "2025-06-09T22:54:47.63Z" }, + { url = "https://files.pythonhosted.org/packages/b7/05/37ae63a0087677e90b1d14710e532ff104d44bc1efa3b3970fff99b891dc/propcache-0.3.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:ce2ac2675a6aa41ddb2a0c9cbff53780a617ac3d43e620f8fd77ba1c84dcfc06", size = 234562, upload-time = "2025-06-09T22:54:48.982Z" }, + { url = "https://files.pythonhosted.org/packages/a4/7c/3f539fcae630408d0bd8bf3208b9a647ccad10976eda62402a80adf8fc34/propcache-0.3.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:62b4239611205294cc433845b914131b2a1f03500ff3c1ed093ed216b82621e1", size = 222142, upload-time = "2025-06-09T22:54:50.424Z" }, + { url = "https://files.pythonhosted.org/packages/7c/d2/34b9eac8c35f79f8a962546b3e97e9d4b990c420ee66ac8255d5d9611648/propcache-0.3.2-cp312-cp312-win32.whl", hash = "sha256:df4a81b9b53449ebc90cc4deefb052c1dd934ba85012aa912c7ea7b7e38b60c1", size = 37711, upload-time = "2025-06-09T22:54:52.072Z" }, + { url = "https://files.pythonhosted.org/packages/19/61/d582be5d226cf79071681d1b46b848d6cb03d7b70af7063e33a2787eaa03/propcache-0.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:7046e79b989d7fe457bb755844019e10f693752d169076138abf17f31380800c", size = 41479, upload-time = "2025-06-09T22:54:53.234Z" }, + { url = "https://files.pythonhosted.org/packages/dc/d1/8c747fafa558c603c4ca19d8e20b288aa0c7cda74e9402f50f31eb65267e/propcache-0.3.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ca592ed634a73ca002967458187109265e980422116c0a107cf93d81f95af945", size = 71286, upload-time = "2025-06-09T22:54:54.369Z" }, + { url = "https://files.pythonhosted.org/packages/61/99/d606cb7986b60d89c36de8a85d58764323b3a5ff07770a99d8e993b3fa73/propcache-0.3.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:9ecb0aad4020e275652ba3975740f241bd12a61f1a784df044cf7477a02bc252", size = 42425, upload-time = "2025-06-09T22:54:55.642Z" }, + { url = "https://files.pythonhosted.org/packages/8c/96/ef98f91bbb42b79e9bb82bdd348b255eb9d65f14dbbe3b1594644c4073f7/propcache-0.3.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:7f08f1cc28bd2eade7a8a3d2954ccc673bb02062e3e7da09bc75d843386b342f", size = 41846, upload-time = "2025-06-09T22:54:57.246Z" }, + { url = "https://files.pythonhosted.org/packages/5b/ad/3f0f9a705fb630d175146cd7b1d2bf5555c9beaed54e94132b21aac098a6/propcache-0.3.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d1a342c834734edb4be5ecb1e9fb48cb64b1e2320fccbd8c54bf8da8f2a84c33", size = 208871, upload-time = "2025-06-09T22:54:58.975Z" }, + { url = "https://files.pythonhosted.org/packages/3a/38/2085cda93d2c8b6ec3e92af2c89489a36a5886b712a34ab25de9fbca7992/propcache-0.3.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8a544caaae1ac73f1fecfae70ded3e93728831affebd017d53449e3ac052ac1e", size = 215720, upload-time = "2025-06-09T22:55:00.471Z" }, + { url = "https://files.pythonhosted.org/packages/61/c1/d72ea2dc83ac7f2c8e182786ab0fc2c7bd123a1ff9b7975bee671866fe5f/propcache-0.3.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:310d11aa44635298397db47a3ebce7db99a4cc4b9bbdfcf6c98a60c8d5261cf1", size = 215203, upload-time = "2025-06-09T22:55:01.834Z" }, + { url = "https://files.pythonhosted.org/packages/af/81/b324c44ae60c56ef12007105f1460d5c304b0626ab0cc6b07c8f2a9aa0b8/propcache-0.3.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c1396592321ac83157ac03a2023aa6cc4a3cc3cfdecb71090054c09e5a7cce3", size = 206365, upload-time = "2025-06-09T22:55:03.199Z" }, + { url = "https://files.pythonhosted.org/packages/09/73/88549128bb89e66d2aff242488f62869014ae092db63ccea53c1cc75a81d/propcache-0.3.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8cabf5b5902272565e78197edb682017d21cf3b550ba0460ee473753f28d23c1", size = 196016, upload-time = "2025-06-09T22:55:04.518Z" }, + { url = "https://files.pythonhosted.org/packages/b9/3f/3bdd14e737d145114a5eb83cb172903afba7242f67c5877f9909a20d948d/propcache-0.3.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0a2f2235ac46a7aa25bdeb03a9e7060f6ecbd213b1f9101c43b3090ffb971ef6", size = 205596, upload-time = "2025-06-09T22:55:05.942Z" }, + { url = "https://files.pythonhosted.org/packages/0f/ca/2f4aa819c357d3107c3763d7ef42c03980f9ed5c48c82e01e25945d437c1/propcache-0.3.2-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:92b69e12e34869a6970fd2f3da91669899994b47c98f5d430b781c26f1d9f387", size = 200977, upload-time = "2025-06-09T22:55:07.792Z" }, + { url = "https://files.pythonhosted.org/packages/cd/4a/e65276c7477533c59085251ae88505caf6831c0e85ff8b2e31ebcbb949b1/propcache-0.3.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:54e02207c79968ebbdffc169591009f4474dde3b4679e16634d34c9363ff56b4", size = 197220, upload-time = "2025-06-09T22:55:09.173Z" }, + { url = "https://files.pythonhosted.org/packages/7c/54/fc7152e517cf5578278b242396ce4d4b36795423988ef39bb8cd5bf274c8/propcache-0.3.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:4adfb44cb588001f68c5466579d3f1157ca07f7504fc91ec87862e2b8e556b88", size = 210642, upload-time = "2025-06-09T22:55:10.62Z" }, + { url = "https://files.pythonhosted.org/packages/b9/80/abeb4a896d2767bf5f1ea7b92eb7be6a5330645bd7fb844049c0e4045d9d/propcache-0.3.2-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:fd3e6019dc1261cd0291ee8919dd91fbab7b169bb76aeef6c716833a3f65d206", size = 212789, upload-time = "2025-06-09T22:55:12.029Z" }, + { url = "https://files.pythonhosted.org/packages/b3/db/ea12a49aa7b2b6d68a5da8293dcf50068d48d088100ac016ad92a6a780e6/propcache-0.3.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4c181cad81158d71c41a2bce88edce078458e2dd5ffee7eddd6b05da85079f43", size = 205880, upload-time = "2025-06-09T22:55:13.45Z" }, + { url = "https://files.pythonhosted.org/packages/d1/e5/9076a0bbbfb65d1198007059c65639dfd56266cf8e477a9707e4b1999ff4/propcache-0.3.2-cp313-cp313-win32.whl", hash = "sha256:8a08154613f2249519e549de2330cf8e2071c2887309a7b07fb56098f5170a02", size = 37220, upload-time = "2025-06-09T22:55:15.284Z" }, + { url = "https://files.pythonhosted.org/packages/d3/f5/b369e026b09a26cd77aa88d8fffd69141d2ae00a2abaaf5380d2603f4b7f/propcache-0.3.2-cp313-cp313-win_amd64.whl", hash = "sha256:e41671f1594fc4ab0a6dec1351864713cb3a279910ae8b58f884a88a0a632c05", size = 40678, upload-time = "2025-06-09T22:55:16.445Z" }, + { url = "https://files.pythonhosted.org/packages/a4/3a/6ece377b55544941a08d03581c7bc400a3c8cd3c2865900a68d5de79e21f/propcache-0.3.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:9a3cf035bbaf035f109987d9d55dc90e4b0e36e04bbbb95af3055ef17194057b", size = 76560, upload-time = "2025-06-09T22:55:17.598Z" }, + { url = "https://files.pythonhosted.org/packages/0c/da/64a2bb16418740fa634b0e9c3d29edff1db07f56d3546ca2d86ddf0305e1/propcache-0.3.2-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:156c03d07dc1323d8dacaa221fbe028c5c70d16709cdd63502778e6c3ccca1b0", size = 44676, upload-time = "2025-06-09T22:55:18.922Z" }, + { url = "https://files.pythonhosted.org/packages/36/7b/f025e06ea51cb72c52fb87e9b395cced02786610b60a3ed51da8af017170/propcache-0.3.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:74413c0ba02ba86f55cf60d18daab219f7e531620c15f1e23d95563f505efe7e", size = 44701, upload-time = "2025-06-09T22:55:20.106Z" }, + { url = "https://files.pythonhosted.org/packages/a4/00/faa1b1b7c3b74fc277f8642f32a4c72ba1d7b2de36d7cdfb676db7f4303e/propcache-0.3.2-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f066b437bb3fa39c58ff97ab2ca351db465157d68ed0440abecb21715eb24b28", size = 276934, upload-time = "2025-06-09T22:55:21.5Z" }, + { url = "https://files.pythonhosted.org/packages/74/ab/935beb6f1756e0476a4d5938ff44bf0d13a055fed880caf93859b4f1baf4/propcache-0.3.2-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f1304b085c83067914721e7e9d9917d41ad87696bf70f0bc7dee450e9c71ad0a", size = 278316, upload-time = "2025-06-09T22:55:22.918Z" }, + { url = "https://files.pythonhosted.org/packages/f8/9d/994a5c1ce4389610838d1caec74bdf0e98b306c70314d46dbe4fcf21a3e2/propcache-0.3.2-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ab50cef01b372763a13333b4e54021bdcb291fc9a8e2ccb9c2df98be51bcde6c", size = 282619, upload-time = "2025-06-09T22:55:24.651Z" }, + { url = "https://files.pythonhosted.org/packages/2b/00/a10afce3d1ed0287cef2e09506d3be9822513f2c1e96457ee369adb9a6cd/propcache-0.3.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fad3b2a085ec259ad2c2842666b2a0a49dea8463579c606426128925af1ed725", size = 265896, upload-time = "2025-06-09T22:55:26.049Z" }, + { url = "https://files.pythonhosted.org/packages/2e/a8/2aa6716ffa566ca57c749edb909ad27884680887d68517e4be41b02299f3/propcache-0.3.2-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:261fa020c1c14deafd54c76b014956e2f86991af198c51139faf41c4d5e83892", size = 252111, upload-time = "2025-06-09T22:55:27.381Z" }, + { url = "https://files.pythonhosted.org/packages/36/4f/345ca9183b85ac29c8694b0941f7484bf419c7f0fea2d1e386b4f7893eed/propcache-0.3.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:46d7f8aa79c927e5f987ee3a80205c987717d3659f035c85cf0c3680526bdb44", size = 268334, upload-time = "2025-06-09T22:55:28.747Z" }, + { url = "https://files.pythonhosted.org/packages/3e/ca/fcd54f78b59e3f97b3b9715501e3147f5340167733d27db423aa321e7148/propcache-0.3.2-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:6d8f3f0eebf73e3c0ff0e7853f68be638b4043c65a70517bb575eff54edd8dbe", size = 255026, upload-time = "2025-06-09T22:55:30.184Z" }, + { url = "https://files.pythonhosted.org/packages/8b/95/8e6a6bbbd78ac89c30c225210a5c687790e532ba4088afb8c0445b77ef37/propcache-0.3.2-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:03c89c1b14a5452cf15403e291c0ccd7751d5b9736ecb2c5bab977ad6c5bcd81", size = 250724, upload-time = "2025-06-09T22:55:31.646Z" }, + { url = "https://files.pythonhosted.org/packages/ee/b0/0dd03616142baba28e8b2d14ce5df6631b4673850a3d4f9c0f9dd714a404/propcache-0.3.2-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:0cc17efde71e12bbaad086d679ce575268d70bc123a5a71ea7ad76f70ba30bba", size = 268868, upload-time = "2025-06-09T22:55:33.209Z" }, + { url = "https://files.pythonhosted.org/packages/c5/98/2c12407a7e4fbacd94ddd32f3b1e3d5231e77c30ef7162b12a60e2dd5ce3/propcache-0.3.2-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:acdf05d00696bc0447e278bb53cb04ca72354e562cf88ea6f9107df8e7fd9770", size = 271322, upload-time = "2025-06-09T22:55:35.065Z" }, + { url = "https://files.pythonhosted.org/packages/35/91/9cb56efbb428b006bb85db28591e40b7736847b8331d43fe335acf95f6c8/propcache-0.3.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:4445542398bd0b5d32df908031cb1b30d43ac848e20470a878b770ec2dcc6330", size = 265778, upload-time = "2025-06-09T22:55:36.45Z" }, + { url = "https://files.pythonhosted.org/packages/9a/4c/b0fe775a2bdd01e176b14b574be679d84fc83958335790f7c9a686c1f468/propcache-0.3.2-cp313-cp313t-win32.whl", hash = "sha256:f86e5d7cd03afb3a1db8e9f9f6eff15794e79e791350ac48a8c924e6f439f394", size = 41175, upload-time = "2025-06-09T22:55:38.436Z" }, + { url = "https://files.pythonhosted.org/packages/a4/ff/47f08595e3d9b5e149c150f88d9714574f1a7cbd89fe2817158a952674bf/propcache-0.3.2-cp313-cp313t-win_amd64.whl", hash = "sha256:9704bedf6e7cbe3c65eca4379a9b53ee6a83749f047808cbb5044d40d7d72198", size = 44857, upload-time = "2025-06-09T22:55:39.687Z" }, + { url = "https://files.pythonhosted.org/packages/6c/39/8ea9bcfaaff16fd0b0fc901ee522e24c9ec44b4ca0229cfffb8066a06959/propcache-0.3.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:a7fad897f14d92086d6b03fdd2eb844777b0c4d7ec5e3bac0fbae2ab0602bbe5", size = 74678, upload-time = "2025-06-09T22:55:41.227Z" }, + { url = "https://files.pythonhosted.org/packages/d3/85/cab84c86966e1d354cf90cdc4ba52f32f99a5bca92a1529d666d957d7686/propcache-0.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1f43837d4ca000243fd7fd6301947d7cb93360d03cd08369969450cc6b2ce3b4", size = 43829, upload-time = "2025-06-09T22:55:42.417Z" }, + { url = "https://files.pythonhosted.org/packages/23/f7/9cb719749152d8b26d63801b3220ce2d3931312b2744d2b3a088b0ee9947/propcache-0.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:261df2e9474a5949c46e962065d88eb9b96ce0f2bd30e9d3136bcde84befd8f2", size = 43729, upload-time = "2025-06-09T22:55:43.651Z" }, + { url = "https://files.pythonhosted.org/packages/a2/a2/0b2b5a210ff311260002a315f6f9531b65a36064dfb804655432b2f7d3e3/propcache-0.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e514326b79e51f0a177daab1052bc164d9d9e54133797a3a58d24c9c87a3fe6d", size = 204483, upload-time = "2025-06-09T22:55:45.327Z" }, + { url = "https://files.pythonhosted.org/packages/3f/e0/7aff5de0c535f783b0c8be5bdb750c305c1961d69fbb136939926e155d98/propcache-0.3.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d4a996adb6904f85894570301939afeee65f072b4fd265ed7e569e8d9058e4ec", size = 217425, upload-time = "2025-06-09T22:55:46.729Z" }, + { url = "https://files.pythonhosted.org/packages/92/1d/65fa889eb3b2a7d6e4ed3c2b568a9cb8817547a1450b572de7bf24872800/propcache-0.3.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:76cace5d6b2a54e55b137669b30f31aa15977eeed390c7cbfb1dafa8dfe9a701", size = 214723, upload-time = "2025-06-09T22:55:48.342Z" }, + { url = "https://files.pythonhosted.org/packages/9a/e2/eecf6989870988dfd731de408a6fa366e853d361a06c2133b5878ce821ad/propcache-0.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:31248e44b81d59d6addbb182c4720f90b44e1efdc19f58112a3c3a1615fb47ef", size = 200166, upload-time = "2025-06-09T22:55:49.775Z" }, + { url = "https://files.pythonhosted.org/packages/12/06/c32be4950967f18f77489268488c7cdc78cbfc65a8ba8101b15e526b83dc/propcache-0.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:abb7fa19dbf88d3857363e0493b999b8011eea856b846305d8c0512dfdf8fbb1", size = 194004, upload-time = "2025-06-09T22:55:51.335Z" }, + { url = "https://files.pythonhosted.org/packages/46/6c/17b521a6b3b7cbe277a4064ff0aa9129dd8c89f425a5a9b6b4dd51cc3ff4/propcache-0.3.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:d81ac3ae39d38588ad0549e321e6f773a4e7cc68e7751524a22885d5bbadf886", size = 203075, upload-time = "2025-06-09T22:55:52.681Z" }, + { url = "https://files.pythonhosted.org/packages/62/cb/3bdba2b736b3e45bc0e40f4370f745b3e711d439ffbffe3ae416393eece9/propcache-0.3.2-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:cc2782eb0f7a16462285b6f8394bbbd0e1ee5f928034e941ffc444012224171b", size = 195407, upload-time = "2025-06-09T22:55:54.048Z" }, + { url = "https://files.pythonhosted.org/packages/29/bd/760c5c6a60a4a2c55a421bc34a25ba3919d49dee411ddb9d1493bb51d46e/propcache-0.3.2-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:db429c19a6c7e8a1c320e6a13c99799450f411b02251fb1b75e6217cf4a14fcb", size = 196045, upload-time = "2025-06-09T22:55:55.485Z" }, + { url = "https://files.pythonhosted.org/packages/76/58/ced2757a46f55b8c84358d6ab8de4faf57cba831c51e823654da7144b13a/propcache-0.3.2-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:21d8759141a9e00a681d35a1f160892a36fb6caa715ba0b832f7747da48fb6ea", size = 208432, upload-time = "2025-06-09T22:55:56.884Z" }, + { url = "https://files.pythonhosted.org/packages/bb/ec/d98ea8d5a4d8fe0e372033f5254eddf3254344c0c5dc6c49ab84349e4733/propcache-0.3.2-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:2ca6d378f09adb13837614ad2754fa8afaee330254f404299611bce41a8438cb", size = 210100, upload-time = "2025-06-09T22:55:58.498Z" }, + { url = "https://files.pythonhosted.org/packages/56/84/b6d8a7ecf3f62d7dd09d9d10bbf89fad6837970ef868b35b5ffa0d24d9de/propcache-0.3.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:34a624af06c048946709f4278b4176470073deda88d91342665d95f7c6270fbe", size = 200712, upload-time = "2025-06-09T22:55:59.906Z" }, + { url = "https://files.pythonhosted.org/packages/bf/32/889f4903ddfe4a9dc61da71ee58b763758cf2d608fe1decede06e6467f8d/propcache-0.3.2-cp39-cp39-win32.whl", hash = "sha256:4ba3fef1c30f306b1c274ce0b8baaa2c3cdd91f645c48f06394068f37d3837a1", size = 38187, upload-time = "2025-06-09T22:56:01.212Z" }, + { url = "https://files.pythonhosted.org/packages/67/74/d666795fb9ba1dc139d30de64f3b6fd1ff9c9d3d96ccfdb992cd715ce5d2/propcache-0.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:7a2368eed65fc69a7a7a40b27f22e85e7627b74216f0846b04ba5c116e191ec9", size = 42025, upload-time = "2025-06-09T22:56:02.875Z" }, + { url = "https://files.pythonhosted.org/packages/cc/35/cc0aaecf278bb4575b8555f2b137de5ab821595ddae9da9d3cd1da4072c7/propcache-0.3.2-py3-none-any.whl", hash = "sha256:98f1ec44fb675f5052cccc8e609c46ed23a35a1cfd18545ad4e29002d858a43f", size = 12663, upload-time = "2025-06-09T22:56:04.484Z" }, +] + +[[package]] +name = "pydantic" +version = "1.10.23" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.9'", + "python_full_version < '3.9'", +] +dependencies = [ + { name = "typing-extensions", marker = "extra == 'group-18-runloop-api-client-pydantic-v1'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/8f/3d/bd64466a91ec17b73f5c6c723373c352086dedd405c9f8dc1141aaddc59e/pydantic-1.10.23.tar.gz", hash = "sha256:81ee80fe4bd69236aeb65c8beeb5150655b8a49b946fce6664a720d6cf5ec717", size = 356864, upload-time = "2025-09-13T02:39:34.915Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/76/0252dc9e6aea421728006e2734f02848a5676bfe7736cc1f9de438aa42a0/pydantic-1.10.23-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1ce178e49a471ebf867451872a3403b89da6194bc2c9761e78ce22f619794d0d", size = 2493024, upload-time = "2025-09-13T02:38:05.322Z" }, + { url = "https://files.pythonhosted.org/packages/b9/11/45f651f4646f451ff9c6ead61837693c052feaf1ac296fd9411d897cf0a2/pydantic-1.10.23-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d5f2ab29db92a2b11c7cd49466f68858583bf227165c42a3fae2b50042a1ab51", size = 2300271, upload-time = "2025-09-13T02:38:08.589Z" }, + { url = "https://files.pythonhosted.org/packages/50/4b/341c4d714ce1238c4c16a3698c38284f499f1d7769029b9f94fee26702ac/pydantic-1.10.23-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8e84ece91eb806586ffa4f92c149308cb07b0fa14a7e1204e18cde01aac283f7", size = 2959673, upload-time = "2025-09-13T02:38:10.231Z" }, + { url = "https://files.pythonhosted.org/packages/82/7f/8db5317689dc10809abac464c6db8f8936292899953b6acf9e96c73cfa63/pydantic-1.10.23-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:757c8a2f459311bf277f6ddb4891222f69ba93fb301eee095c985fc7239d5afd", size = 3029774, upload-time = "2025-09-13T02:38:11.851Z" }, + { url = "https://files.pythonhosted.org/packages/ae/ef/71fea5e0ec14180f63226717b7723857b31b1e5a3e9635ad6607a42296f0/pydantic-1.10.23-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:50b4726ab72a027fb69da865e849ae16107bdbea01ff1670daf4560e078a1606", size = 3099346, upload-time = "2025-09-13T02:38:13.711Z" }, + { url = "https://files.pythonhosted.org/packages/2d/70/1573e4ddcd69f88137e82d405b702631bea48c6a9816b6d0626b468a8d65/pydantic-1.10.23-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:4ed07c43d5c3f6f391eceeef7ead84c8c54083e0a1b5fa009302191c07775a73", size = 3038047, upload-time = "2025-09-13T02:38:15.559Z" }, + { url = "https://files.pythonhosted.org/packages/ba/1f/c06b6a1d4ac137ff63f3dd0a74b3b2e00ceca26572e14373b3deeef3d068/pydantic-1.10.23-cp310-cp310-win_amd64.whl", hash = "sha256:bc5547c3be3b8494a444adf3703c037bdf2170e30af802f5d7bb14a232698106", size = 2092280, upload-time = "2025-09-13T02:38:18.076Z" }, + { url = "https://files.pythonhosted.org/packages/d6/40/c239b68381a2201b1241c0e417cb2cebe29f6e6029f01a2a3a208ed0c7be/pydantic-1.10.23-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b2e9d81546af42331248bbffde26a441631c8823515ebf328ee2ec04d771cd73", size = 2525346, upload-time = "2025-09-13T02:38:19.706Z" }, + { url = "https://files.pythonhosted.org/packages/df/18/2138690053ae63a410dd758061404c5426f7e0ee4edb427a379ff679ef80/pydantic-1.10.23-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7e13f39ce65232a2826d1c32a9e2c6f9ca5451d6e51c6e5ea9fdebc285fc2980", size = 2305920, upload-time = "2025-09-13T02:38:21.89Z" }, + { url = "https://files.pythonhosted.org/packages/2b/e7/618bb71aafd4bade35d1d9fc0427b1621b5966b550ce0c4afb2a326e1348/pydantic-1.10.23-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:041308bdb4804f0b387b02f870ebdf4e86020de344a969020de853f5ea8d5508", size = 2902994, upload-time = "2025-09-13T02:38:23.812Z" }, + { url = "https://files.pythonhosted.org/packages/ce/dd/7044afbe9f805ee57efd7e059a4704111a77664f97e0e821749de8bf065c/pydantic-1.10.23-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ed01648e2a469e2c35984bab9ff5080648c53af3b8b98312e1d7823eacd33d77", size = 2975707, upload-time = "2025-09-13T02:38:25.795Z" }, + { url = "https://files.pythonhosted.org/packages/18/fc/5dc725d18a7f99b4731c1f6301acb89f5d86816f625b3910ed1e6c762ebb/pydantic-1.10.23-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:18056741c9febebeb043798414099ada8d8e74cc47ec2059d7fbdc7d091d0e7b", size = 3063227, upload-time = "2025-09-13T02:38:27.717Z" }, + { url = "https://files.pythonhosted.org/packages/3c/bb/499c9881cbfb4b858ead5264bf740461f8cd10b06dda25379584f5516a43/pydantic-1.10.23-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:7411a18deef02a6b7825edb3930b9ab0251f7b131ebb1cb1ffe0aadf74d60c6d", size = 2989099, upload-time = "2025-09-13T02:38:29.637Z" }, + { url = "https://files.pythonhosted.org/packages/47/84/593aa9e2229151b563f844b4dfc67c5307116389a5b78fa5230ca26b2ccb/pydantic-1.10.23-cp311-cp311-win_amd64.whl", hash = "sha256:890213289bf40481a715b1d8b3e8a602af9e481d9f0e0b2b00dc375a12b0cfbb", size = 2095481, upload-time = "2025-09-13T02:38:31.42Z" }, + { url = "https://files.pythonhosted.org/packages/7d/db/91114a2c7ae0ee946ef54f51aeaba188eb728fa265eea16a2e83801e7174/pydantic-1.10.23-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:136b6428b644691d0ee2a3a7de395d0d1b01ce6388b747bd371bb9ca65b4cc32", size = 2532742, upload-time = "2025-09-13T02:38:33.273Z" }, + { url = "https://files.pythonhosted.org/packages/12/95/5a5b2413eb68c996f9ebe36d3d40c72f79417710f72c3347fe2f7436d699/pydantic-1.10.23-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b47c210416606b7c8e236c7546647500856eaba0d01564d5cddacb30d1b5daec", size = 2321478, upload-time = "2025-09-13T02:38:35.285Z" }, + { url = "https://files.pythonhosted.org/packages/23/4b/34996785baf88fb907fb51a608b81085167b0acfdee3e6920c67bb145738/pydantic-1.10.23-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c9c436e12d81b7c3d3208f66a5d35b401c8ec25fafc9bff446c77f1072ed5f5", size = 2778508, upload-time = "2025-09-13T02:38:37.046Z" }, + { url = "https://files.pythonhosted.org/packages/13/d7/5a748c85d4cd0e82016484642ab6a2ab86cdf4b3d94a3e4969a4f22a85a4/pydantic-1.10.23-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:edba6ac9bd6040daf3e876c284257624171884011e0729d90b90f5fe11f7217d", size = 2828364, upload-time = "2025-09-13T02:38:38.829Z" }, + { url = "https://files.pythonhosted.org/packages/d5/8a/8a04eb44ebf5e64644a3c6c8dbd1b7c3c506774b88bd6bdc4fff9779cfc2/pydantic-1.10.23-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:101ae7dcd77c23003d4766bcf23e08cd3d012173379ad549bdb2c898855b2a57", size = 2910201, upload-time = "2025-09-13T02:38:40.603Z" }, + { url = "https://files.pythonhosted.org/packages/99/a0/9f4c10a0673996f2980c131a857f6eb4d7711fc047df06f4346561af03a0/pydantic-1.10.23-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:9b05416d8dcf36fd291348bba8f565d015fce4c594577d2ef5bc0c5ec8f54a29", size = 2858353, upload-time = "2025-09-13T02:38:42.12Z" }, + { url = "https://files.pythonhosted.org/packages/67/48/5719e361f87245fe798b4ddcfa70ad69a8aa7cf143b4e15467e26d46d453/pydantic-1.10.23-cp312-cp312-win_amd64.whl", hash = "sha256:0f309b3dd80ed4d3487b1219c69dfd9036e51a863aeaa41a3b67497b81c4cb8f", size = 1968607, upload-time = "2025-09-13T02:38:43.788Z" }, + { url = "https://files.pythonhosted.org/packages/fa/d8/02fc15e5af12cf6ee3b58b47ec71bbf0236bc32f621c7d18fd09035c54e5/pydantic-1.10.23-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a6aa6881a18657fe66b9249e0572a9690ebc6f0b37c32872beb06bc51bff738f", size = 2588217, upload-time = "2025-09-13T02:38:45.588Z" }, + { url = "https://files.pythonhosted.org/packages/4c/0a/f56de9d891ef61cf64dcd6c9324a3168b46b268a7489c2f0f62b45bf29aa/pydantic-1.10.23-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:c57bfade74111335062c8ac830d5a14004742ff5b037c52c410d9e9011258bf5", size = 2349602, upload-time = "2025-09-13T02:38:47.598Z" }, + { url = "https://files.pythonhosted.org/packages/02/9c/3e1854d854a11169e7865e55c9e1f081aed3039a9fa3f90b2ae6aa1d1bfc/pydantic-1.10.23-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:723cb7f6aca0b471bac9d7dceb42d151d26aabdca655bd4190be3a7de008a054", size = 2762249, upload-time = "2025-09-13T02:38:49.862Z" }, + { url = "https://files.pythonhosted.org/packages/51/b9/910fb8ea0b347f9b02b7641d14a86e1c2d2306d0aeca785f0efc18e23500/pydantic-1.10.23-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1b81db6c9108c3f6509c897fcdf842e5993d7233e9140a7f1c4dc1c2f85b0a8d", size = 2799069, upload-time = "2025-09-13T02:38:51.427Z" }, + { url = "https://files.pythonhosted.org/packages/b5/bf/b9eb1bf92f229a4420627f23f2be8d92decc4f9b33d43fcad220baee0a0a/pydantic-1.10.23-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:9e9544d07d96df6c6405b64462fb3122e5d0af46a1c4ddf94c180b17ac29f047", size = 2888516, upload-time = "2025-09-13T02:38:53.882Z" }, + { url = "https://files.pythonhosted.org/packages/a6/35/58ef579a4ad591f54b20787d123fe7c356c553bdcbde40abb1745778e49d/pydantic-1.10.23-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4dff5e26a14424f4e6cf44cbd45861b458f31e37d316e92a78bf99ec6d1ef2ee", size = 2850293, upload-time = "2025-09-13T02:38:55.839Z" }, + { url = "https://files.pythonhosted.org/packages/54/73/f9825643f110ac763edd1abef9559d17e0a440348f94f6e5803b23d5aaaf/pydantic-1.10.23-cp313-cp313-win_amd64.whl", hash = "sha256:633235236c9af4a16e7cf47be3ffab15445552613a122b44a8946868c2ace426", size = 1970494, upload-time = "2025-09-13T02:38:57.378Z" }, + { url = "https://files.pythonhosted.org/packages/f0/5b/117c637af7b1680bae4c1e16d35530b8f2d4078e9ee7a5092f32a5b606b4/pydantic-1.10.23-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:f71590dcd1ff354107cecc1c26b85406dd11e6f87d9b8416c5defd3cf4d54a51", size = 2386186, upload-time = "2025-09-13T02:39:09.756Z" }, + { url = "https://files.pythonhosted.org/packages/ed/16/37dbd0bf8212b2cd616fd1defab1f6ee60e65dee62c6ceef90e19392cfa5/pydantic-1.10.23-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:46b3cd6fb8edf973380ddf1ac7387cca5f0624c07579bf9d15121dd77986b57c", size = 2216810, upload-time = "2025-09-13T02:39:11.379Z" }, + { url = "https://files.pythonhosted.org/packages/8e/e7/c30043d13d379ed781bba210027729dbb0370f58cf4b41302ac11860e303/pydantic-1.10.23-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:89e9a801a538d056fd91edf0d01dec02abde1b325e3c019c5c06d75fcca86929", size = 2843784, upload-time = "2025-09-13T02:39:12.892Z" }, + { url = "https://files.pythonhosted.org/packages/c6/7d/5e94a21cd479717825f30ad2947454674026ef00ff9a070eacec316ced6f/pydantic-1.10.23-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7ee7fa1a9bfa45aad5652001efa552a79a40f9ea7a1b11185685dd047895d3a8", size = 2944921, upload-time = "2025-09-13T02:39:14.803Z" }, + { url = "https://files.pythonhosted.org/packages/6f/42/90b4d1db7d4e9a5706fd53e9872db7c09d7e96d980f62b6301d524e40dac/pydantic-1.10.23-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:0db70ae0e58eed1ffd01fbfdd23f6c6e5ae5e1bf2cd50dfeb0a2853656766e68", size = 3092583, upload-time = "2025-09-13T02:39:16.853Z" }, + { url = "https://files.pythonhosted.org/packages/96/38/a4cc7b1d0b8a8a315f08b7d8be998fc4c7753f90e7549b8cb95ce8dd51a9/pydantic-1.10.23-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:d037210949ac9e837360239d91a834cab3cf02e84cf295ea66c6ff73137f3723", size = 2991731, upload-time = "2025-09-13T02:39:18.368Z" }, + { url = "https://files.pythonhosted.org/packages/35/58/7e2583870769eaaef76e2c46d0de61feaf6e1f4cb955f8de0c83e2e6349c/pydantic-1.10.23-cp38-cp38-win_amd64.whl", hash = "sha256:aa8d57384c6305febd9724b4f8de6860b5ba5821b7948dbbd0ddf733d50d7677", size = 2154727, upload-time = "2025-09-13T02:39:19.929Z" }, + { url = "https://files.pythonhosted.org/packages/3c/4f/6d542dae6da93903d4cced16a91d2a2bfee826066feba91c0399f5ccd308/pydantic-1.10.23-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:cdb4c8fdf8344b912285ca85c99d44433bd3d877f44b9ffcfc79cefedbc08869", size = 2502925, upload-time = "2025-09-13T02:39:21.533Z" }, + { url = "https://files.pythonhosted.org/packages/17/66/ebd7428e6db2bff093bc754660db24af4ee5b4d227868937cd114195f1bd/pydantic-1.10.23-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:144f739a617f2c12fa8d135d2efe26b9cf16033a44f2fe5400d7d0e9d9c90dca", size = 2309038, upload-time = "2025-09-13T02:39:23.012Z" }, + { url = "https://files.pythonhosted.org/packages/3c/1e/d696eaff2b1ed889d8de8839012144f1b9be7b743a138e669ca5056efac2/pydantic-1.10.23-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3449e59f27a42ba2c35c2e92aea345794696e5dddba3b5d88d123155eac4ee83", size = 2968173, upload-time = "2025-09-13T02:39:24.536Z" }, + { url = "https://files.pythonhosted.org/packages/b2/5a/f53e05f877509007457314fdec1a7572cd889f17e7e92b5f090ca28bde78/pydantic-1.10.23-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:10e9d8259fab4599498c3246703b84a5e9500240544bf49c54fc57996c6d093a", size = 3038899, upload-time = "2025-09-13T02:39:26.082Z" }, + { url = "https://files.pythonhosted.org/packages/1b/a6/9f9d18d754b21d57e45adb5035ed020ed4e5b70e23fb48cb17b6d2f9c57c/pydantic-1.10.23-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:08b576239a4acbbfd35365b603cbee5fee6d3c56323abba54f0142e7ad6ff406", size = 3107617, upload-time = "2025-09-13T02:39:28.092Z" }, + { url = "https://files.pythonhosted.org/packages/67/ed/e2b6d31a0bda6f78ba8b84ffbeeba2501f2b5efd5b4a584bc728de2abb88/pydantic-1.10.23-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:0f20e4dfe6413ee79fc1b4ac9c9f4112ff9d4cf44a19577592422d09774ee085", size = 3048822, upload-time = "2025-09-13T02:39:29.732Z" }, + { url = "https://files.pythonhosted.org/packages/43/cc/272190268db5c7a12f9106e3ed7925fc93d1c3a2dffc6f3beebf0e06b990/pydantic-1.10.23-cp39-cp39-win_amd64.whl", hash = "sha256:45fcc5ed6adde6703f9f22f898362a087d1d140a337ecc4caca2477f4d735390", size = 2099360, upload-time = "2025-09-13T02:39:31.376Z" }, + { url = "https://files.pythonhosted.org/packages/f0/d6/43d8913ca252c52c5f5b8d84ae7bfa05059d4d7be3b428170f303d67fe3f/pydantic-1.10.23-py3-none-any.whl", hash = "sha256:6294bb84565c294a3a6408c52b26a42803f258d5ebfdb3ae896cd7cccfa07211", size = 166525, upload-time = "2025-09-13T02:39:33.055Z" }, +] + +[[package]] +name = "pydantic" +version = "2.10.6" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.9'", +] +dependencies = [ + { name = "annotated-types", marker = "(python_full_version < '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pydantic-core", version = "2.27.2", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "typing-extensions", marker = "(python_full_version < '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b7/ae/d5220c5c52b158b1de7ca89fc5edb72f304a70a4c540c84c8844bf4008de/pydantic-2.10.6.tar.gz", hash = "sha256:ca5daa827cce33de7a42be142548b0096bf05a7e7b365aebfa5f8eeec7128236", size = 761681, upload-time = "2025-01-24T01:42:12.693Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f4/3c/8cc1cc84deffa6e25d2d0c688ebb80635dfdbf1dbea3e30c541c8cf4d860/pydantic-2.10.6-py3-none-any.whl", hash = "sha256:427d664bf0b8a2b34ff5dd0f5a18df00591adcee7198fbd71981054cef37b584", size = 431696, upload-time = "2025-01-24T01:42:10.371Z" }, +] + +[[package]] +name = "pydantic" +version = "2.11.9" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.9'", +] +dependencies = [ + { name = "annotated-types", marker = "(python_full_version >= '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pydantic-core", version = "2.33.2", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "typing-extensions", marker = "(python_full_version >= '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "typing-inspection", marker = "(python_full_version >= '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ff/5d/09a551ba512d7ca404d785072700d3f6727a02f6f3c24ecfd081c7cf0aa8/pydantic-2.11.9.tar.gz", hash = "sha256:6b8ffda597a14812a7975c90b82a8a2e777d9257aba3453f973acd3c032a18e2", size = 788495, upload-time = "2025-09-13T11:26:39.325Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3e/d3/108f2006987c58e76691d5ae5d200dd3e0f532cb4e5fa3560751c3a1feba/pydantic-2.11.9-py3-none-any.whl", hash = "sha256:c42dd626f5cfc1c6950ce6205ea58c93efa406da65f479dcb4029d5934857da2", size = 444855, upload-time = "2025-09-13T11:26:36.909Z" }, +] + +[[package]] +name = "pydantic-core" +version = "2.27.2" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.9'", +] +dependencies = [ + { name = "typing-extensions", marker = "(python_full_version < '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/fc/01/f3e5ac5e7c25833db5eb555f7b7ab24cd6f8c322d3a3ad2d67a952dc0abc/pydantic_core-2.27.2.tar.gz", hash = "sha256:eb026e5a4c1fee05726072337ff51d1efb6f59090b7da90d30ea58625b1ffb39", size = 413443, upload-time = "2024-12-18T11:31:54.917Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3a/bc/fed5f74b5d802cf9a03e83f60f18864e90e3aed7223adaca5ffb7a8d8d64/pydantic_core-2.27.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2d367ca20b2f14095a8f4fa1210f5a7b78b8a20009ecced6b12818f455b1e9fa", size = 1895938, upload-time = "2024-12-18T11:27:14.406Z" }, + { url = "https://files.pythonhosted.org/packages/71/2a/185aff24ce844e39abb8dd680f4e959f0006944f4a8a0ea372d9f9ae2e53/pydantic_core-2.27.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:491a2b73db93fab69731eaee494f320faa4e093dbed776be1a829c2eb222c34c", size = 1815684, upload-time = "2024-12-18T11:27:16.489Z" }, + { url = "https://files.pythonhosted.org/packages/c3/43/fafabd3d94d159d4f1ed62e383e264f146a17dd4d48453319fd782e7979e/pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7969e133a6f183be60e9f6f56bfae753585680f3b7307a8e555a948d443cc05a", size = 1829169, upload-time = "2024-12-18T11:27:22.16Z" }, + { url = "https://files.pythonhosted.org/packages/a2/d1/f2dfe1a2a637ce6800b799aa086d079998959f6f1215eb4497966efd2274/pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3de9961f2a346257caf0aa508a4da705467f53778e9ef6fe744c038119737ef5", size = 1867227, upload-time = "2024-12-18T11:27:25.097Z" }, + { url = "https://files.pythonhosted.org/packages/7d/39/e06fcbcc1c785daa3160ccf6c1c38fea31f5754b756e34b65f74e99780b5/pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e2bb4d3e5873c37bb3dd58714d4cd0b0e6238cebc4177ac8fe878f8b3aa8e74c", size = 2037695, upload-time = "2024-12-18T11:27:28.656Z" }, + { url = "https://files.pythonhosted.org/packages/7a/67/61291ee98e07f0650eb756d44998214231f50751ba7e13f4f325d95249ab/pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:280d219beebb0752699480fe8f1dc61ab6615c2046d76b7ab7ee38858de0a4e7", size = 2741662, upload-time = "2024-12-18T11:27:30.798Z" }, + { url = "https://files.pythonhosted.org/packages/32/90/3b15e31b88ca39e9e626630b4c4a1f5a0dfd09076366f4219429e6786076/pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47956ae78b6422cbd46f772f1746799cbb862de838fd8d1fbd34a82e05b0983a", size = 1993370, upload-time = "2024-12-18T11:27:33.692Z" }, + { url = "https://files.pythonhosted.org/packages/ff/83/c06d333ee3a67e2e13e07794995c1535565132940715931c1c43bfc85b11/pydantic_core-2.27.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:14d4a5c49d2f009d62a2a7140d3064f686d17a5d1a268bc641954ba181880236", size = 1996813, upload-time = "2024-12-18T11:27:37.111Z" }, + { url = "https://files.pythonhosted.org/packages/7c/f7/89be1c8deb6e22618a74f0ca0d933fdcb8baa254753b26b25ad3acff8f74/pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:337b443af21d488716f8d0b6164de833e788aa6bd7e3a39c005febc1284f4962", size = 2005287, upload-time = "2024-12-18T11:27:40.566Z" }, + { url = "https://files.pythonhosted.org/packages/b7/7d/8eb3e23206c00ef7feee17b83a4ffa0a623eb1a9d382e56e4aa46fd15ff2/pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:03d0f86ea3184a12f41a2d23f7ccb79cdb5a18e06993f8a45baa8dfec746f0e9", size = 2128414, upload-time = "2024-12-18T11:27:43.757Z" }, + { url = "https://files.pythonhosted.org/packages/4e/99/fe80f3ff8dd71a3ea15763878d464476e6cb0a2db95ff1c5c554133b6b83/pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7041c36f5680c6e0f08d922aed302e98b3745d97fe1589db0a3eebf6624523af", size = 2155301, upload-time = "2024-12-18T11:27:47.36Z" }, + { url = "https://files.pythonhosted.org/packages/2b/a3/e50460b9a5789ca1451b70d4f52546fa9e2b420ba3bfa6100105c0559238/pydantic_core-2.27.2-cp310-cp310-win32.whl", hash = "sha256:50a68f3e3819077be2c98110c1f9dcb3817e93f267ba80a2c05bb4f8799e2ff4", size = 1816685, upload-time = "2024-12-18T11:27:50.508Z" }, + { url = "https://files.pythonhosted.org/packages/57/4c/a8838731cb0f2c2a39d3535376466de6049034d7b239c0202a64aaa05533/pydantic_core-2.27.2-cp310-cp310-win_amd64.whl", hash = "sha256:e0fd26b16394ead34a424eecf8a31a1f5137094cabe84a1bcb10fa6ba39d3d31", size = 1982876, upload-time = "2024-12-18T11:27:53.54Z" }, + { url = "https://files.pythonhosted.org/packages/c2/89/f3450af9d09d44eea1f2c369f49e8f181d742f28220f88cc4dfaae91ea6e/pydantic_core-2.27.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:8e10c99ef58cfdf2a66fc15d66b16c4a04f62bca39db589ae8cba08bc55331bc", size = 1893421, upload-time = "2024-12-18T11:27:55.409Z" }, + { url = "https://files.pythonhosted.org/packages/9e/e3/71fe85af2021f3f386da42d291412e5baf6ce7716bd7101ea49c810eda90/pydantic_core-2.27.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:26f32e0adf166a84d0cb63be85c562ca8a6fa8de28e5f0d92250c6b7e9e2aff7", size = 1814998, upload-time = "2024-12-18T11:27:57.252Z" }, + { url = "https://files.pythonhosted.org/packages/a6/3c/724039e0d848fd69dbf5806894e26479577316c6f0f112bacaf67aa889ac/pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c19d1ea0673cd13cc2f872f6c9ab42acc4e4f492a7ca9d3795ce2b112dd7e15", size = 1826167, upload-time = "2024-12-18T11:27:59.146Z" }, + { url = "https://files.pythonhosted.org/packages/2b/5b/1b29e8c1fb5f3199a9a57c1452004ff39f494bbe9bdbe9a81e18172e40d3/pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5e68c4446fe0810e959cdff46ab0a41ce2f2c86d227d96dc3847af0ba7def306", size = 1865071, upload-time = "2024-12-18T11:28:02.625Z" }, + { url = "https://files.pythonhosted.org/packages/89/6c/3985203863d76bb7d7266e36970d7e3b6385148c18a68cc8915fd8c84d57/pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d9640b0059ff4f14d1f37321b94061c6db164fbe49b334b31643e0528d100d99", size = 2036244, upload-time = "2024-12-18T11:28:04.442Z" }, + { url = "https://files.pythonhosted.org/packages/0e/41/f15316858a246b5d723f7d7f599f79e37493b2e84bfc789e58d88c209f8a/pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:40d02e7d45c9f8af700f3452f329ead92da4c5f4317ca9b896de7ce7199ea459", size = 2737470, upload-time = "2024-12-18T11:28:07.679Z" }, + { url = "https://files.pythonhosted.org/packages/a8/7c/b860618c25678bbd6d1d99dbdfdf0510ccb50790099b963ff78a124b754f/pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1c1fd185014191700554795c99b347d64f2bb637966c4cfc16998a0ca700d048", size = 1992291, upload-time = "2024-12-18T11:28:10.297Z" }, + { url = "https://files.pythonhosted.org/packages/bf/73/42c3742a391eccbeab39f15213ecda3104ae8682ba3c0c28069fbcb8c10d/pydantic_core-2.27.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d81d2068e1c1228a565af076598f9e7451712700b673de8f502f0334f281387d", size = 1994613, upload-time = "2024-12-18T11:28:13.362Z" }, + { url = "https://files.pythonhosted.org/packages/94/7a/941e89096d1175d56f59340f3a8ebaf20762fef222c298ea96d36a6328c5/pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1a4207639fb02ec2dbb76227d7c751a20b1a6b4bc52850568e52260cae64ca3b", size = 2002355, upload-time = "2024-12-18T11:28:16.587Z" }, + { url = "https://files.pythonhosted.org/packages/6e/95/2359937a73d49e336a5a19848713555605d4d8d6940c3ec6c6c0ca4dcf25/pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:3de3ce3c9ddc8bbd88f6e0e304dea0e66d843ec9de1b0042b0911c1663ffd474", size = 2126661, upload-time = "2024-12-18T11:28:18.407Z" }, + { url = "https://files.pythonhosted.org/packages/2b/4c/ca02b7bdb6012a1adef21a50625b14f43ed4d11f1fc237f9d7490aa5078c/pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:30c5f68ded0c36466acede341551106821043e9afaad516adfb6e8fa80a4e6a6", size = 2153261, upload-time = "2024-12-18T11:28:21.471Z" }, + { url = "https://files.pythonhosted.org/packages/72/9d/a241db83f973049a1092a079272ffe2e3e82e98561ef6214ab53fe53b1c7/pydantic_core-2.27.2-cp311-cp311-win32.whl", hash = "sha256:c70c26d2c99f78b125a3459f8afe1aed4d9687c24fd677c6a4436bc042e50d6c", size = 1812361, upload-time = "2024-12-18T11:28:23.53Z" }, + { url = "https://files.pythonhosted.org/packages/e8/ef/013f07248041b74abd48a385e2110aa3a9bbfef0fbd97d4e6d07d2f5b89a/pydantic_core-2.27.2-cp311-cp311-win_amd64.whl", hash = "sha256:08e125dbdc505fa69ca7d9c499639ab6407cfa909214d500897d02afb816e7cc", size = 1982484, upload-time = "2024-12-18T11:28:25.391Z" }, + { url = "https://files.pythonhosted.org/packages/10/1c/16b3a3e3398fd29dca77cea0a1d998d6bde3902fa2706985191e2313cc76/pydantic_core-2.27.2-cp311-cp311-win_arm64.whl", hash = "sha256:26f0d68d4b235a2bae0c3fc585c585b4ecc51382db0e3ba402a22cbc440915e4", size = 1867102, upload-time = "2024-12-18T11:28:28.593Z" }, + { url = "https://files.pythonhosted.org/packages/d6/74/51c8a5482ca447871c93e142d9d4a92ead74de6c8dc5e66733e22c9bba89/pydantic_core-2.27.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9e0c8cfefa0ef83b4da9588448b6d8d2a2bf1a53c3f1ae5fca39eb3061e2f0b0", size = 1893127, upload-time = "2024-12-18T11:28:30.346Z" }, + { url = "https://files.pythonhosted.org/packages/d3/f3/c97e80721735868313c58b89d2de85fa80fe8dfeeed84dc51598b92a135e/pydantic_core-2.27.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:83097677b8e3bd7eaa6775720ec8e0405f1575015a463285a92bfdfe254529ef", size = 1811340, upload-time = "2024-12-18T11:28:32.521Z" }, + { url = "https://files.pythonhosted.org/packages/9e/91/840ec1375e686dbae1bd80a9e46c26a1e0083e1186abc610efa3d9a36180/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:172fce187655fece0c90d90a678424b013f8fbb0ca8b036ac266749c09438cb7", size = 1822900, upload-time = "2024-12-18T11:28:34.507Z" }, + { url = "https://files.pythonhosted.org/packages/f6/31/4240bc96025035500c18adc149aa6ffdf1a0062a4b525c932065ceb4d868/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:519f29f5213271eeeeb3093f662ba2fd512b91c5f188f3bb7b27bc5973816934", size = 1869177, upload-time = "2024-12-18T11:28:36.488Z" }, + { url = "https://files.pythonhosted.org/packages/fa/20/02fbaadb7808be578317015c462655c317a77a7c8f0ef274bc016a784c54/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05e3a55d124407fffba0dd6b0c0cd056d10e983ceb4e5dbd10dda135c31071d6", size = 2038046, upload-time = "2024-12-18T11:28:39.409Z" }, + { url = "https://files.pythonhosted.org/packages/06/86/7f306b904e6c9eccf0668248b3f272090e49c275bc488a7b88b0823444a4/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c3ed807c7b91de05e63930188f19e921d1fe90de6b4f5cd43ee7fcc3525cb8c", size = 2685386, upload-time = "2024-12-18T11:28:41.221Z" }, + { url = "https://files.pythonhosted.org/packages/8d/f0/49129b27c43396581a635d8710dae54a791b17dfc50c70164866bbf865e3/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fb4aadc0b9a0c063206846d603b92030eb6f03069151a625667f982887153e2", size = 1997060, upload-time = "2024-12-18T11:28:44.709Z" }, + { url = "https://files.pythonhosted.org/packages/0d/0f/943b4af7cd416c477fd40b187036c4f89b416a33d3cc0ab7b82708a667aa/pydantic_core-2.27.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:28ccb213807e037460326424ceb8b5245acb88f32f3d2777427476e1b32c48c4", size = 2004870, upload-time = "2024-12-18T11:28:46.839Z" }, + { url = "https://files.pythonhosted.org/packages/35/40/aea70b5b1a63911c53a4c8117c0a828d6790483f858041f47bab0b779f44/pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:de3cd1899e2c279b140adde9357c4495ed9d47131b4a4eaff9052f23398076b3", size = 1999822, upload-time = "2024-12-18T11:28:48.896Z" }, + { url = "https://files.pythonhosted.org/packages/f2/b3/807b94fd337d58effc5498fd1a7a4d9d59af4133e83e32ae39a96fddec9d/pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:220f892729375e2d736b97d0e51466252ad84c51857d4d15f5e9692f9ef12be4", size = 2130364, upload-time = "2024-12-18T11:28:50.755Z" }, + { url = "https://files.pythonhosted.org/packages/fc/df/791c827cd4ee6efd59248dca9369fb35e80a9484462c33c6649a8d02b565/pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a0fcd29cd6b4e74fe8ddd2c90330fd8edf2e30cb52acda47f06dd615ae72da57", size = 2158303, upload-time = "2024-12-18T11:28:54.122Z" }, + { url = "https://files.pythonhosted.org/packages/9b/67/4e197c300976af185b7cef4c02203e175fb127e414125916bf1128b639a9/pydantic_core-2.27.2-cp312-cp312-win32.whl", hash = "sha256:1e2cb691ed9834cd6a8be61228471d0a503731abfb42f82458ff27be7b2186fc", size = 1834064, upload-time = "2024-12-18T11:28:56.074Z" }, + { url = "https://files.pythonhosted.org/packages/1f/ea/cd7209a889163b8dcca139fe32b9687dd05249161a3edda62860430457a5/pydantic_core-2.27.2-cp312-cp312-win_amd64.whl", hash = "sha256:cc3f1a99a4f4f9dd1de4fe0312c114e740b5ddead65bb4102884b384c15d8bc9", size = 1989046, upload-time = "2024-12-18T11:28:58.107Z" }, + { url = "https://files.pythonhosted.org/packages/bc/49/c54baab2f4658c26ac633d798dab66b4c3a9bbf47cff5284e9c182f4137a/pydantic_core-2.27.2-cp312-cp312-win_arm64.whl", hash = "sha256:3911ac9284cd8a1792d3cb26a2da18f3ca26c6908cc434a18f730dc0db7bfa3b", size = 1885092, upload-time = "2024-12-18T11:29:01.335Z" }, + { url = "https://files.pythonhosted.org/packages/41/b1/9bc383f48f8002f99104e3acff6cba1231b29ef76cfa45d1506a5cad1f84/pydantic_core-2.27.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7d14bd329640e63852364c306f4d23eb744e0f8193148d4044dd3dacdaacbd8b", size = 1892709, upload-time = "2024-12-18T11:29:03.193Z" }, + { url = "https://files.pythonhosted.org/packages/10/6c/e62b8657b834f3eb2961b49ec8e301eb99946245e70bf42c8817350cbefc/pydantic_core-2.27.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:82f91663004eb8ed30ff478d77c4d1179b3563df6cdb15c0817cd1cdaf34d154", size = 1811273, upload-time = "2024-12-18T11:29:05.306Z" }, + { url = "https://files.pythonhosted.org/packages/ba/15/52cfe49c8c986e081b863b102d6b859d9defc63446b642ccbbb3742bf371/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:71b24c7d61131bb83df10cc7e687433609963a944ccf45190cfc21e0887b08c9", size = 1823027, upload-time = "2024-12-18T11:29:07.294Z" }, + { url = "https://files.pythonhosted.org/packages/b1/1c/b6f402cfc18ec0024120602bdbcebc7bdd5b856528c013bd4d13865ca473/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fa8e459d4954f608fa26116118bb67f56b93b209c39b008277ace29937453dc9", size = 1868888, upload-time = "2024-12-18T11:29:09.249Z" }, + { url = "https://files.pythonhosted.org/packages/bd/7b/8cb75b66ac37bc2975a3b7de99f3c6f355fcc4d89820b61dffa8f1e81677/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce8918cbebc8da707ba805b7fd0b382816858728ae7fe19a942080c24e5b7cd1", size = 2037738, upload-time = "2024-12-18T11:29:11.23Z" }, + { url = "https://files.pythonhosted.org/packages/c8/f1/786d8fe78970a06f61df22cba58e365ce304bf9b9f46cc71c8c424e0c334/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:eda3f5c2a021bbc5d976107bb302e0131351c2ba54343f8a496dc8783d3d3a6a", size = 2685138, upload-time = "2024-12-18T11:29:16.396Z" }, + { url = "https://files.pythonhosted.org/packages/a6/74/d12b2cd841d8724dc8ffb13fc5cef86566a53ed358103150209ecd5d1999/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd8086fa684c4775c27f03f062cbb9eaa6e17f064307e86b21b9e0abc9c0f02e", size = 1997025, upload-time = "2024-12-18T11:29:20.25Z" }, + { url = "https://files.pythonhosted.org/packages/a0/6e/940bcd631bc4d9a06c9539b51f070b66e8f370ed0933f392db6ff350d873/pydantic_core-2.27.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8d9b3388db186ba0c099a6d20f0604a44eabdeef1777ddd94786cdae158729e4", size = 2004633, upload-time = "2024-12-18T11:29:23.877Z" }, + { url = "https://files.pythonhosted.org/packages/50/cc/a46b34f1708d82498c227d5d80ce615b2dd502ddcfd8376fc14a36655af1/pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7a66efda2387de898c8f38c0cf7f14fca0b51a8ef0b24bfea5849f1b3c95af27", size = 1999404, upload-time = "2024-12-18T11:29:25.872Z" }, + { url = "https://files.pythonhosted.org/packages/ca/2d/c365cfa930ed23bc58c41463bae347d1005537dc8db79e998af8ba28d35e/pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:18a101c168e4e092ab40dbc2503bdc0f62010e95d292b27827871dc85450d7ee", size = 2130130, upload-time = "2024-12-18T11:29:29.252Z" }, + { url = "https://files.pythonhosted.org/packages/f4/d7/eb64d015c350b7cdb371145b54d96c919d4db516817f31cd1c650cae3b21/pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ba5dd002f88b78a4215ed2f8ddbdf85e8513382820ba15ad5ad8955ce0ca19a1", size = 2157946, upload-time = "2024-12-18T11:29:31.338Z" }, + { url = "https://files.pythonhosted.org/packages/a4/99/bddde3ddde76c03b65dfd5a66ab436c4e58ffc42927d4ff1198ffbf96f5f/pydantic_core-2.27.2-cp313-cp313-win32.whl", hash = "sha256:1ebaf1d0481914d004a573394f4be3a7616334be70261007e47c2a6fe7e50130", size = 1834387, upload-time = "2024-12-18T11:29:33.481Z" }, + { url = "https://files.pythonhosted.org/packages/71/47/82b5e846e01b26ac6f1893d3c5f9f3a2eb6ba79be26eef0b759b4fe72946/pydantic_core-2.27.2-cp313-cp313-win_amd64.whl", hash = "sha256:953101387ecf2f5652883208769a79e48db18c6df442568a0b5ccd8c2723abee", size = 1990453, upload-time = "2024-12-18T11:29:35.533Z" }, + { url = "https://files.pythonhosted.org/packages/51/b2/b2b50d5ecf21acf870190ae5d093602d95f66c9c31f9d5de6062eb329ad1/pydantic_core-2.27.2-cp313-cp313-win_arm64.whl", hash = "sha256:ac4dbfd1691affb8f48c2c13241a2e3b60ff23247cbcf981759c768b6633cf8b", size = 1885186, upload-time = "2024-12-18T11:29:37.649Z" }, + { url = "https://files.pythonhosted.org/packages/43/53/13e9917fc69c0a4aea06fd63ed6a8d6cda9cf140ca9584d49c1650b0ef5e/pydantic_core-2.27.2-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d3e8d504bdd3f10835468f29008d72fc8359d95c9c415ce6e767203db6127506", size = 1899595, upload-time = "2024-12-18T11:29:40.887Z" }, + { url = "https://files.pythonhosted.org/packages/f4/20/26c549249769ed84877f862f7bb93f89a6ee08b4bee1ed8781616b7fbb5e/pydantic_core-2.27.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:521eb9b7f036c9b6187f0b47318ab0d7ca14bd87f776240b90b21c1f4f149320", size = 1775010, upload-time = "2024-12-18T11:29:44.823Z" }, + { url = "https://files.pythonhosted.org/packages/35/eb/8234e05452d92d2b102ffa1b56d801c3567e628fdc63f02080fdfc68fd5e/pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85210c4d99a0114f5a9481b44560d7d1e35e32cc5634c656bc48e590b669b145", size = 1830727, upload-time = "2024-12-18T11:29:46.904Z" }, + { url = "https://files.pythonhosted.org/packages/8f/df/59f915c8b929d5f61e5a46accf748a87110ba145156f9326d1a7d28912b2/pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d716e2e30c6f140d7560ef1538953a5cd1a87264c737643d481f2779fc247fe1", size = 1868393, upload-time = "2024-12-18T11:29:49.098Z" }, + { url = "https://files.pythonhosted.org/packages/d5/52/81cf4071dca654d485c277c581db368b0c95b2b883f4d7b736ab54f72ddf/pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f66d89ba397d92f840f8654756196d93804278457b5fbede59598a1f9f90b228", size = 2040300, upload-time = "2024-12-18T11:29:51.43Z" }, + { url = "https://files.pythonhosted.org/packages/9c/00/05197ce1614f5c08d7a06e1d39d5d8e704dc81971b2719af134b844e2eaf/pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:669e193c1c576a58f132e3158f9dfa9662969edb1a250c54d8fa52590045f046", size = 2738785, upload-time = "2024-12-18T11:29:55.001Z" }, + { url = "https://files.pythonhosted.org/packages/f7/a3/5f19bc495793546825ab160e530330c2afcee2281c02b5ffafd0b32ac05e/pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdbe7629b996647b99c01b37f11170a57ae675375b14b8c13b8518b8320ced5", size = 1996493, upload-time = "2024-12-18T11:29:57.13Z" }, + { url = "https://files.pythonhosted.org/packages/ed/e8/e0102c2ec153dc3eed88aea03990e1b06cfbca532916b8a48173245afe60/pydantic_core-2.27.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d262606bf386a5ba0b0af3b97f37c83d7011439e3dc1a9298f21efb292e42f1a", size = 1998544, upload-time = "2024-12-18T11:30:00.681Z" }, + { url = "https://files.pythonhosted.org/packages/fb/a3/4be70845b555bd80aaee9f9812a7cf3df81550bce6dadb3cfee9c5d8421d/pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:cabb9bcb7e0d97f74df8646f34fc76fbf793b7f6dc2438517d7a9e50eee4f14d", size = 2007449, upload-time = "2024-12-18T11:30:02.985Z" }, + { url = "https://files.pythonhosted.org/packages/e3/9f/b779ed2480ba355c054e6d7ea77792467631d674b13d8257085a4bc7dcda/pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_armv7l.whl", hash = "sha256:d2d63f1215638d28221f664596b1ccb3944f6e25dd18cd3b86b0a4c408d5ebb9", size = 2129460, upload-time = "2024-12-18T11:30:06.55Z" }, + { url = "https://files.pythonhosted.org/packages/a0/f0/a6ab0681f6e95260c7fbf552874af7302f2ea37b459f9b7f00698f875492/pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:bca101c00bff0adb45a833f8451b9105d9df18accb8743b08107d7ada14bd7da", size = 2159609, upload-time = "2024-12-18T11:30:09.428Z" }, + { url = "https://files.pythonhosted.org/packages/8a/2b/e1059506795104349712fbca647b18b3f4a7fd541c099e6259717441e1e0/pydantic_core-2.27.2-cp38-cp38-win32.whl", hash = "sha256:f6f8e111843bbb0dee4cb6594cdc73e79b3329b526037ec242a3e49012495b3b", size = 1819886, upload-time = "2024-12-18T11:30:11.777Z" }, + { url = "https://files.pythonhosted.org/packages/aa/6d/df49c17f024dfc58db0bacc7b03610058018dd2ea2eaf748ccbada4c3d06/pydantic_core-2.27.2-cp38-cp38-win_amd64.whl", hash = "sha256:fd1aea04935a508f62e0d0ef1f5ae968774a32afc306fb8545e06f5ff5cdf3ad", size = 1980773, upload-time = "2024-12-18T11:30:14.828Z" }, + { url = "https://files.pythonhosted.org/packages/27/97/3aef1ddb65c5ccd6eda9050036c956ff6ecbfe66cb7eb40f280f121a5bb0/pydantic_core-2.27.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:c10eb4f1659290b523af58fa7cffb452a61ad6ae5613404519aee4bfbf1df993", size = 1896475, upload-time = "2024-12-18T11:30:18.316Z" }, + { url = "https://files.pythonhosted.org/packages/ad/d3/5668da70e373c9904ed2f372cb52c0b996426f302e0dee2e65634c92007d/pydantic_core-2.27.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ef592d4bad47296fb11f96cd7dc898b92e795032b4894dfb4076cfccd43a9308", size = 1772279, upload-time = "2024-12-18T11:30:20.547Z" }, + { url = "https://files.pythonhosted.org/packages/8a/9e/e44b8cb0edf04a2f0a1f6425a65ee089c1d6f9c4c2dcab0209127b6fdfc2/pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c61709a844acc6bf0b7dce7daae75195a10aac96a596ea1b776996414791ede4", size = 1829112, upload-time = "2024-12-18T11:30:23.255Z" }, + { url = "https://files.pythonhosted.org/packages/1c/90/1160d7ac700102effe11616e8119e268770f2a2aa5afb935f3ee6832987d/pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c5f762659e47fdb7b16956c71598292f60a03aa92f8b6351504359dbdba6cf", size = 1866780, upload-time = "2024-12-18T11:30:25.742Z" }, + { url = "https://files.pythonhosted.org/packages/ee/33/13983426df09a36d22c15980008f8d9c77674fc319351813b5a2739b70f3/pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4c9775e339e42e79ec99c441d9730fccf07414af63eac2f0e48e08fd38a64d76", size = 2037943, upload-time = "2024-12-18T11:30:28.036Z" }, + { url = "https://files.pythonhosted.org/packages/01/d7/ced164e376f6747e9158c89988c293cd524ab8d215ae4e185e9929655d5c/pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:57762139821c31847cfb2df63c12f725788bd9f04bc2fb392790959b8f70f118", size = 2740492, upload-time = "2024-12-18T11:30:30.412Z" }, + { url = "https://files.pythonhosted.org/packages/8b/1f/3dc6e769d5b7461040778816aab2b00422427bcaa4b56cc89e9c653b2605/pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d1e85068e818c73e048fe28cfc769040bb1f475524f4745a5dc621f75ac7630", size = 1995714, upload-time = "2024-12-18T11:30:34.358Z" }, + { url = "https://files.pythonhosted.org/packages/07/d7/a0bd09bc39283530b3f7c27033a814ef254ba3bd0b5cfd040b7abf1fe5da/pydantic_core-2.27.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:097830ed52fd9e427942ff3b9bc17fab52913b2f50f2880dc4a5611446606a54", size = 1997163, upload-time = "2024-12-18T11:30:37.979Z" }, + { url = "https://files.pythonhosted.org/packages/2d/bb/2db4ad1762e1c5699d9b857eeb41959191980de6feb054e70f93085e1bcd/pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:044a50963a614ecfae59bb1eaf7ea7efc4bc62f49ed594e18fa1e5d953c40e9f", size = 2005217, upload-time = "2024-12-18T11:30:40.367Z" }, + { url = "https://files.pythonhosted.org/packages/53/5f/23a5a3e7b8403f8dd8fc8a6f8b49f6b55c7d715b77dcf1f8ae919eeb5628/pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:4e0b4220ba5b40d727c7f879eac379b822eee5d8fff418e9d3381ee45b3b0362", size = 2127899, upload-time = "2024-12-18T11:30:42.737Z" }, + { url = "https://files.pythonhosted.org/packages/c2/ae/aa38bb8dd3d89c2f1d8362dd890ee8f3b967330821d03bbe08fa01ce3766/pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5e4f4bb20d75e9325cc9696c6802657b58bc1dbbe3022f32cc2b2b632c3fbb96", size = 2155726, upload-time = "2024-12-18T11:30:45.279Z" }, + { url = "https://files.pythonhosted.org/packages/98/61/4f784608cc9e98f70839187117ce840480f768fed5d386f924074bf6213c/pydantic_core-2.27.2-cp39-cp39-win32.whl", hash = "sha256:cca63613e90d001b9f2f9a9ceb276c308bfa2a43fafb75c8031c4f66039e8c6e", size = 1817219, upload-time = "2024-12-18T11:30:47.718Z" }, + { url = "https://files.pythonhosted.org/packages/57/82/bb16a68e4a1a858bb3768c2c8f1ff8d8978014e16598f001ea29a25bf1d1/pydantic_core-2.27.2-cp39-cp39-win_amd64.whl", hash = "sha256:77d1bca19b0f7021b3a982e6f903dcd5b2b06076def36a652e3907f596e29f67", size = 1985382, upload-time = "2024-12-18T11:30:51.871Z" }, + { url = "https://files.pythonhosted.org/packages/46/72/af70981a341500419e67d5cb45abe552a7c74b66326ac8877588488da1ac/pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:2bf14caea37e91198329b828eae1618c068dfb8ef17bb33287a7ad4b61ac314e", size = 1891159, upload-time = "2024-12-18T11:30:54.382Z" }, + { url = "https://files.pythonhosted.org/packages/ad/3d/c5913cccdef93e0a6a95c2d057d2c2cba347815c845cda79ddd3c0f5e17d/pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:b0cb791f5b45307caae8810c2023a184c74605ec3bcbb67d13846c28ff731ff8", size = 1768331, upload-time = "2024-12-18T11:30:58.178Z" }, + { url = "https://files.pythonhosted.org/packages/f6/f0/a3ae8fbee269e4934f14e2e0e00928f9346c5943174f2811193113e58252/pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:688d3fd9fcb71f41c4c015c023d12a79d1c4c0732ec9eb35d96e3388a120dcf3", size = 1822467, upload-time = "2024-12-18T11:31:00.6Z" }, + { url = "https://files.pythonhosted.org/packages/d7/7a/7bbf241a04e9f9ea24cd5874354a83526d639b02674648af3f350554276c/pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d591580c34f4d731592f0e9fe40f9cc1b430d297eecc70b962e93c5c668f15f", size = 1979797, upload-time = "2024-12-18T11:31:07.243Z" }, + { url = "https://files.pythonhosted.org/packages/4f/5f/4784c6107731f89e0005a92ecb8a2efeafdb55eb992b8e9d0a2be5199335/pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:82f986faf4e644ffc189a7f1aafc86e46ef70372bb153e7001e8afccc6e54133", size = 1987839, upload-time = "2024-12-18T11:31:09.775Z" }, + { url = "https://files.pythonhosted.org/packages/6d/a7/61246562b651dff00de86a5f01b6e4befb518df314c54dec187a78d81c84/pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:bec317a27290e2537f922639cafd54990551725fc844249e64c523301d0822fc", size = 1998861, upload-time = "2024-12-18T11:31:13.469Z" }, + { url = "https://files.pythonhosted.org/packages/86/aa/837821ecf0c022bbb74ca132e117c358321e72e7f9702d1b6a03758545e2/pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:0296abcb83a797db256b773f45773da397da75a08f5fcaef41f2044adec05f50", size = 2116582, upload-time = "2024-12-18T11:31:17.423Z" }, + { url = "https://files.pythonhosted.org/packages/81/b0/5e74656e95623cbaa0a6278d16cf15e10a51f6002e3ec126541e95c29ea3/pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:0d75070718e369e452075a6017fbf187f788e17ed67a3abd47fa934d001863d9", size = 2151985, upload-time = "2024-12-18T11:31:19.901Z" }, + { url = "https://files.pythonhosted.org/packages/63/37/3e32eeb2a451fddaa3898e2163746b0cffbbdbb4740d38372db0490d67f3/pydantic_core-2.27.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:7e17b560be3c98a8e3aa66ce828bdebb9e9ac6ad5466fba92eb74c4c95cb1151", size = 2004715, upload-time = "2024-12-18T11:31:22.821Z" }, + { url = "https://files.pythonhosted.org/packages/29/0e/dcaea00c9dbd0348b723cae82b0e0c122e0fa2b43fa933e1622fd237a3ee/pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:c33939a82924da9ed65dab5a65d427205a73181d8098e79b6b426bdf8ad4e656", size = 1891733, upload-time = "2024-12-18T11:31:26.876Z" }, + { url = "https://files.pythonhosted.org/packages/86/d3/e797bba8860ce650272bda6383a9d8cad1d1c9a75a640c9d0e848076f85e/pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:00bad2484fa6bda1e216e7345a798bd37c68fb2d97558edd584942aa41b7d278", size = 1768375, upload-time = "2024-12-18T11:31:29.276Z" }, + { url = "https://files.pythonhosted.org/packages/41/f7/f847b15fb14978ca2b30262548f5fc4872b2724e90f116393eb69008299d/pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c817e2b40aba42bac6f457498dacabc568c3b7a986fc9ba7c8d9d260b71485fb", size = 1822307, upload-time = "2024-12-18T11:31:33.123Z" }, + { url = "https://files.pythonhosted.org/packages/9c/63/ed80ec8255b587b2f108e514dc03eed1546cd00f0af281e699797f373f38/pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:251136cdad0cb722e93732cb45ca5299fb56e1344a833640bf93b2803f8d1bfd", size = 1979971, upload-time = "2024-12-18T11:31:35.755Z" }, + { url = "https://files.pythonhosted.org/packages/a9/6d/6d18308a45454a0de0e975d70171cadaf454bc7a0bf86b9c7688e313f0bb/pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d2088237af596f0a524d3afc39ab3b036e8adb054ee57cbb1dcf8e09da5b29cc", size = 1987616, upload-time = "2024-12-18T11:31:38.534Z" }, + { url = "https://files.pythonhosted.org/packages/82/8a/05f8780f2c1081b800a7ca54c1971e291c2d07d1a50fb23c7e4aef4ed403/pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d4041c0b966a84b4ae7a09832eb691a35aec90910cd2dbe7a208de59be77965b", size = 1998943, upload-time = "2024-12-18T11:31:41.853Z" }, + { url = "https://files.pythonhosted.org/packages/5e/3e/fe5b6613d9e4c0038434396b46c5303f5ade871166900b357ada4766c5b7/pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:8083d4e875ebe0b864ffef72a4304827015cff328a1be6e22cc850753bfb122b", size = 2116654, upload-time = "2024-12-18T11:31:44.756Z" }, + { url = "https://files.pythonhosted.org/packages/db/ad/28869f58938fad8cc84739c4e592989730bfb69b7c90a8fff138dff18e1e/pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f141ee28a0ad2123b6611b6ceff018039df17f32ada8b534e6aa039545a3efb2", size = 2152292, upload-time = "2024-12-18T11:31:48.613Z" }, + { url = "https://files.pythonhosted.org/packages/a1/0c/c5c5cd3689c32ed1fe8c5d234b079c12c281c051759770c05b8bed6412b5/pydantic_core-2.27.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7d0c8399fcc1848491f00e0314bd59fb34a9c008761bcb422a057670c3f65e35", size = 2004961, upload-time = "2024-12-18T11:31:52.446Z" }, +] + +[[package]] +name = "pydantic-core" +version = "2.33.2" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.9'", +] +dependencies = [ + { name = "typing-extensions", marker = "(python_full_version >= '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ad/88/5f2260bdfae97aabf98f1778d43f69574390ad787afb646292a638c923d4/pydantic_core-2.33.2.tar.gz", hash = "sha256:7cb8bc3605c29176e1b105350d2e6474142d7c1bd1d9327c4a9bdb46bf827acc", size = 435195, upload-time = "2025-04-23T18:33:52.104Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e5/92/b31726561b5dae176c2d2c2dc43a9c5bfba5d32f96f8b4c0a600dd492447/pydantic_core-2.33.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2b3d326aaef0c0399d9afffeb6367d5e26ddc24d351dbc9c636840ac355dc5d8", size = 2028817, upload-time = "2025-04-23T18:30:43.919Z" }, + { url = "https://files.pythonhosted.org/packages/a3/44/3f0b95fafdaca04a483c4e685fe437c6891001bf3ce8b2fded82b9ea3aa1/pydantic_core-2.33.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0e5b2671f05ba48b94cb90ce55d8bdcaaedb8ba00cc5359f6810fc918713983d", size = 1861357, upload-time = "2025-04-23T18:30:46.372Z" }, + { url = "https://files.pythonhosted.org/packages/30/97/e8f13b55766234caae05372826e8e4b3b96e7b248be3157f53237682e43c/pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0069c9acc3f3981b9ff4cdfaf088e98d83440a4c7ea1bc07460af3d4dc22e72d", size = 1898011, upload-time = "2025-04-23T18:30:47.591Z" }, + { url = "https://files.pythonhosted.org/packages/9b/a3/99c48cf7bafc991cc3ee66fd544c0aae8dc907b752f1dad2d79b1b5a471f/pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d53b22f2032c42eaaf025f7c40c2e3b94568ae077a606f006d206a463bc69572", size = 1982730, upload-time = "2025-04-23T18:30:49.328Z" }, + { url = "https://files.pythonhosted.org/packages/de/8e/a5b882ec4307010a840fb8b58bd9bf65d1840c92eae7534c7441709bf54b/pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0405262705a123b7ce9f0b92f123334d67b70fd1f20a9372b907ce1080c7ba02", size = 2136178, upload-time = "2025-04-23T18:30:50.907Z" }, + { url = "https://files.pythonhosted.org/packages/e4/bb/71e35fc3ed05af6834e890edb75968e2802fe98778971ab5cba20a162315/pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4b25d91e288e2c4e0662b8038a28c6a07eaac3e196cfc4ff69de4ea3db992a1b", size = 2736462, upload-time = "2025-04-23T18:30:52.083Z" }, + { url = "https://files.pythonhosted.org/packages/31/0d/c8f7593e6bc7066289bbc366f2235701dcbebcd1ff0ef8e64f6f239fb47d/pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6bdfe4b3789761f3bcb4b1ddf33355a71079858958e3a552f16d5af19768fef2", size = 2005652, upload-time = "2025-04-23T18:30:53.389Z" }, + { url = "https://files.pythonhosted.org/packages/d2/7a/996d8bd75f3eda405e3dd219ff5ff0a283cd8e34add39d8ef9157e722867/pydantic_core-2.33.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:efec8db3266b76ef9607c2c4c419bdb06bf335ae433b80816089ea7585816f6a", size = 2113306, upload-time = "2025-04-23T18:30:54.661Z" }, + { url = "https://files.pythonhosted.org/packages/ff/84/daf2a6fb2db40ffda6578a7e8c5a6e9c8affb251a05c233ae37098118788/pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:031c57d67ca86902726e0fae2214ce6770bbe2f710dc33063187a68744a5ecac", size = 2073720, upload-time = "2025-04-23T18:30:56.11Z" }, + { url = "https://files.pythonhosted.org/packages/77/fb/2258da019f4825128445ae79456a5499c032b55849dbd5bed78c95ccf163/pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:f8de619080e944347f5f20de29a975c2d815d9ddd8be9b9b7268e2e3ef68605a", size = 2244915, upload-time = "2025-04-23T18:30:57.501Z" }, + { url = "https://files.pythonhosted.org/packages/d8/7a/925ff73756031289468326e355b6fa8316960d0d65f8b5d6b3a3e7866de7/pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:73662edf539e72a9440129f231ed3757faab89630d291b784ca99237fb94db2b", size = 2241884, upload-time = "2025-04-23T18:30:58.867Z" }, + { url = "https://files.pythonhosted.org/packages/0b/b0/249ee6d2646f1cdadcb813805fe76265745c4010cf20a8eba7b0e639d9b2/pydantic_core-2.33.2-cp310-cp310-win32.whl", hash = "sha256:0a39979dcbb70998b0e505fb1556a1d550a0781463ce84ebf915ba293ccb7e22", size = 1910496, upload-time = "2025-04-23T18:31:00.078Z" }, + { url = "https://files.pythonhosted.org/packages/66/ff/172ba8f12a42d4b552917aa65d1f2328990d3ccfc01d5b7c943ec084299f/pydantic_core-2.33.2-cp310-cp310-win_amd64.whl", hash = "sha256:b0379a2b24882fef529ec3b4987cb5d003b9cda32256024e6fe1586ac45fc640", size = 1955019, upload-time = "2025-04-23T18:31:01.335Z" }, + { url = "https://files.pythonhosted.org/packages/3f/8d/71db63483d518cbbf290261a1fc2839d17ff89fce7089e08cad07ccfce67/pydantic_core-2.33.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:4c5b0a576fb381edd6d27f0a85915c6daf2f8138dc5c267a57c08a62900758c7", size = 2028584, upload-time = "2025-04-23T18:31:03.106Z" }, + { url = "https://files.pythonhosted.org/packages/24/2f/3cfa7244ae292dd850989f328722d2aef313f74ffc471184dc509e1e4e5a/pydantic_core-2.33.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e799c050df38a639db758c617ec771fd8fb7a5f8eaaa4b27b101f266b216a246", size = 1855071, upload-time = "2025-04-23T18:31:04.621Z" }, + { url = "https://files.pythonhosted.org/packages/b3/d3/4ae42d33f5e3f50dd467761304be2fa0a9417fbf09735bc2cce003480f2a/pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dc46a01bf8d62f227d5ecee74178ffc448ff4e5197c756331f71efcc66dc980f", size = 1897823, upload-time = "2025-04-23T18:31:06.377Z" }, + { url = "https://files.pythonhosted.org/packages/f4/f3/aa5976e8352b7695ff808599794b1fba2a9ae2ee954a3426855935799488/pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a144d4f717285c6d9234a66778059f33a89096dfb9b39117663fd8413d582dcc", size = 1983792, upload-time = "2025-04-23T18:31:07.93Z" }, + { url = "https://files.pythonhosted.org/packages/d5/7a/cda9b5a23c552037717f2b2a5257e9b2bfe45e687386df9591eff7b46d28/pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:73cf6373c21bc80b2e0dc88444f41ae60b2f070ed02095754eb5a01df12256de", size = 2136338, upload-time = "2025-04-23T18:31:09.283Z" }, + { url = "https://files.pythonhosted.org/packages/2b/9f/b8f9ec8dd1417eb9da784e91e1667d58a2a4a7b7b34cf4af765ef663a7e5/pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3dc625f4aa79713512d1976fe9f0bc99f706a9dee21dfd1810b4bbbf228d0e8a", size = 2730998, upload-time = "2025-04-23T18:31:11.7Z" }, + { url = "https://files.pythonhosted.org/packages/47/bc/cd720e078576bdb8255d5032c5d63ee5c0bf4b7173dd955185a1d658c456/pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:881b21b5549499972441da4758d662aeea93f1923f953e9cbaff14b8b9565aef", size = 2003200, upload-time = "2025-04-23T18:31:13.536Z" }, + { url = "https://files.pythonhosted.org/packages/ca/22/3602b895ee2cd29d11a2b349372446ae9727c32e78a94b3d588a40fdf187/pydantic_core-2.33.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:bdc25f3681f7b78572699569514036afe3c243bc3059d3942624e936ec93450e", size = 2113890, upload-time = "2025-04-23T18:31:15.011Z" }, + { url = "https://files.pythonhosted.org/packages/ff/e6/e3c5908c03cf00d629eb38393a98fccc38ee0ce8ecce32f69fc7d7b558a7/pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:fe5b32187cbc0c862ee201ad66c30cf218e5ed468ec8dc1cf49dec66e160cc4d", size = 2073359, upload-time = "2025-04-23T18:31:16.393Z" }, + { url = "https://files.pythonhosted.org/packages/12/e7/6a36a07c59ebefc8777d1ffdaf5ae71b06b21952582e4b07eba88a421c79/pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:bc7aee6f634a6f4a95676fcb5d6559a2c2a390330098dba5e5a5f28a2e4ada30", size = 2245883, upload-time = "2025-04-23T18:31:17.892Z" }, + { url = "https://files.pythonhosted.org/packages/16/3f/59b3187aaa6cc0c1e6616e8045b284de2b6a87b027cce2ffcea073adf1d2/pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:235f45e5dbcccf6bd99f9f472858849f73d11120d76ea8707115415f8e5ebebf", size = 2241074, upload-time = "2025-04-23T18:31:19.205Z" }, + { url = "https://files.pythonhosted.org/packages/e0/ed/55532bb88f674d5d8f67ab121a2a13c385df382de2a1677f30ad385f7438/pydantic_core-2.33.2-cp311-cp311-win32.whl", hash = "sha256:6368900c2d3ef09b69cb0b913f9f8263b03786e5b2a387706c5afb66800efd51", size = 1910538, upload-time = "2025-04-23T18:31:20.541Z" }, + { url = "https://files.pythonhosted.org/packages/fe/1b/25b7cccd4519c0b23c2dd636ad39d381abf113085ce4f7bec2b0dc755eb1/pydantic_core-2.33.2-cp311-cp311-win_amd64.whl", hash = "sha256:1e063337ef9e9820c77acc768546325ebe04ee38b08703244c1309cccc4f1bab", size = 1952909, upload-time = "2025-04-23T18:31:22.371Z" }, + { url = "https://files.pythonhosted.org/packages/49/a9/d809358e49126438055884c4366a1f6227f0f84f635a9014e2deb9b9de54/pydantic_core-2.33.2-cp311-cp311-win_arm64.whl", hash = "sha256:6b99022f1d19bc32a4c2a0d544fc9a76e3be90f0b3f4af413f87d38749300e65", size = 1897786, upload-time = "2025-04-23T18:31:24.161Z" }, + { url = "https://files.pythonhosted.org/packages/18/8a/2b41c97f554ec8c71f2a8a5f85cb56a8b0956addfe8b0efb5b3d77e8bdc3/pydantic_core-2.33.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:a7ec89dc587667f22b6a0b6579c249fca9026ce7c333fc142ba42411fa243cdc", size = 2009000, upload-time = "2025-04-23T18:31:25.863Z" }, + { url = "https://files.pythonhosted.org/packages/a1/02/6224312aacb3c8ecbaa959897af57181fb6cf3a3d7917fd44d0f2917e6f2/pydantic_core-2.33.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:3c6db6e52c6d70aa0d00d45cdb9b40f0433b96380071ea80b09277dba021ddf7", size = 1847996, upload-time = "2025-04-23T18:31:27.341Z" }, + { url = "https://files.pythonhosted.org/packages/d6/46/6dcdf084a523dbe0a0be59d054734b86a981726f221f4562aed313dbcb49/pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e61206137cbc65e6d5256e1166f88331d3b6238e082d9f74613b9b765fb9025", size = 1880957, upload-time = "2025-04-23T18:31:28.956Z" }, + { url = "https://files.pythonhosted.org/packages/ec/6b/1ec2c03837ac00886ba8160ce041ce4e325b41d06a034adbef11339ae422/pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eb8c529b2819c37140eb51b914153063d27ed88e3bdc31b71198a198e921e011", size = 1964199, upload-time = "2025-04-23T18:31:31.025Z" }, + { url = "https://files.pythonhosted.org/packages/2d/1d/6bf34d6adb9debd9136bd197ca72642203ce9aaaa85cfcbfcf20f9696e83/pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c52b02ad8b4e2cf14ca7b3d918f3eb0ee91e63b3167c32591e57c4317e134f8f", size = 2120296, upload-time = "2025-04-23T18:31:32.514Z" }, + { url = "https://files.pythonhosted.org/packages/e0/94/2bd0aaf5a591e974b32a9f7123f16637776c304471a0ab33cf263cf5591a/pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:96081f1605125ba0855dfda83f6f3df5ec90c61195421ba72223de35ccfb2f88", size = 2676109, upload-time = "2025-04-23T18:31:33.958Z" }, + { url = "https://files.pythonhosted.org/packages/f9/41/4b043778cf9c4285d59742281a769eac371b9e47e35f98ad321349cc5d61/pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f57a69461af2a5fa6e6bbd7a5f60d3b7e6cebb687f55106933188e79ad155c1", size = 2002028, upload-time = "2025-04-23T18:31:39.095Z" }, + { url = "https://files.pythonhosted.org/packages/cb/d5/7bb781bf2748ce3d03af04d5c969fa1308880e1dca35a9bd94e1a96a922e/pydantic_core-2.33.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:572c7e6c8bb4774d2ac88929e3d1f12bc45714ae5ee6d9a788a9fb35e60bb04b", size = 2100044, upload-time = "2025-04-23T18:31:41.034Z" }, + { url = "https://files.pythonhosted.org/packages/fe/36/def5e53e1eb0ad896785702a5bbfd25eed546cdcf4087ad285021a90ed53/pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:db4b41f9bd95fbe5acd76d89920336ba96f03e149097365afe1cb092fceb89a1", size = 2058881, upload-time = "2025-04-23T18:31:42.757Z" }, + { url = "https://files.pythonhosted.org/packages/01/6c/57f8d70b2ee57fc3dc8b9610315949837fa8c11d86927b9bb044f8705419/pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:fa854f5cf7e33842a892e5c73f45327760bc7bc516339fda888c75ae60edaeb6", size = 2227034, upload-time = "2025-04-23T18:31:44.304Z" }, + { url = "https://files.pythonhosted.org/packages/27/b9/9c17f0396a82b3d5cbea4c24d742083422639e7bb1d5bf600e12cb176a13/pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:5f483cfb75ff703095c59e365360cb73e00185e01aaea067cd19acffd2ab20ea", size = 2234187, upload-time = "2025-04-23T18:31:45.891Z" }, + { url = "https://files.pythonhosted.org/packages/b0/6a/adf5734ffd52bf86d865093ad70b2ce543415e0e356f6cacabbc0d9ad910/pydantic_core-2.33.2-cp312-cp312-win32.whl", hash = "sha256:9cb1da0f5a471435a7bc7e439b8a728e8b61e59784b2af70d7c169f8dd8ae290", size = 1892628, upload-time = "2025-04-23T18:31:47.819Z" }, + { url = "https://files.pythonhosted.org/packages/43/e4/5479fecb3606c1368d496a825d8411e126133c41224c1e7238be58b87d7e/pydantic_core-2.33.2-cp312-cp312-win_amd64.whl", hash = "sha256:f941635f2a3d96b2973e867144fde513665c87f13fe0e193c158ac51bfaaa7b2", size = 1955866, upload-time = "2025-04-23T18:31:49.635Z" }, + { url = "https://files.pythonhosted.org/packages/0d/24/8b11e8b3e2be9dd82df4b11408a67c61bb4dc4f8e11b5b0fc888b38118b5/pydantic_core-2.33.2-cp312-cp312-win_arm64.whl", hash = "sha256:cca3868ddfaccfbc4bfb1d608e2ccaaebe0ae628e1416aeb9c4d88c001bb45ab", size = 1888894, upload-time = "2025-04-23T18:31:51.609Z" }, + { url = "https://files.pythonhosted.org/packages/46/8c/99040727b41f56616573a28771b1bfa08a3d3fe74d3d513f01251f79f172/pydantic_core-2.33.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:1082dd3e2d7109ad8b7da48e1d4710c8d06c253cbc4a27c1cff4fbcaa97a9e3f", size = 2015688, upload-time = "2025-04-23T18:31:53.175Z" }, + { url = "https://files.pythonhosted.org/packages/3a/cc/5999d1eb705a6cefc31f0b4a90e9f7fc400539b1a1030529700cc1b51838/pydantic_core-2.33.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f517ca031dfc037a9c07e748cefd8d96235088b83b4f4ba8939105d20fa1dcd6", size = 1844808, upload-time = "2025-04-23T18:31:54.79Z" }, + { url = "https://files.pythonhosted.org/packages/6f/5e/a0a7b8885c98889a18b6e376f344da1ef323d270b44edf8174d6bce4d622/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0a9f2c9dd19656823cb8250b0724ee9c60a82f3cdf68a080979d13092a3b0fef", size = 1885580, upload-time = "2025-04-23T18:31:57.393Z" }, + { url = "https://files.pythonhosted.org/packages/3b/2a/953581f343c7d11a304581156618c3f592435523dd9d79865903272c256a/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2b0a451c263b01acebe51895bfb0e1cc842a5c666efe06cdf13846c7418caa9a", size = 1973859, upload-time = "2025-04-23T18:31:59.065Z" }, + { url = "https://files.pythonhosted.org/packages/e6/55/f1a813904771c03a3f97f676c62cca0c0a4138654107c1b61f19c644868b/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ea40a64d23faa25e62a70ad163571c0b342b8bf66d5fa612ac0dec4f069d916", size = 2120810, upload-time = "2025-04-23T18:32:00.78Z" }, + { url = "https://files.pythonhosted.org/packages/aa/c3/053389835a996e18853ba107a63caae0b9deb4a276c6b472931ea9ae6e48/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0fb2d542b4d66f9470e8065c5469ec676978d625a8b7a363f07d9a501a9cb36a", size = 2676498, upload-time = "2025-04-23T18:32:02.418Z" }, + { url = "https://files.pythonhosted.org/packages/eb/3c/f4abd740877a35abade05e437245b192f9d0ffb48bbbbd708df33d3cda37/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdac5d6ffa1b5a83bca06ffe7583f5576555e6c8b3a91fbd25ea7780f825f7d", size = 2000611, upload-time = "2025-04-23T18:32:04.152Z" }, + { url = "https://files.pythonhosted.org/packages/59/a7/63ef2fed1837d1121a894d0ce88439fe3e3b3e48c7543b2a4479eb99c2bd/pydantic_core-2.33.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:04a1a413977ab517154eebb2d326da71638271477d6ad87a769102f7c2488c56", size = 2107924, upload-time = "2025-04-23T18:32:06.129Z" }, + { url = "https://files.pythonhosted.org/packages/04/8f/2551964ef045669801675f1cfc3b0d74147f4901c3ffa42be2ddb1f0efc4/pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:c8e7af2f4e0194c22b5b37205bfb293d166a7344a5b0d0eaccebc376546d77d5", size = 2063196, upload-time = "2025-04-23T18:32:08.178Z" }, + { url = "https://files.pythonhosted.org/packages/26/bd/d9602777e77fc6dbb0c7db9ad356e9a985825547dce5ad1d30ee04903918/pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:5c92edd15cd58b3c2d34873597a1e20f13094f59cf88068adb18947df5455b4e", size = 2236389, upload-time = "2025-04-23T18:32:10.242Z" }, + { url = "https://files.pythonhosted.org/packages/42/db/0e950daa7e2230423ab342ae918a794964b053bec24ba8af013fc7c94846/pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:65132b7b4a1c0beded5e057324b7e16e10910c106d43675d9bd87d4f38dde162", size = 2239223, upload-time = "2025-04-23T18:32:12.382Z" }, + { url = "https://files.pythonhosted.org/packages/58/4d/4f937099c545a8a17eb52cb67fe0447fd9a373b348ccfa9a87f141eeb00f/pydantic_core-2.33.2-cp313-cp313-win32.whl", hash = "sha256:52fb90784e0a242bb96ec53f42196a17278855b0f31ac7c3cc6f5c1ec4811849", size = 1900473, upload-time = "2025-04-23T18:32:14.034Z" }, + { url = "https://files.pythonhosted.org/packages/a0/75/4a0a9bac998d78d889def5e4ef2b065acba8cae8c93696906c3a91f310ca/pydantic_core-2.33.2-cp313-cp313-win_amd64.whl", hash = "sha256:c083a3bdd5a93dfe480f1125926afcdbf2917ae714bdb80b36d34318b2bec5d9", size = 1955269, upload-time = "2025-04-23T18:32:15.783Z" }, + { url = "https://files.pythonhosted.org/packages/f9/86/1beda0576969592f1497b4ce8e7bc8cbdf614c352426271b1b10d5f0aa64/pydantic_core-2.33.2-cp313-cp313-win_arm64.whl", hash = "sha256:e80b087132752f6b3d714f041ccf74403799d3b23a72722ea2e6ba2e892555b9", size = 1893921, upload-time = "2025-04-23T18:32:18.473Z" }, + { url = "https://files.pythonhosted.org/packages/a4/7d/e09391c2eebeab681df2b74bfe6c43422fffede8dc74187b2b0bf6fd7571/pydantic_core-2.33.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:61c18fba8e5e9db3ab908620af374db0ac1baa69f0f32df4f61ae23f15e586ac", size = 1806162, upload-time = "2025-04-23T18:32:20.188Z" }, + { url = "https://files.pythonhosted.org/packages/f1/3d/847b6b1fed9f8ed3bb95a9ad04fbd0b212e832d4f0f50ff4d9ee5a9f15cf/pydantic_core-2.33.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95237e53bb015f67b63c91af7518a62a8660376a6a0db19b89acc77a4d6199f5", size = 1981560, upload-time = "2025-04-23T18:32:22.354Z" }, + { url = "https://files.pythonhosted.org/packages/6f/9a/e73262f6c6656262b5fdd723ad90f518f579b7bc8622e43a942eec53c938/pydantic_core-2.33.2-cp313-cp313t-win_amd64.whl", hash = "sha256:c2fc0a768ef76c15ab9238afa6da7f69895bb5d1ee83aeea2e3509af4472d0b9", size = 1935777, upload-time = "2025-04-23T18:32:25.088Z" }, + { url = "https://files.pythonhosted.org/packages/53/ea/bbe9095cdd771987d13c82d104a9c8559ae9aec1e29f139e286fd2e9256e/pydantic_core-2.33.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:a2b911a5b90e0374d03813674bf0a5fbbb7741570dcd4b4e85a2e48d17def29d", size = 2028677, upload-time = "2025-04-23T18:32:27.227Z" }, + { url = "https://files.pythonhosted.org/packages/49/1d/4ac5ed228078737d457a609013e8f7edc64adc37b91d619ea965758369e5/pydantic_core-2.33.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6fa6dfc3e4d1f734a34710f391ae822e0a8eb8559a85c6979e14e65ee6ba2954", size = 1864735, upload-time = "2025-04-23T18:32:29.019Z" }, + { url = "https://files.pythonhosted.org/packages/23/9a/2e70d6388d7cda488ae38f57bc2f7b03ee442fbcf0d75d848304ac7e405b/pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c54c939ee22dc8e2d545da79fc5381f1c020d6d3141d3bd747eab59164dc89fb", size = 1898467, upload-time = "2025-04-23T18:32:31.119Z" }, + { url = "https://files.pythonhosted.org/packages/ff/2e/1568934feb43370c1ffb78a77f0baaa5a8b6897513e7a91051af707ffdc4/pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:53a57d2ed685940a504248187d5685e49eb5eef0f696853647bf37c418c538f7", size = 1983041, upload-time = "2025-04-23T18:32:33.655Z" }, + { url = "https://files.pythonhosted.org/packages/01/1a/1a1118f38ab64eac2f6269eb8c120ab915be30e387bb561e3af904b12499/pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:09fb9dd6571aacd023fe6aaca316bd01cf60ab27240d7eb39ebd66a3a15293b4", size = 2136503, upload-time = "2025-04-23T18:32:35.519Z" }, + { url = "https://files.pythonhosted.org/packages/5c/da/44754d1d7ae0f22d6d3ce6c6b1486fc07ac2c524ed8f6eca636e2e1ee49b/pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0e6116757f7959a712db11f3e9c0a99ade00a5bbedae83cb801985aa154f071b", size = 2736079, upload-time = "2025-04-23T18:32:37.659Z" }, + { url = "https://files.pythonhosted.org/packages/4d/98/f43cd89172220ec5aa86654967b22d862146bc4d736b1350b4c41e7c9c03/pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d55ab81c57b8ff8548c3e4947f119551253f4e3787a7bbc0b6b3ca47498a9d3", size = 2006508, upload-time = "2025-04-23T18:32:39.637Z" }, + { url = "https://files.pythonhosted.org/packages/2b/cc/f77e8e242171d2158309f830f7d5d07e0531b756106f36bc18712dc439df/pydantic_core-2.33.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c20c462aa4434b33a2661701b861604913f912254e441ab8d78d30485736115a", size = 2113693, upload-time = "2025-04-23T18:32:41.818Z" }, + { url = "https://files.pythonhosted.org/packages/54/7a/7be6a7bd43e0a47c147ba7fbf124fe8aaf1200bc587da925509641113b2d/pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:44857c3227d3fb5e753d5fe4a3420d6376fa594b07b621e220cd93703fe21782", size = 2074224, upload-time = "2025-04-23T18:32:44.033Z" }, + { url = "https://files.pythonhosted.org/packages/2a/07/31cf8fadffbb03be1cb520850e00a8490c0927ec456e8293cafda0726184/pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:eb9b459ca4df0e5c87deb59d37377461a538852765293f9e6ee834f0435a93b9", size = 2245403, upload-time = "2025-04-23T18:32:45.836Z" }, + { url = "https://files.pythonhosted.org/packages/b6/8d/bbaf4c6721b668d44f01861f297eb01c9b35f612f6b8e14173cb204e6240/pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9fcd347d2cc5c23b06de6d3b7b8275be558a0c90549495c699e379a80bf8379e", size = 2242331, upload-time = "2025-04-23T18:32:47.618Z" }, + { url = "https://files.pythonhosted.org/packages/bb/93/3cc157026bca8f5006250e74515119fcaa6d6858aceee8f67ab6dc548c16/pydantic_core-2.33.2-cp39-cp39-win32.whl", hash = "sha256:83aa99b1285bc8f038941ddf598501a86f1536789740991d7d8756e34f1e74d9", size = 1910571, upload-time = "2025-04-23T18:32:49.401Z" }, + { url = "https://files.pythonhosted.org/packages/5b/90/7edc3b2a0d9f0dda8806c04e511a67b0b7a41d2187e2003673a996fb4310/pydantic_core-2.33.2-cp39-cp39-win_amd64.whl", hash = "sha256:f481959862f57f29601ccced557cc2e817bce7533ab8e01a797a48b49c9692b3", size = 1956504, upload-time = "2025-04-23T18:32:51.287Z" }, + { url = "https://files.pythonhosted.org/packages/30/68/373d55e58b7e83ce371691f6eaa7175e3a24b956c44628eb25d7da007917/pydantic_core-2.33.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5c4aa4e82353f65e548c476b37e64189783aa5384903bfea4f41580f255fddfa", size = 2023982, upload-time = "2025-04-23T18:32:53.14Z" }, + { url = "https://files.pythonhosted.org/packages/a4/16/145f54ac08c96a63d8ed6442f9dec17b2773d19920b627b18d4f10a061ea/pydantic_core-2.33.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:d946c8bf0d5c24bf4fe333af284c59a19358aa3ec18cb3dc4370080da1e8ad29", size = 1858412, upload-time = "2025-04-23T18:32:55.52Z" }, + { url = "https://files.pythonhosted.org/packages/41/b1/c6dc6c3e2de4516c0bb2c46f6a373b91b5660312342a0cf5826e38ad82fa/pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:87b31b6846e361ef83fedb187bb5b4372d0da3f7e28d85415efa92d6125d6e6d", size = 1892749, upload-time = "2025-04-23T18:32:57.546Z" }, + { url = "https://files.pythonhosted.org/packages/12/73/8cd57e20afba760b21b742106f9dbdfa6697f1570b189c7457a1af4cd8a0/pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa9d91b338f2df0508606f7009fde642391425189bba6d8c653afd80fd6bb64e", size = 2067527, upload-time = "2025-04-23T18:32:59.771Z" }, + { url = "https://files.pythonhosted.org/packages/e3/d5/0bb5d988cc019b3cba4a78f2d4b3854427fc47ee8ec8e9eaabf787da239c/pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2058a32994f1fde4ca0480ab9d1e75a0e8c87c22b53a3ae66554f9af78f2fe8c", size = 2108225, upload-time = "2025-04-23T18:33:04.51Z" }, + { url = "https://files.pythonhosted.org/packages/f1/c5/00c02d1571913d496aabf146106ad8239dc132485ee22efe08085084ff7c/pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:0e03262ab796d986f978f79c943fc5f620381be7287148b8010b4097f79a39ec", size = 2069490, upload-time = "2025-04-23T18:33:06.391Z" }, + { url = "https://files.pythonhosted.org/packages/22/a8/dccc38768274d3ed3a59b5d06f59ccb845778687652daa71df0cab4040d7/pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:1a8695a8d00c73e50bff9dfda4d540b7dee29ff9b8053e38380426a85ef10052", size = 2237525, upload-time = "2025-04-23T18:33:08.44Z" }, + { url = "https://files.pythonhosted.org/packages/d4/e7/4f98c0b125dda7cf7ccd14ba936218397b44f50a56dd8c16a3091df116c3/pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:fa754d1850735a0b0e03bcffd9d4b4343eb417e47196e4485d9cca326073a42c", size = 2238446, upload-time = "2025-04-23T18:33:10.313Z" }, + { url = "https://files.pythonhosted.org/packages/ce/91/2ec36480fdb0b783cd9ef6795753c1dea13882f2e68e73bce76ae8c21e6a/pydantic_core-2.33.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:a11c8d26a50bfab49002947d3d237abe4d9e4b5bdc8846a63537b6488e197808", size = 2066678, upload-time = "2025-04-23T18:33:12.224Z" }, + { url = "https://files.pythonhosted.org/packages/7b/27/d4ae6487d73948d6f20dddcd94be4ea43e74349b56eba82e9bdee2d7494c/pydantic_core-2.33.2-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:dd14041875d09cc0f9308e37a6f8b65f5585cf2598a53aa0123df8b129d481f8", size = 2025200, upload-time = "2025-04-23T18:33:14.199Z" }, + { url = "https://files.pythonhosted.org/packages/f1/b8/b3cb95375f05d33801024079b9392a5ab45267a63400bf1866e7ce0f0de4/pydantic_core-2.33.2-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:d87c561733f66531dced0da6e864f44ebf89a8fba55f31407b00c2f7f9449593", size = 1859123, upload-time = "2025-04-23T18:33:16.555Z" }, + { url = "https://files.pythonhosted.org/packages/05/bc/0d0b5adeda59a261cd30a1235a445bf55c7e46ae44aea28f7bd6ed46e091/pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2f82865531efd18d6e07a04a17331af02cb7a651583c418df8266f17a63c6612", size = 1892852, upload-time = "2025-04-23T18:33:18.513Z" }, + { url = "https://files.pythonhosted.org/packages/3e/11/d37bdebbda2e449cb3f519f6ce950927b56d62f0b84fd9cb9e372a26a3d5/pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2bfb5112df54209d820d7bf9317c7a6c9025ea52e49f46b6a2060104bba37de7", size = 2067484, upload-time = "2025-04-23T18:33:20.475Z" }, + { url = "https://files.pythonhosted.org/packages/8c/55/1f95f0a05ce72ecb02a8a8a1c3be0579bbc29b1d5ab68f1378b7bebc5057/pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:64632ff9d614e5eecfb495796ad51b0ed98c453e447a76bcbeeb69615079fc7e", size = 2108896, upload-time = "2025-04-23T18:33:22.501Z" }, + { url = "https://files.pythonhosted.org/packages/53/89/2b2de6c81fa131f423246a9109d7b2a375e83968ad0800d6e57d0574629b/pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:f889f7a40498cc077332c7ab6b4608d296d852182211787d4f3ee377aaae66e8", size = 2069475, upload-time = "2025-04-23T18:33:24.528Z" }, + { url = "https://files.pythonhosted.org/packages/b8/e9/1f7efbe20d0b2b10f6718944b5d8ece9152390904f29a78e68d4e7961159/pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:de4b83bb311557e439b9e186f733f6c645b9417c84e2eb8203f3f820a4b988bf", size = 2239013, upload-time = "2025-04-23T18:33:26.621Z" }, + { url = "https://files.pythonhosted.org/packages/3c/b2/5309c905a93811524a49b4e031e9851a6b00ff0fb668794472ea7746b448/pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:82f68293f055f51b51ea42fafc74b6aad03e70e191799430b90c13d643059ebb", size = 2238715, upload-time = "2025-04-23T18:33:28.656Z" }, + { url = "https://files.pythonhosted.org/packages/32/56/8a7ca5d2cd2cda1d245d34b1c9a942920a718082ae8e54e5f3e5a58b7add/pydantic_core-2.33.2-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:329467cecfb529c925cf2bbd4d60d2c509bc2fb52a20c1045bf09bb70971a9c1", size = 2066757, upload-time = "2025-04-23T18:33:30.645Z" }, + { url = "https://files.pythonhosted.org/packages/08/98/dbf3fdfabaf81cda5622154fda78ea9965ac467e3239078e0dcd6df159e7/pydantic_core-2.33.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:87acbfcf8e90ca885206e98359d7dca4bcbb35abdc0ff66672a293e1d7a19101", size = 2024034, upload-time = "2025-04-23T18:33:32.843Z" }, + { url = "https://files.pythonhosted.org/packages/8d/99/7810aa9256e7f2ccd492590f86b79d370df1e9292f1f80b000b6a75bd2fb/pydantic_core-2.33.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:7f92c15cd1e97d4b12acd1cc9004fa092578acfa57b67ad5e43a197175d01a64", size = 1858578, upload-time = "2025-04-23T18:33:34.912Z" }, + { url = "https://files.pythonhosted.org/packages/d8/60/bc06fa9027c7006cc6dd21e48dbf39076dc39d9abbaf718a1604973a9670/pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d3f26877a748dc4251cfcfda9dfb5f13fcb034f5308388066bcfe9031b63ae7d", size = 1892858, upload-time = "2025-04-23T18:33:36.933Z" }, + { url = "https://files.pythonhosted.org/packages/f2/40/9d03997d9518816c68b4dfccb88969756b9146031b61cd37f781c74c9b6a/pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dac89aea9af8cd672fa7b510e7b8c33b0bba9a43186680550ccf23020f32d535", size = 2068498, upload-time = "2025-04-23T18:33:38.997Z" }, + { url = "https://files.pythonhosted.org/packages/d8/62/d490198d05d2d86672dc269f52579cad7261ced64c2df213d5c16e0aecb1/pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:970919794d126ba8645f3837ab6046fb4e72bbc057b3709144066204c19a455d", size = 2108428, upload-time = "2025-04-23T18:33:41.18Z" }, + { url = "https://files.pythonhosted.org/packages/9a/ec/4cd215534fd10b8549015f12ea650a1a973da20ce46430b68fc3185573e8/pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:3eb3fe62804e8f859c49ed20a8451342de53ed764150cb14ca71357c765dc2a6", size = 2069854, upload-time = "2025-04-23T18:33:43.446Z" }, + { url = "https://files.pythonhosted.org/packages/1a/1a/abbd63d47e1d9b0d632fee6bb15785d0889c8a6e0a6c3b5a8e28ac1ec5d2/pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:3abcd9392a36025e3bd55f9bd38d908bd17962cc49bc6da8e7e96285336e2bca", size = 2237859, upload-time = "2025-04-23T18:33:45.56Z" }, + { url = "https://files.pythonhosted.org/packages/80/1c/fa883643429908b1c90598fd2642af8839efd1d835b65af1f75fba4d94fe/pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:3a1c81334778f9e3af2f8aeb7a960736e5cab1dfebfb26aabca09afd2906c039", size = 2239059, upload-time = "2025-04-23T18:33:47.735Z" }, + { url = "https://files.pythonhosted.org/packages/d4/29/3cade8a924a61f60ccfa10842f75eb12787e1440e2b8660ceffeb26685e7/pydantic_core-2.33.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:2807668ba86cb38c6817ad9bc66215ab8584d1d304030ce4f0887336f28a5e27", size = 2066661, upload-time = "2025-04-23T18:33:49.995Z" }, +] + +[[package]] +name = "pygments" +version = "2.19.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/7c/2d/c3338d48ea6cc0feb8446d8e6937e1408088a72a39937982cc6111d17f84/pygments-2.19.1.tar.gz", hash = "sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f", size = 4968581, upload-time = "2025-01-06T17:26:30.443Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8a/0b/9fcc47d19c48b59121088dd6da2488a49d5f72dacf8262e2790a1d2c7d15/pygments-2.19.1-py3-none-any.whl", hash = "sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c", size = 1225293, upload-time = "2025-01-06T17:26:25.553Z" }, +] + +[[package]] +name = "pyright" +version = "1.1.399" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "nodeenv" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/db/9d/d91d5f6d26b2db95476fefc772e2b9a16d54c6bd0ea6bb5c1b6d635ab8b4/pyright-1.1.399.tar.gz", hash = "sha256:439035d707a36c3d1b443aec980bc37053fbda88158eded24b8eedcf1c7b7a1b", size = 3856954, upload-time = "2025-04-10T04:40:25.703Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2f/b5/380380c9e7a534cb1783c70c3e8ac6d1193c599650a55838d0557586796e/pyright-1.1.399-py3-none-any.whl", hash = "sha256:55f9a875ddf23c9698f24208c764465ffdfd38be6265f7faf9a176e1dc549f3b", size = 5592584, upload-time = "2025-04-10T04:40:23.502Z" }, +] + +[[package]] +name = "pytest" +version = "8.3.5" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.9'", +] +dependencies = [ + { name = "colorama", marker = "(python_full_version < '3.9' and sys_platform == 'win32') or (python_full_version >= '3.9' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2') or (sys_platform != 'win32' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "exceptiongroup", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "iniconfig", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "packaging", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pluggy", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "tomli", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ae/3c/c9d525a414d506893f0cd8a8d0de7706446213181570cdbd766691164e40/pytest-8.3.5.tar.gz", hash = "sha256:f4efe70cc14e511565ac476b57c279e12a855b11f48f212af1080ef2263d3845", size = 1450891, upload-time = "2025-03-02T12:54:54.503Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/30/3d/64ad57c803f1fa1e963a7946b6e0fea4a70df53c1a7fed304586539c2bac/pytest-8.3.5-py3-none-any.whl", hash = "sha256:c69214aa47deac29fad6c2a4f590b9c4a9fdb16a403176fe154b79c0b4d4d820", size = 343634, upload-time = "2025-03-02T12:54:52.069Z" }, +] + +[[package]] +name = "pytest" +version = "8.4.1" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.9'", +] +dependencies = [ + { name = "colorama", marker = "(python_full_version >= '3.9' and sys_platform == 'win32') or (python_full_version < '3.9' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2') or (sys_platform != 'win32' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "exceptiongroup", marker = "(python_full_version >= '3.9' and python_full_version < '3.11') or (python_full_version < '3.9' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2') or (python_full_version >= '3.11' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "iniconfig", marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "packaging", marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pluggy", marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pygments", marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "tomli", marker = "(python_full_version >= '3.9' and python_full_version < '3.11') or (python_full_version < '3.9' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2') or (python_full_version >= '3.11' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/08/ba/45911d754e8eba3d5a841a5ce61a65a685ff1798421ac054f85aa8747dfb/pytest-8.4.1.tar.gz", hash = "sha256:7c67fd69174877359ed9371ec3af8a3d2b04741818c51e5e99cc1742251fa93c", size = 1517714, upload-time = "2025-06-18T05:48:06.109Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/29/16/c8a903f4c4dffe7a12843191437d7cd8e32751d5de349d45d3fe69544e87/pytest-8.4.1-py3-none-any.whl", hash = "sha256:539c70ba6fcead8e78eebbf1115e8b589e7565830d7d006a8723f19ac8a0afb7", size = 365474, upload-time = "2025-06-18T05:48:03.955Z" }, +] + +[[package]] +name = "pytest-asyncio" +version = "0.24.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pytest", version = "8.3.5", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pytest", version = "8.4.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/52/6d/c6cf50ce320cf8611df7a1254d86233b3df7cc07f9b5f5cbcb82e08aa534/pytest_asyncio-0.24.0.tar.gz", hash = "sha256:d081d828e576d85f875399194281e92bf8a68d60d72d1a2faf2feddb6c46b276", size = 49855, upload-time = "2024-08-22T08:03:18.145Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/96/31/6607dab48616902f76885dfcf62c08d929796fc3b2d2318faf9fd54dbed9/pytest_asyncio-0.24.0-py3-none-any.whl", hash = "sha256:a811296ed596b69bf0b6f3dc40f83bcaf341b155a269052d82efa2b25ac7037b", size = 18024, upload-time = "2024-08-22T08:03:15.536Z" }, +] + +[[package]] +name = "pytest-xdist" +version = "3.6.1" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.9'", +] +dependencies = [ + { name = "execnet", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pytest", version = "8.3.5", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/41/c4/3c310a19bc1f1e9ef50075582652673ef2bfc8cd62afef9585683821902f/pytest_xdist-3.6.1.tar.gz", hash = "sha256:ead156a4db231eec769737f57668ef58a2084a34b2e55c4a8fa20d861107300d", size = 84060, upload-time = "2024-04-28T19:29:54.414Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6d/82/1d96bf03ee4c0fdc3c0cbe61470070e659ca78dc0086fb88b66c185e2449/pytest_xdist-3.6.1-py3-none-any.whl", hash = "sha256:9ed4adfb68a016610848639bb7e02c9352d5d9f03d04809919e2dafc3be4cca7", size = 46108, upload-time = "2024-04-28T19:29:52.813Z" }, +] + +[[package]] +name = "pytest-xdist" +version = "3.7.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.9'", +] +dependencies = [ + { name = "execnet", marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pytest", version = "8.4.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/49/dc/865845cfe987b21658e871d16e0a24e871e00884c545f246dd8f6f69edda/pytest_xdist-3.7.0.tar.gz", hash = "sha256:f9248c99a7c15b7d2f90715df93610353a485827bc06eefb6566d23f6400f126", size = 87550, upload-time = "2025-05-26T21:18:20.251Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0d/b2/0e802fde6f1c5b2f7ae7e9ad42b83fd4ecebac18a8a8c2f2f14e39dce6e1/pytest_xdist-3.7.0-py3-none-any.whl", hash = "sha256:7d3fbd255998265052435eb9daa4e99b62e6fb9cfb6efd1f858d4d8c0c7f0ca0", size = 46142, upload-time = "2025-05-26T21:18:18.759Z" }, +] + +[[package]] +name = "python-dateutil" +version = "2.9.0.post0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "six" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/66/c0/0c8b6ad9f17a802ee498c46e004a0eb49bc148f2fd230864601a86dcf6db/python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", size = 342432, upload-time = "2024-03-01T18:36:20.211Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892, upload-time = "2024-03-01T18:36:18.57Z" }, +] + +[[package]] +name = "pytz" +version = "2024.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/3a/31/3c70bf7603cc2dca0f19bdc53b4537a797747a58875b552c8c413d963a3f/pytz-2024.2.tar.gz", hash = "sha256:2aa355083c50a0f93fa581709deac0c9ad65cca8a9e9beac660adcbd493c798a", size = 319692, upload-time = "2024-09-11T02:24:47.91Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/11/c3/005fcca25ce078d2cc29fd559379817424e94885510568bc1bc53d7d5846/pytz-2024.2-py2.py3-none-any.whl", hash = "sha256:31c7c1817eb7fae7ca4b8c7ee50c72f93aa2dd863de768e1ef4245d426aa0725", size = 508002, upload-time = "2024-09-11T02:24:45.8Z" }, +] + +[[package]] +name = "respx" +version = "0.22.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "httpx" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f4/7c/96bd0bc759cf009675ad1ee1f96535edcb11e9666b985717eb8c87192a95/respx-0.22.0.tar.gz", hash = "sha256:3c8924caa2a50bd71aefc07aa812f2466ff489f1848c96e954a5362d17095d91", size = 28439, upload-time = "2024-12-19T22:33:59.374Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8e/67/afbb0978d5399bc9ea200f1d4489a23c9a1dad4eee6376242b8182389c79/respx-0.22.0-py2.py3-none-any.whl", hash = "sha256:631128d4c9aba15e56903fb5f66fb1eff412ce28dd387ca3a81339e52dbd3ad0", size = 25127, upload-time = "2024-12-19T22:33:57.837Z" }, +] + +[[package]] +name = "rich" +version = "13.9.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markdown-it-py" }, + { name = "pygments" }, + { name = "typing-extensions", marker = "python_full_version < '3.11' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ab/3a/0316b28d0761c6734d6bc14e770d85506c986c85ffb239e688eeaab2c2bc/rich-13.9.4.tar.gz", hash = "sha256:439594978a49a09530cff7ebc4b5c7103ef57baf48d5ea3184f21d9a2befa098", size = 223149, upload-time = "2024-11-01T16:43:57.873Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/19/71/39c7c0d87f8d4e6c020a393182060eaefeeae6c01dab6a84ec346f2567df/rich-13.9.4-py3-none-any.whl", hash = "sha256:6049d5e6ec054bf2779ab3358186963bac2ea89175919d699e378b99738c2a90", size = 242424, upload-time = "2024-11-01T16:43:55.817Z" }, +] + +[[package]] +name = "ruff" +version = "0.9.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/c0/17/529e78f49fc6f8076f50d985edd9a2cf011d1dbadb1cdeacc1d12afc1d26/ruff-0.9.4.tar.gz", hash = "sha256:6907ee3529244bb0ed066683e075f09285b38dd5b4039370df6ff06041ca19e7", size = 3599458, upload-time = "2025-01-30T18:09:51.03Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b6/f8/3fafb7804d82e0699a122101b5bee5f0d6e17c3a806dcbc527bb7d3f5b7a/ruff-0.9.4-py3-none-linux_armv6l.whl", hash = "sha256:64e73d25b954f71ff100bb70f39f1ee09e880728efb4250c632ceed4e4cdf706", size = 11668400, upload-time = "2025-01-30T18:08:46.508Z" }, + { url = "https://files.pythonhosted.org/packages/2e/a6/2efa772d335da48a70ab2c6bb41a096c8517ca43c086ea672d51079e3d1f/ruff-0.9.4-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:6ce6743ed64d9afab4fafeaea70d3631b4d4b28b592db21a5c2d1f0ef52934bf", size = 11628395, upload-time = "2025-01-30T18:08:50.87Z" }, + { url = "https://files.pythonhosted.org/packages/dc/d7/cd822437561082f1c9d7225cc0d0fbb4bad117ad7ac3c41cd5d7f0fa948c/ruff-0.9.4-py3-none-macosx_11_0_arm64.whl", hash = "sha256:54499fb08408e32b57360f6f9de7157a5fec24ad79cb3f42ef2c3f3f728dfe2b", size = 11090052, upload-time = "2025-01-30T18:08:54.498Z" }, + { url = "https://files.pythonhosted.org/packages/9e/67/3660d58e893d470abb9a13f679223368ff1684a4ef40f254a0157f51b448/ruff-0.9.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:37c892540108314a6f01f105040b5106aeb829fa5fb0561d2dcaf71485021137", size = 11882221, upload-time = "2025-01-30T18:08:57.784Z" }, + { url = "https://files.pythonhosted.org/packages/79/d1/757559995c8ba5f14dfec4459ef2dd3fcea82ac43bc4e7c7bf47484180c0/ruff-0.9.4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:de9edf2ce4b9ddf43fd93e20ef635a900e25f622f87ed6e3047a664d0e8f810e", size = 11424862, upload-time = "2025-01-30T18:09:01.167Z" }, + { url = "https://files.pythonhosted.org/packages/c0/96/7915a7c6877bb734caa6a2af424045baf6419f685632469643dbd8eb2958/ruff-0.9.4-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:87c90c32357c74f11deb7fbb065126d91771b207bf9bfaaee01277ca59b574ec", size = 12626735, upload-time = "2025-01-30T18:09:05.312Z" }, + { url = "https://files.pythonhosted.org/packages/0e/cc/dadb9b35473d7cb17c7ffe4737b4377aeec519a446ee8514123ff4a26091/ruff-0.9.4-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:56acd6c694da3695a7461cc55775f3a409c3815ac467279dfa126061d84b314b", size = 13255976, upload-time = "2025-01-30T18:09:09.425Z" }, + { url = "https://files.pythonhosted.org/packages/5f/c3/ad2dd59d3cabbc12df308cced780f9c14367f0321e7800ca0fe52849da4c/ruff-0.9.4-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e0c93e7d47ed951b9394cf352d6695b31498e68fd5782d6cbc282425655f687a", size = 12752262, upload-time = "2025-01-30T18:09:13.112Z" }, + { url = "https://files.pythonhosted.org/packages/c7/17/5f1971e54bd71604da6788efd84d66d789362b1105e17e5ccc53bba0289b/ruff-0.9.4-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1d4c8772670aecf037d1bf7a07c39106574d143b26cfe5ed1787d2f31e800214", size = 14401648, upload-time = "2025-01-30T18:09:17.086Z" }, + { url = "https://files.pythonhosted.org/packages/30/24/6200b13ea611b83260501b6955b764bb320e23b2b75884c60ee7d3f0b68e/ruff-0.9.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bfc5f1d7afeda8d5d37660eeca6d389b142d7f2b5a1ab659d9214ebd0e025231", size = 12414702, upload-time = "2025-01-30T18:09:21.672Z" }, + { url = "https://files.pythonhosted.org/packages/34/cb/f5d50d0c4ecdcc7670e348bd0b11878154bc4617f3fdd1e8ad5297c0d0ba/ruff-0.9.4-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:faa935fc00ae854d8b638c16a5f1ce881bc3f67446957dd6f2af440a5fc8526b", size = 11859608, upload-time = "2025-01-30T18:09:25.663Z" }, + { url = "https://files.pythonhosted.org/packages/d6/f4/9c8499ae8426da48363bbb78d081b817b0f64a9305f9b7f87eab2a8fb2c1/ruff-0.9.4-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:a6c634fc6f5a0ceae1ab3e13c58183978185d131a29c425e4eaa9f40afe1e6d6", size = 11485702, upload-time = "2025-01-30T18:09:28.903Z" }, + { url = "https://files.pythonhosted.org/packages/18/59/30490e483e804ccaa8147dd78c52e44ff96e1c30b5a95d69a63163cdb15b/ruff-0.9.4-py3-none-musllinux_1_2_i686.whl", hash = "sha256:433dedf6ddfdec7f1ac7575ec1eb9844fa60c4c8c2f8887a070672b8d353d34c", size = 12067782, upload-time = "2025-01-30T18:09:32.371Z" }, + { url = "https://files.pythonhosted.org/packages/3d/8c/893fa9551760b2f8eb2a351b603e96f15af167ceaf27e27ad873570bc04c/ruff-0.9.4-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:d612dbd0f3a919a8cc1d12037168bfa536862066808960e0cc901404b77968f0", size = 12483087, upload-time = "2025-01-30T18:09:36.124Z" }, + { url = "https://files.pythonhosted.org/packages/23/15/f6751c07c21ca10e3f4a51ea495ca975ad936d780c347d9808bcedbd7182/ruff-0.9.4-py3-none-win32.whl", hash = "sha256:db1192ddda2200671f9ef61d9597fcef89d934f5d1705e571a93a67fb13a4402", size = 9852302, upload-time = "2025-01-30T18:09:40.013Z" }, + { url = "https://files.pythonhosted.org/packages/12/41/2d2d2c6a72e62566f730e49254f602dfed23019c33b5b21ea8f8917315a1/ruff-0.9.4-py3-none-win_amd64.whl", hash = "sha256:05bebf4cdbe3ef75430d26c375773978950bbf4ee3c95ccb5448940dc092408e", size = 10850051, upload-time = "2025-01-30T18:09:43.42Z" }, + { url = "https://files.pythonhosted.org/packages/c6/e6/3d6ec3bc3d254e7f005c543a661a41c3e788976d0e52a1ada195bd664344/ruff-0.9.4-py3-none-win_arm64.whl", hash = "sha256:585792f1e81509e38ac5123492f8875fbc36f3ede8185af0a26df348e5154f41", size = 10078251, upload-time = "2025-01-30T18:09:48.01Z" }, +] + +[[package]] +name = "runloop-api-client" +version = "0.60.1" +source = { editable = "." } +dependencies = [ + { name = "anyio", version = "4.5.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "anyio", version = "4.8.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "distro" }, + { name = "httpx" }, + { name = "pydantic", version = "1.10.23", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'group-18-runloop-api-client-pydantic-v1'" }, + { name = "pydantic", version = "2.10.6", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pydantic", version = "2.11.9", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "sniffio" }, + { name = "typing-extensions" }, +] + +[package.optional-dependencies] +aiohttp = [ + { name = "aiohttp", version = "3.10.11", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "aiohttp", version = "3.12.13", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "httpx-aiohttp" }, +] + +[package.dev-dependencies] +dev = [ + { name = "dirty-equals" }, + { name = "importlib-metadata", version = "8.5.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "importlib-metadata", version = "8.6.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "mypy" }, + { name = "pyright" }, + { name = "pytest", version = "8.3.5", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pytest", version = "8.4.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pytest-asyncio" }, + { name = "pytest-xdist", version = "3.6.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pytest-xdist", version = "3.7.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "respx" }, + { name = "rich" }, + { name = "ruff" }, + { name = "time-machine", version = "2.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "time-machine", version = "2.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +pydantic-v1 = [ + { name = "pydantic", version = "1.10.23", source = { registry = "https://pypi.org/simple" } }, +] +pydantic-v2 = [ + { name = "pydantic", version = "2.10.6", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.9' and extra == 'group-18-runloop-api-client-pydantic-v2') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pydantic", version = "2.11.9", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.9' and extra == 'group-18-runloop-api-client-pydantic-v2') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] + +[package.metadata] +requires-dist = [ + { name = "aiohttp", marker = "extra == 'aiohttp'" }, + { name = "anyio", specifier = ">=3.5.0,<5" }, + { name = "distro", specifier = ">=1.7.0,<2" }, + { name = "httpx", specifier = ">=0.23.0,<1" }, + { name = "httpx-aiohttp", marker = "extra == 'aiohttp'", specifier = ">=0.1.8" }, + { name = "pydantic", specifier = ">=1.9.0,<3" }, + { name = "sniffio" }, + { name = "typing-extensions", specifier = ">=4.10,<5" }, +] +provides-extras = ["aiohttp"] + +[package.metadata.requires-dev] +dev = [ + { name = "dirty-equals", specifier = ">=0.6.0" }, + { name = "importlib-metadata", specifier = ">=6.7.0" }, + { name = "mypy" }, + { name = "pyright", specifier = "==1.1.399" }, + { name = "pytest" }, + { name = "pytest-asyncio" }, + { name = "pytest-xdist", specifier = ">=3.6.1" }, + { name = "respx" }, + { name = "rich", specifier = ">=13.7.1" }, + { name = "ruff" }, + { name = "time-machine" }, +] +pydantic-v1 = [{ name = "pydantic", specifier = ">=1.9.0,<2" }] +pydantic-v2 = [{ name = "pydantic", specifier = ">=2,<3" }] + +[[package]] +name = "six" +version = "1.17.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/94/e7/b2c673351809dca68a0e064b6af791aa332cf192da575fd474ed7d6f16a2/six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81", size = 34031, upload-time = "2024-12-04T17:35:28.174Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", size = 11050, upload-time = "2024-12-04T17:35:26.475Z" }, +] + +[[package]] +name = "sniffio" +version = "1.3.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a2/87/a6771e1546d97e7e041b6ae58d80074f81b7d5121207425c964ddf5cfdbd/sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc", size = 20372, upload-time = "2024-02-25T23:20:04.057Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2", size = 10235, upload-time = "2024-02-25T23:20:01.196Z" }, +] + +[[package]] +name = "time-machine" +version = "2.15.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.9'", +] +dependencies = [ + { name = "python-dateutil", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b2/e8/82d358c4d53555f031c2343d1c235b56b9f3b0a60ac3adc555778fe87506/time_machine-2.15.0.tar.gz", hash = "sha256:ebd2e63baa117ded04b978813fcd1279d3fc6be2149c9cac75c716b6f1db774c", size = 25067, upload-time = "2024-08-06T11:12:18.578Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/67/47/35413db37da55865fdbf60649bcb948cc2559f420ef4e91e77e4e24c71b8/time_machine-2.15.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:892d016789b59950989b2db188dcd46cf16d34e8daf2343e33b679b0c5fd1001", size = 20779, upload-time = "2024-08-06T13:42:39.043Z" }, + { url = "https://files.pythonhosted.org/packages/e0/c3/fda6d2336737d0331eb55357db1dc916af14c4fda77c69ad8b3733b003c4/time_machine-2.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:4428bdae507996aa3fdeb4727bca09e26306fa64a502e7335207252684516cbf", size = 17040, upload-time = "2024-08-06T13:42:40.273Z" }, + { url = "https://files.pythonhosted.org/packages/36/e1/71200f24d668e5183e875a08ba5e557b6107c1b7d57fa6d54ac24ad10234/time_machine-2.15.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0302568338c8bd333ed0698231dbb781b70ead1a5579b4ac734b9bf88313229f", size = 34811, upload-time = "2024-08-06T13:42:43.632Z" }, + { url = "https://files.pythonhosted.org/packages/9e/2f/4b9289ea07978ad5c3469c872c7eeadf5f5b3a1dcebe2fb274c2486fc220/time_machine-2.15.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:18fc4740073e67071472c48355775ec6d1b93af5c675524b7de2474e0dcd8741", size = 32820, upload-time = "2024-08-06T13:42:41.347Z" }, + { url = "https://files.pythonhosted.org/packages/5f/9e/9f838c91d2248d716281af60dfea4131438c6ad6d7405ebc6e47f8c25c3b/time_machine-2.15.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:768d33b484a35da93731cc99bdc926b539240a78673216cdc6306833d9072350", size = 34635, upload-time = "2024-08-06T13:42:42.427Z" }, + { url = "https://files.pythonhosted.org/packages/f3/10/1048b5ba6de55779563f005de5fbfb764727bf9678ad7701cea480b3816c/time_machine-2.15.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:73a8c8160d2a170dadcad5b82fb5ee53236a19cec0996651cf4d21da0a2574d5", size = 34326, upload-time = "2024-08-06T13:42:45.683Z" }, + { url = "https://files.pythonhosted.org/packages/13/82/6b4df8e5abf754b0ccceeb59fa32486d28c65f67d4ada37ff8b1e9f52006/time_machine-2.15.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:09fd839a321a92aa8183206c383b9725eaf4e0a28a70e4cb87db292b352eeefb", size = 32639, upload-time = "2024-08-06T13:42:46.902Z" }, + { url = "https://files.pythonhosted.org/packages/cf/07/95e380c46136252401d97f613782a10061b3c11b61edaeb78e83aedc1a88/time_machine-2.15.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:838a6d117739f1ae6ecc45ec630fa694f41a85c0d07b1f3b1db2a6cc52c1808b", size = 34021, upload-time = "2024-08-06T13:42:48.294Z" }, + { url = "https://files.pythonhosted.org/packages/b6/0c/6595fa82bd70bc7e8065bfc6534e51a27c18978f7c158d6392c979cace2c/time_machine-2.15.0-cp310-cp310-win32.whl", hash = "sha256:d24d2ec74923b49bce7618e3e7762baa6be74e624d9829d5632321de102bf386", size = 19413, upload-time = "2024-08-06T13:42:49.579Z" }, + { url = "https://files.pythonhosted.org/packages/2f/3d/cb3c1cecfeb4b6423302ee1b2863617390500f67526f0fc1fb5641db05f6/time_machine-2.15.0-cp310-cp310-win_amd64.whl", hash = "sha256:95c8e7036cf442480d0bf6f5fde371e1eb6dbbf5391d7bdb8db73bd8a732b538", size = 20280, upload-time = "2024-08-06T13:42:52.548Z" }, + { url = "https://files.pythonhosted.org/packages/22/aa/96aaac88738369fba43d5cb076bb09290b1a2cbd84210bcc0a9a519c7970/time_machine-2.15.0-cp310-cp310-win_arm64.whl", hash = "sha256:660810cd27a8a94cb5e845e8f28a95e70b01ff0c45466d394c4a0cba5a0ae279", size = 18392, upload-time = "2024-08-06T13:42:53.945Z" }, + { url = "https://files.pythonhosted.org/packages/ce/54/829ab196c3306eb4cee95e3c8e7d004e15877b36479de5d2ecc72fc1d3d4/time_machine-2.15.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:674097dd54a0bbd555e7927092c74428c4c07268ad52bca38cfccc3214707e50", size = 20448, upload-time = "2024-08-06T13:42:58.809Z" }, + { url = "https://files.pythonhosted.org/packages/e1/48/a06f8c7db768db501a60210a48f3d37b7b3d65ca85aa8dc08147eb204b4a/time_machine-2.15.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4e83fd6112808d1d14d1a57397c6fa3bd71bb2f3b8800036e12366e3680819b9", size = 16897, upload-time = "2024-08-06T13:43:00.751Z" }, + { url = "https://files.pythonhosted.org/packages/e7/f8/73265927e3da54a417536dc3d8c9aad806b62b8133099a7ee12661aba1a3/time_machine-2.15.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b095a1de40ca1afaeae8df3f45e26b645094a1912e6e6871e725fcf06ecdb74a", size = 32789, upload-time = "2024-08-06T13:43:06.312Z" }, + { url = "https://files.pythonhosted.org/packages/8a/a4/bcf8ad40a4c6973a67aba5df7ed704dc34256835fb074cfb4d4caa0f93a5/time_machine-2.15.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4601fe7a6b74c6fd9207e614d9db2a20dd4befd4d314677a0feac13a67189707", size = 30911, upload-time = "2024-08-06T13:43:02.579Z" }, + { url = "https://files.pythonhosted.org/packages/13/87/a6de1b187f5468781e0e722c877323625227151cc8ffff363a7391b01149/time_machine-2.15.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:245ef73f9927b7d4909d554a6a0284dbc5dee9730adea599e430b37c9e9fa203", size = 32644, upload-time = "2024-08-06T13:43:04.457Z" }, + { url = "https://files.pythonhosted.org/packages/33/1f/7378d5a032467891a1005e546532223b97c53440c6359b1133696a5cb1ef/time_machine-2.15.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:704abc7f3403584cca9c01c5809812e0bd70632ea4251389fae4f45e11aad94f", size = 32472, upload-time = "2024-08-06T13:43:07.699Z" }, + { url = "https://files.pythonhosted.org/packages/68/14/2fab61ad2c9a831925bce3d5e341fa2108ba062c2de0c190569e1ee6a1c9/time_machine-2.15.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:6425001e50a0c82108caed438233066cea04d42a8fc9c49bfcf081a5b96e5b4e", size = 30882, upload-time = "2024-08-06T13:43:08.83Z" }, + { url = "https://files.pythonhosted.org/packages/8a/01/f5146b9956b548072000a87f3eb8dbb2591ada1516a5d889aa12b373948f/time_machine-2.15.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:5d4073b754f90b19f28d036ec5143d3fca3a75e4d4241d78790a6178b00bb373", size = 32176, upload-time = "2024-08-06T13:43:10.689Z" }, + { url = "https://files.pythonhosted.org/packages/ca/09/8a8488e6d3faf3cb68d078f27ca94aa3ba1bc08d5f804265c590208a70f5/time_machine-2.15.0-cp311-cp311-win32.whl", hash = "sha256:8817b0f7d7830215261b18db83c9c3ef1da6bb64da5c292d7c70b9a46e5a6745", size = 19305, upload-time = "2024-08-06T13:43:12.568Z" }, + { url = "https://files.pythonhosted.org/packages/75/33/d8411b197a08eedb3ce086022cdf4faf1f15738607a2d943fd5286f57fdd/time_machine-2.15.0-cp311-cp311-win_amd64.whl", hash = "sha256:ddad27a62df2ea47b7b483009fbfcf167a71d702cbd8e2eefd9ddc1c93146658", size = 20210, upload-time = "2024-08-06T13:43:13.731Z" }, + { url = "https://files.pythonhosted.org/packages/8c/f5/e9b5d7be612403e570a42af5c2823506877e726f77f2d6ff272d72d0aed3/time_machine-2.15.0-cp311-cp311-win_arm64.whl", hash = "sha256:6f021aa2dbd8fbfe54d3fa2258518129108b7496922b3bcff2cf5991078eec67", size = 18278, upload-time = "2024-08-06T13:43:17.612Z" }, + { url = "https://files.pythonhosted.org/packages/49/47/46bf332f4ecd7f35e197131b9c23daa39423cf71b814e36e9d5df3cf2380/time_machine-2.15.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:a22f47c34ee1fcf7d93a8c5c93135499aac879d9d5d8f820bd28571a30fdabcd", size = 20436, upload-time = "2024-08-06T15:42:15.185Z" }, + { url = "https://files.pythonhosted.org/packages/f1/36/9990f16868ffdefe6b5aecfdfbcb11718230e414ca61a887fbee884f70e5/time_machine-2.15.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:b684f8ecdeacd6baabc17b15ac1b054ca62029193e6c5367ef00b3516671de80", size = 16926, upload-time = "2024-08-06T15:42:17.284Z" }, + { url = "https://files.pythonhosted.org/packages/ca/2d/007955a0899cd079a400bc204c03edc76274de2471d94ca235ff587a6eba/time_machine-2.15.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5f7add997684bc6141e1c80f6ba0c38ffe316ba277a4074e61b1b7b4f5a172bf", size = 17157, upload-time = "2024-08-06T11:12:16.25Z" }, + { url = "https://files.pythonhosted.org/packages/7a/e2/66d26450f9bfd1b019abdefbf0c62e760efc8992c7bf88d6c18f7ea6b94a/time_machine-2.15.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:31af56399bf7c9ef76a3f7b6d9471dffa8f06ee373c194a374b69523f9061de9", size = 34005, upload-time = "2024-08-06T15:42:22.266Z" }, + { url = "https://files.pythonhosted.org/packages/46/2c/dc2c42200aee6b47a55274d984736f7507ecfbfd0345114ec511ec444bef/time_machine-2.15.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f5b94cba3edfc54bcb3ab5be616a2f50fa48be438e5af970824efdf882d1bc31", size = 31926, upload-time = "2024-08-06T15:42:19.044Z" }, + { url = "https://files.pythonhosted.org/packages/87/59/10d8faecbd233b0da831eb9973c3e650c83fb3d443edb607b6b26c9688ac/time_machine-2.15.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3862dda89bdb05f9d521b08fdcb24b19a7dd9f559ae324f4301ba7a07b6eea64", size = 33685, upload-time = "2024-08-06T15:42:20.565Z" }, + { url = "https://files.pythonhosted.org/packages/2e/a4/702ad9e328cbc7b3f1833dee4886d0994e52bc2d9640effa64bccc7740fa/time_machine-2.15.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e1790481a6b9ce38888f22ce30710244067898c3ac4805a0e061e381f3db3506", size = 33609, upload-time = "2024-08-06T15:42:23.817Z" }, + { url = "https://files.pythonhosted.org/packages/a0/9d/6009d28ad395a45b5bb91af31616494b4e61d6d9df252d0e5933cd3aa8f1/time_machine-2.15.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:a731c03bc00552ee6cc685a59616d36003124e7e04c6ddf65c2c47f1c3d85480", size = 31737, upload-time = "2024-08-06T15:42:25.175Z" }, + { url = "https://files.pythonhosted.org/packages/36/22/b55df08cf48d46af93ee2f4310dd88c8519bc5f98afd24af57a81a5d5272/time_machine-2.15.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e6776840aea3ff5ab6924b50117957da62db51b109b3b491c0d5817a804b1a8e", size = 33253, upload-time = "2024-08-06T15:42:26.511Z" }, + { url = "https://files.pythonhosted.org/packages/52/d7/bb5e92f0b0268cd13baad874d82b0e964a847cf52740464abeec48dc1642/time_machine-2.15.0-cp312-cp312-win32.whl", hash = "sha256:9479530e3fce65f6149058071fa4df8150025f15b43b103445f619842981a87c", size = 19369, upload-time = "2024-08-06T15:42:27.682Z" }, + { url = "https://files.pythonhosted.org/packages/f4/33/276537ba292fc7ee67e6aef7566b2a6b313dbc4d479e5e80eed43094ef48/time_machine-2.15.0-cp312-cp312-win_amd64.whl", hash = "sha256:b5f3ab4185c1f72010846ca9fccb08349e23a2b52982a18d9870e848ce9f1c86", size = 20219, upload-time = "2024-08-06T15:42:29.475Z" }, + { url = "https://files.pythonhosted.org/packages/e0/0e/e8b75032248f59a2bc5c125d3a41242b1e577caa07585c42b22373d6466d/time_machine-2.15.0-cp312-cp312-win_arm64.whl", hash = "sha256:c0473dfa8f17c6a9a250b2bd6a5b62af3aa7d22518f701649115f1085d5e35ab", size = 18297, upload-time = "2024-08-06T15:42:31.116Z" }, + { url = "https://files.pythonhosted.org/packages/7c/a1/ebe212530628aa29a86a771ca77cb2d1ead667382cfa89a3fb849e3f0108/time_machine-2.15.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:f50f10058b884d45cd8a50423bf561b1f9f9df7058abeb8b318700c8bcf4bb54", size = 20492, upload-time = "2024-08-06T13:43:20.546Z" }, + { url = "https://files.pythonhosted.org/packages/29/0d/2a19951729e50d8809e161e533585c0be5ae39c0cf40140877353847b9b5/time_machine-2.15.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:df6f618b98f0848fd8d07039541e10f23db679d8283f8719e870a98e1ef8e639", size = 16961, upload-time = "2024-08-06T13:43:23.227Z" }, + { url = "https://files.pythonhosted.org/packages/85/eb/33cf2173758b128f55c880c492e17b70f6c325e7bee879f9b0171cfe02a0/time_machine-2.15.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:52468a0784544eba708c0ae6bc5e8c5dcfd685495a60f7f74028662c984bd9cd", size = 34051, upload-time = "2024-08-06T13:43:26.529Z" }, + { url = "https://files.pythonhosted.org/packages/e1/23/da9a7935a7be952ab6163caf976b6bad049f6e117f3a396ecc381b077cb6/time_machine-2.15.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c08800c28160f4d32ca510128b4e201a43c813e7a2dd53178fa79ebe050eba13", size = 31966, upload-time = "2024-08-06T13:43:24.344Z" }, + { url = "https://files.pythonhosted.org/packages/0b/0d/a8e3cbd91ffa98b0fa50b6e29d03151f37aa04cca4dd658e33cdf2b4731e/time_machine-2.15.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65d395211736d9844537a530287a7c64b9fda1d353e899a0e1723986a0859154", size = 33727, upload-time = "2024-08-06T13:43:25.407Z" }, + { url = "https://files.pythonhosted.org/packages/07/53/c084031980706517cfbae9f462e455d61c7cbf9b66a8a83bcc5b79d00836/time_machine-2.15.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:3b177d334a35bf2ce103bfe4e0e416e4ee824dd33386ea73fa7491c17cc61897", size = 33690, upload-time = "2024-08-06T13:43:28.145Z" }, + { url = "https://files.pythonhosted.org/packages/a0/30/5c87e8709ba00c893faf8a9bddf06abf317fdc6103fe78bdf99c53ab444f/time_machine-2.15.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:9a6a9342fae113b12aab42c790880c549d9ba695b8deff27ee08096eedd67569", size = 31809, upload-time = "2024-08-06T13:43:29.645Z" }, + { url = "https://files.pythonhosted.org/packages/04/7b/92ac7c556cd123bf8b23dbae3cf4a273c276110b87d0c4b5600c2cec8e70/time_machine-2.15.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:bcbb25029ee8756f10c6473cea5ef21707a1d9a8752cdf29fad3a5f34aa4a313", size = 33325, upload-time = "2024-08-06T13:43:30.832Z" }, + { url = "https://files.pythonhosted.org/packages/e9/71/36c74bab3d4e4385d31610b367da1535a36d17358df058e0920a7510e17c/time_machine-2.15.0-cp313-cp313-win32.whl", hash = "sha256:29b988b1f09f2a083b12b6b054787b799ae91ee15bb0e9de3e48f880e4d68674", size = 19397, upload-time = "2024-08-06T13:43:31.996Z" }, + { url = "https://files.pythonhosted.org/packages/a4/69/ea5976c43a673894f2fa85a05b28a610b474472f393e59722a6946f7070b/time_machine-2.15.0-cp313-cp313-win_amd64.whl", hash = "sha256:d828721dcbcb94b904a6b25df67c2513ecd24cd9e36694f38b9f0fa71c7c6103", size = 20242, upload-time = "2024-08-06T13:43:33.11Z" }, + { url = "https://files.pythonhosted.org/packages/cc/c8/26367d0b8dfaf7445576fe0051bff61b8f5be752e7bf3e8807ed7fa3a343/time_machine-2.15.0-cp313-cp313-win_arm64.whl", hash = "sha256:008bd668d933b1a029c81805bcdc0132390c2545b103cf8e6709e3adbc37989d", size = 18337, upload-time = "2024-08-06T13:43:34.227Z" }, + { url = "https://files.pythonhosted.org/packages/97/54/eeac8568cad4f3eb255cc78f1fa2c36147afd3fcba770283bf2b2a188b33/time_machine-2.15.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e99689f6c6b9ca6e2fc7a75d140e38c5a7985dab61fe1f4e506268f7e9844e05", size = 20674, upload-time = "2024-08-06T13:42:05.072Z" }, + { url = "https://files.pythonhosted.org/packages/5c/82/488341de4c03c0856aaf5db74f2a8fe18dcc7657401334c54c4aa6cb0fc6/time_machine-2.15.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:671e88a6209a1cf415dc0f8c67d2b2d3b55b436cc63801a518f9800ebd752959", size = 16990, upload-time = "2024-08-06T13:42:07.508Z" }, + { url = "https://files.pythonhosted.org/packages/9c/cc/0ca559e71be4eb05917d02364f4d356351b31dd0d6ff3c4c86fa4de0a03e/time_machine-2.15.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0b2d28daf4cabc698aafb12135525d87dc1f2f893cbd29a8a6fe0d8d36d1342c", size = 35501, upload-time = "2024-08-06T13:42:12.348Z" }, + { url = "https://files.pythonhosted.org/packages/92/a0/14905a5feecc6d2e87ebe6dd2b044358422836ed173071cdc1245aa5ec88/time_machine-2.15.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4cd9f057457d12604be18b623bcd5ae7d0b917ad66cb510ee1135d5f123666e2", size = 33430, upload-time = "2024-08-06T13:42:09.625Z" }, + { url = "https://files.pythonhosted.org/packages/19/a4/282b65b4d835dfd7b863777cc4206bec375285bda884dc22bd1264716f6a/time_machine-2.15.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:97dc6793e512a62ba9eab250134a2e67372c16ae9948e73d27c2ef355356e2e1", size = 35366, upload-time = "2024-08-06T13:42:10.957Z" }, + { url = "https://files.pythonhosted.org/packages/93/8e/f7db3f641f1ff86b98594c9cf8d71c8d292cc2bde06c1369ce4745494cc5/time_machine-2.15.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:0630a32e9ebcf2fac3704365b31e271fef6eabd6fedfa404cd8dbd244f7fc84d", size = 34373, upload-time = "2024-08-06T13:42:13.419Z" }, + { url = "https://files.pythonhosted.org/packages/3d/9f/8c8ac57ccb29e692e0940e58515a9afb844d2d11b7f057a0fe153bfe4877/time_machine-2.15.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:617c9a92d8d8f60d5ef39e76596620503752a09f834a218e5b83be352fdd6c91", size = 32667, upload-time = "2024-08-06T13:42:15.293Z" }, + { url = "https://files.pythonhosted.org/packages/ec/e7/f0c6f9507b0bbfdec54d256b6efc9417ae1a01ce6320c2a42235b807cf86/time_machine-2.15.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:3f7eadd820e792de33a9ec91f8178a2b9088e4e8b9a166953419ddc4ec5f7cfe", size = 34070, upload-time = "2024-08-06T13:42:17.147Z" }, + { url = "https://files.pythonhosted.org/packages/20/82/ac2d8343db8dade1372457d7a5694f069882d9eac110ddce2643ef0501aa/time_machine-2.15.0-cp38-cp38-win32.whl", hash = "sha256:b7b647684eb2e1fd1e5e6b101249d5fe9d6117c117b5e336ad8dd75af48d2d1f", size = 19396, upload-time = "2024-08-06T13:42:18.256Z" }, + { url = "https://files.pythonhosted.org/packages/3a/12/ac7bb1e932536fce359e021a62c2a5a30c4e470293d6f8b2fb47077562dc/time_machine-2.15.0-cp38-cp38-win_amd64.whl", hash = "sha256:b48abd7745caec1a78a16a048966cde14ff6ccb04d471a7201532648d3f77d14", size = 20266, upload-time = "2024-08-06T13:42:20.304Z" }, + { url = "https://files.pythonhosted.org/packages/ec/bf/d9689e1fa669e575c3ed57bf4f9205a9b5fbe703dc7ef89ba5ce9aa39a38/time_machine-2.15.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:8c2b1c91b437133c672e374857eccb1dd2c2d9f8477ae3b35138382d5ef19846", size = 20775, upload-time = "2024-08-06T13:42:22.424Z" }, + { url = "https://files.pythonhosted.org/packages/d8/4b/4314a7882b470c52cd527601107b1163e19d37fb1eb31eea0f8d73d0b178/time_machine-2.15.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:79bf1ef6850182e09d86e61fa31717da56014a3b2234afb025fca1f2a43ac07b", size = 17037, upload-time = "2024-08-06T13:42:23.539Z" }, + { url = "https://files.pythonhosted.org/packages/f1/b8/adf2f8b8e10f6f5e498b0cddd103f6520144af53fb27b5a01eca50812a92/time_machine-2.15.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:658ea8477fa020f08435fb7277635eb0b50cd5206b9d4cbe10e9a5466b01f855", size = 34511, upload-time = "2024-08-06T13:42:28.63Z" }, + { url = "https://files.pythonhosted.org/packages/e3/86/fda41a9e8115fd377f2d4d15c91a414f75cb8f2cd7f8bde974855a0f381f/time_machine-2.15.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c947135750d20f35acac290c34f1acf5771fc166a3fbc0e3816a97c756aaa5f5", size = 32533, upload-time = "2024-08-06T13:42:25.709Z" }, + { url = "https://files.pythonhosted.org/packages/cb/7e/1e2e69fee659f00715f12392cabea1920245504862eab2caac6e3f30de5b/time_machine-2.15.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1dee3a0dd1866988c49a5d00564404db9bcdf49ca92f9c4e8b6c99609d64e698", size = 34348, upload-time = "2024-08-06T13:42:27.478Z" }, + { url = "https://files.pythonhosted.org/packages/41/da/8db2df73ebe9f23af25b05f1720b108a145805a8c83d5ff8248e2d3cbcfa/time_machine-2.15.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:c596920d6017702a36e3a43fd8110a84e87d6229f30b84bd5640cbae9b5145da", size = 34081, upload-time = "2024-08-06T13:42:29.742Z" }, + { url = "https://files.pythonhosted.org/packages/a7/c7/9202404f8885257c09c98d3e5186b989b6b482a2983dc24c81bd0333e668/time_machine-2.15.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:014589d0edd4aa14f8d63985745565e8cbbe48461d6c004a96000b47f6b44e78", size = 32357, upload-time = "2024-08-06T13:42:30.884Z" }, + { url = "https://files.pythonhosted.org/packages/4d/79/482a69c31259c3c2efcd9e73ea4a0a4d315103836c1667875612288bca28/time_machine-2.15.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:5ff655716cd13a242eef8cf5d368074e8b396ff86508a5933e7cff4f2b3eb3c2", size = 33742, upload-time = "2024-08-06T13:42:33.213Z" }, + { url = "https://files.pythonhosted.org/packages/f0/39/89725d12a3552bb9113528d8f9aa7188e1660b377b74e7d72e8ab5eeff06/time_machine-2.15.0-cp39-cp39-win32.whl", hash = "sha256:1168eebd7af7e6e3e2fd378c16ca917b97dd81c89a1f1f9e1daa985c81699d90", size = 19410, upload-time = "2024-08-06T13:42:34.333Z" }, + { url = "https://files.pythonhosted.org/packages/89/0c/50e86c4a7b72d2bdc658492b13e804f933814f86f34c4350758d1ab87586/time_machine-2.15.0-cp39-cp39-win_amd64.whl", hash = "sha256:c344eb09fcfbf71e5b5847d4f188fec98e1c3a976125ef571eac5f1c39e7a5e5", size = 20281, upload-time = "2024-08-06T13:42:36.174Z" }, + { url = "https://files.pythonhosted.org/packages/f6/4d/f8ad3b0c50a268a9ea766c9533866bba6a7717a5324c84e356abb7347fa4/time_machine-2.15.0-cp39-cp39-win_arm64.whl", hash = "sha256:899f1a856b3bebb82b6cbc3c0014834b583b83f246b28e462a031ec1b766130b", size = 18387, upload-time = "2024-08-06T13:42:37.271Z" }, +] + +[[package]] +name = "time-machine" +version = "2.16.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.9'", +] +dependencies = [ + { name = "python-dateutil", marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/fb/dd/5022939b9cadefe3af04f4012186c29b8afbe858b1ec2cfa38baeec94dab/time_machine-2.16.0.tar.gz", hash = "sha256:4a99acc273d2f98add23a89b94d4dd9e14969c01214c8514bfa78e4e9364c7e2", size = 24626, upload-time = "2024-10-08T14:21:59.734Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/79/47/32fdb8e70122edbc8be9db1f032d22b38e3d9ef0bf52c64470d0815cdb62/time_machine-2.16.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:09531af59fdfb39bfd24d28bd1e837eff5a5d98318509a31b6cfd57d27801e52", size = 20493, upload-time = "2024-10-08T14:20:51.241Z" }, + { url = "https://files.pythonhosted.org/packages/b1/e6/f3bc391d5642e69299f2d1f0a46e7f98d1669e82b1e16c8cf3c6e4615059/time_machine-2.16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:92d0b0f3c49f34dd76eb462f0afdc61ed1cb318c06c46d03e99b44ebb489bdad", size = 16757, upload-time = "2024-10-08T14:20:52.614Z" }, + { url = "https://files.pythonhosted.org/packages/d4/7f/3a78d50fec64edd9964bf42b66a2e659a9846669ac8f705acc363ee79d3a/time_machine-2.16.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7c29616e18e2349a8766d5b6817920fc74e39c00fa375d202231e9d525a1b882", size = 34527, upload-time = "2024-10-08T14:20:53.714Z" }, + { url = "https://files.pythonhosted.org/packages/61/00/7cf1324d8f8db8f5dab71c44ed1e9c11c4f1cecca9d4363abf44154aa13b/time_machine-2.16.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c1ceb6035a64cb00650e3ab203cf3faffac18576a3f3125c24df468b784077c7", size = 32537, upload-time = "2024-10-08T14:20:54.834Z" }, + { url = "https://files.pythonhosted.org/packages/8e/c2/edf5ccb2fa529251eb7f1cfb34098c0ef236dbb88f0a6564d06f6f8378f5/time_machine-2.16.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:64c205ea37b8c4ba232645335fc3b75bc2d03ce30f0a34649e36cae85652ee96", size = 34353, upload-time = "2024-10-08T14:20:56.414Z" }, + { url = "https://files.pythonhosted.org/packages/a9/1e/178b9e3d0054300a4dd0485747c89359e5f719f090ae5165c88618793700/time_machine-2.16.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:dfe92412bd11104c4f0fb2da68653e6c45b41f7217319a83a8b66ed4f20148b3", size = 34045, upload-time = "2024-10-08T14:20:58.117Z" }, + { url = "https://files.pythonhosted.org/packages/e5/4d/068ad9660f00f88a54f3ff7e9d423ed5c08a5f8147518f6c66fd0393dde7/time_machine-2.16.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:d5fe7a6284e3dce87ae13a25029c53542dd27a28d151f3ef362ec4dd9c3e45fd", size = 32356, upload-time = "2024-10-08T14:20:59.8Z" }, + { url = "https://files.pythonhosted.org/packages/a5/25/c0f26294808946ec5b665f17a0072049a3f9e2468abc18aa8fe22580b4cf/time_machine-2.16.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:c0fca3025266d88d1b48be162a43b7c2d91c81cc5b3bee9f01194678ffb9969a", size = 33737, upload-time = "2024-10-08T14:21:00.868Z" }, + { url = "https://files.pythonhosted.org/packages/8b/d4/ae909a269828eaa7672e1201403976e794ea679ae7ba04fe0c0c0c65c2b6/time_machine-2.16.0-cp310-cp310-win32.whl", hash = "sha256:4149e17018af07a5756a1df84aea71e6e178598c358c860c6bfec42170fa7970", size = 19133, upload-time = "2024-10-08T14:21:01.975Z" }, + { url = "https://files.pythonhosted.org/packages/7e/e7/5946d62d49e79b97c6772fe2918eccbd069d74effa8d50bdca4056502aeb/time_machine-2.16.0-cp310-cp310-win_amd64.whl", hash = "sha256:01bc257e9418980a4922de94775be42a966e1a082fb01a1635917f9afc7b84ca", size = 19995, upload-time = "2024-10-08T14:21:03.001Z" }, + { url = "https://files.pythonhosted.org/packages/54/cb/6507c6594f086bc955ff200cc4fd415d2ab229371ca3ba8fc3d27429a9cc/time_machine-2.16.0-cp310-cp310-win_arm64.whl", hash = "sha256:6895e3e84119594ab12847c928f619d40ae9cedd0755515dc154a5b5dc6edd9f", size = 18109, upload-time = "2024-10-08T14:21:04.712Z" }, + { url = "https://files.pythonhosted.org/packages/38/7b/34aad93f75f86503dd1fa53bc120d8129fe4de83aef58ffa78c62b044ef9/time_machine-2.16.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:8f936566ef9f09136a3d5db305961ef6d897b76b240c9ff4199144aed6dd4fe5", size = 20169, upload-time = "2024-10-08T14:21:06.288Z" }, + { url = "https://files.pythonhosted.org/packages/68/cb/7d020d5c05d0460a4a96232b0777882ef989c1e6144d11ba984c4b0b4d1a/time_machine-2.16.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5886e23ede3478ca2a3e0a641f5d09dd784dfa9e48c96e8e5e31fc4fe77b6dc0", size = 16614, upload-time = "2024-10-08T14:21:07.253Z" }, + { url = "https://files.pythonhosted.org/packages/0d/24/ce1ff76c9a4f3be88c2b947f2411a5a8019390734597d3106a151f8a9416/time_machine-2.16.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c76caf539fa4941e1817b7c482c87c65c52a1903fea761e84525955c6106fafb", size = 32507, upload-time = "2024-10-08T14:21:08.289Z" }, + { url = "https://files.pythonhosted.org/packages/08/d7/ba1135587bd2ed105e59ed7e05969c913277d110fecc0ed871006ea3f763/time_machine-2.16.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:298aa423e07c8b21b991782f01d7749c871c792319c2af3e9755f9ab49033212", size = 30627, upload-time = "2024-10-08T14:21:09.246Z" }, + { url = "https://files.pythonhosted.org/packages/da/c6/f490aaddc80c54238f4b8fe97870bbfe0d2c70fe4a57269badc94f5f38a6/time_machine-2.16.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e3391ae9c484736850bb44ef125cbad52fe2d1b69e42c95dc88c43af8ead2cc7", size = 32362, upload-time = "2024-10-08T14:21:10.178Z" }, + { url = "https://files.pythonhosted.org/packages/b1/f7/2522ae1c1995a39d6d8b7ee7efed47ec8bd7ff3240fdb2662a8b7e11b84a/time_machine-2.16.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:503e7ff507c2089699d91885fc5b9c8ff16774a7b6aff48b4dcee0c0a0685b61", size = 32188, upload-time = "2024-10-08T14:21:11.743Z" }, + { url = "https://files.pythonhosted.org/packages/e9/53/b1ccb55f39e7e62660f852d7aedef438d2872ea9c73f64be46d0d3b3f3d7/time_machine-2.16.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:eee7b0fc4fbab2c6585ea17606c6548be83919c70deea0865409fe9fc2d8cdce", size = 30600, upload-time = "2024-10-08T14:21:12.728Z" }, + { url = "https://files.pythonhosted.org/packages/19/1f/37a5a9333a2da35b0fc43e8ac693b82dd5492892131bc3cc0c8f5835af94/time_machine-2.16.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9db5e5b3ccdadaafa5730c2f9db44c38b013234c9ad01f87738907e19bdba268", size = 31896, upload-time = "2024-10-08T14:21:14.451Z" }, + { url = "https://files.pythonhosted.org/packages/fc/97/e1a8bd64e5432adf47859cb63847b4472efc644b508602141c60ccf52112/time_machine-2.16.0-cp311-cp311-win32.whl", hash = "sha256:2552f0767bc10c9d668f108fef9b487809cdeb772439ce932e74136365c69baf", size = 19030, upload-time = "2024-10-08T14:21:15.662Z" }, + { url = "https://files.pythonhosted.org/packages/34/c9/f4764e447aa9da4031c89da60fa69f4f73fd45571415788c298cbd4620e9/time_machine-2.16.0-cp311-cp311-win_amd64.whl", hash = "sha256:12474fcdbc475aa6fe5275fe7224e685c5b9777f5939647f35980e9614ae7558", size = 19924, upload-time = "2024-10-08T14:21:17.324Z" }, + { url = "https://files.pythonhosted.org/packages/8a/c0/788500d33656a044e3289b814106c2277209ac73316c00b9668012ce6027/time_machine-2.16.0-cp311-cp311-win_arm64.whl", hash = "sha256:ac2df0fa564356384515ed62cb6679f33f1f529435b16b0ec0f88414635dbe39", size = 17993, upload-time = "2024-10-08T14:21:18.346Z" }, + { url = "https://files.pythonhosted.org/packages/4a/f4/603a84e7ae6427a53953db9f61b689dc6adf233e03c5f5ca907a901452fd/time_machine-2.16.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:84788f4d62a8b1bf5e499bb9b0e23ceceea21c415ad6030be6267ce3d639842f", size = 20155, upload-time = "2024-10-08T14:21:20.055Z" }, + { url = "https://files.pythonhosted.org/packages/d8/94/dbe69aecb4b84be52d34814e63176c5ca61f38ee9e6ecda11104653405b5/time_machine-2.16.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:15ec236b6571730236a193d9d6c11d472432fc6ab54e85eac1c16d98ddcd71bf", size = 16640, upload-time = "2024-10-08T14:21:22.005Z" }, + { url = "https://files.pythonhosted.org/packages/da/13/27f11be25d7bd298e033b9da93217e5b68309bf724b6e494cdadb471d00d/time_machine-2.16.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cedc989717c8b44a3881ac3d68ab5a95820448796c550de6a2149ed1525157f0", size = 33721, upload-time = "2024-10-08T14:21:23.059Z" }, + { url = "https://files.pythonhosted.org/packages/e6/9d/70e4640fed1fd8122204ae825c688d0ef8c04f515ec6bf3c5f3086d6510e/time_machine-2.16.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9d26d79de1c63a8c6586c75967e09b0ff306aa7e944a1eaddb74595c9b1839ca", size = 31646, upload-time = "2024-10-08T14:21:24.037Z" }, + { url = "https://files.pythonhosted.org/packages/a1/cb/93bc0e51bea4e171a85151dbba3c3b3f612b50b953cd3076f5b4f0db9e14/time_machine-2.16.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:317b68b56a9c3731e0cf8886e0f94230727159e375988b36c60edce0ddbcb44a", size = 33403, upload-time = "2024-10-08T14:21:24.975Z" }, + { url = "https://files.pythonhosted.org/packages/89/71/2c6a63ad4fbce3d62d46bbd9ac4433f30bade7f25978ce00815b905bcfcf/time_machine-2.16.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:43e1e18279759897be3293a255d53e6b1cb0364b69d9591d0b80c51e461c94b0", size = 33327, upload-time = "2024-10-08T14:21:25.958Z" }, + { url = "https://files.pythonhosted.org/packages/68/4e/205c2b26763b8817cd6b8868242843800a1fbf275f2af35f5ba35ff2b01a/time_machine-2.16.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:e43adb22def972a29d2b147999b56897116085777a0fea182fd93ee45730611e", size = 31454, upload-time = "2024-10-08T14:21:27.367Z" }, + { url = "https://files.pythonhosted.org/packages/d7/95/44c1aa3994919f93534244c40cfd2fb9416d7686dc0c8b9b262c751b5118/time_machine-2.16.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:0c766bea27a0600e36806d628ebc4b47178b12fcdfb6c24dc0a566a9c06bfe7f", size = 32972, upload-time = "2024-10-08T14:21:28.351Z" }, + { url = "https://files.pythonhosted.org/packages/d4/ee/75243df9c7cf30f108758e887141a58e6544baaa46e2e647b9ccc56db819/time_machine-2.16.0-cp312-cp312-win32.whl", hash = "sha256:6dae82ab647d107817e013db82223e20a9853fa88543fec853ae326382d03c2e", size = 19078, upload-time = "2024-10-08T14:21:29.425Z" }, + { url = "https://files.pythonhosted.org/packages/d4/7c/d4e67cc031f9653c92167ccf87d241e3208653d191c96ac79281c273ab92/time_machine-2.16.0-cp312-cp312-win_amd64.whl", hash = "sha256:265462c77dc9576267c3c7f20707780a171a9fdbac93ac22e608c309efd68c33", size = 19923, upload-time = "2024-10-08T14:21:30.759Z" }, + { url = "https://files.pythonhosted.org/packages/aa/b6/7047226fcb9afefe47fc80f605530535bf71ad99b6797f057abbfa4cd9a5/time_machine-2.16.0-cp312-cp312-win_arm64.whl", hash = "sha256:ef768e14768eebe3bb1196c0dece8e14c1c6991605721214a0c3c68cf77eb216", size = 18003, upload-time = "2024-10-08T14:21:32.662Z" }, + { url = "https://files.pythonhosted.org/packages/a6/18/3087d0eb185cedbc82385f46bf16032ec7102a0e070205a2c88c4ecf9952/time_machine-2.16.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:7751bf745d54e9e8b358c0afa332815da9b8a6194b26d0fd62876ab6c4d5c9c0", size = 20209, upload-time = "2024-10-08T14:21:34.222Z" }, + { url = "https://files.pythonhosted.org/packages/03/a3/fcc3eaf69390402ecf491d718e533b6d0e06d944d77fc8d87be3a2839102/time_machine-2.16.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:1784edf173ca840ba154de6eed000b5727f65ab92972c2f88cec5c4d6349c5f2", size = 16681, upload-time = "2024-10-08T14:21:35.14Z" }, + { url = "https://files.pythonhosted.org/packages/a2/96/8b76d264014bf9dc21873218de50d67223c71736f87fe6c65e582f7c29ac/time_machine-2.16.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2f5876a5682ce1f517e55d7ace2383432627889f6f7e338b961f99d684fd9e8d", size = 33768, upload-time = "2024-10-08T14:21:36.942Z" }, + { url = "https://files.pythonhosted.org/packages/5c/13/59ae8259be02b6c657ef6e3b6952bf274b43849f6f35cc61a576c68ce301/time_machine-2.16.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:806672529a2e255cd901f244c9033767dc1fa53466d0d3e3e49565a1572a64fe", size = 31685, upload-time = "2024-10-08T14:21:37.881Z" }, + { url = "https://files.pythonhosted.org/packages/3e/c1/9f142beb4d373a2a01ebb58d5117289315baa5131d880ec804db49e94bf7/time_machine-2.16.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:667b150fedb54acdca2a4bea5bf6da837b43e6dd12857301b48191f8803ba93f", size = 33447, upload-time = "2024-10-08T14:21:38.809Z" }, + { url = "https://files.pythonhosted.org/packages/95/f7/ed9ecd93c2d38dca77d0a28e070020f3ce0fb23e0d4a6edb14bcfffa5526/time_machine-2.16.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:da3ae1028af240c0c46c79adf9c1acffecc6ed1701f2863b8132f5ceae6ae4b5", size = 33408, upload-time = "2024-10-08T14:21:39.785Z" }, + { url = "https://files.pythonhosted.org/packages/91/40/d0d274d70fa2c4cad531745deb8c81346365beb0a2736be05a3acde8b94a/time_machine-2.16.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:520a814ea1b2706c89ab260a54023033d3015abef25c77873b83e3d7c1fafbb2", size = 31526, upload-time = "2024-10-08T14:21:40.769Z" }, + { url = "https://files.pythonhosted.org/packages/1d/ba/a27cdbb324d9a6d779cde0d514d47b696b5a6a653705d4b511fd65ef1514/time_machine-2.16.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8243664438bb468408b29c6865958662d75e51f79c91842d2794fa22629eb697", size = 33042, upload-time = "2024-10-08T14:21:41.722Z" }, + { url = "https://files.pythonhosted.org/packages/72/63/64e9156c9e38c18720d0cc41378168635241de44013ffe3dd5b099447eb0/time_machine-2.16.0-cp313-cp313-win32.whl", hash = "sha256:32d445ce20d25c60ab92153c073942b0bac9815bfbfd152ce3dcc225d15ce988", size = 19108, upload-time = "2024-10-08T14:21:43.596Z" }, + { url = "https://files.pythonhosted.org/packages/3d/40/27f5738fbd50b78dcc0682c14417eac5a49ccf430525dd0c5a058be125a2/time_machine-2.16.0-cp313-cp313-win_amd64.whl", hash = "sha256:f6927dda86425f97ffda36131f297b1a601c64a6ee6838bfa0e6d3149c2f0d9f", size = 19935, upload-time = "2024-10-08T14:21:45.277Z" }, + { url = "https://files.pythonhosted.org/packages/35/75/c4d8b2f0fe7dac22854d88a9c509d428e78ac4bf284bc54cfe83f75cc13b/time_machine-2.16.0-cp313-cp313-win_arm64.whl", hash = "sha256:4d3843143c46dddca6491a954bbd0abfd435681512ac343169560e9bab504129", size = 18047, upload-time = "2024-10-08T14:21:46.261Z" }, + { url = "https://files.pythonhosted.org/packages/df/aa/6d4925b22f3f5f53e2bcb12923f2463cac8c7c2360ac55196d51546787a5/time_machine-2.16.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:23c5283c01b4f80b7dfbc88f3d8088c06c301b94b7c35366be498c2d7b308549", size = 20490, upload-time = "2024-10-08T14:21:47.248Z" }, + { url = "https://files.pythonhosted.org/packages/b9/58/2bd28329c3c47de58c9234d177e809bed29d9e54729da79b5d0d8bc47e5e/time_machine-2.16.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ac95ae4529d7d85b251f9cf0f961a8a408ba285875811268f469d824a3b0b15a", size = 16753, upload-time = "2024-10-08T14:21:48.197Z" }, + { url = "https://files.pythonhosted.org/packages/c3/47/c8d388d6e061be146cf357bce727221f1d1d60dff2a36b880cb26e1a3199/time_machine-2.16.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dfb76674db946a74f0ca6e3b81caa8265e35dafe9b7005c7d2b8dd5bbd3825cf", size = 34228, upload-time = "2024-10-08T14:21:49.171Z" }, + { url = "https://files.pythonhosted.org/packages/d2/be/b0fb8693f2e9dfb5b50c5a89bb1d6ff8d4705075722b7987c0f1e18c6694/time_machine-2.16.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d0b6ff3ccde9b16bbc694a2b5facf2d8890554f3135ff626ed1429e270e3cc4f", size = 32250, upload-time = "2024-10-08T14:21:50.842Z" }, + { url = "https://files.pythonhosted.org/packages/6a/bc/e827239b0020195f4e2fa4e7fdf248838bb49230be2bf374181fac892a92/time_machine-2.16.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c1906ec6e26e6b803cd6aab28d420c87285b9c209ff2a69f82d12f82278f78bb", size = 34066, upload-time = "2024-10-08T14:21:51.815Z" }, + { url = "https://files.pythonhosted.org/packages/39/a9/c962c702b94ca4c7fd8264bc9baed431bd92d4ee2aa698dd92ff6e864164/time_machine-2.16.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:e46bd09c944ec7a20868abd2b83d7d7abdaf427775e9df3089b9226a122b340f", size = 33799, upload-time = "2024-10-08T14:21:52.813Z" }, + { url = "https://files.pythonhosted.org/packages/34/5f/91df8e8465a2d5a168c25eebf5a62d813f30e01909c32749dbbd442b66db/time_machine-2.16.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:cac3e2b4101db296b150cb665e5461c03621e6ede6117fc9d5048c0ec96d6e7c", size = 32076, upload-time = "2024-10-08T14:21:53.79Z" }, + { url = "https://files.pythonhosted.org/packages/04/45/bcc3304b545a15f614ecb12b277ec8d93fe0f67fa74e9e4b856e4ecba4c6/time_machine-2.16.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:1e0dcc97cfec12ae306e3036746e7631cc7ef65c31889f7264c25217d4938367", size = 33460, upload-time = "2024-10-08T14:21:54.797Z" }, + { url = "https://files.pythonhosted.org/packages/96/2c/9f14cd6fb912995e9984e67b8160071e8950cd7b0a787796d58b45324269/time_machine-2.16.0-cp39-cp39-win32.whl", hash = "sha256:c761d32d0c5d1fe5b71ac502e1bd5edec4598a7fc6f607b9b906b98e911148ce", size = 19133, upload-time = "2024-10-08T14:21:55.816Z" }, + { url = "https://files.pythonhosted.org/packages/63/0b/95bfa4a2b3a893d91de8304d98edbeb4e29b864977ef36929aa6eda1357f/time_machine-2.16.0-cp39-cp39-win_amd64.whl", hash = "sha256:ddfab1c622342f2945942c5c2d6be327656980e8f2d2b2ce0c022d0aa3711361", size = 19989, upload-time = "2024-10-08T14:21:57.59Z" }, + { url = "https://files.pythonhosted.org/packages/30/36/470c7d77d3a5c7e6a5e29ac40495b8dd3b66f3058ab8bdc823706fec1353/time_machine-2.16.0-cp39-cp39-win_arm64.whl", hash = "sha256:2e08a4015d5d1aab2cb46c780e85b33efcd5cbe880bb363b282a6972e617b8bb", size = 18106, upload-time = "2024-10-08T14:21:58.6Z" }, +] + +[[package]] +name = "tomli" +version = "2.2.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/18/87/302344fed471e44a87289cf4967697d07e532f2421fdaf868a303cbae4ff/tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff", size = 17175, upload-time = "2024-11-27T22:38:36.873Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/43/ca/75707e6efa2b37c77dadb324ae7d9571cb424e61ea73fad7c56c2d14527f/tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249", size = 131077, upload-time = "2024-11-27T22:37:54.956Z" }, + { url = "https://files.pythonhosted.org/packages/c7/16/51ae563a8615d472fdbffc43a3f3d46588c264ac4f024f63f01283becfbb/tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6", size = 123429, upload-time = "2024-11-27T22:37:56.698Z" }, + { url = "https://files.pythonhosted.org/packages/f1/dd/4f6cd1e7b160041db83c694abc78e100473c15d54620083dbd5aae7b990e/tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a", size = 226067, upload-time = "2024-11-27T22:37:57.63Z" }, + { url = "https://files.pythonhosted.org/packages/a9/6b/c54ede5dc70d648cc6361eaf429304b02f2871a345bbdd51e993d6cdf550/tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee", size = 236030, upload-time = "2024-11-27T22:37:59.344Z" }, + { url = "https://files.pythonhosted.org/packages/1f/47/999514fa49cfaf7a92c805a86c3c43f4215621855d151b61c602abb38091/tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e", size = 240898, upload-time = "2024-11-27T22:38:00.429Z" }, + { url = "https://files.pythonhosted.org/packages/73/41/0a01279a7ae09ee1573b423318e7934674ce06eb33f50936655071d81a24/tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4", size = 229894, upload-time = "2024-11-27T22:38:02.094Z" }, + { url = "https://files.pythonhosted.org/packages/55/18/5d8bc5b0a0362311ce4d18830a5d28943667599a60d20118074ea1b01bb7/tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106", size = 245319, upload-time = "2024-11-27T22:38:03.206Z" }, + { url = "https://files.pythonhosted.org/packages/92/a3/7ade0576d17f3cdf5ff44d61390d4b3febb8a9fc2b480c75c47ea048c646/tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8", size = 238273, upload-time = "2024-11-27T22:38:04.217Z" }, + { url = "https://files.pythonhosted.org/packages/72/6f/fa64ef058ac1446a1e51110c375339b3ec6be245af9d14c87c4a6412dd32/tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff", size = 98310, upload-time = "2024-11-27T22:38:05.908Z" }, + { url = "https://files.pythonhosted.org/packages/6a/1c/4a2dcde4a51b81be3530565e92eda625d94dafb46dbeb15069df4caffc34/tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b", size = 108309, upload-time = "2024-11-27T22:38:06.812Z" }, + { url = "https://files.pythonhosted.org/packages/52/e1/f8af4c2fcde17500422858155aeb0d7e93477a0d59a98e56cbfe75070fd0/tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea", size = 132762, upload-time = "2024-11-27T22:38:07.731Z" }, + { url = "https://files.pythonhosted.org/packages/03/b8/152c68bb84fc00396b83e7bbddd5ec0bd3dd409db4195e2a9b3e398ad2e3/tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8", size = 123453, upload-time = "2024-11-27T22:38:09.384Z" }, + { url = "https://files.pythonhosted.org/packages/c8/d6/fc9267af9166f79ac528ff7e8c55c8181ded34eb4b0e93daa767b8841573/tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192", size = 233486, upload-time = "2024-11-27T22:38:10.329Z" }, + { url = "https://files.pythonhosted.org/packages/5c/51/51c3f2884d7bab89af25f678447ea7d297b53b5a3b5730a7cb2ef6069f07/tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222", size = 242349, upload-time = "2024-11-27T22:38:11.443Z" }, + { url = "https://files.pythonhosted.org/packages/ab/df/bfa89627d13a5cc22402e441e8a931ef2108403db390ff3345c05253935e/tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77", size = 252159, upload-time = "2024-11-27T22:38:13.099Z" }, + { url = "https://files.pythonhosted.org/packages/9e/6e/fa2b916dced65763a5168c6ccb91066f7639bdc88b48adda990db10c8c0b/tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6", size = 237243, upload-time = "2024-11-27T22:38:14.766Z" }, + { url = "https://files.pythonhosted.org/packages/b4/04/885d3b1f650e1153cbb93a6a9782c58a972b94ea4483ae4ac5cedd5e4a09/tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd", size = 259645, upload-time = "2024-11-27T22:38:15.843Z" }, + { url = "https://files.pythonhosted.org/packages/9c/de/6b432d66e986e501586da298e28ebeefd3edc2c780f3ad73d22566034239/tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e", size = 244584, upload-time = "2024-11-27T22:38:17.645Z" }, + { url = "https://files.pythonhosted.org/packages/1c/9a/47c0449b98e6e7d1be6cbac02f93dd79003234ddc4aaab6ba07a9a7482e2/tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98", size = 98875, upload-time = "2024-11-27T22:38:19.159Z" }, + { url = "https://files.pythonhosted.org/packages/ef/60/9b9638f081c6f1261e2688bd487625cd1e660d0a85bd469e91d8db969734/tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4", size = 109418, upload-time = "2024-11-27T22:38:20.064Z" }, + { url = "https://files.pythonhosted.org/packages/04/90/2ee5f2e0362cb8a0b6499dc44f4d7d48f8fff06d28ba46e6f1eaa61a1388/tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7", size = 132708, upload-time = "2024-11-27T22:38:21.659Z" }, + { url = "https://files.pythonhosted.org/packages/c0/ec/46b4108816de6b385141f082ba99e315501ccd0a2ea23db4a100dd3990ea/tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c", size = 123582, upload-time = "2024-11-27T22:38:22.693Z" }, + { url = "https://files.pythonhosted.org/packages/a0/bd/b470466d0137b37b68d24556c38a0cc819e8febe392d5b199dcd7f578365/tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13", size = 232543, upload-time = "2024-11-27T22:38:24.367Z" }, + { url = "https://files.pythonhosted.org/packages/d9/e5/82e80ff3b751373f7cead2815bcbe2d51c895b3c990686741a8e56ec42ab/tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281", size = 241691, upload-time = "2024-11-27T22:38:26.081Z" }, + { url = "https://files.pythonhosted.org/packages/05/7e/2a110bc2713557d6a1bfb06af23dd01e7dde52b6ee7dadc589868f9abfac/tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272", size = 251170, upload-time = "2024-11-27T22:38:27.921Z" }, + { url = "https://files.pythonhosted.org/packages/64/7b/22d713946efe00e0adbcdfd6d1aa119ae03fd0b60ebed51ebb3fa9f5a2e5/tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140", size = 236530, upload-time = "2024-11-27T22:38:29.591Z" }, + { url = "https://files.pythonhosted.org/packages/38/31/3a76f67da4b0cf37b742ca76beaf819dca0ebef26d78fc794a576e08accf/tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2", size = 258666, upload-time = "2024-11-27T22:38:30.639Z" }, + { url = "https://files.pythonhosted.org/packages/07/10/5af1293da642aded87e8a988753945d0cf7e00a9452d3911dd3bb354c9e2/tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744", size = 243954, upload-time = "2024-11-27T22:38:31.702Z" }, + { url = "https://files.pythonhosted.org/packages/5b/b9/1ed31d167be802da0fc95020d04cd27b7d7065cc6fbefdd2f9186f60d7bd/tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec", size = 98724, upload-time = "2024-11-27T22:38:32.837Z" }, + { url = "https://files.pythonhosted.org/packages/c7/32/b0963458706accd9afcfeb867c0f9175a741bf7b19cd424230714d722198/tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69", size = 109383, upload-time = "2024-11-27T22:38:34.455Z" }, + { url = "https://files.pythonhosted.org/packages/6e/c2/61d3e0f47e2b74ef40a68b9e6ad5984f6241a942f7cd3bbfbdbd03861ea9/tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc", size = 14257, upload-time = "2024-11-27T22:38:35.385Z" }, +] + +[[package]] +name = "typing-extensions" +version = "4.12.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/df/db/f35a00659bc03fec321ba8bce9420de607a1d37f8342eee1863174c69557/typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8", size = 85321, upload-time = "2024-06-07T18:52:15.995Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/26/9f/ad63fc0248c5379346306f8668cda6e2e2e9c95e01216d2b8ffd9ff037d0/typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d", size = 37438, upload-time = "2024-06-07T18:52:13.582Z" }, +] + +[[package]] +name = "typing-inspection" +version = "0.4.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions", marker = "(python_full_version >= '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f8/b1/0c11f5058406b3af7609f121aaa6b609744687f1d158b3c3a5bf4cc94238/typing_inspection-0.4.1.tar.gz", hash = "sha256:6ae134cc0203c33377d43188d4064e9b357dba58cff3185f22924610e70a9d28", size = 75726, upload-time = "2025-05-21T18:55:23.885Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/17/69/cd203477f944c353c31bade965f880aa1061fd6bf05ded0726ca845b6ff7/typing_inspection-0.4.1-py3-none-any.whl", hash = "sha256:389055682238f53b04f7badcb49b989835495a96700ced5dab2d8feae4b26f51", size = 14552, upload-time = "2025-05-21T18:55:22.152Z" }, +] + +[[package]] +name = "yarl" +version = "1.15.2" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.9'", +] +dependencies = [ + { name = "idna", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "multidict", version = "6.1.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "propcache", version = "0.2.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/e1/d5427a061819c9f885f58bb0467d02a523f1aec19f9e5f9c82ce950d90d3/yarl-1.15.2.tar.gz", hash = "sha256:a39c36f4218a5bb668b4f06874d676d35a035ee668e6e7e3538835c703634b84", size = 169318, upload-time = "2024-10-13T18:48:04.311Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/61/f8/6b1bbc6f597d8937ad8661c042aa6bdbbe46a3a6e38e2c04214b9c82e804/yarl-1.15.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e4ee8b8639070ff246ad3649294336b06db37a94bdea0d09ea491603e0be73b8", size = 136479, upload-time = "2024-10-13T18:44:32.077Z" }, + { url = "https://files.pythonhosted.org/packages/61/e0/973c0d16b1cb710d318b55bd5d019a1ecd161d28670b07d8d9df9a83f51f/yarl-1.15.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:a7cf963a357c5f00cb55b1955df8bbe68d2f2f65de065160a1c26b85a1e44172", size = 88671, upload-time = "2024-10-13T18:44:35.334Z" }, + { url = "https://files.pythonhosted.org/packages/16/df/241cfa1cf33b96da2c8773b76fe3ee58e04cb09ecfe794986ec436ae97dc/yarl-1.15.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:43ebdcc120e2ca679dba01a779333a8ea76b50547b55e812b8b92818d604662c", size = 86578, upload-time = "2024-10-13T18:44:37.58Z" }, + { url = "https://files.pythonhosted.org/packages/02/a4/ee2941d1f93600d921954a0850e20581159772304e7de49f60588e9128a2/yarl-1.15.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3433da95b51a75692dcf6cc8117a31410447c75a9a8187888f02ad45c0a86c50", size = 307212, upload-time = "2024-10-13T18:44:39.932Z" }, + { url = "https://files.pythonhosted.org/packages/08/64/2e6561af430b092b21c7a867ae3079f62e1532d3e51fee765fd7a74cef6c/yarl-1.15.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:38d0124fa992dbacd0c48b1b755d3ee0a9f924f427f95b0ef376556a24debf01", size = 321589, upload-time = "2024-10-13T18:44:42.527Z" }, + { url = "https://files.pythonhosted.org/packages/f8/af/056ab318a7117fa70f6ab502ff880e47af973948d1d123aff397cd68499c/yarl-1.15.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ded1b1803151dd0f20a8945508786d57c2f97a50289b16f2629f85433e546d47", size = 319443, upload-time = "2024-10-13T18:44:45.03Z" }, + { url = "https://files.pythonhosted.org/packages/99/d1/051b0bc2c90c9a2618bab10a9a9a61a96ddb28c7c54161a5c97f9e625205/yarl-1.15.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ace4cad790f3bf872c082366c9edd7f8f8f77afe3992b134cfc810332206884f", size = 310324, upload-time = "2024-10-13T18:44:47.675Z" }, + { url = "https://files.pythonhosted.org/packages/23/1b/16df55016f9ac18457afda165031086bce240d8bcf494501fb1164368617/yarl-1.15.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c77494a2f2282d9bbbbcab7c227a4d1b4bb829875c96251f66fb5f3bae4fb053", size = 300428, upload-time = "2024-10-13T18:44:49.431Z" }, + { url = "https://files.pythonhosted.org/packages/83/a5/5188d1c575139a8dfd90d463d56f831a018f41f833cdf39da6bd8a72ee08/yarl-1.15.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:b7f227ca6db5a9fda0a2b935a2ea34a7267589ffc63c8045f0e4edb8d8dcf956", size = 307079, upload-time = "2024-10-13T18:44:51.96Z" }, + { url = "https://files.pythonhosted.org/packages/ba/4e/2497f8f2b34d1a261bebdbe00066242eacc9a7dccd4f02ddf0995014290a/yarl-1.15.2-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:31561a5b4d8dbef1559b3600b045607cf804bae040f64b5f5bca77da38084a8a", size = 305835, upload-time = "2024-10-13T18:44:53.83Z" }, + { url = "https://files.pythonhosted.org/packages/91/db/40a347e1f8086e287a53c72dc333198816885bc770e3ecafcf5eaeb59311/yarl-1.15.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:3e52474256a7db9dcf3c5f4ca0b300fdea6c21cca0148c8891d03a025649d935", size = 311033, upload-time = "2024-10-13T18:44:56.464Z" }, + { url = "https://files.pythonhosted.org/packages/2f/a6/1500e1e694616c25eed6bf8c1aacc0943f124696d2421a07ae5e9ee101a5/yarl-1.15.2-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:0e1af74a9529a1137c67c887ed9cde62cff53aa4d84a3adbec329f9ec47a3936", size = 326317, upload-time = "2024-10-13T18:44:59.015Z" }, + { url = "https://files.pythonhosted.org/packages/37/db/868d4b59cc76932ce880cc9946cd0ae4ab111a718494a94cb50dd5b67d82/yarl-1.15.2-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:15c87339490100c63472a76d87fe7097a0835c705eb5ae79fd96e343473629ed", size = 324196, upload-time = "2024-10-13T18:45:00.772Z" }, + { url = "https://files.pythonhosted.org/packages/bd/41/b6c917c2fde2601ee0b45c82a0c502dc93e746dea469d3a6d1d0a24749e8/yarl-1.15.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:74abb8709ea54cc483c4fb57fb17bb66f8e0f04438cff6ded322074dbd17c7ec", size = 317023, upload-time = "2024-10-13T18:45:03.427Z" }, + { url = "https://files.pythonhosted.org/packages/b0/85/2cde6b656fd83c474f19606af3f7a3e94add8988760c87a101ee603e7b8f/yarl-1.15.2-cp310-cp310-win32.whl", hash = "sha256:ffd591e22b22f9cb48e472529db6a47203c41c2c5911ff0a52e85723196c0d75", size = 78136, upload-time = "2024-10-13T18:45:05.173Z" }, + { url = "https://files.pythonhosted.org/packages/ef/3c/4414901b0588427870002b21d790bd1fad142a9a992a22e5037506d0ed9d/yarl-1.15.2-cp310-cp310-win_amd64.whl", hash = "sha256:1695497bb2a02a6de60064c9f077a4ae9c25c73624e0d43e3aa9d16d983073c2", size = 84231, upload-time = "2024-10-13T18:45:07.622Z" }, + { url = "https://files.pythonhosted.org/packages/4a/59/3ae125c97a2a8571ea16fdf59fcbd288bc169e0005d1af9946a90ea831d9/yarl-1.15.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9fcda20b2de7042cc35cf911702fa3d8311bd40055a14446c1e62403684afdc5", size = 136492, upload-time = "2024-10-13T18:45:09.962Z" }, + { url = "https://files.pythonhosted.org/packages/f9/2b/efa58f36b582db45b94c15e87803b775eb8a4ca0db558121a272e67f3564/yarl-1.15.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:0545de8c688fbbf3088f9e8b801157923be4bf8e7b03e97c2ecd4dfa39e48e0e", size = 88614, upload-time = "2024-10-13T18:45:12.329Z" }, + { url = "https://files.pythonhosted.org/packages/82/69/eb73c0453a2ff53194df485dc7427d54e6cb8d1180fcef53251a8e24d069/yarl-1.15.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:fbda058a9a68bec347962595f50546a8a4a34fd7b0654a7b9697917dc2bf810d", size = 86607, upload-time = "2024-10-13T18:45:13.88Z" }, + { url = "https://files.pythonhosted.org/packages/48/4e/89beaee3a4da0d1c6af1176d738cff415ff2ad3737785ee25382409fe3e3/yarl-1.15.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d1ac2bc069f4a458634c26b101c2341b18da85cb96afe0015990507efec2e417", size = 334077, upload-time = "2024-10-13T18:45:16.217Z" }, + { url = "https://files.pythonhosted.org/packages/da/e8/8fcaa7552093f94c3f327783e2171da0eaa71db0c267510898a575066b0f/yarl-1.15.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cd126498171f752dd85737ab1544329a4520c53eed3997f9b08aefbafb1cc53b", size = 347365, upload-time = "2024-10-13T18:45:18.812Z" }, + { url = "https://files.pythonhosted.org/packages/be/fa/dc2002f82a89feab13a783d3e6b915a3a2e0e83314d9e3f6d845ee31bfcc/yarl-1.15.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3db817b4e95eb05c362e3b45dafe7144b18603e1211f4a5b36eb9522ecc62bcf", size = 344823, upload-time = "2024-10-13T18:45:20.644Z" }, + { url = "https://files.pythonhosted.org/packages/ae/c8/c4a00fe7f2aa6970c2651df332a14c88f8baaedb2e32d6c3b8c8a003ea74/yarl-1.15.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:076b1ed2ac819933895b1a000904f62d615fe4533a5cf3e052ff9a1da560575c", size = 337132, upload-time = "2024-10-13T18:45:22.487Z" }, + { url = "https://files.pythonhosted.org/packages/07/bf/84125f85f44bf2af03f3cf64e87214b42cd59dcc8a04960d610a9825f4d4/yarl-1.15.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f8cfd847e6b9ecf9f2f2531c8427035f291ec286c0a4944b0a9fce58c6446046", size = 326258, upload-time = "2024-10-13T18:45:25.049Z" }, + { url = "https://files.pythonhosted.org/packages/00/19/73ad8122b2fa73fe22e32c24b82a6c053cf6c73e2f649b73f7ef97bee8d0/yarl-1.15.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:32b66be100ac5739065496c74c4b7f3015cef792c3174982809274d7e51b3e04", size = 336212, upload-time = "2024-10-13T18:45:26.808Z" }, + { url = "https://files.pythonhosted.org/packages/39/1d/2fa4337d11f6587e9b7565f84eba549f2921494bc8b10bfe811079acaa70/yarl-1.15.2-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:34a2d76a1984cac04ff8b1bfc939ec9dc0914821264d4a9c8fd0ed6aa8d4cfd2", size = 330397, upload-time = "2024-10-13T18:45:29.112Z" }, + { url = "https://files.pythonhosted.org/packages/39/ab/dce75e06806bcb4305966471ead03ce639d8230f4f52c32bd614d820c044/yarl-1.15.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:0afad2cd484908f472c8fe2e8ef499facee54a0a6978be0e0cff67b1254fd747", size = 334985, upload-time = "2024-10-13T18:45:31.709Z" }, + { url = "https://files.pythonhosted.org/packages/c1/98/3f679149347a5e34c952bf8f71a387bc96b3488fae81399a49f8b1a01134/yarl-1.15.2-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:c68e820879ff39992c7f148113b46efcd6ec765a4865581f2902b3c43a5f4bbb", size = 356033, upload-time = "2024-10-13T18:45:34.325Z" }, + { url = "https://files.pythonhosted.org/packages/f7/8c/96546061c19852d0a4b1b07084a58c2e8911db6bcf7838972cff542e09fb/yarl-1.15.2-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:98f68df80ec6ca3015186b2677c208c096d646ef37bbf8b49764ab4a38183931", size = 357710, upload-time = "2024-10-13T18:45:36.216Z" }, + { url = "https://files.pythonhosted.org/packages/01/45/ade6fb3daf689816ebaddb3175c962731edf300425c3254c559b6d0dcc27/yarl-1.15.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:3c56ec1eacd0a5d35b8a29f468659c47f4fe61b2cab948ca756c39b7617f0aa5", size = 345532, upload-time = "2024-10-13T18:45:38.123Z" }, + { url = "https://files.pythonhosted.org/packages/e7/d7/8de800d3aecda0e64c43e8fc844f7effc8731a6099fa0c055738a2247504/yarl-1.15.2-cp311-cp311-win32.whl", hash = "sha256:eedc3f247ee7b3808ea07205f3e7d7879bc19ad3e6222195cd5fbf9988853e4d", size = 78250, upload-time = "2024-10-13T18:45:39.908Z" }, + { url = "https://files.pythonhosted.org/packages/3a/6c/69058bbcfb0164f221aa30e0cd1a250f6babb01221e27c95058c51c498ca/yarl-1.15.2-cp311-cp311-win_amd64.whl", hash = "sha256:0ccaa1bc98751fbfcf53dc8dfdb90d96e98838010fc254180dd6707a6e8bb179", size = 84492, upload-time = "2024-10-13T18:45:42.286Z" }, + { url = "https://files.pythonhosted.org/packages/e0/d1/17ff90e7e5b1a0b4ddad847f9ec6a214b87905e3a59d01bff9207ce2253b/yarl-1.15.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:82d5161e8cb8f36ec778fd7ac4d740415d84030f5b9ef8fe4da54784a1f46c94", size = 136721, upload-time = "2024-10-13T18:45:43.876Z" }, + { url = "https://files.pythonhosted.org/packages/44/50/a64ca0577aeb9507f4b672f9c833d46cf8f1e042ce2e80c11753b936457d/yarl-1.15.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:fa2bea05ff0a8fb4d8124498e00e02398f06d23cdadd0fe027d84a3f7afde31e", size = 88954, upload-time = "2024-10-13T18:45:46.305Z" }, + { url = "https://files.pythonhosted.org/packages/c9/0a/a30d0b02046d4088c1fd32d85d025bd70ceb55f441213dee14d503694f41/yarl-1.15.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:99e12d2bf587b44deb74e0d6170fec37adb489964dbca656ec41a7cd8f2ff178", size = 86692, upload-time = "2024-10-13T18:45:47.992Z" }, + { url = "https://files.pythonhosted.org/packages/06/0b/7613decb8baa26cba840d7ea2074bd3c5e27684cbcb6d06e7840d6c5226c/yarl-1.15.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:243fbbbf003754fe41b5bdf10ce1e7f80bcc70732b5b54222c124d6b4c2ab31c", size = 325762, upload-time = "2024-10-13T18:45:49.69Z" }, + { url = "https://files.pythonhosted.org/packages/97/f5/b8c389a58d1eb08f89341fc1bbcc23a0341f7372185a0a0704dbdadba53a/yarl-1.15.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:856b7f1a7b98a8c31823285786bd566cf06226ac4f38b3ef462f593c608a9bd6", size = 335037, upload-time = "2024-10-13T18:45:51.932Z" }, + { url = "https://files.pythonhosted.org/packages/cb/f9/d89b93a7bb8b66e01bf722dcc6fec15e11946e649e71414fd532b05c4d5d/yarl-1.15.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:553dad9af802a9ad1a6525e7528152a015b85fb8dbf764ebfc755c695f488367", size = 334221, upload-time = "2024-10-13T18:45:54.548Z" }, + { url = "https://files.pythonhosted.org/packages/10/77/1db077601998e0831a540a690dcb0f450c31f64c492e993e2eaadfbc7d31/yarl-1.15.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:30c3ff305f6e06650a761c4393666f77384f1cc6c5c0251965d6bfa5fbc88f7f", size = 330167, upload-time = "2024-10-13T18:45:56.675Z" }, + { url = "https://files.pythonhosted.org/packages/3b/c2/e5b7121662fd758656784fffcff2e411c593ec46dc9ec68e0859a2ffaee3/yarl-1.15.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:353665775be69bbfc6d54c8d134bfc533e332149faeddd631b0bc79df0897f46", size = 317472, upload-time = "2024-10-13T18:45:58.815Z" }, + { url = "https://files.pythonhosted.org/packages/c6/f3/41e366c17e50782651b192ba06a71d53500cc351547816bf1928fb043c4f/yarl-1.15.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:f4fe99ce44128c71233d0d72152db31ca119711dfc5f2c82385ad611d8d7f897", size = 330896, upload-time = "2024-10-13T18:46:01.126Z" }, + { url = "https://files.pythonhosted.org/packages/79/a2/d72e501bc1e33e68a5a31f584fe4556ab71a50a27bfd607d023f097cc9bb/yarl-1.15.2-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:9c1e3ff4b89cdd2e1a24c214f141e848b9e0451f08d7d4963cb4108d4d798f1f", size = 328787, upload-time = "2024-10-13T18:46:02.991Z" }, + { url = "https://files.pythonhosted.org/packages/9d/ba/890f7e1ea17f3c247748548eee876528ceb939e44566fa7d53baee57e5aa/yarl-1.15.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:711bdfae4e699a6d4f371137cbe9e740dc958530cb920eb6f43ff9551e17cfbc", size = 332631, upload-time = "2024-10-13T18:46:04.939Z" }, + { url = "https://files.pythonhosted.org/packages/48/c7/27b34206fd5dfe76b2caa08bf22f9212b2d665d5bb2df8a6dd3af498dcf4/yarl-1.15.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:4388c72174868884f76affcdd3656544c426407e0043c89b684d22fb265e04a5", size = 344023, upload-time = "2024-10-13T18:46:06.809Z" }, + { url = "https://files.pythonhosted.org/packages/88/e7/730b130f4f02bd8b00479baf9a57fdea1dc927436ed1d6ba08fa5c36c68e/yarl-1.15.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:f0e1844ad47c7bd5d6fa784f1d4accc5f4168b48999303a868fe0f8597bde715", size = 352290, upload-time = "2024-10-13T18:46:08.676Z" }, + { url = "https://files.pythonhosted.org/packages/84/9b/e8dda28f91a0af67098cddd455e6b540d3f682dda4c0de224215a57dee4a/yarl-1.15.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a5cafb02cf097a82d74403f7e0b6b9df3ffbfe8edf9415ea816314711764a27b", size = 343742, upload-time = "2024-10-13T18:46:10.583Z" }, + { url = "https://files.pythonhosted.org/packages/66/47/b1c6bb85f2b66decbe189e27fcc956ab74670a068655df30ef9a2e15c379/yarl-1.15.2-cp312-cp312-win32.whl", hash = "sha256:156ececdf636143f508770bf8a3a0498de64da5abd890c7dbb42ca9e3b6c05b8", size = 78051, upload-time = "2024-10-13T18:46:12.671Z" }, + { url = "https://files.pythonhosted.org/packages/7d/9e/1a897e5248ec53e96e9f15b3e6928efd5e75d322c6cf666f55c1c063e5c9/yarl-1.15.2-cp312-cp312-win_amd64.whl", hash = "sha256:435aca062444a7f0c884861d2e3ea79883bd1cd19d0a381928b69ae1b85bc51d", size = 84313, upload-time = "2024-10-13T18:46:15.237Z" }, + { url = "https://files.pythonhosted.org/packages/46/ab/be3229898d7eb1149e6ba7fe44f873cf054d275a00b326f2a858c9ff7175/yarl-1.15.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:416f2e3beaeae81e2f7a45dc711258be5bdc79c940a9a270b266c0bec038fb84", size = 135006, upload-time = "2024-10-13T18:46:16.909Z" }, + { url = "https://files.pythonhosted.org/packages/10/10/b91c186b1b0e63951f80481b3e6879bb9f7179d471fe7c4440c9e900e2a3/yarl-1.15.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:173563f3696124372831007e3d4b9821746964a95968628f7075d9231ac6bb33", size = 88121, upload-time = "2024-10-13T18:46:18.702Z" }, + { url = "https://files.pythonhosted.org/packages/bf/1d/4ceaccf836b9591abfde775e84249b847ac4c6c14ee2dd8d15b5b3cede44/yarl-1.15.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9ce2e0f6123a60bd1a7f5ae3b2c49b240c12c132847f17aa990b841a417598a2", size = 85967, upload-time = "2024-10-13T18:46:20.354Z" }, + { url = "https://files.pythonhosted.org/packages/93/bd/c924f22bdb2c5d0ca03a9e64ecc5e041aace138c2a91afff7e2f01edc3a1/yarl-1.15.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eaea112aed589131f73d50d570a6864728bd7c0c66ef6c9154ed7b59f24da611", size = 325615, upload-time = "2024-10-13T18:46:22.057Z" }, + { url = "https://files.pythonhosted.org/packages/59/a5/6226accd5c01cafd57af0d249c7cf9dd12569cd9c78fbd93e8198e7a9d84/yarl-1.15.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e4ca3b9f370f218cc2a0309542cab8d0acdfd66667e7c37d04d617012485f904", size = 334945, upload-time = "2024-10-13T18:46:24.184Z" }, + { url = "https://files.pythonhosted.org/packages/4c/c1/cc6ccdd2bcd0ff7291602d5831754595260f8d2754642dfd34fef1791059/yarl-1.15.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:23ec1d3c31882b2a8a69c801ef58ebf7bae2553211ebbddf04235be275a38548", size = 336701, upload-time = "2024-10-13T18:46:27.038Z" }, + { url = "https://files.pythonhosted.org/packages/ef/ff/39a767ee249444e4b26ea998a526838238f8994c8f274befc1f94dacfb43/yarl-1.15.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:75119badf45f7183e10e348edff5a76a94dc19ba9287d94001ff05e81475967b", size = 330977, upload-time = "2024-10-13T18:46:28.921Z" }, + { url = "https://files.pythonhosted.org/packages/dd/ba/b1fed73f9d39e3e7be8f6786be5a2ab4399c21504c9168c3cadf6e441c2e/yarl-1.15.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:78e6fdc976ec966b99e4daa3812fac0274cc28cd2b24b0d92462e2e5ef90d368", size = 317402, upload-time = "2024-10-13T18:46:30.86Z" }, + { url = "https://files.pythonhosted.org/packages/82/e8/03e3ebb7f558374f29c04868b20ca484d7997f80a0a191490790a8c28058/yarl-1.15.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:8657d3f37f781d987037f9cc20bbc8b40425fa14380c87da0cb8dfce7c92d0fb", size = 331776, upload-time = "2024-10-13T18:46:33.037Z" }, + { url = "https://files.pythonhosted.org/packages/1f/83/90b0f4fd1ecf2602ba4ac50ad0bbc463122208f52dd13f152bbc0d8417dd/yarl-1.15.2-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:93bed8a8084544c6efe8856c362af08a23e959340c87a95687fdbe9c9f280c8b", size = 331585, upload-time = "2024-10-13T18:46:35.275Z" }, + { url = "https://files.pythonhosted.org/packages/c7/f6/1ed7e7f270ae5f9f1174c1f8597b29658f552fee101c26de8b2eb4ca147a/yarl-1.15.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:69d5856d526802cbda768d3e6246cd0d77450fa2a4bc2ea0ea14f0d972c2894b", size = 336395, upload-time = "2024-10-13T18:46:38.003Z" }, + { url = "https://files.pythonhosted.org/packages/e0/3a/4354ed8812909d9ec54a92716a53259b09e6b664209231f2ec5e75f4820d/yarl-1.15.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:ccad2800dfdff34392448c4bf834be124f10a5bc102f254521d931c1c53c455a", size = 342810, upload-time = "2024-10-13T18:46:39.952Z" }, + { url = "https://files.pythonhosted.org/packages/de/cc/39e55e16b1415a87f6d300064965d6cfb2ac8571e11339ccb7dada2444d9/yarl-1.15.2-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:a880372e2e5dbb9258a4e8ff43f13888039abb9dd6d515f28611c54361bc5644", size = 351441, upload-time = "2024-10-13T18:46:41.867Z" }, + { url = "https://files.pythonhosted.org/packages/fb/19/5cd4757079dc9d9f3de3e3831719b695f709a8ce029e70b33350c9d082a7/yarl-1.15.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:c998d0558805860503bc3a595994895ca0f7835e00668dadc673bbf7f5fbfcbe", size = 345875, upload-time = "2024-10-13T18:46:43.824Z" }, + { url = "https://files.pythonhosted.org/packages/83/a0/ef09b54634f73417f1ea4a746456a4372c1b044f07b26e16fa241bd2d94e/yarl-1.15.2-cp313-cp313-win32.whl", hash = "sha256:533a28754e7f7439f217550a497bb026c54072dbe16402b183fdbca2431935a9", size = 302609, upload-time = "2024-10-13T18:46:45.828Z" }, + { url = "https://files.pythonhosted.org/packages/20/9f/f39c37c17929d3975da84c737b96b606b68c495cc4ee86408f10523a1635/yarl-1.15.2-cp313-cp313-win_amd64.whl", hash = "sha256:5838f2b79dc8f96fdc44077c9e4e2e33d7089b10788464609df788eb97d03aad", size = 308252, upload-time = "2024-10-13T18:46:48.042Z" }, + { url = "https://files.pythonhosted.org/packages/7b/1f/544439ce6b7a498327d57ff40f0cd4f24bf4b1c1daf76c8c962dca022e71/yarl-1.15.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:fbbb63bed5fcd70cd3dd23a087cd78e4675fb5a2963b8af53f945cbbca79ae16", size = 138555, upload-time = "2024-10-13T18:46:50.448Z" }, + { url = "https://files.pythonhosted.org/packages/e8/b7/d6f33e7a42832f1e8476d0aabe089be0586a9110b5dfc2cef93444dc7c21/yarl-1.15.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:e2e93b88ecc8f74074012e18d679fb2e9c746f2a56f79cd5e2b1afcf2a8a786b", size = 89844, upload-time = "2024-10-13T18:46:52.297Z" }, + { url = "https://files.pythonhosted.org/packages/93/34/ede8d8ed7350b4b21e33fc4eff71e08de31da697034969b41190132d421f/yarl-1.15.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:af8ff8d7dc07ce873f643de6dfbcd45dc3db2c87462e5c387267197f59e6d776", size = 87671, upload-time = "2024-10-13T18:46:54.104Z" }, + { url = "https://files.pythonhosted.org/packages/fa/51/6d71e92bc54b5788b18f3dc29806f9ce37e12b7c610e8073357717f34b78/yarl-1.15.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:66f629632220a4e7858b58e4857927dd01a850a4cef2fb4044c8662787165cf7", size = 314558, upload-time = "2024-10-13T18:46:55.885Z" }, + { url = "https://files.pythonhosted.org/packages/76/0a/f9ffe503b4ef77cd77c9eefd37717c092e26f2c2dbbdd45700f864831292/yarl-1.15.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:833547179c31f9bec39b49601d282d6f0ea1633620701288934c5f66d88c3e50", size = 327622, upload-time = "2024-10-13T18:46:58.173Z" }, + { url = "https://files.pythonhosted.org/packages/8b/38/8eb602eeb153de0189d572dce4ed81b9b14f71de7c027d330b601b4fdcdc/yarl-1.15.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2aa738e0282be54eede1e3f36b81f1e46aee7ec7602aa563e81e0e8d7b67963f", size = 324447, upload-time = "2024-10-13T18:47:00.263Z" }, + { url = "https://files.pythonhosted.org/packages/c2/1e/1c78c695a4c7b957b5665e46a89ea35df48511dbed301a05c0a8beed0cc3/yarl-1.15.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9a13a07532e8e1c4a5a3afff0ca4553da23409fad65def1b71186fb867eeae8d", size = 319009, upload-time = "2024-10-13T18:47:02.417Z" }, + { url = "https://files.pythonhosted.org/packages/06/a0/7ea93de4ca1991e7f92a8901dcd1585165f547d342f7c6f36f1ea58b75de/yarl-1.15.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c45817e3e6972109d1a2c65091504a537e257bc3c885b4e78a95baa96df6a3f8", size = 307760, upload-time = "2024-10-13T18:47:04.553Z" }, + { url = "https://files.pythonhosted.org/packages/f4/b4/ceaa1f35cfb37fe06af3f7404438abf9a1262dc5df74dba37c90b0615e06/yarl-1.15.2-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:670eb11325ed3a6209339974b276811867defe52f4188fe18dc49855774fa9cf", size = 315038, upload-time = "2024-10-13T18:47:06.482Z" }, + { url = "https://files.pythonhosted.org/packages/da/45/a2ca2b547c56550eefc39e45d61e4b42ae6dbb3e913810b5a0eb53e86412/yarl-1.15.2-cp38-cp38-musllinux_1_2_armv7l.whl", hash = "sha256:d417a4f6943112fae3924bae2af7112562285848d9bcee737fc4ff7cbd450e6c", size = 312898, upload-time = "2024-10-13T18:47:09.291Z" }, + { url = "https://files.pythonhosted.org/packages/ea/e0/f692ba36dedc5b0b22084bba558a7ede053841e247b7dd2adbb9d40450be/yarl-1.15.2-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:bc8936d06cd53fddd4892677d65e98af514c8d78c79864f418bbf78a4a2edde4", size = 319370, upload-time = "2024-10-13T18:47:11.647Z" }, + { url = "https://files.pythonhosted.org/packages/b1/3f/0e382caf39958be6ae61d4bb0c82a68a3c45a494fc8cdc6f55c29757970e/yarl-1.15.2-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:954dde77c404084c2544e572f342aef384240b3e434e06cecc71597e95fd1ce7", size = 332429, upload-time = "2024-10-13T18:47:13.88Z" }, + { url = "https://files.pythonhosted.org/packages/21/6b/c824a4a1c45d67b15b431d4ab83b63462bfcbc710065902e10fa5c2ffd9e/yarl-1.15.2-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:5bc0df728e4def5e15a754521e8882ba5a5121bd6b5a3a0ff7efda5d6558ab3d", size = 333143, upload-time = "2024-10-13T18:47:16.141Z" }, + { url = "https://files.pythonhosted.org/packages/20/76/8af2a1d93fe95b04e284b5d55daaad33aae6e2f6254a1bcdb40e2752af6c/yarl-1.15.2-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:b71862a652f50babab4a43a487f157d26b464b1dedbcc0afda02fd64f3809d04", size = 326687, upload-time = "2024-10-13T18:47:18.179Z" }, + { url = "https://files.pythonhosted.org/packages/1c/53/490830773f907ef8a311cc5d82e5830f75f7692c1adacbdb731d3f1246fd/yarl-1.15.2-cp38-cp38-win32.whl", hash = "sha256:63eab904f8630aed5a68f2d0aeab565dcfc595dc1bf0b91b71d9ddd43dea3aea", size = 78705, upload-time = "2024-10-13T18:47:20.876Z" }, + { url = "https://files.pythonhosted.org/packages/9c/9d/d944e897abf37f50f4fa2d8d6f5fd0ed9413bc8327d3b4cc25ba9694e1ba/yarl-1.15.2-cp38-cp38-win_amd64.whl", hash = "sha256:2cf441c4b6e538ba0d2591574f95d3fdd33f1efafa864faa077d9636ecc0c4e9", size = 84998, upload-time = "2024-10-13T18:47:23.301Z" }, + { url = "https://files.pythonhosted.org/packages/91/1c/1c9d08c29b10499348eedc038cf61b6d96d5ba0e0d69438975845939ed3c/yarl-1.15.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:a32d58f4b521bb98b2c0aa9da407f8bd57ca81f34362bcb090e4a79e9924fefc", size = 138011, upload-time = "2024-10-13T18:47:25.002Z" }, + { url = "https://files.pythonhosted.org/packages/d4/33/2d4a1418bae6d7883c1fcc493be7b6d6fe015919835adc9e8eeba472e9f7/yarl-1.15.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:766dcc00b943c089349d4060b935c76281f6be225e39994c2ccec3a2a36ad627", size = 89618, upload-time = "2024-10-13T18:47:27.587Z" }, + { url = "https://files.pythonhosted.org/packages/78/2e/0024c674a376cfdc722a167a8f308f5779aca615cb7a28d67fbeabf3f697/yarl-1.15.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:bed1b5dbf90bad3bfc19439258c97873eab453c71d8b6869c136346acfe497e7", size = 87347, upload-time = "2024-10-13T18:47:29.671Z" }, + { url = "https://files.pythonhosted.org/packages/c5/08/a01874dabd4ddf475c5c2adc86f7ac329f83a361ee513a97841720ab7b24/yarl-1.15.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ed20a4bdc635f36cb19e630bfc644181dd075839b6fc84cac51c0f381ac472e2", size = 310438, upload-time = "2024-10-13T18:47:31.577Z" }, + { url = "https://files.pythonhosted.org/packages/09/95/691bc6de2c1b0e9c8bbaa5f8f38118d16896ba1a069a09d1fb073d41a093/yarl-1.15.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d538df442c0d9665664ab6dd5fccd0110fa3b364914f9c85b3ef9b7b2e157980", size = 325384, upload-time = "2024-10-13T18:47:33.587Z" }, + { url = "https://files.pythonhosted.org/packages/95/fd/fee11eb3337f48c62d39c5676e6a0e4e318e318900a901b609a3c45394df/yarl-1.15.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c6cf1d92edf936ceedc7afa61b07e9d78a27b15244aa46bbcd534c7458ee1b", size = 321820, upload-time = "2024-10-13T18:47:35.633Z" }, + { url = "https://files.pythonhosted.org/packages/7a/ad/4a2c9bbebaefdce4a69899132f4bf086abbddb738dc6e794a31193bc0854/yarl-1.15.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ce44217ad99ffad8027d2fde0269ae368c86db66ea0571c62a000798d69401fb", size = 314150, upload-time = "2024-10-13T18:47:37.693Z" }, + { url = "https://files.pythonhosted.org/packages/38/7d/552c37bc6c4ae8ea900e44b6c05cb16d50dca72d3782ccd66f53e27e353f/yarl-1.15.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b47a6000a7e833ebfe5886b56a31cb2ff12120b1efd4578a6fcc38df16cc77bd", size = 304202, upload-time = "2024-10-13T18:47:40.411Z" }, + { url = "https://files.pythonhosted.org/packages/2e/f8/c22a158f3337f49775775ecef43fc097a98b20cdce37425b68b9c45a6f94/yarl-1.15.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:e52f77a0cd246086afde8815039f3e16f8d2be51786c0a39b57104c563c5cbb0", size = 310311, upload-time = "2024-10-13T18:47:43.236Z" }, + { url = "https://files.pythonhosted.org/packages/ce/e4/ebce06afa25c2a6c8e6c9a5915cbbc7940a37f3ec38e950e8f346ca908da/yarl-1.15.2-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:f9ca0e6ce7774dc7830dc0cc4bb6b3eec769db667f230e7c770a628c1aa5681b", size = 310645, upload-time = "2024-10-13T18:47:45.24Z" }, + { url = "https://files.pythonhosted.org/packages/0a/34/5504cc8fbd1be959ec0a1e9e9f471fd438c37cb877b0178ce09085b36b51/yarl-1.15.2-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:136f9db0f53c0206db38b8cd0c985c78ded5fd596c9a86ce5c0b92afb91c3a19", size = 313328, upload-time = "2024-10-13T18:47:47.546Z" }, + { url = "https://files.pythonhosted.org/packages/cf/e4/fb3f91a539c6505e347d7d75bc675d291228960ffd6481ced76a15412924/yarl-1.15.2-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:173866d9f7409c0fb514cf6e78952e65816600cb888c68b37b41147349fe0057", size = 330135, upload-time = "2024-10-13T18:47:50.279Z" }, + { url = "https://files.pythonhosted.org/packages/e1/08/a0b27db813f0159e1c8a45f48852afded501de2f527e7613c4dcf436ecf7/yarl-1.15.2-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:6e840553c9c494a35e449a987ca2c4f8372668ee954a03a9a9685075228e5036", size = 327155, upload-time = "2024-10-13T18:47:52.337Z" }, + { url = "https://files.pythonhosted.org/packages/97/4e/b3414dded12d0e2b52eb1964c21a8d8b68495b320004807de770f7b6b53a/yarl-1.15.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:458c0c65802d816a6b955cf3603186de79e8fdb46d4f19abaec4ef0a906f50a7", size = 320810, upload-time = "2024-10-13T18:47:55.067Z" }, + { url = "https://files.pythonhosted.org/packages/bb/ca/e5149c55d1c9dcf3d5b48acd7c71ca8622fd2f61322d0386fe63ba106774/yarl-1.15.2-cp39-cp39-win32.whl", hash = "sha256:5b48388ded01f6f2429a8c55012bdbd1c2a0c3735b3e73e221649e524c34a58d", size = 78686, upload-time = "2024-10-13T18:47:57Z" }, + { url = "https://files.pythonhosted.org/packages/b1/87/f56a80a1abaf65dbf138b821357b51b6cc061756bb7d93f08797950b3881/yarl-1.15.2-cp39-cp39-win_amd64.whl", hash = "sha256:81dadafb3aa124f86dc267a2168f71bbd2bfb163663661ab0038f6e4b8edb810", size = 84818, upload-time = "2024-10-13T18:47:58.76Z" }, + { url = "https://files.pythonhosted.org/packages/46/cf/a28c494decc9c8776b0d7b729c68d26fdafefcedd8d2eab5d9cd767376b2/yarl-1.15.2-py3-none-any.whl", hash = "sha256:0d3105efab7c5c091609abacad33afff33bdff0035bece164c98bcf5a85ef90a", size = 38891, upload-time = "2024-10-13T18:48:00.883Z" }, +] + +[[package]] +name = "yarl" +version = "1.20.1" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.9'", +] +dependencies = [ + { name = "idna", marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "multidict", version = "6.6.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "propcache", version = "0.3.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/3c/fb/efaa23fa4e45537b827620f04cf8f3cd658b76642205162e072703a5b963/yarl-1.20.1.tar.gz", hash = "sha256:d017a4997ee50c91fd5466cef416231bb82177b93b029906cefc542ce14c35ac", size = 186428, upload-time = "2025-06-10T00:46:09.923Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cb/65/7fed0d774abf47487c64be14e9223749468922817b5e8792b8a64792a1bb/yarl-1.20.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:6032e6da6abd41e4acda34d75a816012717000fa6839f37124a47fcefc49bec4", size = 132910, upload-time = "2025-06-10T00:42:31.108Z" }, + { url = "https://files.pythonhosted.org/packages/8a/7b/988f55a52da99df9e56dc733b8e4e5a6ae2090081dc2754fc8fd34e60aa0/yarl-1.20.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2c7b34d804b8cf9b214f05015c4fee2ebe7ed05cf581e7192c06555c71f4446a", size = 90644, upload-time = "2025-06-10T00:42:33.851Z" }, + { url = "https://files.pythonhosted.org/packages/f7/de/30d98f03e95d30c7e3cc093759982d038c8833ec2451001d45ef4854edc1/yarl-1.20.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0c869f2651cc77465f6cd01d938d91a11d9ea5d798738c1dc077f3de0b5e5fed", size = 89322, upload-time = "2025-06-10T00:42:35.688Z" }, + { url = "https://files.pythonhosted.org/packages/e0/7a/f2f314f5ebfe9200724b0b748de2186b927acb334cf964fd312eb86fc286/yarl-1.20.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:62915e6688eb4d180d93840cda4110995ad50c459bf931b8b3775b37c264af1e", size = 323786, upload-time = "2025-06-10T00:42:37.817Z" }, + { url = "https://files.pythonhosted.org/packages/15/3f/718d26f189db96d993d14b984ce91de52e76309d0fd1d4296f34039856aa/yarl-1.20.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:41ebd28167bc6af8abb97fec1a399f412eec5fd61a3ccbe2305a18b84fb4ca73", size = 319627, upload-time = "2025-06-10T00:42:39.937Z" }, + { url = "https://files.pythonhosted.org/packages/a5/76/8fcfbf5fa2369157b9898962a4a7d96764b287b085b5b3d9ffae69cdefd1/yarl-1.20.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:21242b4288a6d56f04ea193adde174b7e347ac46ce6bc84989ff7c1b1ecea84e", size = 339149, upload-time = "2025-06-10T00:42:42.627Z" }, + { url = "https://files.pythonhosted.org/packages/3c/95/d7fc301cc4661785967acc04f54a4a42d5124905e27db27bb578aac49b5c/yarl-1.20.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bea21cdae6c7eb02ba02a475f37463abfe0a01f5d7200121b03e605d6a0439f8", size = 333327, upload-time = "2025-06-10T00:42:44.842Z" }, + { url = "https://files.pythonhosted.org/packages/65/94/e21269718349582eee81efc5c1c08ee71c816bfc1585b77d0ec3f58089eb/yarl-1.20.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1f8a891e4a22a89f5dde7862994485e19db246b70bb288d3ce73a34422e55b23", size = 326054, upload-time = "2025-06-10T00:42:47.149Z" }, + { url = "https://files.pythonhosted.org/packages/32/ae/8616d1f07853704523519f6131d21f092e567c5af93de7e3e94b38d7f065/yarl-1.20.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dd803820d44c8853a109a34e3660e5a61beae12970da479cf44aa2954019bf70", size = 315035, upload-time = "2025-06-10T00:42:48.852Z" }, + { url = "https://files.pythonhosted.org/packages/48/aa/0ace06280861ef055855333707db5e49c6e3a08840a7ce62682259d0a6c0/yarl-1.20.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:b982fa7f74c80d5c0c7b5b38f908971e513380a10fecea528091405f519b9ebb", size = 338962, upload-time = "2025-06-10T00:42:51.024Z" }, + { url = "https://files.pythonhosted.org/packages/20/52/1e9d0e6916f45a8fb50e6844f01cb34692455f1acd548606cbda8134cd1e/yarl-1.20.1-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:33f29ecfe0330c570d997bcf1afd304377f2e48f61447f37e846a6058a4d33b2", size = 335399, upload-time = "2025-06-10T00:42:53.007Z" }, + { url = "https://files.pythonhosted.org/packages/f2/65/60452df742952c630e82f394cd409de10610481d9043aa14c61bf846b7b1/yarl-1.20.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:835ab2cfc74d5eb4a6a528c57f05688099da41cf4957cf08cad38647e4a83b30", size = 338649, upload-time = "2025-06-10T00:42:54.964Z" }, + { url = "https://files.pythonhosted.org/packages/7b/f5/6cd4ff38dcde57a70f23719a838665ee17079640c77087404c3d34da6727/yarl-1.20.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:46b5e0ccf1943a9a6e766b2c2b8c732c55b34e28be57d8daa2b3c1d1d4009309", size = 358563, upload-time = "2025-06-10T00:42:57.28Z" }, + { url = "https://files.pythonhosted.org/packages/d1/90/c42eefd79d0d8222cb3227bdd51b640c0c1d0aa33fe4cc86c36eccba77d3/yarl-1.20.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:df47c55f7d74127d1b11251fe6397d84afdde0d53b90bedb46a23c0e534f9d24", size = 357609, upload-time = "2025-06-10T00:42:59.055Z" }, + { url = "https://files.pythonhosted.org/packages/03/c8/cea6b232cb4617514232e0f8a718153a95b5d82b5290711b201545825532/yarl-1.20.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:76d12524d05841276b0e22573f28d5fbcb67589836772ae9244d90dd7d66aa13", size = 350224, upload-time = "2025-06-10T00:43:01.248Z" }, + { url = "https://files.pythonhosted.org/packages/ce/a3/eaa0ab9712f1f3d01faf43cf6f1f7210ce4ea4a7e9b28b489a2261ca8db9/yarl-1.20.1-cp310-cp310-win32.whl", hash = "sha256:6c4fbf6b02d70e512d7ade4b1f998f237137f1417ab07ec06358ea04f69134f8", size = 81753, upload-time = "2025-06-10T00:43:03.486Z" }, + { url = "https://files.pythonhosted.org/packages/8f/34/e4abde70a9256465fe31c88ed02c3f8502b7b5dead693a4f350a06413f28/yarl-1.20.1-cp310-cp310-win_amd64.whl", hash = "sha256:aef6c4d69554d44b7f9d923245f8ad9a707d971e6209d51279196d8e8fe1ae16", size = 86817, upload-time = "2025-06-10T00:43:05.231Z" }, + { url = "https://files.pythonhosted.org/packages/b1/18/893b50efc2350e47a874c5c2d67e55a0ea5df91186b2a6f5ac52eff887cd/yarl-1.20.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:47ee6188fea634bdfaeb2cc420f5b3b17332e6225ce88149a17c413c77ff269e", size = 133833, upload-time = "2025-06-10T00:43:07.393Z" }, + { url = "https://files.pythonhosted.org/packages/89/ed/b8773448030e6fc47fa797f099ab9eab151a43a25717f9ac043844ad5ea3/yarl-1.20.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d0f6500f69e8402d513e5eedb77a4e1818691e8f45e6b687147963514d84b44b", size = 91070, upload-time = "2025-06-10T00:43:09.538Z" }, + { url = "https://files.pythonhosted.org/packages/e3/e3/409bd17b1e42619bf69f60e4f031ce1ccb29bd7380117a55529e76933464/yarl-1.20.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7a8900a42fcdaad568de58887c7b2f602962356908eedb7628eaf6021a6e435b", size = 89818, upload-time = "2025-06-10T00:43:11.575Z" }, + { url = "https://files.pythonhosted.org/packages/f8/77/64d8431a4d77c856eb2d82aa3de2ad6741365245a29b3a9543cd598ed8c5/yarl-1.20.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bad6d131fda8ef508b36be3ece16d0902e80b88ea7200f030a0f6c11d9e508d4", size = 347003, upload-time = "2025-06-10T00:43:14.088Z" }, + { url = "https://files.pythonhosted.org/packages/8d/d2/0c7e4def093dcef0bd9fa22d4d24b023788b0a33b8d0088b51aa51e21e99/yarl-1.20.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:df018d92fe22aaebb679a7f89fe0c0f368ec497e3dda6cb81a567610f04501f1", size = 336537, upload-time = "2025-06-10T00:43:16.431Z" }, + { url = "https://files.pythonhosted.org/packages/f0/f3/fc514f4b2cf02cb59d10cbfe228691d25929ce8f72a38db07d3febc3f706/yarl-1.20.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8f969afbb0a9b63c18d0feecf0db09d164b7a44a053e78a7d05f5df163e43833", size = 362358, upload-time = "2025-06-10T00:43:18.704Z" }, + { url = "https://files.pythonhosted.org/packages/ea/6d/a313ac8d8391381ff9006ac05f1d4331cee3b1efaa833a53d12253733255/yarl-1.20.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:812303eb4aa98e302886ccda58d6b099e3576b1b9276161469c25803a8db277d", size = 357362, upload-time = "2025-06-10T00:43:20.888Z" }, + { url = "https://files.pythonhosted.org/packages/00/70/8f78a95d6935a70263d46caa3dd18e1f223cf2f2ff2037baa01a22bc5b22/yarl-1.20.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:98c4a7d166635147924aa0bf9bfe8d8abad6fffa6102de9c99ea04a1376f91e8", size = 348979, upload-time = "2025-06-10T00:43:23.169Z" }, + { url = "https://files.pythonhosted.org/packages/cb/05/42773027968968f4f15143553970ee36ead27038d627f457cc44bbbeecf3/yarl-1.20.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:12e768f966538e81e6e7550f9086a6236b16e26cd964cf4df35349970f3551cf", size = 337274, upload-time = "2025-06-10T00:43:27.111Z" }, + { url = "https://files.pythonhosted.org/packages/05/be/665634aa196954156741ea591d2f946f1b78ceee8bb8f28488bf28c0dd62/yarl-1.20.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:fe41919b9d899661c5c28a8b4b0acf704510b88f27f0934ac7a7bebdd8938d5e", size = 363294, upload-time = "2025-06-10T00:43:28.96Z" }, + { url = "https://files.pythonhosted.org/packages/eb/90/73448401d36fa4e210ece5579895731f190d5119c4b66b43b52182e88cd5/yarl-1.20.1-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:8601bc010d1d7780592f3fc1bdc6c72e2b6466ea34569778422943e1a1f3c389", size = 358169, upload-time = "2025-06-10T00:43:30.701Z" }, + { url = "https://files.pythonhosted.org/packages/c3/b0/fce922d46dc1eb43c811f1889f7daa6001b27a4005587e94878570300881/yarl-1.20.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:daadbdc1f2a9033a2399c42646fbd46da7992e868a5fe9513860122d7fe7a73f", size = 362776, upload-time = "2025-06-10T00:43:32.51Z" }, + { url = "https://files.pythonhosted.org/packages/f1/0d/b172628fce039dae8977fd22caeff3eeebffd52e86060413f5673767c427/yarl-1.20.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:03aa1e041727cb438ca762628109ef1333498b122e4c76dd858d186a37cec845", size = 381341, upload-time = "2025-06-10T00:43:34.543Z" }, + { url = "https://files.pythonhosted.org/packages/6b/9b/5b886d7671f4580209e855974fe1cecec409aa4a89ea58b8f0560dc529b1/yarl-1.20.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:642980ef5e0fa1de5fa96d905c7e00cb2c47cb468bfcac5a18c58e27dbf8d8d1", size = 379988, upload-time = "2025-06-10T00:43:36.489Z" }, + { url = "https://files.pythonhosted.org/packages/73/be/75ef5fd0fcd8f083a5d13f78fd3f009528132a1f2a1d7c925c39fa20aa79/yarl-1.20.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:86971e2795584fe8c002356d3b97ef6c61862720eeff03db2a7c86b678d85b3e", size = 371113, upload-time = "2025-06-10T00:43:38.592Z" }, + { url = "https://files.pythonhosted.org/packages/50/4f/62faab3b479dfdcb741fe9e3f0323e2a7d5cd1ab2edc73221d57ad4834b2/yarl-1.20.1-cp311-cp311-win32.whl", hash = "sha256:597f40615b8d25812f14562699e287f0dcc035d25eb74da72cae043bb884d773", size = 81485, upload-time = "2025-06-10T00:43:41.038Z" }, + { url = "https://files.pythonhosted.org/packages/f0/09/d9c7942f8f05c32ec72cd5c8e041c8b29b5807328b68b4801ff2511d4d5e/yarl-1.20.1-cp311-cp311-win_amd64.whl", hash = "sha256:26ef53a9e726e61e9cd1cda6b478f17e350fb5800b4bd1cd9fe81c4d91cfeb2e", size = 86686, upload-time = "2025-06-10T00:43:42.692Z" }, + { url = "https://files.pythonhosted.org/packages/5f/9a/cb7fad7d73c69f296eda6815e4a2c7ed53fc70c2f136479a91c8e5fbdb6d/yarl-1.20.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:bdcc4cd244e58593a4379fe60fdee5ac0331f8eb70320a24d591a3be197b94a9", size = 133667, upload-time = "2025-06-10T00:43:44.369Z" }, + { url = "https://files.pythonhosted.org/packages/67/38/688577a1cb1e656e3971fb66a3492501c5a5df56d99722e57c98249e5b8a/yarl-1.20.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b29a2c385a5f5b9c7d9347e5812b6f7ab267193c62d282a540b4fc528c8a9d2a", size = 91025, upload-time = "2025-06-10T00:43:46.295Z" }, + { url = "https://files.pythonhosted.org/packages/50/ec/72991ae51febeb11a42813fc259f0d4c8e0507f2b74b5514618d8b640365/yarl-1.20.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1112ae8154186dfe2de4732197f59c05a83dc814849a5ced892b708033f40dc2", size = 89709, upload-time = "2025-06-10T00:43:48.22Z" }, + { url = "https://files.pythonhosted.org/packages/99/da/4d798025490e89426e9f976702e5f9482005c548c579bdae792a4c37769e/yarl-1.20.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:90bbd29c4fe234233f7fa2b9b121fb63c321830e5d05b45153a2ca68f7d310ee", size = 352287, upload-time = "2025-06-10T00:43:49.924Z" }, + { url = "https://files.pythonhosted.org/packages/1a/26/54a15c6a567aac1c61b18aa0f4b8aa2e285a52d547d1be8bf48abe2b3991/yarl-1.20.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:680e19c7ce3710ac4cd964e90dad99bf9b5029372ba0c7cbfcd55e54d90ea819", size = 345429, upload-time = "2025-06-10T00:43:51.7Z" }, + { url = "https://files.pythonhosted.org/packages/d6/95/9dcf2386cb875b234353b93ec43e40219e14900e046bf6ac118f94b1e353/yarl-1.20.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4a979218c1fdb4246a05efc2cc23859d47c89af463a90b99b7c56094daf25a16", size = 365429, upload-time = "2025-06-10T00:43:53.494Z" }, + { url = "https://files.pythonhosted.org/packages/91/b2/33a8750f6a4bc224242a635f5f2cff6d6ad5ba651f6edcccf721992c21a0/yarl-1.20.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:255b468adf57b4a7b65d8aad5b5138dce6a0752c139965711bdcb81bc370e1b6", size = 363862, upload-time = "2025-06-10T00:43:55.766Z" }, + { url = "https://files.pythonhosted.org/packages/98/28/3ab7acc5b51f4434b181b0cee8f1f4b77a65919700a355fb3617f9488874/yarl-1.20.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a97d67108e79cfe22e2b430d80d7571ae57d19f17cda8bb967057ca8a7bf5bfd", size = 355616, upload-time = "2025-06-10T00:43:58.056Z" }, + { url = "https://files.pythonhosted.org/packages/36/a3/f666894aa947a371724ec7cd2e5daa78ee8a777b21509b4252dd7bd15e29/yarl-1.20.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8570d998db4ddbfb9a590b185a0a33dbf8aafb831d07a5257b4ec9948df9cb0a", size = 339954, upload-time = "2025-06-10T00:43:59.773Z" }, + { url = "https://files.pythonhosted.org/packages/f1/81/5f466427e09773c04219d3450d7a1256138a010b6c9f0af2d48565e9ad13/yarl-1.20.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:97c75596019baae7c71ccf1d8cc4738bc08134060d0adfcbe5642f778d1dca38", size = 365575, upload-time = "2025-06-10T00:44:02.051Z" }, + { url = "https://files.pythonhosted.org/packages/2e/e3/e4b0ad8403e97e6c9972dd587388940a032f030ebec196ab81a3b8e94d31/yarl-1.20.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:1c48912653e63aef91ff988c5432832692ac5a1d8f0fb8a33091520b5bbe19ef", size = 365061, upload-time = "2025-06-10T00:44:04.196Z" }, + { url = "https://files.pythonhosted.org/packages/ac/99/b8a142e79eb86c926f9f06452eb13ecb1bb5713bd01dc0038faf5452e544/yarl-1.20.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:4c3ae28f3ae1563c50f3d37f064ddb1511ecc1d5584e88c6b7c63cf7702a6d5f", size = 364142, upload-time = "2025-06-10T00:44:06.527Z" }, + { url = "https://files.pythonhosted.org/packages/34/f2/08ed34a4a506d82a1a3e5bab99ccd930a040f9b6449e9fd050320e45845c/yarl-1.20.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:c5e9642f27036283550f5f57dc6156c51084b458570b9d0d96100c8bebb186a8", size = 381894, upload-time = "2025-06-10T00:44:08.379Z" }, + { url = "https://files.pythonhosted.org/packages/92/f8/9a3fbf0968eac704f681726eff595dce9b49c8a25cd92bf83df209668285/yarl-1.20.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:2c26b0c49220d5799f7b22c6838409ee9bc58ee5c95361a4d7831f03cc225b5a", size = 383378, upload-time = "2025-06-10T00:44:10.51Z" }, + { url = "https://files.pythonhosted.org/packages/af/85/9363f77bdfa1e4d690957cd39d192c4cacd1c58965df0470a4905253b54f/yarl-1.20.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:564ab3d517e3d01c408c67f2e5247aad4019dcf1969982aba3974b4093279004", size = 374069, upload-time = "2025-06-10T00:44:12.834Z" }, + { url = "https://files.pythonhosted.org/packages/35/99/9918c8739ba271dcd935400cff8b32e3cd319eaf02fcd023d5dcd487a7c8/yarl-1.20.1-cp312-cp312-win32.whl", hash = "sha256:daea0d313868da1cf2fac6b2d3a25c6e3a9e879483244be38c8e6a41f1d876a5", size = 81249, upload-time = "2025-06-10T00:44:14.731Z" }, + { url = "https://files.pythonhosted.org/packages/eb/83/5d9092950565481b413b31a23e75dd3418ff0a277d6e0abf3729d4d1ce25/yarl-1.20.1-cp312-cp312-win_amd64.whl", hash = "sha256:48ea7d7f9be0487339828a4de0360d7ce0efc06524a48e1810f945c45b813698", size = 86710, upload-time = "2025-06-10T00:44:16.716Z" }, + { url = "https://files.pythonhosted.org/packages/8a/e1/2411b6d7f769a07687acee88a062af5833cf1966b7266f3d8dfb3d3dc7d3/yarl-1.20.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:0b5ff0fbb7c9f1b1b5ab53330acbfc5247893069e7716840c8e7d5bb7355038a", size = 131811, upload-time = "2025-06-10T00:44:18.933Z" }, + { url = "https://files.pythonhosted.org/packages/b2/27/584394e1cb76fb771371770eccad35de400e7b434ce3142c2dd27392c968/yarl-1.20.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:14f326acd845c2b2e2eb38fb1346c94f7f3b01a4f5c788f8144f9b630bfff9a3", size = 90078, upload-time = "2025-06-10T00:44:20.635Z" }, + { url = "https://files.pythonhosted.org/packages/bf/9a/3246ae92d4049099f52d9b0fe3486e3b500e29b7ea872d0f152966fc209d/yarl-1.20.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f60e4ad5db23f0b96e49c018596707c3ae89f5d0bd97f0ad3684bcbad899f1e7", size = 88748, upload-time = "2025-06-10T00:44:22.34Z" }, + { url = "https://files.pythonhosted.org/packages/a3/25/35afe384e31115a1a801fbcf84012d7a066d89035befae7c5d4284df1e03/yarl-1.20.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:49bdd1b8e00ce57e68ba51916e4bb04461746e794e7c4d4bbc42ba2f18297691", size = 349595, upload-time = "2025-06-10T00:44:24.314Z" }, + { url = "https://files.pythonhosted.org/packages/28/2d/8aca6cb2cabc8f12efcb82749b9cefecbccfc7b0384e56cd71058ccee433/yarl-1.20.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:66252d780b45189975abfed839616e8fd2dbacbdc262105ad7742c6ae58f3e31", size = 342616, upload-time = "2025-06-10T00:44:26.167Z" }, + { url = "https://files.pythonhosted.org/packages/0b/e9/1312633d16b31acf0098d30440ca855e3492d66623dafb8e25b03d00c3da/yarl-1.20.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:59174e7332f5d153d8f7452a102b103e2e74035ad085f404df2e40e663a22b28", size = 361324, upload-time = "2025-06-10T00:44:27.915Z" }, + { url = "https://files.pythonhosted.org/packages/bc/a0/688cc99463f12f7669eec7c8acc71ef56a1521b99eab7cd3abb75af887b0/yarl-1.20.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e3968ec7d92a0c0f9ac34d5ecfd03869ec0cab0697c91a45db3fbbd95fe1b653", size = 359676, upload-time = "2025-06-10T00:44:30.041Z" }, + { url = "https://files.pythonhosted.org/packages/af/44/46407d7f7a56e9a85a4c207724c9f2c545c060380718eea9088f222ba697/yarl-1.20.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d1a4fbb50e14396ba3d375f68bfe02215d8e7bc3ec49da8341fe3157f59d2ff5", size = 352614, upload-time = "2025-06-10T00:44:32.171Z" }, + { url = "https://files.pythonhosted.org/packages/b1/91/31163295e82b8d5485d31d9cf7754d973d41915cadce070491778d9c9825/yarl-1.20.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:11a62c839c3a8eac2410e951301309426f368388ff2f33799052787035793b02", size = 336766, upload-time = "2025-06-10T00:44:34.494Z" }, + { url = "https://files.pythonhosted.org/packages/b4/8e/c41a5bc482121f51c083c4c2bcd16b9e01e1cf8729e380273a952513a21f/yarl-1.20.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:041eaa14f73ff5a8986b4388ac6bb43a77f2ea09bf1913df7a35d4646db69e53", size = 364615, upload-time = "2025-06-10T00:44:36.856Z" }, + { url = "https://files.pythonhosted.org/packages/e3/5b/61a3b054238d33d70ea06ebba7e58597891b71c699e247df35cc984ab393/yarl-1.20.1-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:377fae2fef158e8fd9d60b4c8751387b8d1fb121d3d0b8e9b0be07d1b41e83dc", size = 360982, upload-time = "2025-06-10T00:44:39.141Z" }, + { url = "https://files.pythonhosted.org/packages/df/a3/6a72fb83f8d478cb201d14927bc8040af901811a88e0ff2da7842dd0ed19/yarl-1.20.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:1c92f4390e407513f619d49319023664643d3339bd5e5a56a3bebe01bc67ec04", size = 369792, upload-time = "2025-06-10T00:44:40.934Z" }, + { url = "https://files.pythonhosted.org/packages/7c/af/4cc3c36dfc7c077f8dedb561eb21f69e1e9f2456b91b593882b0b18c19dc/yarl-1.20.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:d25ddcf954df1754ab0f86bb696af765c5bfaba39b74095f27eececa049ef9a4", size = 382049, upload-time = "2025-06-10T00:44:42.854Z" }, + { url = "https://files.pythonhosted.org/packages/19/3a/e54e2c4752160115183a66dc9ee75a153f81f3ab2ba4bf79c3c53b33de34/yarl-1.20.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:909313577e9619dcff8c31a0ea2aa0a2a828341d92673015456b3ae492e7317b", size = 384774, upload-time = "2025-06-10T00:44:45.275Z" }, + { url = "https://files.pythonhosted.org/packages/9c/20/200ae86dabfca89060ec6447649f219b4cbd94531e425e50d57e5f5ac330/yarl-1.20.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:793fd0580cb9664548c6b83c63b43c477212c0260891ddf86809e1c06c8b08f1", size = 374252, upload-time = "2025-06-10T00:44:47.31Z" }, + { url = "https://files.pythonhosted.org/packages/83/75/11ee332f2f516b3d094e89448da73d557687f7d137d5a0f48c40ff211487/yarl-1.20.1-cp313-cp313-win32.whl", hash = "sha256:468f6e40285de5a5b3c44981ca3a319a4b208ccc07d526b20b12aeedcfa654b7", size = 81198, upload-time = "2025-06-10T00:44:49.164Z" }, + { url = "https://files.pythonhosted.org/packages/ba/ba/39b1ecbf51620b40ab402b0fc817f0ff750f6d92712b44689c2c215be89d/yarl-1.20.1-cp313-cp313-win_amd64.whl", hash = "sha256:495b4ef2fea40596bfc0affe3837411d6aa3371abcf31aac0ccc4bdd64d4ef5c", size = 86346, upload-time = "2025-06-10T00:44:51.182Z" }, + { url = "https://files.pythonhosted.org/packages/43/c7/669c52519dca4c95153c8ad96dd123c79f354a376346b198f438e56ffeb4/yarl-1.20.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:f60233b98423aab21d249a30eb27c389c14929f47be8430efa7dbd91493a729d", size = 138826, upload-time = "2025-06-10T00:44:52.883Z" }, + { url = "https://files.pythonhosted.org/packages/6a/42/fc0053719b44f6ad04a75d7f05e0e9674d45ef62f2d9ad2c1163e5c05827/yarl-1.20.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:6f3eff4cc3f03d650d8755c6eefc844edde99d641d0dcf4da3ab27141a5f8ddf", size = 93217, upload-time = "2025-06-10T00:44:54.658Z" }, + { url = "https://files.pythonhosted.org/packages/4f/7f/fa59c4c27e2a076bba0d959386e26eba77eb52ea4a0aac48e3515c186b4c/yarl-1.20.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:69ff8439d8ba832d6bed88af2c2b3445977eba9a4588b787b32945871c2444e3", size = 92700, upload-time = "2025-06-10T00:44:56.784Z" }, + { url = "https://files.pythonhosted.org/packages/2f/d4/062b2f48e7c93481e88eff97a6312dca15ea200e959f23e96d8ab898c5b8/yarl-1.20.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3cf34efa60eb81dd2645a2e13e00bb98b76c35ab5061a3989c7a70f78c85006d", size = 347644, upload-time = "2025-06-10T00:44:59.071Z" }, + { url = "https://files.pythonhosted.org/packages/89/47/78b7f40d13c8f62b499cc702fdf69e090455518ae544c00a3bf4afc9fc77/yarl-1.20.1-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:8e0fe9364ad0fddab2688ce72cb7a8e61ea42eff3c7caeeb83874a5d479c896c", size = 323452, upload-time = "2025-06-10T00:45:01.605Z" }, + { url = "https://files.pythonhosted.org/packages/eb/2b/490d3b2dc66f52987d4ee0d3090a147ea67732ce6b4d61e362c1846d0d32/yarl-1.20.1-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8f64fbf81878ba914562c672024089e3401974a39767747691c65080a67b18c1", size = 346378, upload-time = "2025-06-10T00:45:03.946Z" }, + { url = "https://files.pythonhosted.org/packages/66/ad/775da9c8a94ce925d1537f939a4f17d782efef1f973039d821cbe4bcc211/yarl-1.20.1-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f6342d643bf9a1de97e512e45e4b9560a043347e779a173250824f8b254bd5ce", size = 353261, upload-time = "2025-06-10T00:45:05.992Z" }, + { url = "https://files.pythonhosted.org/packages/4b/23/0ed0922b47a4f5c6eb9065d5ff1e459747226ddce5c6a4c111e728c9f701/yarl-1.20.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:56dac5f452ed25eef0f6e3c6a066c6ab68971d96a9fb441791cad0efba6140d3", size = 335987, upload-time = "2025-06-10T00:45:08.227Z" }, + { url = "https://files.pythonhosted.org/packages/3e/49/bc728a7fe7d0e9336e2b78f0958a2d6b288ba89f25a1762407a222bf53c3/yarl-1.20.1-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c7d7f497126d65e2cad8dc5f97d34c27b19199b6414a40cb36b52f41b79014be", size = 329361, upload-time = "2025-06-10T00:45:10.11Z" }, + { url = "https://files.pythonhosted.org/packages/93/8f/b811b9d1f617c83c907e7082a76e2b92b655400e61730cd61a1f67178393/yarl-1.20.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:67e708dfb8e78d8a19169818eeb5c7a80717562de9051bf2413aca8e3696bf16", size = 346460, upload-time = "2025-06-10T00:45:12.055Z" }, + { url = "https://files.pythonhosted.org/packages/70/fd/af94f04f275f95da2c3b8b5e1d49e3e79f1ed8b6ceb0f1664cbd902773ff/yarl-1.20.1-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:595c07bc79af2494365cc96ddeb772f76272364ef7c80fb892ef9d0649586513", size = 334486, upload-time = "2025-06-10T00:45:13.995Z" }, + { url = "https://files.pythonhosted.org/packages/84/65/04c62e82704e7dd0a9b3f61dbaa8447f8507655fd16c51da0637b39b2910/yarl-1.20.1-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:7bdd2f80f4a7df852ab9ab49484a4dee8030023aa536df41f2d922fd57bf023f", size = 342219, upload-time = "2025-06-10T00:45:16.479Z" }, + { url = "https://files.pythonhosted.org/packages/91/95/459ca62eb958381b342d94ab9a4b6aec1ddec1f7057c487e926f03c06d30/yarl-1.20.1-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:c03bfebc4ae8d862f853a9757199677ab74ec25424d0ebd68a0027e9c639a390", size = 350693, upload-time = "2025-06-10T00:45:18.399Z" }, + { url = "https://files.pythonhosted.org/packages/a6/00/d393e82dd955ad20617abc546a8f1aee40534d599ff555ea053d0ec9bf03/yarl-1.20.1-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:344d1103e9c1523f32a5ed704d576172d2cabed3122ea90b1d4e11fe17c66458", size = 355803, upload-time = "2025-06-10T00:45:20.677Z" }, + { url = "https://files.pythonhosted.org/packages/9e/ed/c5fb04869b99b717985e244fd93029c7a8e8febdfcffa06093e32d7d44e7/yarl-1.20.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:88cab98aa4e13e1ade8c141daeedd300a4603b7132819c484841bb7af3edce9e", size = 341709, upload-time = "2025-06-10T00:45:23.221Z" }, + { url = "https://files.pythonhosted.org/packages/24/fd/725b8e73ac2a50e78a4534ac43c6addf5c1c2d65380dd48a9169cc6739a9/yarl-1.20.1-cp313-cp313t-win32.whl", hash = "sha256:b121ff6a7cbd4abc28985b6028235491941b9fe8fe226e6fdc539c977ea1739d", size = 86591, upload-time = "2025-06-10T00:45:25.793Z" }, + { url = "https://files.pythonhosted.org/packages/94/c3/b2e9f38bc3e11191981d57ea08cab2166e74ea770024a646617c9cddd9f6/yarl-1.20.1-cp313-cp313t-win_amd64.whl", hash = "sha256:541d050a355bbbc27e55d906bc91cb6fe42f96c01413dd0f4ed5a5240513874f", size = 93003, upload-time = "2025-06-10T00:45:27.752Z" }, + { url = "https://files.pythonhosted.org/packages/01/75/0d37402d208d025afa6b5b8eb80e466d267d3fd1927db8e317d29a94a4cb/yarl-1.20.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:e42ba79e2efb6845ebab49c7bf20306c4edf74a0b20fc6b2ccdd1a219d12fad3", size = 134259, upload-time = "2025-06-10T00:45:29.882Z" }, + { url = "https://files.pythonhosted.org/packages/73/84/1fb6c85ae0cf9901046f07d0ac9eb162f7ce6d95db541130aa542ed377e6/yarl-1.20.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:41493b9b7c312ac448b7f0a42a089dffe1d6e6e981a2d76205801a023ed26a2b", size = 91269, upload-time = "2025-06-10T00:45:32.917Z" }, + { url = "https://files.pythonhosted.org/packages/f3/9c/eae746b24c4ea29a5accba9a06c197a70fa38a49c7df244e0d3951108861/yarl-1.20.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f5a5928ff5eb13408c62a968ac90d43f8322fd56d87008b8f9dabf3c0f6ee983", size = 89995, upload-time = "2025-06-10T00:45:35.066Z" }, + { url = "https://files.pythonhosted.org/packages/fb/30/693e71003ec4bc1daf2e4cf7c478c417d0985e0a8e8f00b2230d517876fc/yarl-1.20.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:30c41ad5d717b3961b2dd785593b67d386b73feca30522048d37298fee981805", size = 325253, upload-time = "2025-06-10T00:45:37.052Z" }, + { url = "https://files.pythonhosted.org/packages/0f/a2/5264dbebf90763139aeb0b0b3154763239398400f754ae19a0518b654117/yarl-1.20.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:59febc3969b0781682b469d4aca1a5cab7505a4f7b85acf6db01fa500fa3f6ba", size = 320897, upload-time = "2025-06-10T00:45:39.962Z" }, + { url = "https://files.pythonhosted.org/packages/e7/17/77c7a89b3c05856489777e922f41db79ab4faf58621886df40d812c7facd/yarl-1.20.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d2b6fb3622b7e5bf7a6e5b679a69326b4279e805ed1699d749739a61d242449e", size = 340696, upload-time = "2025-06-10T00:45:41.915Z" }, + { url = "https://files.pythonhosted.org/packages/6d/55/28409330b8ef5f2f681f5b478150496ec9cf3309b149dab7ec8ab5cfa3f0/yarl-1.20.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:749d73611db8d26a6281086f859ea7ec08f9c4c56cec864e52028c8b328db723", size = 335064, upload-time = "2025-06-10T00:45:43.893Z" }, + { url = "https://files.pythonhosted.org/packages/85/58/cb0257cbd4002828ff735f44d3c5b6966c4fd1fc8cc1cd3cd8a143fbc513/yarl-1.20.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9427925776096e664c39e131447aa20ec738bdd77c049c48ea5200db2237e000", size = 327256, upload-time = "2025-06-10T00:45:46.393Z" }, + { url = "https://files.pythonhosted.org/packages/53/f6/c77960370cfa46f6fb3d6a5a79a49d3abfdb9ef92556badc2dcd2748bc2a/yarl-1.20.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ff70f32aa316393eaf8222d518ce9118148eddb8a53073c2403863b41033eed5", size = 316389, upload-time = "2025-06-10T00:45:48.358Z" }, + { url = "https://files.pythonhosted.org/packages/64/ab/be0b10b8e029553c10905b6b00c64ecad3ebc8ace44b02293a62579343f6/yarl-1.20.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:c7ddf7a09f38667aea38801da8b8d6bfe81df767d9dfc8c88eb45827b195cd1c", size = 340481, upload-time = "2025-06-10T00:45:50.663Z" }, + { url = "https://files.pythonhosted.org/packages/c5/c3/3f327bd3905a4916029bf5feb7f86dcf864c7704f099715f62155fb386b2/yarl-1.20.1-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:57edc88517d7fc62b174fcfb2e939fbc486a68315d648d7e74d07fac42cec240", size = 336941, upload-time = "2025-06-10T00:45:52.554Z" }, + { url = "https://files.pythonhosted.org/packages/d1/42/040bdd5d3b3bb02b4a6ace4ed4075e02f85df964d6e6cb321795d2a6496a/yarl-1.20.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:dab096ce479d5894d62c26ff4f699ec9072269d514b4edd630a393223f45a0ee", size = 339936, upload-time = "2025-06-10T00:45:54.919Z" }, + { url = "https://files.pythonhosted.org/packages/0d/1c/911867b8e8c7463b84dfdc275e0d99b04b66ad5132b503f184fe76be8ea4/yarl-1.20.1-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:14a85f3bd2d7bb255be7183e5d7d6e70add151a98edf56a770d6140f5d5f4010", size = 360163, upload-time = "2025-06-10T00:45:56.87Z" }, + { url = "https://files.pythonhosted.org/packages/e2/31/8c389f6c6ca0379b57b2da87f1f126c834777b4931c5ee8427dd65d0ff6b/yarl-1.20.1-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:2c89b5c792685dd9cd3fa9761c1b9f46fc240c2a3265483acc1565769996a3f8", size = 359108, upload-time = "2025-06-10T00:45:58.869Z" }, + { url = "https://files.pythonhosted.org/packages/7f/09/ae4a649fb3964324c70a3e2b61f45e566d9ffc0affd2b974cbf628957673/yarl-1.20.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:69e9b141de5511021942a6866990aea6d111c9042235de90e08f94cf972ca03d", size = 351875, upload-time = "2025-06-10T00:46:01.45Z" }, + { url = "https://files.pythonhosted.org/packages/8d/43/bbb4ed4c34d5bb62b48bf957f68cd43f736f79059d4f85225ab1ef80f4b9/yarl-1.20.1-cp39-cp39-win32.whl", hash = "sha256:b5f307337819cdfdbb40193cad84978a029f847b0a357fbe49f712063cfc4f06", size = 82293, upload-time = "2025-06-10T00:46:03.763Z" }, + { url = "https://files.pythonhosted.org/packages/d7/cd/ce185848a7dba68ea69e932674b5c1a42a1852123584bccc5443120f857c/yarl-1.20.1-cp39-cp39-win_amd64.whl", hash = "sha256:eae7bfe2069f9c1c5b05fc7fe5d612e5bbc089a39309904ee8b829e322dcad00", size = 87385, upload-time = "2025-06-10T00:46:05.655Z" }, + { url = "https://files.pythonhosted.org/packages/b4/2d/2345fce04cfd4bee161bf1e7d9cdc702e3e16109021035dbb24db654a622/yarl-1.20.1-py3-none-any.whl", hash = "sha256:83b8eb083fe4683c6115795d9fc1cfaf2cbbefb19b3a1cb68f6527460f483a77", size = 46542, upload-time = "2025-06-10T00:46:07.521Z" }, +] + +[[package]] +name = "zipp" +version = "3.20.2" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.9'", +] +sdist = { url = "https://files.pythonhosted.org/packages/54/bf/5c0000c44ebc80123ecbdddba1f5dcd94a5ada602a9c225d84b5aaa55e86/zipp-3.20.2.tar.gz", hash = "sha256:bc9eb26f4506fda01b81bcde0ca78103b6e62f991b381fec825435c836edbc29", size = 24199, upload-time = "2024-09-13T13:44:16.101Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/62/8b/5ba542fa83c90e09eac972fc9baca7a88e7e7ca4b221a89251954019308b/zipp-3.20.2-py3-none-any.whl", hash = "sha256:a817ac80d6cf4b23bf7f2828b7cabf326f15a001bea8b1f9b49631780ba28350", size = 9200, upload-time = "2024-09-13T13:44:14.38Z" }, +] + +[[package]] +name = "zipp" +version = "3.21.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.9'", +] +sdist = { url = "https://files.pythonhosted.org/packages/3f/50/bad581df71744867e9468ebd0bcd6505de3b275e06f202c2cb016e3ff56f/zipp-3.21.0.tar.gz", hash = "sha256:2c9958f6430a2040341a52eb608ed6dd93ef4392e02ffe219417c1b28b5dd1f4", size = 24545, upload-time = "2024-11-10T15:05:20.202Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b7/1a/7e4798e9339adc931158c9d69ecc34f5e6791489d469f5e50ec15e35f458/zipp-3.21.0-py3-none-any.whl", hash = "sha256:ac1bbe05fd2991f160ebce24ffbac5f6d11d83dc90891255885223d42b3cd931", size = 9630, upload-time = "2024-11-10T15:05:19.275Z" }, +] From 3672172d0140ead1c4b3eadb19bb6b0326107aac Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Sep 2025 17:28:35 +0000 Subject: [PATCH 869/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2b417b30d..f7e971ead 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.60.1" + ".": "0.61.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 4754b5c31..a521f1874 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.60.1" +version = "0.61.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 1867701a4..16da2086a 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.60.1" # x-release-please-version +__version__ = "0.61.0" # x-release-please-version diff --git a/uv.lock b/uv.lock index a0d75fc8b..5957a8d79 100644 --- a/uv.lock +++ b/uv.lock @@ -1771,7 +1771,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "0.60.1" +version = "0.61.0" source = { editable = "." } dependencies = [ { name = "anyio", version = "4.5.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, From ea48d50866ae80d6a959c56eaf8a31e6c32c6bd3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Oct 2025 20:07:05 +0000 Subject: [PATCH 870/993] feat(api): api update --- .stats.yml | 8 +- api.md | 3 + .../resources/blueprints.py | 91 +++---------- .../resources/repositories.py | 128 +++++++++++++++++- src/runloop_api_client/types/__init__.py | 2 + .../types/blueprint_create_params.py | 72 ++-------- .../types/inspection_source_param.py | 16 +++ .../types/repository_inspect_params.py | 16 +++ tests/api_resources/test_blueprints.py | 64 ++------- tests/api_resources/test_repositories.py | 95 +++++++++++++ 10 files changed, 305 insertions(+), 190 deletions(-) create mode 100644 src/runloop_api_client/types/inspection_source_param.py create mode 100644 src/runloop_api_client/types/repository_inspect_params.py diff --git a/.stats.yml b/.stats.yml index be3e247e2..f933e2cc8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 90 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-9b2e136aedff0713e8d50d6c53a930cd2c3583dcac1a9fce552cf25bb0d29214.yml -openapi_spec_hash: 81e1da702f2dfb28bbe1bfab0d5d8cbd -config_hash: 5b2602a56850cf0d0e50da298d1c6916 +configured_endpoints: 91 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-034d0b86510db8b712b55ac88c1c4a322db2ce84edc632f6d27be1eb4f34fd37.yml +openapi_spec_hash: 0485ec0d01253b2c1bdab3015370808e +config_hash: 35e129f39a0c1fd38209b0dafb7c7562 diff --git a/api.md b/api.md index f9eb24816..55ae37b26 100644 --- a/api.md +++ b/api.md @@ -45,12 +45,14 @@ Types: ```python from runloop_api_client.types import ( + BlueprintBuildFromInspectionParameters, BlueprintBuildLog, BlueprintBuildLogsListView, BlueprintBuildParameters, BlueprintListView, BlueprintPreviewView, BlueprintView, + InspectionSource, ) ``` @@ -295,6 +297,7 @@ Methods: - client.repositories.retrieve(id) -> RepositoryConnectionView - client.repositories.list(\*\*params) -> SyncRepositoriesCursorIDPage[RepositoryConnectionView] - client.repositories.delete(id) -> object +- client.repositories.inspect(id, \*\*params) -> RepositoryInspectionDetails - client.repositories.list_inspections(id) -> RepositoryInspectionListView - client.repositories.refresh(id, \*\*params) -> object diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index 2e429ed10..f767f202d 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -26,6 +26,7 @@ from .._base_client import AsyncPaginator, make_request_options from ..types.blueprint_view import BlueprintView from ..types.blueprint_preview_view import BlueprintPreviewView +from ..types.inspection_source_param import InspectionSourceParam from ..types.blueprint_build_logs_list_view import BlueprintBuildLogsListView from ..types.shared_params.launch_parameters import LaunchParameters from ..types.shared_params.code_mount_parameters import CodeMountParameters @@ -56,16 +57,11 @@ def with_streaming_response(self) -> BlueprintsResourceWithStreamingResponse: def create( self, *, + inspection_source: InspectionSourceParam, name: str, - base_blueprint_id: Optional[str] | Omit = omit, - base_blueprint_name: Optional[str] | Omit = omit, - build_args: Optional[Dict[str, str]] | Omit = omit, - code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, - dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, - services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -75,29 +71,16 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BlueprintView: - """Starts build of custom defined container Blueprint. - - The Blueprint will begin in - the 'provisioning' step and transition to the 'building' step once it is - selected off the build queue., Upon build complete it will transition to - 'building_complete' if the build is successful. + """ + Starts build of custom defined container Blueprint using a RepositoryConnection + Inspection as a source container specification. Args: - name: Name of the Blueprint. - - base_blueprint_id: (Optional) ID of previously built blueprint to use as a base blueprint for this - build. - - base_blueprint_name: (Optional) Name of previously built blueprint to use as a base blueprint for - this build. When set, this will load the latest successfully built Blueprint - with the given name. Only one of (base_blueprint_id, base_blueprint_name) should - be specified. + inspection_source: (Optional) Use a RepositoryInspection a source of a Blueprint build. The + Dockerfile will be automatically created based on the RepositoryInspection + contents. - build_args: (Optional) Arbitrary Docker build args to pass during build. - - code_mounts: A list of code mounts to be included in the Blueprint. - - dockerfile: Dockerfile contents to be used to build the Blueprint. + name: Name of the Blueprint. file_mounts: (Optional) Map of paths and file contents to write before setup. @@ -105,10 +88,6 @@ def create( metadata: (Optional) User defined metadata for the Blueprint. - services: (Optional) List of containerized services to include in the Blueprint. These - services will be pre-pulled during the build phase for optimized startup - performance. - system_setup_commands: A list of commands to run to set up your system. extra_headers: Send extra headers @@ -125,16 +104,11 @@ def create( "/v1/blueprints", body=maybe_transform( { + "inspection_source": inspection_source, "name": name, - "base_blueprint_id": base_blueprint_id, - "base_blueprint_name": base_blueprint_name, - "build_args": build_args, - "code_mounts": code_mounts, - "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, "metadata": metadata, - "services": services, "system_setup_commands": system_setup_commands, }, blueprint_create_params.BlueprintCreateParams, @@ -475,16 +449,11 @@ def with_streaming_response(self) -> AsyncBlueprintsResourceWithStreamingRespons async def create( self, *, + inspection_source: InspectionSourceParam, name: str, - base_blueprint_id: Optional[str] | Omit = omit, - base_blueprint_name: Optional[str] | Omit = omit, - build_args: Optional[Dict[str, str]] | Omit = omit, - code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, - dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, - services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -494,29 +463,16 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BlueprintView: - """Starts build of custom defined container Blueprint. - - The Blueprint will begin in - the 'provisioning' step and transition to the 'building' step once it is - selected off the build queue., Upon build complete it will transition to - 'building_complete' if the build is successful. + """ + Starts build of custom defined container Blueprint using a RepositoryConnection + Inspection as a source container specification. Args: - name: Name of the Blueprint. - - base_blueprint_id: (Optional) ID of previously built blueprint to use as a base blueprint for this - build. - - base_blueprint_name: (Optional) Name of previously built blueprint to use as a base blueprint for - this build. When set, this will load the latest successfully built Blueprint - with the given name. Only one of (base_blueprint_id, base_blueprint_name) should - be specified. + inspection_source: (Optional) Use a RepositoryInspection a source of a Blueprint build. The + Dockerfile will be automatically created based on the RepositoryInspection + contents. - build_args: (Optional) Arbitrary Docker build args to pass during build. - - code_mounts: A list of code mounts to be included in the Blueprint. - - dockerfile: Dockerfile contents to be used to build the Blueprint. + name: Name of the Blueprint. file_mounts: (Optional) Map of paths and file contents to write before setup. @@ -524,10 +480,6 @@ async def create( metadata: (Optional) User defined metadata for the Blueprint. - services: (Optional) List of containerized services to include in the Blueprint. These - services will be pre-pulled during the build phase for optimized startup - performance. - system_setup_commands: A list of commands to run to set up your system. extra_headers: Send extra headers @@ -544,16 +496,11 @@ async def create( "/v1/blueprints", body=await async_maybe_transform( { + "inspection_source": inspection_source, "name": name, - "base_blueprint_id": base_blueprint_id, - "base_blueprint_name": base_blueprint_name, - "build_args": build_args, - "code_mounts": code_mounts, - "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, "metadata": metadata, - "services": services, "system_setup_commands": system_setup_commands, }, blueprint_create_params.BlueprintCreateParams, diff --git a/src/runloop_api_client/resources/repositories.py b/src/runloop_api_client/resources/repositories.py index 99c484ba1..d11c7e800 100644 --- a/src/runloop_api_client/resources/repositories.py +++ b/src/runloop_api_client/resources/repositories.py @@ -6,7 +6,12 @@ import httpx -from ..types import repository_list_params, repository_create_params, repository_refresh_params +from ..types import ( + repository_list_params, + repository_create_params, + repository_inspect_params, + repository_refresh_params, +) from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property @@ -20,6 +25,7 @@ from ..pagination import SyncRepositoriesCursorIDPage, AsyncRepositoriesCursorIDPage from .._base_client import AsyncPaginator, make_request_options from ..types.repository_connection_view import RepositoryConnectionView +from ..types.repository_inspection_details import RepositoryInspectionDetails from ..types.repository_inspection_list_view import RepositoryInspectionListView __all__ = ["RepositoriesResource", "AsyncRepositoriesResource"] @@ -234,6 +240,60 @@ def delete( cast_to=object, ) + def inspect( + self, + id: str, + *, + blueprint_id: Optional[str] | Omit = omit, + github_auth_token: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> RepositoryInspectionDetails: + """ + Inspect a repository connection by inspecting the specified version including + repo's technical stack and developer environment requirements. + + Args: + blueprint_id: ID of blueprint to use as base for resulting RepositoryVersion blueprint. + + github_auth_token: GitHub authentication token for accessing private repositories. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/repositories/{id}/inspect", + body=maybe_transform( + { + "blueprint_id": blueprint_id, + "github_auth_token": github_auth_token, + }, + repository_inspect_params.RepositoryInspectParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=RepositoryInspectionDetails, + ) + def list_inspections( self, id: str, @@ -532,6 +592,60 @@ async def delete( cast_to=object, ) + async def inspect( + self, + id: str, + *, + blueprint_id: Optional[str] | Omit = omit, + github_auth_token: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> RepositoryInspectionDetails: + """ + Inspect a repository connection by inspecting the specified version including + repo's technical stack and developer environment requirements. + + Args: + blueprint_id: ID of blueprint to use as base for resulting RepositoryVersion blueprint. + + github_auth_token: GitHub authentication token for accessing private repositories. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/repositories/{id}/inspect", + body=await async_maybe_transform( + { + "blueprint_id": blueprint_id, + "github_auth_token": github_auth_token, + }, + repository_inspect_params.RepositoryInspectParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=RepositoryInspectionDetails, + ) + async def list_inspections( self, id: str, @@ -637,6 +751,9 @@ def __init__(self, repositories: RepositoriesResource) -> None: self.delete = to_raw_response_wrapper( repositories.delete, ) + self.inspect = to_raw_response_wrapper( + repositories.inspect, + ) self.list_inspections = to_raw_response_wrapper( repositories.list_inspections, ) @@ -661,6 +778,9 @@ def __init__(self, repositories: AsyncRepositoriesResource) -> None: self.delete = async_to_raw_response_wrapper( repositories.delete, ) + self.inspect = async_to_raw_response_wrapper( + repositories.inspect, + ) self.list_inspections = async_to_raw_response_wrapper( repositories.list_inspections, ) @@ -685,6 +805,9 @@ def __init__(self, repositories: RepositoriesResource) -> None: self.delete = to_streamed_response_wrapper( repositories.delete, ) + self.inspect = to_streamed_response_wrapper( + repositories.inspect, + ) self.list_inspections = to_streamed_response_wrapper( repositories.list_inspections, ) @@ -709,6 +832,9 @@ def __init__(self, repositories: AsyncRepositoriesResource) -> None: self.delete = async_to_streamed_response_wrapper( repositories.delete, ) + self.inspect = async_to_streamed_response_wrapper( + repositories.inspect, + ) self.list_inspections = async_to_streamed_response_wrapper( repositories.list_inspections, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index d53235820..0e4598ee6 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -52,6 +52,7 @@ from .benchmark_run_list_view import BenchmarkRunListView as BenchmarkRunListView from .benchmark_update_params import BenchmarkUpdateParams as BenchmarkUpdateParams from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams +from .inspection_source_param import InspectionSourceParam as InspectionSourceParam from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams from .object_download_url_view import ObjectDownloadURLView as ObjectDownloadURLView from .repository_create_params import RepositoryCreateParams as RepositoryCreateParams @@ -59,6 +60,7 @@ from .devbox_snapshot_list_view import DevboxSnapshotListView as DevboxSnapshotListView from .devbox_upload_file_params import DevboxUploadFileParams as DevboxUploadFileParams from .object_list_public_params import ObjectListPublicParams as ObjectListPublicParams +from .repository_inspect_params import RepositoryInspectParams as RepositoryInspectParams from .repository_refresh_params import RepositoryRefreshParams as RepositoryRefreshParams from .scenario_start_run_params import ScenarioStartRunParams as ScenarioStartRunParams from .benchmark_start_run_params import BenchmarkStartRunParams as BenchmarkStartRunParams diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index 80d32de9a..211bbd58e 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -2,42 +2,26 @@ from __future__ import annotations -from typing import Dict, Iterable, Optional +from typing import Dict, Optional from typing_extensions import Required, TypedDict from .._types import SequenceNotStr +from .inspection_source_param import InspectionSourceParam from .shared_params.launch_parameters import LaunchParameters -from .shared_params.code_mount_parameters import CodeMountParameters -__all__ = ["BlueprintCreateParams", "Service", "ServiceCredentials"] +__all__ = ["BlueprintCreateParams"] class BlueprintCreateParams(TypedDict, total=False): - name: Required[str] - """Name of the Blueprint.""" + inspection_source: Required[InspectionSourceParam] + """(Optional) Use a RepositoryInspection a source of a Blueprint build. - base_blueprint_id: Optional[str] + The Dockerfile will be automatically created based on the RepositoryInspection + contents. """ - (Optional) ID of previously built blueprint to use as a base blueprint for this - build. - """ - - base_blueprint_name: Optional[str] - """ - (Optional) Name of previously built blueprint to use as a base blueprint for - this build. When set, this will load the latest successfully built Blueprint - with the given name. Only one of (base_blueprint_id, base_blueprint_name) should - be specified. - """ - - build_args: Optional[Dict[str, str]] - """(Optional) Arbitrary Docker build args to pass during build.""" - code_mounts: Optional[Iterable[CodeMountParameters]] - """A list of code mounts to be included in the Blueprint.""" - - dockerfile: Optional[str] - """Dockerfile contents to be used to build the Blueprint.""" + name: Required[str] + """Name of the Blueprint.""" file_mounts: Optional[Dict[str, str]] """(Optional) Map of paths and file contents to write before setup.""" @@ -48,43 +32,5 @@ class BlueprintCreateParams(TypedDict, total=False): metadata: Optional[Dict[str, str]] """(Optional) User defined metadata for the Blueprint.""" - services: Optional[Iterable[Service]] - """(Optional) List of containerized services to include in the Blueprint. - - These services will be pre-pulled during the build phase for optimized startup - performance. - """ - system_setup_commands: Optional[SequenceNotStr[str]] """A list of commands to run to set up your system.""" - - -class ServiceCredentials(TypedDict, total=False): - password: Required[str] - """The password of the container service.""" - - username: Required[str] - """The username of the container service.""" - - -class Service(TypedDict, total=False): - image: Required[str] - """The image of the container service.""" - - name: Required[str] - """The name of the container service.""" - - credentials: Optional[ServiceCredentials] - """The credentials of the container service.""" - - env: Optional[Dict[str, str]] - """The environment variables of the container service.""" - - options: Optional[str] - """Additional Docker container create options.""" - - port_mappings: Optional[SequenceNotStr[str]] - """The port mappings of the container service. - - Port mappings are in the format of :. - """ diff --git a/src/runloop_api_client/types/inspection_source_param.py b/src/runloop_api_client/types/inspection_source_param.py new file mode 100644 index 000000000..ba9e7f397 --- /dev/null +++ b/src/runloop_api_client/types/inspection_source_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +__all__ = ["InspectionSourceParam"] + + +class InspectionSourceParam(TypedDict, total=False): + inspection_id: Required[str] + """The ID of a repository inspection.""" + + github_auth_token: Optional[str] + """GitHub authentication token for accessing private repositories.""" diff --git a/src/runloop_api_client/types/repository_inspect_params.py b/src/runloop_api_client/types/repository_inspect_params.py new file mode 100644 index 000000000..c68b4b830 --- /dev/null +++ b/src/runloop_api_client/types/repository_inspect_params.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import TypedDict + +__all__ = ["RepositoryInspectParams"] + + +class RepositoryInspectParams(TypedDict, total=False): + blueprint_id: Optional[str] + """ID of blueprint to use as base for resulting RepositoryVersion blueprint.""" + + github_auth_token: Optional[str] + """GitHub authentication token for accessing private repositories.""" diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 0e6eb9eba..3a937c1c6 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -25,6 +25,7 @@ class TestBlueprints: @parametrize def test_method_create(self, client: Runloop) -> None: blueprint = client.blueprints.create( + inspection_source={"inspection_id": "inspection_id"}, name="name", ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @@ -32,19 +33,11 @@ def test_method_create(self, client: Runloop) -> None: @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: blueprint = client.blueprints.create( + inspection_source={ + "inspection_id": "inspection_id", + "github_auth_token": "github_auth_token", + }, name="name", - base_blueprint_id="base_blueprint_id", - base_blueprint_name="base_blueprint_name", - build_args={"foo": "string"}, - code_mounts=[ - { - "repo_name": "repo_name", - "repo_owner": "repo_owner", - "token": "token", - "install_command": "install_command", - } - ], - dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ "after_idle": { @@ -66,19 +59,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: }, }, metadata={"foo": "string"}, - services=[ - { - "image": "image", - "name": "name", - "credentials": { - "password": "password", - "username": "username", - }, - "env": {"foo": "string"}, - "options": "options", - "port_mappings": ["string"], - } - ], system_setup_commands=["string"], ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @@ -86,6 +66,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: @parametrize def test_raw_response_create(self, client: Runloop) -> None: response = client.blueprints.with_raw_response.create( + inspection_source={"inspection_id": "inspection_id"}, name="name", ) @@ -97,6 +78,7 @@ def test_raw_response_create(self, client: Runloop) -> None: @parametrize def test_streaming_response_create(self, client: Runloop) -> None: with client.blueprints.with_streaming_response.create( + inspection_source={"inspection_id": "inspection_id"}, name="name", ) as response: assert not response.is_closed @@ -383,6 +365,7 @@ class TestAsyncBlueprints: @parametrize async def test_method_create(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.create( + inspection_source={"inspection_id": "inspection_id"}, name="name", ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @@ -390,19 +373,11 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.create( + inspection_source={ + "inspection_id": "inspection_id", + "github_auth_token": "github_auth_token", + }, name="name", - base_blueprint_id="base_blueprint_id", - base_blueprint_name="base_blueprint_name", - build_args={"foo": "string"}, - code_mounts=[ - { - "repo_name": "repo_name", - "repo_owner": "repo_owner", - "token": "token", - "install_command": "install_command", - } - ], - dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ "after_idle": { @@ -424,19 +399,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - }, }, metadata={"foo": "string"}, - services=[ - { - "image": "image", - "name": "name", - "credentials": { - "password": "password", - "username": "username", - }, - "env": {"foo": "string"}, - "options": "options", - "port_mappings": ["string"], - } - ], system_setup_commands=["string"], ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @@ -444,6 +406,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - @parametrize async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: response = await async_client.blueprints.with_raw_response.create( + inspection_source={"inspection_id": "inspection_id"}, name="name", ) @@ -455,6 +418,7 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: async with async_client.blueprints.with_streaming_response.create( + inspection_source={"inspection_id": "inspection_id"}, name="name", ) as response: assert not response.is_closed diff --git a/tests/api_resources/test_repositories.py b/tests/api_resources/test_repositories.py index da723e080..8e31ed986 100644 --- a/tests/api_resources/test_repositories.py +++ b/tests/api_resources/test_repositories.py @@ -11,6 +11,7 @@ from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types import ( RepositoryConnectionView, + RepositoryInspectionDetails, RepositoryInspectionListView, ) from runloop_api_client.pagination import SyncRepositoriesCursorIDPage, AsyncRepositoriesCursorIDPage @@ -176,6 +177,53 @@ def test_path_params_delete(self, client: Runloop) -> None: "", ) + @parametrize + def test_method_inspect(self, client: Runloop) -> None: + repository = client.repositories.inspect( + id="id", + ) + assert_matches_type(RepositoryInspectionDetails, repository, path=["response"]) + + @parametrize + def test_method_inspect_with_all_params(self, client: Runloop) -> None: + repository = client.repositories.inspect( + id="id", + blueprint_id="blueprint_id", + github_auth_token="github_auth_token", + ) + assert_matches_type(RepositoryInspectionDetails, repository, path=["response"]) + + @parametrize + def test_raw_response_inspect(self, client: Runloop) -> None: + response = client.repositories.with_raw_response.inspect( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = response.parse() + assert_matches_type(RepositoryInspectionDetails, repository, path=["response"]) + + @parametrize + def test_streaming_response_inspect(self, client: Runloop) -> None: + with client.repositories.with_streaming_response.inspect( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = response.parse() + assert_matches_type(RepositoryInspectionDetails, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_inspect(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.repositories.with_raw_response.inspect( + id="", + ) + @parametrize def test_method_list_inspections(self, client: Runloop) -> None: repository = client.repositories.list_inspections( @@ -422,6 +470,53 @@ async def test_path_params_delete(self, async_client: AsyncRunloop) -> None: "", ) + @parametrize + async def test_method_inspect(self, async_client: AsyncRunloop) -> None: + repository = await async_client.repositories.inspect( + id="id", + ) + assert_matches_type(RepositoryInspectionDetails, repository, path=["response"]) + + @parametrize + async def test_method_inspect_with_all_params(self, async_client: AsyncRunloop) -> None: + repository = await async_client.repositories.inspect( + id="id", + blueprint_id="blueprint_id", + github_auth_token="github_auth_token", + ) + assert_matches_type(RepositoryInspectionDetails, repository, path=["response"]) + + @parametrize + async def test_raw_response_inspect(self, async_client: AsyncRunloop) -> None: + response = await async_client.repositories.with_raw_response.inspect( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = await response.parse() + assert_matches_type(RepositoryInspectionDetails, repository, path=["response"]) + + @parametrize + async def test_streaming_response_inspect(self, async_client: AsyncRunloop) -> None: + async with async_client.repositories.with_streaming_response.inspect( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = await response.parse() + assert_matches_type(RepositoryInspectionDetails, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_inspect(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.repositories.with_raw_response.inspect( + id="", + ) + @parametrize async def test_method_list_inspections(self, async_client: AsyncRunloop) -> None: repository = await async_client.repositories.list_inspections( From 782d085715fcce8846853b93fc4ed5c5e8ac2256 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Oct 2025 21:24:59 +0000 Subject: [PATCH 871/993] feat(api): api update --- .stats.yml | 4 +- .../resources/blueprints.py | 91 +++++++++++++++---- src/runloop_api_client/types/__init__.py | 1 - .../types/blueprint_create_params.py | 72 +++++++++++++-- .../types/inspection_source_param.py | 16 ---- tests/api_resources/test_blueprints.py | 64 ++++++++++--- 6 files changed, 187 insertions(+), 61 deletions(-) delete mode 100644 src/runloop_api_client/types/inspection_source_param.py diff --git a/.stats.yml b/.stats.yml index f933e2cc8..21c53f96b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 91 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-034d0b86510db8b712b55ac88c1c4a322db2ce84edc632f6d27be1eb4f34fd37.yml -openapi_spec_hash: 0485ec0d01253b2c1bdab3015370808e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f1d928f705d6771a22fe701dfb8c0c66aabbd0dd6d17e3fa09b8eb3a48259a84.yml +openapi_spec_hash: 12dc18a4da3f084fee3d2c5f428e1df3 config_hash: 35e129f39a0c1fd38209b0dafb7c7562 diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index f767f202d..2e429ed10 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -26,7 +26,6 @@ from .._base_client import AsyncPaginator, make_request_options from ..types.blueprint_view import BlueprintView from ..types.blueprint_preview_view import BlueprintPreviewView -from ..types.inspection_source_param import InspectionSourceParam from ..types.blueprint_build_logs_list_view import BlueprintBuildLogsListView from ..types.shared_params.launch_parameters import LaunchParameters from ..types.shared_params.code_mount_parameters import CodeMountParameters @@ -57,11 +56,16 @@ def with_streaming_response(self) -> BlueprintsResourceWithStreamingResponse: def create( self, *, - inspection_source: InspectionSourceParam, name: str, + base_blueprint_id: Optional[str] | Omit = omit, + base_blueprint_name: Optional[str] | Omit = omit, + build_args: Optional[Dict[str, str]] | Omit = omit, + code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, + dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, + services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -71,23 +75,40 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BlueprintView: - """ - Starts build of custom defined container Blueprint using a RepositoryConnection - Inspection as a source container specification. + """Starts build of custom defined container Blueprint. - Args: - inspection_source: (Optional) Use a RepositoryInspection a source of a Blueprint build. The - Dockerfile will be automatically created based on the RepositoryInspection - contents. + The Blueprint will begin in + the 'provisioning' step and transition to the 'building' step once it is + selected off the build queue., Upon build complete it will transition to + 'building_complete' if the build is successful. + Args: name: Name of the Blueprint. + base_blueprint_id: (Optional) ID of previously built blueprint to use as a base blueprint for this + build. + + base_blueprint_name: (Optional) Name of previously built blueprint to use as a base blueprint for + this build. When set, this will load the latest successfully built Blueprint + with the given name. Only one of (base_blueprint_id, base_blueprint_name) should + be specified. + + build_args: (Optional) Arbitrary Docker build args to pass during build. + + code_mounts: A list of code mounts to be included in the Blueprint. + + dockerfile: Dockerfile contents to be used to build the Blueprint. + file_mounts: (Optional) Map of paths and file contents to write before setup. launch_parameters: Parameters to configure your Devbox at launch time. metadata: (Optional) User defined metadata for the Blueprint. + services: (Optional) List of containerized services to include in the Blueprint. These + services will be pre-pulled during the build phase for optimized startup + performance. + system_setup_commands: A list of commands to run to set up your system. extra_headers: Send extra headers @@ -104,11 +125,16 @@ def create( "/v1/blueprints", body=maybe_transform( { - "inspection_source": inspection_source, "name": name, + "base_blueprint_id": base_blueprint_id, + "base_blueprint_name": base_blueprint_name, + "build_args": build_args, + "code_mounts": code_mounts, + "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, "metadata": metadata, + "services": services, "system_setup_commands": system_setup_commands, }, blueprint_create_params.BlueprintCreateParams, @@ -449,11 +475,16 @@ def with_streaming_response(self) -> AsyncBlueprintsResourceWithStreamingRespons async def create( self, *, - inspection_source: InspectionSourceParam, name: str, + base_blueprint_id: Optional[str] | Omit = omit, + base_blueprint_name: Optional[str] | Omit = omit, + build_args: Optional[Dict[str, str]] | Omit = omit, + code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, + dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, + services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -463,23 +494,40 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BlueprintView: - """ - Starts build of custom defined container Blueprint using a RepositoryConnection - Inspection as a source container specification. + """Starts build of custom defined container Blueprint. - Args: - inspection_source: (Optional) Use a RepositoryInspection a source of a Blueprint build. The - Dockerfile will be automatically created based on the RepositoryInspection - contents. + The Blueprint will begin in + the 'provisioning' step and transition to the 'building' step once it is + selected off the build queue., Upon build complete it will transition to + 'building_complete' if the build is successful. + Args: name: Name of the Blueprint. + base_blueprint_id: (Optional) ID of previously built blueprint to use as a base blueprint for this + build. + + base_blueprint_name: (Optional) Name of previously built blueprint to use as a base blueprint for + this build. When set, this will load the latest successfully built Blueprint + with the given name. Only one of (base_blueprint_id, base_blueprint_name) should + be specified. + + build_args: (Optional) Arbitrary Docker build args to pass during build. + + code_mounts: A list of code mounts to be included in the Blueprint. + + dockerfile: Dockerfile contents to be used to build the Blueprint. + file_mounts: (Optional) Map of paths and file contents to write before setup. launch_parameters: Parameters to configure your Devbox at launch time. metadata: (Optional) User defined metadata for the Blueprint. + services: (Optional) List of containerized services to include in the Blueprint. These + services will be pre-pulled during the build phase for optimized startup + performance. + system_setup_commands: A list of commands to run to set up your system. extra_headers: Send extra headers @@ -496,11 +544,16 @@ async def create( "/v1/blueprints", body=await async_maybe_transform( { - "inspection_source": inspection_source, "name": name, + "base_blueprint_id": base_blueprint_id, + "base_blueprint_name": base_blueprint_name, + "build_args": build_args, + "code_mounts": code_mounts, + "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, "metadata": metadata, + "services": services, "system_setup_commands": system_setup_commands, }, blueprint_create_params.BlueprintCreateParams, diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 0e4598ee6..5dcfbe0fe 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -52,7 +52,6 @@ from .benchmark_run_list_view import BenchmarkRunListView as BenchmarkRunListView from .benchmark_update_params import BenchmarkUpdateParams as BenchmarkUpdateParams from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams -from .inspection_source_param import InspectionSourceParam as InspectionSourceParam from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams from .object_download_url_view import ObjectDownloadURLView as ObjectDownloadURLView from .repository_create_params import RepositoryCreateParams as RepositoryCreateParams diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index 211bbd58e..80d32de9a 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -2,26 +2,42 @@ from __future__ import annotations -from typing import Dict, Optional +from typing import Dict, Iterable, Optional from typing_extensions import Required, TypedDict from .._types import SequenceNotStr -from .inspection_source_param import InspectionSourceParam from .shared_params.launch_parameters import LaunchParameters +from .shared_params.code_mount_parameters import CodeMountParameters -__all__ = ["BlueprintCreateParams"] +__all__ = ["BlueprintCreateParams", "Service", "ServiceCredentials"] class BlueprintCreateParams(TypedDict, total=False): - inspection_source: Required[InspectionSourceParam] - """(Optional) Use a RepositoryInspection a source of a Blueprint build. + name: Required[str] + """Name of the Blueprint.""" - The Dockerfile will be automatically created based on the RepositoryInspection - contents. + base_blueprint_id: Optional[str] + """ + (Optional) ID of previously built blueprint to use as a base blueprint for this + build. """ - name: Required[str] - """Name of the Blueprint.""" + base_blueprint_name: Optional[str] + """ + (Optional) Name of previously built blueprint to use as a base blueprint for + this build. When set, this will load the latest successfully built Blueprint + with the given name. Only one of (base_blueprint_id, base_blueprint_name) should + be specified. + """ + + build_args: Optional[Dict[str, str]] + """(Optional) Arbitrary Docker build args to pass during build.""" + + code_mounts: Optional[Iterable[CodeMountParameters]] + """A list of code mounts to be included in the Blueprint.""" + + dockerfile: Optional[str] + """Dockerfile contents to be used to build the Blueprint.""" file_mounts: Optional[Dict[str, str]] """(Optional) Map of paths and file contents to write before setup.""" @@ -32,5 +48,43 @@ class BlueprintCreateParams(TypedDict, total=False): metadata: Optional[Dict[str, str]] """(Optional) User defined metadata for the Blueprint.""" + services: Optional[Iterable[Service]] + """(Optional) List of containerized services to include in the Blueprint. + + These services will be pre-pulled during the build phase for optimized startup + performance. + """ + system_setup_commands: Optional[SequenceNotStr[str]] """A list of commands to run to set up your system.""" + + +class ServiceCredentials(TypedDict, total=False): + password: Required[str] + """The password of the container service.""" + + username: Required[str] + """The username of the container service.""" + + +class Service(TypedDict, total=False): + image: Required[str] + """The image of the container service.""" + + name: Required[str] + """The name of the container service.""" + + credentials: Optional[ServiceCredentials] + """The credentials of the container service.""" + + env: Optional[Dict[str, str]] + """The environment variables of the container service.""" + + options: Optional[str] + """Additional Docker container create options.""" + + port_mappings: Optional[SequenceNotStr[str]] + """The port mappings of the container service. + + Port mappings are in the format of :. + """ diff --git a/src/runloop_api_client/types/inspection_source_param.py b/src/runloop_api_client/types/inspection_source_param.py deleted file mode 100644 index ba9e7f397..000000000 --- a/src/runloop_api_client/types/inspection_source_param.py +++ /dev/null @@ -1,16 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Optional -from typing_extensions import Required, TypedDict - -__all__ = ["InspectionSourceParam"] - - -class InspectionSourceParam(TypedDict, total=False): - inspection_id: Required[str] - """The ID of a repository inspection.""" - - github_auth_token: Optional[str] - """GitHub authentication token for accessing private repositories.""" diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 3a937c1c6..0e6eb9eba 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -25,7 +25,6 @@ class TestBlueprints: @parametrize def test_method_create(self, client: Runloop) -> None: blueprint = client.blueprints.create( - inspection_source={"inspection_id": "inspection_id"}, name="name", ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @@ -33,11 +32,19 @@ def test_method_create(self, client: Runloop) -> None: @parametrize def test_method_create_with_all_params(self, client: Runloop) -> None: blueprint = client.blueprints.create( - inspection_source={ - "inspection_id": "inspection_id", - "github_auth_token": "github_auth_token", - }, name="name", + base_blueprint_id="base_blueprint_id", + base_blueprint_name="base_blueprint_name", + build_args={"foo": "string"}, + code_mounts=[ + { + "repo_name": "repo_name", + "repo_owner": "repo_owner", + "token": "token", + "install_command": "install_command", + } + ], + dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ "after_idle": { @@ -59,6 +66,19 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: }, }, metadata={"foo": "string"}, + services=[ + { + "image": "image", + "name": "name", + "credentials": { + "password": "password", + "username": "username", + }, + "env": {"foo": "string"}, + "options": "options", + "port_mappings": ["string"], + } + ], system_setup_commands=["string"], ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @@ -66,7 +86,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: @parametrize def test_raw_response_create(self, client: Runloop) -> None: response = client.blueprints.with_raw_response.create( - inspection_source={"inspection_id": "inspection_id"}, name="name", ) @@ -78,7 +97,6 @@ def test_raw_response_create(self, client: Runloop) -> None: @parametrize def test_streaming_response_create(self, client: Runloop) -> None: with client.blueprints.with_streaming_response.create( - inspection_source={"inspection_id": "inspection_id"}, name="name", ) as response: assert not response.is_closed @@ -365,7 +383,6 @@ class TestAsyncBlueprints: @parametrize async def test_method_create(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.create( - inspection_source={"inspection_id": "inspection_id"}, name="name", ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @@ -373,11 +390,19 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.create( - inspection_source={ - "inspection_id": "inspection_id", - "github_auth_token": "github_auth_token", - }, name="name", + base_blueprint_id="base_blueprint_id", + base_blueprint_name="base_blueprint_name", + build_args={"foo": "string"}, + code_mounts=[ + { + "repo_name": "repo_name", + "repo_owner": "repo_owner", + "token": "token", + "install_command": "install_command", + } + ], + dockerfile="dockerfile", file_mounts={"foo": "string"}, launch_parameters={ "after_idle": { @@ -399,6 +424,19 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - }, }, metadata={"foo": "string"}, + services=[ + { + "image": "image", + "name": "name", + "credentials": { + "password": "password", + "username": "username", + }, + "env": {"foo": "string"}, + "options": "options", + "port_mappings": ["string"], + } + ], system_setup_commands=["string"], ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @@ -406,7 +444,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - @parametrize async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: response = await async_client.blueprints.with_raw_response.create( - inspection_source={"inspection_id": "inspection_id"}, name="name", ) @@ -418,7 +455,6 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: async with async_client.blueprints.with_streaming_response.create( - inspection_source={"inspection_id": "inspection_id"}, name="name", ) as response: assert not response.is_closed From 936a4639666e9609613ce3acfac307897e0d7cd9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Oct 2025 22:01:51 +0000 Subject: [PATCH 872/993] feat(api): api update --- .stats.yml | 4 +- api.md | 1 + .../resources/blueprints.py | 152 ++++++++++++++++++ src/runloop_api_client/types/__init__.py | 4 + ...blueprint_create_from_inspection_params.py | 36 +++++ .../types/inspection_source_param.py | 16 ++ tests/api_resources/test_blueprints.py | 134 +++++++++++++++ 7 files changed, 345 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/types/blueprint_create_from_inspection_params.py create mode 100644 src/runloop_api_client/types/inspection_source_param.py diff --git a/.stats.yml b/.stats.yml index 21c53f96b..32058a67e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 91 +configured_endpoints: 92 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f1d928f705d6771a22fe701dfb8c0c66aabbd0dd6d17e3fa09b8eb3a48259a84.yml openapi_spec_hash: 12dc18a4da3f084fee3d2c5f428e1df3 -config_hash: 35e129f39a0c1fd38209b0dafb7c7562 +config_hash: f9f7bc60c36f103c77333d9149cd3e46 diff --git a/api.md b/api.md index 55ae37b26..64fff8eea 100644 --- a/api.md +++ b/api.md @@ -62,6 +62,7 @@ Methods: - client.blueprints.retrieve(id) -> BlueprintView - client.blueprints.list(\*\*params) -> SyncBlueprintsCursorIDPage[BlueprintView] - client.blueprints.delete(id) -> object +- client.blueprints.create_from_inspection(\*\*params) -> BlueprintView - client.blueprints.list_public(\*\*params) -> SyncBlueprintsCursorIDPage[BlueprintView] - client.blueprints.logs(id) -> BlueprintBuildLogsListView - client.blueprints.preview(\*\*params) -> BlueprintPreviewView diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index 2e429ed10..e201ffd82 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -11,6 +11,7 @@ blueprint_create_params, blueprint_preview_params, blueprint_list_public_params, + blueprint_create_from_inspection_params, ) from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from .._utils import maybe_transform, async_maybe_transform @@ -26,6 +27,7 @@ from .._base_client import AsyncPaginator, make_request_options from ..types.blueprint_view import BlueprintView from ..types.blueprint_preview_view import BlueprintPreviewView +from ..types.inspection_source_param import InspectionSourceParam from ..types.blueprint_build_logs_list_view import BlueprintBuildLogsListView from ..types.shared_params.launch_parameters import LaunchParameters from ..types.shared_params.code_mount_parameters import CodeMountParameters @@ -273,6 +275,75 @@ def delete( cast_to=object, ) + def create_from_inspection( + self, + *, + inspection_source: InspectionSourceParam, + name: str, + file_mounts: Optional[Dict[str, str]] | Omit = omit, + launch_parameters: Optional[LaunchParameters] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> BlueprintView: + """ + Starts build of custom defined container Blueprint using a RepositoryConnection + Inspection as a source container specification. + + Args: + inspection_source: (Optional) Use a RepositoryInspection a source of a Blueprint build. The + Dockerfile will be automatically created based on the RepositoryInspection + contents. + + name: Name of the Blueprint. + + file_mounts: (Optional) Map of paths and file contents to write before setup. + + launch_parameters: Parameters to configure your Devbox at launch time. + + metadata: (Optional) User defined metadata for the Blueprint. + + system_setup_commands: A list of commands to run to set up your system. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/v1/blueprints/create_from_inspection", + body=maybe_transform( + { + "inspection_source": inspection_source, + "name": name, + "file_mounts": file_mounts, + "launch_parameters": launch_parameters, + "metadata": metadata, + "system_setup_commands": system_setup_commands, + }, + blueprint_create_from_inspection_params.BlueprintCreateFromInspectionParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BlueprintView, + ) + def list_public( self, *, @@ -692,6 +763,75 @@ async def delete( cast_to=object, ) + async def create_from_inspection( + self, + *, + inspection_source: InspectionSourceParam, + name: str, + file_mounts: Optional[Dict[str, str]] | Omit = omit, + launch_parameters: Optional[LaunchParameters] | Omit = omit, + metadata: Optional[Dict[str, str]] | Omit = omit, + system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> BlueprintView: + """ + Starts build of custom defined container Blueprint using a RepositoryConnection + Inspection as a source container specification. + + Args: + inspection_source: (Optional) Use a RepositoryInspection a source of a Blueprint build. The + Dockerfile will be automatically created based on the RepositoryInspection + contents. + + name: Name of the Blueprint. + + file_mounts: (Optional) Map of paths and file contents to write before setup. + + launch_parameters: Parameters to configure your Devbox at launch time. + + metadata: (Optional) User defined metadata for the Blueprint. + + system_setup_commands: A list of commands to run to set up your system. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/v1/blueprints/create_from_inspection", + body=await async_maybe_transform( + { + "inspection_source": inspection_source, + "name": name, + "file_mounts": file_mounts, + "launch_parameters": launch_parameters, + "metadata": metadata, + "system_setup_commands": system_setup_commands, + }, + blueprint_create_from_inspection_params.BlueprintCreateFromInspectionParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BlueprintView, + ) + def list_public( self, *, @@ -887,6 +1027,9 @@ def __init__(self, blueprints: BlueprintsResource) -> None: self.delete = to_raw_response_wrapper( blueprints.delete, ) + self.create_from_inspection = to_raw_response_wrapper( + blueprints.create_from_inspection, + ) self.list_public = to_raw_response_wrapper( blueprints.list_public, ) @@ -914,6 +1057,9 @@ def __init__(self, blueprints: AsyncBlueprintsResource) -> None: self.delete = async_to_raw_response_wrapper( blueprints.delete, ) + self.create_from_inspection = async_to_raw_response_wrapper( + blueprints.create_from_inspection, + ) self.list_public = async_to_raw_response_wrapper( blueprints.list_public, ) @@ -941,6 +1087,9 @@ def __init__(self, blueprints: BlueprintsResource) -> None: self.delete = to_streamed_response_wrapper( blueprints.delete, ) + self.create_from_inspection = to_streamed_response_wrapper( + blueprints.create_from_inspection, + ) self.list_public = to_streamed_response_wrapper( blueprints.list_public, ) @@ -968,6 +1117,9 @@ def __init__(self, blueprints: AsyncBlueprintsResource) -> None: self.delete = async_to_streamed_response_wrapper( blueprints.delete, ) + self.create_from_inspection = async_to_streamed_response_wrapper( + blueprints.create_from_inspection, + ) self.list_public = async_to_streamed_response_wrapper( blueprints.list_public, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 5dcfbe0fe..efffa52f1 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -52,6 +52,7 @@ from .benchmark_run_list_view import BenchmarkRunListView as BenchmarkRunListView from .benchmark_update_params import BenchmarkUpdateParams as BenchmarkUpdateParams from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams +from .inspection_source_param import InspectionSourceParam as InspectionSourceParam from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams from .object_download_url_view import ObjectDownloadURLView as ObjectDownloadURLView from .repository_create_params import RepositoryCreateParams as RepositoryCreateParams @@ -94,3 +95,6 @@ from .devbox_write_file_contents_params import DevboxWriteFileContentsParams as DevboxWriteFileContentsParams from .devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView as DevboxAsyncExecutionDetailView from .devbox_read_file_contents_response import DevboxReadFileContentsResponse as DevboxReadFileContentsResponse +from .blueprint_create_from_inspection_params import ( + BlueprintCreateFromInspectionParams as BlueprintCreateFromInspectionParams, +) diff --git a/src/runloop_api_client/types/blueprint_create_from_inspection_params.py b/src/runloop_api_client/types/blueprint_create_from_inspection_params.py new file mode 100644 index 000000000..402bbb4db --- /dev/null +++ b/src/runloop_api_client/types/blueprint_create_from_inspection_params.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Optional +from typing_extensions import Required, TypedDict + +from .._types import SequenceNotStr +from .inspection_source_param import InspectionSourceParam +from .shared_params.launch_parameters import LaunchParameters + +__all__ = ["BlueprintCreateFromInspectionParams"] + + +class BlueprintCreateFromInspectionParams(TypedDict, total=False): + inspection_source: Required[InspectionSourceParam] + """(Optional) Use a RepositoryInspection a source of a Blueprint build. + + The Dockerfile will be automatically created based on the RepositoryInspection + contents. + """ + + name: Required[str] + """Name of the Blueprint.""" + + file_mounts: Optional[Dict[str, str]] + """(Optional) Map of paths and file contents to write before setup.""" + + launch_parameters: Optional[LaunchParameters] + """Parameters to configure your Devbox at launch time.""" + + metadata: Optional[Dict[str, str]] + """(Optional) User defined metadata for the Blueprint.""" + + system_setup_commands: Optional[SequenceNotStr[str]] + """A list of commands to run to set up your system.""" diff --git a/src/runloop_api_client/types/inspection_source_param.py b/src/runloop_api_client/types/inspection_source_param.py new file mode 100644 index 000000000..ba9e7f397 --- /dev/null +++ b/src/runloop_api_client/types/inspection_source_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +__all__ = ["InspectionSourceParam"] + + +class InspectionSourceParam(TypedDict, total=False): + inspection_id: Required[str] + """The ID of a repository inspection.""" + + github_auth_token: Optional[str] + """GitHub authentication token for accessing private repositories.""" diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 0e6eb9eba..4c34f9b4e 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -217,6 +217,73 @@ def test_path_params_delete(self, client: Runloop) -> None: "", ) + @parametrize + def test_method_create_from_inspection(self, client: Runloop) -> None: + blueprint = client.blueprints.create_from_inspection( + inspection_source={"inspection_id": "inspection_id"}, + name="name", + ) + assert_matches_type(BlueprintView, blueprint, path=["response"]) + + @parametrize + def test_method_create_from_inspection_with_all_params(self, client: Runloop) -> None: + blueprint = client.blueprints.create_from_inspection( + inspection_source={ + "inspection_id": "inspection_id", + "github_auth_token": "github_auth_token", + }, + name="name", + file_mounts={"foo": "string"}, + launch_parameters={ + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "shutdown", + }, + "architecture": "x86_64", + "available_ports": [0], + "custom_cpu_cores": 0, + "custom_disk_size": 0, + "custom_gb_memory": 0, + "keep_alive_time_seconds": 0, + "launch_commands": ["string"], + "required_services": ["string"], + "resource_size_request": "X_SMALL", + "user_parameters": { + "uid": 0, + "username": "username", + }, + }, + metadata={"foo": "string"}, + system_setup_commands=["string"], + ) + assert_matches_type(BlueprintView, blueprint, path=["response"]) + + @parametrize + def test_raw_response_create_from_inspection(self, client: Runloop) -> None: + response = client.blueprints.with_raw_response.create_from_inspection( + inspection_source={"inspection_id": "inspection_id"}, + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = response.parse() + assert_matches_type(BlueprintView, blueprint, path=["response"]) + + @parametrize + def test_streaming_response_create_from_inspection(self, client: Runloop) -> None: + with client.blueprints.with_streaming_response.create_from_inspection( + inspection_source={"inspection_id": "inspection_id"}, + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + blueprint = response.parse() + assert_matches_type(BlueprintView, blueprint, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_list_public(self, client: Runloop) -> None: blueprint = client.blueprints.list_public() @@ -575,6 +642,73 @@ async def test_path_params_delete(self, async_client: AsyncRunloop) -> None: "", ) + @parametrize + async def test_method_create_from_inspection(self, async_client: AsyncRunloop) -> None: + blueprint = await async_client.blueprints.create_from_inspection( + inspection_source={"inspection_id": "inspection_id"}, + name="name", + ) + assert_matches_type(BlueprintView, blueprint, path=["response"]) + + @parametrize + async def test_method_create_from_inspection_with_all_params(self, async_client: AsyncRunloop) -> None: + blueprint = await async_client.blueprints.create_from_inspection( + inspection_source={ + "inspection_id": "inspection_id", + "github_auth_token": "github_auth_token", + }, + name="name", + file_mounts={"foo": "string"}, + launch_parameters={ + "after_idle": { + "idle_time_seconds": 0, + "on_idle": "shutdown", + }, + "architecture": "x86_64", + "available_ports": [0], + "custom_cpu_cores": 0, + "custom_disk_size": 0, + "custom_gb_memory": 0, + "keep_alive_time_seconds": 0, + "launch_commands": ["string"], + "required_services": ["string"], + "resource_size_request": "X_SMALL", + "user_parameters": { + "uid": 0, + "username": "username", + }, + }, + metadata={"foo": "string"}, + system_setup_commands=["string"], + ) + assert_matches_type(BlueprintView, blueprint, path=["response"]) + + @parametrize + async def test_raw_response_create_from_inspection(self, async_client: AsyncRunloop) -> None: + response = await async_client.blueprints.with_raw_response.create_from_inspection( + inspection_source={"inspection_id": "inspection_id"}, + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + blueprint = await response.parse() + assert_matches_type(BlueprintView, blueprint, path=["response"]) + + @parametrize + async def test_streaming_response_create_from_inspection(self, async_client: AsyncRunloop) -> None: + async with async_client.blueprints.with_streaming_response.create_from_inspection( + inspection_source={"inspection_id": "inspection_id"}, + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + blueprint = await response.parse() + assert_matches_type(BlueprintView, blueprint, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_list_public(self, async_client: AsyncRunloop) -> None: blueprint = await async_client.blueprints.list_public() From 44d0b6c72d400bc42f651f1f83aca55a52a5edeb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Oct 2025 22:03:38 +0000 Subject: [PATCH 873/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f7e971ead..fdce87245 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.61.0" + ".": "0.62.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index a521f1874..2c96f9ace 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.61.0" +version = "0.62.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 16da2086a..628c89ebc 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.61.0" # x-release-please-version +__version__ = "0.62.0" # x-release-please-version diff --git a/uv.lock b/uv.lock index 5957a8d79..da818e083 100644 --- a/uv.lock +++ b/uv.lock @@ -1771,7 +1771,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "0.61.0" +version = "0.62.0" source = { editable = "." } dependencies = [ { name = "anyio", version = "4.5.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, From 2e6f497f9e839684f1f29f9ccef1ac9eac7dca37 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 23:46:30 +0000 Subject: [PATCH 874/993] feat(api): api update --- .stats.yml | 4 +- .../resources/devboxes/devboxes.py | 12 +++++- .../resources/repositories.py | 18 +-------- .../types/devbox_create_params.py | 39 +++++++++++++++++-- .../types/devbox_execute_params.py | 2 +- .../types/repository_inspect_params.py | 3 -- tests/api_resources/test_devboxes.py | 14 +++++++ tests/api_resources/test_repositories.py | 2 - 8 files changed, 65 insertions(+), 29 deletions(-) diff --git a/.stats.yml b/.stats.yml index 32058a67e..820edb715 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 92 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f1d928f705d6771a22fe701dfb8c0c66aabbd0dd6d17e3fa09b8eb3a48259a84.yml -openapi_spec_hash: 12dc18a4da3f084fee3d2c5f428e1df3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6b65a42b74406a77acb03ddb582288396d7af64df16eebf887c77246d3a54470.yml +openapi_spec_hash: aeb9f595d53412926ef507174f33a1a1 config_hash: f9f7bc60c36f103c77333d9149cd3e46 diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 33c226954..b502ade1b 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -155,6 +155,7 @@ def create( file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, + mounts: Optional[Iterable[devbox_create_params.Mount]] | Omit = omit, name: Optional[str] | Omit = omit, repo_connection_id: Optional[str] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, @@ -198,6 +199,8 @@ def create( metadata: User defined metadata to attach to the devbox for organization. + mounts: A list of file system mounts to be included in the Devbox. + name: (Optional) A user specified name to give the Devbox. repo_connection_id: Repository connection id the devbox should source its base image from. @@ -232,6 +235,7 @@ def create( "file_mounts": file_mounts, "launch_parameters": launch_parameters, "metadata": metadata, + "mounts": mounts, "name": name, "repo_connection_id": repo_connection_id, "secrets": secrets, @@ -590,7 +594,7 @@ def execute( specified the command is run from the directory based on the recent state of the persistent shell. - command_id: The command ID for idempotency and tracking + command_id: The command ID in UUIDv7 string format for idempotency and tracking optimistic_timeout: Timeout in seconds to wait for command completion. Operation is not killed. Max is 600 seconds. @@ -1426,6 +1430,7 @@ async def create( file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, + mounts: Optional[Iterable[devbox_create_params.Mount]] | Omit = omit, name: Optional[str] | Omit = omit, repo_connection_id: Optional[str] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, @@ -1469,6 +1474,8 @@ async def create( metadata: User defined metadata to attach to the devbox for organization. + mounts: A list of file system mounts to be included in the Devbox. + name: (Optional) A user specified name to give the Devbox. repo_connection_id: Repository connection id the devbox should source its base image from. @@ -1503,6 +1510,7 @@ async def create( "file_mounts": file_mounts, "launch_parameters": launch_parameters, "metadata": metadata, + "mounts": mounts, "name": name, "repo_connection_id": repo_connection_id, "secrets": secrets, @@ -1861,7 +1869,7 @@ async def execute( specified the command is run from the directory based on the recent state of the persistent shell. - command_id: The command ID for idempotency and tracking + command_id: The command ID in UUIDv7 string format for idempotency and tracking optimistic_timeout: Timeout in seconds to wait for command completion. Operation is not killed. Max is 600 seconds. diff --git a/src/runloop_api_client/resources/repositories.py b/src/runloop_api_client/resources/repositories.py index d11c7e800..49e3fb9a2 100644 --- a/src/runloop_api_client/resources/repositories.py +++ b/src/runloop_api_client/resources/repositories.py @@ -244,7 +244,6 @@ def inspect( self, id: str, *, - blueprint_id: Optional[str] | Omit = omit, github_auth_token: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -259,8 +258,6 @@ def inspect( repo's technical stack and developer environment requirements. Args: - blueprint_id: ID of blueprint to use as base for resulting RepositoryVersion blueprint. - github_auth_token: GitHub authentication token for accessing private repositories. extra_headers: Send extra headers @@ -278,11 +275,7 @@ def inspect( return self._post( f"/v1/repositories/{id}/inspect", body=maybe_transform( - { - "blueprint_id": blueprint_id, - "github_auth_token": github_auth_token, - }, - repository_inspect_params.RepositoryInspectParams, + {"github_auth_token": github_auth_token}, repository_inspect_params.RepositoryInspectParams ), options=make_request_options( extra_headers=extra_headers, @@ -596,7 +589,6 @@ async def inspect( self, id: str, *, - blueprint_id: Optional[str] | Omit = omit, github_auth_token: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -611,8 +603,6 @@ async def inspect( repo's technical stack and developer environment requirements. Args: - blueprint_id: ID of blueprint to use as base for resulting RepositoryVersion blueprint. - github_auth_token: GitHub authentication token for accessing private repositories. extra_headers: Send extra headers @@ -630,11 +620,7 @@ async def inspect( return await self._post( f"/v1/repositories/{id}/inspect", body=await async_maybe_transform( - { - "blueprint_id": blueprint_id, - "github_auth_token": github_auth_token, - }, - repository_inspect_params.RepositoryInspectParams, + {"github_auth_token": github_auth_token}, repository_inspect_params.RepositoryInspectParams ), options=make_request_options( extra_headers=extra_headers, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 6efea2b79..b073c2bd2 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -2,13 +2,13 @@ from __future__ import annotations -from typing import Dict, Iterable, Optional -from typing_extensions import TypedDict +from typing import Dict, Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict from .shared_params.launch_parameters import LaunchParameters from .shared_params.code_mount_parameters import CodeMountParameters -__all__ = ["DevboxCreateParams"] +__all__ = ["DevboxCreateParams", "Mount", "MountObjectMountParameters", "MountAgentMountParameters"] class DevboxCreateParams(TypedDict, total=False): @@ -49,6 +49,9 @@ class DevboxCreateParams(TypedDict, total=False): metadata: Optional[Dict[str, str]] """User defined metadata to attach to the devbox for organization.""" + mounts: Optional[Iterable[Mount]] + """A list of file system mounts to be included in the Devbox.""" + name: Optional[str] """(Optional) A user specified name to give the Devbox.""" @@ -68,3 +71,33 @@ class DevboxCreateParams(TypedDict, total=False): Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified. """ + + +class MountObjectMountParameters(TypedDict, total=False): + object_id: Required[str] + """The ID of the object to write.""" + + object_path: Required[str] + """The path to write the object on the Devbox. + + Use absolute path of object (ie /home/user/object.txt, or directory if archive + /home/user/archive_dir) + """ + + type: Required[Literal["object_mount"]] + + +class MountAgentMountParameters(TypedDict, total=False): + agent_id: Required[str] + """The ID of the agent to mount.""" + + type: Required[Literal["agent_mount"]] + + agent_path: Optional[str] + """Optional path to mount the agent on the Devbox. + + Required for git and object agents. Use absolute path (e.g., /home/user/agent) + """ + + +Mount: TypeAlias = Union[MountObjectMountParameters, MountAgentMountParameters] diff --git a/src/runloop_api_client/types/devbox_execute_params.py b/src/runloop_api_client/types/devbox_execute_params.py index 8ddea07c2..30defa616 100644 --- a/src/runloop_api_client/types/devbox_execute_params.py +++ b/src/runloop_api_client/types/devbox_execute_params.py @@ -18,7 +18,7 @@ class DevboxExecuteParams(TypedDict, total=False): """ command_id: Required[str] - """The command ID for idempotency and tracking""" + """The command ID in UUIDv7 string format for idempotency and tracking""" optimistic_timeout: Optional[int] """Timeout in seconds to wait for command completion. diff --git a/src/runloop_api_client/types/repository_inspect_params.py b/src/runloop_api_client/types/repository_inspect_params.py index c68b4b830..c42103dab 100644 --- a/src/runloop_api_client/types/repository_inspect_params.py +++ b/src/runloop_api_client/types/repository_inspect_params.py @@ -9,8 +9,5 @@ class RepositoryInspectParams(TypedDict, total=False): - blueprint_id: Optional[str] - """ID of blueprint to use as base for resulting RepositoryVersion blueprint.""" - github_auth_token: Optional[str] """GitHub authentication token for accessing private repositories.""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 8fddd5bd4..d55d0dfff 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -81,6 +81,13 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: }, }, metadata={"foo": "string"}, + mounts=[ + { + "object_id": "object_id", + "object_path": "object_path", + "type": "object_mount", + } + ], name="name", repo_connection_id="repo_connection_id", secrets={"foo": "string"}, @@ -1142,6 +1149,13 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - }, }, metadata={"foo": "string"}, + mounts=[ + { + "object_id": "object_id", + "object_path": "object_path", + "type": "object_mount", + } + ], name="name", repo_connection_id="repo_connection_id", secrets={"foo": "string"}, diff --git a/tests/api_resources/test_repositories.py b/tests/api_resources/test_repositories.py index 8e31ed986..c07d16b35 100644 --- a/tests/api_resources/test_repositories.py +++ b/tests/api_resources/test_repositories.py @@ -188,7 +188,6 @@ def test_method_inspect(self, client: Runloop) -> None: def test_method_inspect_with_all_params(self, client: Runloop) -> None: repository = client.repositories.inspect( id="id", - blueprint_id="blueprint_id", github_auth_token="github_auth_token", ) assert_matches_type(RepositoryInspectionDetails, repository, path=["response"]) @@ -481,7 +480,6 @@ async def test_method_inspect(self, async_client: AsyncRunloop) -> None: async def test_method_inspect_with_all_params(self, async_client: AsyncRunloop) -> None: repository = await async_client.repositories.inspect( id="id", - blueprint_id="blueprint_id", github_auth_token="github_auth_token", ) assert_matches_type(RepositoryInspectionDetails, repository, path=["response"]) From 0d793537ef67582e1504c17b8bb0dfdfd5fb83af Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 23:52:31 +0000 Subject: [PATCH 875/993] feat(api): api update --- .stats.yml | 2 +- api.md | 10 ++++- .../resources/devboxes/devboxes.py | 5 ++- src/runloop_api_client/types/__init__.py | 3 ++ .../types/devbox_create_params.py | 37 ++----------------- .../types/shared/__init__.py | 3 ++ .../types/shared/agent_mount_parameters.py | 21 +++++++++++ src/runloop_api_client/types/shared/mount.py | 12 ++++++ .../types/shared/object_mount_parameters.py | 21 +++++++++++ .../types/shared_params/__init__.py | 3 ++ .../shared_params/agent_mount_parameters.py | 21 +++++++++++ .../types/shared_params/mount.py | 13 +++++++ .../shared_params/object_mount_parameters.py | 21 +++++++++++ 13 files changed, 135 insertions(+), 37 deletions(-) create mode 100644 src/runloop_api_client/types/shared/agent_mount_parameters.py create mode 100644 src/runloop_api_client/types/shared/mount.py create mode 100644 src/runloop_api_client/types/shared/object_mount_parameters.py create mode 100644 src/runloop_api_client/types/shared_params/agent_mount_parameters.py create mode 100644 src/runloop_api_client/types/shared_params/mount.py create mode 100644 src/runloop_api_client/types/shared_params/object_mount_parameters.py diff --git a/.stats.yml b/.stats.yml index 820edb715..bd6f2f508 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 92 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6b65a42b74406a77acb03ddb582288396d7af64df16eebf887c77246d3a54470.yml openapi_spec_hash: aeb9f595d53412926ef507174f33a1a1 -config_hash: f9f7bc60c36f103c77333d9149cd3e46 +config_hash: f008c82c6ae5099c9a4b8e1fce1e15f1 diff --git a/api.md b/api.md index 64fff8eea..d0b3b3867 100644 --- a/api.md +++ b/api.md @@ -1,7 +1,15 @@ # Shared Types ```python -from runloop_api_client.types import AfterIdle, CodeMountParameters, LaunchParameters, RunProfile +from runloop_api_client.types import ( + AfterIdle, + AgentMountParameters, + CodeMountParameters, + LaunchParameters, + Mount, + ObjectMountParameters, + RunProfile, +) ``` # Benchmarks diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index b502ade1b..7d59a3547 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -94,6 +94,7 @@ ) from ...types.devbox_view import DevboxView from ...types.devbox_tunnel_view import DevboxTunnelView +from ...types.shared_params.mount import Mount from ...types.devbox_snapshot_view import DevboxSnapshotView from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse @@ -155,7 +156,7 @@ def create( file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, - mounts: Optional[Iterable[devbox_create_params.Mount]] | Omit = omit, + mounts: Optional[Iterable[Mount]] | Omit = omit, name: Optional[str] | Omit = omit, repo_connection_id: Optional[str] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, @@ -1430,7 +1431,7 @@ async def create( file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, - mounts: Optional[Iterable[devbox_create_params.Mount]] | Omit = omit, + mounts: Optional[Iterable[Mount]] | Omit = omit, name: Optional[str] | Omit = omit, repo_connection_id: Optional[str] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index efffa52f1..0fbcf8275 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -3,10 +3,13 @@ from __future__ import annotations from .shared import ( + Mount as Mount, AfterIdle as AfterIdle, RunProfile as RunProfile, LaunchParameters as LaunchParameters, CodeMountParameters as CodeMountParameters, + AgentMountParameters as AgentMountParameters, + ObjectMountParameters as ObjectMountParameters, ) from .devbox_view import DevboxView as DevboxView from .object_view import ObjectView as ObjectView diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index b073c2bd2..c93dcca81 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -2,13 +2,14 @@ from __future__ import annotations -from typing import Dict, Union, Iterable, Optional -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing import Dict, Iterable, Optional +from typing_extensions import TypedDict +from .shared_params.mount import Mount from .shared_params.launch_parameters import LaunchParameters from .shared_params.code_mount_parameters import CodeMountParameters -__all__ = ["DevboxCreateParams", "Mount", "MountObjectMountParameters", "MountAgentMountParameters"] +__all__ = ["DevboxCreateParams"] class DevboxCreateParams(TypedDict, total=False): @@ -71,33 +72,3 @@ class DevboxCreateParams(TypedDict, total=False): Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified. """ - - -class MountObjectMountParameters(TypedDict, total=False): - object_id: Required[str] - """The ID of the object to write.""" - - object_path: Required[str] - """The path to write the object on the Devbox. - - Use absolute path of object (ie /home/user/object.txt, or directory if archive - /home/user/archive_dir) - """ - - type: Required[Literal["object_mount"]] - - -class MountAgentMountParameters(TypedDict, total=False): - agent_id: Required[str] - """The ID of the agent to mount.""" - - type: Required[Literal["agent_mount"]] - - agent_path: Optional[str] - """Optional path to mount the agent on the Devbox. - - Required for git and object agents. Use absolute path (e.g., /home/user/agent) - """ - - -Mount: TypeAlias = Union[MountObjectMountParameters, MountAgentMountParameters] diff --git a/src/runloop_api_client/types/shared/__init__.py b/src/runloop_api_client/types/shared/__init__.py index 356cc4022..39a3b079e 100644 --- a/src/runloop_api_client/types/shared/__init__.py +++ b/src/runloop_api_client/types/shared/__init__.py @@ -1,6 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .mount import Mount as Mount from .after_idle import AfterIdle as AfterIdle from .run_profile import RunProfile as RunProfile from .launch_parameters import LaunchParameters as LaunchParameters from .code_mount_parameters import CodeMountParameters as CodeMountParameters +from .agent_mount_parameters import AgentMountParameters as AgentMountParameters +from .object_mount_parameters import ObjectMountParameters as ObjectMountParameters diff --git a/src/runloop_api_client/types/shared/agent_mount_parameters.py b/src/runloop_api_client/types/shared/agent_mount_parameters.py new file mode 100644 index 000000000..5e92a0641 --- /dev/null +++ b/src/runloop_api_client/types/shared/agent_mount_parameters.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["AgentMountParameters"] + + +class AgentMountParameters(BaseModel): + agent_id: str + """The ID of the agent to mount.""" + + type: Literal["agent_mount"] + + agent_path: Optional[str] = None + """Optional path to mount the agent on the Devbox. + + Required for git and object agents. Use absolute path (e.g., /home/user/agent) + """ diff --git a/src/runloop_api_client/types/shared/mount.py b/src/runloop_api_client/types/shared/mount.py new file mode 100644 index 000000000..7fb68f24a --- /dev/null +++ b/src/runloop_api_client/types/shared/mount.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ..._utils import PropertyInfo +from .agent_mount_parameters import AgentMountParameters +from .object_mount_parameters import ObjectMountParameters + +__all__ = ["Mount"] + +Mount: TypeAlias = Annotated[Union[ObjectMountParameters, AgentMountParameters], PropertyInfo(discriminator="type")] diff --git a/src/runloop_api_client/types/shared/object_mount_parameters.py b/src/runloop_api_client/types/shared/object_mount_parameters.py new file mode 100644 index 000000000..3413d0e1d --- /dev/null +++ b/src/runloop_api_client/types/shared/object_mount_parameters.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ObjectMountParameters"] + + +class ObjectMountParameters(BaseModel): + object_id: str + """The ID of the object to write.""" + + object_path: str + """The path to write the object on the Devbox. + + Use absolute path of object (ie /home/user/object.txt, or directory if archive + /home/user/archive_dir) + """ + + type: Literal["object_mount"] diff --git a/src/runloop_api_client/types/shared_params/__init__.py b/src/runloop_api_client/types/shared_params/__init__.py index 356cc4022..39a3b079e 100644 --- a/src/runloop_api_client/types/shared_params/__init__.py +++ b/src/runloop_api_client/types/shared_params/__init__.py @@ -1,6 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .mount import Mount as Mount from .after_idle import AfterIdle as AfterIdle from .run_profile import RunProfile as RunProfile from .launch_parameters import LaunchParameters as LaunchParameters from .code_mount_parameters import CodeMountParameters as CodeMountParameters +from .agent_mount_parameters import AgentMountParameters as AgentMountParameters +from .object_mount_parameters import ObjectMountParameters as ObjectMountParameters diff --git a/src/runloop_api_client/types/shared_params/agent_mount_parameters.py b/src/runloop_api_client/types/shared_params/agent_mount_parameters.py new file mode 100644 index 000000000..eca7e8cf1 --- /dev/null +++ b/src/runloop_api_client/types/shared_params/agent_mount_parameters.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["AgentMountParameters"] + + +class AgentMountParameters(TypedDict, total=False): + agent_id: Required[str] + """The ID of the agent to mount.""" + + type: Required[Literal["agent_mount"]] + + agent_path: Optional[str] + """Optional path to mount the agent on the Devbox. + + Required for git and object agents. Use absolute path (e.g., /home/user/agent) + """ diff --git a/src/runloop_api_client/types/shared_params/mount.py b/src/runloop_api_client/types/shared_params/mount.py new file mode 100644 index 000000000..fb7e05ba7 --- /dev/null +++ b/src/runloop_api_client/types/shared_params/mount.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from typing_extensions import TypeAlias + +from .agent_mount_parameters import AgentMountParameters +from .object_mount_parameters import ObjectMountParameters + +__all__ = ["Mount"] + +Mount: TypeAlias = Union[ObjectMountParameters, AgentMountParameters] diff --git a/src/runloop_api_client/types/shared_params/object_mount_parameters.py b/src/runloop_api_client/types/shared_params/object_mount_parameters.py new file mode 100644 index 000000000..8b22ebf74 --- /dev/null +++ b/src/runloop_api_client/types/shared_params/object_mount_parameters.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ObjectMountParameters"] + + +class ObjectMountParameters(TypedDict, total=False): + object_id: Required[str] + """The ID of the object to write.""" + + object_path: Required[str] + """The path to write the object on the Devbox. + + Use absolute path of object (ie /home/user/object.txt, or directory if archive + /home/user/archive_dir) + """ + + type: Required[Literal["object_mount"]] From f43fb2063ac4e8235c7496346297951ce2fc5ae4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 2 Oct 2025 23:57:45 +0000 Subject: [PATCH 876/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index fdce87245..3cb6257ce 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.62.0" + ".": "0.63.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 2c96f9ace..9e208823a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.62.0" +version = "0.63.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 628c89ebc..5c8f372d6 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.62.0" # x-release-please-version +__version__ = "0.63.0" # x-release-please-version diff --git a/uv.lock b/uv.lock index da818e083..afc168ec9 100644 --- a/uv.lock +++ b/uv.lock @@ -1771,7 +1771,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "0.62.0" +version = "0.63.0" source = { editable = "." } dependencies = [ { name = "anyio", version = "4.5.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, From 71b9db78923f25afe6eb025dfdd149f94a4a8b0b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 17:45:14 +0000 Subject: [PATCH 877/993] feat(api): api update --- .stats.yml | 4 +- api.md | 1 + .../resources/devboxes/executions.py | 107 ++++++++++++++++ .../types/devboxes/__init__.py | 1 + .../devboxes/execution_send_std_in_params.py | 14 +++ .../api_resources/devboxes/test_executions.py | 114 ++++++++++++++++++ 6 files changed, 239 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/types/devboxes/execution_send_std_in_params.py diff --git a/.stats.yml b/.stats.yml index bd6f2f508..ed778ee7b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 92 +configured_endpoints: 93 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6b65a42b74406a77acb03ddb582288396d7af64df16eebf887c77246d3a54470.yml openapi_spec_hash: aeb9f595d53412926ef507174f33a1a1 -config_hash: f008c82c6ae5099c9a4b8e1fce1e15f1 +config_hash: 97c56b44c382faf3f8cbb0999532054f diff --git a/api.md b/api.md index d0b3b3867..d49b3843b 100644 --- a/api.md +++ b/api.md @@ -195,6 +195,7 @@ Methods: - client.devboxes.executions.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.executions.kill(execution_id, \*, devbox_id, \*\*params) -> DevboxAsyncExecutionDetailView +- client.devboxes.executions.send_std_in(execution_id, \*, devbox_id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.stream_stderr_updates(execution_id, \*, devbox_id, \*\*params) -> ExecutionUpdateChunk - client.devboxes.executions.stream_stdout_updates(execution_id, \*, devbox_id, \*\*params) -> ExecutionUpdateChunk diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index 69106a3bf..b8b899f8f 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -23,6 +23,7 @@ from ...types.devboxes import ( execution_kill_params, execution_retrieve_params, + execution_send_std_in_params, execution_execute_sync_params, execution_execute_async_params, execution_stream_stderr_updates_params, @@ -269,6 +270,53 @@ def kill( cast_to=DevboxAsyncExecutionDetailView, ) + def send_std_in( + self, + execution_id: str, + *, + devbox_id: str, + text: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> DevboxAsyncExecutionDetailView: + """ + Send content to the Std In of a running execution. + + Args: + text: Text to send to std in of the running execution. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not devbox_id: + raise ValueError(f"Expected a non-empty value for `devbox_id` but received {devbox_id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + return self._post( + f"/v1/devboxes/{devbox_id}/executions/{execution_id}/send_std_in", + body=maybe_transform({"text": text}, execution_send_std_in_params.ExecutionSendStdInParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + def stream_stderr_updates( self, execution_id: str, @@ -602,6 +650,53 @@ async def kill( cast_to=DevboxAsyncExecutionDetailView, ) + async def send_std_in( + self, + execution_id: str, + *, + devbox_id: str, + text: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> DevboxAsyncExecutionDetailView: + """ + Send content to the Std In of a running execution. + + Args: + text: Text to send to std in of the running execution. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not devbox_id: + raise ValueError(f"Expected a non-empty value for `devbox_id` but received {devbox_id!r}") + if not execution_id: + raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") + return await self._post( + f"/v1/devboxes/{devbox_id}/executions/{execution_id}/send_std_in", + body=await async_maybe_transform({"text": text}, execution_send_std_in_params.ExecutionSendStdInParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=DevboxAsyncExecutionDetailView, + ) + async def stream_stderr_updates( self, execution_id: str, @@ -715,6 +810,9 @@ def __init__(self, executions: ExecutionsResource) -> None: self.kill = to_raw_response_wrapper( executions.kill, ) + self.send_std_in = to_raw_response_wrapper( + executions.send_std_in, + ) self.stream_stderr_updates = to_raw_response_wrapper( executions.stream_stderr_updates, ) @@ -741,6 +839,9 @@ def __init__(self, executions: AsyncExecutionsResource) -> None: self.kill = async_to_raw_response_wrapper( executions.kill, ) + self.send_std_in = async_to_raw_response_wrapper( + executions.send_std_in, + ) self.stream_stderr_updates = async_to_raw_response_wrapper( executions.stream_stderr_updates, ) @@ -767,6 +868,9 @@ def __init__(self, executions: ExecutionsResource) -> None: self.kill = to_streamed_response_wrapper( executions.kill, ) + self.send_std_in = to_streamed_response_wrapper( + executions.send_std_in, + ) self.stream_stderr_updates = to_streamed_response_wrapper( executions.stream_stderr_updates, ) @@ -793,6 +897,9 @@ def __init__(self, executions: AsyncExecutionsResource) -> None: self.kill = async_to_streamed_response_wrapper( executions.kill, ) + self.send_std_in = async_to_streamed_response_wrapper( + executions.send_std_in, + ) self.stream_stderr_updates = async_to_streamed_response_wrapper( executions.stream_stderr_updates, ) diff --git a/src/runloop_api_client/types/devboxes/__init__.py b/src/runloop_api_client/types/devboxes/__init__.py index 9b7f0134d..0852b4c30 100644 --- a/src/runloop_api_client/types/devboxes/__init__.py +++ b/src/runloop_api_client/types/devboxes/__init__.py @@ -13,6 +13,7 @@ from .disk_snapshot_list_params import DiskSnapshotListParams as DiskSnapshotListParams from .execution_retrieve_params import ExecutionRetrieveParams as ExecutionRetrieveParams from .disk_snapshot_update_params import DiskSnapshotUpdateParams as DiskSnapshotUpdateParams +from .execution_send_std_in_params import ExecutionSendStdInParams as ExecutionSendStdInParams from .execution_execute_sync_params import ExecutionExecuteSyncParams as ExecutionExecuteSyncParams from .execution_execute_async_params import ExecutionExecuteAsyncParams as ExecutionExecuteAsyncParams from .computer_mouse_interaction_params import ComputerMouseInteractionParams as ComputerMouseInteractionParams diff --git a/src/runloop_api_client/types/devboxes/execution_send_std_in_params.py b/src/runloop_api_client/types/devboxes/execution_send_std_in_params.py new file mode 100644 index 000000000..df6dfe672 --- /dev/null +++ b/src/runloop_api_client/types/devboxes/execution_send_std_in_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["ExecutionSendStdInParams"] + + +class ExecutionSendStdInParams(TypedDict, total=False): + devbox_id: Required[str] + + text: str + """Text to send to std in of the running execution.""" diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index d8955edd6..39799105a 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -242,6 +242,63 @@ def test_path_params_kill(self, client: Runloop) -> None: devbox_id="devbox_id", ) + @parametrize + def test_method_send_std_in(self, client: Runloop) -> None: + execution = client.devboxes.executions.send_std_in( + execution_id="execution_id", + devbox_id="devbox_id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_method_send_std_in_with_all_params(self, client: Runloop) -> None: + execution = client.devboxes.executions.send_std_in( + execution_id="execution_id", + devbox_id="devbox_id", + text="text", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_raw_response_send_std_in(self, client: Runloop) -> None: + response = client.devboxes.executions.with_raw_response.send_std_in( + execution_id="execution_id", + devbox_id="devbox_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + def test_streaming_response_send_std_in(self, client: Runloop) -> None: + with client.devboxes.executions.with_streaming_response.send_std_in( + execution_id="execution_id", + devbox_id="devbox_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_send_std_in(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `devbox_id` but received ''"): + client.devboxes.executions.with_raw_response.send_std_in( + execution_id="execution_id", + devbox_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + client.devboxes.executions.with_raw_response.send_std_in( + execution_id="", + devbox_id="devbox_id", + ) + @parametrize def test_method_stream_stderr_updates(self, client: Runloop) -> None: execution_stream = client.devboxes.executions.stream_stderr_updates( @@ -583,6 +640,63 @@ async def test_path_params_kill(self, async_client: AsyncRunloop) -> None: devbox_id="devbox_id", ) + @parametrize + async def test_method_send_std_in(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.send_std_in( + execution_id="execution_id", + devbox_id="devbox_id", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_method_send_std_in_with_all_params(self, async_client: AsyncRunloop) -> None: + execution = await async_client.devboxes.executions.send_std_in( + execution_id="execution_id", + devbox_id="devbox_id", + text="text", + ) + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_raw_response_send_std_in(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.executions.with_raw_response.send_std_in( + execution_id="execution_id", + devbox_id="devbox_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + execution = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + @parametrize + async def test_streaming_response_send_std_in(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.executions.with_streaming_response.send_std_in( + execution_id="execution_id", + devbox_id="devbox_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + execution = await response.parse() + assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_send_std_in(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `devbox_id` but received ''"): + await async_client.devboxes.executions.with_raw_response.send_std_in( + execution_id="execution_id", + devbox_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `execution_id` but received ''"): + await async_client.devboxes.executions.with_raw_response.send_std_in( + execution_id="", + devbox_id="devbox_id", + ) + @parametrize async def test_method_stream_stderr_updates(self, async_client: AsyncRunloop) -> None: execution_stream = await async_client.devboxes.executions.stream_stderr_updates( From 9c08d7bcd453acab8bc8510c6253b201bbd5bde4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 19:06:32 +0000 Subject: [PATCH 878/993] feat(api): api update --- .stats.yml | 8 +- api.md | 1 + .../resources/repositories.py | 105 +++++++++++- tests/api_resources/test_repositories.py | 160 ++++++++++++++---- 4 files changed, 228 insertions(+), 46 deletions(-) diff --git a/.stats.yml b/.stats.yml index ed778ee7b..99d659dd3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 93 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6b65a42b74406a77acb03ddb582288396d7af64df16eebf887c77246d3a54470.yml -openapi_spec_hash: aeb9f595d53412926ef507174f33a1a1 -config_hash: 97c56b44c382faf3f8cbb0999532054f +configured_endpoints: 94 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6bdf8a52fe1e6d7564c6cc54b3743ea05ea324a9420808764b17d02483dbaf86.yml +openapi_spec_hash: 23c253ceed235b9f13794beb091941c8 +config_hash: 82af97d4d6dde958eed9f5e4ae55f75a diff --git a/api.md b/api.md index d49b3843b..206ca6f36 100644 --- a/api.md +++ b/api.md @@ -310,6 +310,7 @@ Methods: - client.repositories.inspect(id, \*\*params) -> RepositoryInspectionDetails - client.repositories.list_inspections(id) -> RepositoryInspectionListView - client.repositories.refresh(id, \*\*params) -> object +- client.repositories.retrieve_inspection(id) -> RepositoryInspectionDetails # Secrets diff --git a/src/runloop_api_client/resources/repositories.py b/src/runloop_api_client/resources/repositories.py index 49e3fb9a2..e2b238750 100644 --- a/src/runloop_api_client/resources/repositories.py +++ b/src/runloop_api_client/resources/repositories.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Optional import httpx @@ -321,6 +322,7 @@ def list_inspections( cast_to=RepositoryInspectionListView, ) + @typing_extensions.deprecated("deprecated") def refresh( self, id: str, @@ -375,6 +377,39 @@ def refresh( cast_to=object, ) + def retrieve_inspection( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RepositoryInspectionDetails: + """ + Get a repository inspection by id. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/repositories/inspections/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RepositoryInspectionDetails, + ) + class AsyncRepositoriesResource(AsyncAPIResource): @cached_property @@ -666,6 +701,7 @@ async def list_inspections( cast_to=RepositoryInspectionListView, ) + @typing_extensions.deprecated("deprecated") async def refresh( self, id: str, @@ -720,6 +756,39 @@ async def refresh( cast_to=object, ) + async def retrieve_inspection( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> RepositoryInspectionDetails: + """ + Get a repository inspection by id. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/repositories/inspections/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=RepositoryInspectionDetails, + ) + class RepositoriesResourceWithRawResponse: def __init__(self, repositories: RepositoriesResource) -> None: @@ -743,8 +812,13 @@ def __init__(self, repositories: RepositoriesResource) -> None: self.list_inspections = to_raw_response_wrapper( repositories.list_inspections, ) - self.refresh = to_raw_response_wrapper( - repositories.refresh, + self.refresh = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + repositories.refresh, # pyright: ignore[reportDeprecated], + ) + ) + self.retrieve_inspection = to_raw_response_wrapper( + repositories.retrieve_inspection, ) @@ -770,8 +844,13 @@ def __init__(self, repositories: AsyncRepositoriesResource) -> None: self.list_inspections = async_to_raw_response_wrapper( repositories.list_inspections, ) - self.refresh = async_to_raw_response_wrapper( - repositories.refresh, + self.refresh = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + repositories.refresh, # pyright: ignore[reportDeprecated], + ) + ) + self.retrieve_inspection = async_to_raw_response_wrapper( + repositories.retrieve_inspection, ) @@ -797,8 +876,13 @@ def __init__(self, repositories: RepositoriesResource) -> None: self.list_inspections = to_streamed_response_wrapper( repositories.list_inspections, ) - self.refresh = to_streamed_response_wrapper( - repositories.refresh, + self.refresh = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + repositories.refresh, # pyright: ignore[reportDeprecated], + ) + ) + self.retrieve_inspection = to_streamed_response_wrapper( + repositories.retrieve_inspection, ) @@ -824,6 +908,11 @@ def __init__(self, repositories: AsyncRepositoriesResource) -> None: self.list_inspections = async_to_streamed_response_wrapper( repositories.list_inspections, ) - self.refresh = async_to_streamed_response_wrapper( - repositories.refresh, + self.refresh = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + repositories.refresh, # pyright: ignore[reportDeprecated], + ) + ) + self.retrieve_inspection = async_to_streamed_response_wrapper( + repositories.retrieve_inspection, ) diff --git a/tests/api_resources/test_repositories.py b/tests/api_resources/test_repositories.py index c07d16b35..282688d80 100644 --- a/tests/api_resources/test_repositories.py +++ b/tests/api_resources/test_repositories.py @@ -16,6 +16,8 @@ ) from runloop_api_client.pagination import SyncRepositoriesCursorIDPage, AsyncRepositoriesCursorIDPage +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -263,25 +265,30 @@ def test_path_params_list_inspections(self, client: Runloop) -> None: @parametrize def test_method_refresh(self, client: Runloop) -> None: - repository = client.repositories.refresh( - id="id", - ) + with pytest.warns(DeprecationWarning): + repository = client.repositories.refresh( + id="id", + ) + assert_matches_type(object, repository, path=["response"]) @parametrize def test_method_refresh_with_all_params(self, client: Runloop) -> None: - repository = client.repositories.refresh( - id="id", - blueprint_id="blueprint_id", - github_auth_token="github_auth_token", - ) + with pytest.warns(DeprecationWarning): + repository = client.repositories.refresh( + id="id", + blueprint_id="blueprint_id", + github_auth_token="github_auth_token", + ) + assert_matches_type(object, repository, path=["response"]) @parametrize def test_raw_response_refresh(self, client: Runloop) -> None: - response = client.repositories.with_raw_response.refresh( - id="id", - ) + with pytest.warns(DeprecationWarning): + response = client.repositories.with_raw_response.refresh( + id="id", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -290,22 +297,62 @@ def test_raw_response_refresh(self, client: Runloop) -> None: @parametrize def test_streaming_response_refresh(self, client: Runloop) -> None: - with client.repositories.with_streaming_response.refresh( - id="id", + with pytest.warns(DeprecationWarning): + with client.repositories.with_streaming_response.refresh( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = response.parse() + assert_matches_type(object, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_refresh(self, client: Runloop) -> None: + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.repositories.with_raw_response.refresh( + id="", + ) + + @parametrize + def test_method_retrieve_inspection(self, client: Runloop) -> None: + repository = client.repositories.retrieve_inspection( + "id", + ) + assert_matches_type(RepositoryInspectionDetails, repository, path=["response"]) + + @parametrize + def test_raw_response_retrieve_inspection(self, client: Runloop) -> None: + response = client.repositories.with_raw_response.retrieve_inspection( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = response.parse() + assert_matches_type(RepositoryInspectionDetails, repository, path=["response"]) + + @parametrize + def test_streaming_response_retrieve_inspection(self, client: Runloop) -> None: + with client.repositories.with_streaming_response.retrieve_inspection( + "id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" repository = response.parse() - assert_matches_type(object, repository, path=["response"]) + assert_matches_type(RepositoryInspectionDetails, repository, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_refresh(self, client: Runloop) -> None: + def test_path_params_retrieve_inspection(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.repositories.with_raw_response.refresh( - id="", + client.repositories.with_raw_response.retrieve_inspection( + "", ) @@ -555,25 +602,30 @@ async def test_path_params_list_inspections(self, async_client: AsyncRunloop) -> @parametrize async def test_method_refresh(self, async_client: AsyncRunloop) -> None: - repository = await async_client.repositories.refresh( - id="id", - ) + with pytest.warns(DeprecationWarning): + repository = await async_client.repositories.refresh( + id="id", + ) + assert_matches_type(object, repository, path=["response"]) @parametrize async def test_method_refresh_with_all_params(self, async_client: AsyncRunloop) -> None: - repository = await async_client.repositories.refresh( - id="id", - blueprint_id="blueprint_id", - github_auth_token="github_auth_token", - ) + with pytest.warns(DeprecationWarning): + repository = await async_client.repositories.refresh( + id="id", + blueprint_id="blueprint_id", + github_auth_token="github_auth_token", + ) + assert_matches_type(object, repository, path=["response"]) @parametrize async def test_raw_response_refresh(self, async_client: AsyncRunloop) -> None: - response = await async_client.repositories.with_raw_response.refresh( - id="id", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.repositories.with_raw_response.refresh( + id="id", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -582,20 +634,60 @@ async def test_raw_response_refresh(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_refresh(self, async_client: AsyncRunloop) -> None: - async with async_client.repositories.with_streaming_response.refresh( - id="id", + with pytest.warns(DeprecationWarning): + async with async_client.repositories.with_streaming_response.refresh( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = await response.parse() + assert_matches_type(object, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_refresh(self, async_client: AsyncRunloop) -> None: + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.repositories.with_raw_response.refresh( + id="", + ) + + @parametrize + async def test_method_retrieve_inspection(self, async_client: AsyncRunloop) -> None: + repository = await async_client.repositories.retrieve_inspection( + "id", + ) + assert_matches_type(RepositoryInspectionDetails, repository, path=["response"]) + + @parametrize + async def test_raw_response_retrieve_inspection(self, async_client: AsyncRunloop) -> None: + response = await async_client.repositories.with_raw_response.retrieve_inspection( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = await response.parse() + assert_matches_type(RepositoryInspectionDetails, repository, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve_inspection(self, async_client: AsyncRunloop) -> None: + async with async_client.repositories.with_streaming_response.retrieve_inspection( + "id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" repository = await response.parse() - assert_matches_type(object, repository, path=["response"]) + assert_matches_type(RepositoryInspectionDetails, repository, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_refresh(self, async_client: AsyncRunloop) -> None: + async def test_path_params_retrieve_inspection(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.repositories.with_raw_response.refresh( - id="", + await async_client.repositories.with_raw_response.retrieve_inspection( + "", ) From fb4fadf2c21d9ba9b34614b7d5205d8ef9bad7e4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 20:34:11 +0000 Subject: [PATCH 879/993] feat(api): api update --- .stats.yml | 4 +-- .../resources/devboxes/executions.py | 27 ++++++++++++++++--- .../devboxes/execution_send_std_in_params.py | 8 ++++-- .../api_resources/devboxes/test_executions.py | 2 ++ 4 files changed, 33 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 99d659dd3..3999b4279 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-6bdf8a52fe1e6d7564c6cc54b3743ea05ea324a9420808764b17d02483dbaf86.yml -openapi_spec_hash: 23c253ceed235b9f13794beb091941c8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d1cc15eb5ef9125c6eef2855fc9ccc1129f68116e20ac0a72a9c77a445909033.yml +openapi_spec_hash: 925f218d18ed7f1faff9389b318a674f config_hash: 82af97d4d6dde958eed9f5e4ae55f75a diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index b8b899f8f..38688629e 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -4,6 +4,7 @@ import typing_extensions from typing import Optional +from typing_extensions import Literal import httpx @@ -275,7 +276,8 @@ def send_std_in( execution_id: str, *, devbox_id: str, - text: str | Omit = omit, + signal: Optional[Literal["EOF", "INTERRUPT"]] | Omit = omit, + text: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -288,6 +290,8 @@ def send_std_in( Send content to the Std In of a running execution. Args: + signal: Signal to send to std in of the running execution. + text: Text to send to std in of the running execution. extra_headers: Send extra headers @@ -306,7 +310,13 @@ def send_std_in( raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") return self._post( f"/v1/devboxes/{devbox_id}/executions/{execution_id}/send_std_in", - body=maybe_transform({"text": text}, execution_send_std_in_params.ExecutionSendStdInParams), + body=maybe_transform( + { + "signal": signal, + "text": text, + }, + execution_send_std_in_params.ExecutionSendStdInParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -655,7 +665,8 @@ async def send_std_in( execution_id: str, *, devbox_id: str, - text: str | Omit = omit, + signal: Optional[Literal["EOF", "INTERRUPT"]] | Omit = omit, + text: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -668,6 +679,8 @@ async def send_std_in( Send content to the Std In of a running execution. Args: + signal: Signal to send to std in of the running execution. + text: Text to send to std in of the running execution. extra_headers: Send extra headers @@ -686,7 +699,13 @@ async def send_std_in( raise ValueError(f"Expected a non-empty value for `execution_id` but received {execution_id!r}") return await self._post( f"/v1/devboxes/{devbox_id}/executions/{execution_id}/send_std_in", - body=await async_maybe_transform({"text": text}, execution_send_std_in_params.ExecutionSendStdInParams), + body=await async_maybe_transform( + { + "signal": signal, + "text": text, + }, + execution_send_std_in_params.ExecutionSendStdInParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/runloop_api_client/types/devboxes/execution_send_std_in_params.py b/src/runloop_api_client/types/devboxes/execution_send_std_in_params.py index df6dfe672..0d8358958 100644 --- a/src/runloop_api_client/types/devboxes/execution_send_std_in_params.py +++ b/src/runloop_api_client/types/devboxes/execution_send_std_in_params.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing import Optional +from typing_extensions import Literal, Required, TypedDict __all__ = ["ExecutionSendStdInParams"] @@ -10,5 +11,8 @@ class ExecutionSendStdInParams(TypedDict, total=False): devbox_id: Required[str] - text: str + signal: Optional[Literal["EOF", "INTERRUPT"]] + """Signal to send to std in of the running execution.""" + + text: Optional[str] """Text to send to std in of the running execution.""" diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index 39799105a..b6952be5b 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -255,6 +255,7 @@ def test_method_send_std_in_with_all_params(self, client: Runloop) -> None: execution = client.devboxes.executions.send_std_in( execution_id="execution_id", devbox_id="devbox_id", + signal="EOF", text="text", ) assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) @@ -653,6 +654,7 @@ async def test_method_send_std_in_with_all_params(self, async_client: AsyncRunlo execution = await async_client.devboxes.executions.send_std_in( execution_id="execution_id", devbox_id="devbox_id", + signal="EOF", text="text", ) assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) From 983d52c708bc27caabf6f1c3c184c334a279a6f0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 22:57:10 +0000 Subject: [PATCH 880/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3cb6257ce..4c56f2a48 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.63.0" + ".": "0.64.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 9e208823a..f9b4a780b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.63.0" +version = "0.64.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 5c8f372d6..86a8c7253 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.63.0" # x-release-please-version +__version__ = "0.64.0" # x-release-please-version diff --git a/uv.lock b/uv.lock index afc168ec9..4ec46c191 100644 --- a/uv.lock +++ b/uv.lock @@ -1771,7 +1771,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "0.63.0" +version = "0.64.0" source = { editable = "." } dependencies = [ { name = "anyio", version = "4.5.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, From edd18d8dfdb7fe98d35a65cbf6e0bd179fa7dada Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 11 Oct 2025 02:12:25 +0000 Subject: [PATCH 881/993] chore(internal): detect missing future annotations with ruff --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index f9b4a780b..29dbee20f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -209,6 +209,8 @@ select = [ "B", # remove unused imports "F401", + # check for missing future annotations + "FA102", # bare except statements "E722", # unused arguments @@ -231,6 +233,8 @@ unfixable = [ "T203", ] +extend-safe-fixes = ["FA102"] + [tool.ruff.lint.flake8-tidy-imports.banned-api] "functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead" From 1c57bdb182dfbea7e645f3763fa8dec1adbf672d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Oct 2025 22:54:15 +0000 Subject: [PATCH 882/993] feat(api): api update --- .stats.yml | 6 +- api.md | 4 +- .../resources/devboxes/devboxes.py | 64 ++++++++++++++++++- .../resources/devboxes/disk_snapshots.py | 8 +++ .../resources/devboxes/executions.py | 39 ++++++++--- src/runloop_api_client/types/__init__.py | 1 + .../types/devbox_execute_async_params.py | 6 ++ .../types/devbox_execute_params.py | 3 + .../types/devbox_execute_sync_params.py | 6 ++ .../types/devbox_send_std_in_result.py | 16 +++++ .../devbox_snapshot_disk_async_params.py | 3 + .../types/devbox_snapshot_disk_params.py | 3 + .../types/devbox_snapshot_view.py | 3 + .../types/devbox_wait_for_command_params.py | 3 + .../devboxes/disk_snapshot_update_params.py | 3 + .../execution_execute_async_params.py | 6 ++ .../devboxes/execution_execute_sync_params.py | 6 ++ .../devboxes/execution_retrieve_params.py | 2 +- src/runloop_api_client/types/object_view.py | 3 + .../devboxes/test_disk_snapshots.py | 2 + .../api_resources/devboxes/test_executions.py | 22 ++++--- tests/api_resources/test_devboxes.py | 12 ++++ 22 files changed, 197 insertions(+), 24 deletions(-) create mode 100644 src/runloop_api_client/types/devbox_send_std_in_result.py diff --git a/.stats.yml b/.stats.yml index 3999b4279..d4e6d79a9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d1cc15eb5ef9125c6eef2855fc9ccc1129f68116e20ac0a72a9c77a445909033.yml -openapi_spec_hash: 925f218d18ed7f1faff9389b318a674f -config_hash: 82af97d4d6dde958eed9f5e4ae55f75a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-436b4f5c7426cca5e0133377ac1a0d1491b5705407a3d877c3b4abeb4e9935f1.yml +openapi_spec_hash: cd980135831e4407f1063af254fba1cd +config_hash: 95facb8cef59b5a1b05763b871bf6a4b diff --git a/api.md b/api.md index 206ca6f36..811f49ba4 100644 --- a/api.md +++ b/api.md @@ -85,6 +85,8 @@ from runloop_api_client.types import ( DevboxExecutionDetailView, DevboxKillExecutionRequest, DevboxListView, + DevboxSendStdInRequest, + DevboxSendStdInResult, DevboxSnapshotListView, DevboxSnapshotView, DevboxTunnelView, @@ -195,7 +197,7 @@ Methods: - client.devboxes.executions.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.executions.execute_sync(id, \*\*params) -> DevboxExecutionDetailView - client.devboxes.executions.kill(execution_id, \*, devbox_id, \*\*params) -> DevboxAsyncExecutionDetailView -- client.devboxes.executions.send_std_in(execution_id, \*, devbox_id, \*\*params) -> DevboxAsyncExecutionDetailView +- client.devboxes.executions.send_std_in(execution_id, \*, devbox_id, \*\*params) -> DevboxSendStdInResult - client.devboxes.executions.stream_stderr_updates(execution_id, \*, devbox_id, \*\*params) -> ExecutionUpdateChunk - client.devboxes.executions.stream_stdout_updates(execution_id, \*, devbox_id, \*\*params) -> ExecutionUpdateChunk diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 7d59a3547..5023b17ac 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -574,6 +574,7 @@ def execute( *, command: str, command_id: str, + last_n: str | Omit = omit, optimistic_timeout: Optional[int] | Omit = omit, shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -588,6 +589,8 @@ def execute( Execute a command with a known command ID on a devbox, optimistically waiting for it to complete within the specified timeout. If it completes in time, return the result. If not, return a status indicating the command is still running. + Note: attach_stdin parameter is not supported; use execute_async for stdin + support. Args: command: The command to execute via the Devbox shell. By default, commands are run from @@ -597,6 +600,8 @@ def execute( command_id: The command ID in UUIDv7 string format for idempotency and tracking + last_n: Last n lines of standard error / standard out to return (default: 100) + optimistic_timeout: Timeout in seconds to wait for command completion. Operation is not killed. Max is 600 seconds. @@ -635,6 +640,7 @@ def execute( extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key, + query=maybe_transform({"last_n": last_n}, devbox_execute_params.DevboxExecuteParams), ), cast_to=DevboxAsyncExecutionDetailView, ) @@ -644,6 +650,7 @@ def execute_async( id: str, *, command: str, + attach_stdin: Optional[bool] | Omit = omit, shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -663,6 +670,9 @@ def execute_async( specified the command is run from the directory based on the recent state of the persistent shell. + attach_stdin: Whether to attach stdin streaming for async commands. Not valid for execute_sync + endpoint. Defaults to false if not specified. + shell_name: The name of the persistent shell to create or use if already created. When using a persistent shell, the command will run from the directory at the end of the previous command and environment variables will be preserved. @@ -684,6 +694,7 @@ def execute_async( body=maybe_transform( { "command": command, + "attach_stdin": attach_stdin, "shell_name": shell_name, }, devbox_execute_async_params.DevboxExecuteAsyncParams, @@ -704,6 +715,7 @@ def execute_sync( id: str, *, command: str, + attach_stdin: Optional[bool] | Omit = omit, shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -715,7 +727,8 @@ def execute_sync( ) -> DevboxExecutionDetailView: """ Execute a bash command in the Devbox shell, await the command completion and - return the output. + return the output. Note: attach_stdin parameter is not supported for synchronous + execution. Args: command: The command to execute via the Devbox shell. By default, commands are run from @@ -723,6 +736,9 @@ def execute_sync( specified the command is run from the directory based on the recent state of the persistent shell. + attach_stdin: Whether to attach stdin streaming for async commands. Not valid for execute_sync + endpoint. Defaults to false if not specified. + shell_name: The name of the persistent shell to create or use if already created. When using a persistent shell, the command will run from the directory at the end of the previous command and environment variables will be preserved. @@ -746,6 +762,7 @@ def execute_sync( body=maybe_transform( { "command": command, + "attach_stdin": attach_stdin, "shell_name": shell_name, }, devbox_execute_sync_params.DevboxExecuteSyncParams, @@ -1049,6 +1066,7 @@ def snapshot_disk( self, id: str, *, + commit_message: Optional[str] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1064,6 +1082,8 @@ def snapshot_disk( enable launching future Devboxes with the same disk state. Args: + commit_message: (Optional) Commit message associated with the snapshot (max 1000 characters) + metadata: (Optional) Metadata used to describe the snapshot name: (Optional) A user specified name to give the snapshot @@ -1086,6 +1106,7 @@ def snapshot_disk( f"/v1/devboxes/{id}/snapshot_disk", body=maybe_transform( { + "commit_message": commit_message, "metadata": metadata, "name": name, }, @@ -1105,6 +1126,7 @@ def snapshot_disk_async( self, id: str, *, + commit_message: Optional[str] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1121,6 +1143,8 @@ def snapshot_disk_async( monitored using the query endpoint. Args: + commit_message: (Optional) Commit message associated with the snapshot (max 1000 characters) + metadata: (Optional) Metadata used to describe the snapshot name: (Optional) A user specified name to give the snapshot @@ -1141,6 +1165,7 @@ def snapshot_disk_async( f"/v1/devboxes/{id}/snapshot_disk_async", body=maybe_transform( { + "commit_message": commit_message, "metadata": metadata, "name": name, }, @@ -1267,6 +1292,7 @@ def wait_for_command( *, devbox_id: str, statuses: List[Literal["queued", "running", "completed"]], + last_n: str | Omit = omit, timeout_seconds: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1285,6 +1311,8 @@ def wait_for_command( provided. The command will be returned as soon as it reaches any of the provided statuses. + last_n: Last n lines of standard error / standard out to return (default: 100) + timeout_seconds: (Optional) Timeout in seconds to wait for the status, up to 60 seconds. Defaults to 60 seconds. @@ -1317,6 +1345,7 @@ def wait_for_command( extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key, + query=maybe_transform({"last_n": last_n}, devbox_wait_for_command_params.DevboxWaitForCommandParams), ), cast_to=DevboxAsyncExecutionDetailView, ) @@ -1849,6 +1878,7 @@ async def execute( *, command: str, command_id: str, + last_n: str | Omit = omit, optimistic_timeout: Optional[int] | Omit = omit, shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1863,6 +1893,8 @@ async def execute( Execute a command with a known command ID on a devbox, optimistically waiting for it to complete within the specified timeout. If it completes in time, return the result. If not, return a status indicating the command is still running. + Note: attach_stdin parameter is not supported; use execute_async for stdin + support. Args: command: The command to execute via the Devbox shell. By default, commands are run from @@ -1872,6 +1904,8 @@ async def execute( command_id: The command ID in UUIDv7 string format for idempotency and tracking + last_n: Last n lines of standard error / standard out to return (default: 100) + optimistic_timeout: Timeout in seconds to wait for command completion. Operation is not killed. Max is 600 seconds. @@ -1910,6 +1944,7 @@ async def execute( extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key, + query=await async_maybe_transform({"last_n": last_n}, devbox_execute_params.DevboxExecuteParams), ), cast_to=DevboxAsyncExecutionDetailView, ) @@ -1919,6 +1954,7 @@ async def execute_async( id: str, *, command: str, + attach_stdin: Optional[bool] | Omit = omit, shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1938,6 +1974,9 @@ async def execute_async( specified the command is run from the directory based on the recent state of the persistent shell. + attach_stdin: Whether to attach stdin streaming for async commands. Not valid for execute_sync + endpoint. Defaults to false if not specified. + shell_name: The name of the persistent shell to create or use if already created. When using a persistent shell, the command will run from the directory at the end of the previous command and environment variables will be preserved. @@ -1959,6 +1998,7 @@ async def execute_async( body=await async_maybe_transform( { "command": command, + "attach_stdin": attach_stdin, "shell_name": shell_name, }, devbox_execute_async_params.DevboxExecuteAsyncParams, @@ -1979,6 +2019,7 @@ async def execute_sync( id: str, *, command: str, + attach_stdin: Optional[bool] | Omit = omit, shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1990,7 +2031,8 @@ async def execute_sync( ) -> DevboxExecutionDetailView: """ Execute a bash command in the Devbox shell, await the command completion and - return the output. + return the output. Note: attach_stdin parameter is not supported for synchronous + execution. Args: command: The command to execute via the Devbox shell. By default, commands are run from @@ -1998,6 +2040,9 @@ async def execute_sync( specified the command is run from the directory based on the recent state of the persistent shell. + attach_stdin: Whether to attach stdin streaming for async commands. Not valid for execute_sync + endpoint. Defaults to false if not specified. + shell_name: The name of the persistent shell to create or use if already created. When using a persistent shell, the command will run from the directory at the end of the previous command and environment variables will be preserved. @@ -2021,6 +2066,7 @@ async def execute_sync( body=await async_maybe_transform( { "command": command, + "attach_stdin": attach_stdin, "shell_name": shell_name, }, devbox_execute_sync_params.DevboxExecuteSyncParams, @@ -2324,6 +2370,7 @@ async def snapshot_disk( self, id: str, *, + commit_message: Optional[str] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2339,6 +2386,8 @@ async def snapshot_disk( enable launching future Devboxes with the same disk state. Args: + commit_message: (Optional) Commit message associated with the snapshot (max 1000 characters) + metadata: (Optional) Metadata used to describe the snapshot name: (Optional) A user specified name to give the snapshot @@ -2361,6 +2410,7 @@ async def snapshot_disk( f"/v1/devboxes/{id}/snapshot_disk", body=await async_maybe_transform( { + "commit_message": commit_message, "metadata": metadata, "name": name, }, @@ -2380,6 +2430,7 @@ async def snapshot_disk_async( self, id: str, *, + commit_message: Optional[str] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2396,6 +2447,8 @@ async def snapshot_disk_async( monitored using the query endpoint. Args: + commit_message: (Optional) Commit message associated with the snapshot (max 1000 characters) + metadata: (Optional) Metadata used to describe the snapshot name: (Optional) A user specified name to give the snapshot @@ -2416,6 +2469,7 @@ async def snapshot_disk_async( f"/v1/devboxes/{id}/snapshot_disk_async", body=await async_maybe_transform( { + "commit_message": commit_message, "metadata": metadata, "name": name, }, @@ -2542,6 +2596,7 @@ async def wait_for_command( *, devbox_id: str, statuses: List[Literal["queued", "running", "completed"]], + last_n: str | Omit = omit, timeout_seconds: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2560,6 +2615,8 @@ async def wait_for_command( provided. The command will be returned as soon as it reaches any of the provided statuses. + last_n: Last n lines of standard error / standard out to return (default: 100) + timeout_seconds: (Optional) Timeout in seconds to wait for the status, up to 60 seconds. Defaults to 60 seconds. @@ -2592,6 +2649,9 @@ async def wait_for_command( extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key, + query=await async_maybe_transform( + {"last_n": last_n}, devbox_wait_for_command_params.DevboxWaitForCommandParams + ), ), cast_to=DevboxAsyncExecutionDetailView, ) diff --git a/src/runloop_api_client/resources/devboxes/disk_snapshots.py b/src/runloop_api_client/resources/devboxes/disk_snapshots.py index 38a91fd8d..3575b41f0 100644 --- a/src/runloop_api_client/resources/devboxes/disk_snapshots.py +++ b/src/runloop_api_client/resources/devboxes/disk_snapshots.py @@ -49,6 +49,7 @@ def update( self, id: str, *, + commit_message: Optional[str] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -65,6 +66,8 @@ def update( replaced. Args: + commit_message: (Optional) Commit message associated with the snapshot (max 1000 characters) + metadata: (Optional) Metadata used to describe the snapshot name: (Optional) A user specified name to give the snapshot @@ -85,6 +88,7 @@ def update( f"/v1/devboxes/disk_snapshots/{id}", body=maybe_transform( { + "commit_message": commit_message, "metadata": metadata, "name": name, }, @@ -260,6 +264,7 @@ async def update( self, id: str, *, + commit_message: Optional[str] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -276,6 +281,8 @@ async def update( replaced. Args: + commit_message: (Optional) Commit message associated with the snapshot (max 1000 characters) + metadata: (Optional) Metadata used to describe the snapshot name: (Optional) A user specified name to give the snapshot @@ -296,6 +303,7 @@ async def update( f"/v1/devboxes/disk_snapshots/{id}", body=await async_maybe_transform( { + "commit_message": commit_message, "metadata": metadata, "name": name, }, diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index 38688629e..ba62abf4d 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -30,6 +30,7 @@ execution_stream_stderr_updates_params, execution_stream_stdout_updates_params, ) +from ...types.devbox_send_std_in_result import DevboxSendStdInResult from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devboxes.execution_update_chunk import ExecutionUpdateChunk from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView @@ -75,7 +76,7 @@ def retrieve( stdout/error and the exit code if complete. Args: - last_n: Last n lines of standard error / standard out to return + last_n: Last n lines of standard error / standard out to return (default: 100) extra_headers: Send extra headers @@ -106,6 +107,7 @@ def execute_async( id: str, *, command: str, + attach_stdin: Optional[bool] | Omit = omit, shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -125,6 +127,9 @@ def execute_async( specified the command is run from the directory based on the recent state of the persistent shell. + attach_stdin: Whether to attach stdin streaming for async commands. Not valid for execute_sync + endpoint. Defaults to false if not specified. + shell_name: The name of the persistent shell to create or use if already created. When using a persistent shell, the command will run from the directory at the end of the previous command and environment variables will be preserved. @@ -146,6 +151,7 @@ def execute_async( body=maybe_transform( { "command": command, + "attach_stdin": attach_stdin, "shell_name": shell_name, }, execution_execute_async_params.ExecutionExecuteAsyncParams, @@ -166,6 +172,7 @@ def execute_sync( id: str, *, command: str, + attach_stdin: Optional[bool] | Omit = omit, shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -177,7 +184,8 @@ def execute_sync( ) -> DevboxExecutionDetailView: """ Execute a bash command in the Devbox shell, await the command completion and - return the output. + return the output. Note: attach_stdin parameter is not supported for synchronous + execution. Args: command: The command to execute via the Devbox shell. By default, commands are run from @@ -185,6 +193,9 @@ def execute_sync( specified the command is run from the directory based on the recent state of the persistent shell. + attach_stdin: Whether to attach stdin streaming for async commands. Not valid for execute_sync + endpoint. Defaults to false if not specified. + shell_name: The name of the persistent shell to create or use if already created. When using a persistent shell, the command will run from the directory at the end of the previous command and environment variables will be preserved. @@ -208,6 +219,7 @@ def execute_sync( body=maybe_transform( { "command": command, + "attach_stdin": attach_stdin, "shell_name": shell_name, }, execution_execute_sync_params.ExecutionExecuteSyncParams, @@ -285,7 +297,7 @@ def send_std_in( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, - ) -> DevboxAsyncExecutionDetailView: + ) -> DevboxSendStdInResult: """ Send content to the Std In of a running execution. @@ -324,7 +336,7 @@ def send_std_in( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=DevboxAsyncExecutionDetailView, + cast_to=DevboxSendStdInResult, ) def stream_stderr_updates( @@ -460,7 +472,7 @@ async def retrieve( stdout/error and the exit code if complete. Args: - last_n: Last n lines of standard error / standard out to return + last_n: Last n lines of standard error / standard out to return (default: 100) extra_headers: Send extra headers @@ -493,6 +505,7 @@ async def execute_async( id: str, *, command: str, + attach_stdin: Optional[bool] | Omit = omit, shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -512,6 +525,9 @@ async def execute_async( specified the command is run from the directory based on the recent state of the persistent shell. + attach_stdin: Whether to attach stdin streaming for async commands. Not valid for execute_sync + endpoint. Defaults to false if not specified. + shell_name: The name of the persistent shell to create or use if already created. When using a persistent shell, the command will run from the directory at the end of the previous command and environment variables will be preserved. @@ -533,6 +549,7 @@ async def execute_async( body=await async_maybe_transform( { "command": command, + "attach_stdin": attach_stdin, "shell_name": shell_name, }, execution_execute_async_params.ExecutionExecuteAsyncParams, @@ -553,6 +570,7 @@ async def execute_sync( id: str, *, command: str, + attach_stdin: Optional[bool] | Omit = omit, shell_name: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -564,7 +582,8 @@ async def execute_sync( ) -> DevboxExecutionDetailView: """ Execute a bash command in the Devbox shell, await the command completion and - return the output. + return the output. Note: attach_stdin parameter is not supported for synchronous + execution. Args: command: The command to execute via the Devbox shell. By default, commands are run from @@ -572,6 +591,9 @@ async def execute_sync( specified the command is run from the directory based on the recent state of the persistent shell. + attach_stdin: Whether to attach stdin streaming for async commands. Not valid for execute_sync + endpoint. Defaults to false if not specified. + shell_name: The name of the persistent shell to create or use if already created. When using a persistent shell, the command will run from the directory at the end of the previous command and environment variables will be preserved. @@ -595,6 +617,7 @@ async def execute_sync( body=await async_maybe_transform( { "command": command, + "attach_stdin": attach_stdin, "shell_name": shell_name, }, execution_execute_sync_params.ExecutionExecuteSyncParams, @@ -674,7 +697,7 @@ async def send_std_in( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, - ) -> DevboxAsyncExecutionDetailView: + ) -> DevboxSendStdInResult: """ Send content to the Std In of a running execution. @@ -713,7 +736,7 @@ async def send_std_in( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=DevboxAsyncExecutionDetailView, + cast_to=DevboxSendStdInResult, ) async def stream_stderr_updates( diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 0fbcf8275..2330d5227 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -60,6 +60,7 @@ from .object_download_url_view import ObjectDownloadURLView as ObjectDownloadURLView from .repository_create_params import RepositoryCreateParams as RepositoryCreateParams from .repository_manifest_view import RepositoryManifestView as RepositoryManifestView +from .devbox_send_std_in_result import DevboxSendStdInResult as DevboxSendStdInResult from .devbox_snapshot_list_view import DevboxSnapshotListView as DevboxSnapshotListView from .devbox_upload_file_params import DevboxUploadFileParams as DevboxUploadFileParams from .object_list_public_params import ObjectListPublicParams as ObjectListPublicParams diff --git a/src/runloop_api_client/types/devbox_execute_async_params.py b/src/runloop_api_client/types/devbox_execute_async_params.py index f4d0280b8..9de00ccf0 100644 --- a/src/runloop_api_client/types/devbox_execute_async_params.py +++ b/src/runloop_api_client/types/devbox_execute_async_params.py @@ -17,6 +17,12 @@ class DevboxExecuteAsyncParams(TypedDict, total=False): based on the recent state of the persistent shell. """ + attach_stdin: Optional[bool] + """Whether to attach stdin streaming for async commands. + + Not valid for execute_sync endpoint. Defaults to false if not specified. + """ + shell_name: Optional[str] """The name of the persistent shell to create or use if already created. diff --git a/src/runloop_api_client/types/devbox_execute_params.py b/src/runloop_api_client/types/devbox_execute_params.py index 30defa616..24ca9e7fe 100644 --- a/src/runloop_api_client/types/devbox_execute_params.py +++ b/src/runloop_api_client/types/devbox_execute_params.py @@ -20,6 +20,9 @@ class DevboxExecuteParams(TypedDict, total=False): command_id: Required[str] """The command ID in UUIDv7 string format for idempotency and tracking""" + last_n: str + """Last n lines of standard error / standard out to return (default: 100)""" + optimistic_timeout: Optional[int] """Timeout in seconds to wait for command completion. diff --git a/src/runloop_api_client/types/devbox_execute_sync_params.py b/src/runloop_api_client/types/devbox_execute_sync_params.py index 1a873032c..c911a151c 100644 --- a/src/runloop_api_client/types/devbox_execute_sync_params.py +++ b/src/runloop_api_client/types/devbox_execute_sync_params.py @@ -17,6 +17,12 @@ class DevboxExecuteSyncParams(TypedDict, total=False): based on the recent state of the persistent shell. """ + attach_stdin: Optional[bool] + """Whether to attach stdin streaming for async commands. + + Not valid for execute_sync endpoint. Defaults to false if not specified. + """ + shell_name: Optional[str] """The name of the persistent shell to create or use if already created. diff --git a/src/runloop_api_client/types/devbox_send_std_in_result.py b/src/runloop_api_client/types/devbox_send_std_in_result.py new file mode 100644 index 000000000..2b675f9e9 --- /dev/null +++ b/src/runloop_api_client/types/devbox_send_std_in_result.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .._models import BaseModel + +__all__ = ["DevboxSendStdInResult"] + + +class DevboxSendStdInResult(BaseModel): + devbox_id: str + """Devbox id where command is executing.""" + + execution_id: str + """Execution id that received the stdin.""" + + success: bool + """Whether the stdin was successfully sent.""" diff --git a/src/runloop_api_client/types/devbox_snapshot_disk_async_params.py b/src/runloop_api_client/types/devbox_snapshot_disk_async_params.py index eda38c53b..7ad87ffb9 100644 --- a/src/runloop_api_client/types/devbox_snapshot_disk_async_params.py +++ b/src/runloop_api_client/types/devbox_snapshot_disk_async_params.py @@ -9,6 +9,9 @@ class DevboxSnapshotDiskAsyncParams(TypedDict, total=False): + commit_message: Optional[str] + """(Optional) Commit message associated with the snapshot (max 1000 characters)""" + metadata: Optional[Dict[str, str]] """(Optional) Metadata used to describe the snapshot""" diff --git a/src/runloop_api_client/types/devbox_snapshot_disk_params.py b/src/runloop_api_client/types/devbox_snapshot_disk_params.py index 67bf5ec9d..6ce8804b4 100644 --- a/src/runloop_api_client/types/devbox_snapshot_disk_params.py +++ b/src/runloop_api_client/types/devbox_snapshot_disk_params.py @@ -9,6 +9,9 @@ class DevboxSnapshotDiskParams(TypedDict, total=False): + commit_message: Optional[str] + """(Optional) Commit message associated with the snapshot (max 1000 characters)""" + metadata: Optional[Dict[str, str]] """(Optional) Metadata used to describe the snapshot""" diff --git a/src/runloop_api_client/types/devbox_snapshot_view.py b/src/runloop_api_client/types/devbox_snapshot_view.py index 115fe72e9..82ae90907 100644 --- a/src/runloop_api_client/types/devbox_snapshot_view.py +++ b/src/runloop_api_client/types/devbox_snapshot_view.py @@ -20,5 +20,8 @@ class DevboxSnapshotView(BaseModel): source_devbox_id: str """The source Devbox ID this snapshot was created from.""" + commit_message: Optional[str] = None + """(Optional) The commit message of the snapshot (max 1000 characters).""" + name: Optional[str] = None """(Optional) The custom name of the snapshot.""" diff --git a/src/runloop_api_client/types/devbox_wait_for_command_params.py b/src/runloop_api_client/types/devbox_wait_for_command_params.py index 93cf7e1e5..367d6ed2f 100644 --- a/src/runloop_api_client/types/devbox_wait_for_command_params.py +++ b/src/runloop_api_client/types/devbox_wait_for_command_params.py @@ -18,6 +18,9 @@ class DevboxWaitForCommandParams(TypedDict, total=False): reaches any of the provided statuses. """ + last_n: str + """Last n lines of standard error / standard out to return (default: 100)""" + timeout_seconds: Optional[int] """(Optional) Timeout in seconds to wait for the status, up to 60 seconds. diff --git a/src/runloop_api_client/types/devboxes/disk_snapshot_update_params.py b/src/runloop_api_client/types/devboxes/disk_snapshot_update_params.py index 6b4d276c5..548b6c08d 100644 --- a/src/runloop_api_client/types/devboxes/disk_snapshot_update_params.py +++ b/src/runloop_api_client/types/devboxes/disk_snapshot_update_params.py @@ -9,6 +9,9 @@ class DiskSnapshotUpdateParams(TypedDict, total=False): + commit_message: Optional[str] + """(Optional) Commit message associated with the snapshot (max 1000 characters)""" + metadata: Optional[Dict[str, str]] """(Optional) Metadata used to describe the snapshot""" diff --git a/src/runloop_api_client/types/devboxes/execution_execute_async_params.py b/src/runloop_api_client/types/devboxes/execution_execute_async_params.py index 22a5292c9..e0ae30e53 100644 --- a/src/runloop_api_client/types/devboxes/execution_execute_async_params.py +++ b/src/runloop_api_client/types/devboxes/execution_execute_async_params.py @@ -17,6 +17,12 @@ class ExecutionExecuteAsyncParams(TypedDict, total=False): based on the recent state of the persistent shell. """ + attach_stdin: Optional[bool] + """Whether to attach stdin streaming for async commands. + + Not valid for execute_sync endpoint. Defaults to false if not specified. + """ + shell_name: Optional[str] """The name of the persistent shell to create or use if already created. diff --git a/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py b/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py index a900f3e4b..e0875a1c1 100755 --- a/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py +++ b/src/runloop_api_client/types/devboxes/execution_execute_sync_params.py @@ -17,6 +17,12 @@ class ExecutionExecuteSyncParams(TypedDict, total=False): based on the recent state of the persistent shell. """ + attach_stdin: Optional[bool] + """Whether to attach stdin streaming for async commands. + + Not valid for execute_sync endpoint. Defaults to false if not specified. + """ + shell_name: Optional[str] """The name of the persistent shell to create or use if already created. diff --git a/src/runloop_api_client/types/devboxes/execution_retrieve_params.py b/src/runloop_api_client/types/devboxes/execution_retrieve_params.py index 96e8bc24b..145d1a679 100644 --- a/src/runloop_api_client/types/devboxes/execution_retrieve_params.py +++ b/src/runloop_api_client/types/devboxes/execution_retrieve_params.py @@ -11,4 +11,4 @@ class ExecutionRetrieveParams(TypedDict, total=False): devbox_id: Required[str] last_n: str - """Last n lines of standard error / standard out to return""" + """Last n lines of standard error / standard out to return (default: 100)""" diff --git a/src/runloop_api_client/types/object_view.py b/src/runloop_api_client/types/object_view.py index 18c7c1d3c..b8a2e0f4c 100644 --- a/src/runloop_api_client/types/object_view.py +++ b/src/runloop_api_client/types/object_view.py @@ -15,6 +15,9 @@ class ObjectView(BaseModel): content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"] """The content type of the Object.""" + create_time_ms: int + """The creation time of the Object in milliseconds since epoch.""" + name: str """The name of the Object.""" diff --git a/tests/api_resources/devboxes/test_disk_snapshots.py b/tests/api_resources/devboxes/test_disk_snapshots.py index 3ef9f7b94..c04e4e971 100644 --- a/tests/api_resources/devboxes/test_disk_snapshots.py +++ b/tests/api_resources/devboxes/test_disk_snapshots.py @@ -32,6 +32,7 @@ def test_method_update(self, client: Runloop) -> None: def test_method_update_with_all_params(self, client: Runloop) -> None: disk_snapshot = client.devboxes.disk_snapshots.update( id="id", + commit_message="commit_message", metadata={"foo": "string"}, name="name", ) @@ -197,6 +198,7 @@ async def test_method_update(self, async_client: AsyncRunloop) -> None: async def test_method_update_with_all_params(self, async_client: AsyncRunloop) -> None: disk_snapshot = await async_client.devboxes.disk_snapshots.update( id="id", + commit_message="commit_message", metadata={"foo": "string"}, name="name", ) diff --git a/tests/api_resources/devboxes/test_executions.py b/tests/api_resources/devboxes/test_executions.py index b6952be5b..03f025f09 100755 --- a/tests/api_resources/devboxes/test_executions.py +++ b/tests/api_resources/devboxes/test_executions.py @@ -9,7 +9,7 @@ from tests.utils import assert_matches_type from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types import DevboxExecutionDetailView, DevboxAsyncExecutionDetailView +from runloop_api_client.types import DevboxSendStdInResult, DevboxExecutionDetailView, DevboxAsyncExecutionDetailView # pyright: reportDeprecated=false @@ -89,6 +89,7 @@ def test_method_execute_async_with_all_params(self, client: Runloop) -> None: execution = client.devboxes.executions.execute_async( id="id", command="command", + attach_stdin=True, shell_name="shell_name", ) assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) @@ -143,6 +144,7 @@ def test_method_execute_sync_with_all_params(self, client: Runloop) -> None: execution = client.devboxes.executions.execute_sync( id="id", command="command", + attach_stdin=True, shell_name="shell_name", ) @@ -248,7 +250,7 @@ def test_method_send_std_in(self, client: Runloop) -> None: execution_id="execution_id", devbox_id="devbox_id", ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + assert_matches_type(DevboxSendStdInResult, execution, path=["response"]) @parametrize def test_method_send_std_in_with_all_params(self, client: Runloop) -> None: @@ -258,7 +260,7 @@ def test_method_send_std_in_with_all_params(self, client: Runloop) -> None: signal="EOF", text="text", ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + assert_matches_type(DevboxSendStdInResult, execution, path=["response"]) @parametrize def test_raw_response_send_std_in(self, client: Runloop) -> None: @@ -270,7 +272,7 @@ def test_raw_response_send_std_in(self, client: Runloop) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + assert_matches_type(DevboxSendStdInResult, execution, path=["response"]) @parametrize def test_streaming_response_send_std_in(self, client: Runloop) -> None: @@ -282,7 +284,7 @@ def test_streaming_response_send_std_in(self, client: Runloop) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + assert_matches_type(DevboxSendStdInResult, execution, path=["response"]) assert cast(Any, response.is_closed) is True @@ -488,6 +490,7 @@ async def test_method_execute_async_with_all_params(self, async_client: AsyncRun execution = await async_client.devboxes.executions.execute_async( id="id", command="command", + attach_stdin=True, shell_name="shell_name", ) assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) @@ -542,6 +545,7 @@ async def test_method_execute_sync_with_all_params(self, async_client: AsyncRunl execution = await async_client.devboxes.executions.execute_sync( id="id", command="command", + attach_stdin=True, shell_name="shell_name", ) @@ -647,7 +651,7 @@ async def test_method_send_std_in(self, async_client: AsyncRunloop) -> None: execution_id="execution_id", devbox_id="devbox_id", ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + assert_matches_type(DevboxSendStdInResult, execution, path=["response"]) @parametrize async def test_method_send_std_in_with_all_params(self, async_client: AsyncRunloop) -> None: @@ -657,7 +661,7 @@ async def test_method_send_std_in_with_all_params(self, async_client: AsyncRunlo signal="EOF", text="text", ) - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + assert_matches_type(DevboxSendStdInResult, execution, path=["response"]) @parametrize async def test_raw_response_send_std_in(self, async_client: AsyncRunloop) -> None: @@ -669,7 +673,7 @@ async def test_raw_response_send_std_in(self, async_client: AsyncRunloop) -> Non assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = await response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + assert_matches_type(DevboxSendStdInResult, execution, path=["response"]) @parametrize async def test_streaming_response_send_std_in(self, async_client: AsyncRunloop) -> None: @@ -681,7 +685,7 @@ async def test_streaming_response_send_std_in(self, async_client: AsyncRunloop) assert response.http_request.headers.get("X-Stainless-Lang") == "python" execution = await response.parse() - assert_matches_type(DevboxAsyncExecutionDetailView, execution, path=["response"]) + assert_matches_type(DevboxSendStdInResult, execution, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index d55d0dfff..7a5dfb304 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -425,6 +425,7 @@ def test_method_execute_with_all_params(self, client: Runloop) -> None: id="id", command="command", command_id="command_id", + last_n="last_n", optimistic_timeout=0, shell_name="shell_name", ) @@ -480,6 +481,7 @@ def test_method_execute_async_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.execute_async( id="id", command="command", + attach_stdin=True, shell_name="shell_name", ) assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) @@ -534,6 +536,7 @@ def test_method_execute_sync_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.execute_sync( id="id", command="command", + attach_stdin=True, shell_name="shell_name", ) @@ -821,6 +824,7 @@ def test_method_snapshot_disk(self, client: Runloop) -> None: def test_method_snapshot_disk_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.snapshot_disk( id="id", + commit_message="commit_message", metadata={"foo": "string"}, name="name", ) @@ -868,6 +872,7 @@ def test_method_snapshot_disk_async(self, client: Runloop) -> None: def test_method_snapshot_disk_async_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.snapshot_disk_async( id="id", + commit_message="commit_message", metadata={"foo": "string"}, name="name", ) @@ -1008,6 +1013,7 @@ def test_method_wait_for_command_with_all_params(self, client: Runloop) -> None: execution_id="execution_id", devbox_id="devbox_id", statuses=["queued"], + last_n="last_n", timeout_seconds=0, ) assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) @@ -1493,6 +1499,7 @@ async def test_method_execute_with_all_params(self, async_client: AsyncRunloop) id="id", command="command", command_id="command_id", + last_n="last_n", optimistic_timeout=0, shell_name="shell_name", ) @@ -1548,6 +1555,7 @@ async def test_method_execute_async_with_all_params(self, async_client: AsyncRun devbox = await async_client.devboxes.execute_async( id="id", command="command", + attach_stdin=True, shell_name="shell_name", ) assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) @@ -1602,6 +1610,7 @@ async def test_method_execute_sync_with_all_params(self, async_client: AsyncRunl devbox = await async_client.devboxes.execute_sync( id="id", command="command", + attach_stdin=True, shell_name="shell_name", ) @@ -1889,6 +1898,7 @@ async def test_method_snapshot_disk(self, async_client: AsyncRunloop) -> None: async def test_method_snapshot_disk_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.snapshot_disk( id="id", + commit_message="commit_message", metadata={"foo": "string"}, name="name", ) @@ -1936,6 +1946,7 @@ async def test_method_snapshot_disk_async(self, async_client: AsyncRunloop) -> N async def test_method_snapshot_disk_async_with_all_params(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.snapshot_disk_async( id="id", + commit_message="commit_message", metadata={"foo": "string"}, name="name", ) @@ -2076,6 +2087,7 @@ async def test_method_wait_for_command_with_all_params(self, async_client: Async execution_id="execution_id", devbox_id="devbox_id", statuses=["queued"], + last_n="last_n", timeout_seconds=0, ) assert_matches_type(DevboxAsyncExecutionDetailView, devbox, path=["response"]) From 0f4abe81fad7fad8bcd439f9fecac6a0ae492378 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 15 Oct 2025 13:54:55 +0000 Subject: [PATCH 883/993] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d4e6d79a9..3729fb940 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-436b4f5c7426cca5e0133377ac1a0d1491b5705407a3d877c3b4abeb4e9935f1.yml -openapi_spec_hash: cd980135831e4407f1063af254fba1cd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-039b6fefb20a791ff9739695a732c6d70ac20788675486b6ef04c7a3911b938d.yml +openapi_spec_hash: 2a41f3c2f6c48a1787d06094240302a5 config_hash: 95facb8cef59b5a1b05763b871bf6a4b From f05e28ab124bd3bf8b2c752cf96d8f7bb929a75c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 15 Oct 2025 15:27:35 +0000 Subject: [PATCH 884/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4c56f2a48..57726a4f1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.64.0" + ".": "0.65.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 29dbee20f..3856ecd29 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.64.0" +version = "0.65.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 86a8c7253..4608f59f0 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.64.0" # x-release-please-version +__version__ = "0.65.0" # x-release-please-version diff --git a/uv.lock b/uv.lock index 4ec46c191..a950b47fc 100644 --- a/uv.lock +++ b/uv.lock @@ -1771,7 +1771,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "0.64.0" +version = "0.65.0" source = { editable = "." } dependencies = [ { name = "anyio", version = "4.5.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, From bd2f8810cef55e8d48eb16a6dc60860f983a2a59 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 18 Oct 2025 02:06:59 +0000 Subject: [PATCH 885/993] chore: bump `httpx-aiohttp` version to 0.1.9 --- pyproject.toml | 2 +- uv.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3856ecd29..0ff996b0f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ Homepage = "https://github.com/runloopai/api-client-python" Repository = "https://github.com/runloopai/api-client-python" [project.optional-dependencies] -aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"] +aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"] [tool.uv] managed = true diff --git a/uv.lock b/uv.lock index a950b47fc..cab2f47a3 100644 --- a/uv.lock +++ b/uv.lock @@ -660,16 +660,16 @@ wheels = [ [[package]] name = "httpx-aiohttp" -version = "0.1.8" +version = "0.1.9" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "aiohttp", version = "3.10.11", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, { name = "aiohttp", version = "3.12.13", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, { name = "httpx" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/37/19/ae2d2bf1f57fdd23c8ad83675599fb5c407fa13bc20e90f00cffa4dea3aa/httpx_aiohttp-0.1.8.tar.gz", hash = "sha256:756c5e74cdb568c3248ba63fe82bfe8bbe64b928728720f7eaac64b3cf46f308", size = 25401, upload-time = "2025-07-04T10:40:32.329Z" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/f2/9a86ce9bc48cf57dabb3a3160dfed26d8bbe5a2478a51f9d1dbf89f2f1fc/httpx_aiohttp-0.1.9.tar.gz", hash = "sha256:4ee8b22e6f2e7c80cd03be29eff98bfe7d89bd77f021ce0b578ee76b73b4bfe6", size = 206023, upload-time = "2025-10-15T08:52:57.475Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/54/7a/514c484b88cc4ebbcd2e27e92b86019c0c5bb920582f5fbb10b7e6c78574/httpx_aiohttp-0.1.8-py3-none-any.whl", hash = "sha256:b7bd958d1331f3759a38a0ba22ad29832cb63ca69498c17735228055bf78fa7e", size = 6180, upload-time = "2025-07-04T10:40:31.522Z" }, + { url = "https://files.pythonhosted.org/packages/a1/db/5cfa8254a86c34a1ab7fe0dbec9f81bb5ebd831cbdd65aa4be4f37027804/httpx_aiohttp-0.1.9-py3-none-any.whl", hash = "sha256:3dc2845568b07742588710fcf3d72db2cbcdf2acc93376edf85f789c4d8e5fda", size = 6180, upload-time = "2025-10-15T08:52:56.521Z" }, ] [[package]] @@ -1824,7 +1824,7 @@ requires-dist = [ { name = "anyio", specifier = ">=3.5.0,<5" }, { name = "distro", specifier = ">=1.7.0,<2" }, { name = "httpx", specifier = ">=0.23.0,<1" }, - { name = "httpx-aiohttp", marker = "extra == 'aiohttp'", specifier = ">=0.1.8" }, + { name = "httpx-aiohttp", marker = "extra == 'aiohttp'", specifier = ">=0.1.9" }, { name = "pydantic", specifier = ">=1.9.0,<3" }, { name = "sniffio" }, { name = "typing-extensions", specifier = ">=4.10,<5" }, From 88d7bdd2c8de4f866f9cec85d24bd603d55b0671 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Oct 2025 04:07:10 +0000 Subject: [PATCH 886/993] feat(api): api update --- .stats.yml | 4 +- .../resources/blueprints.py | 40 +++++++++++++++++++ .../types/blueprint_build_parameters.py | 8 ++++ ...blueprint_create_from_inspection_params.py | 7 ++++ .../types/blueprint_create_params.py | 8 ++++ .../types/blueprint_preview_params.py | 8 ++++ tests/api_resources/test_blueprints.py | 6 +++ 7 files changed, 79 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3729fb940..0e4db68fc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-039b6fefb20a791ff9739695a732c6d70ac20788675486b6ef04c7a3911b938d.yml -openapi_spec_hash: 2a41f3c2f6c48a1787d06094240302a5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f60ee2123156a4db87ddfa4e1b8dd6379e26e8f8cf533946ca25b76559b6aa4d.yml +openapi_spec_hash: d80fdfaf40c65ce8c1962c4f6d35acc6 config_hash: 95facb8cef59b5a1b05763b871bf6a4b diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index e201ffd82..a0e07e83a 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -67,6 +67,7 @@ def create( file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, + secrets: Optional[Dict[str, str]] | Omit = omit, services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -107,6 +108,11 @@ def create( metadata: (Optional) User defined metadata for the Blueprint. + secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets + will be available to commands during the build. Secrets are NOT stored in the + blueprint image. Example: {"DB_PASS": "DATABASE_PASSWORD"} makes the secret + 'DATABASE_PASSWORD' available as environment variable 'DB_PASS'. + services: (Optional) List of containerized services to include in the Blueprint. These services will be pre-pulled during the build phase for optimized startup performance. @@ -136,6 +142,7 @@ def create( "file_mounts": file_mounts, "launch_parameters": launch_parameters, "metadata": metadata, + "secrets": secrets, "services": services, "system_setup_commands": system_setup_commands, }, @@ -283,6 +290,7 @@ def create_from_inspection( file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, + secrets: Optional[Dict[str, str]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -309,6 +317,10 @@ def create_from_inspection( metadata: (Optional) User defined metadata for the Blueprint. + secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets + can be used as environment variables in system_setup_commands. Example: + {"GITHUB_TOKEN": "gh_secret"} makes 'gh_secret' available as GITHUB_TOKEN. + system_setup_commands: A list of commands to run to set up your system. extra_headers: Send extra headers @@ -330,6 +342,7 @@ def create_from_inspection( "file_mounts": file_mounts, "launch_parameters": launch_parameters, "metadata": metadata, + "secrets": secrets, "system_setup_commands": system_setup_commands, }, blueprint_create_from_inspection_params.BlueprintCreateFromInspectionParams, @@ -440,6 +453,7 @@ def preview( file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, + secrets: Optional[Dict[str, str]] | Omit = omit, services: Optional[Iterable[blueprint_preview_params.Service]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -478,6 +492,11 @@ def preview( metadata: (Optional) User defined metadata for the Blueprint. + secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets + will be available to commands during the build. Secrets are NOT stored in the + blueprint image. Example: {"DB_PASS": "DATABASE_PASSWORD"} makes the secret + 'DATABASE_PASSWORD' available as environment variable 'DB_PASS'. + services: (Optional) List of containerized services to include in the Blueprint. These services will be pre-pulled during the build phase for optimized startup performance. @@ -507,6 +526,7 @@ def preview( "file_mounts": file_mounts, "launch_parameters": launch_parameters, "metadata": metadata, + "secrets": secrets, "services": services, "system_setup_commands": system_setup_commands, }, @@ -555,6 +575,7 @@ async def create( file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, + secrets: Optional[Dict[str, str]] | Omit = omit, services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -595,6 +616,11 @@ async def create( metadata: (Optional) User defined metadata for the Blueprint. + secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets + will be available to commands during the build. Secrets are NOT stored in the + blueprint image. Example: {"DB_PASS": "DATABASE_PASSWORD"} makes the secret + 'DATABASE_PASSWORD' available as environment variable 'DB_PASS'. + services: (Optional) List of containerized services to include in the Blueprint. These services will be pre-pulled during the build phase for optimized startup performance. @@ -624,6 +650,7 @@ async def create( "file_mounts": file_mounts, "launch_parameters": launch_parameters, "metadata": metadata, + "secrets": secrets, "services": services, "system_setup_commands": system_setup_commands, }, @@ -771,6 +798,7 @@ async def create_from_inspection( file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, + secrets: Optional[Dict[str, str]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -797,6 +825,10 @@ async def create_from_inspection( metadata: (Optional) User defined metadata for the Blueprint. + secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets + can be used as environment variables in system_setup_commands. Example: + {"GITHUB_TOKEN": "gh_secret"} makes 'gh_secret' available as GITHUB_TOKEN. + system_setup_commands: A list of commands to run to set up your system. extra_headers: Send extra headers @@ -818,6 +850,7 @@ async def create_from_inspection( "file_mounts": file_mounts, "launch_parameters": launch_parameters, "metadata": metadata, + "secrets": secrets, "system_setup_commands": system_setup_commands, }, blueprint_create_from_inspection_params.BlueprintCreateFromInspectionParams, @@ -928,6 +961,7 @@ async def preview( file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, + secrets: Optional[Dict[str, str]] | Omit = omit, services: Optional[Iterable[blueprint_preview_params.Service]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -966,6 +1000,11 @@ async def preview( metadata: (Optional) User defined metadata for the Blueprint. + secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets + will be available to commands during the build. Secrets are NOT stored in the + blueprint image. Example: {"DB_PASS": "DATABASE_PASSWORD"} makes the secret + 'DATABASE_PASSWORD' available as environment variable 'DB_PASS'. + services: (Optional) List of containerized services to include in the Blueprint. These services will be pre-pulled during the build phase for optimized startup performance. @@ -995,6 +1034,7 @@ async def preview( "file_mounts": file_mounts, "launch_parameters": launch_parameters, "metadata": metadata, + "secrets": secrets, "services": services, "system_setup_commands": system_setup_commands, }, diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index b2d042701..63a92f146 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -76,6 +76,14 @@ class BlueprintBuildParameters(BaseModel): metadata: Optional[Dict[str, str]] = None """(Optional) User defined metadata for the Blueprint.""" + secrets: Optional[Dict[str, str]] = None + """(Optional) Map of mount IDs/environment variable names to secret names. + + Secrets will be available to commands during the build. Secrets are NOT stored + in the blueprint image. Example: {"DB_PASS": "DATABASE_PASSWORD"} makes the + secret 'DATABASE_PASSWORD' available as environment variable 'DB_PASS'. + """ + services: Optional[List[Service]] = None """(Optional) List of containerized services to include in the Blueprint. diff --git a/src/runloop_api_client/types/blueprint_create_from_inspection_params.py b/src/runloop_api_client/types/blueprint_create_from_inspection_params.py index 402bbb4db..740c0a292 100644 --- a/src/runloop_api_client/types/blueprint_create_from_inspection_params.py +++ b/src/runloop_api_client/types/blueprint_create_from_inspection_params.py @@ -32,5 +32,12 @@ class BlueprintCreateFromInspectionParams(TypedDict, total=False): metadata: Optional[Dict[str, str]] """(Optional) User defined metadata for the Blueprint.""" + secrets: Optional[Dict[str, str]] + """(Optional) Map of mount IDs/environment variable names to secret names. + + Secrets can be used as environment variables in system_setup_commands. Example: + {"GITHUB_TOKEN": "gh_secret"} makes 'gh_secret' available as GITHUB_TOKEN. + """ + system_setup_commands: Optional[SequenceNotStr[str]] """A list of commands to run to set up your system.""" diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index 80d32de9a..9d0a15848 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -48,6 +48,14 @@ class BlueprintCreateParams(TypedDict, total=False): metadata: Optional[Dict[str, str]] """(Optional) User defined metadata for the Blueprint.""" + secrets: Optional[Dict[str, str]] + """(Optional) Map of mount IDs/environment variable names to secret names. + + Secrets will be available to commands during the build. Secrets are NOT stored + in the blueprint image. Example: {"DB_PASS": "DATABASE_PASSWORD"} makes the + secret 'DATABASE_PASSWORD' available as environment variable 'DB_PASS'. + """ + services: Optional[Iterable[Service]] """(Optional) List of containerized services to include in the Blueprint. diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index a9d8d1918..5c1e257f2 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -48,6 +48,14 @@ class BlueprintPreviewParams(TypedDict, total=False): metadata: Optional[Dict[str, str]] """(Optional) User defined metadata for the Blueprint.""" + secrets: Optional[Dict[str, str]] + """(Optional) Map of mount IDs/environment variable names to secret names. + + Secrets will be available to commands during the build. Secrets are NOT stored + in the blueprint image. Example: {"DB_PASS": "DATABASE_PASSWORD"} makes the + secret 'DATABASE_PASSWORD' available as environment variable 'DB_PASS'. + """ + services: Optional[Iterable[Service]] """(Optional) List of containerized services to include in the Blueprint. diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 4c34f9b4e..30ae21d3e 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -66,6 +66,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: }, }, metadata={"foo": "string"}, + secrets={"foo": "string"}, services=[ { "image": "image", @@ -254,6 +255,7 @@ def test_method_create_from_inspection_with_all_params(self, client: Runloop) -> }, }, metadata={"foo": "string"}, + secrets={"foo": "string"}, system_setup_commands=["string"], ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @@ -400,6 +402,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: }, }, metadata={"foo": "string"}, + secrets={"foo": "string"}, services=[ { "image": "image", @@ -491,6 +494,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - }, }, metadata={"foo": "string"}, + secrets={"foo": "string"}, services=[ { "image": "image", @@ -679,6 +683,7 @@ async def test_method_create_from_inspection_with_all_params(self, async_client: }, }, metadata={"foo": "string"}, + secrets={"foo": "string"}, system_setup_commands=["string"], ) assert_matches_type(BlueprintView, blueprint, path=["response"]) @@ -825,6 +830,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) }, }, metadata={"foo": "string"}, + secrets={"foo": "string"}, services=[ { "image": "image", From 86a91fc0cab211734f7b4bdee597074de050bcbb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Oct 2025 04:30:15 +0000 Subject: [PATCH 887/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 57726a4f1..b429f966f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.65.0" + ".": "0.66.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 0ff996b0f..c6c984d64 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.65.0" +version = "0.66.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 4608f59f0..6080fb4c0 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.65.0" # x-release-please-version +__version__ = "0.66.0" # x-release-please-version diff --git a/uv.lock b/uv.lock index cab2f47a3..6ac77fc76 100644 --- a/uv.lock +++ b/uv.lock @@ -1771,7 +1771,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "0.65.0" +version = "0.66.0" source = { editable = "." } dependencies = [ { name = "anyio", version = "4.5.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, From d007c65693c3a90912e4dfcf6aca36ed54bbd314 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Oct 2025 22:13:59 +0000 Subject: [PATCH 888/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b429f966f..11d330953 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.66.0" + ".": "0.66.1" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index c6c984d64..e4df6e84a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.66.0" +version = "0.66.1" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 6080fb4c0..dc049fffe 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.66.0" # x-release-please-version +__version__ = "0.66.1" # x-release-please-version diff --git a/uv.lock b/uv.lock index 6ac77fc76..9524b6453 100644 --- a/uv.lock +++ b/uv.lock @@ -1771,7 +1771,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "0.66.0" +version = "0.66.1" source = { editable = "." } dependencies = [ { name = "anyio", version = "4.5.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, From 66d7bd25e9df12d6844b226eda901aebd38976cf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 02:12:40 +0000 Subject: [PATCH 889/993] fix(client): close streams without requiring full consumption --- src/runloop_api_client/_streaming.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/runloop_api_client/_streaming.py b/src/runloop_api_client/_streaming.py index ded05ee4b..ed46fe26f 100644 --- a/src/runloop_api_client/_streaming.py +++ b/src/runloop_api_client/_streaming.py @@ -57,9 +57,8 @@ def __stream__(self) -> Iterator[_T]: for sse in iterator: yield process_data(data=sse.json(), cast_to=cast_to, response=response) - # Ensure the entire stream is consumed - for _sse in iterator: - ... + # As we might not fully consume the response stream, we need to close it explicitly + response.close() def __enter__(self) -> Self: return self @@ -121,9 +120,8 @@ async def __stream__(self) -> AsyncIterator[_T]: async for sse in iterator: yield process_data(data=sse.json(), cast_to=cast_to, response=response) - # Ensure the entire stream is consumed - async for _sse in iterator: - ... + # As we might not fully consume the response stream, we need to close it explicitly + await response.aclose() async def __aenter__(self) -> Self: return self From 4113160cecfcfe6a91df921b3a9290e4e966155c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Oct 2025 02:27:44 +0000 Subject: [PATCH 890/993] chore(internal/tests): avoid race condition with implicit client cleanup --- tests/test_client.py | 384 +++++++++++++++++++++++-------------------- 1 file changed, 210 insertions(+), 174 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index ca53896b3..8333b35ef 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -59,51 +59,49 @@ def _get_open_connections(client: Runloop | AsyncRunloop) -> int: class TestRunloop: - client = Runloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) - @pytest.mark.respx(base_url=base_url) - def test_raw_response(self, respx_mock: MockRouter) -> None: + def test_raw_response(self, respx_mock: MockRouter, client: Runloop) -> None: respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = self.client.post("/foo", cast_to=httpx.Response) + response = client.post("/foo", cast_to=httpx.Response) assert response.status_code == 200 assert isinstance(response, httpx.Response) assert response.json() == {"foo": "bar"} @pytest.mark.respx(base_url=base_url) - def test_raw_response_for_binary(self, respx_mock: MockRouter) -> None: + def test_raw_response_for_binary(self, respx_mock: MockRouter, client: Runloop) -> None: respx_mock.post("/foo").mock( return_value=httpx.Response(200, headers={"Content-Type": "application/binary"}, content='{"foo": "bar"}') ) - response = self.client.post("/foo", cast_to=httpx.Response) + response = client.post("/foo", cast_to=httpx.Response) assert response.status_code == 200 assert isinstance(response, httpx.Response) assert response.json() == {"foo": "bar"} - def test_copy(self) -> None: - copied = self.client.copy() - assert id(copied) != id(self.client) + def test_copy(self, client: Runloop) -> None: + copied = client.copy() + assert id(copied) != id(client) - copied = self.client.copy(bearer_token="another My Bearer Token") + copied = client.copy(bearer_token="another My Bearer Token") assert copied.bearer_token == "another My Bearer Token" - assert self.client.bearer_token == "My Bearer Token" + assert client.bearer_token == "My Bearer Token" - def test_copy_default_options(self) -> None: + def test_copy_default_options(self, client: Runloop) -> None: # options that have a default are overridden correctly - copied = self.client.copy(max_retries=7) + copied = client.copy(max_retries=7) assert copied.max_retries == 7 - assert self.client.max_retries == 5 + assert client.max_retries == 5 copied2 = copied.copy(max_retries=6) assert copied2.max_retries == 6 assert copied.max_retries == 7 # timeout - assert isinstance(self.client.timeout, httpx.Timeout) - copied = self.client.copy(timeout=None) + assert isinstance(client.timeout, httpx.Timeout) + copied = client.copy(timeout=None) assert copied.timeout is None - assert isinstance(self.client.timeout, httpx.Timeout) + assert isinstance(client.timeout, httpx.Timeout) def test_copy_default_headers(self) -> None: client = Runloop( @@ -141,6 +139,7 @@ def test_copy_default_headers(self) -> None: match="`default_headers` and `set_default_headers` arguments are mutually exclusive", ): client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"}) + client.close() def test_copy_default_query(self) -> None: client = Runloop( @@ -178,13 +177,15 @@ def test_copy_default_query(self) -> None: ): client.copy(set_default_query={}, default_query={"foo": "Bar"}) - def test_copy_signature(self) -> None: + client.close() + + def test_copy_signature(self, client: Runloop) -> None: # ensure the same parameters that can be passed to the client are defined in the `.copy()` method init_signature = inspect.signature( # mypy doesn't like that we access the `__init__` property. - self.client.__init__, # type: ignore[misc] + client.__init__, # type: ignore[misc] ) - copy_signature = inspect.signature(self.client.copy) + copy_signature = inspect.signature(client.copy) exclude_params = {"transport", "proxies", "_strict_response_validation"} for name in init_signature.parameters.keys(): @@ -195,12 +196,12 @@ def test_copy_signature(self) -> None: assert copy_param is not None, f"copy() signature is missing the {name} param" @pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12") - def test_copy_build_request(self) -> None: + def test_copy_build_request(self, client: Runloop) -> None: options = FinalRequestOptions(method="get", url="/foo") def build_request(options: FinalRequestOptions) -> None: - client = self.client.copy() - client._build_request(options) + client_copy = client.copy() + client_copy._build_request(options) # ensure that the machinery is warmed up before tracing starts. build_request(options) @@ -257,14 +258,12 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic print(frame) raise AssertionError() - def test_request_timeout(self) -> None: - request = self.client._build_request(FinalRequestOptions(method="get", url="/foo")) + def test_request_timeout(self, client: Runloop) -> None: + request = client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT - request = self.client._build_request( - FinalRequestOptions(method="get", url="/foo", timeout=httpx.Timeout(100.0)) - ) + request = client._build_request(FinalRequestOptions(method="get", url="/foo", timeout=httpx.Timeout(100.0))) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(100.0) @@ -277,6 +276,8 @@ def test_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(0) + client.close() + def test_http_client_timeout_option(self) -> None: # custom timeout given to the httpx client should be used with httpx.Client(timeout=None) as http_client: @@ -288,6 +289,8 @@ def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(None) + client.close() + # no timeout given to the httpx client should not use the httpx default with httpx.Client() as http_client: client = Runloop( @@ -298,6 +301,8 @@ def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT + client.close() + # explicitly passing the default timeout currently results in it being ignored with httpx.Client(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: client = Runloop( @@ -308,6 +313,8 @@ def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT # our default + client.close() + async def test_invalid_http_client(self) -> None: with pytest.raises(TypeError, match="Invalid `http_client` arg"): async with httpx.AsyncClient() as http_client: @@ -319,17 +326,17 @@ async def test_invalid_http_client(self) -> None: ) def test_default_headers_option(self) -> None: - client = Runloop( + test_client = Runloop( base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, default_headers={"X-Foo": "bar"}, ) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + request = test_client._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("x-foo") == "bar" assert request.headers.get("x-stainless-lang") == "python" - client2 = Runloop( + test_client2 = Runloop( base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, @@ -338,10 +345,13 @@ def test_default_headers_option(self) -> None: "X-Stainless-Lang": "my-overriding-header", }, ) - request = client2._build_request(FinalRequestOptions(method="get", url="/foo")) + request = test_client2._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("x-foo") == "stainless" assert request.headers.get("x-stainless-lang") == "my-overriding-header" + test_client.close() + test_client2.close() + def test_validate_headers(self) -> None: client = Runloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -373,8 +383,10 @@ def test_default_query_option(self) -> None: url = httpx.URL(request.url) assert dict(url.params) == {"foo": "baz", "query_param": "overridden"} - def test_request_extra_json(self) -> None: - request = self.client._build_request( + client.close() + + def test_request_extra_json(self, client: Runloop) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -385,7 +397,7 @@ def test_request_extra_json(self) -> None: data = json.loads(request.content.decode("utf-8")) assert data == {"foo": "bar", "baz": False} - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -396,7 +408,7 @@ def test_request_extra_json(self) -> None: assert data == {"baz": False} # `extra_json` takes priority over `json_data` when keys clash - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -407,8 +419,8 @@ def test_request_extra_json(self) -> None: data = json.loads(request.content.decode("utf-8")) assert data == {"foo": "bar", "baz": None} - def test_request_extra_headers(self) -> None: - request = self.client._build_request( + def test_request_extra_headers(self, client: Runloop) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -418,7 +430,7 @@ def test_request_extra_headers(self) -> None: assert request.headers.get("X-Foo") == "Foo" # `extra_headers` takes priority over `default_headers` when keys clash - request = self.client.with_options(default_headers={"X-Bar": "true"})._build_request( + request = client.with_options(default_headers={"X-Bar": "true"})._build_request( FinalRequestOptions( method="post", url="/foo", @@ -429,8 +441,8 @@ def test_request_extra_headers(self) -> None: ) assert request.headers.get("X-Bar") == "false" - def test_request_extra_query(self) -> None: - request = self.client._build_request( + def test_request_extra_query(self, client: Runloop) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -443,7 +455,7 @@ def test_request_extra_query(self) -> None: assert params == {"my_query_param": "Foo"} # if both `query` and `extra_query` are given, they are merged - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -457,7 +469,7 @@ def test_request_extra_query(self) -> None: assert params == {"bar": "1", "foo": "2"} # `extra_query` takes priority over `query` when keys clash - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -500,7 +512,7 @@ def test_multipart_repeating_array(self, client: Runloop) -> None: ] @pytest.mark.respx(base_url=base_url) - def test_basic_union_response(self, respx_mock: MockRouter) -> None: + def test_basic_union_response(self, respx_mock: MockRouter, client: Runloop) -> None: class Model1(BaseModel): name: str @@ -509,12 +521,12 @@ class Model2(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model2) assert response.foo == "bar" @pytest.mark.respx(base_url=base_url) - def test_union_response_different_types(self, respx_mock: MockRouter) -> None: + def test_union_response_different_types(self, respx_mock: MockRouter, client: Runloop) -> None: """Union of objects with the same field name using a different type""" class Model1(BaseModel): @@ -525,18 +537,18 @@ class Model2(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model2) assert response.foo == "bar" respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": 1})) - response = self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model1) assert response.foo == 1 @pytest.mark.respx(base_url=base_url) - def test_non_application_json_content_type_for_json_data(self, respx_mock: MockRouter) -> None: + def test_non_application_json_content_type_for_json_data(self, respx_mock: MockRouter, client: Runloop) -> None: """ Response that sets Content-Type to something other than application/json but returns json data """ @@ -552,33 +564,33 @@ class Model(BaseModel): ) ) - response = self.client.get("/foo", cast_to=Model) + response = client.get("/foo", cast_to=Model) assert isinstance(response, Model) assert response.foo == 2 @pytest.mark.respx(base_url=base_url) - def test_idempotency_header_options(self, respx_mock: MockRouter) -> None: + def test_idempotency_header_options(self, respx_mock: MockRouter, client: Runloop) -> None: respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={})) - response = self.client.post("/foo", cast_to=httpx.Response) + response = client.post("/foo", cast_to=httpx.Response) header = response.request.headers.get("x-request-id") assert header is not None assert header.startswith("stainless-python-retry") # explicit header - response = self.client.post( + response = client.post( "/foo", cast_to=httpx.Response, options=make_request_options(extra_headers={"x-request-id": "custom-key"}) ) assert response.request.headers.get("x-request-id") == "custom-key" - response = self.client.post( + response = client.post( "/foo", cast_to=httpx.Response, options=make_request_options(extra_headers={"x-request-id": "custom-key"}) ) assert response.request.headers.get("x-request-id") == "custom-key" # custom argument - response = self.client.post( + response = client.post( "/foo", cast_to=httpx.Response, options=make_request_options(idempotency_key="custom-key") ) assert response.request.headers.get("x-request-id") == "custom-key" @@ -593,6 +605,8 @@ def test_base_url_setter(self) -> None: assert client.base_url == "https://example.com/from_setter/" + client.close() + def test_base_url_env(self) -> None: with update_env(RUNLOOP_BASE_URL="http://localhost:5000/from/env"): client = Runloop(bearer_token=bearer_token, _strict_response_validation=True) @@ -624,6 +638,7 @@ def test_base_url_trailing_slash(self, client: Runloop) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + client.close() @pytest.mark.parametrize( "client", @@ -651,6 +666,7 @@ def test_base_url_no_trailing_slash(self, client: Runloop) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + client.close() @pytest.mark.parametrize( "client", @@ -678,35 +694,36 @@ def test_absolute_request_url(self, client: Runloop) -> None: ), ) assert request.url == "https://myapi.com/foo" + client.close() def test_copied_client_does_not_close_http(self) -> None: - client = Runloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) - assert not client.is_closed() + test_client = Runloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + assert not test_client.is_closed() - copied = client.copy() - assert copied is not client + copied = test_client.copy() + assert copied is not test_client del copied - assert not client.is_closed() + assert not test_client.is_closed() def test_client_context_manager(self) -> None: - client = Runloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) - with client as c2: - assert c2 is client + test_client = Runloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + with test_client as c2: + assert c2 is test_client assert not c2.is_closed() - assert not client.is_closed() - assert client.is_closed() + assert not test_client.is_closed() + assert test_client.is_closed() @pytest.mark.respx(base_url=base_url) - def test_client_response_validation_error(self, respx_mock: MockRouter) -> None: + def test_client_response_validation_error(self, respx_mock: MockRouter, client: Runloop) -> None: class Model(BaseModel): foo: str respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": {"invalid": True}})) with pytest.raises(APIResponseValidationError) as exc: - self.client.get("/foo", cast_to=Model) + client.get("/foo", cast_to=Model) assert isinstance(exc.value.__cause__, ValidationError) @@ -731,11 +748,14 @@ class Model(BaseModel): with pytest.raises(APIResponseValidationError): strict_client.get("/foo", cast_to=Model) - client = Runloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=False) + non_strict_client = Runloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=False) - response = client.get("/foo", cast_to=Model) + response = non_strict_client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] + strict_client.close() + non_strict_client.close() + @pytest.mark.parametrize( "remaining_retries,retry_after,timeout", [ @@ -758,9 +778,9 @@ class Model(BaseModel): ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) - def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: - client = Runloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) - + def test_parse_retry_after_header( + self, remaining_retries: int, retry_after: str, timeout: float, client: Runloop + ) -> None: headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) calculated = client._calculate_retry_timeout(remaining_retries, options, headers) @@ -774,7 +794,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, clien with pytest.raises(APITimeoutError): client.devboxes.with_streaming_response.create().__enter__() - assert _get_open_connections(self.client) == 0 + assert _get_open_connections(client) == 0 @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) @@ -783,7 +803,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client with pytest.raises(APIStatusError): client.devboxes.with_streaming_response.create().__enter__() - assert _get_open_connections(self.client) == 0 + assert _get_open_connections(client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @@ -885,83 +905,77 @@ def test_default_client_creation(self) -> None: ) @pytest.mark.respx(base_url=base_url) - def test_follow_redirects(self, respx_mock: MockRouter) -> None: + def test_follow_redirects(self, respx_mock: MockRouter, client: Runloop) -> None: # Test that the default follow_redirects=True allows following redirects respx_mock.post("/redirect").mock( return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) ) respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"})) - response = self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) + response = client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) assert response.status_code == 200 assert response.json() == {"status": "ok"} @pytest.mark.respx(base_url=base_url) - def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None: + def test_follow_redirects_disabled(self, respx_mock: MockRouter, client: Runloop) -> None: # Test that follow_redirects=False prevents following redirects respx_mock.post("/redirect").mock( return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) ) with pytest.raises(APIStatusError) as exc_info: - self.client.post( - "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response - ) + client.post("/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response) assert exc_info.value.response.status_code == 302 assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected" class TestAsyncRunloop: - client = AsyncRunloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) - @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio - async def test_raw_response(self, respx_mock: MockRouter) -> None: + async def test_raw_response(self, respx_mock: MockRouter, async_client: AsyncRunloop) -> None: respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = await self.client.post("/foo", cast_to=httpx.Response) + response = await async_client.post("/foo", cast_to=httpx.Response) assert response.status_code == 200 assert isinstance(response, httpx.Response) assert response.json() == {"foo": "bar"} @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio - async def test_raw_response_for_binary(self, respx_mock: MockRouter) -> None: + async def test_raw_response_for_binary(self, respx_mock: MockRouter, async_client: AsyncRunloop) -> None: respx_mock.post("/foo").mock( return_value=httpx.Response(200, headers={"Content-Type": "application/binary"}, content='{"foo": "bar"}') ) - response = await self.client.post("/foo", cast_to=httpx.Response) + response = await async_client.post("/foo", cast_to=httpx.Response) assert response.status_code == 200 assert isinstance(response, httpx.Response) assert response.json() == {"foo": "bar"} - def test_copy(self) -> None: - copied = self.client.copy() - assert id(copied) != id(self.client) + def test_copy(self, async_client: AsyncRunloop) -> None: + copied = async_client.copy() + assert id(copied) != id(async_client) - copied = self.client.copy(bearer_token="another My Bearer Token") + copied = async_client.copy(bearer_token="another My Bearer Token") assert copied.bearer_token == "another My Bearer Token" - assert self.client.bearer_token == "My Bearer Token" + assert async_client.bearer_token == "My Bearer Token" - def test_copy_default_options(self) -> None: + def test_copy_default_options(self, async_client: AsyncRunloop) -> None: # options that have a default are overridden correctly - copied = self.client.copy(max_retries=7) + copied = async_client.copy(max_retries=7) assert copied.max_retries == 7 - assert self.client.max_retries == 5 + assert async_client.max_retries == 5 copied2 = copied.copy(max_retries=6) assert copied2.max_retries == 6 assert copied.max_retries == 7 # timeout - assert isinstance(self.client.timeout, httpx.Timeout) - copied = self.client.copy(timeout=None) + assert isinstance(async_client.timeout, httpx.Timeout) + copied = async_client.copy(timeout=None) assert copied.timeout is None - assert isinstance(self.client.timeout, httpx.Timeout) + assert isinstance(async_client.timeout, httpx.Timeout) - def test_copy_default_headers(self) -> None: + async def test_copy_default_headers(self) -> None: client = AsyncRunloop( base_url=base_url, bearer_token=bearer_token, @@ -997,8 +1011,9 @@ def test_copy_default_headers(self) -> None: match="`default_headers` and `set_default_headers` arguments are mutually exclusive", ): client.copy(set_default_headers={}, default_headers={"X-Foo": "Bar"}) + await client.close() - def test_copy_default_query(self) -> None: + async def test_copy_default_query(self) -> None: client = AsyncRunloop( base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, default_query={"foo": "bar"} ) @@ -1034,13 +1049,15 @@ def test_copy_default_query(self) -> None: ): client.copy(set_default_query={}, default_query={"foo": "Bar"}) - def test_copy_signature(self) -> None: + await client.close() + + def test_copy_signature(self, async_client: AsyncRunloop) -> None: # ensure the same parameters that can be passed to the client are defined in the `.copy()` method init_signature = inspect.signature( # mypy doesn't like that we access the `__init__` property. - self.client.__init__, # type: ignore[misc] + async_client.__init__, # type: ignore[misc] ) - copy_signature = inspect.signature(self.client.copy) + copy_signature = inspect.signature(async_client.copy) exclude_params = {"transport", "proxies", "_strict_response_validation"} for name in init_signature.parameters.keys(): @@ -1051,12 +1068,12 @@ def test_copy_signature(self) -> None: assert copy_param is not None, f"copy() signature is missing the {name} param" @pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12") - def test_copy_build_request(self) -> None: + def test_copy_build_request(self, async_client: AsyncRunloop) -> None: options = FinalRequestOptions(method="get", url="/foo") def build_request(options: FinalRequestOptions) -> None: - client = self.client.copy() - client._build_request(options) + client_copy = async_client.copy() + client_copy._build_request(options) # ensure that the machinery is warmed up before tracing starts. build_request(options) @@ -1113,12 +1130,12 @@ def add_leak(leaks: list[tracemalloc.StatisticDiff], diff: tracemalloc.Statistic print(frame) raise AssertionError() - async def test_request_timeout(self) -> None: - request = self.client._build_request(FinalRequestOptions(method="get", url="/foo")) + async def test_request_timeout(self, async_client: AsyncRunloop) -> None: + request = async_client._build_request(FinalRequestOptions(method="get", url="/foo")) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT - request = self.client._build_request( + request = async_client._build_request( FinalRequestOptions(method="get", url="/foo", timeout=httpx.Timeout(100.0)) ) timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore @@ -1133,6 +1150,8 @@ async def test_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(0) + await client.close() + async def test_http_client_timeout_option(self) -> None: # custom timeout given to the httpx client should be used async with httpx.AsyncClient(timeout=None) as http_client: @@ -1144,6 +1163,8 @@ async def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == httpx.Timeout(None) + await client.close() + # no timeout given to the httpx client should not use the httpx default async with httpx.AsyncClient() as http_client: client = AsyncRunloop( @@ -1154,6 +1175,8 @@ async def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT + await client.close() + # explicitly passing the default timeout currently results in it being ignored async with httpx.AsyncClient(timeout=HTTPX_DEFAULT_TIMEOUT) as http_client: client = AsyncRunloop( @@ -1164,6 +1187,8 @@ async def test_http_client_timeout_option(self) -> None: timeout = httpx.Timeout(**request.extensions["timeout"]) # type: ignore assert timeout == DEFAULT_TIMEOUT # our default + await client.close() + def test_invalid_http_client(self) -> None: with pytest.raises(TypeError, match="Invalid `http_client` arg"): with httpx.Client() as http_client: @@ -1174,18 +1199,18 @@ def test_invalid_http_client(self) -> None: http_client=cast(Any, http_client), ) - def test_default_headers_option(self) -> None: - client = AsyncRunloop( + async def test_default_headers_option(self) -> None: + test_client = AsyncRunloop( base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, default_headers={"X-Foo": "bar"}, ) - request = client._build_request(FinalRequestOptions(method="get", url="/foo")) + request = test_client._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("x-foo") == "bar" assert request.headers.get("x-stainless-lang") == "python" - client2 = AsyncRunloop( + test_client2 = AsyncRunloop( base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True, @@ -1194,10 +1219,13 @@ def test_default_headers_option(self) -> None: "X-Stainless-Lang": "my-overriding-header", }, ) - request = client2._build_request(FinalRequestOptions(method="get", url="/foo")) + request = test_client2._build_request(FinalRequestOptions(method="get", url="/foo")) assert request.headers.get("x-foo") == "stainless" assert request.headers.get("x-stainless-lang") == "my-overriding-header" + await test_client.close() + await test_client2.close() + def test_validate_headers(self) -> None: client = AsyncRunloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) request = client._build_request(FinalRequestOptions(method="get", url="/foo")) @@ -1208,7 +1236,7 @@ def test_validate_headers(self) -> None: client2 = AsyncRunloop(base_url=base_url, bearer_token=None, _strict_response_validation=True) _ = client2 - def test_default_query_option(self) -> None: + async def test_default_query_option(self) -> None: client = AsyncRunloop( base_url=base_url, bearer_token=bearer_token, @@ -1229,8 +1257,10 @@ def test_default_query_option(self) -> None: url = httpx.URL(request.url) assert dict(url.params) == {"foo": "baz", "query_param": "overridden"} - def test_request_extra_json(self) -> None: - request = self.client._build_request( + await client.close() + + def test_request_extra_json(self, client: Runloop) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1241,7 +1271,7 @@ def test_request_extra_json(self) -> None: data = json.loads(request.content.decode("utf-8")) assert data == {"foo": "bar", "baz": False} - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1252,7 +1282,7 @@ def test_request_extra_json(self) -> None: assert data == {"baz": False} # `extra_json` takes priority over `json_data` when keys clash - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1263,8 +1293,8 @@ def test_request_extra_json(self) -> None: data = json.loads(request.content.decode("utf-8")) assert data == {"foo": "bar", "baz": None} - def test_request_extra_headers(self) -> None: - request = self.client._build_request( + def test_request_extra_headers(self, client: Runloop) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1274,7 +1304,7 @@ def test_request_extra_headers(self) -> None: assert request.headers.get("X-Foo") == "Foo" # `extra_headers` takes priority over `default_headers` when keys clash - request = self.client.with_options(default_headers={"X-Bar": "true"})._build_request( + request = client.with_options(default_headers={"X-Bar": "true"})._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1285,8 +1315,8 @@ def test_request_extra_headers(self) -> None: ) assert request.headers.get("X-Bar") == "false" - def test_request_extra_query(self) -> None: - request = self.client._build_request( + def test_request_extra_query(self, client: Runloop) -> None: + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1299,7 +1329,7 @@ def test_request_extra_query(self) -> None: assert params == {"my_query_param": "Foo"} # if both `query` and `extra_query` are given, they are merged - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1313,7 +1343,7 @@ def test_request_extra_query(self) -> None: assert params == {"bar": "1", "foo": "2"} # `extra_query` takes priority over `query` when keys clash - request = self.client._build_request( + request = client._build_request( FinalRequestOptions( method="post", url="/foo", @@ -1356,7 +1386,7 @@ def test_multipart_repeating_array(self, async_client: AsyncRunloop) -> None: ] @pytest.mark.respx(base_url=base_url) - async def test_basic_union_response(self, respx_mock: MockRouter) -> None: + async def test_basic_union_response(self, respx_mock: MockRouter, async_client: AsyncRunloop) -> None: class Model1(BaseModel): name: str @@ -1365,12 +1395,12 @@ class Model2(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = await async_client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model2) assert response.foo == "bar" @pytest.mark.respx(base_url=base_url) - async def test_union_response_different_types(self, respx_mock: MockRouter) -> None: + async def test_union_response_different_types(self, respx_mock: MockRouter, async_client: AsyncRunloop) -> None: """Union of objects with the same field name using a different type""" class Model1(BaseModel): @@ -1381,18 +1411,20 @@ class Model2(BaseModel): respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": "bar"})) - response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = await async_client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model2) assert response.foo == "bar" respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": 1})) - response = await self.client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) + response = await async_client.get("/foo", cast_to=cast(Any, Union[Model1, Model2])) assert isinstance(response, Model1) assert response.foo == 1 @pytest.mark.respx(base_url=base_url) - async def test_non_application_json_content_type_for_json_data(self, respx_mock: MockRouter) -> None: + async def test_non_application_json_content_type_for_json_data( + self, respx_mock: MockRouter, async_client: AsyncRunloop + ) -> None: """ Response that sets Content-Type to something other than application/json but returns json data """ @@ -1408,38 +1440,38 @@ class Model(BaseModel): ) ) - response = await self.client.get("/foo", cast_to=Model) + response = await async_client.get("/foo", cast_to=Model) assert isinstance(response, Model) assert response.foo == 2 @pytest.mark.respx(base_url=base_url) - async def test_idempotency_header_options(self, respx_mock: MockRouter) -> None: + async def test_idempotency_header_options(self, respx_mock: MockRouter, async_client: AsyncRunloop) -> None: respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={})) - response = await self.client.post("/foo", cast_to=httpx.Response) + response = await async_client.post("/foo", cast_to=httpx.Response) header = response.request.headers.get("x-request-id") assert header is not None assert header.startswith("stainless-python-retry") # explicit header - response = await self.client.post( + response = await async_client.post( "/foo", cast_to=httpx.Response, options=make_request_options(extra_headers={"x-request-id": "custom-key"}) ) assert response.request.headers.get("x-request-id") == "custom-key" - response = await self.client.post( + response = await async_client.post( "/foo", cast_to=httpx.Response, options=make_request_options(extra_headers={"x-request-id": "custom-key"}) ) assert response.request.headers.get("x-request-id") == "custom-key" # custom argument - response = await self.client.post( + response = await async_client.post( "/foo", cast_to=httpx.Response, options=make_request_options(idempotency_key="custom-key") ) assert response.request.headers.get("x-request-id") == "custom-key" - def test_base_url_setter(self) -> None: + async def test_base_url_setter(self) -> None: client = AsyncRunloop( base_url="https://example.com/from_init", bearer_token=bearer_token, _strict_response_validation=True ) @@ -1449,7 +1481,9 @@ def test_base_url_setter(self) -> None: assert client.base_url == "https://example.com/from_setter/" - def test_base_url_env(self) -> None: + await client.close() + + async def test_base_url_env(self) -> None: with update_env(RUNLOOP_BASE_URL="http://localhost:5000/from/env"): client = AsyncRunloop(bearer_token=bearer_token, _strict_response_validation=True) assert client.base_url == "http://localhost:5000/from/env/" @@ -1471,7 +1505,7 @@ def test_base_url_env(self) -> None: ], ids=["standard", "custom http client"], ) - def test_base_url_trailing_slash(self, client: AsyncRunloop) -> None: + async def test_base_url_trailing_slash(self, client: AsyncRunloop) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1480,6 +1514,7 @@ def test_base_url_trailing_slash(self, client: AsyncRunloop) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + await client.close() @pytest.mark.parametrize( "client", @@ -1498,7 +1533,7 @@ def test_base_url_trailing_slash(self, client: AsyncRunloop) -> None: ], ids=["standard", "custom http client"], ) - def test_base_url_no_trailing_slash(self, client: AsyncRunloop) -> None: + async def test_base_url_no_trailing_slash(self, client: AsyncRunloop) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1507,6 +1542,7 @@ def test_base_url_no_trailing_slash(self, client: AsyncRunloop) -> None: ), ) assert request.url == "http://localhost:5000/custom/path/foo" + await client.close() @pytest.mark.parametrize( "client", @@ -1525,7 +1561,7 @@ def test_base_url_no_trailing_slash(self, client: AsyncRunloop) -> None: ], ids=["standard", "custom http client"], ) - def test_absolute_request_url(self, client: AsyncRunloop) -> None: + async def test_absolute_request_url(self, client: AsyncRunloop) -> None: request = client._build_request( FinalRequestOptions( method="post", @@ -1534,37 +1570,37 @@ def test_absolute_request_url(self, client: AsyncRunloop) -> None: ), ) assert request.url == "https://myapi.com/foo" + await client.close() async def test_copied_client_does_not_close_http(self) -> None: - client = AsyncRunloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) - assert not client.is_closed() + test_client = AsyncRunloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + assert not test_client.is_closed() - copied = client.copy() - assert copied is not client + copied = test_client.copy() + assert copied is not test_client del copied await asyncio.sleep(0.2) - assert not client.is_closed() + assert not test_client.is_closed() async def test_client_context_manager(self) -> None: - client = AsyncRunloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) - async with client as c2: - assert c2 is client + test_client = AsyncRunloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) + async with test_client as c2: + assert c2 is test_client assert not c2.is_closed() - assert not client.is_closed() - assert client.is_closed() + assert not test_client.is_closed() + assert test_client.is_closed() @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio - async def test_client_response_validation_error(self, respx_mock: MockRouter) -> None: + async def test_client_response_validation_error(self, respx_mock: MockRouter, async_client: AsyncRunloop) -> None: class Model(BaseModel): foo: str respx_mock.get("/foo").mock(return_value=httpx.Response(200, json={"foo": {"invalid": True}})) with pytest.raises(APIResponseValidationError) as exc: - await self.client.get("/foo", cast_to=Model) + await async_client.get("/foo", cast_to=Model) assert isinstance(exc.value.__cause__, ValidationError) @@ -1578,7 +1614,6 @@ async def test_client_max_retries_validation(self) -> None: ) @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio async def test_received_text_for_expected_json(self, respx_mock: MockRouter) -> None: class Model(BaseModel): name: str @@ -1590,11 +1625,16 @@ class Model(BaseModel): with pytest.raises(APIResponseValidationError): await strict_client.get("/foo", cast_to=Model) - client = AsyncRunloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=False) + non_strict_client = AsyncRunloop( + base_url=base_url, bearer_token=bearer_token, _strict_response_validation=False + ) - response = await client.get("/foo", cast_to=Model) + response = await non_strict_client.get("/foo", cast_to=Model) assert isinstance(response, str) # type: ignore[unreachable] + await strict_client.close() + await non_strict_client.close() + @pytest.mark.parametrize( "remaining_retries,retry_after,timeout", [ @@ -1617,13 +1657,12 @@ class Model(BaseModel): ], ) @mock.patch("time.time", mock.MagicMock(return_value=1696004797)) - @pytest.mark.asyncio - async def test_parse_retry_after_header(self, remaining_retries: int, retry_after: str, timeout: float) -> None: - client = AsyncRunloop(base_url=base_url, bearer_token=bearer_token, _strict_response_validation=True) - + async def test_parse_retry_after_header( + self, remaining_retries: int, retry_after: str, timeout: float, async_client: AsyncRunloop + ) -> None: headers = httpx.Headers({"retry-after": retry_after}) options = FinalRequestOptions(method="get", url="/foo", max_retries=3) - calculated = client._calculate_retry_timeout(remaining_retries, options, headers) + calculated = async_client._calculate_retry_timeout(remaining_retries, options, headers) assert calculated == pytest.approx(timeout, 1 * 0.875) # pyright: ignore[reportUnknownMemberType] @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @@ -1636,7 +1675,7 @@ async def test_retrying_timeout_errors_doesnt_leak( with pytest.raises(APITimeoutError): await async_client.devboxes.with_streaming_response.create().__aenter__() - assert _get_open_connections(self.client) == 0 + assert _get_open_connections(async_client) == 0 @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) @@ -1645,12 +1684,11 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, with pytest.raises(APIStatusError): await async_client.devboxes.with_streaming_response.create().__aenter__() - assert _get_open_connections(self.client) == 0 + assert _get_open_connections(async_client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio @pytest.mark.parametrize("failure_mode", ["status", "exception"]) async def test_retries_taken( self, @@ -1682,7 +1720,6 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio async def test_omit_retry_count_header( self, async_client: AsyncRunloop, failures_before_success: int, respx_mock: MockRouter ) -> None: @@ -1706,7 +1743,6 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @mock.patch("runloop_api_client._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout) @pytest.mark.respx(base_url=base_url) - @pytest.mark.asyncio async def test_overwrite_retry_count_header( self, async_client: AsyncRunloop, failures_before_success: int, respx_mock: MockRouter ) -> None: @@ -1754,26 +1790,26 @@ async def test_default_client_creation(self) -> None: ) @pytest.mark.respx(base_url=base_url) - async def test_follow_redirects(self, respx_mock: MockRouter) -> None: + async def test_follow_redirects(self, respx_mock: MockRouter, async_client: AsyncRunloop) -> None: # Test that the default follow_redirects=True allows following redirects respx_mock.post("/redirect").mock( return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) ) respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"})) - response = await self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) + response = await async_client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response) assert response.status_code == 200 assert response.json() == {"status": "ok"} @pytest.mark.respx(base_url=base_url) - async def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None: + async def test_follow_redirects_disabled(self, respx_mock: MockRouter, async_client: AsyncRunloop) -> None: # Test that follow_redirects=False prevents following redirects respx_mock.post("/redirect").mock( return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"}) ) with pytest.raises(APIStatusError) as exc_info: - await self.client.post( + await async_client.post( "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response ) From 36dc06c8c36f6437b3b3d185e0b2b0aa4036838e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Nov 2025 03:38:07 +0000 Subject: [PATCH 891/993] chore(internal): grammar fix (it's -> its) --- src/runloop_api_client/_utils/_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runloop_api_client/_utils/_utils.py b/src/runloop_api_client/_utils/_utils.py index 50d59269a..eec7f4a1f 100644 --- a/src/runloop_api_client/_utils/_utils.py +++ b/src/runloop_api_client/_utils/_utils.py @@ -133,7 +133,7 @@ def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]: # Type safe methods for narrowing types with TypeVars. # The default narrowing for isinstance(obj, dict) is dict[unknown, unknown], # however this cause Pyright to rightfully report errors. As we know we don't -# care about the contained types we can safely use `object` in it's place. +# care about the contained types we can safely use `object` in its place. # # There are two separate functions defined, `is_*` and `is_*_t` for different use cases. # `is_*` is for when you're dealing with an unknown input From 5aba8fa5264fa4abff42dd5f0c043262edce4a93 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Nov 2025 00:51:30 +0000 Subject: [PATCH 892/993] feat(api): api update --- .stats.yml | 4 ++-- .../resources/devboxes/executions.py | 12 ++++++++---- .../types/devbox_async_execution_detail_view.py | 6 ++++++ .../execution_stream_stderr_updates_params.py | 5 ++++- .../execution_stream_stdout_updates_params.py | 5 ++++- .../types/shared/launch_parameters.py | 2 +- .../types/shared_params/launch_parameters.py | 2 +- 7 files changed, 26 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0e4db68fc..65a815124 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f60ee2123156a4db87ddfa4e1b8dd6379e26e8f8cf533946ca25b76559b6aa4d.yml -openapi_spec_hash: d80fdfaf40c65ce8c1962c4f6d35acc6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8e02c3b1500a865edf699bd71ae3796ffa686e68c414675ec3b1073d1d47c5e2.yml +openapi_spec_hash: 86bc37c63758e046e45a4025685caa65 config_hash: 95facb8cef59b5a1b05763b871bf6a4b diff --git a/src/runloop_api_client/resources/devboxes/executions.py b/src/runloop_api_client/resources/devboxes/executions.py index ba62abf4d..aa85e339c 100755 --- a/src/runloop_api_client/resources/devboxes/executions.py +++ b/src/runloop_api_client/resources/devboxes/executions.py @@ -356,7 +356,8 @@ def stream_stderr_updates( Tails the stderr logs for the given execution with SSE streaming Args: - offset: The byte offset to start the stream from + offset: The byte offset to start the stream from (if unspecified, starts from the + beginning of the stream) extra_headers: Send extra headers @@ -403,7 +404,8 @@ def stream_stdout_updates( Tails the stdout logs for the given execution with SSE streaming Args: - offset: The byte offset to start the stream from + offset: The byte offset to start the stream from (if unspecified, starts from the + beginning of the stream) extra_headers: Send extra headers @@ -756,7 +758,8 @@ async def stream_stderr_updates( Tails the stderr logs for the given execution with SSE streaming Args: - offset: The byte offset to start the stream from + offset: The byte offset to start the stream from (if unspecified, starts from the + beginning of the stream) extra_headers: Send extra headers @@ -803,7 +806,8 @@ async def stream_stdout_updates( Tails the stdout logs for the given execution with SSE streaming Args: - offset: The byte offset to start the stream from + offset: The byte offset to start the stream from (if unspecified, starts from the + beginning of the stream) extra_headers: Send extra headers diff --git a/src/runloop_api_client/types/devbox_async_execution_detail_view.py b/src/runloop_api_client/types/devbox_async_execution_detail_view.py index fffbe61fe..5239e4ed2 100755 --- a/src/runloop_api_client/types/devbox_async_execution_detail_view.py +++ b/src/runloop_api_client/types/devbox_async_execution_detail_view.py @@ -33,8 +33,14 @@ class DevboxAsyncExecutionDetailView(BaseModel): This field will remain unset until the execution has completed. """ + stderr_truncated: Optional[bool] = None + """Indicates whether the stderr was truncated due to size limits.""" + stdout: Optional[str] = None """Standard out generated by command. This field will remain unset until the execution has completed. """ + + stdout_truncated: Optional[bool] = None + """Indicates whether the stdout was truncated due to size limits.""" diff --git a/src/runloop_api_client/types/devboxes/execution_stream_stderr_updates_params.py b/src/runloop_api_client/types/devboxes/execution_stream_stderr_updates_params.py index b82639556..ea879c046 100644 --- a/src/runloop_api_client/types/devboxes/execution_stream_stderr_updates_params.py +++ b/src/runloop_api_client/types/devboxes/execution_stream_stderr_updates_params.py @@ -11,4 +11,7 @@ class ExecutionStreamStderrUpdatesParams(TypedDict, total=False): devbox_id: Required[str] offset: str - """The byte offset to start the stream from""" + """ + The byte offset to start the stream from (if unspecified, starts from the + beginning of the stream) + """ diff --git a/src/runloop_api_client/types/devboxes/execution_stream_stdout_updates_params.py b/src/runloop_api_client/types/devboxes/execution_stream_stdout_updates_params.py index 7296156b0..6d4d8111d 100644 --- a/src/runloop_api_client/types/devboxes/execution_stream_stdout_updates_params.py +++ b/src/runloop_api_client/types/devboxes/execution_stream_stdout_updates_params.py @@ -11,4 +11,7 @@ class ExecutionStreamStdoutUpdatesParams(TypedDict, total=False): devbox_id: Required[str] offset: str - """The byte offset to start the stream from""" + """ + The byte offset to start the stream from (if unspecified, starts from the + beginning of the stream) + """ diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index ccc3d725a..04901ebfc 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -55,7 +55,7 @@ class LaunchParameters(BaseModel): keep_alive_time_seconds: Optional[int] = None """Time in seconds after which Devbox will automatically shutdown. - Default is 1 hour. + Default is 1 hour. Maximum is 48 hours (172800 seconds). """ launch_commands: Optional[List[str]] = None diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index 4fd9ef5a6..303835be3 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -57,7 +57,7 @@ class LaunchParameters(TypedDict, total=False): keep_alive_time_seconds: Optional[int] """Time in seconds after which Devbox will automatically shutdown. - Default is 1 hour. + Default is 1 hour. Maximum is 48 hours (172800 seconds). """ launch_commands: Optional[SequenceNotStr[str]] From a97a66c2a3d5530dda8c704df2ba67f36631e2c1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 5 Nov 2025 01:06:17 +0000 Subject: [PATCH 893/993] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 65a815124..2f8268ab1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8e02c3b1500a865edf699bd71ae3796ffa686e68c414675ec3b1073d1d47c5e2.yml -openapi_spec_hash: 86bc37c63758e046e45a4025685caa65 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-63df0e3eb49d4874724f380b650693d90e071a41748bc163e93236b72a342883.yml +openapi_spec_hash: eb5df67593bd1c4a5c8d1082f24d73fb config_hash: 95facb8cef59b5a1b05763b871bf6a4b From 6344092c47d5a8e529e16e10f11e0e107e94c596 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Nov 2025 01:05:47 +0000 Subject: [PATCH 894/993] feat(blueprint): adds queued state --- .stats.yml | 4 ++-- src/runloop_api_client/types/blueprint_view.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2f8268ab1..0ffcd7329 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-63df0e3eb49d4874724f380b650693d90e071a41748bc163e93236b72a342883.yml -openapi_spec_hash: eb5df67593bd1c4a5c8d1082f24d73fb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-91cec4aeec2421487d5eeece4804ae3b8b47e22bdbb9fc7460feb64a8c10e42f.yml +openapi_spec_hash: 3d8d782e2450d46b8ce6573bad488ea1 config_hash: 95facb8cef59b5a1b05763b871bf6a4b diff --git a/src/runloop_api_client/types/blueprint_view.py b/src/runloop_api_client/types/blueprint_view.py index b63763e42..7a10d1686 100644 --- a/src/runloop_api_client/types/blueprint_view.py +++ b/src/runloop_api_client/types/blueprint_view.py @@ -56,7 +56,7 @@ class BlueprintView(BaseModel): state: Literal["created", "deleted"] """The state of the Blueprint.""" - status: Literal["provisioning", "building", "failed", "build_complete"] + status: Literal["queued", "provisioning", "building", "failed", "build_complete"] """The status of the Blueprint build.""" base_blueprint_id: Optional[str] = None From 46021967e5cbc5d5d59e51d9941f76a16ed37108 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Nov 2025 03:33:02 +0000 Subject: [PATCH 895/993] chore(package): drop Python 3.8 support --- README.md | 4 +- pyproject.toml | 5 +- requirements-dev.lock | 39 +- scripts/test | 4 +- src/runloop_api_client/_utils/_sync.py | 34 +- uv.lock | 1329 ++++-------------------- 6 files changed, 195 insertions(+), 1220 deletions(-) diff --git a/README.md b/README.md index 1866dfe99..3ddf4bbd7 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![PyPI version](https://img.shields.io/pypi/v/runloop_api_client.svg?label=pypi%20(stable))](https://pypi.org/project/runloop_api_client/) -The Runloop Python library provides convenient access to the Runloop REST API from any Python 3.8+ +The Runloop Python library provides convenient access to the Runloop REST API from any Python 3.9+ application. The library includes type definitions for all request params and response fields, and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx). @@ -453,7 +453,7 @@ print(runloop_api_client.__version__) ## Requirements -Python 3.8 or higher. +Python 3.9 or higher. ## Contributing diff --git a/pyproject.toml b/pyproject.toml index e4df6e84a..eb44c011c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,11 +15,10 @@ dependencies = [ "distro>=1.7.0, <2", "sniffio", ] -requires-python = ">= 3.8" +requires-python = ">= 3.9" classifiers = [ "Typing :: Typed", "Intended Audience :: Developers", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -126,7 +125,7 @@ filterwarnings = [ # there are a couple of flags that are still disabled by # default in strict mode as they are experimental and niche. typeCheckingMode = "strict" -pythonVersion = "3.8" +pythonVersion = "3.9" exclude = [ "_dev", diff --git a/requirements-dev.lock b/requirements-dev.lock index 16e3c6ed7..06562358b 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -3,11 +3,7 @@ -e . annotated-types==0.7.0 # via pydantic -anyio==4.5.2 ; python_full_version < '3.9' - # via - # httpx - # runloop-api-client -anyio==4.8.0 ; python_full_version >= '3.9' +anyio==4.8.0 # via # httpx # runloop-api-client @@ -38,8 +34,7 @@ idna==3.10 # via # anyio # httpx -importlib-metadata==8.5.0 ; python_full_version < '3.9' -importlib-metadata==8.6.1 ; python_full_version >= '3.9' +importlib-metadata==8.6.1 iniconfig==2.0.0 # via pytest markdown-it-py==3.0.0 @@ -55,34 +50,23 @@ packaging==24.2 # via pytest pluggy==1.5.0 # via pytest -pydantic==2.10.6 ; python_full_version < '3.9' +pydantic==2.10.3 # via runloop-api-client -pydantic==2.11.9 ; python_full_version >= '3.9' - # via runloop-api-client -pydantic-core==2.27.2 ; python_full_version < '3.9' - # via pydantic -pydantic-core==2.33.2 ; python_full_version >= '3.9' +pydantic-core==2.27.1 # via pydantic pygments==2.19.1 # via # pytest # rich pyright==1.1.399 -pytest==8.3.5 ; python_full_version < '3.9' - # via - # pytest-asyncio - # pytest-xdist -pytest==8.4.1 ; python_full_version >= '3.9' +pytest==8.4.1 # via # pytest-asyncio # pytest-xdist pytest-asyncio==0.24.0 -pytest-xdist==3.6.1 ; python_full_version < '3.9' -pytest-xdist==3.7.0 ; python_full_version >= '3.9' +pytest-xdist==3.7.0 python-dateutil==2.9.0.post0 # via time-machine -pytz==2024.2 ; python_full_version < '3.9' - # via dirty-equals respx==0.22.0 rich==13.9.4 ruff==0.9.4 @@ -92,15 +76,13 @@ sniffio==1.3.1 # via # anyio # runloop-api-client -time-machine==2.15.0 ; python_full_version < '3.9' -time-machine==2.16.0 ; python_full_version >= '3.9' +time-machine==2.16.0 tomli==2.2.1 ; python_full_version < '3.11' # via # mypy # pytest typing-extensions==4.12.2 # via - # annotated-types # anyio # mypy # pydantic @@ -108,10 +90,5 @@ typing-extensions==4.12.2 # pyright # rich # runloop-api-client - # typing-inspection -typing-inspection==0.4.1 ; python_full_version >= '3.9' - # via pydantic -zipp==3.20.2 ; python_full_version < '3.9' - # via importlib-metadata -zipp==3.21.0 ; python_full_version >= '3.9' +zipp==3.21.0 # via importlib-metadata diff --git a/scripts/test b/scripts/test index aa1bdc949..f87b13bef 100755 --- a/scripts/test +++ b/scripts/test @@ -68,8 +68,8 @@ if [[ -n "$UV_PYTHON" ]]; then else # If UV_PYTHON is not set, run the command for min and max versions - echo "==> Running tests for Python 3.8" - UV_PYTHON=3.8 run_tests "$@" + echo "==> Running tests for Python 3.9" + UV_PYTHON=3.9 run_tests "$@" echo "==> Running tests for Python 3.13" UV_PYTHON=3.13 run_tests "$@" diff --git a/src/runloop_api_client/_utils/_sync.py b/src/runloop_api_client/_utils/_sync.py index ad7ec71b7..f6027c183 100644 --- a/src/runloop_api_client/_utils/_sync.py +++ b/src/runloop_api_client/_utils/_sync.py @@ -1,10 +1,8 @@ from __future__ import annotations -import sys import asyncio import functools -import contextvars -from typing import Any, TypeVar, Callable, Awaitable +from typing import TypeVar, Callable, Awaitable from typing_extensions import ParamSpec import anyio @@ -15,34 +13,11 @@ T_ParamSpec = ParamSpec("T_ParamSpec") -if sys.version_info >= (3, 9): - _asyncio_to_thread = asyncio.to_thread -else: - # backport of https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread - # for Python 3.8 support - async def _asyncio_to_thread( - func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs - ) -> Any: - """Asynchronously run function *func* in a separate thread. - - Any *args and **kwargs supplied for this function are directly passed - to *func*. Also, the current :class:`contextvars.Context` is propagated, - allowing context variables from the main thread to be accessed in the - separate thread. - - Returns a coroutine that can be awaited to get the eventual result of *func*. - """ - loop = asyncio.events.get_running_loop() - ctx = contextvars.copy_context() - func_call = functools.partial(ctx.run, func, *args, **kwargs) - return await loop.run_in_executor(None, func_call) - - async def to_thread( func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs ) -> T_Retval: if sniffio.current_async_library() == "asyncio": - return await _asyncio_to_thread(func, *args, **kwargs) + return await asyncio.to_thread(func, *args, **kwargs) return await anyio.to_thread.run_sync( functools.partial(func, *args, **kwargs), @@ -53,10 +28,7 @@ async def to_thread( def asyncify(function: Callable[T_ParamSpec, T_Retval]) -> Callable[T_ParamSpec, Awaitable[T_Retval]]: """ Take a blocking function and create an async one that receives the same - positional and keyword arguments. For python version 3.9 and above, it uses - asyncio.to_thread to run the function in a separate thread. For python version - 3.8, it uses locally defined copy of the asyncio.to_thread function which was - introduced in python 3.9. + positional and keyword arguments. Usage: diff --git a/uv.lock b/uv.lock index 9524b6453..0a71acdfd 100644 --- a/uv.lock +++ b/uv.lock @@ -1,165 +1,33 @@ version = 1 revision = 3 -requires-python = ">=3.8" -resolution-markers = [ - "python_full_version >= '3.9'", - "python_full_version < '3.9'", -] +requires-python = ">=3.9" conflicts = [[ { package = "runloop-api-client", group = "pydantic-v1" }, { package = "runloop-api-client", group = "pydantic-v2" }, ]] -[[package]] -name = "aiohappyeyeballs" -version = "2.4.4" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version < '3.9'", -] -sdist = { url = "https://files.pythonhosted.org/packages/7f/55/e4373e888fdacb15563ef6fa9fa8c8252476ea071e96fb46defac9f18bf2/aiohappyeyeballs-2.4.4.tar.gz", hash = "sha256:5fdd7d87889c63183afc18ce9271f9b0a7d32c2303e394468dd45d514a757745", size = 21977, upload-time = "2024-11-30T18:44:00.701Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b9/74/fbb6559de3607b3300b9be3cc64e97548d55678e44623db17820dbd20002/aiohappyeyeballs-2.4.4-py3-none-any.whl", hash = "sha256:a980909d50efcd44795c4afeca523296716d50cd756ddca6af8c65b996e27de8", size = 14756, upload-time = "2024-11-30T18:43:39.849Z" }, -] - [[package]] name = "aiohappyeyeballs" version = "2.6.1" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.9'", -] sdist = { url = "https://files.pythonhosted.org/packages/26/30/f84a107a9c4331c14b2b586036f40965c128aa4fee4dda5d3d51cb14ad54/aiohappyeyeballs-2.6.1.tar.gz", hash = "sha256:c3f9d0113123803ccadfdf3f0faa505bc78e6a72d1cc4806cbd719826e943558", size = 22760, upload-time = "2025-03-12T01:42:48.764Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/0f/15/5bf3b99495fb160b63f95972b81750f18f7f4e02ad051373b669d17d44f2/aiohappyeyeballs-2.6.1-py3-none-any.whl", hash = "sha256:f349ba8f4b75cb25c99c5c2d84e997e485204d2902a9597802b0371f09331fb8", size = 15265, upload-time = "2025-03-12T01:42:47.083Z" }, ] -[[package]] -name = "aiohttp" -version = "3.10.11" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version < '3.9'", -] -dependencies = [ - { name = "aiohappyeyeballs", version = "2.4.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "aiosignal", version = "1.3.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "async-timeout", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "attrs", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "frozenlist", version = "1.5.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "multidict", version = "6.1.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "yarl", version = "1.15.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/25/a8/8e2ba36c6e3278d62e0c88aa42bb92ddbef092ac363b390dab4421da5cf5/aiohttp-3.10.11.tar.gz", hash = "sha256:9dc2b8f3dcab2e39e0fa309c8da50c3b55e6f34ab25f1a71d3288f24924d33a7", size = 7551886, upload-time = "2024-11-13T16:40:33.335Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/11/c7/575f9e82d7ef13cb1b45b9db8a5b8fadb35107fb12e33809356ae0155223/aiohttp-3.10.11-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:5077b1a5f40ffa3ba1f40d537d3bec4383988ee51fbba6b74aa8fb1bc466599e", size = 588218, upload-time = "2024-11-13T16:36:38.461Z" }, - { url = "https://files.pythonhosted.org/packages/12/7b/a800dadbd9a47b7f921bfddcd531371371f39b9cd05786c3638bfe2e1175/aiohttp-3.10.11-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:8d6a14a4d93b5b3c2891fca94fa9d41b2322a68194422bef0dd5ec1e57d7d298", size = 400815, upload-time = "2024-11-13T16:36:40.547Z" }, - { url = "https://files.pythonhosted.org/packages/cb/28/7dbd53ab10b0ded397feed914880f39ce075bd39393b8dfc322909754a0a/aiohttp-3.10.11-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ffbfde2443696345e23a3c597049b1dd43049bb65337837574205e7368472177", size = 392099, upload-time = "2024-11-13T16:36:43.918Z" }, - { url = "https://files.pythonhosted.org/packages/6a/2e/c6390f49e67911711c2229740e261c501685fe7201f7f918d6ff2fd1cfb0/aiohttp-3.10.11-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:20b3d9e416774d41813bc02fdc0663379c01817b0874b932b81c7f777f67b217", size = 1224854, upload-time = "2024-11-13T16:36:46.473Z" }, - { url = "https://files.pythonhosted.org/packages/69/68/c96afae129201bff4edbece52b3e1abf3a8af57529a42700669458b00b9f/aiohttp-3.10.11-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2b943011b45ee6bf74b22245c6faab736363678e910504dd7531a58c76c9015a", size = 1259641, upload-time = "2024-11-13T16:36:48.28Z" }, - { url = "https://files.pythonhosted.org/packages/63/89/bedd01456442747946114a8c2f30ff1b23d3b2ea0c03709f854c4f354a5a/aiohttp-3.10.11-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:48bc1d924490f0d0b3658fe5c4b081a4d56ebb58af80a6729d4bd13ea569797a", size = 1295412, upload-time = "2024-11-13T16:36:50.286Z" }, - { url = "https://files.pythonhosted.org/packages/9b/4d/942198e2939efe7bfa484781590f082135e9931b8bcafb4bba62cf2d8f2f/aiohttp-3.10.11-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e12eb3f4b1f72aaaf6acd27d045753b18101524f72ae071ae1c91c1cd44ef115", size = 1218311, upload-time = "2024-11-13T16:36:53.721Z" }, - { url = "https://files.pythonhosted.org/packages/a3/5b/8127022912f1fa72dfc39cf37c36f83e0b56afc3b93594b1cf377b6e4ffc/aiohttp-3.10.11-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f14ebc419a568c2eff3c1ed35f634435c24ead2fe19c07426af41e7adb68713a", size = 1189448, upload-time = "2024-11-13T16:36:55.844Z" }, - { url = "https://files.pythonhosted.org/packages/af/12/752878033c8feab3362c0890a4d24e9895921729a53491f6f6fad64d3287/aiohttp-3.10.11-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:72b191cdf35a518bfc7ca87d770d30941decc5aaf897ec8b484eb5cc8c7706f3", size = 1186484, upload-time = "2024-11-13T16:36:58.472Z" }, - { url = "https://files.pythonhosted.org/packages/61/24/1d91c304fca47d5e5002ca23abab9b2196ac79d5c531258e048195b435b2/aiohttp-3.10.11-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:5ab2328a61fdc86424ee540d0aeb8b73bbcad7351fb7cf7a6546fc0bcffa0038", size = 1183864, upload-time = "2024-11-13T16:37:00.737Z" }, - { url = "https://files.pythonhosted.org/packages/c1/70/022d28b898314dac4cb5dd52ead2a372563c8590b1eaab9c5ed017eefb1e/aiohttp-3.10.11-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:aa93063d4af05c49276cf14e419550a3f45258b6b9d1f16403e777f1addf4519", size = 1241460, upload-time = "2024-11-13T16:37:03.175Z" }, - { url = "https://files.pythonhosted.org/packages/c3/15/2b43853330f82acf180602de0f68be62a2838d25d03d2ed40fecbe82479e/aiohttp-3.10.11-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:30283f9d0ce420363c24c5c2421e71a738a2155f10adbb1a11a4d4d6d2715cfc", size = 1258521, upload-time = "2024-11-13T16:37:06.013Z" }, - { url = "https://files.pythonhosted.org/packages/28/38/9ef2076cb06dcc155e7f02275f5da403a3e7c9327b6b075e999f0eb73613/aiohttp-3.10.11-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e5358addc8044ee49143c546d2182c15b4ac3a60be01c3209374ace05af5733d", size = 1207329, upload-time = "2024-11-13T16:37:08.091Z" }, - { url = "https://files.pythonhosted.org/packages/c2/5f/c5329d67a2c83d8ae17a84e11dec14da5773520913bfc191caaf4cd57e50/aiohttp-3.10.11-cp310-cp310-win32.whl", hash = "sha256:e1ffa713d3ea7cdcd4aea9cddccab41edf6882fa9552940344c44e59652e1120", size = 363835, upload-time = "2024-11-13T16:37:10.017Z" }, - { url = "https://files.pythonhosted.org/packages/0f/c6/ca5d70eea2fdbe283dbc1e7d30649a1a5371b2a2a9150db192446f645789/aiohttp-3.10.11-cp310-cp310-win_amd64.whl", hash = "sha256:778cbd01f18ff78b5dd23c77eb82987ee4ba23408cbed233009fd570dda7e674", size = 382169, upload-time = "2024-11-13T16:37:12.603Z" }, - { url = "https://files.pythonhosted.org/packages/73/96/221ec59bc38395a6c205cbe8bf72c114ce92694b58abc8c3c6b7250efa7f/aiohttp-3.10.11-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:80ff08556c7f59a7972b1e8919f62e9c069c33566a6d28586771711e0eea4f07", size = 587742, upload-time = "2024-11-13T16:37:14.469Z" }, - { url = "https://files.pythonhosted.org/packages/24/17/4e606c969b19de5c31a09b946bd4c37e30c5288ca91d4790aa915518846e/aiohttp-3.10.11-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2c8f96e9ee19f04c4914e4e7a42a60861066d3e1abf05c726f38d9d0a466e695", size = 400357, upload-time = "2024-11-13T16:37:16.482Z" }, - { url = "https://files.pythonhosted.org/packages/a2/e5/433f59b87ba69736e446824710dd7f26fcd05b24c6647cb1e76554ea5d02/aiohttp-3.10.11-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:fb8601394d537da9221947b5d6e62b064c9a43e88a1ecd7414d21a1a6fba9c24", size = 392099, upload-time = "2024-11-13T16:37:20.013Z" }, - { url = "https://files.pythonhosted.org/packages/d2/a3/3be340f5063970bb9e47f065ee8151edab639d9c2dce0d9605a325ab035d/aiohttp-3.10.11-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2ea224cf7bc2d8856d6971cea73b1d50c9c51d36971faf1abc169a0d5f85a382", size = 1300367, upload-time = "2024-11-13T16:37:22.645Z" }, - { url = "https://files.pythonhosted.org/packages/ba/7d/a3043918466cbee9429792ebe795f92f70eeb40aee4ccbca14c38ee8fa4d/aiohttp-3.10.11-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:db9503f79e12d5d80b3efd4d01312853565c05367493379df76d2674af881caa", size = 1339448, upload-time = "2024-11-13T16:37:24.834Z" }, - { url = "https://files.pythonhosted.org/packages/2c/60/192b378bd9d1ae67716b71ae63c3e97c48b134aad7675915a10853a0b7de/aiohttp-3.10.11-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0f449a50cc33f0384f633894d8d3cd020e3ccef81879c6e6245c3c375c448625", size = 1374875, upload-time = "2024-11-13T16:37:26.799Z" }, - { url = "https://files.pythonhosted.org/packages/e0/d7/cd58bd17f5277d9cc32ecdbb0481ca02c52fc066412de413aa01268dc9b4/aiohttp-3.10.11-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:82052be3e6d9e0c123499127782a01a2b224b8af8c62ab46b3f6197035ad94e9", size = 1285626, upload-time = "2024-11-13T16:37:29.02Z" }, - { url = "https://files.pythonhosted.org/packages/bb/b2/da4953643b7dcdcd29cc99f98209f3653bf02023d95ce8a8fd57ffba0f15/aiohttp-3.10.11-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:20063c7acf1eec550c8eb098deb5ed9e1bb0521613b03bb93644b810986027ac", size = 1246120, upload-time = "2024-11-13T16:37:31.268Z" }, - { url = "https://files.pythonhosted.org/packages/6c/22/1217b3c773055f0cb172e3b7108274a74c0fe9900c716362727303931cbb/aiohttp-3.10.11-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:489cced07a4c11488f47aab1f00d0c572506883f877af100a38f1fedaa884c3a", size = 1265177, upload-time = "2024-11-13T16:37:33.348Z" }, - { url = "https://files.pythonhosted.org/packages/63/5e/3827ad7e61544ed1e73e4fdea7bb87ea35ac59a362d7eb301feb5e859780/aiohttp-3.10.11-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:ea9b3bab329aeaa603ed3bf605f1e2a6f36496ad7e0e1aa42025f368ee2dc07b", size = 1257238, upload-time = "2024-11-13T16:37:35.753Z" }, - { url = "https://files.pythonhosted.org/packages/53/31/951f78751d403da6086b662760e6e8b08201b0dcf5357969f48261b4d0e1/aiohttp-3.10.11-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:ca117819d8ad113413016cb29774b3f6d99ad23c220069789fc050267b786c16", size = 1315944, upload-time = "2024-11-13T16:37:38.317Z" }, - { url = "https://files.pythonhosted.org/packages/0d/79/06ef7a2a69880649261818b135b245de5a4e89fed5a6987c8645428563fc/aiohttp-3.10.11-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:2dfb612dcbe70fb7cdcf3499e8d483079b89749c857a8f6e80263b021745c730", size = 1332065, upload-time = "2024-11-13T16:37:40.725Z" }, - { url = "https://files.pythonhosted.org/packages/10/39/a273857c2d0bbf2152a4201fbf776931c2dac74aa399c6683ed4c286d1d1/aiohttp-3.10.11-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f9b615d3da0d60e7d53c62e22b4fd1c70f4ae5993a44687b011ea3a2e49051b8", size = 1291882, upload-time = "2024-11-13T16:37:43.209Z" }, - { url = "https://files.pythonhosted.org/packages/49/39/7aa387f88403febc96e0494101763afaa14d342109329a01b413b2bac075/aiohttp-3.10.11-cp311-cp311-win32.whl", hash = "sha256:29103f9099b6068bbdf44d6a3d090e0a0b2be6d3c9f16a070dd9d0d910ec08f9", size = 363409, upload-time = "2024-11-13T16:37:45.143Z" }, - { url = "https://files.pythonhosted.org/packages/6f/e9/8eb3dc095ce48499d867ad461d02f1491686b79ad92e4fad4df582f6be7b/aiohttp-3.10.11-cp311-cp311-win_amd64.whl", hash = "sha256:236b28ceb79532da85d59aa9b9bf873b364e27a0acb2ceaba475dc61cffb6f3f", size = 382644, upload-time = "2024-11-13T16:37:47.685Z" }, - { url = "https://files.pythonhosted.org/packages/01/16/077057ef3bd684dbf9a8273a5299e182a8d07b4b252503712ff8b5364fd1/aiohttp-3.10.11-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:7480519f70e32bfb101d71fb9a1f330fbd291655a4c1c922232a48c458c52710", size = 584830, upload-time = "2024-11-13T16:37:49.608Z" }, - { url = "https://files.pythonhosted.org/packages/2c/cf/348b93deb9597c61a51b6682e81f7c7d79290249e886022ef0705d858d90/aiohttp-3.10.11-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:f65267266c9aeb2287a6622ee2bb39490292552f9fbf851baabc04c9f84e048d", size = 397090, upload-time = "2024-11-13T16:37:51.539Z" }, - { url = "https://files.pythonhosted.org/packages/70/bf/903df5cd739dfaf5b827b3d8c9d68ff4fcea16a0ca1aeb948c9da30f56c8/aiohttp-3.10.11-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7400a93d629a0608dc1d6c55f1e3d6e07f7375745aaa8bd7f085571e4d1cee97", size = 392361, upload-time = "2024-11-13T16:37:53.586Z" }, - { url = "https://files.pythonhosted.org/packages/fb/97/e4792675448a2ac5bd56f377a095233b805dd1315235c940c8ba5624e3cb/aiohttp-3.10.11-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f34b97e4b11b8d4eb2c3a4f975be626cc8af99ff479da7de49ac2c6d02d35725", size = 1309839, upload-time = "2024-11-13T16:37:55.68Z" }, - { url = "https://files.pythonhosted.org/packages/96/d0/ba19b1260da6fbbda4d5b1550d8a53ba3518868f2c143d672aedfdbc6172/aiohttp-3.10.11-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1e7b825da878464a252ccff2958838f9caa82f32a8dbc334eb9b34a026e2c636", size = 1348116, upload-time = "2024-11-13T16:37:58.232Z" }, - { url = "https://files.pythonhosted.org/packages/b3/b9/15100ee7113a2638bfdc91aecc54641609a92a7ce4fe533ebeaa8d43ff93/aiohttp-3.10.11-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f9f92a344c50b9667827da308473005f34767b6a2a60d9acff56ae94f895f385", size = 1391402, upload-time = "2024-11-13T16:38:00.522Z" }, - { url = "https://files.pythonhosted.org/packages/c5/36/831522618ac0dcd0b28f327afd18df7fb6bbf3eaf302f912a40e87714846/aiohttp-3.10.11-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc6f1ab987a27b83c5268a17218463c2ec08dbb754195113867a27b166cd6087", size = 1304239, upload-time = "2024-11-13T16:38:04.195Z" }, - { url = "https://files.pythonhosted.org/packages/60/9f/b7230d0c48b076500ae57adb717aa0656432acd3d8febb1183dedfaa4e75/aiohttp-3.10.11-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1dc0f4ca54842173d03322793ebcf2c8cc2d34ae91cc762478e295d8e361e03f", size = 1256565, upload-time = "2024-11-13T16:38:07.218Z" }, - { url = "https://files.pythonhosted.org/packages/63/c2/35c7b4699f4830b3b0a5c3d5619df16dca8052ae8b488e66065902d559f6/aiohttp-3.10.11-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:7ce6a51469bfaacff146e59e7fb61c9c23006495d11cc24c514a455032bcfa03", size = 1269285, upload-time = "2024-11-13T16:38:09.396Z" }, - { url = "https://files.pythonhosted.org/packages/51/48/bc20ea753909bdeb09f9065260aefa7453e3a57f6a51f56f5216adc1a5e7/aiohttp-3.10.11-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:aad3cd91d484d065ede16f3cf15408254e2469e3f613b241a1db552c5eb7ab7d", size = 1276716, upload-time = "2024-11-13T16:38:12.039Z" }, - { url = "https://files.pythonhosted.org/packages/0c/7b/a8708616b3810f55ead66f8e189afa9474795760473aea734bbea536cd64/aiohttp-3.10.11-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:f4df4b8ca97f658c880fb4b90b1d1ec528315d4030af1ec763247ebfd33d8b9a", size = 1315023, upload-time = "2024-11-13T16:38:15.155Z" }, - { url = "https://files.pythonhosted.org/packages/2a/d6/dfe9134a921e05b01661a127a37b7d157db93428905450e32f9898eef27d/aiohttp-3.10.11-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:2e4e18a0a2d03531edbc06c366954e40a3f8d2a88d2b936bbe78a0c75a3aab3e", size = 1342735, upload-time = "2024-11-13T16:38:17.539Z" }, - { url = "https://files.pythonhosted.org/packages/ca/1a/3bd7f18e3909eabd57e5d17ecdbf5ea4c5828d91341e3676a07de7c76312/aiohttp-3.10.11-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:6ce66780fa1a20e45bc753cda2a149daa6dbf1561fc1289fa0c308391c7bc0a4", size = 1302618, upload-time = "2024-11-13T16:38:19.865Z" }, - { url = "https://files.pythonhosted.org/packages/cf/51/d063133781cda48cfdd1e11fc8ef45ab3912b446feba41556385b3ae5087/aiohttp-3.10.11-cp312-cp312-win32.whl", hash = "sha256:a919c8957695ea4c0e7a3e8d16494e3477b86f33067478f43106921c2fef15bb", size = 360497, upload-time = "2024-11-13T16:38:21.996Z" }, - { url = "https://files.pythonhosted.org/packages/55/4e/f29def9ed39826fe8f85955f2e42fe5cc0cbe3ebb53c97087f225368702e/aiohttp-3.10.11-cp312-cp312-win_amd64.whl", hash = "sha256:b5e29706e6389a2283a91611c91bf24f218962717c8f3b4e528ef529d112ee27", size = 380577, upload-time = "2024-11-13T16:38:24.247Z" }, - { url = "https://files.pythonhosted.org/packages/1f/63/654c185dfe3cf5d4a0d35b6ee49ee6ca91922c694eaa90732e1ba4b40ef1/aiohttp-3.10.11-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:703938e22434d7d14ec22f9f310559331f455018389222eed132808cd8f44127", size = 577381, upload-time = "2024-11-13T16:38:26.708Z" }, - { url = "https://files.pythonhosted.org/packages/4e/c4/ee9c350acb202ba2eb0c44b0f84376b05477e870444192a9f70e06844c28/aiohttp-3.10.11-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:9bc50b63648840854e00084c2b43035a62e033cb9b06d8c22b409d56eb098413", size = 393289, upload-time = "2024-11-13T16:38:29.207Z" }, - { url = "https://files.pythonhosted.org/packages/3d/7c/30d161a7e3b208cef1b922eacf2bbb8578b7e5a62266a6a2245a1dd044dc/aiohttp-3.10.11-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5f0463bf8b0754bc744e1feb61590706823795041e63edf30118a6f0bf577461", size = 388859, upload-time = "2024-11-13T16:38:31.567Z" }, - { url = "https://files.pythonhosted.org/packages/79/10/8d050e04be447d3d39e5a4a910fa289d930120cebe1b893096bd3ee29063/aiohttp-3.10.11-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f6c6dec398ac5a87cb3a407b068e1106b20ef001c344e34154616183fe684288", size = 1280983, upload-time = "2024-11-13T16:38:33.738Z" }, - { url = "https://files.pythonhosted.org/packages/31/b3/977eca40afe643dcfa6b8d8bb9a93f4cba1d8ed1ead22c92056b08855c7a/aiohttp-3.10.11-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bcaf2d79104d53d4dcf934f7ce76d3d155302d07dae24dff6c9fffd217568067", size = 1317132, upload-time = "2024-11-13T16:38:35.999Z" }, - { url = "https://files.pythonhosted.org/packages/1a/43/b5ee8e697ed0f96a2b3d80b3058fa7590cda508e9cd256274246ba1cf37a/aiohttp-3.10.11-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:25fd5470922091b5a9aeeb7e75be609e16b4fba81cdeaf12981393fb240dd10e", size = 1362630, upload-time = "2024-11-13T16:38:39.016Z" }, - { url = "https://files.pythonhosted.org/packages/28/20/3ae8e993b2990fa722987222dea74d6bac9331e2f530d086f309b4aa8847/aiohttp-3.10.11-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bbde2ca67230923a42161b1f408c3992ae6e0be782dca0c44cb3206bf330dee1", size = 1276865, upload-time = "2024-11-13T16:38:41.423Z" }, - { url = "https://files.pythonhosted.org/packages/02/08/1afb0ab7dcff63333b683e998e751aa2547d1ff897b577d2244b00e6fe38/aiohttp-3.10.11-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:249c8ff8d26a8b41a0f12f9df804e7c685ca35a207e2410adbd3e924217b9006", size = 1230448, upload-time = "2024-11-13T16:38:43.962Z" }, - { url = "https://files.pythonhosted.org/packages/c6/fd/ccd0ff842c62128d164ec09e3dd810208a84d79cd402358a3038ae91f3e9/aiohttp-3.10.11-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:878ca6a931ee8c486a8f7b432b65431d095c522cbeb34892bee5be97b3481d0f", size = 1244626, upload-time = "2024-11-13T16:38:47.089Z" }, - { url = "https://files.pythonhosted.org/packages/9f/75/30e9537ab41ed7cb062338d8df7c4afb0a715b3551cd69fc4ea61cfa5a95/aiohttp-3.10.11-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:8663f7777ce775f0413324be0d96d9730959b2ca73d9b7e2c2c90539139cbdd6", size = 1243608, upload-time = "2024-11-13T16:38:49.47Z" }, - { url = "https://files.pythonhosted.org/packages/c2/e0/3e7a62d99b9080793affddc12a82b11c9bc1312916ad849700d2bddf9786/aiohttp-3.10.11-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:6cd3f10b01f0c31481fba8d302b61603a2acb37b9d30e1d14e0f5a58b7b18a31", size = 1286158, upload-time = "2024-11-13T16:38:51.947Z" }, - { url = "https://files.pythonhosted.org/packages/71/b8/df67886802e71e976996ed9324eb7dc379e53a7d972314e9c7fe3f6ac6bc/aiohttp-3.10.11-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:4e8d8aad9402d3aa02fdc5ca2fe68bcb9fdfe1f77b40b10410a94c7f408b664d", size = 1313636, upload-time = "2024-11-13T16:38:54.424Z" }, - { url = "https://files.pythonhosted.org/packages/3c/3b/aea9c3e70ff4e030f46902df28b4cdf486695f4d78fd9c6698827e2bafab/aiohttp-3.10.11-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:38e3c4f80196b4f6c3a85d134a534a56f52da9cb8d8e7af1b79a32eefee73a00", size = 1273772, upload-time = "2024-11-13T16:38:56.846Z" }, - { url = "https://files.pythonhosted.org/packages/e9/9e/4b4c5705270d1c4ee146516ad288af720798d957ba46504aaf99b86e85d9/aiohttp-3.10.11-cp313-cp313-win32.whl", hash = "sha256:fc31820cfc3b2863c6e95e14fcf815dc7afe52480b4dc03393c4873bb5599f71", size = 358679, upload-time = "2024-11-13T16:38:59.787Z" }, - { url = "https://files.pythonhosted.org/packages/28/1d/18ef37549901db94717d4389eb7be807acbfbdeab48a73ff2993fc909118/aiohttp-3.10.11-cp313-cp313-win_amd64.whl", hash = "sha256:4996ff1345704ffdd6d75fb06ed175938c133425af616142e7187f28dc75f14e", size = 378073, upload-time = "2024-11-13T16:39:02.065Z" }, - { url = "https://files.pythonhosted.org/packages/dd/f2/59165bee7bba0b0634525834c622f152a30715a1d8280f6291a0cb86b1e6/aiohttp-3.10.11-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:74baf1a7d948b3d640badeac333af581a367ab916b37e44cf90a0334157cdfd2", size = 592135, upload-time = "2024-11-13T16:39:04.774Z" }, - { url = "https://files.pythonhosted.org/packages/2e/0e/b3555c504745af66efbf89d16811148ff12932b86fad529d115538fe2739/aiohttp-3.10.11-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:473aebc3b871646e1940c05268d451f2543a1d209f47035b594b9d4e91ce8339", size = 402913, upload-time = "2024-11-13T16:39:08.065Z" }, - { url = "https://files.pythonhosted.org/packages/31/bb/2890a3c77126758ef58536ca9f7476a12ba2021e0cd074108fb99b8c8747/aiohttp-3.10.11-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:c2f746a6968c54ab2186574e15c3f14f3e7f67aef12b761e043b33b89c5b5f95", size = 394013, upload-time = "2024-11-13T16:39:10.638Z" }, - { url = "https://files.pythonhosted.org/packages/74/82/0ab5199b473558846d72901a714b6afeb6f6a6a6a4c3c629e2c107418afd/aiohttp-3.10.11-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d110cabad8360ffa0dec8f6ec60e43286e9d251e77db4763a87dcfe55b4adb92", size = 1255578, upload-time = "2024-11-13T16:39:13.14Z" }, - { url = "https://files.pythonhosted.org/packages/f8/b2/f232477dd3c0e95693a903c4815bfb8d831f6a1a67e27ad14d30a774eeda/aiohttp-3.10.11-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e0099c7d5d7afff4202a0c670e5b723f7718810000b4abcbc96b064129e64bc7", size = 1298780, upload-time = "2024-11-13T16:39:15.721Z" }, - { url = "https://files.pythonhosted.org/packages/34/8c/11972235a6b53d5b69098f2ee6629ff8f99cd9592dcaa620c7868deb5673/aiohttp-3.10.11-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0316e624b754dbbf8c872b62fe6dcb395ef20c70e59890dfa0de9eafccd2849d", size = 1336093, upload-time = "2024-11-13T16:39:19.11Z" }, - { url = "https://files.pythonhosted.org/packages/03/be/7ad9a6cd2312221cf7b6837d8e2d8e4660fbd4f9f15bccf79ef857f41f4d/aiohttp-3.10.11-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5a5f7ab8baf13314e6b2485965cbacb94afff1e93466ac4d06a47a81c50f9cca", size = 1250296, upload-time = "2024-11-13T16:39:22.363Z" }, - { url = "https://files.pythonhosted.org/packages/bb/8d/a3885a582d9fc481bccb155d082f83a7a846942e36e4a4bba061e3d6b95e/aiohttp-3.10.11-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c891011e76041e6508cbfc469dd1a8ea09bc24e87e4c204e05f150c4c455a5fa", size = 1215020, upload-time = "2024-11-13T16:39:25.205Z" }, - { url = "https://files.pythonhosted.org/packages/bb/e7/09a1736b7264316dc3738492d9b559f2a54b985660f21d76095c9890a62e/aiohttp-3.10.11-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:9208299251370ee815473270c52cd3f7069ee9ed348d941d574d1457d2c73e8b", size = 1210591, upload-time = "2024-11-13T16:39:28.311Z" }, - { url = "https://files.pythonhosted.org/packages/58/b1/ee684631f6af98065d49ac8416db7a8e74ea33e1378bc75952ab0522342f/aiohttp-3.10.11-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:459f0f32c8356e8125f45eeff0ecf2b1cb6db1551304972702f34cd9e6c44658", size = 1211255, upload-time = "2024-11-13T16:39:30.799Z" }, - { url = "https://files.pythonhosted.org/packages/8f/55/e21e312fd6c581f244dd2ed077ccb784aade07c19416a6316b1453f02c4e/aiohttp-3.10.11-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:14cdc8c1810bbd4b4b9f142eeee23cda528ae4e57ea0923551a9af4820980e39", size = 1278114, upload-time = "2024-11-13T16:39:34.141Z" }, - { url = "https://files.pythonhosted.org/packages/d8/7f/ff6df0e90df6759693f52720ebedbfa10982d97aa1fd02c6ca917a6399ea/aiohttp-3.10.11-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:971aa438a29701d4b34e4943e91b5e984c3ae6ccbf80dd9efaffb01bd0b243a9", size = 1292714, upload-time = "2024-11-13T16:39:37.216Z" }, - { url = "https://files.pythonhosted.org/packages/3a/45/63f35367dfffae41e7abd0603f92708b5b3655fda55c08388ac2c7fb127b/aiohttp-3.10.11-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:9a309c5de392dfe0f32ee57fa43ed8fc6ddf9985425e84bd51ed66bb16bce3a7", size = 1233734, upload-time = "2024-11-13T16:39:40.599Z" }, - { url = "https://files.pythonhosted.org/packages/ec/ee/74b0696c0e84e06c43beab9302f353d97dc9f0cccd7ccf3ee648411b849b/aiohttp-3.10.11-cp38-cp38-win32.whl", hash = "sha256:9ec1628180241d906a0840b38f162a3215114b14541f1a8711c368a8739a9be4", size = 365350, upload-time = "2024-11-13T16:39:43.852Z" }, - { url = "https://files.pythonhosted.org/packages/21/0c/74c895688db09a2852056abf32d128991ec2fb41e5f57a1fe0928e15151c/aiohttp-3.10.11-cp38-cp38-win_amd64.whl", hash = "sha256:9c6e0ffd52c929f985c7258f83185d17c76d4275ad22e90aa29f38e211aacbec", size = 384542, upload-time = "2024-11-13T16:39:47.093Z" }, - { url = "https://files.pythonhosted.org/packages/cc/df/aa0d1548db818395a372b5f90e62072677ce786d6b19680c49dd4da3825f/aiohttp-3.10.11-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:cdc493a2e5d8dc79b2df5bec9558425bcd39aff59fc949810cbd0832e294b106", size = 589833, upload-time = "2024-11-13T16:39:49.72Z" }, - { url = "https://files.pythonhosted.org/packages/75/7c/d11145784b3fa29c0421a3883a4b91ee8c19acb40332b1d2e39f47be4e5b/aiohttp-3.10.11-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b3e70f24e7d0405be2348da9d5a7836936bf3a9b4fd210f8c37e8d48bc32eca6", size = 401685, upload-time = "2024-11-13T16:39:52.263Z" }, - { url = "https://files.pythonhosted.org/packages/e2/67/1b5f93babeb060cb683d23104b243be1d6299fe6cd807dcb56cf67d2e62c/aiohttp-3.10.11-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:968b8fb2a5eee2770eda9c7b5581587ef9b96fbdf8dcabc6b446d35ccc69df01", size = 392957, upload-time = "2024-11-13T16:39:54.668Z" }, - { url = "https://files.pythonhosted.org/packages/e1/4d/441df53aafd8dd97b8cfe9e467c641fa19cb5113e7601a7f77f2124518e0/aiohttp-3.10.11-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:deef4362af9493d1382ef86732ee2e4cbc0d7c005947bd54ad1a9a16dd59298e", size = 1229754, upload-time = "2024-11-13T16:39:57.166Z" }, - { url = "https://files.pythonhosted.org/packages/4d/cc/f1397a2501b95cb94580de7051395e85af95a1e27aed1f8af73459ddfa22/aiohttp-3.10.11-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:686b03196976e327412a1b094f4120778c7c4b9cff9bce8d2fdfeca386b89829", size = 1266246, upload-time = "2024-11-13T16:40:00.723Z" }, - { url = "https://files.pythonhosted.org/packages/c2/b5/7d33dae7630b4e9f90d634c6a90cb0923797e011b71cd9b10fe685aec3f6/aiohttp-3.10.11-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3bf6d027d9d1d34e1c2e1645f18a6498c98d634f8e373395221121f1c258ace8", size = 1301720, upload-time = "2024-11-13T16:40:04.111Z" }, - { url = "https://files.pythonhosted.org/packages/51/36/f917bcc63bc489aa3f534fa81efbf895fa5286745dcd8bbd0eb9dbc923a1/aiohttp-3.10.11-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:099fd126bf960f96d34a760e747a629c27fb3634da5d05c7ef4d35ef4ea519fc", size = 1221527, upload-time = "2024-11-13T16:40:06.851Z" }, - { url = "https://files.pythonhosted.org/packages/32/c2/1a303a072b4763d99d4b0664a3a8b952869e3fbb660d4239826bd0c56cc1/aiohttp-3.10.11-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c73c4d3dae0b4644bc21e3de546530531d6cdc88659cdeb6579cd627d3c206aa", size = 1192309, upload-time = "2024-11-13T16:40:09.65Z" }, - { url = "https://files.pythonhosted.org/packages/62/ef/d62f705dc665382b78ef171e5ba2616c395220ac7c1f452f0d2dcad3f9f5/aiohttp-3.10.11-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:0c5580f3c51eea91559db3facd45d72e7ec970b04528b4709b1f9c2555bd6d0b", size = 1189481, upload-time = "2024-11-13T16:40:12.77Z" }, - { url = "https://files.pythonhosted.org/packages/40/22/3e3eb4f97e5c4f52ccd198512b583c0c9135aa4e989c7ade97023c4cd282/aiohttp-3.10.11-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:fdf6429f0caabfd8a30c4e2eaecb547b3c340e4730ebfe25139779b9815ba138", size = 1187877, upload-time = "2024-11-13T16:40:15.985Z" }, - { url = "https://files.pythonhosted.org/packages/b5/73/77475777fbe2b3efaceb49db2859f1a22c96fd5869d736e80375db05bbf4/aiohttp-3.10.11-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:d97187de3c276263db3564bb9d9fad9e15b51ea10a371ffa5947a5ba93ad6777", size = 1246006, upload-time = "2024-11-13T16:40:19.17Z" }, - { url = "https://files.pythonhosted.org/packages/ef/f7/5b060d19065473da91838b63d8fd4d20ef8426a7d905cc8f9cd11eabd780/aiohttp-3.10.11-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:0acafb350cfb2eba70eb5d271f55e08bd4502ec35e964e18ad3e7d34d71f7261", size = 1260403, upload-time = "2024-11-13T16:40:21.761Z" }, - { url = "https://files.pythonhosted.org/packages/6c/ea/e9ad224815cd83c8dfda686d2bafa2cab5b93d7232e09470a8d2a158acde/aiohttp-3.10.11-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:c13ed0c779911c7998a58e7848954bd4d63df3e3575f591e321b19a2aec8df9f", size = 1208643, upload-time = "2024-11-13T16:40:24.803Z" }, - { url = "https://files.pythonhosted.org/packages/ba/c1/e1c6bba72f379adbd52958601a8642546ed0807964afba3b1b5b8cfb1bc0/aiohttp-3.10.11-cp39-cp39-win32.whl", hash = "sha256:22b7c540c55909140f63ab4f54ec2c20d2635c0289cdd8006da46f3327f971b9", size = 364419, upload-time = "2024-11-13T16:40:27.817Z" }, - { url = "https://files.pythonhosted.org/packages/30/24/50862e06e86cd263c60661e00b9d2c8d7fdece4fe95454ed5aa21ecf8036/aiohttp-3.10.11-cp39-cp39-win_amd64.whl", hash = "sha256:7b26b1551e481012575dab8e3727b16fe7dd27eb2711d2e63ced7368756268fb", size = 382857, upload-time = "2024-11-13T16:40:30.427Z" }, -] - [[package]] name = "aiohttp" version = "3.12.13" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.9'", -] dependencies = [ - { name = "aiohappyeyeballs", version = "2.6.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "aiosignal", version = "1.4.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "async-timeout", marker = "(python_full_version >= '3.9' and python_full_version < '3.11') or (python_full_version < '3.9' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2') or (python_full_version >= '3.11' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "attrs", marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "frozenlist", version = "1.7.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "multidict", version = "6.6.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "propcache", version = "0.3.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "yarl", version = "1.20.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "aiohappyeyeballs" }, + { name = "aiosignal" }, + { name = "async-timeout", marker = "python_full_version < '3.11' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "attrs" }, + { name = "frozenlist" }, + { name = "multidict" }, + { name = "propcache" }, + { name = "yarl" }, ] sdist = { url = "https://files.pythonhosted.org/packages/42/6e/ab88e7cb2a4058bed2f7870276454f85a7c56cd6da79349eb314fc7bbcaa/aiohttp-3.12.13.tar.gz", hash = "sha256:47e2da578528264a12e4e3dd8dd72a7289e5f812758fe086473fab037a10fcce", size = 7819160, upload-time = "2025-06-14T15:15:41.354Z" } wheels = [ @@ -250,31 +118,13 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/e5/cb/aaa022eb993e7d51928dc22d743ed17addb40142250e829701c5e6679615/aiohttp-3.12.13-cp39-cp39-win_amd64.whl", hash = "sha256:29e08111ccf81b2734ae03f1ad1cb03b9615e7d8f616764f22f71209c094f122", size = 451652, upload-time = "2025-06-14T15:15:39.079Z" }, ] -[[package]] -name = "aiosignal" -version = "1.3.1" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version < '3.9'", -] -dependencies = [ - { name = "frozenlist", version = "1.5.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/ae/67/0952ed97a9793b4958e5736f6d2b346b414a2cd63e82d05940032f45b32f/aiosignal-1.3.1.tar.gz", hash = "sha256:54cd96e15e1649b75d6c87526a6ff0b6c1b0dd3459f43d9ca11d48c339b68cfc", size = 19422, upload-time = "2022-11-08T16:03:58.806Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/76/ac/a7305707cb852b7e16ff80eaf5692309bde30e2b1100a1fcacdc8f731d97/aiosignal-1.3.1-py3-none-any.whl", hash = "sha256:f8376fb07dd1e86a584e4fcdec80b36b7f81aac666ebc724e2c090300dd83b17", size = 7617, upload-time = "2022-11-08T16:03:57.483Z" }, -] - [[package]] name = "aiosignal" version = "1.4.0" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.9'", -] dependencies = [ - { name = "frozenlist", version = "1.7.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "typing-extensions", marker = "(python_full_version >= '3.9' and python_full_version < '3.13') or (python_full_version < '3.9' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2') or (python_full_version >= '3.13' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "frozenlist" }, + { name = "typing-extensions", marker = "python_full_version < '3.13' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, ] sdist = { url = "https://files.pythonhosted.org/packages/61/62/06741b579156360248d1ec624842ad0edf697050bbaf7c3e46394e106ad1/aiosignal-1.4.0.tar.gz", hash = "sha256:f47eecd9468083c2029cc99945502cb7708b082c232f9aca65da147157b251c7", size = 25007, upload-time = "2025-07-03T22:54:43.528Z" } wheels = [ @@ -285,44 +135,20 @@ wheels = [ name = "annotated-types" version = "0.7.0" source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "typing-extensions", marker = "(python_full_version < '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, -] sdist = { url = "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081, upload-time = "2024-05-20T21:33:25.928Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643, upload-time = "2024-05-20T21:33:24.1Z" }, ] -[[package]] -name = "anyio" -version = "4.5.2" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version < '3.9'", -] -dependencies = [ - { name = "exceptiongroup", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "idna", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "sniffio", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "typing-extensions", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/4d/f9/9a7ce600ebe7804daf90d4d48b1c0510a4561ddce43a596be46676f82343/anyio-4.5.2.tar.gz", hash = "sha256:23009af4ed04ce05991845451e11ef02fc7c5ed29179ac9a420e5ad0ac7ddc5b", size = 171293, upload-time = "2024-10-13T22:18:03.307Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/1b/b4/f7e396030e3b11394436358ca258a81d6010106582422f23443c16ca1873/anyio-4.5.2-py3-none-any.whl", hash = "sha256:c011ee36bc1e8ba40e5a81cb9df91925c218fe9b778554e0b56a21e1b5d4716f", size = 89766, upload-time = "2024-10-13T22:18:01.524Z" }, -] - [[package]] name = "anyio" version = "4.8.0" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.9'", -] dependencies = [ - { name = "exceptiongroup", marker = "(python_full_version >= '3.9' and python_full_version < '3.11') or (python_full_version < '3.9' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2') or (python_full_version >= '3.11' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "idna", marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "sniffio", marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "typing-extensions", marker = "(python_full_version >= '3.9' and python_full_version < '3.13') or (python_full_version < '3.9' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2') or (python_full_version >= '3.13' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "exceptiongroup", marker = "python_full_version < '3.11' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "idna" }, + { name = "sniffio" }, + { name = "typing-extensions", marker = "python_full_version < '3.13' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, ] sdist = { url = "https://files.pythonhosted.org/packages/a3/73/199a98fc2dae33535d6b8e8e6ec01f8c1d76c9adb096c6b7d64823038cde/anyio-4.8.0.tar.gz", hash = "sha256:1d9fe889df5212298c0c0723fa20479d1b94883a2df44bd3897aa91083316f7a", size = 181126, upload-time = "2025-01-05T13:13:11.095Z" } wheels = [ @@ -369,9 +195,6 @@ wheels = [ name = "dirty-equals" version = "0.9.0" source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "pytz", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, -] sdist = { url = "https://files.pythonhosted.org/packages/b0/99/133892f401ced5a27e641a473c547d5fbdb39af8f85dac8a9d633ea3e7a7/dirty_equals-0.9.0.tar.gz", hash = "sha256:17f515970b04ed7900b733c95fd8091f4f85e52f1fb5f268757f25c858eb1f7b", size = 50412, upload-time = "2025-01-11T23:23:40.491Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/77/0c/03cc99bf3b6328604b10829de3460f2b2ad3373200c45665c38508e550c6/dirty_equals-0.9.0-py3-none-any.whl", hash = "sha256:ff4d027f5cfa1b69573af00f7ba9043ea652dbdce3fe5cbe828e478c7346db9c", size = 28226, upload-time = "2025-01-11T23:23:37.489Z" }, @@ -404,115 +227,10 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/43/09/2aea36ff60d16dd8879bdb2f5b3ee0ba8d08cbbdcdfe870e695ce3784385/execnet-2.1.1-py3-none-any.whl", hash = "sha256:26dee51f1b80cebd6d0ca8e74dd8745419761d3bef34163928cbebbdc4749fdc", size = 40612, upload-time = "2024-04-08T09:04:17.414Z" }, ] -[[package]] -name = "frozenlist" -version = "1.5.0" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version < '3.9'", -] -sdist = { url = "https://files.pythonhosted.org/packages/8f/ed/0f4cec13a93c02c47ec32d81d11c0c1efbadf4a471e3f3ce7cad366cbbd3/frozenlist-1.5.0.tar.gz", hash = "sha256:81d5af29e61b9c8348e876d442253723928dce6433e0e76cd925cd83f1b4b817", size = 39930, upload-time = "2024-10-23T09:48:29.903Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/54/79/29d44c4af36b2b240725dce566b20f63f9b36ef267aaaa64ee7466f4f2f8/frozenlist-1.5.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:5b6a66c18b5b9dd261ca98dffcb826a525334b2f29e7caa54e182255c5f6a65a", size = 94451, upload-time = "2024-10-23T09:46:20.558Z" }, - { url = "https://files.pythonhosted.org/packages/47/47/0c999aeace6ead8a44441b4f4173e2261b18219e4ad1fe9a479871ca02fc/frozenlist-1.5.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d1b3eb7b05ea246510b43a7e53ed1653e55c2121019a97e60cad7efb881a97bb", size = 54301, upload-time = "2024-10-23T09:46:21.759Z" }, - { url = "https://files.pythonhosted.org/packages/8d/60/107a38c1e54176d12e06e9d4b5d755b677d71d1219217cee063911b1384f/frozenlist-1.5.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:15538c0cbf0e4fa11d1e3a71f823524b0c46299aed6e10ebb4c2089abd8c3bec", size = 52213, upload-time = "2024-10-23T09:46:22.993Z" }, - { url = "https://files.pythonhosted.org/packages/17/62/594a6829ac5679c25755362a9dc93486a8a45241394564309641425d3ff6/frozenlist-1.5.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e79225373c317ff1e35f210dd5f1344ff31066ba8067c307ab60254cd3a78ad5", size = 240946, upload-time = "2024-10-23T09:46:24.661Z" }, - { url = "https://files.pythonhosted.org/packages/7e/75/6c8419d8f92c80dd0ee3f63bdde2702ce6398b0ac8410ff459f9b6f2f9cb/frozenlist-1.5.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9272fa73ca71266702c4c3e2d4a28553ea03418e591e377a03b8e3659d94fa76", size = 264608, upload-time = "2024-10-23T09:46:26.017Z" }, - { url = "https://files.pythonhosted.org/packages/88/3e/82a6f0b84bc6fb7e0be240e52863c6d4ab6098cd62e4f5b972cd31e002e8/frozenlist-1.5.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:498524025a5b8ba81695761d78c8dd7382ac0b052f34e66939c42df860b8ff17", size = 261361, upload-time = "2024-10-23T09:46:27.787Z" }, - { url = "https://files.pythonhosted.org/packages/fd/85/14e5f9ccac1b64ff2f10c927b3ffdf88772aea875882406f9ba0cec8ad84/frozenlist-1.5.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:92b5278ed9d50fe610185ecd23c55d8b307d75ca18e94c0e7de328089ac5dcba", size = 231649, upload-time = "2024-10-23T09:46:28.992Z" }, - { url = "https://files.pythonhosted.org/packages/ee/59/928322800306f6529d1852323014ee9008551e9bb027cc38d276cbc0b0e7/frozenlist-1.5.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f3c8c1dacd037df16e85227bac13cca58c30da836c6f936ba1df0c05d046d8d", size = 241853, upload-time = "2024-10-23T09:46:30.211Z" }, - { url = "https://files.pythonhosted.org/packages/7d/bd/e01fa4f146a6f6c18c5d34cab8abdc4013774a26c4ff851128cd1bd3008e/frozenlist-1.5.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f2ac49a9bedb996086057b75bf93538240538c6d9b38e57c82d51f75a73409d2", size = 243652, upload-time = "2024-10-23T09:46:31.758Z" }, - { url = "https://files.pythonhosted.org/packages/a5/bd/e4771fd18a8ec6757033f0fa903e447aecc3fbba54e3630397b61596acf0/frozenlist-1.5.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:e66cc454f97053b79c2ab09c17fbe3c825ea6b4de20baf1be28919460dd7877f", size = 241734, upload-time = "2024-10-23T09:46:33.044Z" }, - { url = "https://files.pythonhosted.org/packages/21/13/c83821fa5544af4f60c5d3a65d054af3213c26b14d3f5f48e43e5fb48556/frozenlist-1.5.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:5a3ba5f9a0dfed20337d3e966dc359784c9f96503674c2faf015f7fe8e96798c", size = 260959, upload-time = "2024-10-23T09:46:34.916Z" }, - { url = "https://files.pythonhosted.org/packages/71/f3/1f91c9a9bf7ed0e8edcf52698d23f3c211d8d00291a53c9f115ceb977ab1/frozenlist-1.5.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:6321899477db90bdeb9299ac3627a6a53c7399c8cd58d25da094007402b039ab", size = 262706, upload-time = "2024-10-23T09:46:36.159Z" }, - { url = "https://files.pythonhosted.org/packages/4c/22/4a256fdf5d9bcb3ae32622c796ee5ff9451b3a13a68cfe3f68e2c95588ce/frozenlist-1.5.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:76e4753701248476e6286f2ef492af900ea67d9706a0155335a40ea21bf3b2f5", size = 250401, upload-time = "2024-10-23T09:46:37.327Z" }, - { url = "https://files.pythonhosted.org/packages/af/89/c48ebe1f7991bd2be6d5f4ed202d94960c01b3017a03d6954dd5fa9ea1e8/frozenlist-1.5.0-cp310-cp310-win32.whl", hash = "sha256:977701c081c0241d0955c9586ffdd9ce44f7a7795df39b9151cd9a6fd0ce4cfb", size = 45498, upload-time = "2024-10-23T09:46:38.552Z" }, - { url = "https://files.pythonhosted.org/packages/28/2f/cc27d5f43e023d21fe5c19538e08894db3d7e081cbf582ad5ed366c24446/frozenlist-1.5.0-cp310-cp310-win_amd64.whl", hash = "sha256:189f03b53e64144f90990d29a27ec4f7997d91ed3d01b51fa39d2dbe77540fd4", size = 51622, upload-time = "2024-10-23T09:46:39.513Z" }, - { url = "https://files.pythonhosted.org/packages/79/43/0bed28bf5eb1c9e4301003b74453b8e7aa85fb293b31dde352aac528dafc/frozenlist-1.5.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:fd74520371c3c4175142d02a976aee0b4cb4a7cc912a60586ffd8d5929979b30", size = 94987, upload-time = "2024-10-23T09:46:40.487Z" }, - { url = "https://files.pythonhosted.org/packages/bb/bf/b74e38f09a246e8abbe1e90eb65787ed745ccab6eaa58b9c9308e052323d/frozenlist-1.5.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2f3f7a0fbc219fb4455264cae4d9f01ad41ae6ee8524500f381de64ffaa077d5", size = 54584, upload-time = "2024-10-23T09:46:41.463Z" }, - { url = "https://files.pythonhosted.org/packages/2c/31/ab01375682f14f7613a1ade30149f684c84f9b8823a4391ed950c8285656/frozenlist-1.5.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f47c9c9028f55a04ac254346e92977bf0f166c483c74b4232bee19a6697e4778", size = 52499, upload-time = "2024-10-23T09:46:42.451Z" }, - { url = "https://files.pythonhosted.org/packages/98/a8/d0ac0b9276e1404f58fec3ab6e90a4f76b778a49373ccaf6a563f100dfbc/frozenlist-1.5.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0996c66760924da6e88922756d99b47512a71cfd45215f3570bf1e0b694c206a", size = 276357, upload-time = "2024-10-23T09:46:44.166Z" }, - { url = "https://files.pythonhosted.org/packages/ad/c9/c7761084fa822f07dac38ac29f841d4587570dd211e2262544aa0b791d21/frozenlist-1.5.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a2fe128eb4edeabe11896cb6af88fca5346059f6c8d807e3b910069f39157869", size = 287516, upload-time = "2024-10-23T09:46:45.369Z" }, - { url = "https://files.pythonhosted.org/packages/a1/ff/cd7479e703c39df7bdab431798cef89dc75010d8aa0ca2514c5b9321db27/frozenlist-1.5.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1a8ea951bbb6cacd492e3948b8da8c502a3f814f5d20935aae74b5df2b19cf3d", size = 283131, upload-time = "2024-10-23T09:46:46.654Z" }, - { url = "https://files.pythonhosted.org/packages/59/a0/370941beb47d237eca4fbf27e4e91389fd68699e6f4b0ebcc95da463835b/frozenlist-1.5.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:de537c11e4aa01d37db0d403b57bd6f0546e71a82347a97c6a9f0dcc532b3a45", size = 261320, upload-time = "2024-10-23T09:46:47.825Z" }, - { url = "https://files.pythonhosted.org/packages/b8/5f/c10123e8d64867bc9b4f2f510a32042a306ff5fcd7e2e09e5ae5100ee333/frozenlist-1.5.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c2623347b933fcb9095841f1cc5d4ff0b278addd743e0e966cb3d460278840d", size = 274877, upload-time = "2024-10-23T09:46:48.989Z" }, - { url = "https://files.pythonhosted.org/packages/fa/79/38c505601ae29d4348f21706c5d89755ceded02a745016ba2f58bd5f1ea6/frozenlist-1.5.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:cee6798eaf8b1416ef6909b06f7dc04b60755206bddc599f52232606e18179d3", size = 269592, upload-time = "2024-10-23T09:46:50.235Z" }, - { url = "https://files.pythonhosted.org/packages/19/e2/39f3a53191b8204ba9f0bb574b926b73dd2efba2a2b9d2d730517e8f7622/frozenlist-1.5.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:f5f9da7f5dbc00a604fe74aa02ae7c98bcede8a3b8b9666f9f86fc13993bc71a", size = 265934, upload-time = "2024-10-23T09:46:51.829Z" }, - { url = "https://files.pythonhosted.org/packages/d5/c9/3075eb7f7f3a91f1a6b00284af4de0a65a9ae47084930916f5528144c9dd/frozenlist-1.5.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:90646abbc7a5d5c7c19461d2e3eeb76eb0b204919e6ece342feb6032c9325ae9", size = 283859, upload-time = "2024-10-23T09:46:52.947Z" }, - { url = "https://files.pythonhosted.org/packages/05/f5/549f44d314c29408b962fa2b0e69a1a67c59379fb143b92a0a065ffd1f0f/frozenlist-1.5.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:bdac3c7d9b705d253b2ce370fde941836a5f8b3c5c2b8fd70940a3ea3af7f4f2", size = 287560, upload-time = "2024-10-23T09:46:54.162Z" }, - { url = "https://files.pythonhosted.org/packages/9d/f8/cb09b3c24a3eac02c4c07a9558e11e9e244fb02bf62c85ac2106d1eb0c0b/frozenlist-1.5.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:03d33c2ddbc1816237a67f66336616416e2bbb6beb306e5f890f2eb22b959cdf", size = 277150, upload-time = "2024-10-23T09:46:55.361Z" }, - { url = "https://files.pythonhosted.org/packages/37/48/38c2db3f54d1501e692d6fe058f45b6ad1b358d82cd19436efab80cfc965/frozenlist-1.5.0-cp311-cp311-win32.whl", hash = "sha256:237f6b23ee0f44066219dae14c70ae38a63f0440ce6750f868ee08775073f942", size = 45244, upload-time = "2024-10-23T09:46:56.578Z" }, - { url = "https://files.pythonhosted.org/packages/ca/8c/2ddffeb8b60a4bce3b196c32fcc30d8830d4615e7b492ec2071da801b8ad/frozenlist-1.5.0-cp311-cp311-win_amd64.whl", hash = "sha256:0cc974cc93d32c42e7b0f6cf242a6bd941c57c61b618e78b6c0a96cb72788c1d", size = 51634, upload-time = "2024-10-23T09:46:57.6Z" }, - { url = "https://files.pythonhosted.org/packages/79/73/fa6d1a96ab7fd6e6d1c3500700963eab46813847f01ef0ccbaa726181dd5/frozenlist-1.5.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:31115ba75889723431aa9a4e77d5f398f5cf976eea3bdf61749731f62d4a4a21", size = 94026, upload-time = "2024-10-23T09:46:58.601Z" }, - { url = "https://files.pythonhosted.org/packages/ab/04/ea8bf62c8868b8eada363f20ff1b647cf2e93377a7b284d36062d21d81d1/frozenlist-1.5.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7437601c4d89d070eac8323f121fcf25f88674627505334654fd027b091db09d", size = 54150, upload-time = "2024-10-23T09:46:59.608Z" }, - { url = "https://files.pythonhosted.org/packages/d0/9a/8e479b482a6f2070b26bda572c5e6889bb3ba48977e81beea35b5ae13ece/frozenlist-1.5.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7948140d9f8ece1745be806f2bfdf390127cf1a763b925c4a805c603df5e697e", size = 51927, upload-time = "2024-10-23T09:47:00.625Z" }, - { url = "https://files.pythonhosted.org/packages/e3/12/2aad87deb08a4e7ccfb33600871bbe8f0e08cb6d8224371387f3303654d7/frozenlist-1.5.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:feeb64bc9bcc6b45c6311c9e9b99406660a9c05ca8a5b30d14a78555088b0b3a", size = 282647, upload-time = "2024-10-23T09:47:01.992Z" }, - { url = "https://files.pythonhosted.org/packages/77/f2/07f06b05d8a427ea0060a9cef6e63405ea9e0d761846b95ef3fb3be57111/frozenlist-1.5.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:683173d371daad49cffb8309779e886e59c2f369430ad28fe715f66d08d4ab1a", size = 289052, upload-time = "2024-10-23T09:47:04.039Z" }, - { url = "https://files.pythonhosted.org/packages/bd/9f/8bf45a2f1cd4aa401acd271b077989c9267ae8463e7c8b1eb0d3f561b65e/frozenlist-1.5.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7d57d8f702221405a9d9b40f9da8ac2e4a1a8b5285aac6100f3393675f0a85ee", size = 291719, upload-time = "2024-10-23T09:47:05.58Z" }, - { url = "https://files.pythonhosted.org/packages/41/d1/1f20fd05a6c42d3868709b7604c9f15538a29e4f734c694c6bcfc3d3b935/frozenlist-1.5.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:30c72000fbcc35b129cb09956836c7d7abf78ab5416595e4857d1cae8d6251a6", size = 267433, upload-time = "2024-10-23T09:47:07.807Z" }, - { url = "https://files.pythonhosted.org/packages/af/f2/64b73a9bb86f5a89fb55450e97cd5c1f84a862d4ff90d9fd1a73ab0f64a5/frozenlist-1.5.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:000a77d6034fbad9b6bb880f7ec073027908f1b40254b5d6f26210d2dab1240e", size = 283591, upload-time = "2024-10-23T09:47:09.645Z" }, - { url = "https://files.pythonhosted.org/packages/29/e2/ffbb1fae55a791fd6c2938dd9ea779509c977435ba3940b9f2e8dc9d5316/frozenlist-1.5.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:5d7f5a50342475962eb18b740f3beecc685a15b52c91f7d975257e13e029eca9", size = 273249, upload-time = "2024-10-23T09:47:10.808Z" }, - { url = "https://files.pythonhosted.org/packages/2e/6e/008136a30798bb63618a114b9321b5971172a5abddff44a100c7edc5ad4f/frozenlist-1.5.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:87f724d055eb4785d9be84e9ebf0f24e392ddfad00b3fe036e43f489fafc9039", size = 271075, upload-time = "2024-10-23T09:47:11.938Z" }, - { url = "https://files.pythonhosted.org/packages/ae/f0/4e71e54a026b06724cec9b6c54f0b13a4e9e298cc8db0f82ec70e151f5ce/frozenlist-1.5.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:6e9080bb2fb195a046e5177f10d9d82b8a204c0736a97a153c2466127de87784", size = 285398, upload-time = "2024-10-23T09:47:14.071Z" }, - { url = "https://files.pythonhosted.org/packages/4d/36/70ec246851478b1c0b59f11ef8ade9c482ff447c1363c2bd5fad45098b12/frozenlist-1.5.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:9b93d7aaa36c966fa42efcaf716e6b3900438632a626fb09c049f6a2f09fc631", size = 294445, upload-time = "2024-10-23T09:47:15.318Z" }, - { url = "https://files.pythonhosted.org/packages/37/e0/47f87544055b3349b633a03c4d94b405956cf2437f4ab46d0928b74b7526/frozenlist-1.5.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:52ef692a4bc60a6dd57f507429636c2af8b6046db8b31b18dac02cbc8f507f7f", size = 280569, upload-time = "2024-10-23T09:47:17.149Z" }, - { url = "https://files.pythonhosted.org/packages/f9/7c/490133c160fb6b84ed374c266f42800e33b50c3bbab1652764e6e1fc498a/frozenlist-1.5.0-cp312-cp312-win32.whl", hash = "sha256:29d94c256679247b33a3dc96cce0f93cbc69c23bf75ff715919332fdbb6a32b8", size = 44721, upload-time = "2024-10-23T09:47:19.012Z" }, - { url = "https://files.pythonhosted.org/packages/b1/56/4e45136ffc6bdbfa68c29ca56ef53783ef4c2fd395f7cbf99a2624aa9aaa/frozenlist-1.5.0-cp312-cp312-win_amd64.whl", hash = "sha256:8969190d709e7c48ea386db202d708eb94bdb29207a1f269bab1196ce0dcca1f", size = 51329, upload-time = "2024-10-23T09:47:20.177Z" }, - { url = "https://files.pythonhosted.org/packages/da/3b/915f0bca8a7ea04483622e84a9bd90033bab54bdf485479556c74fd5eaf5/frozenlist-1.5.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:7a1a048f9215c90973402e26c01d1cff8a209e1f1b53f72b95c13db61b00f953", size = 91538, upload-time = "2024-10-23T09:47:21.176Z" }, - { url = "https://files.pythonhosted.org/packages/c7/d1/a7c98aad7e44afe5306a2b068434a5830f1470675f0e715abb86eb15f15b/frozenlist-1.5.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:dd47a5181ce5fcb463b5d9e17ecfdb02b678cca31280639255ce9d0e5aa67af0", size = 52849, upload-time = "2024-10-23T09:47:22.439Z" }, - { url = "https://files.pythonhosted.org/packages/3a/c8/76f23bf9ab15d5f760eb48701909645f686f9c64fbb8982674c241fbef14/frozenlist-1.5.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1431d60b36d15cda188ea222033eec8e0eab488f39a272461f2e6d9e1a8e63c2", size = 50583, upload-time = "2024-10-23T09:47:23.44Z" }, - { url = "https://files.pythonhosted.org/packages/1f/22/462a3dd093d11df623179d7754a3b3269de3b42de2808cddef50ee0f4f48/frozenlist-1.5.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6482a5851f5d72767fbd0e507e80737f9c8646ae7fd303def99bfe813f76cf7f", size = 265636, upload-time = "2024-10-23T09:47:24.82Z" }, - { url = "https://files.pythonhosted.org/packages/80/cf/e075e407fc2ae7328155a1cd7e22f932773c8073c1fc78016607d19cc3e5/frozenlist-1.5.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:44c49271a937625619e862baacbd037a7ef86dd1ee215afc298a417ff3270608", size = 270214, upload-time = "2024-10-23T09:47:26.156Z" }, - { url = "https://files.pythonhosted.org/packages/a1/58/0642d061d5de779f39c50cbb00df49682832923f3d2ebfb0fedf02d05f7f/frozenlist-1.5.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:12f78f98c2f1c2429d42e6a485f433722b0061d5c0b0139efa64f396efb5886b", size = 273905, upload-time = "2024-10-23T09:47:27.741Z" }, - { url = "https://files.pythonhosted.org/packages/ab/66/3fe0f5f8f2add5b4ab7aa4e199f767fd3b55da26e3ca4ce2cc36698e50c4/frozenlist-1.5.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ce3aa154c452d2467487765e3adc730a8c153af77ad84096bc19ce19a2400840", size = 250542, upload-time = "2024-10-23T09:47:28.938Z" }, - { url = "https://files.pythonhosted.org/packages/f6/b8/260791bde9198c87a465224e0e2bb62c4e716f5d198fc3a1dacc4895dbd1/frozenlist-1.5.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9b7dc0c4338e6b8b091e8faf0db3168a37101943e687f373dce00959583f7439", size = 267026, upload-time = "2024-10-23T09:47:30.283Z" }, - { url = "https://files.pythonhosted.org/packages/2e/a4/3d24f88c527f08f8d44ade24eaee83b2627793fa62fa07cbb7ff7a2f7d42/frozenlist-1.5.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:45e0896250900b5aa25180f9aec243e84e92ac84bd4a74d9ad4138ef3f5c97de", size = 257690, upload-time = "2024-10-23T09:47:32.388Z" }, - { url = "https://files.pythonhosted.org/packages/de/9a/d311d660420b2beeff3459b6626f2ab4fb236d07afbdac034a4371fe696e/frozenlist-1.5.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:561eb1c9579d495fddb6da8959fd2a1fca2c6d060d4113f5844b433fc02f2641", size = 253893, upload-time = "2024-10-23T09:47:34.274Z" }, - { url = "https://files.pythonhosted.org/packages/c6/23/e491aadc25b56eabd0f18c53bb19f3cdc6de30b2129ee0bc39cd387cd560/frozenlist-1.5.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:df6e2f325bfee1f49f81aaac97d2aa757c7646534a06f8f577ce184afe2f0a9e", size = 267006, upload-time = "2024-10-23T09:47:35.499Z" }, - { url = "https://files.pythonhosted.org/packages/08/c4/ab918ce636a35fb974d13d666dcbe03969592aeca6c3ab3835acff01f79c/frozenlist-1.5.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:140228863501b44b809fb39ec56b5d4071f4d0aa6d216c19cbb08b8c5a7eadb9", size = 276157, upload-time = "2024-10-23T09:47:37.522Z" }, - { url = "https://files.pythonhosted.org/packages/c0/29/3b7a0bbbbe5a34833ba26f686aabfe982924adbdcafdc294a7a129c31688/frozenlist-1.5.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:7707a25d6a77f5d27ea7dc7d1fc608aa0a478193823f88511ef5e6b8a48f9d03", size = 264642, upload-time = "2024-10-23T09:47:38.75Z" }, - { url = "https://files.pythonhosted.org/packages/ab/42/0595b3dbffc2e82d7fe658c12d5a5bafcd7516c6bf2d1d1feb5387caa9c1/frozenlist-1.5.0-cp313-cp313-win32.whl", hash = "sha256:31a9ac2b38ab9b5a8933b693db4939764ad3f299fcaa931a3e605bc3460e693c", size = 44914, upload-time = "2024-10-23T09:47:40.145Z" }, - { url = "https://files.pythonhosted.org/packages/17/c4/b7db1206a3fea44bf3b838ca61deb6f74424a8a5db1dd53ecb21da669be6/frozenlist-1.5.0-cp313-cp313-win_amd64.whl", hash = "sha256:11aabdd62b8b9c4b84081a3c246506d1cddd2dd93ff0ad53ede5defec7886b28", size = 51167, upload-time = "2024-10-23T09:47:41.812Z" }, - { url = "https://files.pythonhosted.org/packages/33/b5/00fcbe8e7e7e172829bf4addc8227d8f599a3d5def3a4e9aa2b54b3145aa/frozenlist-1.5.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:dd94994fc91a6177bfaafd7d9fd951bc8689b0a98168aa26b5f543868548d3ca", size = 95648, upload-time = "2024-10-23T09:47:43.118Z" }, - { url = "https://files.pythonhosted.org/packages/1e/69/e4a32fc4b2fa8e9cb6bcb1bad9c7eeb4b254bc34da475b23f93264fdc306/frozenlist-1.5.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2d0da8bbec082bf6bf18345b180958775363588678f64998c2b7609e34719b10", size = 54888, upload-time = "2024-10-23T09:47:44.832Z" }, - { url = "https://files.pythonhosted.org/packages/76/a3/c08322a91e73d1199901a77ce73971cffa06d3c74974270ff97aed6e152a/frozenlist-1.5.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:73f2e31ea8dd7df61a359b731716018c2be196e5bb3b74ddba107f694fbd7604", size = 52975, upload-time = "2024-10-23T09:47:46.579Z" }, - { url = "https://files.pythonhosted.org/packages/fc/60/a315321d8ada167b578ff9d2edc147274ead6129523b3a308501b6621b4f/frozenlist-1.5.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:828afae9f17e6de596825cf4228ff28fbdf6065974e5ac1410cecc22f699d2b3", size = 241912, upload-time = "2024-10-23T09:47:47.687Z" }, - { url = "https://files.pythonhosted.org/packages/bd/d0/1f0980987bca4f94f9e8bae01980b23495ffc2e5049a3da4d9b7d2762bee/frozenlist-1.5.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f1577515d35ed5649d52ab4319db757bb881ce3b2b796d7283e6634d99ace307", size = 259433, upload-time = "2024-10-23T09:47:49.339Z" }, - { url = "https://files.pythonhosted.org/packages/28/e7/d00600c072eec8f18a606e281afdf0e8606e71a4882104d0438429b02468/frozenlist-1.5.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2150cc6305a2c2ab33299453e2968611dacb970d2283a14955923062c8d00b10", size = 255576, upload-time = "2024-10-23T09:47:50.519Z" }, - { url = "https://files.pythonhosted.org/packages/82/71/993c5f45dba7be347384ddec1ebc1b4d998291884e7690c06aa6ba755211/frozenlist-1.5.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a72b7a6e3cd2725eff67cd64c8f13335ee18fc3c7befc05aed043d24c7b9ccb9", size = 233349, upload-time = "2024-10-23T09:47:53.197Z" }, - { url = "https://files.pythonhosted.org/packages/66/30/f9c006223feb2ac87f1826b57f2367b60aacc43092f562dab60d2312562e/frozenlist-1.5.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c16d2fa63e0800723139137d667e1056bee1a1cf7965153d2d104b62855e9b99", size = 243126, upload-time = "2024-10-23T09:47:54.432Z" }, - { url = "https://files.pythonhosted.org/packages/b5/34/e4219c9343f94b81068d0018cbe37948e66c68003b52bf8a05e9509d09ec/frozenlist-1.5.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:17dcc32fc7bda7ce5875435003220a457bcfa34ab7924a49a1c19f55b6ee185c", size = 241261, upload-time = "2024-10-23T09:47:56.01Z" }, - { url = "https://files.pythonhosted.org/packages/48/96/9141758f6a19f2061a51bb59b9907c92f9bda1ac7b2baaf67a6e352b280f/frozenlist-1.5.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:97160e245ea33d8609cd2b8fd997c850b56db147a304a262abc2b3be021a9171", size = 240203, upload-time = "2024-10-23T09:47:57.337Z" }, - { url = "https://files.pythonhosted.org/packages/f9/71/0ef5970e68d181571a050958e84c76a061ca52f9c6f50257d9bfdd84c7f7/frozenlist-1.5.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:f1e6540b7fa044eee0bb5111ada694cf3dc15f2b0347ca125ee9ca984d5e9e6e", size = 267539, upload-time = "2024-10-23T09:47:58.874Z" }, - { url = "https://files.pythonhosted.org/packages/ab/bd/6e7d450c5d993b413591ad9cdab6dcdfa2c6ab2cd835b2b5c1cfeb0323bf/frozenlist-1.5.0-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:91d6c171862df0a6c61479d9724f22efb6109111017c87567cfeb7b5d1449fdf", size = 268518, upload-time = "2024-10-23T09:48:00.771Z" }, - { url = "https://files.pythonhosted.org/packages/cc/3d/5a7c4dfff1ae57ca2cbbe9041521472ecd9446d49e7044a0e9bfd0200fd0/frozenlist-1.5.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:c1fac3e2ace2eb1052e9f7c7db480818371134410e1f5c55d65e8f3ac6d1407e", size = 248114, upload-time = "2024-10-23T09:48:02.625Z" }, - { url = "https://files.pythonhosted.org/packages/f7/41/2342ec4c714349793f1a1e7bd5c4aeec261e24e697fa9a5499350c3a2415/frozenlist-1.5.0-cp38-cp38-win32.whl", hash = "sha256:b97f7b575ab4a8af9b7bc1d2ef7f29d3afee2226bd03ca3875c16451ad5a7723", size = 45648, upload-time = "2024-10-23T09:48:03.895Z" }, - { url = "https://files.pythonhosted.org/packages/0c/90/85bb3547c327f5975078c1be018478d5e8d250a540c828f8f31a35d2a1bd/frozenlist-1.5.0-cp38-cp38-win_amd64.whl", hash = "sha256:374ca2dabdccad8e2a76d40b1d037f5bd16824933bf7bcea3e59c891fd4a0923", size = 51930, upload-time = "2024-10-23T09:48:05.293Z" }, - { url = "https://files.pythonhosted.org/packages/da/4d/d94ff0fb0f5313902c132817c62d19cdc5bdcd0c195d392006ef4b779fc6/frozenlist-1.5.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:9bbcdfaf4af7ce002694a4e10a0159d5a8d20056a12b05b45cea944a4953f972", size = 95319, upload-time = "2024-10-23T09:48:06.405Z" }, - { url = "https://files.pythonhosted.org/packages/8c/1b/d90e554ca2b483d31cb2296e393f72c25bdc38d64526579e95576bfda587/frozenlist-1.5.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1893f948bf6681733aaccf36c5232c231e3b5166d607c5fa77773611df6dc336", size = 54749, upload-time = "2024-10-23T09:48:07.48Z" }, - { url = "https://files.pythonhosted.org/packages/f8/66/7fdecc9ef49f8db2aa4d9da916e4ecf357d867d87aea292efc11e1b2e932/frozenlist-1.5.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2b5e23253bb709ef57a8e95e6ae48daa9ac5f265637529e4ce6b003a37b2621f", size = 52718, upload-time = "2024-10-23T09:48:08.725Z" }, - { url = "https://files.pythonhosted.org/packages/08/04/e2fddc92135276e07addbc1cf413acffa0c2d848b3e54cacf684e146df49/frozenlist-1.5.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0f253985bb515ecd89629db13cb58d702035ecd8cfbca7d7a7e29a0e6d39af5f", size = 241756, upload-time = "2024-10-23T09:48:09.843Z" }, - { url = "https://files.pythonhosted.org/packages/c6/52/be5ff200815d8a341aee5b16b6b707355e0ca3652953852238eb92b120c2/frozenlist-1.5.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:04a5c6babd5e8fb7d3c871dc8b321166b80e41b637c31a995ed844a6139942b6", size = 267718, upload-time = "2024-10-23T09:48:11.828Z" }, - { url = "https://files.pythonhosted.org/packages/88/be/4bd93a58be57a3722fc544c36debdf9dcc6758f761092e894d78f18b8f20/frozenlist-1.5.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a9fe0f1c29ba24ba6ff6abf688cb0b7cf1efab6b6aa6adc55441773c252f7411", size = 263494, upload-time = "2024-10-23T09:48:13.424Z" }, - { url = "https://files.pythonhosted.org/packages/32/ba/58348b90193caa096ce9e9befea6ae67f38dabfd3aacb47e46137a6250a8/frozenlist-1.5.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:226d72559fa19babe2ccd920273e767c96a49b9d3d38badd7c91a0fdeda8ea08", size = 232838, upload-time = "2024-10-23T09:48:14.792Z" }, - { url = "https://files.pythonhosted.org/packages/f6/33/9f152105227630246135188901373c4f322cc026565ca6215b063f4c82f4/frozenlist-1.5.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15b731db116ab3aedec558573c1a5eec78822b32292fe4f2f0345b7f697745c2", size = 242912, upload-time = "2024-10-23T09:48:16.249Z" }, - { url = "https://files.pythonhosted.org/packages/a0/10/3db38fb3ccbafadd80a1b0d6800c987b0e3fe3ef2d117c6ced0246eea17a/frozenlist-1.5.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:366d8f93e3edfe5a918c874702f78faac300209a4d5bf38352b2c1bdc07a766d", size = 244763, upload-time = "2024-10-23T09:48:17.781Z" }, - { url = "https://files.pythonhosted.org/packages/e2/cd/1df468fdce2f66a4608dffe44c40cdc35eeaa67ef7fd1d813f99a9a37842/frozenlist-1.5.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:1b96af8c582b94d381a1c1f51ffaedeb77c821c690ea5f01da3d70a487dd0a9b", size = 242841, upload-time = "2024-10-23T09:48:19.507Z" }, - { url = "https://files.pythonhosted.org/packages/ee/5f/16097a5ca0bb6b6779c02cc9379c72fe98d56115d4c54d059fb233168fb6/frozenlist-1.5.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:c03eff4a41bd4e38415cbed054bbaff4a075b093e2394b6915dca34a40d1e38b", size = 263407, upload-time = "2024-10-23T09:48:21.467Z" }, - { url = "https://files.pythonhosted.org/packages/0f/f7/58cd220ee1c2248ee65a32f5b4b93689e3fe1764d85537eee9fc392543bc/frozenlist-1.5.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:50cf5e7ee9b98f22bdecbabf3800ae78ddcc26e4a435515fc72d97903e8488e0", size = 265083, upload-time = "2024-10-23T09:48:22.725Z" }, - { url = "https://files.pythonhosted.org/packages/62/b8/49768980caabf81ac4a2d156008f7cbd0107e6b36d08a313bb31035d9201/frozenlist-1.5.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:1e76bfbc72353269c44e0bc2cfe171900fbf7f722ad74c9a7b638052afe6a00c", size = 251564, upload-time = "2024-10-23T09:48:24.272Z" }, - { url = "https://files.pythonhosted.org/packages/cb/83/619327da3b86ef957ee7a0cbf3c166a09ed1e87a3f7f1ff487d7d0284683/frozenlist-1.5.0-cp39-cp39-win32.whl", hash = "sha256:666534d15ba8f0fda3f53969117383d5dc021266b3c1a42c9ec4855e4b58b9d3", size = 45691, upload-time = "2024-10-23T09:48:26.317Z" }, - { url = "https://files.pythonhosted.org/packages/8b/28/407bc34a745151ed2322c690b6e7d83d7101472e81ed76e1ebdac0b70a78/frozenlist-1.5.0-cp39-cp39-win_amd64.whl", hash = "sha256:5c28f4b5dbef8a0d8aad0d4de24d1e9e981728628afaf4ea0792f5d0939372f0", size = 51767, upload-time = "2024-10-23T09:48:27.427Z" }, - { url = "https://files.pythonhosted.org/packages/c6/c8/a5be5b7550c10858fcf9b0ea054baccab474da77d37f1e828ce043a3a5d4/frozenlist-1.5.0-py3-none-any.whl", hash = "sha256:d994863bba198a4a518b467bb971c56e1db3f180a25c6cf7bb1949c267f748c3", size = 11901, upload-time = "2024-10-23T09:48:28.851Z" }, -] - [[package]] name = "frozenlist" version = "1.7.0" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.9'", -] sdist = { url = "https://files.pythonhosted.org/packages/79/b1/b64018016eeb087db503b038296fd782586432b9c077fc5c7839e9cb6ef6/frozenlist-1.7.0.tar.gz", hash = "sha256:2e310d81923c2437ea8670467121cc3e9b0f76d3043cc1d2331d56c7fb7a3a8f", size = 45078, upload-time = "2025-06-09T23:02:35.538Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/af/36/0da0a49409f6b47cc2d060dc8c9040b897b5902a8a4e37d9bc1deb11f680/frozenlist-1.7.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:cc4df77d638aa2ed703b878dd093725b72a824c3c546c076e8fdf276f78ee84a", size = 81304, upload-time = "2025-06-09T22:59:46.226Z" }, @@ -647,8 +365,7 @@ name = "httpx" version = "0.28.1" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "anyio", version = "4.5.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "anyio", version = "4.8.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "anyio" }, { name = "certifi" }, { name = "httpcore" }, { name = "idna" }, @@ -663,8 +380,7 @@ name = "httpx-aiohttp" version = "0.1.9" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "aiohttp", version = "3.10.11", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "aiohttp", version = "3.12.13", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "aiohttp" }, { name = "httpx" }, ] sdist = { url = "https://files.pythonhosted.org/packages/d8/f2/9a86ce9bc48cf57dabb3a3160dfed26d8bbe5a2478a51f9d1dbf89f2f1fc/httpx_aiohttp-0.1.9.tar.gz", hash = "sha256:4ee8b22e6f2e7c80cd03be29eff98bfe7d89bd77f021ce0b578ee76b73b4bfe6", size = 206023, upload-time = "2025-10-15T08:52:57.475Z" } @@ -681,30 +397,12 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/76/c6/c88e154df9c4e1a2a66ccf0005a88dfb2650c1dffb6f5ce603dfbd452ce3/idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3", size = 70442, upload-time = "2024-09-15T18:07:37.964Z" }, ] -[[package]] -name = "importlib-metadata" -version = "8.5.0" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version < '3.9'", -] -dependencies = [ - { name = "zipp", version = "3.20.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/cd/12/33e59336dca5be0c398a7482335911a33aa0e20776128f038019f1a95f1b/importlib_metadata-8.5.0.tar.gz", hash = "sha256:71522656f0abace1d072b9e5481a48f07c138e00f079c38c8f883823f9c26bd7", size = 55304, upload-time = "2024-09-11T14:56:08.937Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/a0/d9/a1e041c5e7caa9a05c925f4bdbdfb7f006d1f74996af53467bc394c97be7/importlib_metadata-8.5.0-py3-none-any.whl", hash = "sha256:45e54197d28b7a7f1559e60b95e7c567032b602131fbd588f1497f47880aa68b", size = 26514, upload-time = "2024-09-11T14:56:07.019Z" }, -] - [[package]] name = "importlib-metadata" version = "8.6.1" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.9'", -] dependencies = [ - { name = "zipp", version = "3.21.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "zipp" }, ] sdist = { url = "https://files.pythonhosted.org/packages/33/08/c1395a292bb23fd03bdf572a1357c5a733d3eecbab877641ceacab23db6e/importlib_metadata-8.6.1.tar.gz", hash = "sha256:310b41d755445d74569f993ccfc22838295d9fe005425094fad953d7f15c8580", size = 55767, upload-time = "2025-01-20T22:21:30.429Z" } wheels = [ @@ -741,120 +439,12 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" }, ] -[[package]] -name = "multidict" -version = "6.1.0" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version < '3.9'", -] -dependencies = [ - { name = "typing-extensions", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/d6/be/504b89a5e9ca731cd47487e91c469064f8ae5af93b7259758dcfc2b9c848/multidict-6.1.0.tar.gz", hash = "sha256:22ae2ebf9b0c69d206c003e2f6a914ea33f0a932d4aa16f236afc049d9958f4a", size = 64002, upload-time = "2024-09-09T23:49:38.163Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/29/68/259dee7fd14cf56a17c554125e534f6274c2860159692a414d0b402b9a6d/multidict-6.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:3380252550e372e8511d49481bd836264c009adb826b23fefcc5dd3c69692f60", size = 48628, upload-time = "2024-09-09T23:47:18.278Z" }, - { url = "https://files.pythonhosted.org/packages/50/79/53ba256069fe5386a4a9e80d4e12857ced9de295baf3e20c68cdda746e04/multidict-6.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:99f826cbf970077383d7de805c0681799491cb939c25450b9b5b3ced03ca99f1", size = 29327, upload-time = "2024-09-09T23:47:20.224Z" }, - { url = "https://files.pythonhosted.org/packages/ff/10/71f1379b05b196dae749b5ac062e87273e3f11634f447ebac12a571d90ae/multidict-6.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a114d03b938376557927ab23f1e950827c3b893ccb94b62fd95d430fd0e5cf53", size = 29689, upload-time = "2024-09-09T23:47:21.667Z" }, - { url = "https://files.pythonhosted.org/packages/71/45/70bac4f87438ded36ad4793793c0095de6572d433d98575a5752629ef549/multidict-6.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b1c416351ee6271b2f49b56ad7f308072f6f44b37118d69c2cad94f3fa8a40d5", size = 126639, upload-time = "2024-09-09T23:47:23.333Z" }, - { url = "https://files.pythonhosted.org/packages/80/cf/17f35b3b9509b4959303c05379c4bfb0d7dd05c3306039fc79cf035bbac0/multidict-6.1.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6b5d83030255983181005e6cfbac1617ce9746b219bc2aad52201ad121226581", size = 134315, upload-time = "2024-09-09T23:47:24.99Z" }, - { url = "https://files.pythonhosted.org/packages/ef/1f/652d70ab5effb33c031510a3503d4d6efc5ec93153562f1ee0acdc895a57/multidict-6.1.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3e97b5e938051226dc025ec80980c285b053ffb1e25a3db2a3aa3bc046bf7f56", size = 129471, upload-time = "2024-09-09T23:47:26.305Z" }, - { url = "https://files.pythonhosted.org/packages/a6/64/2dd6c4c681688c0165dea3975a6a4eab4944ea30f35000f8b8af1df3148c/multidict-6.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d618649d4e70ac6efcbba75be98b26ef5078faad23592f9b51ca492953012429", size = 124585, upload-time = "2024-09-09T23:47:27.958Z" }, - { url = "https://files.pythonhosted.org/packages/87/56/e6ee5459894c7e554b57ba88f7257dc3c3d2d379cb15baaa1e265b8c6165/multidict-6.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:10524ebd769727ac77ef2278390fb0068d83f3acb7773792a5080f2b0abf7748", size = 116957, upload-time = "2024-09-09T23:47:29.376Z" }, - { url = "https://files.pythonhosted.org/packages/36/9e/616ce5e8d375c24b84f14fc263c7ef1d8d5e8ef529dbc0f1df8ce71bb5b8/multidict-6.1.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:ff3827aef427c89a25cc96ded1759271a93603aba9fb977a6d264648ebf989db", size = 128609, upload-time = "2024-09-09T23:47:31.038Z" }, - { url = "https://files.pythonhosted.org/packages/8c/4f/4783e48a38495d000f2124020dc96bacc806a4340345211b1ab6175a6cb4/multidict-6.1.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:06809f4f0f7ab7ea2cabf9caca7d79c22c0758b58a71f9d32943ae13c7ace056", size = 123016, upload-time = "2024-09-09T23:47:32.47Z" }, - { url = "https://files.pythonhosted.org/packages/3e/b3/4950551ab8fc39862ba5e9907dc821f896aa829b4524b4deefd3e12945ab/multidict-6.1.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:f179dee3b863ab1c59580ff60f9d99f632f34ccb38bf67a33ec6b3ecadd0fd76", size = 133542, upload-time = "2024-09-09T23:47:34.103Z" }, - { url = "https://files.pythonhosted.org/packages/96/4d/f0ce6ac9914168a2a71df117935bb1f1781916acdecbb43285e225b484b8/multidict-6.1.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:aaed8b0562be4a0876ee3b6946f6869b7bcdb571a5d1496683505944e268b160", size = 130163, upload-time = "2024-09-09T23:47:35.716Z" }, - { url = "https://files.pythonhosted.org/packages/be/72/17c9f67e7542a49dd252c5ae50248607dfb780bcc03035907dafefb067e3/multidict-6.1.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:3c8b88a2ccf5493b6c8da9076fb151ba106960a2df90c2633f342f120751a9e7", size = 126832, upload-time = "2024-09-09T23:47:37.116Z" }, - { url = "https://files.pythonhosted.org/packages/71/9f/72d719e248cbd755c8736c6d14780533a1606ffb3fbb0fbd77da9f0372da/multidict-6.1.0-cp310-cp310-win32.whl", hash = "sha256:4a9cb68166a34117d6646c0023c7b759bf197bee5ad4272f420a0141d7eb03a0", size = 26402, upload-time = "2024-09-09T23:47:38.863Z" }, - { url = "https://files.pythonhosted.org/packages/04/5a/d88cd5d00a184e1ddffc82aa2e6e915164a6d2641ed3606e766b5d2f275a/multidict-6.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:20b9b5fbe0b88d0bdef2012ef7dee867f874b72528cf1d08f1d59b0e3850129d", size = 28800, upload-time = "2024-09-09T23:47:40.056Z" }, - { url = "https://files.pythonhosted.org/packages/93/13/df3505a46d0cd08428e4c8169a196131d1b0c4b515c3649829258843dde6/multidict-6.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:3efe2c2cb5763f2f1b275ad2bf7a287d3f7ebbef35648a9726e3b69284a4f3d6", size = 48570, upload-time = "2024-09-09T23:47:41.36Z" }, - { url = "https://files.pythonhosted.org/packages/f0/e1/a215908bfae1343cdb72f805366592bdd60487b4232d039c437fe8f5013d/multidict-6.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c7053d3b0353a8b9de430a4f4b4268ac9a4fb3481af37dfe49825bf45ca24156", size = 29316, upload-time = "2024-09-09T23:47:42.612Z" }, - { url = "https://files.pythonhosted.org/packages/70/0f/6dc70ddf5d442702ed74f298d69977f904960b82368532c88e854b79f72b/multidict-6.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:27e5fc84ccef8dfaabb09d82b7d179c7cf1a3fbc8a966f8274fcb4ab2eb4cadb", size = 29640, upload-time = "2024-09-09T23:47:44.028Z" }, - { url = "https://files.pythonhosted.org/packages/d8/6d/9c87b73a13d1cdea30b321ef4b3824449866bd7f7127eceed066ccb9b9ff/multidict-6.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0e2b90b43e696f25c62656389d32236e049568b39320e2735d51f08fd362761b", size = 131067, upload-time = "2024-09-09T23:47:45.617Z" }, - { url = "https://files.pythonhosted.org/packages/cc/1e/1b34154fef373371fd6c65125b3d42ff5f56c7ccc6bfff91b9b3c60ae9e0/multidict-6.1.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d83a047959d38a7ff552ff94be767b7fd79b831ad1cd9920662db05fec24fe72", size = 138507, upload-time = "2024-09-09T23:47:47.429Z" }, - { url = "https://files.pythonhosted.org/packages/fb/e0/0bc6b2bac6e461822b5f575eae85da6aae76d0e2a79b6665d6206b8e2e48/multidict-6.1.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d1a9dd711d0877a1ece3d2e4fea11a8e75741ca21954c919406b44e7cf971304", size = 133905, upload-time = "2024-09-09T23:47:48.878Z" }, - { url = "https://files.pythonhosted.org/packages/ba/af/73d13b918071ff9b2205fcf773d316e0f8fefb4ec65354bbcf0b10908cc6/multidict-6.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec2abea24d98246b94913b76a125e855eb5c434f7c46546046372fe60f666351", size = 129004, upload-time = "2024-09-09T23:47:50.124Z" }, - { url = "https://files.pythonhosted.org/packages/74/21/23960627b00ed39643302d81bcda44c9444ebcdc04ee5bedd0757513f259/multidict-6.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4867cafcbc6585e4b678876c489b9273b13e9fff9f6d6d66add5e15d11d926cb", size = 121308, upload-time = "2024-09-09T23:47:51.97Z" }, - { url = "https://files.pythonhosted.org/packages/8b/5c/cf282263ffce4a596ed0bb2aa1a1dddfe1996d6a62d08842a8d4b33dca13/multidict-6.1.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:5b48204e8d955c47c55b72779802b219a39acc3ee3d0116d5080c388970b76e3", size = 132608, upload-time = "2024-09-09T23:47:53.201Z" }, - { url = "https://files.pythonhosted.org/packages/d7/3e/97e778c041c72063f42b290888daff008d3ab1427f5b09b714f5a8eff294/multidict-6.1.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:d8fff389528cad1618fb4b26b95550327495462cd745d879a8c7c2115248e399", size = 127029, upload-time = "2024-09-09T23:47:54.435Z" }, - { url = "https://files.pythonhosted.org/packages/47/ac/3efb7bfe2f3aefcf8d103e9a7162572f01936155ab2f7ebcc7c255a23212/multidict-6.1.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:a7a9541cd308eed5e30318430a9c74d2132e9a8cb46b901326272d780bf2d423", size = 137594, upload-time = "2024-09-09T23:47:55.659Z" }, - { url = "https://files.pythonhosted.org/packages/42/9b/6c6e9e8dc4f915fc90a9b7798c44a30773dea2995fdcb619870e705afe2b/multidict-6.1.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:da1758c76f50c39a2efd5e9859ce7d776317eb1dd34317c8152ac9251fc574a3", size = 134556, upload-time = "2024-09-09T23:47:56.98Z" }, - { url = "https://files.pythonhosted.org/packages/1d/10/8e881743b26aaf718379a14ac58572a240e8293a1c9d68e1418fb11c0f90/multidict-6.1.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:c943a53e9186688b45b323602298ab727d8865d8c9ee0b17f8d62d14b56f0753", size = 130993, upload-time = "2024-09-09T23:47:58.163Z" }, - { url = "https://files.pythonhosted.org/packages/45/84/3eb91b4b557442802d058a7579e864b329968c8d0ea57d907e7023c677f2/multidict-6.1.0-cp311-cp311-win32.whl", hash = "sha256:90f8717cb649eea3504091e640a1b8568faad18bd4b9fcd692853a04475a4b80", size = 26405, upload-time = "2024-09-09T23:47:59.391Z" }, - { url = "https://files.pythonhosted.org/packages/9f/0b/ad879847ecbf6d27e90a6eabb7eff6b62c129eefe617ea45eae7c1f0aead/multidict-6.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:82176036e65644a6cc5bd619f65f6f19781e8ec2e5330f51aa9ada7504cc1926", size = 28795, upload-time = "2024-09-09T23:48:00.359Z" }, - { url = "https://files.pythonhosted.org/packages/fd/16/92057c74ba3b96d5e211b553895cd6dc7cc4d1e43d9ab8fafc727681ef71/multidict-6.1.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:b04772ed465fa3cc947db808fa306d79b43e896beb677a56fb2347ca1a49c1fa", size = 48713, upload-time = "2024-09-09T23:48:01.893Z" }, - { url = "https://files.pythonhosted.org/packages/94/3d/37d1b8893ae79716179540b89fc6a0ee56b4a65fcc0d63535c6f5d96f217/multidict-6.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:6180c0ae073bddeb5a97a38c03f30c233e0a4d39cd86166251617d1bbd0af436", size = 29516, upload-time = "2024-09-09T23:48:03.463Z" }, - { url = "https://files.pythonhosted.org/packages/a2/12/adb6b3200c363062f805275b4c1e656be2b3681aada66c80129932ff0bae/multidict-6.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:071120490b47aa997cca00666923a83f02c7fbb44f71cf7f136df753f7fa8761", size = 29557, upload-time = "2024-09-09T23:48:04.905Z" }, - { url = "https://files.pythonhosted.org/packages/47/e9/604bb05e6e5bce1e6a5cf80a474e0f072e80d8ac105f1b994a53e0b28c42/multidict-6.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:50b3a2710631848991d0bf7de077502e8994c804bb805aeb2925a981de58ec2e", size = 130170, upload-time = "2024-09-09T23:48:06.862Z" }, - { url = "https://files.pythonhosted.org/packages/7e/13/9efa50801785eccbf7086b3c83b71a4fb501a4d43549c2f2f80b8787d69f/multidict-6.1.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b58c621844d55e71c1b7f7c498ce5aa6985d743a1a59034c57a905b3f153c1ef", size = 134836, upload-time = "2024-09-09T23:48:08.537Z" }, - { url = "https://files.pythonhosted.org/packages/bf/0f/93808b765192780d117814a6dfcc2e75de6dcc610009ad408b8814dca3ba/multidict-6.1.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:55b6d90641869892caa9ca42ff913f7ff1c5ece06474fbd32fb2cf6834726c95", size = 133475, upload-time = "2024-09-09T23:48:09.865Z" }, - { url = "https://files.pythonhosted.org/packages/d3/c8/529101d7176fe7dfe1d99604e48d69c5dfdcadb4f06561f465c8ef12b4df/multidict-6.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4b820514bfc0b98a30e3d85462084779900347e4d49267f747ff54060cc33925", size = 131049, upload-time = "2024-09-09T23:48:11.115Z" }, - { url = "https://files.pythonhosted.org/packages/ca/0c/fc85b439014d5a58063e19c3a158a889deec399d47b5269a0f3b6a2e28bc/multidict-6.1.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:10a9b09aba0c5b48c53761b7c720aaaf7cf236d5fe394cd399c7ba662d5f9966", size = 120370, upload-time = "2024-09-09T23:48:12.78Z" }, - { url = "https://files.pythonhosted.org/packages/db/46/d4416eb20176492d2258fbd47b4abe729ff3b6e9c829ea4236f93c865089/multidict-6.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1e16bf3e5fc9f44632affb159d30a437bfe286ce9e02754759be5536b169b305", size = 125178, upload-time = "2024-09-09T23:48:14.295Z" }, - { url = "https://files.pythonhosted.org/packages/5b/46/73697ad7ec521df7de5531a32780bbfd908ded0643cbe457f981a701457c/multidict-6.1.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:76f364861c3bfc98cbbcbd402d83454ed9e01a5224bb3a28bf70002a230f73e2", size = 119567, upload-time = "2024-09-09T23:48:16.284Z" }, - { url = "https://files.pythonhosted.org/packages/cd/ed/51f060e2cb0e7635329fa6ff930aa5cffa17f4c7f5c6c3ddc3500708e2f2/multidict-6.1.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:820c661588bd01a0aa62a1283f20d2be4281b086f80dad9e955e690c75fb54a2", size = 129822, upload-time = "2024-09-09T23:48:17.835Z" }, - { url = "https://files.pythonhosted.org/packages/df/9e/ee7d1954b1331da3eddea0c4e08d9142da5f14b1321c7301f5014f49d492/multidict-6.1.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:0e5f362e895bc5b9e67fe6e4ded2492d8124bdf817827f33c5b46c2fe3ffaca6", size = 128656, upload-time = "2024-09-09T23:48:19.576Z" }, - { url = "https://files.pythonhosted.org/packages/77/00/8538f11e3356b5d95fa4b024aa566cde7a38aa7a5f08f4912b32a037c5dc/multidict-6.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:3ec660d19bbc671e3a6443325f07263be452c453ac9e512f5eb935e7d4ac28b3", size = 125360, upload-time = "2024-09-09T23:48:20.957Z" }, - { url = "https://files.pythonhosted.org/packages/be/05/5d334c1f2462d43fec2363cd00b1c44c93a78c3925d952e9a71caf662e96/multidict-6.1.0-cp312-cp312-win32.whl", hash = "sha256:58130ecf8f7b8112cdb841486404f1282b9c86ccb30d3519faf301b2e5659133", size = 26382, upload-time = "2024-09-09T23:48:22.351Z" }, - { url = "https://files.pythonhosted.org/packages/a3/bf/f332a13486b1ed0496d624bcc7e8357bb8053823e8cd4b9a18edc1d97e73/multidict-6.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:188215fc0aafb8e03341995e7c4797860181562380f81ed0a87ff455b70bf1f1", size = 28529, upload-time = "2024-09-09T23:48:23.478Z" }, - { url = "https://files.pythonhosted.org/packages/22/67/1c7c0f39fe069aa4e5d794f323be24bf4d33d62d2a348acdb7991f8f30db/multidict-6.1.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:d569388c381b24671589335a3be6e1d45546c2988c2ebe30fdcada8457a31008", size = 48771, upload-time = "2024-09-09T23:48:24.594Z" }, - { url = "https://files.pythonhosted.org/packages/3c/25/c186ee7b212bdf0df2519eacfb1981a017bda34392c67542c274651daf23/multidict-6.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:052e10d2d37810b99cc170b785945421141bf7bb7d2f8799d431e7db229c385f", size = 29533, upload-time = "2024-09-09T23:48:26.187Z" }, - { url = "https://files.pythonhosted.org/packages/67/5e/04575fd837e0958e324ca035b339cea174554f6f641d3fb2b4f2e7ff44a2/multidict-6.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f90c822a402cb865e396a504f9fc8173ef34212a342d92e362ca498cad308e28", size = 29595, upload-time = "2024-09-09T23:48:27.305Z" }, - { url = "https://files.pythonhosted.org/packages/d3/b2/e56388f86663810c07cfe4a3c3d87227f3811eeb2d08450b9e5d19d78876/multidict-6.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b225d95519a5bf73860323e633a664b0d85ad3d5bede6d30d95b35d4dfe8805b", size = 130094, upload-time = "2024-09-09T23:48:28.544Z" }, - { url = "https://files.pythonhosted.org/packages/6c/ee/30ae9b4186a644d284543d55d491fbd4239b015d36b23fea43b4c94f7052/multidict-6.1.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:23bfd518810af7de1116313ebd9092cb9aa629beb12f6ed631ad53356ed6b86c", size = 134876, upload-time = "2024-09-09T23:48:30.098Z" }, - { url = "https://files.pythonhosted.org/packages/84/c7/70461c13ba8ce3c779503c70ec9d0345ae84de04521c1f45a04d5f48943d/multidict-6.1.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5c09fcfdccdd0b57867577b719c69e347a436b86cd83747f179dbf0cc0d4c1f3", size = 133500, upload-time = "2024-09-09T23:48:31.793Z" }, - { url = "https://files.pythonhosted.org/packages/4a/9f/002af221253f10f99959561123fae676148dd730e2daa2cd053846a58507/multidict-6.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bf6bea52ec97e95560af5ae576bdac3aa3aae0b6758c6efa115236d9e07dae44", size = 131099, upload-time = "2024-09-09T23:48:33.193Z" }, - { url = "https://files.pythonhosted.org/packages/82/42/d1c7a7301d52af79d88548a97e297f9d99c961ad76bbe6f67442bb77f097/multidict-6.1.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:57feec87371dbb3520da6192213c7d6fc892d5589a93db548331954de8248fd2", size = 120403, upload-time = "2024-09-09T23:48:34.942Z" }, - { url = "https://files.pythonhosted.org/packages/68/f3/471985c2c7ac707547553e8f37cff5158030d36bdec4414cb825fbaa5327/multidict-6.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0c3f390dc53279cbc8ba976e5f8035eab997829066756d811616b652b00a23a3", size = 125348, upload-time = "2024-09-09T23:48:36.222Z" }, - { url = "https://files.pythonhosted.org/packages/67/2c/e6df05c77e0e433c214ec1d21ddd203d9a4770a1f2866a8ca40a545869a0/multidict-6.1.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:59bfeae4b25ec05b34f1956eaa1cb38032282cd4dfabc5056d0a1ec4d696d3aa", size = 119673, upload-time = "2024-09-09T23:48:37.588Z" }, - { url = "https://files.pythonhosted.org/packages/c5/cd/bc8608fff06239c9fb333f9db7743a1b2eafe98c2666c9a196e867a3a0a4/multidict-6.1.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:b2f59caeaf7632cc633b5cf6fc449372b83bbdf0da4ae04d5be36118e46cc0aa", size = 129927, upload-time = "2024-09-09T23:48:39.128Z" }, - { url = "https://files.pythonhosted.org/packages/44/8e/281b69b7bc84fc963a44dc6e0bbcc7150e517b91df368a27834299a526ac/multidict-6.1.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:37bb93b2178e02b7b618893990941900fd25b6b9ac0fa49931a40aecdf083fe4", size = 128711, upload-time = "2024-09-09T23:48:40.55Z" }, - { url = "https://files.pythonhosted.org/packages/12/a4/63e7cd38ed29dd9f1881d5119f272c898ca92536cdb53ffe0843197f6c85/multidict-6.1.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4e9f48f58c2c523d5a06faea47866cd35b32655c46b443f163d08c6d0ddb17d6", size = 125519, upload-time = "2024-09-09T23:48:42.446Z" }, - { url = "https://files.pythonhosted.org/packages/38/e0/4f5855037a72cd8a7a2f60a3952d9aa45feedb37ae7831642102604e8a37/multidict-6.1.0-cp313-cp313-win32.whl", hash = "sha256:3a37ffb35399029b45c6cc33640a92bef403c9fd388acce75cdc88f58bd19a81", size = 26426, upload-time = "2024-09-09T23:48:43.936Z" }, - { url = "https://files.pythonhosted.org/packages/7e/a5/17ee3a4db1e310b7405f5d25834460073a8ccd86198ce044dfaf69eac073/multidict-6.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:e9aa71e15d9d9beaad2c6b9319edcdc0a49a43ef5c0a4c8265ca9ee7d6c67774", size = 28531, upload-time = "2024-09-09T23:48:45.122Z" }, - { url = "https://files.pythonhosted.org/packages/3e/6a/af41f3aaf5f00fd86cc7d470a2f5b25299b0c84691163b8757f4a1a205f2/multidict-6.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:db7457bac39421addd0c8449933ac32d8042aae84a14911a757ae6ca3eef1392", size = 48597, upload-time = "2024-09-09T23:48:46.391Z" }, - { url = "https://files.pythonhosted.org/packages/d9/d6/3d4082760ed11b05734f8bf32a0615b99e7d9d2b3730ad698a4d7377c00a/multidict-6.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d094ddec350a2fb899fec68d8353c78233debde9b7d8b4beeafa70825f1c281a", size = 29338, upload-time = "2024-09-09T23:48:47.891Z" }, - { url = "https://files.pythonhosted.org/packages/9d/7f/5d1ce7f47d44393d429922910afbe88fcd29ee3069babbb47507a4c3a7ea/multidict-6.1.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:5845c1fd4866bb5dd3125d89b90e57ed3138241540897de748cdf19de8a2fca2", size = 29562, upload-time = "2024-09-09T23:48:49.254Z" }, - { url = "https://files.pythonhosted.org/packages/ce/ec/c425257671af9308a9b626e2e21f7f43841616e4551de94eb3c92aca75b2/multidict-6.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9079dfc6a70abe341f521f78405b8949f96db48da98aeb43f9907f342f627cdc", size = 130980, upload-time = "2024-09-09T23:48:50.606Z" }, - { url = "https://files.pythonhosted.org/packages/d8/d7/d4220ad2633a89b314593e9b85b5bc9287a7c563c7f9108a4a68d9da5374/multidict-6.1.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3914f5aaa0f36d5d60e8ece6a308ee1c9784cd75ec8151062614657a114c4478", size = 136694, upload-time = "2024-09-09T23:48:52.042Z" }, - { url = "https://files.pythonhosted.org/packages/a1/2a/13e554db5830c8d40185a2e22aa8325516a5de9634c3fb2caf3886a829b3/multidict-6.1.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c08be4f460903e5a9d0f76818db3250f12e9c344e79314d1d570fc69d7f4eae4", size = 131616, upload-time = "2024-09-09T23:48:54.283Z" }, - { url = "https://files.pythonhosted.org/packages/2e/a9/83692e37d8152f104333132105b67100aabfb2e96a87f6bed67f566035a7/multidict-6.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d093be959277cb7dee84b801eb1af388b6ad3ca6a6b6bf1ed7585895789d027d", size = 129664, upload-time = "2024-09-09T23:48:55.785Z" }, - { url = "https://files.pythonhosted.org/packages/cc/1c/1718cd518fb9da7e8890d9d1611c1af0ea5e60f68ff415d026e38401ed36/multidict-6.1.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3702ea6872c5a2a4eeefa6ffd36b042e9773f05b1f37ae3ef7264b1163c2dcf6", size = 121855, upload-time = "2024-09-09T23:48:57.333Z" }, - { url = "https://files.pythonhosted.org/packages/2b/92/f6ed67514b0e3894198f0eb42dcde22f0851ea35f4561a1e4acf36c7b1be/multidict-6.1.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:2090f6a85cafc5b2db085124d752757c9d251548cedabe9bd31afe6363e0aff2", size = 127928, upload-time = "2024-09-09T23:48:58.778Z" }, - { url = "https://files.pythonhosted.org/packages/f7/30/c66954115a4dc4dc3c84e02c8ae11bb35a43d79ef93122c3c3a40c4d459b/multidict-6.1.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:f67f217af4b1ff66c68a87318012de788dd95fcfeb24cc889011f4e1c7454dfd", size = 122793, upload-time = "2024-09-09T23:49:00.244Z" }, - { url = "https://files.pythonhosted.org/packages/62/c9/d386d01b43871e8e1631eb7b3695f6af071b7ae1ab716caf371100f0eb24/multidict-6.1.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:189f652a87e876098bbc67b4da1049afb5f5dfbaa310dd67c594b01c10388db6", size = 132762, upload-time = "2024-09-09T23:49:02.188Z" }, - { url = "https://files.pythonhosted.org/packages/69/ff/f70cb0a2f7a358acf48e32139ce3a150ff18c961ee9c714cc8c0dc7e3584/multidict-6.1.0-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:6bb5992037f7a9eff7991ebe4273ea7f51f1c1c511e6a2ce511d0e7bdb754492", size = 127872, upload-time = "2024-09-09T23:49:04.389Z" }, - { url = "https://files.pythonhosted.org/packages/89/5b/abea7db3ba4cd07752a9b560f9275a11787cd13f86849b5d99c1ceea921d/multidict-6.1.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:ac10f4c2b9e770c4e393876e35a7046879d195cd123b4f116d299d442b335bcd", size = 126161, upload-time = "2024-09-09T23:49:06.306Z" }, - { url = "https://files.pythonhosted.org/packages/22/03/acc77a4667cca4462ee974fc39990803e58fa573d5a923d6e82b7ef6da7e/multidict-6.1.0-cp38-cp38-win32.whl", hash = "sha256:e27bbb6d14416713a8bd7aaa1313c0fc8d44ee48d74497a0ff4c3a1b6ccb5167", size = 26338, upload-time = "2024-09-09T23:49:07.782Z" }, - { url = "https://files.pythonhosted.org/packages/90/bf/3d0c1cc9c8163abc24625fae89c0ade1ede9bccb6eceb79edf8cff3cca46/multidict-6.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:22f3105d4fb15c8f57ff3959a58fcab6ce36814486500cd7485651230ad4d4ef", size = 28736, upload-time = "2024-09-09T23:49:09.126Z" }, - { url = "https://files.pythonhosted.org/packages/e7/c9/9e153a6572b38ac5ff4434113af38acf8d5e9957897cdb1f513b3d6614ed/multidict-6.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:4e18b656c5e844539d506a0a06432274d7bd52a7487e6828c63a63d69185626c", size = 48550, upload-time = "2024-09-09T23:49:10.475Z" }, - { url = "https://files.pythonhosted.org/packages/76/f5/79565ddb629eba6c7f704f09a09df085c8dc04643b12506f10f718cee37a/multidict-6.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:a185f876e69897a6f3325c3f19f26a297fa058c5e456bfcff8015e9a27e83ae1", size = 29298, upload-time = "2024-09-09T23:49:12.119Z" }, - { url = "https://files.pythonhosted.org/packages/60/1b/9851878b704bc98e641a3e0bce49382ae9e05743dac6d97748feb5b7baba/multidict-6.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ab7c4ceb38d91570a650dba194e1ca87c2b543488fe9309b4212694174fd539c", size = 29641, upload-time = "2024-09-09T23:49:13.714Z" }, - { url = "https://files.pythonhosted.org/packages/89/87/d451d45aab9e422cb0fb2f7720c31a4c1d3012c740483c37f642eba568fb/multidict-6.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e617fb6b0b6953fffd762669610c1c4ffd05632c138d61ac7e14ad187870669c", size = 126202, upload-time = "2024-09-09T23:49:15.238Z" }, - { url = "https://files.pythonhosted.org/packages/fa/b4/27cbe9f3e2e469359887653f2e45470272eef7295139916cc21107c6b48c/multidict-6.1.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:16e5f4bf4e603eb1fdd5d8180f1a25f30056f22e55ce51fb3d6ad4ab29f7d96f", size = 133925, upload-time = "2024-09-09T23:49:16.786Z" }, - { url = "https://files.pythonhosted.org/packages/4d/a3/afc841899face8adfd004235ce759a37619f6ec99eafd959650c5ce4df57/multidict-6.1.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f4c035da3f544b1882bac24115f3e2e8760f10a0107614fc9839fd232200b875", size = 129039, upload-time = "2024-09-09T23:49:18.381Z" }, - { url = "https://files.pythonhosted.org/packages/5e/41/0d0fb18c1ad574f807196f5f3d99164edf9de3e169a58c6dc2d6ed5742b9/multidict-6.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:957cf8e4b6e123a9eea554fa7ebc85674674b713551de587eb318a2df3e00255", size = 124072, upload-time = "2024-09-09T23:49:20.115Z" }, - { url = "https://files.pythonhosted.org/packages/00/22/defd7a2e71a44e6e5b9a5428f972e5b572e7fe28e404dfa6519bbf057c93/multidict-6.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:483a6aea59cb89904e1ceabd2b47368b5600fb7de78a6e4a2c2987b2d256cf30", size = 116532, upload-time = "2024-09-09T23:49:21.685Z" }, - { url = "https://files.pythonhosted.org/packages/91/25/f7545102def0b1d456ab6449388eed2dfd822debba1d65af60194904a23a/multidict-6.1.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:87701f25a2352e5bf7454caa64757642734da9f6b11384c1f9d1a8e699758057", size = 128173, upload-time = "2024-09-09T23:49:23.657Z" }, - { url = "https://files.pythonhosted.org/packages/45/79/3dbe8d35fc99f5ea610813a72ab55f426cb9cf482f860fa8496e5409be11/multidict-6.1.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:682b987361e5fd7a139ed565e30d81fd81e9629acc7d925a205366877d8c8657", size = 122654, upload-time = "2024-09-09T23:49:25.7Z" }, - { url = "https://files.pythonhosted.org/packages/97/cb/209e735eeab96e1b160825b5d0b36c56d3862abff828fc43999bb957dcad/multidict-6.1.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:ce2186a7df133a9c895dea3331ddc5ddad42cdd0d1ea2f0a51e5d161e4762f28", size = 133197, upload-time = "2024-09-09T23:49:27.906Z" }, - { url = "https://files.pythonhosted.org/packages/e4/3a/a13808a7ada62808afccea67837a79d00ad6581440015ef00f726d064c2d/multidict-6.1.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:9f636b730f7e8cb19feb87094949ba54ee5357440b9658b2a32a5ce4bce53972", size = 129754, upload-time = "2024-09-09T23:49:29.508Z" }, - { url = "https://files.pythonhosted.org/packages/77/dd/8540e139eafb240079242da8f8ffdf9d3f4b4ad1aac5a786cd4050923783/multidict-6.1.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:73eae06aa53af2ea5270cc066dcaf02cc60d2994bbb2c4ef5764949257d10f43", size = 126402, upload-time = "2024-09-09T23:49:31.243Z" }, - { url = "https://files.pythonhosted.org/packages/86/99/e82e1a275d8b1ea16d3a251474262258dbbe41c05cce0c01bceda1fc8ea5/multidict-6.1.0-cp39-cp39-win32.whl", hash = "sha256:1ca0083e80e791cffc6efce7660ad24af66c8d4079d2a750b29001b53ff59ada", size = 26421, upload-time = "2024-09-09T23:49:32.648Z" }, - { url = "https://files.pythonhosted.org/packages/86/1c/9fa630272355af7e4446a2c7550c259f11ee422ab2d30ff90a0a71cf3d9e/multidict-6.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:aa466da5b15ccea564bdab9c89175c762bc12825f4659c11227f515cee76fa4a", size = 28791, upload-time = "2024-09-09T23:49:34.725Z" }, - { url = "https://files.pythonhosted.org/packages/99/b7/b9e70fde2c0f0c9af4cc5277782a89b66d35948ea3369ec9f598358c3ac5/multidict-6.1.0-py3-none-any.whl", hash = "sha256:48e171e52d1c4d33888e529b999e5900356b9ae588c2f09a52dcefb158b27506", size = 10051, upload-time = "2024-09-09T23:49:36.506Z" }, -] - [[package]] name = "multidict" version = "6.6.3" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.9'", -] dependencies = [ - { name = "typing-extensions", marker = "(python_full_version >= '3.9' and python_full_version < '3.11') or (python_full_version < '3.9' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2') or (python_full_version >= '3.11' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "typing-extensions", marker = "python_full_version < '3.11' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, ] sdist = { url = "https://files.pythonhosted.org/packages/3d/2c/5dad12e82fbdf7470f29bff2171484bf07cb3b16ada60a6589af8f376440/multidict-6.6.3.tar.gz", hash = "sha256:798a9eb12dab0a6c2e29c1de6f3468af5cb2da6053a20dfa3344907eed0937cc", size = 101006, upload-time = "2025-06-30T15:53:46.929Z" } wheels = [ @@ -1004,12 +594,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/56/9d/4a236b9c57f5d8f08ed346914b3f091a62dd7e19336b2b2a0d85485f82ff/mypy-1.14.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d4b19b03fdf54f3c5b2fa474c56b4c13c9dbfb9a2db4370ede7ec11a2c5927d9", size = 12867660, upload-time = "2024-12-30T16:38:17.342Z" }, { url = "https://files.pythonhosted.org/packages/40/88/a61a5497e2f68d9027de2bb139c7bb9abaeb1be1584649fa9d807f80a338/mypy-1.14.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:0c911fde686394753fff899c409fd4e16e9b294c24bfd5e1ea4675deae1ac6fd", size = 12969198, upload-time = "2024-12-30T16:38:32.839Z" }, { url = "https://files.pythonhosted.org/packages/54/da/3d6fc5d92d324701b0c23fb413c853892bfe0e1dbe06c9138037d459756b/mypy-1.14.1-cp313-cp313-win_amd64.whl", hash = "sha256:8b21525cb51671219f5307be85f7e646a153e5acc656e5cebf64bfa076c50107", size = 9885276, upload-time = "2024-12-30T16:38:20.828Z" }, - { url = "https://files.pythonhosted.org/packages/39/02/1817328c1372be57c16148ce7d2bfcfa4a796bedaed897381b1aad9b267c/mypy-1.14.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:7084fb8f1128c76cd9cf68fe5971b37072598e7c31b2f9f95586b65c741a9d31", size = 11143050, upload-time = "2024-12-30T16:38:29.743Z" }, - { url = "https://files.pythonhosted.org/packages/b9/07/99db9a95ece5e58eee1dd87ca456a7e7b5ced6798fd78182c59c35a7587b/mypy-1.14.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:8f845a00b4f420f693f870eaee5f3e2692fa84cc8514496114649cfa8fd5e2c6", size = 10321087, upload-time = "2024-12-30T16:38:14.739Z" }, - { url = "https://files.pythonhosted.org/packages/9a/eb/85ea6086227b84bce79b3baf7f465b4732e0785830726ce4a51528173b71/mypy-1.14.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:44bf464499f0e3a2d14d58b54674dee25c031703b2ffc35064bd0df2e0fac319", size = 12066766, upload-time = "2024-12-30T16:38:47.038Z" }, - { url = "https://files.pythonhosted.org/packages/4b/bb/f01bebf76811475d66359c259eabe40766d2f8ac8b8250d4e224bb6df379/mypy-1.14.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c99f27732c0b7dc847adb21c9d47ce57eb48fa33a17bc6d7d5c5e9f9e7ae5bac", size = 12787111, upload-time = "2024-12-30T16:39:02.444Z" }, - { url = "https://files.pythonhosted.org/packages/2f/c9/84837ff891edcb6dcc3c27d85ea52aab0c4a34740ff5f0ccc0eb87c56139/mypy-1.14.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:bce23c7377b43602baa0bd22ea3265c49b9ff0b76eb315d6c34721af4cdf1d9b", size = 12974331, upload-time = "2024-12-30T16:38:23.849Z" }, - { url = "https://files.pythonhosted.org/packages/84/5f/901e18464e6a13f8949b4909535be3fa7f823291b8ab4e4b36cfe57d6769/mypy-1.14.1-cp38-cp38-win_amd64.whl", hash = "sha256:8edc07eeade7ebc771ff9cf6b211b9a7d93687ff892150cb5692e4f4272b0837", size = 9763210, upload-time = "2024-12-30T16:38:36.299Z" }, { url = "https://files.pythonhosted.org/packages/ca/1f/186d133ae2514633f8558e78cd658070ba686c0e9275c5a5c24a1e1f0d67/mypy-1.14.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3888a1816d69f7ab92092f785a462944b3ca16d7c470d564165fe703b0970c35", size = 11200493, upload-time = "2024-12-30T16:38:26.935Z" }, { url = "https://files.pythonhosted.org/packages/af/fc/4842485d034e38a4646cccd1369f6b1ccd7bc86989c52770d75d719a9941/mypy-1.14.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:46c756a444117c43ee984bd055db99e498bc613a70bbbc120272bd13ca579fbc", size = 10357702, upload-time = "2024-12-30T16:38:50.623Z" }, { url = "https://files.pythonhosted.org/packages/b4/e6/457b83f2d701e23869cfec013a48a12638f75b9d37612a9ddf99072c1051/mypy-1.14.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:27fc248022907e72abfd8e22ab1f10e903915ff69961174784a3900a8cba9ad9", size = 12091104, upload-time = "2024-12-30T16:38:53.735Z" }, @@ -1055,121 +639,10 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556, upload-time = "2024-04-20T21:34:40.434Z" }, ] -[[package]] -name = "propcache" -version = "0.2.0" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version < '3.9'", -] -sdist = { url = "https://files.pythonhosted.org/packages/a9/4d/5e5a60b78dbc1d464f8a7bbaeb30957257afdc8512cbb9dfd5659304f5cd/propcache-0.2.0.tar.gz", hash = "sha256:df81779732feb9d01e5d513fad0122efb3d53bbc75f61b2a4f29a020bc985e70", size = 40951, upload-time = "2024-10-07T12:56:36.896Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/3a/08/1963dfb932b8d74d5b09098507b37e9b96c835ba89ab8aad35aa330f4ff3/propcache-0.2.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:c5869b8fd70b81835a6f187c5fdbe67917a04d7e52b6e7cc4e5fe39d55c39d58", size = 80712, upload-time = "2024-10-07T12:54:02.193Z" }, - { url = "https://files.pythonhosted.org/packages/e6/59/49072aba9bf8a8ed958e576182d46f038e595b17ff7408bc7e8807e721e1/propcache-0.2.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:952e0d9d07609d9c5be361f33b0d6d650cd2bae393aabb11d9b719364521984b", size = 46301, upload-time = "2024-10-07T12:54:03.576Z" }, - { url = "https://files.pythonhosted.org/packages/33/a2/6b1978c2e0d80a678e2c483f45e5443c15fe5d32c483902e92a073314ef1/propcache-0.2.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:33ac8f098df0585c0b53009f039dfd913b38c1d2edafed0cedcc0c32a05aa110", size = 45581, upload-time = "2024-10-07T12:54:05.415Z" }, - { url = "https://files.pythonhosted.org/packages/43/95/55acc9adff8f997c7572f23d41993042290dfb29e404cdadb07039a4386f/propcache-0.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:97e48e8875e6c13909c800fa344cd54cc4b2b0db1d5f911f840458a500fde2c2", size = 208659, upload-time = "2024-10-07T12:54:06.742Z" }, - { url = "https://files.pythonhosted.org/packages/bd/2c/ef7371ff715e6cd19ea03fdd5637ecefbaa0752fee5b0f2fe8ea8407ee01/propcache-0.2.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:388f3217649d6d59292b722d940d4d2e1e6a7003259eb835724092a1cca0203a", size = 222613, upload-time = "2024-10-07T12:54:08.204Z" }, - { url = "https://files.pythonhosted.org/packages/5e/1c/fef251f79fd4971a413fa4b1ae369ee07727b4cc2c71e2d90dfcde664fbb/propcache-0.2.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f571aea50ba5623c308aa146eb650eebf7dbe0fd8c5d946e28343cb3b5aad577", size = 221067, upload-time = "2024-10-07T12:54:10.449Z" }, - { url = "https://files.pythonhosted.org/packages/8d/e7/22e76ae6fc5a1708bdce92bdb49de5ebe89a173db87e4ef597d6bbe9145a/propcache-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3dfafb44f7bb35c0c06eda6b2ab4bfd58f02729e7c4045e179f9a861b07c9850", size = 208920, upload-time = "2024-10-07T12:54:11.903Z" }, - { url = "https://files.pythonhosted.org/packages/04/3e/f10aa562781bcd8a1e0b37683a23bef32bdbe501d9cc7e76969becaac30d/propcache-0.2.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a3ebe9a75be7ab0b7da2464a77bb27febcb4fab46a34f9288f39d74833db7f61", size = 200050, upload-time = "2024-10-07T12:54:13.292Z" }, - { url = "https://files.pythonhosted.org/packages/d0/98/8ac69f638358c5f2a0043809c917802f96f86026e86726b65006830f3dc6/propcache-0.2.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:d2f0d0f976985f85dfb5f3d685697ef769faa6b71993b46b295cdbbd6be8cc37", size = 202346, upload-time = "2024-10-07T12:54:14.644Z" }, - { url = "https://files.pythonhosted.org/packages/ee/78/4acfc5544a5075d8e660af4d4e468d60c418bba93203d1363848444511ad/propcache-0.2.0-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:a3dc1a4b165283bd865e8f8cb5f0c64c05001e0718ed06250d8cac9bec115b48", size = 199750, upload-time = "2024-10-07T12:54:16.286Z" }, - { url = "https://files.pythonhosted.org/packages/a2/8f/90ada38448ca2e9cf25adc2fe05d08358bda1b9446f54a606ea38f41798b/propcache-0.2.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:9e0f07b42d2a50c7dd2d8675d50f7343d998c64008f1da5fef888396b7f84630", size = 201279, upload-time = "2024-10-07T12:54:17.752Z" }, - { url = "https://files.pythonhosted.org/packages/08/31/0e299f650f73903da851f50f576ef09bfffc8e1519e6a2f1e5ed2d19c591/propcache-0.2.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:e63e3e1e0271f374ed489ff5ee73d4b6e7c60710e1f76af5f0e1a6117cd26394", size = 211035, upload-time = "2024-10-07T12:54:19.109Z" }, - { url = "https://files.pythonhosted.org/packages/85/3e/e356cc6b09064bff1c06d0b2413593e7c925726f0139bc7acef8a21e87a8/propcache-0.2.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:56bb5c98f058a41bb58eead194b4db8c05b088c93d94d5161728515bd52b052b", size = 215565, upload-time = "2024-10-07T12:54:20.578Z" }, - { url = "https://files.pythonhosted.org/packages/8b/54/4ef7236cd657e53098bd05aa59cbc3cbf7018fba37b40eaed112c3921e51/propcache-0.2.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:7665f04d0c7f26ff8bb534e1c65068409bf4687aa2534faf7104d7182debb336", size = 207604, upload-time = "2024-10-07T12:54:22.588Z" }, - { url = "https://files.pythonhosted.org/packages/1f/27/d01d7799c068443ee64002f0655d82fb067496897bf74b632e28ee6a32cf/propcache-0.2.0-cp310-cp310-win32.whl", hash = "sha256:7cf18abf9764746b9c8704774d8b06714bcb0a63641518a3a89c7f85cc02c2ad", size = 40526, upload-time = "2024-10-07T12:54:23.867Z" }, - { url = "https://files.pythonhosted.org/packages/bb/44/6c2add5eeafb7f31ff0d25fbc005d930bea040a1364cf0f5768750ddf4d1/propcache-0.2.0-cp310-cp310-win_amd64.whl", hash = "sha256:cfac69017ef97db2438efb854edf24f5a29fd09a536ff3a992b75990720cdc99", size = 44958, upload-time = "2024-10-07T12:54:24.983Z" }, - { url = "https://files.pythonhosted.org/packages/e0/1c/71eec730e12aec6511e702ad0cd73c2872eccb7cad39de8ba3ba9de693ef/propcache-0.2.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:63f13bf09cc3336eb04a837490b8f332e0db41da66995c9fd1ba04552e516354", size = 80811, upload-time = "2024-10-07T12:54:26.165Z" }, - { url = "https://files.pythonhosted.org/packages/89/c3/7e94009f9a4934c48a371632197406a8860b9f08e3f7f7d922ab69e57a41/propcache-0.2.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:608cce1da6f2672a56b24a015b42db4ac612ee709f3d29f27a00c943d9e851de", size = 46365, upload-time = "2024-10-07T12:54:28.034Z" }, - { url = "https://files.pythonhosted.org/packages/c0/1d/c700d16d1d6903aeab28372fe9999762f074b80b96a0ccc953175b858743/propcache-0.2.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:466c219deee4536fbc83c08d09115249db301550625c7fef1c5563a584c9bc87", size = 45602, upload-time = "2024-10-07T12:54:29.148Z" }, - { url = "https://files.pythonhosted.org/packages/2e/5e/4a3e96380805bf742712e39a4534689f4cddf5fa2d3a93f22e9fd8001b23/propcache-0.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fc2db02409338bf36590aa985a461b2c96fce91f8e7e0f14c50c5fcc4f229016", size = 236161, upload-time = "2024-10-07T12:54:31.557Z" }, - { url = "https://files.pythonhosted.org/packages/a5/85/90132481183d1436dff6e29f4fa81b891afb6cb89a7306f32ac500a25932/propcache-0.2.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a6ed8db0a556343d566a5c124ee483ae113acc9a557a807d439bcecc44e7dfbb", size = 244938, upload-time = "2024-10-07T12:54:33.051Z" }, - { url = "https://files.pythonhosted.org/packages/4a/89/c893533cb45c79c970834274e2d0f6d64383ec740be631b6a0a1d2b4ddc0/propcache-0.2.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:91997d9cb4a325b60d4e3f20967f8eb08dfcb32b22554d5ef78e6fd1dda743a2", size = 243576, upload-time = "2024-10-07T12:54:34.497Z" }, - { url = "https://files.pythonhosted.org/packages/8c/56/98c2054c8526331a05f205bf45cbb2cda4e58e56df70e76d6a509e5d6ec6/propcache-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c7dde9e533c0a49d802b4f3f218fa9ad0a1ce21f2c2eb80d5216565202acab4", size = 236011, upload-time = "2024-10-07T12:54:35.903Z" }, - { url = "https://files.pythonhosted.org/packages/2d/0c/8b8b9f8a6e1abd869c0fa79b907228e7abb966919047d294ef5df0d136cf/propcache-0.2.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ffcad6c564fe6b9b8916c1aefbb37a362deebf9394bd2974e9d84232e3e08504", size = 224834, upload-time = "2024-10-07T12:54:37.238Z" }, - { url = "https://files.pythonhosted.org/packages/18/bb/397d05a7298b7711b90e13108db697732325cafdcd8484c894885c1bf109/propcache-0.2.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:97a58a28bcf63284e8b4d7b460cbee1edaab24634e82059c7b8c09e65284f178", size = 224946, upload-time = "2024-10-07T12:54:38.72Z" }, - { url = "https://files.pythonhosted.org/packages/25/19/4fc08dac19297ac58135c03770b42377be211622fd0147f015f78d47cd31/propcache-0.2.0-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:945db8ee295d3af9dbdbb698cce9bbc5c59b5c3fe328bbc4387f59a8a35f998d", size = 217280, upload-time = "2024-10-07T12:54:40.089Z" }, - { url = "https://files.pythonhosted.org/packages/7e/76/c79276a43df2096ce2aba07ce47576832b1174c0c480fe6b04bd70120e59/propcache-0.2.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:39e104da444a34830751715f45ef9fc537475ba21b7f1f5b0f4d71a3b60d7fe2", size = 220088, upload-time = "2024-10-07T12:54:41.726Z" }, - { url = "https://files.pythonhosted.org/packages/c3/9a/8a8cf428a91b1336b883f09c8b884e1734c87f724d74b917129a24fe2093/propcache-0.2.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:c5ecca8f9bab618340c8e848d340baf68bcd8ad90a8ecd7a4524a81c1764b3db", size = 233008, upload-time = "2024-10-07T12:54:43.742Z" }, - { url = "https://files.pythonhosted.org/packages/25/7b/768a8969abd447d5f0f3333df85c6a5d94982a1bc9a89c53c154bf7a8b11/propcache-0.2.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:c436130cc779806bdf5d5fae0d848713105472b8566b75ff70048c47d3961c5b", size = 237719, upload-time = "2024-10-07T12:54:45.065Z" }, - { url = "https://files.pythonhosted.org/packages/ed/0d/e5d68ccc7976ef8b57d80613ac07bbaf0614d43f4750cf953f0168ef114f/propcache-0.2.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:191db28dc6dcd29d1a3e063c3be0b40688ed76434622c53a284e5427565bbd9b", size = 227729, upload-time = "2024-10-07T12:54:46.405Z" }, - { url = "https://files.pythonhosted.org/packages/05/64/17eb2796e2d1c3d0c431dc5f40078d7282f4645af0bb4da9097fbb628c6c/propcache-0.2.0-cp311-cp311-win32.whl", hash = "sha256:5f2564ec89058ee7c7989a7b719115bdfe2a2fb8e7a4543b8d1c0cc4cf6478c1", size = 40473, upload-time = "2024-10-07T12:54:47.694Z" }, - { url = "https://files.pythonhosted.org/packages/83/c5/e89fc428ccdc897ade08cd7605f174c69390147526627a7650fb883e0cd0/propcache-0.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:6e2e54267980349b723cff366d1e29b138b9a60fa376664a157a342689553f71", size = 44921, upload-time = "2024-10-07T12:54:48.935Z" }, - { url = "https://files.pythonhosted.org/packages/7c/46/a41ca1097769fc548fc9216ec4c1471b772cc39720eb47ed7e38ef0006a9/propcache-0.2.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:2ee7606193fb267be4b2e3b32714f2d58cad27217638db98a60f9efb5efeccc2", size = 80800, upload-time = "2024-10-07T12:54:50.409Z" }, - { url = "https://files.pythonhosted.org/packages/75/4f/93df46aab9cc473498ff56be39b5f6ee1e33529223d7a4d8c0a6101a9ba2/propcache-0.2.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:91ee8fc02ca52e24bcb77b234f22afc03288e1dafbb1f88fe24db308910c4ac7", size = 46443, upload-time = "2024-10-07T12:54:51.634Z" }, - { url = "https://files.pythonhosted.org/packages/0b/17/308acc6aee65d0f9a8375e36c4807ac6605d1f38074b1581bd4042b9fb37/propcache-0.2.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2e900bad2a8456d00a113cad8c13343f3b1f327534e3589acc2219729237a2e8", size = 45676, upload-time = "2024-10-07T12:54:53.454Z" }, - { url = "https://files.pythonhosted.org/packages/65/44/626599d2854d6c1d4530b9a05e7ff2ee22b790358334b475ed7c89f7d625/propcache-0.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f52a68c21363c45297aca15561812d542f8fc683c85201df0bebe209e349f793", size = 246191, upload-time = "2024-10-07T12:54:55.438Z" }, - { url = "https://files.pythonhosted.org/packages/f2/df/5d996d7cb18df076debae7d76ac3da085c0575a9f2be6b1f707fe227b54c/propcache-0.2.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1e41d67757ff4fbc8ef2af99b338bfb955010444b92929e9e55a6d4dcc3c4f09", size = 251791, upload-time = "2024-10-07T12:54:57.441Z" }, - { url = "https://files.pythonhosted.org/packages/2e/6d/9f91e5dde8b1f662f6dd4dff36098ed22a1ef4e08e1316f05f4758f1576c/propcache-0.2.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a64e32f8bd94c105cc27f42d3b658902b5bcc947ece3c8fe7bc1b05982f60e89", size = 253434, upload-time = "2024-10-07T12:54:58.857Z" }, - { url = "https://files.pythonhosted.org/packages/3c/e9/1b54b7e26f50b3e0497cd13d3483d781d284452c2c50dd2a615a92a087a3/propcache-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:55346705687dbd7ef0d77883ab4f6fabc48232f587925bdaf95219bae072491e", size = 248150, upload-time = "2024-10-07T12:55:00.19Z" }, - { url = "https://files.pythonhosted.org/packages/a7/ef/a35bf191c8038fe3ce9a414b907371c81d102384eda5dbafe6f4dce0cf9b/propcache-0.2.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:00181262b17e517df2cd85656fcd6b4e70946fe62cd625b9d74ac9977b64d8d9", size = 233568, upload-time = "2024-10-07T12:55:01.723Z" }, - { url = "https://files.pythonhosted.org/packages/97/d9/d00bb9277a9165a5e6d60f2142cd1a38a750045c9c12e47ae087f686d781/propcache-0.2.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:6994984550eaf25dd7fc7bd1b700ff45c894149341725bb4edc67f0ffa94efa4", size = 229874, upload-time = "2024-10-07T12:55:03.962Z" }, - { url = "https://files.pythonhosted.org/packages/8e/78/c123cf22469bdc4b18efb78893e69c70a8b16de88e6160b69ca6bdd88b5d/propcache-0.2.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:56295eb1e5f3aecd516d91b00cfd8bf3a13991de5a479df9e27dd569ea23959c", size = 225857, upload-time = "2024-10-07T12:55:06.439Z" }, - { url = "https://files.pythonhosted.org/packages/31/1b/fd6b2f1f36d028820d35475be78859d8c89c8f091ad30e377ac49fd66359/propcache-0.2.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:439e76255daa0f8151d3cb325f6dd4a3e93043e6403e6491813bcaaaa8733887", size = 227604, upload-time = "2024-10-07T12:55:08.254Z" }, - { url = "https://files.pythonhosted.org/packages/99/36/b07be976edf77a07233ba712e53262937625af02154353171716894a86a6/propcache-0.2.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:f6475a1b2ecb310c98c28d271a30df74f9dd436ee46d09236a6b750a7599ce57", size = 238430, upload-time = "2024-10-07T12:55:09.766Z" }, - { url = "https://files.pythonhosted.org/packages/0d/64/5822f496c9010e3966e934a011ac08cac8734561842bc7c1f65586e0683c/propcache-0.2.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:3444cdba6628accf384e349014084b1cacd866fbb88433cd9d279d90a54e0b23", size = 244814, upload-time = "2024-10-07T12:55:11.145Z" }, - { url = "https://files.pythonhosted.org/packages/fd/bd/8657918a35d50b18a9e4d78a5df7b6c82a637a311ab20851eef4326305c1/propcache-0.2.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:4a9d9b4d0a9b38d1c391bb4ad24aa65f306c6f01b512e10a8a34a2dc5675d348", size = 235922, upload-time = "2024-10-07T12:55:12.508Z" }, - { url = "https://files.pythonhosted.org/packages/a8/6f/ec0095e1647b4727db945213a9f395b1103c442ef65e54c62e92a72a3f75/propcache-0.2.0-cp312-cp312-win32.whl", hash = "sha256:69d3a98eebae99a420d4b28756c8ce6ea5a29291baf2dc9ff9414b42676f61d5", size = 40177, upload-time = "2024-10-07T12:55:13.814Z" }, - { url = "https://files.pythonhosted.org/packages/20/a2/bd0896fdc4f4c1db46d9bc361c8c79a9bf08ccc08ba054a98e38e7ba1557/propcache-0.2.0-cp312-cp312-win_amd64.whl", hash = "sha256:ad9c9b99b05f163109466638bd30ada1722abb01bbb85c739c50b6dc11f92dc3", size = 44446, upload-time = "2024-10-07T12:55:14.972Z" }, - { url = "https://files.pythonhosted.org/packages/a8/a7/5f37b69197d4f558bfef5b4bceaff7c43cc9b51adf5bd75e9081d7ea80e4/propcache-0.2.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ecddc221a077a8132cf7c747d5352a15ed763b674c0448d811f408bf803d9ad7", size = 78120, upload-time = "2024-10-07T12:55:16.179Z" }, - { url = "https://files.pythonhosted.org/packages/c8/cd/48ab2b30a6b353ecb95a244915f85756d74f815862eb2ecc7a518d565b48/propcache-0.2.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:0e53cb83fdd61cbd67202735e6a6687a7b491c8742dfc39c9e01e80354956763", size = 45127, upload-time = "2024-10-07T12:55:18.275Z" }, - { url = "https://files.pythonhosted.org/packages/a5/ba/0a1ef94a3412aab057bd996ed5f0ac7458be5bf469e85c70fa9ceb43290b/propcache-0.2.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:92fe151145a990c22cbccf9ae15cae8ae9eddabfc949a219c9f667877e40853d", size = 44419, upload-time = "2024-10-07T12:55:19.487Z" }, - { url = "https://files.pythonhosted.org/packages/b4/6c/ca70bee4f22fa99eacd04f4d2f1699be9d13538ccf22b3169a61c60a27fa/propcache-0.2.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d6a21ef516d36909931a2967621eecb256018aeb11fc48656e3257e73e2e247a", size = 229611, upload-time = "2024-10-07T12:55:21.377Z" }, - { url = "https://files.pythonhosted.org/packages/19/70/47b872a263e8511ca33718d96a10c17d3c853aefadeb86dc26e8421184b9/propcache-0.2.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3f88a4095e913f98988f5b338c1d4d5d07dbb0b6bad19892fd447484e483ba6b", size = 234005, upload-time = "2024-10-07T12:55:22.898Z" }, - { url = "https://files.pythonhosted.org/packages/4f/be/3b0ab8c84a22e4a3224719099c1229ddfdd8a6a1558cf75cb55ee1e35c25/propcache-0.2.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5a5b3bb545ead161be780ee85a2b54fdf7092815995661947812dde94a40f6fb", size = 237270, upload-time = "2024-10-07T12:55:24.354Z" }, - { url = "https://files.pythonhosted.org/packages/04/d8/f071bb000d4b8f851d312c3c75701e586b3f643fe14a2e3409b1b9ab3936/propcache-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:67aeb72e0f482709991aa91345a831d0b707d16b0257e8ef88a2ad246a7280bf", size = 231877, upload-time = "2024-10-07T12:55:25.774Z" }, - { url = "https://files.pythonhosted.org/packages/93/e7/57a035a1359e542bbb0a7df95aad6b9871ebee6dce2840cb157a415bd1f3/propcache-0.2.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3c997f8c44ec9b9b0bcbf2d422cc00a1d9b9c681f56efa6ca149a941e5560da2", size = 217848, upload-time = "2024-10-07T12:55:27.148Z" }, - { url = "https://files.pythonhosted.org/packages/f0/93/d1dea40f112ec183398fb6c42fde340edd7bab202411c4aa1a8289f461b6/propcache-0.2.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:2a66df3d4992bc1d725b9aa803e8c5a66c010c65c741ad901e260ece77f58d2f", size = 216987, upload-time = "2024-10-07T12:55:29.294Z" }, - { url = "https://files.pythonhosted.org/packages/62/4c/877340871251145d3522c2b5d25c16a1690ad655fbab7bb9ece6b117e39f/propcache-0.2.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:3ebbcf2a07621f29638799828b8d8668c421bfb94c6cb04269130d8de4fb7136", size = 212451, upload-time = "2024-10-07T12:55:30.643Z" }, - { url = "https://files.pythonhosted.org/packages/7c/bb/a91b72efeeb42906ef58ccf0cdb87947b54d7475fee3c93425d732f16a61/propcache-0.2.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:1235c01ddaa80da8235741e80815ce381c5267f96cc49b1477fdcf8c047ef325", size = 212879, upload-time = "2024-10-07T12:55:32.024Z" }, - { url = "https://files.pythonhosted.org/packages/9b/7f/ee7fea8faac57b3ec5d91ff47470c6c5d40d7f15d0b1fccac806348fa59e/propcache-0.2.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:3947483a381259c06921612550867b37d22e1df6d6d7e8361264b6d037595f44", size = 222288, upload-time = "2024-10-07T12:55:33.401Z" }, - { url = "https://files.pythonhosted.org/packages/ff/d7/acd67901c43d2e6b20a7a973d9d5fd543c6e277af29b1eb0e1f7bd7ca7d2/propcache-0.2.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:d5bed7f9805cc29c780f3aee05de3262ee7ce1f47083cfe9f77471e9d6777e83", size = 228257, upload-time = "2024-10-07T12:55:35.381Z" }, - { url = "https://files.pythonhosted.org/packages/8d/6f/6272ecc7a8daad1d0754cfc6c8846076a8cb13f810005c79b15ce0ef0cf2/propcache-0.2.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e4a91d44379f45f5e540971d41e4626dacd7f01004826a18cb048e7da7e96544", size = 221075, upload-time = "2024-10-07T12:55:36.789Z" }, - { url = "https://files.pythonhosted.org/packages/7c/bd/c7a6a719a6b3dd8b3aeadb3675b5783983529e4a3185946aa444d3e078f6/propcache-0.2.0-cp313-cp313-win32.whl", hash = "sha256:f902804113e032e2cdf8c71015651c97af6418363bea8d78dc0911d56c335032", size = 39654, upload-time = "2024-10-07T12:55:38.762Z" }, - { url = "https://files.pythonhosted.org/packages/88/e7/0eef39eff84fa3e001b44de0bd41c7c0e3432e7648ffd3d64955910f002d/propcache-0.2.0-cp313-cp313-win_amd64.whl", hash = "sha256:8f188cfcc64fb1266f4684206c9de0e80f54622c3f22a910cbd200478aeae61e", size = 43705, upload-time = "2024-10-07T12:55:39.921Z" }, - { url = "https://files.pythonhosted.org/packages/b4/94/2c3d64420fd58ed462e2b416386d48e72dec027cf7bb572066cf3866e939/propcache-0.2.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:53d1bd3f979ed529f0805dd35ddaca330f80a9a6d90bc0121d2ff398f8ed8861", size = 82315, upload-time = "2024-10-07T12:55:41.166Z" }, - { url = "https://files.pythonhosted.org/packages/73/b7/9e2a17d9a126f2012b22ddc5d0979c28ca75104e24945214790c1d787015/propcache-0.2.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:83928404adf8fb3d26793665633ea79b7361efa0287dfbd372a7e74311d51ee6", size = 47188, upload-time = "2024-10-07T12:55:42.316Z" }, - { url = "https://files.pythonhosted.org/packages/80/ef/18af27caaae5589c08bb5a461cfa136b83b7e7983be604f2140d91f92b97/propcache-0.2.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:77a86c261679ea5f3896ec060be9dc8e365788248cc1e049632a1be682442063", size = 46314, upload-time = "2024-10-07T12:55:43.544Z" }, - { url = "https://files.pythonhosted.org/packages/fa/df/8dbd3e472baf73251c0fbb571a3f0a4e3a40c52a1c8c2a6c46ab08736ff9/propcache-0.2.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:218db2a3c297a3768c11a34812e63b3ac1c3234c3a086def9c0fee50d35add1f", size = 212874, upload-time = "2024-10-07T12:55:44.823Z" }, - { url = "https://files.pythonhosted.org/packages/7c/57/5d4d783ac594bd56434679b8643673ae12de1ce758116fd8912a7f2313ec/propcache-0.2.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7735e82e3498c27bcb2d17cb65d62c14f1100b71723b68362872bca7d0913d90", size = 224578, upload-time = "2024-10-07T12:55:46.253Z" }, - { url = "https://files.pythonhosted.org/packages/66/27/072be8ad434c9a3aa1b561f527984ea0ed4ac072fd18dfaaa2aa2d6e6a2b/propcache-0.2.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:20a617c776f520c3875cf4511e0d1db847a076d720714ae35ffe0df3e440be68", size = 222636, upload-time = "2024-10-07T12:55:47.608Z" }, - { url = "https://files.pythonhosted.org/packages/c3/f1/69a30ff0928d07f50bdc6f0147fd9a08e80904fd3fdb711785e518de1021/propcache-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:67b69535c870670c9f9b14a75d28baa32221d06f6b6fa6f77a0a13c5a7b0a5b9", size = 213573, upload-time = "2024-10-07T12:55:49.82Z" }, - { url = "https://files.pythonhosted.org/packages/a8/2e/c16716ae113fe0a3219978df3665a6fea049d81d50bd28c4ae72a4c77567/propcache-0.2.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4569158070180c3855e9c0791c56be3ceeb192defa2cdf6a3f39e54319e56b89", size = 205438, upload-time = "2024-10-07T12:55:51.231Z" }, - { url = "https://files.pythonhosted.org/packages/e1/df/80e2c5cd5ed56a7bfb1aa58cedb79617a152ae43de7c0a7e800944a6b2e2/propcache-0.2.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:db47514ffdbd91ccdc7e6f8407aac4ee94cc871b15b577c1c324236b013ddd04", size = 202352, upload-time = "2024-10-07T12:55:52.596Z" }, - { url = "https://files.pythonhosted.org/packages/0f/4e/79f665fa04839f30ffb2903211c718b9660fbb938ac7a4df79525af5aeb3/propcache-0.2.0-cp38-cp38-musllinux_1_2_armv7l.whl", hash = "sha256:2a60ad3e2553a74168d275a0ef35e8c0a965448ffbc3b300ab3a5bb9956c2162", size = 200476, upload-time = "2024-10-07T12:55:54.016Z" }, - { url = "https://files.pythonhosted.org/packages/a9/39/b9ea7b011521dd7cfd2f89bb6b8b304f3c789ea6285445bc145bebc83094/propcache-0.2.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:662dd62358bdeaca0aee5761de8727cfd6861432e3bb828dc2a693aa0471a563", size = 201581, upload-time = "2024-10-07T12:55:56.246Z" }, - { url = "https://files.pythonhosted.org/packages/e4/81/e8e96c97aa0b675a14e37b12ca9c9713b15cfacf0869e64bf3ab389fabf1/propcache-0.2.0-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:25a1f88b471b3bc911d18b935ecb7115dff3a192b6fef46f0bfaf71ff4f12418", size = 225628, upload-time = "2024-10-07T12:55:57.686Z" }, - { url = "https://files.pythonhosted.org/packages/eb/99/15f998c502c214f6c7f51462937605d514a8943a9a6c1fa10f40d2710976/propcache-0.2.0-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:f60f0ac7005b9f5a6091009b09a419ace1610e163fa5deaba5ce3484341840e7", size = 229270, upload-time = "2024-10-07T12:55:59.065Z" }, - { url = "https://files.pythonhosted.org/packages/ff/3a/a9f1a0c0e5b994b8f1a1c71bea56bb3e9eeec821cb4dd61e14051c4ba00b/propcache-0.2.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:74acd6e291f885678631b7ebc85d2d4aec458dd849b8c841b57ef04047833bed", size = 207771, upload-time = "2024-10-07T12:56:00.393Z" }, - { url = "https://files.pythonhosted.org/packages/ff/3e/6103906a66d6713f32880cf6a5ba84a1406b4d66e1b9389bb9b8e1789f9e/propcache-0.2.0-cp38-cp38-win32.whl", hash = "sha256:d9b6ddac6408194e934002a69bcaadbc88c10b5f38fb9307779d1c629181815d", size = 41015, upload-time = "2024-10-07T12:56:01.953Z" }, - { url = "https://files.pythonhosted.org/packages/37/23/a30214b4c1f2bea24cc1197ef48d67824fbc41d5cf5472b17c37fef6002c/propcache-0.2.0-cp38-cp38-win_amd64.whl", hash = "sha256:676135dcf3262c9c5081cc8f19ad55c8a64e3f7282a21266d05544450bffc3a5", size = 45749, upload-time = "2024-10-07T12:56:03.095Z" }, - { url = "https://files.pythonhosted.org/packages/38/05/797e6738c9f44ab5039e3ff329540c934eabbe8ad7e63c305c75844bc86f/propcache-0.2.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:25c8d773a62ce0451b020c7b29a35cfbc05de8b291163a7a0f3b7904f27253e6", size = 81903, upload-time = "2024-10-07T12:56:04.651Z" }, - { url = "https://files.pythonhosted.org/packages/9f/84/8d5edb9a73e1a56b24dd8f2adb6aac223109ff0e8002313d52e5518258ba/propcache-0.2.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:375a12d7556d462dc64d70475a9ee5982465fbb3d2b364f16b86ba9135793638", size = 46960, upload-time = "2024-10-07T12:56:06.38Z" }, - { url = "https://files.pythonhosted.org/packages/e7/77/388697bedda984af0d12d68e536b98129b167282da3401965c8450de510e/propcache-0.2.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1ec43d76b9677637a89d6ab86e1fef70d739217fefa208c65352ecf0282be957", size = 46133, upload-time = "2024-10-07T12:56:07.606Z" }, - { url = "https://files.pythonhosted.org/packages/e2/dc/60d444610bc5b1d7a758534f58362b1bcee736a785473f8a39c91f05aad1/propcache-0.2.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f45eec587dafd4b2d41ac189c2156461ebd0c1082d2fe7013571598abb8505d1", size = 211105, upload-time = "2024-10-07T12:56:08.826Z" }, - { url = "https://files.pythonhosted.org/packages/bc/c6/40eb0dd1de6f8e84f454615ab61f68eb4a58f9d63d6f6eaf04300ac0cc17/propcache-0.2.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bc092ba439d91df90aea38168e11f75c655880c12782facf5cf9c00f3d42b562", size = 226613, upload-time = "2024-10-07T12:56:11.184Z" }, - { url = "https://files.pythonhosted.org/packages/de/b6/e078b5e9de58e20db12135eb6a206b4b43cb26c6b62ee0fe36ac40763a64/propcache-0.2.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fa1076244f54bb76e65e22cb6910365779d5c3d71d1f18b275f1dfc7b0d71b4d", size = 225587, upload-time = "2024-10-07T12:56:15.294Z" }, - { url = "https://files.pythonhosted.org/packages/ce/4e/97059dd24494d1c93d1efb98bb24825e1930265b41858dd59c15cb37a975/propcache-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:682a7c79a2fbf40f5dbb1eb6bfe2cd865376deeac65acf9beb607505dced9e12", size = 211826, upload-time = "2024-10-07T12:56:16.997Z" }, - { url = "https://files.pythonhosted.org/packages/fc/23/4dbf726602a989d2280fe130a9b9dd71faa8d3bb8cd23d3261ff3c23f692/propcache-0.2.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8e40876731f99b6f3c897b66b803c9e1c07a989b366c6b5b475fafd1f7ba3fb8", size = 203140, upload-time = "2024-10-07T12:56:18.368Z" }, - { url = "https://files.pythonhosted.org/packages/5b/ce/f3bff82c885dbd9ae9e43f134d5b02516c3daa52d46f7a50e4f52ef9121f/propcache-0.2.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:363ea8cd3c5cb6679f1c2f5f1f9669587361c062e4899fce56758efa928728f8", size = 208841, upload-time = "2024-10-07T12:56:19.859Z" }, - { url = "https://files.pythonhosted.org/packages/29/d7/19a4d3b4c7e95d08f216da97035d0b103d0c90411c6f739d47088d2da1f0/propcache-0.2.0-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:140fbf08ab3588b3468932974a9331aff43c0ab8a2ec2c608b6d7d1756dbb6cb", size = 203315, upload-time = "2024-10-07T12:56:21.256Z" }, - { url = "https://files.pythonhosted.org/packages/db/87/5748212a18beb8d4ab46315c55ade8960d1e2cdc190764985b2d229dd3f4/propcache-0.2.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:e70fac33e8b4ac63dfc4c956fd7d85a0b1139adcfc0d964ce288b7c527537fea", size = 204724, upload-time = "2024-10-07T12:56:23.644Z" }, - { url = "https://files.pythonhosted.org/packages/84/2a/c3d2f989fc571a5bad0fabcd970669ccb08c8f9b07b037ecddbdab16a040/propcache-0.2.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:b33d7a286c0dc1a15f5fc864cc48ae92a846df287ceac2dd499926c3801054a6", size = 215514, upload-time = "2024-10-07T12:56:25.733Z" }, - { url = "https://files.pythonhosted.org/packages/c9/1f/4c44c133b08bc5f776afcb8f0833889c2636b8a83e07ea1d9096c1e401b0/propcache-0.2.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:f6d5749fdd33d90e34c2efb174c7e236829147a2713334d708746e94c4bde40d", size = 220063, upload-time = "2024-10-07T12:56:28.497Z" }, - { url = "https://files.pythonhosted.org/packages/2e/25/280d0a3bdaee68db74c0acd9a472e59e64b516735b59cffd3a326ff9058a/propcache-0.2.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:22aa8f2272d81d9317ff5756bb108021a056805ce63dd3630e27d042c8092798", size = 211620, upload-time = "2024-10-07T12:56:29.891Z" }, - { url = "https://files.pythonhosted.org/packages/28/8c/266898981b7883c1563c35954f9ce9ced06019fdcc487a9520150c48dc91/propcache-0.2.0-cp39-cp39-win32.whl", hash = "sha256:73e4b40ea0eda421b115248d7e79b59214411109a5bc47d0d48e4c73e3b8fcf9", size = 41049, upload-time = "2024-10-07T12:56:31.246Z" }, - { url = "https://files.pythonhosted.org/packages/af/53/a3e5b937f58e757a940716b88105ec4c211c42790c1ea17052b46dc16f16/propcache-0.2.0-cp39-cp39-win_amd64.whl", hash = "sha256:9517d5e9e0731957468c29dbfd0f976736a0e55afaea843726e887f36fe017df", size = 45587, upload-time = "2024-10-07T12:56:33.416Z" }, - { url = "https://files.pythonhosted.org/packages/3d/b6/e6d98278f2d49b22b4d033c9f792eda783b9ab2094b041f013fc69bcde87/propcache-0.2.0-py3-none-any.whl", hash = "sha256:2ccc28197af5313706511fab3a8b66dcd6da067a1331372c82ea1cb74285e036", size = 11603, upload-time = "2024-10-07T12:56:35.137Z" }, -] - [[package]] name = "propcache" version = "0.3.2" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.9'", -] sdist = { url = "https://files.pythonhosted.org/packages/a6/16/43264e4a779dd8588c21a70f0709665ee8f611211bdd2c87d952cfa7c776/propcache-0.3.2.tar.gz", hash = "sha256:20d7d62e4e7ef05f221e0db2856b979540686342e7dd9973b815599c7057e168", size = 44139, upload-time = "2025-06-09T22:56:06.081Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/ab/14/510deed325e262afeb8b360043c5d7c960da7d3ecd6d6f9496c9c56dc7f4/propcache-0.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:22d9962a358aedbb7a2e36187ff273adeaab9743373a272976d2e348d08c7770", size = 73178, upload-time = "2025-06-09T22:53:40.126Z" }, @@ -1273,320 +746,160 @@ wheels = [ [[package]] name = "pydantic" -version = "1.10.23" +version = "1.10.22" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.9'", - "python_full_version < '3.9'", -] dependencies = [ { name = "typing-extensions", marker = "extra == 'group-18-runloop-api-client-pydantic-v1'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/8f/3d/bd64466a91ec17b73f5c6c723373c352086dedd405c9f8dc1141aaddc59e/pydantic-1.10.23.tar.gz", hash = "sha256:81ee80fe4bd69236aeb65c8beeb5150655b8a49b946fce6664a720d6cf5ec717", size = 356864, upload-time = "2025-09-13T02:39:34.915Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b3/76/0252dc9e6aea421728006e2734f02848a5676bfe7736cc1f9de438aa42a0/pydantic-1.10.23-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1ce178e49a471ebf867451872a3403b89da6194bc2c9761e78ce22f619794d0d", size = 2493024, upload-time = "2025-09-13T02:38:05.322Z" }, - { url = "https://files.pythonhosted.org/packages/b9/11/45f651f4646f451ff9c6ead61837693c052feaf1ac296fd9411d897cf0a2/pydantic-1.10.23-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d5f2ab29db92a2b11c7cd49466f68858583bf227165c42a3fae2b50042a1ab51", size = 2300271, upload-time = "2025-09-13T02:38:08.589Z" }, - { url = "https://files.pythonhosted.org/packages/50/4b/341c4d714ce1238c4c16a3698c38284f499f1d7769029b9f94fee26702ac/pydantic-1.10.23-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8e84ece91eb806586ffa4f92c149308cb07b0fa14a7e1204e18cde01aac283f7", size = 2959673, upload-time = "2025-09-13T02:38:10.231Z" }, - { url = "https://files.pythonhosted.org/packages/82/7f/8db5317689dc10809abac464c6db8f8936292899953b6acf9e96c73cfa63/pydantic-1.10.23-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:757c8a2f459311bf277f6ddb4891222f69ba93fb301eee095c985fc7239d5afd", size = 3029774, upload-time = "2025-09-13T02:38:11.851Z" }, - { url = "https://files.pythonhosted.org/packages/ae/ef/71fea5e0ec14180f63226717b7723857b31b1e5a3e9635ad6607a42296f0/pydantic-1.10.23-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:50b4726ab72a027fb69da865e849ae16107bdbea01ff1670daf4560e078a1606", size = 3099346, upload-time = "2025-09-13T02:38:13.711Z" }, - { url = "https://files.pythonhosted.org/packages/2d/70/1573e4ddcd69f88137e82d405b702631bea48c6a9816b6d0626b468a8d65/pydantic-1.10.23-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:4ed07c43d5c3f6f391eceeef7ead84c8c54083e0a1b5fa009302191c07775a73", size = 3038047, upload-time = "2025-09-13T02:38:15.559Z" }, - { url = "https://files.pythonhosted.org/packages/ba/1f/c06b6a1d4ac137ff63f3dd0a74b3b2e00ceca26572e14373b3deeef3d068/pydantic-1.10.23-cp310-cp310-win_amd64.whl", hash = "sha256:bc5547c3be3b8494a444adf3703c037bdf2170e30af802f5d7bb14a232698106", size = 2092280, upload-time = "2025-09-13T02:38:18.076Z" }, - { url = "https://files.pythonhosted.org/packages/d6/40/c239b68381a2201b1241c0e417cb2cebe29f6e6029f01a2a3a208ed0c7be/pydantic-1.10.23-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b2e9d81546af42331248bbffde26a441631c8823515ebf328ee2ec04d771cd73", size = 2525346, upload-time = "2025-09-13T02:38:19.706Z" }, - { url = "https://files.pythonhosted.org/packages/df/18/2138690053ae63a410dd758061404c5426f7e0ee4edb427a379ff679ef80/pydantic-1.10.23-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7e13f39ce65232a2826d1c32a9e2c6f9ca5451d6e51c6e5ea9fdebc285fc2980", size = 2305920, upload-time = "2025-09-13T02:38:21.89Z" }, - { url = "https://files.pythonhosted.org/packages/2b/e7/618bb71aafd4bade35d1d9fc0427b1621b5966b550ce0c4afb2a326e1348/pydantic-1.10.23-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:041308bdb4804f0b387b02f870ebdf4e86020de344a969020de853f5ea8d5508", size = 2902994, upload-time = "2025-09-13T02:38:23.812Z" }, - { url = "https://files.pythonhosted.org/packages/ce/dd/7044afbe9f805ee57efd7e059a4704111a77664f97e0e821749de8bf065c/pydantic-1.10.23-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ed01648e2a469e2c35984bab9ff5080648c53af3b8b98312e1d7823eacd33d77", size = 2975707, upload-time = "2025-09-13T02:38:25.795Z" }, - { url = "https://files.pythonhosted.org/packages/18/fc/5dc725d18a7f99b4731c1f6301acb89f5d86816f625b3910ed1e6c762ebb/pydantic-1.10.23-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:18056741c9febebeb043798414099ada8d8e74cc47ec2059d7fbdc7d091d0e7b", size = 3063227, upload-time = "2025-09-13T02:38:27.717Z" }, - { url = "https://files.pythonhosted.org/packages/3c/bb/499c9881cbfb4b858ead5264bf740461f8cd10b06dda25379584f5516a43/pydantic-1.10.23-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:7411a18deef02a6b7825edb3930b9ab0251f7b131ebb1cb1ffe0aadf74d60c6d", size = 2989099, upload-time = "2025-09-13T02:38:29.637Z" }, - { url = "https://files.pythonhosted.org/packages/47/84/593aa9e2229151b563f844b4dfc67c5307116389a5b78fa5230ca26b2ccb/pydantic-1.10.23-cp311-cp311-win_amd64.whl", hash = "sha256:890213289bf40481a715b1d8b3e8a602af9e481d9f0e0b2b00dc375a12b0cfbb", size = 2095481, upload-time = "2025-09-13T02:38:31.42Z" }, - { url = "https://files.pythonhosted.org/packages/7d/db/91114a2c7ae0ee946ef54f51aeaba188eb728fa265eea16a2e83801e7174/pydantic-1.10.23-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:136b6428b644691d0ee2a3a7de395d0d1b01ce6388b747bd371bb9ca65b4cc32", size = 2532742, upload-time = "2025-09-13T02:38:33.273Z" }, - { url = "https://files.pythonhosted.org/packages/12/95/5a5b2413eb68c996f9ebe36d3d40c72f79417710f72c3347fe2f7436d699/pydantic-1.10.23-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b47c210416606b7c8e236c7546647500856eaba0d01564d5cddacb30d1b5daec", size = 2321478, upload-time = "2025-09-13T02:38:35.285Z" }, - { url = "https://files.pythonhosted.org/packages/23/4b/34996785baf88fb907fb51a608b81085167b0acfdee3e6920c67bb145738/pydantic-1.10.23-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c9c436e12d81b7c3d3208f66a5d35b401c8ec25fafc9bff446c77f1072ed5f5", size = 2778508, upload-time = "2025-09-13T02:38:37.046Z" }, - { url = "https://files.pythonhosted.org/packages/13/d7/5a748c85d4cd0e82016484642ab6a2ab86cdf4b3d94a3e4969a4f22a85a4/pydantic-1.10.23-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:edba6ac9bd6040daf3e876c284257624171884011e0729d90b90f5fe11f7217d", size = 2828364, upload-time = "2025-09-13T02:38:38.829Z" }, - { url = "https://files.pythonhosted.org/packages/d5/8a/8a04eb44ebf5e64644a3c6c8dbd1b7c3c506774b88bd6bdc4fff9779cfc2/pydantic-1.10.23-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:101ae7dcd77c23003d4766bcf23e08cd3d012173379ad549bdb2c898855b2a57", size = 2910201, upload-time = "2025-09-13T02:38:40.603Z" }, - { url = "https://files.pythonhosted.org/packages/99/a0/9f4c10a0673996f2980c131a857f6eb4d7711fc047df06f4346561af03a0/pydantic-1.10.23-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:9b05416d8dcf36fd291348bba8f565d015fce4c594577d2ef5bc0c5ec8f54a29", size = 2858353, upload-time = "2025-09-13T02:38:42.12Z" }, - { url = "https://files.pythonhosted.org/packages/67/48/5719e361f87245fe798b4ddcfa70ad69a8aa7cf143b4e15467e26d46d453/pydantic-1.10.23-cp312-cp312-win_amd64.whl", hash = "sha256:0f309b3dd80ed4d3487b1219c69dfd9036e51a863aeaa41a3b67497b81c4cb8f", size = 1968607, upload-time = "2025-09-13T02:38:43.788Z" }, - { url = "https://files.pythonhosted.org/packages/fa/d8/02fc15e5af12cf6ee3b58b47ec71bbf0236bc32f621c7d18fd09035c54e5/pydantic-1.10.23-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a6aa6881a18657fe66b9249e0572a9690ebc6f0b37c32872beb06bc51bff738f", size = 2588217, upload-time = "2025-09-13T02:38:45.588Z" }, - { url = "https://files.pythonhosted.org/packages/4c/0a/f56de9d891ef61cf64dcd6c9324a3168b46b268a7489c2f0f62b45bf29aa/pydantic-1.10.23-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:c57bfade74111335062c8ac830d5a14004742ff5b037c52c410d9e9011258bf5", size = 2349602, upload-time = "2025-09-13T02:38:47.598Z" }, - { url = "https://files.pythonhosted.org/packages/02/9c/3e1854d854a11169e7865e55c9e1f081aed3039a9fa3f90b2ae6aa1d1bfc/pydantic-1.10.23-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:723cb7f6aca0b471bac9d7dceb42d151d26aabdca655bd4190be3a7de008a054", size = 2762249, upload-time = "2025-09-13T02:38:49.862Z" }, - { url = "https://files.pythonhosted.org/packages/51/b9/910fb8ea0b347f9b02b7641d14a86e1c2d2306d0aeca785f0efc18e23500/pydantic-1.10.23-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1b81db6c9108c3f6509c897fcdf842e5993d7233e9140a7f1c4dc1c2f85b0a8d", size = 2799069, upload-time = "2025-09-13T02:38:51.427Z" }, - { url = "https://files.pythonhosted.org/packages/b5/bf/b9eb1bf92f229a4420627f23f2be8d92decc4f9b33d43fcad220baee0a0a/pydantic-1.10.23-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:9e9544d07d96df6c6405b64462fb3122e5d0af46a1c4ddf94c180b17ac29f047", size = 2888516, upload-time = "2025-09-13T02:38:53.882Z" }, - { url = "https://files.pythonhosted.org/packages/a6/35/58ef579a4ad591f54b20787d123fe7c356c553bdcbde40abb1745778e49d/pydantic-1.10.23-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4dff5e26a14424f4e6cf44cbd45861b458f31e37d316e92a78bf99ec6d1ef2ee", size = 2850293, upload-time = "2025-09-13T02:38:55.839Z" }, - { url = "https://files.pythonhosted.org/packages/54/73/f9825643f110ac763edd1abef9559d17e0a440348f94f6e5803b23d5aaaf/pydantic-1.10.23-cp313-cp313-win_amd64.whl", hash = "sha256:633235236c9af4a16e7cf47be3ffab15445552613a122b44a8946868c2ace426", size = 1970494, upload-time = "2025-09-13T02:38:57.378Z" }, - { url = "https://files.pythonhosted.org/packages/f0/5b/117c637af7b1680bae4c1e16d35530b8f2d4078e9ee7a5092f32a5b606b4/pydantic-1.10.23-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:f71590dcd1ff354107cecc1c26b85406dd11e6f87d9b8416c5defd3cf4d54a51", size = 2386186, upload-time = "2025-09-13T02:39:09.756Z" }, - { url = "https://files.pythonhosted.org/packages/ed/16/37dbd0bf8212b2cd616fd1defab1f6ee60e65dee62c6ceef90e19392cfa5/pydantic-1.10.23-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:46b3cd6fb8edf973380ddf1ac7387cca5f0624c07579bf9d15121dd77986b57c", size = 2216810, upload-time = "2025-09-13T02:39:11.379Z" }, - { url = "https://files.pythonhosted.org/packages/8e/e7/c30043d13d379ed781bba210027729dbb0370f58cf4b41302ac11860e303/pydantic-1.10.23-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:89e9a801a538d056fd91edf0d01dec02abde1b325e3c019c5c06d75fcca86929", size = 2843784, upload-time = "2025-09-13T02:39:12.892Z" }, - { url = "https://files.pythonhosted.org/packages/c6/7d/5e94a21cd479717825f30ad2947454674026ef00ff9a070eacec316ced6f/pydantic-1.10.23-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7ee7fa1a9bfa45aad5652001efa552a79a40f9ea7a1b11185685dd047895d3a8", size = 2944921, upload-time = "2025-09-13T02:39:14.803Z" }, - { url = "https://files.pythonhosted.org/packages/6f/42/90b4d1db7d4e9a5706fd53e9872db7c09d7e96d980f62b6301d524e40dac/pydantic-1.10.23-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:0db70ae0e58eed1ffd01fbfdd23f6c6e5ae5e1bf2cd50dfeb0a2853656766e68", size = 3092583, upload-time = "2025-09-13T02:39:16.853Z" }, - { url = "https://files.pythonhosted.org/packages/96/38/a4cc7b1d0b8a8a315f08b7d8be998fc4c7753f90e7549b8cb95ce8dd51a9/pydantic-1.10.23-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:d037210949ac9e837360239d91a834cab3cf02e84cf295ea66c6ff73137f3723", size = 2991731, upload-time = "2025-09-13T02:39:18.368Z" }, - { url = "https://files.pythonhosted.org/packages/35/58/7e2583870769eaaef76e2c46d0de61feaf6e1f4cb955f8de0c83e2e6349c/pydantic-1.10.23-cp38-cp38-win_amd64.whl", hash = "sha256:aa8d57384c6305febd9724b4f8de6860b5ba5821b7948dbbd0ddf733d50d7677", size = 2154727, upload-time = "2025-09-13T02:39:19.929Z" }, - { url = "https://files.pythonhosted.org/packages/3c/4f/6d542dae6da93903d4cced16a91d2a2bfee826066feba91c0399f5ccd308/pydantic-1.10.23-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:cdb4c8fdf8344b912285ca85c99d44433bd3d877f44b9ffcfc79cefedbc08869", size = 2502925, upload-time = "2025-09-13T02:39:21.533Z" }, - { url = "https://files.pythonhosted.org/packages/17/66/ebd7428e6db2bff093bc754660db24af4ee5b4d227868937cd114195f1bd/pydantic-1.10.23-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:144f739a617f2c12fa8d135d2efe26b9cf16033a44f2fe5400d7d0e9d9c90dca", size = 2309038, upload-time = "2025-09-13T02:39:23.012Z" }, - { url = "https://files.pythonhosted.org/packages/3c/1e/d696eaff2b1ed889d8de8839012144f1b9be7b743a138e669ca5056efac2/pydantic-1.10.23-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3449e59f27a42ba2c35c2e92aea345794696e5dddba3b5d88d123155eac4ee83", size = 2968173, upload-time = "2025-09-13T02:39:24.536Z" }, - { url = "https://files.pythonhosted.org/packages/b2/5a/f53e05f877509007457314fdec1a7572cd889f17e7e92b5f090ca28bde78/pydantic-1.10.23-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:10e9d8259fab4599498c3246703b84a5e9500240544bf49c54fc57996c6d093a", size = 3038899, upload-time = "2025-09-13T02:39:26.082Z" }, - { url = "https://files.pythonhosted.org/packages/1b/a6/9f9d18d754b21d57e45adb5035ed020ed4e5b70e23fb48cb17b6d2f9c57c/pydantic-1.10.23-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:08b576239a4acbbfd35365b603cbee5fee6d3c56323abba54f0142e7ad6ff406", size = 3107617, upload-time = "2025-09-13T02:39:28.092Z" }, - { url = "https://files.pythonhosted.org/packages/67/ed/e2b6d31a0bda6f78ba8b84ffbeeba2501f2b5efd5b4a584bc728de2abb88/pydantic-1.10.23-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:0f20e4dfe6413ee79fc1b4ac9c9f4112ff9d4cf44a19577592422d09774ee085", size = 3048822, upload-time = "2025-09-13T02:39:29.732Z" }, - { url = "https://files.pythonhosted.org/packages/43/cc/272190268db5c7a12f9106e3ed7925fc93d1c3a2dffc6f3beebf0e06b990/pydantic-1.10.23-cp39-cp39-win_amd64.whl", hash = "sha256:45fcc5ed6adde6703f9f22f898362a087d1d140a337ecc4caca2477f4d735390", size = 2099360, upload-time = "2025-09-13T02:39:31.376Z" }, - { url = "https://files.pythonhosted.org/packages/f0/d6/43d8913ca252c52c5f5b8d84ae7bfa05059d4d7be3b428170f303d67fe3f/pydantic-1.10.23-py3-none-any.whl", hash = "sha256:6294bb84565c294a3a6408c52b26a42803f258d5ebfdb3ae896cd7cccfa07211", size = 166525, upload-time = "2025-09-13T02:39:33.055Z" }, -] - -[[package]] -name = "pydantic" -version = "2.10.6" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version < '3.9'", -] -dependencies = [ - { name = "annotated-types", marker = "(python_full_version < '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "pydantic-core", version = "2.27.2", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "typing-extensions", marker = "(python_full_version < '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/b7/ae/d5220c5c52b158b1de7ca89fc5edb72f304a70a4c540c84c8844bf4008de/pydantic-2.10.6.tar.gz", hash = "sha256:ca5daa827cce33de7a42be142548b0096bf05a7e7b365aebfa5f8eeec7128236", size = 761681, upload-time = "2025-01-24T01:42:12.693Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/f4/3c/8cc1cc84deffa6e25d2d0c688ebb80635dfdbf1dbea3e30c541c8cf4d860/pydantic-2.10.6-py3-none-any.whl", hash = "sha256:427d664bf0b8a2b34ff5dd0f5a18df00591adcee7198fbd71981054cef37b584", size = 431696, upload-time = "2025-01-24T01:42:10.371Z" }, +sdist = { url = "https://files.pythonhosted.org/packages/9a/57/5996c63f0deec09e9e901a2b838247c97c6844999562eac4e435bcb83938/pydantic-1.10.22.tar.gz", hash = "sha256:ee1006cebd43a8e7158fb7190bb8f4e2da9649719bff65d0c287282ec38dec6d", size = 356771, upload-time = "2025-04-24T13:38:43.605Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/92/91eb5c75a1460292e1f2f3e577122574ebb942fbac19ad2369ff00b9eb24/pydantic-1.10.22-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:57889565ccc1e5b7b73343329bbe6198ebc472e3ee874af2fa1865cfe7048228", size = 2852481, upload-time = "2025-04-24T13:36:55.045Z" }, + { url = "https://files.pythonhosted.org/packages/08/f3/dd54b49fc5caaed06f5a0d0a5ec35a81cf722cd6b42455f408dad1ef3f7d/pydantic-1.10.22-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:90729e22426de79bc6a3526b4c45ec4400caf0d4f10d7181ba7f12c01bb3897d", size = 2585586, upload-time = "2025-04-24T13:36:58.453Z" }, + { url = "https://files.pythonhosted.org/packages/ec/9b/48d10180cc614ffb66da486e99bc1f8b639fb44edf322864f2fb161e2351/pydantic-1.10.22-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f8684d347f351554ec94fdcb507983d3116dc4577fb8799fed63c65869a2d10", size = 3336974, upload-time = "2025-04-24T13:37:00.652Z" }, + { url = "https://files.pythonhosted.org/packages/ff/80/b55ad0029ae8e7b8b5c81ad7c4e800774a52107d26f70c6696857dc733d5/pydantic-1.10.22-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c8dad498ceff2d9ef1d2e2bc6608f5b59b8e1ba2031759b22dfb8c16608e1802", size = 3362338, upload-time = "2025-04-24T13:37:02.42Z" }, + { url = "https://files.pythonhosted.org/packages/65/e0/8a5cd2cd29a5632581ba466f5792194b2a568aa052ce9da9ba98b634debf/pydantic-1.10.22-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:fac529cc654d4575cf8de191cce354b12ba705f528a0a5c654de6d01f76cd818", size = 3519505, upload-time = "2025-04-24T13:37:04.322Z" }, + { url = "https://files.pythonhosted.org/packages/38/c5/c776d03ec374f22860802b2cee057b41e866be3c80826b53d4c001692db3/pydantic-1.10.22-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:4148232aded8dd1dd13cf910a01b32a763c34bd79a0ab4d1ee66164fcb0b7b9d", size = 3485878, upload-time = "2025-04-24T13:37:06.102Z" }, + { url = "https://files.pythonhosted.org/packages/d1/a2/1efd064513a2c1bcb5c2b0e022cdf77d132ef7f7f20d91bb439d759f6a88/pydantic-1.10.22-cp310-cp310-win_amd64.whl", hash = "sha256:ece68105d9e436db45d8650dc375c760cc85a6793ae019c08769052902dca7db", size = 2299673, upload-time = "2025-04-24T13:37:07.969Z" }, + { url = "https://files.pythonhosted.org/packages/42/03/e435ed85a9abda29e3fbdb49c572fe4131a68c6daf3855a01eebda9e1b27/pydantic-1.10.22-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:8e530a8da353f791ad89e701c35787418605d35085f4bdda51b416946070e938", size = 2845682, upload-time = "2025-04-24T13:37:10.142Z" }, + { url = "https://files.pythonhosted.org/packages/72/ea/4a625035672f6c06d3f1c7e33aa0af6bf1929991e27017e98b9c2064ae0b/pydantic-1.10.22-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:654322b85642e9439d7de4c83cb4084ddd513df7ff8706005dada43b34544946", size = 2553286, upload-time = "2025-04-24T13:37:11.946Z" }, + { url = "https://files.pythonhosted.org/packages/a4/f0/424ad837746e69e9f061ba9be68c2a97aef7376d1911692904d8efbcd322/pydantic-1.10.22-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a8bece75bd1b9fc1c32b57a32831517943b1159ba18b4ba32c0d431d76a120ae", size = 3141232, upload-time = "2025-04-24T13:37:14.394Z" }, + { url = "https://files.pythonhosted.org/packages/14/67/4979c19e8cfd092085a292485e0b42d74e4eeefbb8cd726aa8ba38d06294/pydantic-1.10.22-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eccb58767f13c6963dcf96d02cb8723ebb98b16692030803ac075d2439c07b0f", size = 3214272, upload-time = "2025-04-24T13:37:16.201Z" }, + { url = "https://files.pythonhosted.org/packages/1a/04/32339ce43e97519d19e7759902515c750edbf4832a13063a4ab157f83f42/pydantic-1.10.22-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:7778e6200ff8ed5f7052c1516617423d22517ad36cc7a3aedd51428168e3e5e8", size = 3321646, upload-time = "2025-04-24T13:37:19.086Z" }, + { url = "https://files.pythonhosted.org/packages/92/35/dffc1b29cb7198aadab68d75447191e59bdbc1f1d2d51826c9a4460d372f/pydantic-1.10.22-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:bffe02767d27c39af9ca7dc7cd479c00dda6346bb62ffc89e306f665108317a2", size = 3244258, upload-time = "2025-04-24T13:37:20.929Z" }, + { url = "https://files.pythonhosted.org/packages/11/c5/c4ce6ebe7f528a879441eabd2c6dd9e2e4c54f320a8c9344ba93b3aa8701/pydantic-1.10.22-cp311-cp311-win_amd64.whl", hash = "sha256:23bc19c55427091b8e589bc08f635ab90005f2dc99518f1233386f46462c550a", size = 2309702, upload-time = "2025-04-24T13:37:23.296Z" }, + { url = "https://files.pythonhosted.org/packages/f6/a3/ec66239ed7c9e90edfb85b23b6b18eb290ed7aa05f54837cdcb6a14faa98/pydantic-1.10.22-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:92d0f97828a075a71d9efc65cf75db5f149b4d79a38c89648a63d2932894d8c9", size = 2794865, upload-time = "2025-04-24T13:37:25.087Z" }, + { url = "https://files.pythonhosted.org/packages/49/6a/99cf3fee612d93210c85f45a161e98c1c5b45b6dcadb21c9f1f838fa9e28/pydantic-1.10.22-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6af5a2811b6b95b58b829aeac5996d465a5f0c7ed84bd871d603cf8646edf6ff", size = 2534212, upload-time = "2025-04-24T13:37:26.848Z" }, + { url = "https://files.pythonhosted.org/packages/f1/e6/0f8882775cd9a60b221103ee7d6a89e10eb5a892d877c398df0da7140704/pydantic-1.10.22-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6cf06d8d40993e79af0ab2102ef5da77b9ddba51248e4cb27f9f3f591fbb096e", size = 2994027, upload-time = "2025-04-24T13:37:28.683Z" }, + { url = "https://files.pythonhosted.org/packages/e7/a3/f20fdecbaa2a2721a6a8ee9e4f344d1f72bd7d56e679371c3f2be15eb8c8/pydantic-1.10.22-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:184b7865b171a6057ad97f4a17fbac81cec29bd103e996e7add3d16b0d95f609", size = 3036716, upload-time = "2025-04-24T13:37:30.547Z" }, + { url = "https://files.pythonhosted.org/packages/1f/83/dab34436d830c38706685acc77219fc2a209fea2a2301a1b05a2865b28bf/pydantic-1.10.22-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:923ad861677ab09d89be35d36111156063a7ebb44322cdb7b49266e1adaba4bb", size = 3171801, upload-time = "2025-04-24T13:37:32.474Z" }, + { url = "https://files.pythonhosted.org/packages/1e/6e/b64deccb8a7304d584088972437ea3091e9d99d27a8e7bf2bd08e29ae84e/pydantic-1.10.22-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:82d9a3da1686443fb854c8d2ab9a473251f8f4cdd11b125522efb4d7c646e7bc", size = 3123560, upload-time = "2025-04-24T13:37:34.855Z" }, + { url = "https://files.pythonhosted.org/packages/08/9a/90d1ab704329a7ae8666354be84b5327d655764003974364767c9d307d3a/pydantic-1.10.22-cp312-cp312-win_amd64.whl", hash = "sha256:1612604929af4c602694a7f3338b18039d402eb5ddfbf0db44f1ebfaf07f93e7", size = 2191378, upload-time = "2025-04-24T13:37:36.649Z" }, + { url = "https://files.pythonhosted.org/packages/47/8f/67befe3607b342dd6eb80237134ebcc6e8db42138609306eaf2b30e1f273/pydantic-1.10.22-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:b259dc89c9abcd24bf42f31951fb46c62e904ccf4316393f317abeeecda39978", size = 2797042, upload-time = "2025-04-24T13:37:38.753Z" }, + { url = "https://files.pythonhosted.org/packages/aa/91/bfde7d301f8e1c4cff949b3f1eb2c9b27bdd4b2368da0fe88e7350bbe4bc/pydantic-1.10.22-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9238aa0964d80c0908d2f385e981add58faead4412ca80ef0fa352094c24e46d", size = 2538572, upload-time = "2025-04-24T13:37:41.653Z" }, + { url = "https://files.pythonhosted.org/packages/d7/ce/1b0097ece420354df77d2f01c72278fb43770c8ed732d6b7a303c0c70875/pydantic-1.10.22-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f8029f05b04080e3f1a550575a1bca747c0ea4be48e2d551473d47fd768fc1b", size = 2986271, upload-time = "2025-04-24T13:37:43.551Z" }, + { url = "https://files.pythonhosted.org/packages/eb/4c/e257edfd5a0025a428aee7a2835e21b51c76a6b1c8994bcccb14d5721eea/pydantic-1.10.22-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5c06918894f119e0431a36c9393bc7cceeb34d1feeb66670ef9b9ca48c073937", size = 3015617, upload-time = "2025-04-24T13:37:45.466Z" }, + { url = "https://files.pythonhosted.org/packages/00/17/ecf46ff31fd62d382424a07ed60540d4479094204bebeebb6dea597e88c3/pydantic-1.10.22-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:e205311649622ee8fc1ec9089bd2076823797f5cd2c1e3182dc0e12aab835b35", size = 3164222, upload-time = "2025-04-24T13:37:47.35Z" }, + { url = "https://files.pythonhosted.org/packages/1a/47/2d55ec452c9a87347234bbbc70df268e1f081154b1851f0db89638558a1c/pydantic-1.10.22-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:815f0a73d5688d6dd0796a7edb9eca7071bfef961a7b33f91e618822ae7345b7", size = 3117572, upload-time = "2025-04-24T13:37:49.339Z" }, + { url = "https://files.pythonhosted.org/packages/03/2f/30359a36245b029bec7e442dd780fc242c66e66ad7dd5b50af2dcfd41ff3/pydantic-1.10.22-cp313-cp313-win_amd64.whl", hash = "sha256:9dfce71d42a5cde10e78a469e3d986f656afc245ab1b97c7106036f088dd91f8", size = 2174666, upload-time = "2025-04-24T13:37:51.114Z" }, + { url = "https://files.pythonhosted.org/packages/01/6f/9658e94018bc7c4e71863fb0f1ea8d30f8b3439e17df7aa710b2bb72dbca/pydantic-1.10.22-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ec54c89b2568b258bb30d7348ac4d82bec1b58b377fb56a00441e2ac66b24587", size = 2854460, upload-time = "2025-04-24T13:38:23.753Z" }, + { url = "https://files.pythonhosted.org/packages/b8/b3/5184ec7d3423a37c193ffaeced03921f4c34d226f3c6852653784f37d38b/pydantic-1.10.22-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:d8f1d1a1532e4f3bcab4e34e8d2197a7def4b67072acd26cfa60e92d75803a48", size = 2587418, upload-time = "2025-04-24T13:38:26.449Z" }, + { url = "https://files.pythonhosted.org/packages/90/25/27d769c5dc7491df5faebfc49a26f83ca2e070a9a788c67fde4c4e51d68b/pydantic-1.10.22-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8ad83ca35508c27eae1005b6b61f369f78aae6d27ead2135ec156a2599910121", size = 3331289, upload-time = "2025-04-24T13:38:29.262Z" }, + { url = "https://files.pythonhosted.org/packages/ed/18/7abe334d3d4de02ef2bbcc079a5782c53b868572b8d74aef2927d4f5b125/pydantic-1.10.22-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:53cdb44b78c420f570ff16b071ea8cd5a477635c6b0efc343c8a91e3029bbf1a", size = 3361613, upload-time = "2025-04-24T13:38:31.575Z" }, + { url = "https://files.pythonhosted.org/packages/68/95/6e649d14718969582ed35d1d70cb24a1ee825c65bec51e3275849d5aab8a/pydantic-1.10.22-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:16d0a5ae9d98264186ce31acdd7686ec05fd331fab9d68ed777d5cb2d1514e5e", size = 3520268, upload-time = "2025-04-24T13:38:33.835Z" }, + { url = "https://files.pythonhosted.org/packages/e9/87/eb3408e1c040a6d9f703e089d26a723d6c41f23a192e86bd7584d037d576/pydantic-1.10.22-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:8aee040e25843f036192b1a1af62117504a209a043aa8db12e190bb86ad7e611", size = 3483434, upload-time = "2025-04-24T13:38:36.078Z" }, + { url = "https://files.pythonhosted.org/packages/a8/13/ec2e52439137768d1bb0d4955b890f788c23f4aab2cfe9eef9e2b55584de/pydantic-1.10.22-cp39-cp39-win_amd64.whl", hash = "sha256:7f691eec68dbbfca497d3c11b92a3e5987393174cbedf03ec7a4184c35c2def6", size = 2301586, upload-time = "2025-04-24T13:38:39.351Z" }, + { url = "https://files.pythonhosted.org/packages/e9/e0/1ed151a56869be1588ad2d8cda9f8c1d95b16f74f09a7cea879ca9b63a8b/pydantic-1.10.22-py3-none-any.whl", hash = "sha256:343037d608bcbd34df937ac259708bfc83664dadf88afe8516c4f282d7d471a9", size = 166503, upload-time = "2025-04-24T13:38:41.374Z" }, ] [[package]] name = "pydantic" -version = "2.11.9" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.9'", -] -dependencies = [ - { name = "annotated-types", marker = "(python_full_version >= '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "pydantic-core", version = "2.33.2", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "typing-extensions", marker = "(python_full_version >= '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "typing-inspection", marker = "(python_full_version >= '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/ff/5d/09a551ba512d7ca404d785072700d3f6727a02f6f3c24ecfd081c7cf0aa8/pydantic-2.11.9.tar.gz", hash = "sha256:6b8ffda597a14812a7975c90b82a8a2e777d9257aba3453f973acd3c032a18e2", size = 788495, upload-time = "2025-09-13T11:26:39.325Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/3e/d3/108f2006987c58e76691d5ae5d200dd3e0f532cb4e5fa3560751c3a1feba/pydantic-2.11.9-py3-none-any.whl", hash = "sha256:c42dd626f5cfc1c6950ce6205ea58c93efa406da65f479dcb4029d5934857da2", size = 444855, upload-time = "2025-09-13T11:26:36.909Z" }, -] - -[[package]] -name = "pydantic-core" -version = "2.27.2" +version = "2.10.3" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version < '3.9'", -] dependencies = [ - { name = "typing-extensions", marker = "(python_full_version < '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "annotated-types" }, + { name = "pydantic-core" }, + { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/fc/01/f3e5ac5e7c25833db5eb555f7b7ab24cd6f8c322d3a3ad2d67a952dc0abc/pydantic_core-2.27.2.tar.gz", hash = "sha256:eb026e5a4c1fee05726072337ff51d1efb6f59090b7da90d30ea58625b1ffb39", size = 413443, upload-time = "2024-12-18T11:31:54.917Z" } +sdist = { url = "https://files.pythonhosted.org/packages/45/0f/27908242621b14e649a84e62b133de45f84c255eecb350ab02979844a788/pydantic-2.10.3.tar.gz", hash = "sha256:cb5ac360ce894ceacd69c403187900a02c4b20b693a9dd1d643e1effab9eadf9", size = 786486, upload-time = "2024-12-03T15:59:02.347Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/3a/bc/fed5f74b5d802cf9a03e83f60f18864e90e3aed7223adaca5ffb7a8d8d64/pydantic_core-2.27.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2d367ca20b2f14095a8f4fa1210f5a7b78b8a20009ecced6b12818f455b1e9fa", size = 1895938, upload-time = "2024-12-18T11:27:14.406Z" }, - { url = "https://files.pythonhosted.org/packages/71/2a/185aff24ce844e39abb8dd680f4e959f0006944f4a8a0ea372d9f9ae2e53/pydantic_core-2.27.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:491a2b73db93fab69731eaee494f320faa4e093dbed776be1a829c2eb222c34c", size = 1815684, upload-time = "2024-12-18T11:27:16.489Z" }, - { url = "https://files.pythonhosted.org/packages/c3/43/fafabd3d94d159d4f1ed62e383e264f146a17dd4d48453319fd782e7979e/pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7969e133a6f183be60e9f6f56bfae753585680f3b7307a8e555a948d443cc05a", size = 1829169, upload-time = "2024-12-18T11:27:22.16Z" }, - { url = "https://files.pythonhosted.org/packages/a2/d1/f2dfe1a2a637ce6800b799aa086d079998959f6f1215eb4497966efd2274/pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3de9961f2a346257caf0aa508a4da705467f53778e9ef6fe744c038119737ef5", size = 1867227, upload-time = "2024-12-18T11:27:25.097Z" }, - { url = "https://files.pythonhosted.org/packages/7d/39/e06fcbcc1c785daa3160ccf6c1c38fea31f5754b756e34b65f74e99780b5/pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e2bb4d3e5873c37bb3dd58714d4cd0b0e6238cebc4177ac8fe878f8b3aa8e74c", size = 2037695, upload-time = "2024-12-18T11:27:28.656Z" }, - { url = "https://files.pythonhosted.org/packages/7a/67/61291ee98e07f0650eb756d44998214231f50751ba7e13f4f325d95249ab/pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:280d219beebb0752699480fe8f1dc61ab6615c2046d76b7ab7ee38858de0a4e7", size = 2741662, upload-time = "2024-12-18T11:27:30.798Z" }, - { url = "https://files.pythonhosted.org/packages/32/90/3b15e31b88ca39e9e626630b4c4a1f5a0dfd09076366f4219429e6786076/pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47956ae78b6422cbd46f772f1746799cbb862de838fd8d1fbd34a82e05b0983a", size = 1993370, upload-time = "2024-12-18T11:27:33.692Z" }, - { url = "https://files.pythonhosted.org/packages/ff/83/c06d333ee3a67e2e13e07794995c1535565132940715931c1c43bfc85b11/pydantic_core-2.27.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:14d4a5c49d2f009d62a2a7140d3064f686d17a5d1a268bc641954ba181880236", size = 1996813, upload-time = "2024-12-18T11:27:37.111Z" }, - { url = "https://files.pythonhosted.org/packages/7c/f7/89be1c8deb6e22618a74f0ca0d933fdcb8baa254753b26b25ad3acff8f74/pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:337b443af21d488716f8d0b6164de833e788aa6bd7e3a39c005febc1284f4962", size = 2005287, upload-time = "2024-12-18T11:27:40.566Z" }, - { url = "https://files.pythonhosted.org/packages/b7/7d/8eb3e23206c00ef7feee17b83a4ffa0a623eb1a9d382e56e4aa46fd15ff2/pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:03d0f86ea3184a12f41a2d23f7ccb79cdb5a18e06993f8a45baa8dfec746f0e9", size = 2128414, upload-time = "2024-12-18T11:27:43.757Z" }, - { url = "https://files.pythonhosted.org/packages/4e/99/fe80f3ff8dd71a3ea15763878d464476e6cb0a2db95ff1c5c554133b6b83/pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7041c36f5680c6e0f08d922aed302e98b3745d97fe1589db0a3eebf6624523af", size = 2155301, upload-time = "2024-12-18T11:27:47.36Z" }, - { url = "https://files.pythonhosted.org/packages/2b/a3/e50460b9a5789ca1451b70d4f52546fa9e2b420ba3bfa6100105c0559238/pydantic_core-2.27.2-cp310-cp310-win32.whl", hash = "sha256:50a68f3e3819077be2c98110c1f9dcb3817e93f267ba80a2c05bb4f8799e2ff4", size = 1816685, upload-time = "2024-12-18T11:27:50.508Z" }, - { url = "https://files.pythonhosted.org/packages/57/4c/a8838731cb0f2c2a39d3535376466de6049034d7b239c0202a64aaa05533/pydantic_core-2.27.2-cp310-cp310-win_amd64.whl", hash = "sha256:e0fd26b16394ead34a424eecf8a31a1f5137094cabe84a1bcb10fa6ba39d3d31", size = 1982876, upload-time = "2024-12-18T11:27:53.54Z" }, - { url = "https://files.pythonhosted.org/packages/c2/89/f3450af9d09d44eea1f2c369f49e8f181d742f28220f88cc4dfaae91ea6e/pydantic_core-2.27.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:8e10c99ef58cfdf2a66fc15d66b16c4a04f62bca39db589ae8cba08bc55331bc", size = 1893421, upload-time = "2024-12-18T11:27:55.409Z" }, - { url = "https://files.pythonhosted.org/packages/9e/e3/71fe85af2021f3f386da42d291412e5baf6ce7716bd7101ea49c810eda90/pydantic_core-2.27.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:26f32e0adf166a84d0cb63be85c562ca8a6fa8de28e5f0d92250c6b7e9e2aff7", size = 1814998, upload-time = "2024-12-18T11:27:57.252Z" }, - { url = "https://files.pythonhosted.org/packages/a6/3c/724039e0d848fd69dbf5806894e26479577316c6f0f112bacaf67aa889ac/pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c19d1ea0673cd13cc2f872f6c9ab42acc4e4f492a7ca9d3795ce2b112dd7e15", size = 1826167, upload-time = "2024-12-18T11:27:59.146Z" }, - { url = "https://files.pythonhosted.org/packages/2b/5b/1b29e8c1fb5f3199a9a57c1452004ff39f494bbe9bdbe9a81e18172e40d3/pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5e68c4446fe0810e959cdff46ab0a41ce2f2c86d227d96dc3847af0ba7def306", size = 1865071, upload-time = "2024-12-18T11:28:02.625Z" }, - { url = "https://files.pythonhosted.org/packages/89/6c/3985203863d76bb7d7266e36970d7e3b6385148c18a68cc8915fd8c84d57/pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d9640b0059ff4f14d1f37321b94061c6db164fbe49b334b31643e0528d100d99", size = 2036244, upload-time = "2024-12-18T11:28:04.442Z" }, - { url = "https://files.pythonhosted.org/packages/0e/41/f15316858a246b5d723f7d7f599f79e37493b2e84bfc789e58d88c209f8a/pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:40d02e7d45c9f8af700f3452f329ead92da4c5f4317ca9b896de7ce7199ea459", size = 2737470, upload-time = "2024-12-18T11:28:07.679Z" }, - { url = "https://files.pythonhosted.org/packages/a8/7c/b860618c25678bbd6d1d99dbdfdf0510ccb50790099b963ff78a124b754f/pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1c1fd185014191700554795c99b347d64f2bb637966c4cfc16998a0ca700d048", size = 1992291, upload-time = "2024-12-18T11:28:10.297Z" }, - { url = "https://files.pythonhosted.org/packages/bf/73/42c3742a391eccbeab39f15213ecda3104ae8682ba3c0c28069fbcb8c10d/pydantic_core-2.27.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d81d2068e1c1228a565af076598f9e7451712700b673de8f502f0334f281387d", size = 1994613, upload-time = "2024-12-18T11:28:13.362Z" }, - { url = "https://files.pythonhosted.org/packages/94/7a/941e89096d1175d56f59340f3a8ebaf20762fef222c298ea96d36a6328c5/pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1a4207639fb02ec2dbb76227d7c751a20b1a6b4bc52850568e52260cae64ca3b", size = 2002355, upload-time = "2024-12-18T11:28:16.587Z" }, - { url = "https://files.pythonhosted.org/packages/6e/95/2359937a73d49e336a5a19848713555605d4d8d6940c3ec6c6c0ca4dcf25/pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:3de3ce3c9ddc8bbd88f6e0e304dea0e66d843ec9de1b0042b0911c1663ffd474", size = 2126661, upload-time = "2024-12-18T11:28:18.407Z" }, - { url = "https://files.pythonhosted.org/packages/2b/4c/ca02b7bdb6012a1adef21a50625b14f43ed4d11f1fc237f9d7490aa5078c/pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:30c5f68ded0c36466acede341551106821043e9afaad516adfb6e8fa80a4e6a6", size = 2153261, upload-time = "2024-12-18T11:28:21.471Z" }, - { url = "https://files.pythonhosted.org/packages/72/9d/a241db83f973049a1092a079272ffe2e3e82e98561ef6214ab53fe53b1c7/pydantic_core-2.27.2-cp311-cp311-win32.whl", hash = "sha256:c70c26d2c99f78b125a3459f8afe1aed4d9687c24fd677c6a4436bc042e50d6c", size = 1812361, upload-time = "2024-12-18T11:28:23.53Z" }, - { url = "https://files.pythonhosted.org/packages/e8/ef/013f07248041b74abd48a385e2110aa3a9bbfef0fbd97d4e6d07d2f5b89a/pydantic_core-2.27.2-cp311-cp311-win_amd64.whl", hash = "sha256:08e125dbdc505fa69ca7d9c499639ab6407cfa909214d500897d02afb816e7cc", size = 1982484, upload-time = "2024-12-18T11:28:25.391Z" }, - { url = "https://files.pythonhosted.org/packages/10/1c/16b3a3e3398fd29dca77cea0a1d998d6bde3902fa2706985191e2313cc76/pydantic_core-2.27.2-cp311-cp311-win_arm64.whl", hash = "sha256:26f0d68d4b235a2bae0c3fc585c585b4ecc51382db0e3ba402a22cbc440915e4", size = 1867102, upload-time = "2024-12-18T11:28:28.593Z" }, - { url = "https://files.pythonhosted.org/packages/d6/74/51c8a5482ca447871c93e142d9d4a92ead74de6c8dc5e66733e22c9bba89/pydantic_core-2.27.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9e0c8cfefa0ef83b4da9588448b6d8d2a2bf1a53c3f1ae5fca39eb3061e2f0b0", size = 1893127, upload-time = "2024-12-18T11:28:30.346Z" }, - { url = "https://files.pythonhosted.org/packages/d3/f3/c97e80721735868313c58b89d2de85fa80fe8dfeeed84dc51598b92a135e/pydantic_core-2.27.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:83097677b8e3bd7eaa6775720ec8e0405f1575015a463285a92bfdfe254529ef", size = 1811340, upload-time = "2024-12-18T11:28:32.521Z" }, - { url = "https://files.pythonhosted.org/packages/9e/91/840ec1375e686dbae1bd80a9e46c26a1e0083e1186abc610efa3d9a36180/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:172fce187655fece0c90d90a678424b013f8fbb0ca8b036ac266749c09438cb7", size = 1822900, upload-time = "2024-12-18T11:28:34.507Z" }, - { url = "https://files.pythonhosted.org/packages/f6/31/4240bc96025035500c18adc149aa6ffdf1a0062a4b525c932065ceb4d868/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:519f29f5213271eeeeb3093f662ba2fd512b91c5f188f3bb7b27bc5973816934", size = 1869177, upload-time = "2024-12-18T11:28:36.488Z" }, - { url = "https://files.pythonhosted.org/packages/fa/20/02fbaadb7808be578317015c462655c317a77a7c8f0ef274bc016a784c54/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05e3a55d124407fffba0dd6b0c0cd056d10e983ceb4e5dbd10dda135c31071d6", size = 2038046, upload-time = "2024-12-18T11:28:39.409Z" }, - { url = "https://files.pythonhosted.org/packages/06/86/7f306b904e6c9eccf0668248b3f272090e49c275bc488a7b88b0823444a4/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c3ed807c7b91de05e63930188f19e921d1fe90de6b4f5cd43ee7fcc3525cb8c", size = 2685386, upload-time = "2024-12-18T11:28:41.221Z" }, - { url = "https://files.pythonhosted.org/packages/8d/f0/49129b27c43396581a635d8710dae54a791b17dfc50c70164866bbf865e3/pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fb4aadc0b9a0c063206846d603b92030eb6f03069151a625667f982887153e2", size = 1997060, upload-time = "2024-12-18T11:28:44.709Z" }, - { url = "https://files.pythonhosted.org/packages/0d/0f/943b4af7cd416c477fd40b187036c4f89b416a33d3cc0ab7b82708a667aa/pydantic_core-2.27.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:28ccb213807e037460326424ceb8b5245acb88f32f3d2777427476e1b32c48c4", size = 2004870, upload-time = "2024-12-18T11:28:46.839Z" }, - { url = "https://files.pythonhosted.org/packages/35/40/aea70b5b1a63911c53a4c8117c0a828d6790483f858041f47bab0b779f44/pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:de3cd1899e2c279b140adde9357c4495ed9d47131b4a4eaff9052f23398076b3", size = 1999822, upload-time = "2024-12-18T11:28:48.896Z" }, - { url = "https://files.pythonhosted.org/packages/f2/b3/807b94fd337d58effc5498fd1a7a4d9d59af4133e83e32ae39a96fddec9d/pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:220f892729375e2d736b97d0e51466252ad84c51857d4d15f5e9692f9ef12be4", size = 2130364, upload-time = "2024-12-18T11:28:50.755Z" }, - { url = "https://files.pythonhosted.org/packages/fc/df/791c827cd4ee6efd59248dca9369fb35e80a9484462c33c6649a8d02b565/pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a0fcd29cd6b4e74fe8ddd2c90330fd8edf2e30cb52acda47f06dd615ae72da57", size = 2158303, upload-time = "2024-12-18T11:28:54.122Z" }, - { url = "https://files.pythonhosted.org/packages/9b/67/4e197c300976af185b7cef4c02203e175fb127e414125916bf1128b639a9/pydantic_core-2.27.2-cp312-cp312-win32.whl", hash = "sha256:1e2cb691ed9834cd6a8be61228471d0a503731abfb42f82458ff27be7b2186fc", size = 1834064, upload-time = "2024-12-18T11:28:56.074Z" }, - { url = "https://files.pythonhosted.org/packages/1f/ea/cd7209a889163b8dcca139fe32b9687dd05249161a3edda62860430457a5/pydantic_core-2.27.2-cp312-cp312-win_amd64.whl", hash = "sha256:cc3f1a99a4f4f9dd1de4fe0312c114e740b5ddead65bb4102884b384c15d8bc9", size = 1989046, upload-time = "2024-12-18T11:28:58.107Z" }, - { url = "https://files.pythonhosted.org/packages/bc/49/c54baab2f4658c26ac633d798dab66b4c3a9bbf47cff5284e9c182f4137a/pydantic_core-2.27.2-cp312-cp312-win_arm64.whl", hash = "sha256:3911ac9284cd8a1792d3cb26a2da18f3ca26c6908cc434a18f730dc0db7bfa3b", size = 1885092, upload-time = "2024-12-18T11:29:01.335Z" }, - { url = "https://files.pythonhosted.org/packages/41/b1/9bc383f48f8002f99104e3acff6cba1231b29ef76cfa45d1506a5cad1f84/pydantic_core-2.27.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7d14bd329640e63852364c306f4d23eb744e0f8193148d4044dd3dacdaacbd8b", size = 1892709, upload-time = "2024-12-18T11:29:03.193Z" }, - { url = "https://files.pythonhosted.org/packages/10/6c/e62b8657b834f3eb2961b49ec8e301eb99946245e70bf42c8817350cbefc/pydantic_core-2.27.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:82f91663004eb8ed30ff478d77c4d1179b3563df6cdb15c0817cd1cdaf34d154", size = 1811273, upload-time = "2024-12-18T11:29:05.306Z" }, - { url = "https://files.pythonhosted.org/packages/ba/15/52cfe49c8c986e081b863b102d6b859d9defc63446b642ccbbb3742bf371/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:71b24c7d61131bb83df10cc7e687433609963a944ccf45190cfc21e0887b08c9", size = 1823027, upload-time = "2024-12-18T11:29:07.294Z" }, - { url = "https://files.pythonhosted.org/packages/b1/1c/b6f402cfc18ec0024120602bdbcebc7bdd5b856528c013bd4d13865ca473/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fa8e459d4954f608fa26116118bb67f56b93b209c39b008277ace29937453dc9", size = 1868888, upload-time = "2024-12-18T11:29:09.249Z" }, - { url = "https://files.pythonhosted.org/packages/bd/7b/8cb75b66ac37bc2975a3b7de99f3c6f355fcc4d89820b61dffa8f1e81677/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce8918cbebc8da707ba805b7fd0b382816858728ae7fe19a942080c24e5b7cd1", size = 2037738, upload-time = "2024-12-18T11:29:11.23Z" }, - { url = "https://files.pythonhosted.org/packages/c8/f1/786d8fe78970a06f61df22cba58e365ce304bf9b9f46cc71c8c424e0c334/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:eda3f5c2a021bbc5d976107bb302e0131351c2ba54343f8a496dc8783d3d3a6a", size = 2685138, upload-time = "2024-12-18T11:29:16.396Z" }, - { url = "https://files.pythonhosted.org/packages/a6/74/d12b2cd841d8724dc8ffb13fc5cef86566a53ed358103150209ecd5d1999/pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd8086fa684c4775c27f03f062cbb9eaa6e17f064307e86b21b9e0abc9c0f02e", size = 1997025, upload-time = "2024-12-18T11:29:20.25Z" }, - { url = "https://files.pythonhosted.org/packages/a0/6e/940bcd631bc4d9a06c9539b51f070b66e8f370ed0933f392db6ff350d873/pydantic_core-2.27.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8d9b3388db186ba0c099a6d20f0604a44eabdeef1777ddd94786cdae158729e4", size = 2004633, upload-time = "2024-12-18T11:29:23.877Z" }, - { url = "https://files.pythonhosted.org/packages/50/cc/a46b34f1708d82498c227d5d80ce615b2dd502ddcfd8376fc14a36655af1/pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7a66efda2387de898c8f38c0cf7f14fca0b51a8ef0b24bfea5849f1b3c95af27", size = 1999404, upload-time = "2024-12-18T11:29:25.872Z" }, - { url = "https://files.pythonhosted.org/packages/ca/2d/c365cfa930ed23bc58c41463bae347d1005537dc8db79e998af8ba28d35e/pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:18a101c168e4e092ab40dbc2503bdc0f62010e95d292b27827871dc85450d7ee", size = 2130130, upload-time = "2024-12-18T11:29:29.252Z" }, - { url = "https://files.pythonhosted.org/packages/f4/d7/eb64d015c350b7cdb371145b54d96c919d4db516817f31cd1c650cae3b21/pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ba5dd002f88b78a4215ed2f8ddbdf85e8513382820ba15ad5ad8955ce0ca19a1", size = 2157946, upload-time = "2024-12-18T11:29:31.338Z" }, - { url = "https://files.pythonhosted.org/packages/a4/99/bddde3ddde76c03b65dfd5a66ab436c4e58ffc42927d4ff1198ffbf96f5f/pydantic_core-2.27.2-cp313-cp313-win32.whl", hash = "sha256:1ebaf1d0481914d004a573394f4be3a7616334be70261007e47c2a6fe7e50130", size = 1834387, upload-time = "2024-12-18T11:29:33.481Z" }, - { url = "https://files.pythonhosted.org/packages/71/47/82b5e846e01b26ac6f1893d3c5f9f3a2eb6ba79be26eef0b759b4fe72946/pydantic_core-2.27.2-cp313-cp313-win_amd64.whl", hash = "sha256:953101387ecf2f5652883208769a79e48db18c6df442568a0b5ccd8c2723abee", size = 1990453, upload-time = "2024-12-18T11:29:35.533Z" }, - { url = "https://files.pythonhosted.org/packages/51/b2/b2b50d5ecf21acf870190ae5d093602d95f66c9c31f9d5de6062eb329ad1/pydantic_core-2.27.2-cp313-cp313-win_arm64.whl", hash = "sha256:ac4dbfd1691affb8f48c2c13241a2e3b60ff23247cbcf981759c768b6633cf8b", size = 1885186, upload-time = "2024-12-18T11:29:37.649Z" }, - { url = "https://files.pythonhosted.org/packages/43/53/13e9917fc69c0a4aea06fd63ed6a8d6cda9cf140ca9584d49c1650b0ef5e/pydantic_core-2.27.2-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d3e8d504bdd3f10835468f29008d72fc8359d95c9c415ce6e767203db6127506", size = 1899595, upload-time = "2024-12-18T11:29:40.887Z" }, - { url = "https://files.pythonhosted.org/packages/f4/20/26c549249769ed84877f862f7bb93f89a6ee08b4bee1ed8781616b7fbb5e/pydantic_core-2.27.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:521eb9b7f036c9b6187f0b47318ab0d7ca14bd87f776240b90b21c1f4f149320", size = 1775010, upload-time = "2024-12-18T11:29:44.823Z" }, - { url = "https://files.pythonhosted.org/packages/35/eb/8234e05452d92d2b102ffa1b56d801c3567e628fdc63f02080fdfc68fd5e/pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85210c4d99a0114f5a9481b44560d7d1e35e32cc5634c656bc48e590b669b145", size = 1830727, upload-time = "2024-12-18T11:29:46.904Z" }, - { url = "https://files.pythonhosted.org/packages/8f/df/59f915c8b929d5f61e5a46accf748a87110ba145156f9326d1a7d28912b2/pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d716e2e30c6f140d7560ef1538953a5cd1a87264c737643d481f2779fc247fe1", size = 1868393, upload-time = "2024-12-18T11:29:49.098Z" }, - { url = "https://files.pythonhosted.org/packages/d5/52/81cf4071dca654d485c277c581db368b0c95b2b883f4d7b736ab54f72ddf/pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f66d89ba397d92f840f8654756196d93804278457b5fbede59598a1f9f90b228", size = 2040300, upload-time = "2024-12-18T11:29:51.43Z" }, - { url = "https://files.pythonhosted.org/packages/9c/00/05197ce1614f5c08d7a06e1d39d5d8e704dc81971b2719af134b844e2eaf/pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:669e193c1c576a58f132e3158f9dfa9662969edb1a250c54d8fa52590045f046", size = 2738785, upload-time = "2024-12-18T11:29:55.001Z" }, - { url = "https://files.pythonhosted.org/packages/f7/a3/5f19bc495793546825ab160e530330c2afcee2281c02b5ffafd0b32ac05e/pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdbe7629b996647b99c01b37f11170a57ae675375b14b8c13b8518b8320ced5", size = 1996493, upload-time = "2024-12-18T11:29:57.13Z" }, - { url = "https://files.pythonhosted.org/packages/ed/e8/e0102c2ec153dc3eed88aea03990e1b06cfbca532916b8a48173245afe60/pydantic_core-2.27.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d262606bf386a5ba0b0af3b97f37c83d7011439e3dc1a9298f21efb292e42f1a", size = 1998544, upload-time = "2024-12-18T11:30:00.681Z" }, - { url = "https://files.pythonhosted.org/packages/fb/a3/4be70845b555bd80aaee9f9812a7cf3df81550bce6dadb3cfee9c5d8421d/pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:cabb9bcb7e0d97f74df8646f34fc76fbf793b7f6dc2438517d7a9e50eee4f14d", size = 2007449, upload-time = "2024-12-18T11:30:02.985Z" }, - { url = "https://files.pythonhosted.org/packages/e3/9f/b779ed2480ba355c054e6d7ea77792467631d674b13d8257085a4bc7dcda/pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_armv7l.whl", hash = "sha256:d2d63f1215638d28221f664596b1ccb3944f6e25dd18cd3b86b0a4c408d5ebb9", size = 2129460, upload-time = "2024-12-18T11:30:06.55Z" }, - { url = "https://files.pythonhosted.org/packages/a0/f0/a6ab0681f6e95260c7fbf552874af7302f2ea37b459f9b7f00698f875492/pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:bca101c00bff0adb45a833f8451b9105d9df18accb8743b08107d7ada14bd7da", size = 2159609, upload-time = "2024-12-18T11:30:09.428Z" }, - { url = "https://files.pythonhosted.org/packages/8a/2b/e1059506795104349712fbca647b18b3f4a7fd541c099e6259717441e1e0/pydantic_core-2.27.2-cp38-cp38-win32.whl", hash = "sha256:f6f8e111843bbb0dee4cb6594cdc73e79b3329b526037ec242a3e49012495b3b", size = 1819886, upload-time = "2024-12-18T11:30:11.777Z" }, - { url = "https://files.pythonhosted.org/packages/aa/6d/df49c17f024dfc58db0bacc7b03610058018dd2ea2eaf748ccbada4c3d06/pydantic_core-2.27.2-cp38-cp38-win_amd64.whl", hash = "sha256:fd1aea04935a508f62e0d0ef1f5ae968774a32afc306fb8545e06f5ff5cdf3ad", size = 1980773, upload-time = "2024-12-18T11:30:14.828Z" }, - { url = "https://files.pythonhosted.org/packages/27/97/3aef1ddb65c5ccd6eda9050036c956ff6ecbfe66cb7eb40f280f121a5bb0/pydantic_core-2.27.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:c10eb4f1659290b523af58fa7cffb452a61ad6ae5613404519aee4bfbf1df993", size = 1896475, upload-time = "2024-12-18T11:30:18.316Z" }, - { url = "https://files.pythonhosted.org/packages/ad/d3/5668da70e373c9904ed2f372cb52c0b996426f302e0dee2e65634c92007d/pydantic_core-2.27.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ef592d4bad47296fb11f96cd7dc898b92e795032b4894dfb4076cfccd43a9308", size = 1772279, upload-time = "2024-12-18T11:30:20.547Z" }, - { url = "https://files.pythonhosted.org/packages/8a/9e/e44b8cb0edf04a2f0a1f6425a65ee089c1d6f9c4c2dcab0209127b6fdfc2/pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c61709a844acc6bf0b7dce7daae75195a10aac96a596ea1b776996414791ede4", size = 1829112, upload-time = "2024-12-18T11:30:23.255Z" }, - { url = "https://files.pythonhosted.org/packages/1c/90/1160d7ac700102effe11616e8119e268770f2a2aa5afb935f3ee6832987d/pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c5f762659e47fdb7b16956c71598292f60a03aa92f8b6351504359dbdba6cf", size = 1866780, upload-time = "2024-12-18T11:30:25.742Z" }, - { url = "https://files.pythonhosted.org/packages/ee/33/13983426df09a36d22c15980008f8d9c77674fc319351813b5a2739b70f3/pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4c9775e339e42e79ec99c441d9730fccf07414af63eac2f0e48e08fd38a64d76", size = 2037943, upload-time = "2024-12-18T11:30:28.036Z" }, - { url = "https://files.pythonhosted.org/packages/01/d7/ced164e376f6747e9158c89988c293cd524ab8d215ae4e185e9929655d5c/pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:57762139821c31847cfb2df63c12f725788bd9f04bc2fb392790959b8f70f118", size = 2740492, upload-time = "2024-12-18T11:30:30.412Z" }, - { url = "https://files.pythonhosted.org/packages/8b/1f/3dc6e769d5b7461040778816aab2b00422427bcaa4b56cc89e9c653b2605/pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d1e85068e818c73e048fe28cfc769040bb1f475524f4745a5dc621f75ac7630", size = 1995714, upload-time = "2024-12-18T11:30:34.358Z" }, - { url = "https://files.pythonhosted.org/packages/07/d7/a0bd09bc39283530b3f7c27033a814ef254ba3bd0b5cfd040b7abf1fe5da/pydantic_core-2.27.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:097830ed52fd9e427942ff3b9bc17fab52913b2f50f2880dc4a5611446606a54", size = 1997163, upload-time = "2024-12-18T11:30:37.979Z" }, - { url = "https://files.pythonhosted.org/packages/2d/bb/2db4ad1762e1c5699d9b857eeb41959191980de6feb054e70f93085e1bcd/pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:044a50963a614ecfae59bb1eaf7ea7efc4bc62f49ed594e18fa1e5d953c40e9f", size = 2005217, upload-time = "2024-12-18T11:30:40.367Z" }, - { url = "https://files.pythonhosted.org/packages/53/5f/23a5a3e7b8403f8dd8fc8a6f8b49f6b55c7d715b77dcf1f8ae919eeb5628/pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:4e0b4220ba5b40d727c7f879eac379b822eee5d8fff418e9d3381ee45b3b0362", size = 2127899, upload-time = "2024-12-18T11:30:42.737Z" }, - { url = "https://files.pythonhosted.org/packages/c2/ae/aa38bb8dd3d89c2f1d8362dd890ee8f3b967330821d03bbe08fa01ce3766/pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5e4f4bb20d75e9325cc9696c6802657b58bc1dbbe3022f32cc2b2b632c3fbb96", size = 2155726, upload-time = "2024-12-18T11:30:45.279Z" }, - { url = "https://files.pythonhosted.org/packages/98/61/4f784608cc9e98f70839187117ce840480f768fed5d386f924074bf6213c/pydantic_core-2.27.2-cp39-cp39-win32.whl", hash = "sha256:cca63613e90d001b9f2f9a9ceb276c308bfa2a43fafb75c8031c4f66039e8c6e", size = 1817219, upload-time = "2024-12-18T11:30:47.718Z" }, - { url = "https://files.pythonhosted.org/packages/57/82/bb16a68e4a1a858bb3768c2c8f1ff8d8978014e16598f001ea29a25bf1d1/pydantic_core-2.27.2-cp39-cp39-win_amd64.whl", hash = "sha256:77d1bca19b0f7021b3a982e6f903dcd5b2b06076def36a652e3907f596e29f67", size = 1985382, upload-time = "2024-12-18T11:30:51.871Z" }, - { url = "https://files.pythonhosted.org/packages/46/72/af70981a341500419e67d5cb45abe552a7c74b66326ac8877588488da1ac/pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:2bf14caea37e91198329b828eae1618c068dfb8ef17bb33287a7ad4b61ac314e", size = 1891159, upload-time = "2024-12-18T11:30:54.382Z" }, - { url = "https://files.pythonhosted.org/packages/ad/3d/c5913cccdef93e0a6a95c2d057d2c2cba347815c845cda79ddd3c0f5e17d/pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:b0cb791f5b45307caae8810c2023a184c74605ec3bcbb67d13846c28ff731ff8", size = 1768331, upload-time = "2024-12-18T11:30:58.178Z" }, - { url = "https://files.pythonhosted.org/packages/f6/f0/a3ae8fbee269e4934f14e2e0e00928f9346c5943174f2811193113e58252/pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:688d3fd9fcb71f41c4c015c023d12a79d1c4c0732ec9eb35d96e3388a120dcf3", size = 1822467, upload-time = "2024-12-18T11:31:00.6Z" }, - { url = "https://files.pythonhosted.org/packages/d7/7a/7bbf241a04e9f9ea24cd5874354a83526d639b02674648af3f350554276c/pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d591580c34f4d731592f0e9fe40f9cc1b430d297eecc70b962e93c5c668f15f", size = 1979797, upload-time = "2024-12-18T11:31:07.243Z" }, - { url = "https://files.pythonhosted.org/packages/4f/5f/4784c6107731f89e0005a92ecb8a2efeafdb55eb992b8e9d0a2be5199335/pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:82f986faf4e644ffc189a7f1aafc86e46ef70372bb153e7001e8afccc6e54133", size = 1987839, upload-time = "2024-12-18T11:31:09.775Z" }, - { url = "https://files.pythonhosted.org/packages/6d/a7/61246562b651dff00de86a5f01b6e4befb518df314c54dec187a78d81c84/pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:bec317a27290e2537f922639cafd54990551725fc844249e64c523301d0822fc", size = 1998861, upload-time = "2024-12-18T11:31:13.469Z" }, - { url = "https://files.pythonhosted.org/packages/86/aa/837821ecf0c022bbb74ca132e117c358321e72e7f9702d1b6a03758545e2/pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:0296abcb83a797db256b773f45773da397da75a08f5fcaef41f2044adec05f50", size = 2116582, upload-time = "2024-12-18T11:31:17.423Z" }, - { url = "https://files.pythonhosted.org/packages/81/b0/5e74656e95623cbaa0a6278d16cf15e10a51f6002e3ec126541e95c29ea3/pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:0d75070718e369e452075a6017fbf187f788e17ed67a3abd47fa934d001863d9", size = 2151985, upload-time = "2024-12-18T11:31:19.901Z" }, - { url = "https://files.pythonhosted.org/packages/63/37/3e32eeb2a451fddaa3898e2163746b0cffbbdbb4740d38372db0490d67f3/pydantic_core-2.27.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:7e17b560be3c98a8e3aa66ce828bdebb9e9ac6ad5466fba92eb74c4c95cb1151", size = 2004715, upload-time = "2024-12-18T11:31:22.821Z" }, - { url = "https://files.pythonhosted.org/packages/29/0e/dcaea00c9dbd0348b723cae82b0e0c122e0fa2b43fa933e1622fd237a3ee/pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:c33939a82924da9ed65dab5a65d427205a73181d8098e79b6b426bdf8ad4e656", size = 1891733, upload-time = "2024-12-18T11:31:26.876Z" }, - { url = "https://files.pythonhosted.org/packages/86/d3/e797bba8860ce650272bda6383a9d8cad1d1c9a75a640c9d0e848076f85e/pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:00bad2484fa6bda1e216e7345a798bd37c68fb2d97558edd584942aa41b7d278", size = 1768375, upload-time = "2024-12-18T11:31:29.276Z" }, - { url = "https://files.pythonhosted.org/packages/41/f7/f847b15fb14978ca2b30262548f5fc4872b2724e90f116393eb69008299d/pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c817e2b40aba42bac6f457498dacabc568c3b7a986fc9ba7c8d9d260b71485fb", size = 1822307, upload-time = "2024-12-18T11:31:33.123Z" }, - { url = "https://files.pythonhosted.org/packages/9c/63/ed80ec8255b587b2f108e514dc03eed1546cd00f0af281e699797f373f38/pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:251136cdad0cb722e93732cb45ca5299fb56e1344a833640bf93b2803f8d1bfd", size = 1979971, upload-time = "2024-12-18T11:31:35.755Z" }, - { url = "https://files.pythonhosted.org/packages/a9/6d/6d18308a45454a0de0e975d70171cadaf454bc7a0bf86b9c7688e313f0bb/pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d2088237af596f0a524d3afc39ab3b036e8adb054ee57cbb1dcf8e09da5b29cc", size = 1987616, upload-time = "2024-12-18T11:31:38.534Z" }, - { url = "https://files.pythonhosted.org/packages/82/8a/05f8780f2c1081b800a7ca54c1971e291c2d07d1a50fb23c7e4aef4ed403/pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d4041c0b966a84b4ae7a09832eb691a35aec90910cd2dbe7a208de59be77965b", size = 1998943, upload-time = "2024-12-18T11:31:41.853Z" }, - { url = "https://files.pythonhosted.org/packages/5e/3e/fe5b6613d9e4c0038434396b46c5303f5ade871166900b357ada4766c5b7/pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:8083d4e875ebe0b864ffef72a4304827015cff328a1be6e22cc850753bfb122b", size = 2116654, upload-time = "2024-12-18T11:31:44.756Z" }, - { url = "https://files.pythonhosted.org/packages/db/ad/28869f58938fad8cc84739c4e592989730bfb69b7c90a8fff138dff18e1e/pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f141ee28a0ad2123b6611b6ceff018039df17f32ada8b534e6aa039545a3efb2", size = 2152292, upload-time = "2024-12-18T11:31:48.613Z" }, - { url = "https://files.pythonhosted.org/packages/a1/0c/c5c5cd3689c32ed1fe8c5d234b079c12c281c051759770c05b8bed6412b5/pydantic_core-2.27.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7d0c8399fcc1848491f00e0314bd59fb34a9c008761bcb422a057670c3f65e35", size = 2004961, upload-time = "2024-12-18T11:31:52.446Z" }, + { url = "https://files.pythonhosted.org/packages/62/51/72c18c55cf2f46ff4f91ebcc8f75aa30f7305f3d726be3f4ebffb4ae972b/pydantic-2.10.3-py3-none-any.whl", hash = "sha256:be04d85bbc7b65651c5f8e6b9976ed9c6f41782a55524cef079a34a0bb82144d", size = 456997, upload-time = "2024-12-03T15:58:59.867Z" }, ] [[package]] name = "pydantic-core" -version = "2.33.2" +version = "2.27.1" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.9'", -] dependencies = [ - { name = "typing-extensions", marker = "(python_full_version >= '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/ad/88/5f2260bdfae97aabf98f1778d43f69574390ad787afb646292a638c923d4/pydantic_core-2.33.2.tar.gz", hash = "sha256:7cb8bc3605c29176e1b105350d2e6474142d7c1bd1d9327c4a9bdb46bf827acc", size = 435195, upload-time = "2025-04-23T18:33:52.104Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/e5/92/b31726561b5dae176c2d2c2dc43a9c5bfba5d32f96f8b4c0a600dd492447/pydantic_core-2.33.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2b3d326aaef0c0399d9afffeb6367d5e26ddc24d351dbc9c636840ac355dc5d8", size = 2028817, upload-time = "2025-04-23T18:30:43.919Z" }, - { url = "https://files.pythonhosted.org/packages/a3/44/3f0b95fafdaca04a483c4e685fe437c6891001bf3ce8b2fded82b9ea3aa1/pydantic_core-2.33.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0e5b2671f05ba48b94cb90ce55d8bdcaaedb8ba00cc5359f6810fc918713983d", size = 1861357, upload-time = "2025-04-23T18:30:46.372Z" }, - { url = "https://files.pythonhosted.org/packages/30/97/e8f13b55766234caae05372826e8e4b3b96e7b248be3157f53237682e43c/pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0069c9acc3f3981b9ff4cdfaf088e98d83440a4c7ea1bc07460af3d4dc22e72d", size = 1898011, upload-time = "2025-04-23T18:30:47.591Z" }, - { url = "https://files.pythonhosted.org/packages/9b/a3/99c48cf7bafc991cc3ee66fd544c0aae8dc907b752f1dad2d79b1b5a471f/pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d53b22f2032c42eaaf025f7c40c2e3b94568ae077a606f006d206a463bc69572", size = 1982730, upload-time = "2025-04-23T18:30:49.328Z" }, - { url = "https://files.pythonhosted.org/packages/de/8e/a5b882ec4307010a840fb8b58bd9bf65d1840c92eae7534c7441709bf54b/pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0405262705a123b7ce9f0b92f123334d67b70fd1f20a9372b907ce1080c7ba02", size = 2136178, upload-time = "2025-04-23T18:30:50.907Z" }, - { url = "https://files.pythonhosted.org/packages/e4/bb/71e35fc3ed05af6834e890edb75968e2802fe98778971ab5cba20a162315/pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4b25d91e288e2c4e0662b8038a28c6a07eaac3e196cfc4ff69de4ea3db992a1b", size = 2736462, upload-time = "2025-04-23T18:30:52.083Z" }, - { url = "https://files.pythonhosted.org/packages/31/0d/c8f7593e6bc7066289bbc366f2235701dcbebcd1ff0ef8e64f6f239fb47d/pydantic_core-2.33.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6bdfe4b3789761f3bcb4b1ddf33355a71079858958e3a552f16d5af19768fef2", size = 2005652, upload-time = "2025-04-23T18:30:53.389Z" }, - { url = "https://files.pythonhosted.org/packages/d2/7a/996d8bd75f3eda405e3dd219ff5ff0a283cd8e34add39d8ef9157e722867/pydantic_core-2.33.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:efec8db3266b76ef9607c2c4c419bdb06bf335ae433b80816089ea7585816f6a", size = 2113306, upload-time = "2025-04-23T18:30:54.661Z" }, - { url = "https://files.pythonhosted.org/packages/ff/84/daf2a6fb2db40ffda6578a7e8c5a6e9c8affb251a05c233ae37098118788/pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:031c57d67ca86902726e0fae2214ce6770bbe2f710dc33063187a68744a5ecac", size = 2073720, upload-time = "2025-04-23T18:30:56.11Z" }, - { url = "https://files.pythonhosted.org/packages/77/fb/2258da019f4825128445ae79456a5499c032b55849dbd5bed78c95ccf163/pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:f8de619080e944347f5f20de29a975c2d815d9ddd8be9b9b7268e2e3ef68605a", size = 2244915, upload-time = "2025-04-23T18:30:57.501Z" }, - { url = "https://files.pythonhosted.org/packages/d8/7a/925ff73756031289468326e355b6fa8316960d0d65f8b5d6b3a3e7866de7/pydantic_core-2.33.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:73662edf539e72a9440129f231ed3757faab89630d291b784ca99237fb94db2b", size = 2241884, upload-time = "2025-04-23T18:30:58.867Z" }, - { url = "https://files.pythonhosted.org/packages/0b/b0/249ee6d2646f1cdadcb813805fe76265745c4010cf20a8eba7b0e639d9b2/pydantic_core-2.33.2-cp310-cp310-win32.whl", hash = "sha256:0a39979dcbb70998b0e505fb1556a1d550a0781463ce84ebf915ba293ccb7e22", size = 1910496, upload-time = "2025-04-23T18:31:00.078Z" }, - { url = "https://files.pythonhosted.org/packages/66/ff/172ba8f12a42d4b552917aa65d1f2328990d3ccfc01d5b7c943ec084299f/pydantic_core-2.33.2-cp310-cp310-win_amd64.whl", hash = "sha256:b0379a2b24882fef529ec3b4987cb5d003b9cda32256024e6fe1586ac45fc640", size = 1955019, upload-time = "2025-04-23T18:31:01.335Z" }, - { url = "https://files.pythonhosted.org/packages/3f/8d/71db63483d518cbbf290261a1fc2839d17ff89fce7089e08cad07ccfce67/pydantic_core-2.33.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:4c5b0a576fb381edd6d27f0a85915c6daf2f8138dc5c267a57c08a62900758c7", size = 2028584, upload-time = "2025-04-23T18:31:03.106Z" }, - { url = "https://files.pythonhosted.org/packages/24/2f/3cfa7244ae292dd850989f328722d2aef313f74ffc471184dc509e1e4e5a/pydantic_core-2.33.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e799c050df38a639db758c617ec771fd8fb7a5f8eaaa4b27b101f266b216a246", size = 1855071, upload-time = "2025-04-23T18:31:04.621Z" }, - { url = "https://files.pythonhosted.org/packages/b3/d3/4ae42d33f5e3f50dd467761304be2fa0a9417fbf09735bc2cce003480f2a/pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dc46a01bf8d62f227d5ecee74178ffc448ff4e5197c756331f71efcc66dc980f", size = 1897823, upload-time = "2025-04-23T18:31:06.377Z" }, - { url = "https://files.pythonhosted.org/packages/f4/f3/aa5976e8352b7695ff808599794b1fba2a9ae2ee954a3426855935799488/pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a144d4f717285c6d9234a66778059f33a89096dfb9b39117663fd8413d582dcc", size = 1983792, upload-time = "2025-04-23T18:31:07.93Z" }, - { url = "https://files.pythonhosted.org/packages/d5/7a/cda9b5a23c552037717f2b2a5257e9b2bfe45e687386df9591eff7b46d28/pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:73cf6373c21bc80b2e0dc88444f41ae60b2f070ed02095754eb5a01df12256de", size = 2136338, upload-time = "2025-04-23T18:31:09.283Z" }, - { url = "https://files.pythonhosted.org/packages/2b/9f/b8f9ec8dd1417eb9da784e91e1667d58a2a4a7b7b34cf4af765ef663a7e5/pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3dc625f4aa79713512d1976fe9f0bc99f706a9dee21dfd1810b4bbbf228d0e8a", size = 2730998, upload-time = "2025-04-23T18:31:11.7Z" }, - { url = "https://files.pythonhosted.org/packages/47/bc/cd720e078576bdb8255d5032c5d63ee5c0bf4b7173dd955185a1d658c456/pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:881b21b5549499972441da4758d662aeea93f1923f953e9cbaff14b8b9565aef", size = 2003200, upload-time = "2025-04-23T18:31:13.536Z" }, - { url = "https://files.pythonhosted.org/packages/ca/22/3602b895ee2cd29d11a2b349372446ae9727c32e78a94b3d588a40fdf187/pydantic_core-2.33.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:bdc25f3681f7b78572699569514036afe3c243bc3059d3942624e936ec93450e", size = 2113890, upload-time = "2025-04-23T18:31:15.011Z" }, - { url = "https://files.pythonhosted.org/packages/ff/e6/e3c5908c03cf00d629eb38393a98fccc38ee0ce8ecce32f69fc7d7b558a7/pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:fe5b32187cbc0c862ee201ad66c30cf218e5ed468ec8dc1cf49dec66e160cc4d", size = 2073359, upload-time = "2025-04-23T18:31:16.393Z" }, - { url = "https://files.pythonhosted.org/packages/12/e7/6a36a07c59ebefc8777d1ffdaf5ae71b06b21952582e4b07eba88a421c79/pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:bc7aee6f634a6f4a95676fcb5d6559a2c2a390330098dba5e5a5f28a2e4ada30", size = 2245883, upload-time = "2025-04-23T18:31:17.892Z" }, - { url = "https://files.pythonhosted.org/packages/16/3f/59b3187aaa6cc0c1e6616e8045b284de2b6a87b027cce2ffcea073adf1d2/pydantic_core-2.33.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:235f45e5dbcccf6bd99f9f472858849f73d11120d76ea8707115415f8e5ebebf", size = 2241074, upload-time = "2025-04-23T18:31:19.205Z" }, - { url = "https://files.pythonhosted.org/packages/e0/ed/55532bb88f674d5d8f67ab121a2a13c385df382de2a1677f30ad385f7438/pydantic_core-2.33.2-cp311-cp311-win32.whl", hash = "sha256:6368900c2d3ef09b69cb0b913f9f8263b03786e5b2a387706c5afb66800efd51", size = 1910538, upload-time = "2025-04-23T18:31:20.541Z" }, - { url = "https://files.pythonhosted.org/packages/fe/1b/25b7cccd4519c0b23c2dd636ad39d381abf113085ce4f7bec2b0dc755eb1/pydantic_core-2.33.2-cp311-cp311-win_amd64.whl", hash = "sha256:1e063337ef9e9820c77acc768546325ebe04ee38b08703244c1309cccc4f1bab", size = 1952909, upload-time = "2025-04-23T18:31:22.371Z" }, - { url = "https://files.pythonhosted.org/packages/49/a9/d809358e49126438055884c4366a1f6227f0f84f635a9014e2deb9b9de54/pydantic_core-2.33.2-cp311-cp311-win_arm64.whl", hash = "sha256:6b99022f1d19bc32a4c2a0d544fc9a76e3be90f0b3f4af413f87d38749300e65", size = 1897786, upload-time = "2025-04-23T18:31:24.161Z" }, - { url = "https://files.pythonhosted.org/packages/18/8a/2b41c97f554ec8c71f2a8a5f85cb56a8b0956addfe8b0efb5b3d77e8bdc3/pydantic_core-2.33.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:a7ec89dc587667f22b6a0b6579c249fca9026ce7c333fc142ba42411fa243cdc", size = 2009000, upload-time = "2025-04-23T18:31:25.863Z" }, - { url = "https://files.pythonhosted.org/packages/a1/02/6224312aacb3c8ecbaa959897af57181fb6cf3a3d7917fd44d0f2917e6f2/pydantic_core-2.33.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:3c6db6e52c6d70aa0d00d45cdb9b40f0433b96380071ea80b09277dba021ddf7", size = 1847996, upload-time = "2025-04-23T18:31:27.341Z" }, - { url = "https://files.pythonhosted.org/packages/d6/46/6dcdf084a523dbe0a0be59d054734b86a981726f221f4562aed313dbcb49/pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e61206137cbc65e6d5256e1166f88331d3b6238e082d9f74613b9b765fb9025", size = 1880957, upload-time = "2025-04-23T18:31:28.956Z" }, - { url = "https://files.pythonhosted.org/packages/ec/6b/1ec2c03837ac00886ba8160ce041ce4e325b41d06a034adbef11339ae422/pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eb8c529b2819c37140eb51b914153063d27ed88e3bdc31b71198a198e921e011", size = 1964199, upload-time = "2025-04-23T18:31:31.025Z" }, - { url = "https://files.pythonhosted.org/packages/2d/1d/6bf34d6adb9debd9136bd197ca72642203ce9aaaa85cfcbfcf20f9696e83/pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c52b02ad8b4e2cf14ca7b3d918f3eb0ee91e63b3167c32591e57c4317e134f8f", size = 2120296, upload-time = "2025-04-23T18:31:32.514Z" }, - { url = "https://files.pythonhosted.org/packages/e0/94/2bd0aaf5a591e974b32a9f7123f16637776c304471a0ab33cf263cf5591a/pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:96081f1605125ba0855dfda83f6f3df5ec90c61195421ba72223de35ccfb2f88", size = 2676109, upload-time = "2025-04-23T18:31:33.958Z" }, - { url = "https://files.pythonhosted.org/packages/f9/41/4b043778cf9c4285d59742281a769eac371b9e47e35f98ad321349cc5d61/pydantic_core-2.33.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f57a69461af2a5fa6e6bbd7a5f60d3b7e6cebb687f55106933188e79ad155c1", size = 2002028, upload-time = "2025-04-23T18:31:39.095Z" }, - { url = "https://files.pythonhosted.org/packages/cb/d5/7bb781bf2748ce3d03af04d5c969fa1308880e1dca35a9bd94e1a96a922e/pydantic_core-2.33.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:572c7e6c8bb4774d2ac88929e3d1f12bc45714ae5ee6d9a788a9fb35e60bb04b", size = 2100044, upload-time = "2025-04-23T18:31:41.034Z" }, - { url = "https://files.pythonhosted.org/packages/fe/36/def5e53e1eb0ad896785702a5bbfd25eed546cdcf4087ad285021a90ed53/pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:db4b41f9bd95fbe5acd76d89920336ba96f03e149097365afe1cb092fceb89a1", size = 2058881, upload-time = "2025-04-23T18:31:42.757Z" }, - { url = "https://files.pythonhosted.org/packages/01/6c/57f8d70b2ee57fc3dc8b9610315949837fa8c11d86927b9bb044f8705419/pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:fa854f5cf7e33842a892e5c73f45327760bc7bc516339fda888c75ae60edaeb6", size = 2227034, upload-time = "2025-04-23T18:31:44.304Z" }, - { url = "https://files.pythonhosted.org/packages/27/b9/9c17f0396a82b3d5cbea4c24d742083422639e7bb1d5bf600e12cb176a13/pydantic_core-2.33.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:5f483cfb75ff703095c59e365360cb73e00185e01aaea067cd19acffd2ab20ea", size = 2234187, upload-time = "2025-04-23T18:31:45.891Z" }, - { url = "https://files.pythonhosted.org/packages/b0/6a/adf5734ffd52bf86d865093ad70b2ce543415e0e356f6cacabbc0d9ad910/pydantic_core-2.33.2-cp312-cp312-win32.whl", hash = "sha256:9cb1da0f5a471435a7bc7e439b8a728e8b61e59784b2af70d7c169f8dd8ae290", size = 1892628, upload-time = "2025-04-23T18:31:47.819Z" }, - { url = "https://files.pythonhosted.org/packages/43/e4/5479fecb3606c1368d496a825d8411e126133c41224c1e7238be58b87d7e/pydantic_core-2.33.2-cp312-cp312-win_amd64.whl", hash = "sha256:f941635f2a3d96b2973e867144fde513665c87f13fe0e193c158ac51bfaaa7b2", size = 1955866, upload-time = "2025-04-23T18:31:49.635Z" }, - { url = "https://files.pythonhosted.org/packages/0d/24/8b11e8b3e2be9dd82df4b11408a67c61bb4dc4f8e11b5b0fc888b38118b5/pydantic_core-2.33.2-cp312-cp312-win_arm64.whl", hash = "sha256:cca3868ddfaccfbc4bfb1d608e2ccaaebe0ae628e1416aeb9c4d88c001bb45ab", size = 1888894, upload-time = "2025-04-23T18:31:51.609Z" }, - { url = "https://files.pythonhosted.org/packages/46/8c/99040727b41f56616573a28771b1bfa08a3d3fe74d3d513f01251f79f172/pydantic_core-2.33.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:1082dd3e2d7109ad8b7da48e1d4710c8d06c253cbc4a27c1cff4fbcaa97a9e3f", size = 2015688, upload-time = "2025-04-23T18:31:53.175Z" }, - { url = "https://files.pythonhosted.org/packages/3a/cc/5999d1eb705a6cefc31f0b4a90e9f7fc400539b1a1030529700cc1b51838/pydantic_core-2.33.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f517ca031dfc037a9c07e748cefd8d96235088b83b4f4ba8939105d20fa1dcd6", size = 1844808, upload-time = "2025-04-23T18:31:54.79Z" }, - { url = "https://files.pythonhosted.org/packages/6f/5e/a0a7b8885c98889a18b6e376f344da1ef323d270b44edf8174d6bce4d622/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0a9f2c9dd19656823cb8250b0724ee9c60a82f3cdf68a080979d13092a3b0fef", size = 1885580, upload-time = "2025-04-23T18:31:57.393Z" }, - { url = "https://files.pythonhosted.org/packages/3b/2a/953581f343c7d11a304581156618c3f592435523dd9d79865903272c256a/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2b0a451c263b01acebe51895bfb0e1cc842a5c666efe06cdf13846c7418caa9a", size = 1973859, upload-time = "2025-04-23T18:31:59.065Z" }, - { url = "https://files.pythonhosted.org/packages/e6/55/f1a813904771c03a3f97f676c62cca0c0a4138654107c1b61f19c644868b/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ea40a64d23faa25e62a70ad163571c0b342b8bf66d5fa612ac0dec4f069d916", size = 2120810, upload-time = "2025-04-23T18:32:00.78Z" }, - { url = "https://files.pythonhosted.org/packages/aa/c3/053389835a996e18853ba107a63caae0b9deb4a276c6b472931ea9ae6e48/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0fb2d542b4d66f9470e8065c5469ec676978d625a8b7a363f07d9a501a9cb36a", size = 2676498, upload-time = "2025-04-23T18:32:02.418Z" }, - { url = "https://files.pythonhosted.org/packages/eb/3c/f4abd740877a35abade05e437245b192f9d0ffb48bbbbd708df33d3cda37/pydantic_core-2.33.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdac5d6ffa1b5a83bca06ffe7583f5576555e6c8b3a91fbd25ea7780f825f7d", size = 2000611, upload-time = "2025-04-23T18:32:04.152Z" }, - { url = "https://files.pythonhosted.org/packages/59/a7/63ef2fed1837d1121a894d0ce88439fe3e3b3e48c7543b2a4479eb99c2bd/pydantic_core-2.33.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:04a1a413977ab517154eebb2d326da71638271477d6ad87a769102f7c2488c56", size = 2107924, upload-time = "2025-04-23T18:32:06.129Z" }, - { url = "https://files.pythonhosted.org/packages/04/8f/2551964ef045669801675f1cfc3b0d74147f4901c3ffa42be2ddb1f0efc4/pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:c8e7af2f4e0194c22b5b37205bfb293d166a7344a5b0d0eaccebc376546d77d5", size = 2063196, upload-time = "2025-04-23T18:32:08.178Z" }, - { url = "https://files.pythonhosted.org/packages/26/bd/d9602777e77fc6dbb0c7db9ad356e9a985825547dce5ad1d30ee04903918/pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:5c92edd15cd58b3c2d34873597a1e20f13094f59cf88068adb18947df5455b4e", size = 2236389, upload-time = "2025-04-23T18:32:10.242Z" }, - { url = "https://files.pythonhosted.org/packages/42/db/0e950daa7e2230423ab342ae918a794964b053bec24ba8af013fc7c94846/pydantic_core-2.33.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:65132b7b4a1c0beded5e057324b7e16e10910c106d43675d9bd87d4f38dde162", size = 2239223, upload-time = "2025-04-23T18:32:12.382Z" }, - { url = "https://files.pythonhosted.org/packages/58/4d/4f937099c545a8a17eb52cb67fe0447fd9a373b348ccfa9a87f141eeb00f/pydantic_core-2.33.2-cp313-cp313-win32.whl", hash = "sha256:52fb90784e0a242bb96ec53f42196a17278855b0f31ac7c3cc6f5c1ec4811849", size = 1900473, upload-time = "2025-04-23T18:32:14.034Z" }, - { url = "https://files.pythonhosted.org/packages/a0/75/4a0a9bac998d78d889def5e4ef2b065acba8cae8c93696906c3a91f310ca/pydantic_core-2.33.2-cp313-cp313-win_amd64.whl", hash = "sha256:c083a3bdd5a93dfe480f1125926afcdbf2917ae714bdb80b36d34318b2bec5d9", size = 1955269, upload-time = "2025-04-23T18:32:15.783Z" }, - { url = "https://files.pythonhosted.org/packages/f9/86/1beda0576969592f1497b4ce8e7bc8cbdf614c352426271b1b10d5f0aa64/pydantic_core-2.33.2-cp313-cp313-win_arm64.whl", hash = "sha256:e80b087132752f6b3d714f041ccf74403799d3b23a72722ea2e6ba2e892555b9", size = 1893921, upload-time = "2025-04-23T18:32:18.473Z" }, - { url = "https://files.pythonhosted.org/packages/a4/7d/e09391c2eebeab681df2b74bfe6c43422fffede8dc74187b2b0bf6fd7571/pydantic_core-2.33.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:61c18fba8e5e9db3ab908620af374db0ac1baa69f0f32df4f61ae23f15e586ac", size = 1806162, upload-time = "2025-04-23T18:32:20.188Z" }, - { url = "https://files.pythonhosted.org/packages/f1/3d/847b6b1fed9f8ed3bb95a9ad04fbd0b212e832d4f0f50ff4d9ee5a9f15cf/pydantic_core-2.33.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:95237e53bb015f67b63c91af7518a62a8660376a6a0db19b89acc77a4d6199f5", size = 1981560, upload-time = "2025-04-23T18:32:22.354Z" }, - { url = "https://files.pythonhosted.org/packages/6f/9a/e73262f6c6656262b5fdd723ad90f518f579b7bc8622e43a942eec53c938/pydantic_core-2.33.2-cp313-cp313t-win_amd64.whl", hash = "sha256:c2fc0a768ef76c15ab9238afa6da7f69895bb5d1ee83aeea2e3509af4472d0b9", size = 1935777, upload-time = "2025-04-23T18:32:25.088Z" }, - { url = "https://files.pythonhosted.org/packages/53/ea/bbe9095cdd771987d13c82d104a9c8559ae9aec1e29f139e286fd2e9256e/pydantic_core-2.33.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:a2b911a5b90e0374d03813674bf0a5fbbb7741570dcd4b4e85a2e48d17def29d", size = 2028677, upload-time = "2025-04-23T18:32:27.227Z" }, - { url = "https://files.pythonhosted.org/packages/49/1d/4ac5ed228078737d457a609013e8f7edc64adc37b91d619ea965758369e5/pydantic_core-2.33.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6fa6dfc3e4d1f734a34710f391ae822e0a8eb8559a85c6979e14e65ee6ba2954", size = 1864735, upload-time = "2025-04-23T18:32:29.019Z" }, - { url = "https://files.pythonhosted.org/packages/23/9a/2e70d6388d7cda488ae38f57bc2f7b03ee442fbcf0d75d848304ac7e405b/pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c54c939ee22dc8e2d545da79fc5381f1c020d6d3141d3bd747eab59164dc89fb", size = 1898467, upload-time = "2025-04-23T18:32:31.119Z" }, - { url = "https://files.pythonhosted.org/packages/ff/2e/1568934feb43370c1ffb78a77f0baaa5a8b6897513e7a91051af707ffdc4/pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:53a57d2ed685940a504248187d5685e49eb5eef0f696853647bf37c418c538f7", size = 1983041, upload-time = "2025-04-23T18:32:33.655Z" }, - { url = "https://files.pythonhosted.org/packages/01/1a/1a1118f38ab64eac2f6269eb8c120ab915be30e387bb561e3af904b12499/pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:09fb9dd6571aacd023fe6aaca316bd01cf60ab27240d7eb39ebd66a3a15293b4", size = 2136503, upload-time = "2025-04-23T18:32:35.519Z" }, - { url = "https://files.pythonhosted.org/packages/5c/da/44754d1d7ae0f22d6d3ce6c6b1486fc07ac2c524ed8f6eca636e2e1ee49b/pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0e6116757f7959a712db11f3e9c0a99ade00a5bbedae83cb801985aa154f071b", size = 2736079, upload-time = "2025-04-23T18:32:37.659Z" }, - { url = "https://files.pythonhosted.org/packages/4d/98/f43cd89172220ec5aa86654967b22d862146bc4d736b1350b4c41e7c9c03/pydantic_core-2.33.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d55ab81c57b8ff8548c3e4947f119551253f4e3787a7bbc0b6b3ca47498a9d3", size = 2006508, upload-time = "2025-04-23T18:32:39.637Z" }, - { url = "https://files.pythonhosted.org/packages/2b/cc/f77e8e242171d2158309f830f7d5d07e0531b756106f36bc18712dc439df/pydantic_core-2.33.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c20c462aa4434b33a2661701b861604913f912254e441ab8d78d30485736115a", size = 2113693, upload-time = "2025-04-23T18:32:41.818Z" }, - { url = "https://files.pythonhosted.org/packages/54/7a/7be6a7bd43e0a47c147ba7fbf124fe8aaf1200bc587da925509641113b2d/pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:44857c3227d3fb5e753d5fe4a3420d6376fa594b07b621e220cd93703fe21782", size = 2074224, upload-time = "2025-04-23T18:32:44.033Z" }, - { url = "https://files.pythonhosted.org/packages/2a/07/31cf8fadffbb03be1cb520850e00a8490c0927ec456e8293cafda0726184/pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:eb9b459ca4df0e5c87deb59d37377461a538852765293f9e6ee834f0435a93b9", size = 2245403, upload-time = "2025-04-23T18:32:45.836Z" }, - { url = "https://files.pythonhosted.org/packages/b6/8d/bbaf4c6721b668d44f01861f297eb01c9b35f612f6b8e14173cb204e6240/pydantic_core-2.33.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9fcd347d2cc5c23b06de6d3b7b8275be558a0c90549495c699e379a80bf8379e", size = 2242331, upload-time = "2025-04-23T18:32:47.618Z" }, - { url = "https://files.pythonhosted.org/packages/bb/93/3cc157026bca8f5006250e74515119fcaa6d6858aceee8f67ab6dc548c16/pydantic_core-2.33.2-cp39-cp39-win32.whl", hash = "sha256:83aa99b1285bc8f038941ddf598501a86f1536789740991d7d8756e34f1e74d9", size = 1910571, upload-time = "2025-04-23T18:32:49.401Z" }, - { url = "https://files.pythonhosted.org/packages/5b/90/7edc3b2a0d9f0dda8806c04e511a67b0b7a41d2187e2003673a996fb4310/pydantic_core-2.33.2-cp39-cp39-win_amd64.whl", hash = "sha256:f481959862f57f29601ccced557cc2e817bce7533ab8e01a797a48b49c9692b3", size = 1956504, upload-time = "2025-04-23T18:32:51.287Z" }, - { url = "https://files.pythonhosted.org/packages/30/68/373d55e58b7e83ce371691f6eaa7175e3a24b956c44628eb25d7da007917/pydantic_core-2.33.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5c4aa4e82353f65e548c476b37e64189783aa5384903bfea4f41580f255fddfa", size = 2023982, upload-time = "2025-04-23T18:32:53.14Z" }, - { url = "https://files.pythonhosted.org/packages/a4/16/145f54ac08c96a63d8ed6442f9dec17b2773d19920b627b18d4f10a061ea/pydantic_core-2.33.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:d946c8bf0d5c24bf4fe333af284c59a19358aa3ec18cb3dc4370080da1e8ad29", size = 1858412, upload-time = "2025-04-23T18:32:55.52Z" }, - { url = "https://files.pythonhosted.org/packages/41/b1/c6dc6c3e2de4516c0bb2c46f6a373b91b5660312342a0cf5826e38ad82fa/pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:87b31b6846e361ef83fedb187bb5b4372d0da3f7e28d85415efa92d6125d6e6d", size = 1892749, upload-time = "2025-04-23T18:32:57.546Z" }, - { url = "https://files.pythonhosted.org/packages/12/73/8cd57e20afba760b21b742106f9dbdfa6697f1570b189c7457a1af4cd8a0/pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa9d91b338f2df0508606f7009fde642391425189bba6d8c653afd80fd6bb64e", size = 2067527, upload-time = "2025-04-23T18:32:59.771Z" }, - { url = "https://files.pythonhosted.org/packages/e3/d5/0bb5d988cc019b3cba4a78f2d4b3854427fc47ee8ec8e9eaabf787da239c/pydantic_core-2.33.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2058a32994f1fde4ca0480ab9d1e75a0e8c87c22b53a3ae66554f9af78f2fe8c", size = 2108225, upload-time = "2025-04-23T18:33:04.51Z" }, - { url = "https://files.pythonhosted.org/packages/f1/c5/00c02d1571913d496aabf146106ad8239dc132485ee22efe08085084ff7c/pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:0e03262ab796d986f978f79c943fc5f620381be7287148b8010b4097f79a39ec", size = 2069490, upload-time = "2025-04-23T18:33:06.391Z" }, - { url = "https://files.pythonhosted.org/packages/22/a8/dccc38768274d3ed3a59b5d06f59ccb845778687652daa71df0cab4040d7/pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:1a8695a8d00c73e50bff9dfda4d540b7dee29ff9b8053e38380426a85ef10052", size = 2237525, upload-time = "2025-04-23T18:33:08.44Z" }, - { url = "https://files.pythonhosted.org/packages/d4/e7/4f98c0b125dda7cf7ccd14ba936218397b44f50a56dd8c16a3091df116c3/pydantic_core-2.33.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:fa754d1850735a0b0e03bcffd9d4b4343eb417e47196e4485d9cca326073a42c", size = 2238446, upload-time = "2025-04-23T18:33:10.313Z" }, - { url = "https://files.pythonhosted.org/packages/ce/91/2ec36480fdb0b783cd9ef6795753c1dea13882f2e68e73bce76ae8c21e6a/pydantic_core-2.33.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:a11c8d26a50bfab49002947d3d237abe4d9e4b5bdc8846a63537b6488e197808", size = 2066678, upload-time = "2025-04-23T18:33:12.224Z" }, - { url = "https://files.pythonhosted.org/packages/7b/27/d4ae6487d73948d6f20dddcd94be4ea43e74349b56eba82e9bdee2d7494c/pydantic_core-2.33.2-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:dd14041875d09cc0f9308e37a6f8b65f5585cf2598a53aa0123df8b129d481f8", size = 2025200, upload-time = "2025-04-23T18:33:14.199Z" }, - { url = "https://files.pythonhosted.org/packages/f1/b8/b3cb95375f05d33801024079b9392a5ab45267a63400bf1866e7ce0f0de4/pydantic_core-2.33.2-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:d87c561733f66531dced0da6e864f44ebf89a8fba55f31407b00c2f7f9449593", size = 1859123, upload-time = "2025-04-23T18:33:16.555Z" }, - { url = "https://files.pythonhosted.org/packages/05/bc/0d0b5adeda59a261cd30a1235a445bf55c7e46ae44aea28f7bd6ed46e091/pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2f82865531efd18d6e07a04a17331af02cb7a651583c418df8266f17a63c6612", size = 1892852, upload-time = "2025-04-23T18:33:18.513Z" }, - { url = "https://files.pythonhosted.org/packages/3e/11/d37bdebbda2e449cb3f519f6ce950927b56d62f0b84fd9cb9e372a26a3d5/pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2bfb5112df54209d820d7bf9317c7a6c9025ea52e49f46b6a2060104bba37de7", size = 2067484, upload-time = "2025-04-23T18:33:20.475Z" }, - { url = "https://files.pythonhosted.org/packages/8c/55/1f95f0a05ce72ecb02a8a8a1c3be0579bbc29b1d5ab68f1378b7bebc5057/pydantic_core-2.33.2-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:64632ff9d614e5eecfb495796ad51b0ed98c453e447a76bcbeeb69615079fc7e", size = 2108896, upload-time = "2025-04-23T18:33:22.501Z" }, - { url = "https://files.pythonhosted.org/packages/53/89/2b2de6c81fa131f423246a9109d7b2a375e83968ad0800d6e57d0574629b/pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:f889f7a40498cc077332c7ab6b4608d296d852182211787d4f3ee377aaae66e8", size = 2069475, upload-time = "2025-04-23T18:33:24.528Z" }, - { url = "https://files.pythonhosted.org/packages/b8/e9/1f7efbe20d0b2b10f6718944b5d8ece9152390904f29a78e68d4e7961159/pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:de4b83bb311557e439b9e186f733f6c645b9417c84e2eb8203f3f820a4b988bf", size = 2239013, upload-time = "2025-04-23T18:33:26.621Z" }, - { url = "https://files.pythonhosted.org/packages/3c/b2/5309c905a93811524a49b4e031e9851a6b00ff0fb668794472ea7746b448/pydantic_core-2.33.2-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:82f68293f055f51b51ea42fafc74b6aad03e70e191799430b90c13d643059ebb", size = 2238715, upload-time = "2025-04-23T18:33:28.656Z" }, - { url = "https://files.pythonhosted.org/packages/32/56/8a7ca5d2cd2cda1d245d34b1c9a942920a718082ae8e54e5f3e5a58b7add/pydantic_core-2.33.2-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:329467cecfb529c925cf2bbd4d60d2c509bc2fb52a20c1045bf09bb70971a9c1", size = 2066757, upload-time = "2025-04-23T18:33:30.645Z" }, - { url = "https://files.pythonhosted.org/packages/08/98/dbf3fdfabaf81cda5622154fda78ea9965ac467e3239078e0dcd6df159e7/pydantic_core-2.33.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:87acbfcf8e90ca885206e98359d7dca4bcbb35abdc0ff66672a293e1d7a19101", size = 2024034, upload-time = "2025-04-23T18:33:32.843Z" }, - { url = "https://files.pythonhosted.org/packages/8d/99/7810aa9256e7f2ccd492590f86b79d370df1e9292f1f80b000b6a75bd2fb/pydantic_core-2.33.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:7f92c15cd1e97d4b12acd1cc9004fa092578acfa57b67ad5e43a197175d01a64", size = 1858578, upload-time = "2025-04-23T18:33:34.912Z" }, - { url = "https://files.pythonhosted.org/packages/d8/60/bc06fa9027c7006cc6dd21e48dbf39076dc39d9abbaf718a1604973a9670/pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d3f26877a748dc4251cfcfda9dfb5f13fcb034f5308388066bcfe9031b63ae7d", size = 1892858, upload-time = "2025-04-23T18:33:36.933Z" }, - { url = "https://files.pythonhosted.org/packages/f2/40/9d03997d9518816c68b4dfccb88969756b9146031b61cd37f781c74c9b6a/pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dac89aea9af8cd672fa7b510e7b8c33b0bba9a43186680550ccf23020f32d535", size = 2068498, upload-time = "2025-04-23T18:33:38.997Z" }, - { url = "https://files.pythonhosted.org/packages/d8/62/d490198d05d2d86672dc269f52579cad7261ced64c2df213d5c16e0aecb1/pydantic_core-2.33.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:970919794d126ba8645f3837ab6046fb4e72bbc057b3709144066204c19a455d", size = 2108428, upload-time = "2025-04-23T18:33:41.18Z" }, - { url = "https://files.pythonhosted.org/packages/9a/ec/4cd215534fd10b8549015f12ea650a1a973da20ce46430b68fc3185573e8/pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:3eb3fe62804e8f859c49ed20a8451342de53ed764150cb14ca71357c765dc2a6", size = 2069854, upload-time = "2025-04-23T18:33:43.446Z" }, - { url = "https://files.pythonhosted.org/packages/1a/1a/abbd63d47e1d9b0d632fee6bb15785d0889c8a6e0a6c3b5a8e28ac1ec5d2/pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:3abcd9392a36025e3bd55f9bd38d908bd17962cc49bc6da8e7e96285336e2bca", size = 2237859, upload-time = "2025-04-23T18:33:45.56Z" }, - { url = "https://files.pythonhosted.org/packages/80/1c/fa883643429908b1c90598fd2642af8839efd1d835b65af1f75fba4d94fe/pydantic_core-2.33.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:3a1c81334778f9e3af2f8aeb7a960736e5cab1dfebfb26aabca09afd2906c039", size = 2239059, upload-time = "2025-04-23T18:33:47.735Z" }, - { url = "https://files.pythonhosted.org/packages/d4/29/3cade8a924a61f60ccfa10842f75eb12787e1440e2b8660ceffeb26685e7/pydantic_core-2.33.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:2807668ba86cb38c6817ad9bc66215ab8584d1d304030ce4f0887336f28a5e27", size = 2066661, upload-time = "2025-04-23T18:33:49.995Z" }, +sdist = { url = "https://files.pythonhosted.org/packages/a6/9f/7de1f19b6aea45aeb441838782d68352e71bfa98ee6fa048d5041991b33e/pydantic_core-2.27.1.tar.gz", hash = "sha256:62a763352879b84aa31058fc931884055fd75089cccbd9d58bb6afd01141b235", size = 412785, upload-time = "2024-11-22T00:24:49.865Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6e/ce/60fd96895c09738648c83f3f00f595c807cb6735c70d3306b548cc96dd49/pydantic_core-2.27.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:71a5e35c75c021aaf400ac048dacc855f000bdfed91614b4a726f7432f1f3d6a", size = 1897984, upload-time = "2024-11-22T00:21:25.431Z" }, + { url = "https://files.pythonhosted.org/packages/fd/b9/84623d6b6be98cc209b06687d9bca5a7b966ffed008d15225dd0d20cce2e/pydantic_core-2.27.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f82d068a2d6ecfc6e054726080af69a6764a10015467d7d7b9f66d6ed5afa23b", size = 1807491, upload-time = "2024-11-22T00:21:27.318Z" }, + { url = "https://files.pythonhosted.org/packages/01/72/59a70165eabbc93b1111d42df9ca016a4aa109409db04304829377947028/pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:121ceb0e822f79163dd4699e4c54f5ad38b157084d97b34de8b232bcaad70278", size = 1831953, upload-time = "2024-11-22T00:21:28.606Z" }, + { url = "https://files.pythonhosted.org/packages/7c/0c/24841136476adafd26f94b45bb718a78cb0500bd7b4f8d667b67c29d7b0d/pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4603137322c18eaf2e06a4495f426aa8d8388940f3c457e7548145011bb68e05", size = 1856071, upload-time = "2024-11-22T00:21:29.931Z" }, + { url = "https://files.pythonhosted.org/packages/53/5e/c32957a09cceb2af10d7642df45d1e3dbd8596061f700eac93b801de53c0/pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a33cd6ad9017bbeaa9ed78a2e0752c5e250eafb9534f308e7a5f7849b0b1bfb4", size = 2038439, upload-time = "2024-11-22T00:21:32.245Z" }, + { url = "https://files.pythonhosted.org/packages/e4/8f/979ab3eccd118b638cd6d8f980fea8794f45018255a36044dea40fe579d4/pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:15cc53a3179ba0fcefe1e3ae50beb2784dede4003ad2dfd24f81bba4b23a454f", size = 2787416, upload-time = "2024-11-22T00:21:33.708Z" }, + { url = "https://files.pythonhosted.org/packages/02/1d/00f2e4626565b3b6d3690dab4d4fe1a26edd6a20e53749eb21ca892ef2df/pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:45d9c5eb9273aa50999ad6adc6be5e0ecea7e09dbd0d31bd0c65a55a2592ca08", size = 2134548, upload-time = "2024-11-22T00:21:35.823Z" }, + { url = "https://files.pythonhosted.org/packages/9d/46/3112621204128b90898adc2e721a3cd6cf5626504178d6f32c33b5a43b79/pydantic_core-2.27.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8bf7b66ce12a2ac52d16f776b31d16d91033150266eb796967a7e4621707e4f6", size = 1989882, upload-time = "2024-11-22T00:21:37.872Z" }, + { url = "https://files.pythonhosted.org/packages/49/ec/557dd4ff5287ffffdf16a31d08d723de6762bb1b691879dc4423392309bc/pydantic_core-2.27.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:655d7dd86f26cb15ce8a431036f66ce0318648f8853d709b4167786ec2fa4807", size = 1995829, upload-time = "2024-11-22T00:21:39.966Z" }, + { url = "https://files.pythonhosted.org/packages/6e/b2/610dbeb74d8d43921a7234555e4c091cb050a2bdb8cfea86d07791ce01c5/pydantic_core-2.27.1-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:5556470f1a2157031e676f776c2bc20acd34c1990ca5f7e56f1ebf938b9ab57c", size = 2091257, upload-time = "2024-11-22T00:21:41.99Z" }, + { url = "https://files.pythonhosted.org/packages/8c/7f/4bf8e9d26a9118521c80b229291fa9558a07cdd9a968ec2d5c1026f14fbc/pydantic_core-2.27.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f69ed81ab24d5a3bd93861c8c4436f54afdf8e8cc421562b0c7504cf3be58206", size = 2143894, upload-time = "2024-11-22T00:21:44.193Z" }, + { url = "https://files.pythonhosted.org/packages/1f/1c/875ac7139c958f4390f23656fe696d1acc8edf45fb81e4831960f12cd6e4/pydantic_core-2.27.1-cp310-none-win32.whl", hash = "sha256:f5a823165e6d04ccea61a9f0576f345f8ce40ed533013580e087bd4d7442b52c", size = 1816081, upload-time = "2024-11-22T00:21:45.468Z" }, + { url = "https://files.pythonhosted.org/packages/d7/41/55a117acaeda25ceae51030b518032934f251b1dac3704a53781383e3491/pydantic_core-2.27.1-cp310-none-win_amd64.whl", hash = "sha256:57866a76e0b3823e0b56692d1a0bf722bffb324839bb5b7226a7dbd6c9a40b17", size = 1981109, upload-time = "2024-11-22T00:21:47.452Z" }, + { url = "https://files.pythonhosted.org/packages/27/39/46fe47f2ad4746b478ba89c561cafe4428e02b3573df882334bd2964f9cb/pydantic_core-2.27.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:ac3b20653bdbe160febbea8aa6c079d3df19310d50ac314911ed8cc4eb7f8cb8", size = 1895553, upload-time = "2024-11-22T00:21:48.859Z" }, + { url = "https://files.pythonhosted.org/packages/1c/00/0804e84a78b7fdb394fff4c4f429815a10e5e0993e6ae0e0b27dd20379ee/pydantic_core-2.27.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a5a8e19d7c707c4cadb8c18f5f60c843052ae83c20fa7d44f41594c644a1d330", size = 1807220, upload-time = "2024-11-22T00:21:50.354Z" }, + { url = "https://files.pythonhosted.org/packages/01/de/df51b3bac9820d38371f5a261020f505025df732ce566c2a2e7970b84c8c/pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7f7059ca8d64fea7f238994c97d91f75965216bcbe5f695bb44f354893f11d52", size = 1829727, upload-time = "2024-11-22T00:21:51.722Z" }, + { url = "https://files.pythonhosted.org/packages/5f/d9/c01d19da8f9e9fbdb2bf99f8358d145a312590374d0dc9dd8dbe484a9cde/pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bed0f8a0eeea9fb72937ba118f9db0cb7e90773462af7962d382445f3005e5a4", size = 1854282, upload-time = "2024-11-22T00:21:53.098Z" }, + { url = "https://files.pythonhosted.org/packages/5f/84/7db66eb12a0dc88c006abd6f3cbbf4232d26adfd827a28638c540d8f871d/pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a3cb37038123447cf0f3ea4c74751f6a9d7afef0eb71aa07bf5f652b5e6a132c", size = 2037437, upload-time = "2024-11-22T00:21:55.185Z" }, + { url = "https://files.pythonhosted.org/packages/34/ac/a2537958db8299fbabed81167d58cc1506049dba4163433524e06a7d9f4c/pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:84286494f6c5d05243456e04223d5a9417d7f443c3b76065e75001beb26f88de", size = 2780899, upload-time = "2024-11-22T00:21:56.633Z" }, + { url = "https://files.pythonhosted.org/packages/4a/c1/3e38cd777ef832c4fdce11d204592e135ddeedb6c6f525478a53d1c7d3e5/pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:acc07b2cfc5b835444b44a9956846b578d27beeacd4b52e45489e93276241025", size = 2135022, upload-time = "2024-11-22T00:21:59.154Z" }, + { url = "https://files.pythonhosted.org/packages/7a/69/b9952829f80fd555fe04340539d90e000a146f2a003d3fcd1e7077c06c71/pydantic_core-2.27.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4fefee876e07a6e9aad7a8c8c9f85b0cdbe7df52b8a9552307b09050f7512c7e", size = 1987969, upload-time = "2024-11-22T00:22:01.325Z" }, + { url = "https://files.pythonhosted.org/packages/05/72/257b5824d7988af43460c4e22b63932ed651fe98804cc2793068de7ec554/pydantic_core-2.27.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:258c57abf1188926c774a4c94dd29237e77eda19462e5bb901d88adcab6af919", size = 1994625, upload-time = "2024-11-22T00:22:03.447Z" }, + { url = "https://files.pythonhosted.org/packages/73/c3/78ed6b7f3278a36589bcdd01243189ade7fc9b26852844938b4d7693895b/pydantic_core-2.27.1-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:35c14ac45fcfdf7167ca76cc80b2001205a8d5d16d80524e13508371fb8cdd9c", size = 2090089, upload-time = "2024-11-22T00:22:04.941Z" }, + { url = "https://files.pythonhosted.org/packages/8d/c8/b4139b2f78579960353c4cd987e035108c93a78371bb19ba0dc1ac3b3220/pydantic_core-2.27.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d1b26e1dff225c31897696cab7d4f0a315d4c0d9e8666dbffdb28216f3b17fdc", size = 2142496, upload-time = "2024-11-22T00:22:06.57Z" }, + { url = "https://files.pythonhosted.org/packages/3e/f8/171a03e97eb36c0b51981efe0f78460554a1d8311773d3d30e20c005164e/pydantic_core-2.27.1-cp311-none-win32.whl", hash = "sha256:2cdf7d86886bc6982354862204ae3b2f7f96f21a3eb0ba5ca0ac42c7b38598b9", size = 1811758, upload-time = "2024-11-22T00:22:08.445Z" }, + { url = "https://files.pythonhosted.org/packages/6a/fe/4e0e63c418c1c76e33974a05266e5633e879d4061f9533b1706a86f77d5b/pydantic_core-2.27.1-cp311-none-win_amd64.whl", hash = "sha256:3af385b0cee8df3746c3f406f38bcbfdc9041b5c2d5ce3e5fc6637256e60bbc5", size = 1980864, upload-time = "2024-11-22T00:22:10Z" }, + { url = "https://files.pythonhosted.org/packages/50/fc/93f7238a514c155a8ec02fc7ac6376177d449848115e4519b853820436c5/pydantic_core-2.27.1-cp311-none-win_arm64.whl", hash = "sha256:81f2ec23ddc1b476ff96563f2e8d723830b06dceae348ce02914a37cb4e74b89", size = 1864327, upload-time = "2024-11-22T00:22:11.478Z" }, + { url = "https://files.pythonhosted.org/packages/be/51/2e9b3788feb2aebff2aa9dfbf060ec739b38c05c46847601134cc1fed2ea/pydantic_core-2.27.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9cbd94fc661d2bab2bc702cddd2d3370bbdcc4cd0f8f57488a81bcce90c7a54f", size = 1895239, upload-time = "2024-11-22T00:22:13.775Z" }, + { url = "https://files.pythonhosted.org/packages/7b/9e/f8063952e4a7d0127f5d1181addef9377505dcce3be224263b25c4f0bfd9/pydantic_core-2.27.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5f8c4718cd44ec1580e180cb739713ecda2bdee1341084c1467802a417fe0f02", size = 1805070, upload-time = "2024-11-22T00:22:15.438Z" }, + { url = "https://files.pythonhosted.org/packages/2c/9d/e1d6c4561d262b52e41b17a7ef8301e2ba80b61e32e94520271029feb5d8/pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:15aae984e46de8d376df515f00450d1522077254ef6b7ce189b38ecee7c9677c", size = 1828096, upload-time = "2024-11-22T00:22:17.892Z" }, + { url = "https://files.pythonhosted.org/packages/be/65/80ff46de4266560baa4332ae3181fffc4488ea7d37282da1a62d10ab89a4/pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1ba5e3963344ff25fc8c40da90f44b0afca8cfd89d12964feb79ac1411a260ac", size = 1857708, upload-time = "2024-11-22T00:22:19.412Z" }, + { url = "https://files.pythonhosted.org/packages/d5/ca/3370074ad758b04d9562b12ecdb088597f4d9d13893a48a583fb47682cdf/pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:992cea5f4f3b29d6b4f7f1726ed8ee46c8331c6b4eed6db5b40134c6fe1768bb", size = 2037751, upload-time = "2024-11-22T00:22:20.979Z" }, + { url = "https://files.pythonhosted.org/packages/b1/e2/4ab72d93367194317b99d051947c071aef6e3eb95f7553eaa4208ecf9ba4/pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0325336f348dbee6550d129b1627cb8f5351a9dc91aad141ffb96d4937bd9529", size = 2733863, upload-time = "2024-11-22T00:22:22.951Z" }, + { url = "https://files.pythonhosted.org/packages/8a/c6/8ae0831bf77f356bb73127ce5a95fe115b10f820ea480abbd72d3cc7ccf3/pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7597c07fbd11515f654d6ece3d0e4e5093edc30a436c63142d9a4b8e22f19c35", size = 2161161, upload-time = "2024-11-22T00:22:24.785Z" }, + { url = "https://files.pythonhosted.org/packages/f1/f4/b2fe73241da2429400fc27ddeaa43e35562f96cf5b67499b2de52b528cad/pydantic_core-2.27.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3bbd5d8cc692616d5ef6fbbbd50dbec142c7e6ad9beb66b78a96e9c16729b089", size = 1993294, upload-time = "2024-11-22T00:22:27.076Z" }, + { url = "https://files.pythonhosted.org/packages/77/29/4bb008823a7f4cc05828198153f9753b3bd4c104d93b8e0b1bfe4e187540/pydantic_core-2.27.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:dc61505e73298a84a2f317255fcc72b710b72980f3a1f670447a21efc88f8381", size = 2001468, upload-time = "2024-11-22T00:22:29.346Z" }, + { url = "https://files.pythonhosted.org/packages/f2/a9/0eaceeba41b9fad851a4107e0cf999a34ae8f0d0d1f829e2574f3d8897b0/pydantic_core-2.27.1-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:e1f735dc43da318cad19b4173dd1ffce1d84aafd6c9b782b3abc04a0d5a6f5bb", size = 2091413, upload-time = "2024-11-22T00:22:30.984Z" }, + { url = "https://files.pythonhosted.org/packages/d8/36/eb8697729725bc610fd73940f0d860d791dc2ad557faaefcbb3edbd2b349/pydantic_core-2.27.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:f4e5658dbffe8843a0f12366a4c2d1c316dbe09bb4dfbdc9d2d9cd6031de8aae", size = 2154735, upload-time = "2024-11-22T00:22:32.616Z" }, + { url = "https://files.pythonhosted.org/packages/52/e5/4f0fbd5c5995cc70d3afed1b5c754055bb67908f55b5cb8000f7112749bf/pydantic_core-2.27.1-cp312-none-win32.whl", hash = "sha256:672ebbe820bb37988c4d136eca2652ee114992d5d41c7e4858cdd90ea94ffe5c", size = 1833633, upload-time = "2024-11-22T00:22:35.027Z" }, + { url = "https://files.pythonhosted.org/packages/ee/f2/c61486eee27cae5ac781305658779b4a6b45f9cc9d02c90cb21b940e82cc/pydantic_core-2.27.1-cp312-none-win_amd64.whl", hash = "sha256:66ff044fd0bb1768688aecbe28b6190f6e799349221fb0de0e6f4048eca14c16", size = 1986973, upload-time = "2024-11-22T00:22:37.502Z" }, + { url = "https://files.pythonhosted.org/packages/df/a6/e3f12ff25f250b02f7c51be89a294689d175ac76e1096c32bf278f29ca1e/pydantic_core-2.27.1-cp312-none-win_arm64.whl", hash = "sha256:9a3b0793b1bbfd4146304e23d90045f2a9b5fd5823aa682665fbdaf2a6c28f3e", size = 1883215, upload-time = "2024-11-22T00:22:39.186Z" }, + { url = "https://files.pythonhosted.org/packages/0f/d6/91cb99a3c59d7b072bded9959fbeab0a9613d5a4935773c0801f1764c156/pydantic_core-2.27.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:f216dbce0e60e4d03e0c4353c7023b202d95cbaeff12e5fd2e82ea0a66905073", size = 1895033, upload-time = "2024-11-22T00:22:41.087Z" }, + { url = "https://files.pythonhosted.org/packages/07/42/d35033f81a28b27dedcade9e967e8a40981a765795c9ebae2045bcef05d3/pydantic_core-2.27.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a2e02889071850bbfd36b56fd6bc98945e23670773bc7a76657e90e6b6603c08", size = 1807542, upload-time = "2024-11-22T00:22:43.341Z" }, + { url = "https://files.pythonhosted.org/packages/41/c2/491b59e222ec7e72236e512108ecad532c7f4391a14e971c963f624f7569/pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42b0e23f119b2b456d07ca91b307ae167cc3f6c846a7b169fca5326e32fdc6cf", size = 1827854, upload-time = "2024-11-22T00:22:44.96Z" }, + { url = "https://files.pythonhosted.org/packages/e3/f3/363652651779113189cefdbbb619b7b07b7a67ebb6840325117cc8cc3460/pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:764be71193f87d460a03f1f7385a82e226639732214b402f9aa61f0d025f0737", size = 1857389, upload-time = "2024-11-22T00:22:47.305Z" }, + { url = "https://files.pythonhosted.org/packages/5f/97/be804aed6b479af5a945daec7538d8bf358d668bdadde4c7888a2506bdfb/pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1c00666a3bd2f84920a4e94434f5974d7bbc57e461318d6bb34ce9cdbbc1f6b2", size = 2037934, upload-time = "2024-11-22T00:22:49.093Z" }, + { url = "https://files.pythonhosted.org/packages/42/01/295f0bd4abf58902917e342ddfe5f76cf66ffabfc57c2e23c7681a1a1197/pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3ccaa88b24eebc0f849ce0a4d09e8a408ec5a94afff395eb69baf868f5183107", size = 2735176, upload-time = "2024-11-22T00:22:50.822Z" }, + { url = "https://files.pythonhosted.org/packages/9d/a0/cd8e9c940ead89cc37812a1a9f310fef59ba2f0b22b4e417d84ab09fa970/pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c65af9088ac534313e1963443d0ec360bb2b9cba6c2909478d22c2e363d98a51", size = 2160720, upload-time = "2024-11-22T00:22:52.638Z" }, + { url = "https://files.pythonhosted.org/packages/73/ae/9d0980e286627e0aeca4c352a60bd760331622c12d576e5ea4441ac7e15e/pydantic_core-2.27.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:206b5cf6f0c513baffaeae7bd817717140770c74528f3e4c3e1cec7871ddd61a", size = 1992972, upload-time = "2024-11-22T00:22:54.31Z" }, + { url = "https://files.pythonhosted.org/packages/bf/ba/ae4480bc0292d54b85cfb954e9d6bd226982949f8316338677d56541b85f/pydantic_core-2.27.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:062f60e512fc7fff8b8a9d680ff0ddaaef0193dba9fa83e679c0c5f5fbd018bc", size = 2001477, upload-time = "2024-11-22T00:22:56.451Z" }, + { url = "https://files.pythonhosted.org/packages/55/b7/e26adf48c2f943092ce54ae14c3c08d0d221ad34ce80b18a50de8ed2cba8/pydantic_core-2.27.1-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:a0697803ed7d4af5e4c1adf1670af078f8fcab7a86350e969f454daf598c4960", size = 2091186, upload-time = "2024-11-22T00:22:58.226Z" }, + { url = "https://files.pythonhosted.org/packages/ba/cc/8491fff5b608b3862eb36e7d29d36a1af1c945463ca4c5040bf46cc73f40/pydantic_core-2.27.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:58ca98a950171f3151c603aeea9303ef6c235f692fe555e883591103da709b23", size = 2154429, upload-time = "2024-11-22T00:22:59.985Z" }, + { url = "https://files.pythonhosted.org/packages/78/d8/c080592d80edd3441ab7f88f865f51dae94a157fc64283c680e9f32cf6da/pydantic_core-2.27.1-cp313-none-win32.whl", hash = "sha256:8065914ff79f7eab1599bd80406681f0ad08f8e47c880f17b416c9f8f7a26d05", size = 1833713, upload-time = "2024-11-22T00:23:01.715Z" }, + { url = "https://files.pythonhosted.org/packages/83/84/5ab82a9ee2538ac95a66e51f6838d6aba6e0a03a42aa185ad2fe404a4e8f/pydantic_core-2.27.1-cp313-none-win_amd64.whl", hash = "sha256:ba630d5e3db74c79300d9a5bdaaf6200172b107f263c98a0539eeecb857b2337", size = 1987897, upload-time = "2024-11-22T00:23:03.497Z" }, + { url = "https://files.pythonhosted.org/packages/df/c3/b15fb833926d91d982fde29c0624c9f225da743c7af801dace0d4e187e71/pydantic_core-2.27.1-cp313-none-win_arm64.whl", hash = "sha256:45cf8588c066860b623cd11c4ba687f8d7175d5f7ef65f7129df8a394c502de5", size = 1882983, upload-time = "2024-11-22T00:23:05.983Z" }, + { url = "https://files.pythonhosted.org/packages/bc/6a/d741ce0c7da75ce9b394636a406aace00ad992ae417935ef2ad2e67fb970/pydantic_core-2.27.1-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:e9386266798d64eeb19dd3677051f5705bf873e98e15897ddb7d76f477131967", size = 1898376, upload-time = "2024-11-22T00:23:35.233Z" }, + { url = "https://files.pythonhosted.org/packages/bd/68/6ba18e30f10c7051bc55f1dffeadbee51454b381c91846104892a6d3b9cd/pydantic_core-2.27.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4228b5b646caa73f119b1ae756216b59cc6e2267201c27d3912b592c5e323b60", size = 1777246, upload-time = "2024-11-22T00:23:37.134Z" }, + { url = "https://files.pythonhosted.org/packages/36/b8/6f1b7c5f068c00dfe179b8762bc1d32c75c0e9f62c9372174b1b64a74aa8/pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0b3dfe500de26c52abe0477dde16192ac39c98f05bf2d80e76102d394bd13854", size = 1832148, upload-time = "2024-11-22T00:23:39.206Z" }, + { url = "https://files.pythonhosted.org/packages/d9/83/83ff64d599847f080a93df119e856e3bd93063cced04b9a27eb66d863831/pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:aee66be87825cdf72ac64cb03ad4c15ffef4143dbf5c113f64a5ff4f81477bf9", size = 1856371, upload-time = "2024-11-22T00:23:41.206Z" }, + { url = "https://files.pythonhosted.org/packages/72/e9/974e6c73f59627c446833ecc306cadd199edab40abcfa093372a5a5c0156/pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3b748c44bb9f53031c8cbc99a8a061bc181c1000c60a30f55393b6e9c45cc5bd", size = 2038686, upload-time = "2024-11-22T00:23:43.274Z" }, + { url = "https://files.pythonhosted.org/packages/5e/bb/5e912d02dcf29aebb2da35e5a1a26088c39ffc0b1ea81242ee9db6f1f730/pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5ca038c7f6a0afd0b2448941b6ef9d5e1949e999f9e5517692eb6da58e9d44be", size = 2785725, upload-time = "2024-11-22T00:23:45.233Z" }, + { url = "https://files.pythonhosted.org/packages/85/d7/936846087424c882d89c853711687230cd60179a67c79c34c99b64f92625/pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e0bd57539da59a3e4671b90a502da9a28c72322a4f17866ba3ac63a82c4498e", size = 2135177, upload-time = "2024-11-22T00:23:48.382Z" }, + { url = "https://files.pythonhosted.org/packages/82/72/5a386e5ce8d3e933c3f283e61357474181c39383f38afffc15a6152fa1c5/pydantic_core-2.27.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ac6c2c45c847bbf8f91930d88716a0fb924b51e0c6dad329b793d670ec5db792", size = 1989877, upload-time = "2024-11-22T00:23:50.417Z" }, + { url = "https://files.pythonhosted.org/packages/ce/5c/b1c417a5fd67ce132d78d16a6ba7629dc7f188dbd4f7c30ef58111ee5147/pydantic_core-2.27.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b94d4ba43739bbe8b0ce4262bcc3b7b9f31459ad120fb595627eaeb7f9b9ca01", size = 1996006, upload-time = "2024-11-22T00:23:52.534Z" }, + { url = "https://files.pythonhosted.org/packages/dd/04/4e18f2c42b29929882f30e4c09a3a039555158995a4ac730a73585198a66/pydantic_core-2.27.1-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:00e6424f4b26fe82d44577b4c842d7df97c20be6439e8e685d0d715feceb9fb9", size = 2091441, upload-time = "2024-11-22T00:23:54.618Z" }, + { url = "https://files.pythonhosted.org/packages/06/84/5a332345b7efb5ab361f916eaf7316ef010e72417e8c7dd3d34462ee9840/pydantic_core-2.27.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:38de0a70160dd97540335b7ad3a74571b24f1dc3ed33f815f0880682e6880131", size = 2144471, upload-time = "2024-11-22T00:23:57.437Z" }, + { url = "https://files.pythonhosted.org/packages/54/58/23caa58c35d36627156789c0fb562264c12cfdb451c75eb275535188a96f/pydantic_core-2.27.1-cp39-none-win32.whl", hash = "sha256:7ccebf51efc61634f6c2344da73e366c75e735960b5654b63d7e6f69a5885fa3", size = 1816563, upload-time = "2024-11-22T00:23:59.45Z" }, + { url = "https://files.pythonhosted.org/packages/f7/9c/e83f08adc8e222b43c7f11d98b27eba08f21bcb259bcbf74743ce903c49c/pydantic_core-2.27.1-cp39-none-win_amd64.whl", hash = "sha256:a57847b090d7892f123726202b7daa20df6694cbd583b67a592e856bff603d6c", size = 1983137, upload-time = "2024-11-22T00:24:01.606Z" }, + { url = "https://files.pythonhosted.org/packages/7c/60/e5eb2d462595ba1f622edbe7b1d19531e510c05c405f0b87c80c1e89d5b1/pydantic_core-2.27.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:3fa80ac2bd5856580e242dbc202db873c60a01b20309c8319b5c5986fbe53ce6", size = 1894016, upload-time = "2024-11-22T00:24:03.815Z" }, + { url = "https://files.pythonhosted.org/packages/61/20/da7059855225038c1c4326a840908cc7ca72c7198cb6addb8b92ec81c1d6/pydantic_core-2.27.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:d950caa237bb1954f1b8c9227b5065ba6875ac9771bb8ec790d956a699b78676", size = 1771648, upload-time = "2024-11-22T00:24:05.981Z" }, + { url = "https://files.pythonhosted.org/packages/8f/fc/5485cf0b0bb38da31d1d292160a4d123b5977841ddc1122c671a30b76cfd/pydantic_core-2.27.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0e4216e64d203e39c62df627aa882f02a2438d18a5f21d7f721621f7a5d3611d", size = 1826929, upload-time = "2024-11-22T00:24:08.163Z" }, + { url = "https://files.pythonhosted.org/packages/a1/ff/fb1284a210e13a5f34c639efc54d51da136074ffbe25ec0c279cf9fbb1c4/pydantic_core-2.27.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:02a3d637bd387c41d46b002f0e49c52642281edacd2740e5a42f7017feea3f2c", size = 1980591, upload-time = "2024-11-22T00:24:10.291Z" }, + { url = "https://files.pythonhosted.org/packages/f1/14/77c1887a182d05af74f6aeac7b740da3a74155d3093ccc7ee10b900cc6b5/pydantic_core-2.27.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:161c27ccce13b6b0c8689418da3885d3220ed2eae2ea5e9b2f7f3d48f1d52c27", size = 1981326, upload-time = "2024-11-22T00:24:13.169Z" }, + { url = "https://files.pythonhosted.org/packages/06/aa/6f1b2747f811a9c66b5ef39d7f02fbb200479784c75e98290d70004b1253/pydantic_core-2.27.1-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:19910754e4cc9c63bc1c7f6d73aa1cfee82f42007e407c0f413695c2f7ed777f", size = 1989205, upload-time = "2024-11-22T00:24:16.049Z" }, + { url = "https://files.pythonhosted.org/packages/7a/d2/8ce2b074d6835f3c88d85f6d8a399790043e9fdb3d0e43455e72d19df8cc/pydantic_core-2.27.1-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:e173486019cc283dc9778315fa29a363579372fe67045e971e89b6365cc035ed", size = 2079616, upload-time = "2024-11-22T00:24:19.099Z" }, + { url = "https://files.pythonhosted.org/packages/65/71/af01033d4e58484c3db1e5d13e751ba5e3d6b87cc3368533df4c50932c8b/pydantic_core-2.27.1-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:af52d26579b308921b73b956153066481f064875140ccd1dfd4e77db89dbb12f", size = 2133265, upload-time = "2024-11-22T00:24:21.397Z" }, + { url = "https://files.pythonhosted.org/packages/33/72/f881b5e18fbb67cf2fb4ab253660de3c6899dbb2dba409d0b757e3559e3d/pydantic_core-2.27.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:981fb88516bd1ae8b0cbbd2034678a39dedc98752f264ac9bc5839d3923fa04c", size = 2001864, upload-time = "2024-11-22T00:24:24.354Z" }, + { url = "https://files.pythonhosted.org/packages/85/3e/f6f75ba36678fee11dd07a7729e9ed172ecf31e3f50a5d636e9605eee2af/pydantic_core-2.27.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5fde892e6c697ce3e30c61b239330fc5d569a71fefd4eb6512fc6caec9dd9e2f", size = 1894250, upload-time = "2024-11-22T00:24:26.603Z" }, + { url = "https://files.pythonhosted.org/packages/d3/2d/a40578918e2eb5b4ee0d206a4fb6c4040c2bf14e28d29fba9bd7e7659d16/pydantic_core-2.27.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:816f5aa087094099fff7edabb5e01cc370eb21aa1a1d44fe2d2aefdfb5599b31", size = 1772035, upload-time = "2024-11-22T00:24:29.721Z" }, + { url = "https://files.pythonhosted.org/packages/7f/ee/0377e9f4ca5a47e8885f670a65c0a647ddf9ce98d50bf7547cf8e1ee5771/pydantic_core-2.27.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9c10c309e18e443ddb108f0ef64e8729363adbfd92d6d57beec680f6261556f3", size = 1827025, upload-time = "2024-11-22T00:24:32.054Z" }, + { url = "https://files.pythonhosted.org/packages/fe/0b/a24d9ef762d05bebdfafd6d5d176b990728fa9ec8ea7b6040d6fb5f3caaa/pydantic_core-2.27.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:98476c98b02c8e9b2eec76ac4156fd006628b1b2d0ef27e548ffa978393fd154", size = 1980927, upload-time = "2024-11-22T00:24:34.285Z" }, + { url = "https://files.pythonhosted.org/packages/00/bd/deadc1722eb7dfdf787a3bbcd32eabbdcc36931fd48671a850e1b9f2cd77/pydantic_core-2.27.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c3027001c28434e7ca5a6e1e527487051136aa81803ac812be51802150d880dd", size = 1980918, upload-time = "2024-11-22T00:24:36.588Z" }, + { url = "https://files.pythonhosted.org/packages/f0/05/5d09d0b0e92053d538927308ea1d35cb25ab543d9c3e2eb2d7653bc73690/pydantic_core-2.27.1-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:7699b1df36a48169cdebda7ab5a2bac265204003f153b4bd17276153d997670a", size = 1989990, upload-time = "2024-11-22T00:24:39.101Z" }, + { url = "https://files.pythonhosted.org/packages/5b/7e/f7191346d1c3ac66049f618ee331359f8552a8b68a2daf916003c30b6dc8/pydantic_core-2.27.1-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:1c39b07d90be6b48968ddc8c19e7585052088fd7ec8d568bb31ff64c70ae3c97", size = 2079871, upload-time = "2024-11-22T00:24:42.191Z" }, + { url = "https://files.pythonhosted.org/packages/f3/65/2caf4f7ad65413a137d43cb9578c54d1abd3224be786ad840263c1bf9e0f/pydantic_core-2.27.1-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:46ccfe3032b3915586e469d4972973f893c0a2bb65669194a5bdea9bacc088c2", size = 2133569, upload-time = "2024-11-22T00:24:44.508Z" }, + { url = "https://files.pythonhosted.org/packages/fd/ab/718d9a1c41bb8d3e0e04d15b68b8afc135f8fcf552705b62f226225065c7/pydantic_core-2.27.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:62ba45e21cf6571d7f716d903b5b7b6d2617e2d5d67c0923dc47b9d41369f840", size = 2002035, upload-time = "2024-11-22T00:24:46.917Z" }, ] [[package]] @@ -1611,41 +924,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/2f/b5/380380c9e7a534cb1783c70c3e8ac6d1193c599650a55838d0557586796e/pyright-1.1.399-py3-none-any.whl", hash = "sha256:55f9a875ddf23c9698f24208c764465ffdfd38be6265f7faf9a176e1dc549f3b", size = 5592584, upload-time = "2025-04-10T04:40:23.502Z" }, ] -[[package]] -name = "pytest" -version = "8.3.5" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version < '3.9'", -] -dependencies = [ - { name = "colorama", marker = "(python_full_version < '3.9' and sys_platform == 'win32') or (python_full_version >= '3.9' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2') or (sys_platform != 'win32' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "exceptiongroup", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "iniconfig", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "packaging", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "pluggy", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "tomli", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/ae/3c/c9d525a414d506893f0cd8a8d0de7706446213181570cdbd766691164e40/pytest-8.3.5.tar.gz", hash = "sha256:f4efe70cc14e511565ac476b57c279e12a855b11f48f212af1080ef2263d3845", size = 1450891, upload-time = "2025-03-02T12:54:54.503Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/30/3d/64ad57c803f1fa1e963a7946b6e0fea4a70df53c1a7fed304586539c2bac/pytest-8.3.5-py3-none-any.whl", hash = "sha256:c69214aa47deac29fad6c2a4f590b9c4a9fdb16a403176fe154b79c0b4d4d820", size = 343634, upload-time = "2025-03-02T12:54:52.069Z" }, -] - [[package]] name = "pytest" version = "8.4.1" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.9'", -] dependencies = [ - { name = "colorama", marker = "(python_full_version >= '3.9' and sys_platform == 'win32') or (python_full_version < '3.9' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2') or (sys_platform != 'win32' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "exceptiongroup", marker = "(python_full_version >= '3.9' and python_full_version < '3.11') or (python_full_version < '3.9' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2') or (python_full_version >= '3.11' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "iniconfig", marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "packaging", marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "pluggy", marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "pygments", marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "tomli", marker = "(python_full_version >= '3.9' and python_full_version < '3.11') or (python_full_version < '3.9' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2') or (python_full_version >= '3.11' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "colorama", marker = "sys_platform == 'win32' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "exceptiongroup", marker = "python_full_version < '3.11' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, + { name = "pygments" }, + { name = "tomli", marker = "python_full_version < '3.11' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, ] sdist = { url = "https://files.pythonhosted.org/packages/08/ba/45911d754e8eba3d5a841a5ce61a65a685ff1798421ac054f85aa8747dfb/pytest-8.4.1.tar.gz", hash = "sha256:7c67fd69174877359ed9371ec3af8a3d2b04741818c51e5e99cc1742251fa93c", size = 1517714, upload-time = "2025-06-18T05:48:06.109Z" } wheels = [ @@ -1657,40 +947,20 @@ name = "pytest-asyncio" version = "0.24.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "pytest", version = "8.3.5", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "pytest", version = "8.4.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pytest" }, ] sdist = { url = "https://files.pythonhosted.org/packages/52/6d/c6cf50ce320cf8611df7a1254d86233b3df7cc07f9b5f5cbcb82e08aa534/pytest_asyncio-0.24.0.tar.gz", hash = "sha256:d081d828e576d85f875399194281e92bf8a68d60d72d1a2faf2feddb6c46b276", size = 49855, upload-time = "2024-08-22T08:03:18.145Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/96/31/6607dab48616902f76885dfcf62c08d929796fc3b2d2318faf9fd54dbed9/pytest_asyncio-0.24.0-py3-none-any.whl", hash = "sha256:a811296ed596b69bf0b6f3dc40f83bcaf341b155a269052d82efa2b25ac7037b", size = 18024, upload-time = "2024-08-22T08:03:15.536Z" }, ] -[[package]] -name = "pytest-xdist" -version = "3.6.1" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version < '3.9'", -] -dependencies = [ - { name = "execnet", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "pytest", version = "8.3.5", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/41/c4/3c310a19bc1f1e9ef50075582652673ef2bfc8cd62afef9585683821902f/pytest_xdist-3.6.1.tar.gz", hash = "sha256:ead156a4db231eec769737f57668ef58a2084a34b2e55c4a8fa20d861107300d", size = 84060, upload-time = "2024-04-28T19:29:54.414Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/6d/82/1d96bf03ee4c0fdc3c0cbe61470070e659ca78dc0086fb88b66c185e2449/pytest_xdist-3.6.1-py3-none-any.whl", hash = "sha256:9ed4adfb68a016610848639bb7e02c9352d5d9f03d04809919e2dafc3be4cca7", size = 46108, upload-time = "2024-04-28T19:29:52.813Z" }, -] - [[package]] name = "pytest-xdist" version = "3.7.0" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.9'", -] dependencies = [ - { name = "execnet", marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "pytest", version = "8.4.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "execnet" }, + { name = "pytest" }, ] sdist = { url = "https://files.pythonhosted.org/packages/49/dc/865845cfe987b21658e871d16e0a24e871e00884c545f246dd8f6f69edda/pytest_xdist-3.7.0.tar.gz", hash = "sha256:f9248c99a7c15b7d2f90715df93610353a485827bc06eefb6566d23f6400f126", size = 87550, upload-time = "2025-05-26T21:18:20.251Z" } wheels = [ @@ -1709,15 +979,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892, upload-time = "2024-03-01T18:36:18.57Z" }, ] -[[package]] -name = "pytz" -version = "2024.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/3a/31/3c70bf7603cc2dca0f19bdc53b4537a797747a58875b552c8c413d963a3f/pytz-2024.2.tar.gz", hash = "sha256:2aa355083c50a0f93fa581709deac0c9ad65cca8a9e9beac660adcbd493c798a", size = 319692, upload-time = "2024-09-11T02:24:47.91Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/11/c3/005fcca25ce078d2cc29fd559379817424e94885510568bc1bc53d7d5846/pytz-2024.2-py2.py3-none-any.whl", hash = "sha256:31c7c1817eb7fae7ca4b8c7ee50c72f93aa2dd863de768e1ef4245d426aa0725", size = 508002, upload-time = "2024-09-11T02:24:45.8Z" }, -] - [[package]] name = "respx" version = "0.22.0" @@ -1774,48 +1035,40 @@ name = "runloop-api-client" version = "0.66.1" source = { editable = "." } dependencies = [ - { name = "anyio", version = "4.5.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "anyio", version = "4.8.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "anyio" }, { name = "distro" }, { name = "httpx" }, - { name = "pydantic", version = "1.10.23", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'group-18-runloop-api-client-pydantic-v1'" }, - { name = "pydantic", version = "2.10.6", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "pydantic", version = "2.11.9", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pydantic", version = "1.10.22", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'group-18-runloop-api-client-pydantic-v1'" }, + { name = "pydantic", version = "2.10.3", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'group-18-runloop-api-client-pydantic-v2' or extra != 'group-18-runloop-api-client-pydantic-v1'" }, { name = "sniffio" }, { name = "typing-extensions" }, ] [package.optional-dependencies] aiohttp = [ - { name = "aiohttp", version = "3.10.11", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "aiohttp", version = "3.12.13", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "aiohttp" }, { name = "httpx-aiohttp" }, ] [package.dev-dependencies] dev = [ { name = "dirty-equals" }, - { name = "importlib-metadata", version = "8.5.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "importlib-metadata", version = "8.6.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "importlib-metadata" }, { name = "mypy" }, { name = "pyright" }, - { name = "pytest", version = "8.3.5", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "pytest", version = "8.4.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pytest" }, { name = "pytest-asyncio" }, - { name = "pytest-xdist", version = "3.6.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "pytest-xdist", version = "3.7.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pytest-xdist" }, { name = "respx" }, { name = "rich" }, { name = "ruff" }, - { name = "time-machine", version = "2.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "time-machine", version = "2.16.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "time-machine" }, ] pydantic-v1 = [ - { name = "pydantic", version = "1.10.23", source = { registry = "https://pypi.org/simple" } }, + { name = "pydantic", version = "1.10.22", source = { registry = "https://pypi.org/simple" } }, ] pydantic-v2 = [ - { name = "pydantic", version = "2.10.6", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version < '3.9' and extra == 'group-18-runloop-api-client-pydantic-v2') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "pydantic", version = "2.11.9", source = { registry = "https://pypi.org/simple" }, marker = "(python_full_version >= '3.9' and extra == 'group-18-runloop-api-client-pydantic-v2') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pydantic", version = "2.10.3", source = { registry = "https://pypi.org/simple" } }, ] [package.metadata] @@ -1866,95 +1119,12 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2", size = 10235, upload-time = "2024-02-25T23:20:01.196Z" }, ] -[[package]] -name = "time-machine" -version = "2.15.0" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version < '3.9'", -] -dependencies = [ - { name = "python-dateutil", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/b2/e8/82d358c4d53555f031c2343d1c235b56b9f3b0a60ac3adc555778fe87506/time_machine-2.15.0.tar.gz", hash = "sha256:ebd2e63baa117ded04b978813fcd1279d3fc6be2149c9cac75c716b6f1db774c", size = 25067, upload-time = "2024-08-06T11:12:18.578Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/67/47/35413db37da55865fdbf60649bcb948cc2559f420ef4e91e77e4e24c71b8/time_machine-2.15.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:892d016789b59950989b2db188dcd46cf16d34e8daf2343e33b679b0c5fd1001", size = 20779, upload-time = "2024-08-06T13:42:39.043Z" }, - { url = "https://files.pythonhosted.org/packages/e0/c3/fda6d2336737d0331eb55357db1dc916af14c4fda77c69ad8b3733b003c4/time_machine-2.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:4428bdae507996aa3fdeb4727bca09e26306fa64a502e7335207252684516cbf", size = 17040, upload-time = "2024-08-06T13:42:40.273Z" }, - { url = "https://files.pythonhosted.org/packages/36/e1/71200f24d668e5183e875a08ba5e557b6107c1b7d57fa6d54ac24ad10234/time_machine-2.15.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0302568338c8bd333ed0698231dbb781b70ead1a5579b4ac734b9bf88313229f", size = 34811, upload-time = "2024-08-06T13:42:43.632Z" }, - { url = "https://files.pythonhosted.org/packages/9e/2f/4b9289ea07978ad5c3469c872c7eeadf5f5b3a1dcebe2fb274c2486fc220/time_machine-2.15.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:18fc4740073e67071472c48355775ec6d1b93af5c675524b7de2474e0dcd8741", size = 32820, upload-time = "2024-08-06T13:42:41.347Z" }, - { url = "https://files.pythonhosted.org/packages/5f/9e/9f838c91d2248d716281af60dfea4131438c6ad6d7405ebc6e47f8c25c3b/time_machine-2.15.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:768d33b484a35da93731cc99bdc926b539240a78673216cdc6306833d9072350", size = 34635, upload-time = "2024-08-06T13:42:42.427Z" }, - { url = "https://files.pythonhosted.org/packages/f3/10/1048b5ba6de55779563f005de5fbfb764727bf9678ad7701cea480b3816c/time_machine-2.15.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:73a8c8160d2a170dadcad5b82fb5ee53236a19cec0996651cf4d21da0a2574d5", size = 34326, upload-time = "2024-08-06T13:42:45.683Z" }, - { url = "https://files.pythonhosted.org/packages/13/82/6b4df8e5abf754b0ccceeb59fa32486d28c65f67d4ada37ff8b1e9f52006/time_machine-2.15.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:09fd839a321a92aa8183206c383b9725eaf4e0a28a70e4cb87db292b352eeefb", size = 32639, upload-time = "2024-08-06T13:42:46.902Z" }, - { url = "https://files.pythonhosted.org/packages/cf/07/95e380c46136252401d97f613782a10061b3c11b61edaeb78e83aedc1a88/time_machine-2.15.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:838a6d117739f1ae6ecc45ec630fa694f41a85c0d07b1f3b1db2a6cc52c1808b", size = 34021, upload-time = "2024-08-06T13:42:48.294Z" }, - { url = "https://files.pythonhosted.org/packages/b6/0c/6595fa82bd70bc7e8065bfc6534e51a27c18978f7c158d6392c979cace2c/time_machine-2.15.0-cp310-cp310-win32.whl", hash = "sha256:d24d2ec74923b49bce7618e3e7762baa6be74e624d9829d5632321de102bf386", size = 19413, upload-time = "2024-08-06T13:42:49.579Z" }, - { url = "https://files.pythonhosted.org/packages/2f/3d/cb3c1cecfeb4b6423302ee1b2863617390500f67526f0fc1fb5641db05f6/time_machine-2.15.0-cp310-cp310-win_amd64.whl", hash = "sha256:95c8e7036cf442480d0bf6f5fde371e1eb6dbbf5391d7bdb8db73bd8a732b538", size = 20280, upload-time = "2024-08-06T13:42:52.548Z" }, - { url = "https://files.pythonhosted.org/packages/22/aa/96aaac88738369fba43d5cb076bb09290b1a2cbd84210bcc0a9a519c7970/time_machine-2.15.0-cp310-cp310-win_arm64.whl", hash = "sha256:660810cd27a8a94cb5e845e8f28a95e70b01ff0c45466d394c4a0cba5a0ae279", size = 18392, upload-time = "2024-08-06T13:42:53.945Z" }, - { url = "https://files.pythonhosted.org/packages/ce/54/829ab196c3306eb4cee95e3c8e7d004e15877b36479de5d2ecc72fc1d3d4/time_machine-2.15.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:674097dd54a0bbd555e7927092c74428c4c07268ad52bca38cfccc3214707e50", size = 20448, upload-time = "2024-08-06T13:42:58.809Z" }, - { url = "https://files.pythonhosted.org/packages/e1/48/a06f8c7db768db501a60210a48f3d37b7b3d65ca85aa8dc08147eb204b4a/time_machine-2.15.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4e83fd6112808d1d14d1a57397c6fa3bd71bb2f3b8800036e12366e3680819b9", size = 16897, upload-time = "2024-08-06T13:43:00.751Z" }, - { url = "https://files.pythonhosted.org/packages/e7/f8/73265927e3da54a417536dc3d8c9aad806b62b8133099a7ee12661aba1a3/time_machine-2.15.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b095a1de40ca1afaeae8df3f45e26b645094a1912e6e6871e725fcf06ecdb74a", size = 32789, upload-time = "2024-08-06T13:43:06.312Z" }, - { url = "https://files.pythonhosted.org/packages/8a/a4/bcf8ad40a4c6973a67aba5df7ed704dc34256835fb074cfb4d4caa0f93a5/time_machine-2.15.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4601fe7a6b74c6fd9207e614d9db2a20dd4befd4d314677a0feac13a67189707", size = 30911, upload-time = "2024-08-06T13:43:02.579Z" }, - { url = "https://files.pythonhosted.org/packages/13/87/a6de1b187f5468781e0e722c877323625227151cc8ffff363a7391b01149/time_machine-2.15.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:245ef73f9927b7d4909d554a6a0284dbc5dee9730adea599e430b37c9e9fa203", size = 32644, upload-time = "2024-08-06T13:43:04.457Z" }, - { url = "https://files.pythonhosted.org/packages/33/1f/7378d5a032467891a1005e546532223b97c53440c6359b1133696a5cb1ef/time_machine-2.15.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:704abc7f3403584cca9c01c5809812e0bd70632ea4251389fae4f45e11aad94f", size = 32472, upload-time = "2024-08-06T13:43:07.699Z" }, - { url = "https://files.pythonhosted.org/packages/68/14/2fab61ad2c9a831925bce3d5e341fa2108ba062c2de0c190569e1ee6a1c9/time_machine-2.15.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:6425001e50a0c82108caed438233066cea04d42a8fc9c49bfcf081a5b96e5b4e", size = 30882, upload-time = "2024-08-06T13:43:08.83Z" }, - { url = "https://files.pythonhosted.org/packages/8a/01/f5146b9956b548072000a87f3eb8dbb2591ada1516a5d889aa12b373948f/time_machine-2.15.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:5d4073b754f90b19f28d036ec5143d3fca3a75e4d4241d78790a6178b00bb373", size = 32176, upload-time = "2024-08-06T13:43:10.689Z" }, - { url = "https://files.pythonhosted.org/packages/ca/09/8a8488e6d3faf3cb68d078f27ca94aa3ba1bc08d5f804265c590208a70f5/time_machine-2.15.0-cp311-cp311-win32.whl", hash = "sha256:8817b0f7d7830215261b18db83c9c3ef1da6bb64da5c292d7c70b9a46e5a6745", size = 19305, upload-time = "2024-08-06T13:43:12.568Z" }, - { url = "https://files.pythonhosted.org/packages/75/33/d8411b197a08eedb3ce086022cdf4faf1f15738607a2d943fd5286f57fdd/time_machine-2.15.0-cp311-cp311-win_amd64.whl", hash = "sha256:ddad27a62df2ea47b7b483009fbfcf167a71d702cbd8e2eefd9ddc1c93146658", size = 20210, upload-time = "2024-08-06T13:43:13.731Z" }, - { url = "https://files.pythonhosted.org/packages/8c/f5/e9b5d7be612403e570a42af5c2823506877e726f77f2d6ff272d72d0aed3/time_machine-2.15.0-cp311-cp311-win_arm64.whl", hash = "sha256:6f021aa2dbd8fbfe54d3fa2258518129108b7496922b3bcff2cf5991078eec67", size = 18278, upload-time = "2024-08-06T13:43:17.612Z" }, - { url = "https://files.pythonhosted.org/packages/49/47/46bf332f4ecd7f35e197131b9c23daa39423cf71b814e36e9d5df3cf2380/time_machine-2.15.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:a22f47c34ee1fcf7d93a8c5c93135499aac879d9d5d8f820bd28571a30fdabcd", size = 20436, upload-time = "2024-08-06T15:42:15.185Z" }, - { url = "https://files.pythonhosted.org/packages/f1/36/9990f16868ffdefe6b5aecfdfbcb11718230e414ca61a887fbee884f70e5/time_machine-2.15.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:b684f8ecdeacd6baabc17b15ac1b054ca62029193e6c5367ef00b3516671de80", size = 16926, upload-time = "2024-08-06T15:42:17.284Z" }, - { url = "https://files.pythonhosted.org/packages/ca/2d/007955a0899cd079a400bc204c03edc76274de2471d94ca235ff587a6eba/time_machine-2.15.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5f7add997684bc6141e1c80f6ba0c38ffe316ba277a4074e61b1b7b4f5a172bf", size = 17157, upload-time = "2024-08-06T11:12:16.25Z" }, - { url = "https://files.pythonhosted.org/packages/7a/e2/66d26450f9bfd1b019abdefbf0c62e760efc8992c7bf88d6c18f7ea6b94a/time_machine-2.15.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:31af56399bf7c9ef76a3f7b6d9471dffa8f06ee373c194a374b69523f9061de9", size = 34005, upload-time = "2024-08-06T15:42:22.266Z" }, - { url = "https://files.pythonhosted.org/packages/46/2c/dc2c42200aee6b47a55274d984736f7507ecfbfd0345114ec511ec444bef/time_machine-2.15.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f5b94cba3edfc54bcb3ab5be616a2f50fa48be438e5af970824efdf882d1bc31", size = 31926, upload-time = "2024-08-06T15:42:19.044Z" }, - { url = "https://files.pythonhosted.org/packages/87/59/10d8faecbd233b0da831eb9973c3e650c83fb3d443edb607b6b26c9688ac/time_machine-2.15.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3862dda89bdb05f9d521b08fdcb24b19a7dd9f559ae324f4301ba7a07b6eea64", size = 33685, upload-time = "2024-08-06T15:42:20.565Z" }, - { url = "https://files.pythonhosted.org/packages/2e/a4/702ad9e328cbc7b3f1833dee4886d0994e52bc2d9640effa64bccc7740fa/time_machine-2.15.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e1790481a6b9ce38888f22ce30710244067898c3ac4805a0e061e381f3db3506", size = 33609, upload-time = "2024-08-06T15:42:23.817Z" }, - { url = "https://files.pythonhosted.org/packages/a0/9d/6009d28ad395a45b5bb91af31616494b4e61d6d9df252d0e5933cd3aa8f1/time_machine-2.15.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:a731c03bc00552ee6cc685a59616d36003124e7e04c6ddf65c2c47f1c3d85480", size = 31737, upload-time = "2024-08-06T15:42:25.175Z" }, - { url = "https://files.pythonhosted.org/packages/36/22/b55df08cf48d46af93ee2f4310dd88c8519bc5f98afd24af57a81a5d5272/time_machine-2.15.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e6776840aea3ff5ab6924b50117957da62db51b109b3b491c0d5817a804b1a8e", size = 33253, upload-time = "2024-08-06T15:42:26.511Z" }, - { url = "https://files.pythonhosted.org/packages/52/d7/bb5e92f0b0268cd13baad874d82b0e964a847cf52740464abeec48dc1642/time_machine-2.15.0-cp312-cp312-win32.whl", hash = "sha256:9479530e3fce65f6149058071fa4df8150025f15b43b103445f619842981a87c", size = 19369, upload-time = "2024-08-06T15:42:27.682Z" }, - { url = "https://files.pythonhosted.org/packages/f4/33/276537ba292fc7ee67e6aef7566b2a6b313dbc4d479e5e80eed43094ef48/time_machine-2.15.0-cp312-cp312-win_amd64.whl", hash = "sha256:b5f3ab4185c1f72010846ca9fccb08349e23a2b52982a18d9870e848ce9f1c86", size = 20219, upload-time = "2024-08-06T15:42:29.475Z" }, - { url = "https://files.pythonhosted.org/packages/e0/0e/e8b75032248f59a2bc5c125d3a41242b1e577caa07585c42b22373d6466d/time_machine-2.15.0-cp312-cp312-win_arm64.whl", hash = "sha256:c0473dfa8f17c6a9a250b2bd6a5b62af3aa7d22518f701649115f1085d5e35ab", size = 18297, upload-time = "2024-08-06T15:42:31.116Z" }, - { url = "https://files.pythonhosted.org/packages/7c/a1/ebe212530628aa29a86a771ca77cb2d1ead667382cfa89a3fb849e3f0108/time_machine-2.15.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:f50f10058b884d45cd8a50423bf561b1f9f9df7058abeb8b318700c8bcf4bb54", size = 20492, upload-time = "2024-08-06T13:43:20.546Z" }, - { url = "https://files.pythonhosted.org/packages/29/0d/2a19951729e50d8809e161e533585c0be5ae39c0cf40140877353847b9b5/time_machine-2.15.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:df6f618b98f0848fd8d07039541e10f23db679d8283f8719e870a98e1ef8e639", size = 16961, upload-time = "2024-08-06T13:43:23.227Z" }, - { url = "https://files.pythonhosted.org/packages/85/eb/33cf2173758b128f55c880c492e17b70f6c325e7bee879f9b0171cfe02a0/time_machine-2.15.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:52468a0784544eba708c0ae6bc5e8c5dcfd685495a60f7f74028662c984bd9cd", size = 34051, upload-time = "2024-08-06T13:43:26.529Z" }, - { url = "https://files.pythonhosted.org/packages/e1/23/da9a7935a7be952ab6163caf976b6bad049f6e117f3a396ecc381b077cb6/time_machine-2.15.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c08800c28160f4d32ca510128b4e201a43c813e7a2dd53178fa79ebe050eba13", size = 31966, upload-time = "2024-08-06T13:43:24.344Z" }, - { url = "https://files.pythonhosted.org/packages/0b/0d/a8e3cbd91ffa98b0fa50b6e29d03151f37aa04cca4dd658e33cdf2b4731e/time_machine-2.15.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65d395211736d9844537a530287a7c64b9fda1d353e899a0e1723986a0859154", size = 33727, upload-time = "2024-08-06T13:43:25.407Z" }, - { url = "https://files.pythonhosted.org/packages/07/53/c084031980706517cfbae9f462e455d61c7cbf9b66a8a83bcc5b79d00836/time_machine-2.15.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:3b177d334a35bf2ce103bfe4e0e416e4ee824dd33386ea73fa7491c17cc61897", size = 33690, upload-time = "2024-08-06T13:43:28.145Z" }, - { url = "https://files.pythonhosted.org/packages/a0/30/5c87e8709ba00c893faf8a9bddf06abf317fdc6103fe78bdf99c53ab444f/time_machine-2.15.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:9a6a9342fae113b12aab42c790880c549d9ba695b8deff27ee08096eedd67569", size = 31809, upload-time = "2024-08-06T13:43:29.645Z" }, - { url = "https://files.pythonhosted.org/packages/04/7b/92ac7c556cd123bf8b23dbae3cf4a273c276110b87d0c4b5600c2cec8e70/time_machine-2.15.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:bcbb25029ee8756f10c6473cea5ef21707a1d9a8752cdf29fad3a5f34aa4a313", size = 33325, upload-time = "2024-08-06T13:43:30.832Z" }, - { url = "https://files.pythonhosted.org/packages/e9/71/36c74bab3d4e4385d31610b367da1535a36d17358df058e0920a7510e17c/time_machine-2.15.0-cp313-cp313-win32.whl", hash = "sha256:29b988b1f09f2a083b12b6b054787b799ae91ee15bb0e9de3e48f880e4d68674", size = 19397, upload-time = "2024-08-06T13:43:31.996Z" }, - { url = "https://files.pythonhosted.org/packages/a4/69/ea5976c43a673894f2fa85a05b28a610b474472f393e59722a6946f7070b/time_machine-2.15.0-cp313-cp313-win_amd64.whl", hash = "sha256:d828721dcbcb94b904a6b25df67c2513ecd24cd9e36694f38b9f0fa71c7c6103", size = 20242, upload-time = "2024-08-06T13:43:33.11Z" }, - { url = "https://files.pythonhosted.org/packages/cc/c8/26367d0b8dfaf7445576fe0051bff61b8f5be752e7bf3e8807ed7fa3a343/time_machine-2.15.0-cp313-cp313-win_arm64.whl", hash = "sha256:008bd668d933b1a029c81805bcdc0132390c2545b103cf8e6709e3adbc37989d", size = 18337, upload-time = "2024-08-06T13:43:34.227Z" }, - { url = "https://files.pythonhosted.org/packages/97/54/eeac8568cad4f3eb255cc78f1fa2c36147afd3fcba770283bf2b2a188b33/time_machine-2.15.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e99689f6c6b9ca6e2fc7a75d140e38c5a7985dab61fe1f4e506268f7e9844e05", size = 20674, upload-time = "2024-08-06T13:42:05.072Z" }, - { url = "https://files.pythonhosted.org/packages/5c/82/488341de4c03c0856aaf5db74f2a8fe18dcc7657401334c54c4aa6cb0fc6/time_machine-2.15.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:671e88a6209a1cf415dc0f8c67d2b2d3b55b436cc63801a518f9800ebd752959", size = 16990, upload-time = "2024-08-06T13:42:07.508Z" }, - { url = "https://files.pythonhosted.org/packages/9c/cc/0ca559e71be4eb05917d02364f4d356351b31dd0d6ff3c4c86fa4de0a03e/time_machine-2.15.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0b2d28daf4cabc698aafb12135525d87dc1f2f893cbd29a8a6fe0d8d36d1342c", size = 35501, upload-time = "2024-08-06T13:42:12.348Z" }, - { url = "https://files.pythonhosted.org/packages/92/a0/14905a5feecc6d2e87ebe6dd2b044358422836ed173071cdc1245aa5ec88/time_machine-2.15.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4cd9f057457d12604be18b623bcd5ae7d0b917ad66cb510ee1135d5f123666e2", size = 33430, upload-time = "2024-08-06T13:42:09.625Z" }, - { url = "https://files.pythonhosted.org/packages/19/a4/282b65b4d835dfd7b863777cc4206bec375285bda884dc22bd1264716f6a/time_machine-2.15.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:97dc6793e512a62ba9eab250134a2e67372c16ae9948e73d27c2ef355356e2e1", size = 35366, upload-time = "2024-08-06T13:42:10.957Z" }, - { url = "https://files.pythonhosted.org/packages/93/8e/f7db3f641f1ff86b98594c9cf8d71c8d292cc2bde06c1369ce4745494cc5/time_machine-2.15.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:0630a32e9ebcf2fac3704365b31e271fef6eabd6fedfa404cd8dbd244f7fc84d", size = 34373, upload-time = "2024-08-06T13:42:13.419Z" }, - { url = "https://files.pythonhosted.org/packages/3d/9f/8c8ac57ccb29e692e0940e58515a9afb844d2d11b7f057a0fe153bfe4877/time_machine-2.15.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:617c9a92d8d8f60d5ef39e76596620503752a09f834a218e5b83be352fdd6c91", size = 32667, upload-time = "2024-08-06T13:42:15.293Z" }, - { url = "https://files.pythonhosted.org/packages/ec/e7/f0c6f9507b0bbfdec54d256b6efc9417ae1a01ce6320c2a42235b807cf86/time_machine-2.15.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:3f7eadd820e792de33a9ec91f8178a2b9088e4e8b9a166953419ddc4ec5f7cfe", size = 34070, upload-time = "2024-08-06T13:42:17.147Z" }, - { url = "https://files.pythonhosted.org/packages/20/82/ac2d8343db8dade1372457d7a5694f069882d9eac110ddce2643ef0501aa/time_machine-2.15.0-cp38-cp38-win32.whl", hash = "sha256:b7b647684eb2e1fd1e5e6b101249d5fe9d6117c117b5e336ad8dd75af48d2d1f", size = 19396, upload-time = "2024-08-06T13:42:18.256Z" }, - { url = "https://files.pythonhosted.org/packages/3a/12/ac7bb1e932536fce359e021a62c2a5a30c4e470293d6f8b2fb47077562dc/time_machine-2.15.0-cp38-cp38-win_amd64.whl", hash = "sha256:b48abd7745caec1a78a16a048966cde14ff6ccb04d471a7201532648d3f77d14", size = 20266, upload-time = "2024-08-06T13:42:20.304Z" }, - { url = "https://files.pythonhosted.org/packages/ec/bf/d9689e1fa669e575c3ed57bf4f9205a9b5fbe703dc7ef89ba5ce9aa39a38/time_machine-2.15.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:8c2b1c91b437133c672e374857eccb1dd2c2d9f8477ae3b35138382d5ef19846", size = 20775, upload-time = "2024-08-06T13:42:22.424Z" }, - { url = "https://files.pythonhosted.org/packages/d8/4b/4314a7882b470c52cd527601107b1163e19d37fb1eb31eea0f8d73d0b178/time_machine-2.15.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:79bf1ef6850182e09d86e61fa31717da56014a3b2234afb025fca1f2a43ac07b", size = 17037, upload-time = "2024-08-06T13:42:23.539Z" }, - { url = "https://files.pythonhosted.org/packages/f1/b8/adf2f8b8e10f6f5e498b0cddd103f6520144af53fb27b5a01eca50812a92/time_machine-2.15.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:658ea8477fa020f08435fb7277635eb0b50cd5206b9d4cbe10e9a5466b01f855", size = 34511, upload-time = "2024-08-06T13:42:28.63Z" }, - { url = "https://files.pythonhosted.org/packages/e3/86/fda41a9e8115fd377f2d4d15c91a414f75cb8f2cd7f8bde974855a0f381f/time_machine-2.15.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c947135750d20f35acac290c34f1acf5771fc166a3fbc0e3816a97c756aaa5f5", size = 32533, upload-time = "2024-08-06T13:42:25.709Z" }, - { url = "https://files.pythonhosted.org/packages/cb/7e/1e2e69fee659f00715f12392cabea1920245504862eab2caac6e3f30de5b/time_machine-2.15.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1dee3a0dd1866988c49a5d00564404db9bcdf49ca92f9c4e8b6c99609d64e698", size = 34348, upload-time = "2024-08-06T13:42:27.478Z" }, - { url = "https://files.pythonhosted.org/packages/41/da/8db2df73ebe9f23af25b05f1720b108a145805a8c83d5ff8248e2d3cbcfa/time_machine-2.15.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:c596920d6017702a36e3a43fd8110a84e87d6229f30b84bd5640cbae9b5145da", size = 34081, upload-time = "2024-08-06T13:42:29.742Z" }, - { url = "https://files.pythonhosted.org/packages/a7/c7/9202404f8885257c09c98d3e5186b989b6b482a2983dc24c81bd0333e668/time_machine-2.15.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:014589d0edd4aa14f8d63985745565e8cbbe48461d6c004a96000b47f6b44e78", size = 32357, upload-time = "2024-08-06T13:42:30.884Z" }, - { url = "https://files.pythonhosted.org/packages/4d/79/482a69c31259c3c2efcd9e73ea4a0a4d315103836c1667875612288bca28/time_machine-2.15.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:5ff655716cd13a242eef8cf5d368074e8b396ff86508a5933e7cff4f2b3eb3c2", size = 33742, upload-time = "2024-08-06T13:42:33.213Z" }, - { url = "https://files.pythonhosted.org/packages/f0/39/89725d12a3552bb9113528d8f9aa7188e1660b377b74e7d72e8ab5eeff06/time_machine-2.15.0-cp39-cp39-win32.whl", hash = "sha256:1168eebd7af7e6e3e2fd378c16ca917b97dd81c89a1f1f9e1daa985c81699d90", size = 19410, upload-time = "2024-08-06T13:42:34.333Z" }, - { url = "https://files.pythonhosted.org/packages/89/0c/50e86c4a7b72d2bdc658492b13e804f933814f86f34c4350758d1ab87586/time_machine-2.15.0-cp39-cp39-win_amd64.whl", hash = "sha256:c344eb09fcfbf71e5b5847d4f188fec98e1c3a976125ef571eac5f1c39e7a5e5", size = 20281, upload-time = "2024-08-06T13:42:36.174Z" }, - { url = "https://files.pythonhosted.org/packages/f6/4d/f8ad3b0c50a268a9ea766c9533866bba6a7717a5324c84e356abb7347fa4/time_machine-2.15.0-cp39-cp39-win_arm64.whl", hash = "sha256:899f1a856b3bebb82b6cbc3c0014834b583b83f246b28e462a031ec1b766130b", size = 18387, upload-time = "2024-08-06T13:42:37.271Z" }, -] - [[package]] name = "time-machine" version = "2.16.0" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.9'", -] dependencies = [ - { name = "python-dateutil", marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "python-dateutil" }, ] sdist = { url = "https://files.pythonhosted.org/packages/fb/dd/5022939b9cadefe3af04f4012186c29b8afbe858b1ec2cfa38baeec94dab/time_machine-2.16.0.tar.gz", hash = "sha256:4a99acc273d2f98add23a89b94d4dd9e14969c01214c8514bfa78e4e9364c7e2", size = 24626, upload-time = "2024-10-08T14:21:59.734Z" } wheels = [ @@ -2063,142 +1233,14 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/26/9f/ad63fc0248c5379346306f8668cda6e2e2e9c95e01216d2b8ffd9ff037d0/typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d", size = 37438, upload-time = "2024-06-07T18:52:13.582Z" }, ] -[[package]] -name = "typing-inspection" -version = "0.4.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "typing-extensions", marker = "(python_full_version >= '3.9' and extra != 'group-18-runloop-api-client-pydantic-v1') or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/f8/b1/0c11f5058406b3af7609f121aaa6b609744687f1d158b3c3a5bf4cc94238/typing_inspection-0.4.1.tar.gz", hash = "sha256:6ae134cc0203c33377d43188d4064e9b357dba58cff3185f22924610e70a9d28", size = 75726, upload-time = "2025-05-21T18:55:23.885Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/17/69/cd203477f944c353c31bade965f880aa1061fd6bf05ded0726ca845b6ff7/typing_inspection-0.4.1-py3-none-any.whl", hash = "sha256:389055682238f53b04f7badcb49b989835495a96700ced5dab2d8feae4b26f51", size = 14552, upload-time = "2025-05-21T18:55:22.152Z" }, -] - -[[package]] -name = "yarl" -version = "1.15.2" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version < '3.9'", -] -dependencies = [ - { name = "idna", marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "multidict", version = "6.1.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "propcache", version = "0.2.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/06/e1/d5427a061819c9f885f58bb0467d02a523f1aec19f9e5f9c82ce950d90d3/yarl-1.15.2.tar.gz", hash = "sha256:a39c36f4218a5bb668b4f06874d676d35a035ee668e6e7e3538835c703634b84", size = 169318, upload-time = "2024-10-13T18:48:04.311Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/61/f8/6b1bbc6f597d8937ad8661c042aa6bdbbe46a3a6e38e2c04214b9c82e804/yarl-1.15.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e4ee8b8639070ff246ad3649294336b06db37a94bdea0d09ea491603e0be73b8", size = 136479, upload-time = "2024-10-13T18:44:32.077Z" }, - { url = "https://files.pythonhosted.org/packages/61/e0/973c0d16b1cb710d318b55bd5d019a1ecd161d28670b07d8d9df9a83f51f/yarl-1.15.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:a7cf963a357c5f00cb55b1955df8bbe68d2f2f65de065160a1c26b85a1e44172", size = 88671, upload-time = "2024-10-13T18:44:35.334Z" }, - { url = "https://files.pythonhosted.org/packages/16/df/241cfa1cf33b96da2c8773b76fe3ee58e04cb09ecfe794986ec436ae97dc/yarl-1.15.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:43ebdcc120e2ca679dba01a779333a8ea76b50547b55e812b8b92818d604662c", size = 86578, upload-time = "2024-10-13T18:44:37.58Z" }, - { url = "https://files.pythonhosted.org/packages/02/a4/ee2941d1f93600d921954a0850e20581159772304e7de49f60588e9128a2/yarl-1.15.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3433da95b51a75692dcf6cc8117a31410447c75a9a8187888f02ad45c0a86c50", size = 307212, upload-time = "2024-10-13T18:44:39.932Z" }, - { url = "https://files.pythonhosted.org/packages/08/64/2e6561af430b092b21c7a867ae3079f62e1532d3e51fee765fd7a74cef6c/yarl-1.15.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:38d0124fa992dbacd0c48b1b755d3ee0a9f924f427f95b0ef376556a24debf01", size = 321589, upload-time = "2024-10-13T18:44:42.527Z" }, - { url = "https://files.pythonhosted.org/packages/f8/af/056ab318a7117fa70f6ab502ff880e47af973948d1d123aff397cd68499c/yarl-1.15.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ded1b1803151dd0f20a8945508786d57c2f97a50289b16f2629f85433e546d47", size = 319443, upload-time = "2024-10-13T18:44:45.03Z" }, - { url = "https://files.pythonhosted.org/packages/99/d1/051b0bc2c90c9a2618bab10a9a9a61a96ddb28c7c54161a5c97f9e625205/yarl-1.15.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ace4cad790f3bf872c082366c9edd7f8f8f77afe3992b134cfc810332206884f", size = 310324, upload-time = "2024-10-13T18:44:47.675Z" }, - { url = "https://files.pythonhosted.org/packages/23/1b/16df55016f9ac18457afda165031086bce240d8bcf494501fb1164368617/yarl-1.15.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c77494a2f2282d9bbbbcab7c227a4d1b4bb829875c96251f66fb5f3bae4fb053", size = 300428, upload-time = "2024-10-13T18:44:49.431Z" }, - { url = "https://files.pythonhosted.org/packages/83/a5/5188d1c575139a8dfd90d463d56f831a018f41f833cdf39da6bd8a72ee08/yarl-1.15.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:b7f227ca6db5a9fda0a2b935a2ea34a7267589ffc63c8045f0e4edb8d8dcf956", size = 307079, upload-time = "2024-10-13T18:44:51.96Z" }, - { url = "https://files.pythonhosted.org/packages/ba/4e/2497f8f2b34d1a261bebdbe00066242eacc9a7dccd4f02ddf0995014290a/yarl-1.15.2-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:31561a5b4d8dbef1559b3600b045607cf804bae040f64b5f5bca77da38084a8a", size = 305835, upload-time = "2024-10-13T18:44:53.83Z" }, - { url = "https://files.pythonhosted.org/packages/91/db/40a347e1f8086e287a53c72dc333198816885bc770e3ecafcf5eaeb59311/yarl-1.15.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:3e52474256a7db9dcf3c5f4ca0b300fdea6c21cca0148c8891d03a025649d935", size = 311033, upload-time = "2024-10-13T18:44:56.464Z" }, - { url = "https://files.pythonhosted.org/packages/2f/a6/1500e1e694616c25eed6bf8c1aacc0943f124696d2421a07ae5e9ee101a5/yarl-1.15.2-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:0e1af74a9529a1137c67c887ed9cde62cff53aa4d84a3adbec329f9ec47a3936", size = 326317, upload-time = "2024-10-13T18:44:59.015Z" }, - { url = "https://files.pythonhosted.org/packages/37/db/868d4b59cc76932ce880cc9946cd0ae4ab111a718494a94cb50dd5b67d82/yarl-1.15.2-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:15c87339490100c63472a76d87fe7097a0835c705eb5ae79fd96e343473629ed", size = 324196, upload-time = "2024-10-13T18:45:00.772Z" }, - { url = "https://files.pythonhosted.org/packages/bd/41/b6c917c2fde2601ee0b45c82a0c502dc93e746dea469d3a6d1d0a24749e8/yarl-1.15.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:74abb8709ea54cc483c4fb57fb17bb66f8e0f04438cff6ded322074dbd17c7ec", size = 317023, upload-time = "2024-10-13T18:45:03.427Z" }, - { url = "https://files.pythonhosted.org/packages/b0/85/2cde6b656fd83c474f19606af3f7a3e94add8988760c87a101ee603e7b8f/yarl-1.15.2-cp310-cp310-win32.whl", hash = "sha256:ffd591e22b22f9cb48e472529db6a47203c41c2c5911ff0a52e85723196c0d75", size = 78136, upload-time = "2024-10-13T18:45:05.173Z" }, - { url = "https://files.pythonhosted.org/packages/ef/3c/4414901b0588427870002b21d790bd1fad142a9a992a22e5037506d0ed9d/yarl-1.15.2-cp310-cp310-win_amd64.whl", hash = "sha256:1695497bb2a02a6de60064c9f077a4ae9c25c73624e0d43e3aa9d16d983073c2", size = 84231, upload-time = "2024-10-13T18:45:07.622Z" }, - { url = "https://files.pythonhosted.org/packages/4a/59/3ae125c97a2a8571ea16fdf59fcbd288bc169e0005d1af9946a90ea831d9/yarl-1.15.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9fcda20b2de7042cc35cf911702fa3d8311bd40055a14446c1e62403684afdc5", size = 136492, upload-time = "2024-10-13T18:45:09.962Z" }, - { url = "https://files.pythonhosted.org/packages/f9/2b/efa58f36b582db45b94c15e87803b775eb8a4ca0db558121a272e67f3564/yarl-1.15.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:0545de8c688fbbf3088f9e8b801157923be4bf8e7b03e97c2ecd4dfa39e48e0e", size = 88614, upload-time = "2024-10-13T18:45:12.329Z" }, - { url = "https://files.pythonhosted.org/packages/82/69/eb73c0453a2ff53194df485dc7427d54e6cb8d1180fcef53251a8e24d069/yarl-1.15.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:fbda058a9a68bec347962595f50546a8a4a34fd7b0654a7b9697917dc2bf810d", size = 86607, upload-time = "2024-10-13T18:45:13.88Z" }, - { url = "https://files.pythonhosted.org/packages/48/4e/89beaee3a4da0d1c6af1176d738cff415ff2ad3737785ee25382409fe3e3/yarl-1.15.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d1ac2bc069f4a458634c26b101c2341b18da85cb96afe0015990507efec2e417", size = 334077, upload-time = "2024-10-13T18:45:16.217Z" }, - { url = "https://files.pythonhosted.org/packages/da/e8/8fcaa7552093f94c3f327783e2171da0eaa71db0c267510898a575066b0f/yarl-1.15.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cd126498171f752dd85737ab1544329a4520c53eed3997f9b08aefbafb1cc53b", size = 347365, upload-time = "2024-10-13T18:45:18.812Z" }, - { url = "https://files.pythonhosted.org/packages/be/fa/dc2002f82a89feab13a783d3e6b915a3a2e0e83314d9e3f6d845ee31bfcc/yarl-1.15.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3db817b4e95eb05c362e3b45dafe7144b18603e1211f4a5b36eb9522ecc62bcf", size = 344823, upload-time = "2024-10-13T18:45:20.644Z" }, - { url = "https://files.pythonhosted.org/packages/ae/c8/c4a00fe7f2aa6970c2651df332a14c88f8baaedb2e32d6c3b8c8a003ea74/yarl-1.15.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:076b1ed2ac819933895b1a000904f62d615fe4533a5cf3e052ff9a1da560575c", size = 337132, upload-time = "2024-10-13T18:45:22.487Z" }, - { url = "https://files.pythonhosted.org/packages/07/bf/84125f85f44bf2af03f3cf64e87214b42cd59dcc8a04960d610a9825f4d4/yarl-1.15.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f8cfd847e6b9ecf9f2f2531c8427035f291ec286c0a4944b0a9fce58c6446046", size = 326258, upload-time = "2024-10-13T18:45:25.049Z" }, - { url = "https://files.pythonhosted.org/packages/00/19/73ad8122b2fa73fe22e32c24b82a6c053cf6c73e2f649b73f7ef97bee8d0/yarl-1.15.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:32b66be100ac5739065496c74c4b7f3015cef792c3174982809274d7e51b3e04", size = 336212, upload-time = "2024-10-13T18:45:26.808Z" }, - { url = "https://files.pythonhosted.org/packages/39/1d/2fa4337d11f6587e9b7565f84eba549f2921494bc8b10bfe811079acaa70/yarl-1.15.2-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:34a2d76a1984cac04ff8b1bfc939ec9dc0914821264d4a9c8fd0ed6aa8d4cfd2", size = 330397, upload-time = "2024-10-13T18:45:29.112Z" }, - { url = "https://files.pythonhosted.org/packages/39/ab/dce75e06806bcb4305966471ead03ce639d8230f4f52c32bd614d820c044/yarl-1.15.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:0afad2cd484908f472c8fe2e8ef499facee54a0a6978be0e0cff67b1254fd747", size = 334985, upload-time = "2024-10-13T18:45:31.709Z" }, - { url = "https://files.pythonhosted.org/packages/c1/98/3f679149347a5e34c952bf8f71a387bc96b3488fae81399a49f8b1a01134/yarl-1.15.2-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:c68e820879ff39992c7f148113b46efcd6ec765a4865581f2902b3c43a5f4bbb", size = 356033, upload-time = "2024-10-13T18:45:34.325Z" }, - { url = "https://files.pythonhosted.org/packages/f7/8c/96546061c19852d0a4b1b07084a58c2e8911db6bcf7838972cff542e09fb/yarl-1.15.2-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:98f68df80ec6ca3015186b2677c208c096d646ef37bbf8b49764ab4a38183931", size = 357710, upload-time = "2024-10-13T18:45:36.216Z" }, - { url = "https://files.pythonhosted.org/packages/01/45/ade6fb3daf689816ebaddb3175c962731edf300425c3254c559b6d0dcc27/yarl-1.15.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:3c56ec1eacd0a5d35b8a29f468659c47f4fe61b2cab948ca756c39b7617f0aa5", size = 345532, upload-time = "2024-10-13T18:45:38.123Z" }, - { url = "https://files.pythonhosted.org/packages/e7/d7/8de800d3aecda0e64c43e8fc844f7effc8731a6099fa0c055738a2247504/yarl-1.15.2-cp311-cp311-win32.whl", hash = "sha256:eedc3f247ee7b3808ea07205f3e7d7879bc19ad3e6222195cd5fbf9988853e4d", size = 78250, upload-time = "2024-10-13T18:45:39.908Z" }, - { url = "https://files.pythonhosted.org/packages/3a/6c/69058bbcfb0164f221aa30e0cd1a250f6babb01221e27c95058c51c498ca/yarl-1.15.2-cp311-cp311-win_amd64.whl", hash = "sha256:0ccaa1bc98751fbfcf53dc8dfdb90d96e98838010fc254180dd6707a6e8bb179", size = 84492, upload-time = "2024-10-13T18:45:42.286Z" }, - { url = "https://files.pythonhosted.org/packages/e0/d1/17ff90e7e5b1a0b4ddad847f9ec6a214b87905e3a59d01bff9207ce2253b/yarl-1.15.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:82d5161e8cb8f36ec778fd7ac4d740415d84030f5b9ef8fe4da54784a1f46c94", size = 136721, upload-time = "2024-10-13T18:45:43.876Z" }, - { url = "https://files.pythonhosted.org/packages/44/50/a64ca0577aeb9507f4b672f9c833d46cf8f1e042ce2e80c11753b936457d/yarl-1.15.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:fa2bea05ff0a8fb4d8124498e00e02398f06d23cdadd0fe027d84a3f7afde31e", size = 88954, upload-time = "2024-10-13T18:45:46.305Z" }, - { url = "https://files.pythonhosted.org/packages/c9/0a/a30d0b02046d4088c1fd32d85d025bd70ceb55f441213dee14d503694f41/yarl-1.15.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:99e12d2bf587b44deb74e0d6170fec37adb489964dbca656ec41a7cd8f2ff178", size = 86692, upload-time = "2024-10-13T18:45:47.992Z" }, - { url = "https://files.pythonhosted.org/packages/06/0b/7613decb8baa26cba840d7ea2074bd3c5e27684cbcb6d06e7840d6c5226c/yarl-1.15.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:243fbbbf003754fe41b5bdf10ce1e7f80bcc70732b5b54222c124d6b4c2ab31c", size = 325762, upload-time = "2024-10-13T18:45:49.69Z" }, - { url = "https://files.pythonhosted.org/packages/97/f5/b8c389a58d1eb08f89341fc1bbcc23a0341f7372185a0a0704dbdadba53a/yarl-1.15.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:856b7f1a7b98a8c31823285786bd566cf06226ac4f38b3ef462f593c608a9bd6", size = 335037, upload-time = "2024-10-13T18:45:51.932Z" }, - { url = "https://files.pythonhosted.org/packages/cb/f9/d89b93a7bb8b66e01bf722dcc6fec15e11946e649e71414fd532b05c4d5d/yarl-1.15.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:553dad9af802a9ad1a6525e7528152a015b85fb8dbf764ebfc755c695f488367", size = 334221, upload-time = "2024-10-13T18:45:54.548Z" }, - { url = "https://files.pythonhosted.org/packages/10/77/1db077601998e0831a540a690dcb0f450c31f64c492e993e2eaadfbc7d31/yarl-1.15.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:30c3ff305f6e06650a761c4393666f77384f1cc6c5c0251965d6bfa5fbc88f7f", size = 330167, upload-time = "2024-10-13T18:45:56.675Z" }, - { url = "https://files.pythonhosted.org/packages/3b/c2/e5b7121662fd758656784fffcff2e411c593ec46dc9ec68e0859a2ffaee3/yarl-1.15.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:353665775be69bbfc6d54c8d134bfc533e332149faeddd631b0bc79df0897f46", size = 317472, upload-time = "2024-10-13T18:45:58.815Z" }, - { url = "https://files.pythonhosted.org/packages/c6/f3/41e366c17e50782651b192ba06a71d53500cc351547816bf1928fb043c4f/yarl-1.15.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:f4fe99ce44128c71233d0d72152db31ca119711dfc5f2c82385ad611d8d7f897", size = 330896, upload-time = "2024-10-13T18:46:01.126Z" }, - { url = "https://files.pythonhosted.org/packages/79/a2/d72e501bc1e33e68a5a31f584fe4556ab71a50a27bfd607d023f097cc9bb/yarl-1.15.2-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:9c1e3ff4b89cdd2e1a24c214f141e848b9e0451f08d7d4963cb4108d4d798f1f", size = 328787, upload-time = "2024-10-13T18:46:02.991Z" }, - { url = "https://files.pythonhosted.org/packages/9d/ba/890f7e1ea17f3c247748548eee876528ceb939e44566fa7d53baee57e5aa/yarl-1.15.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:711bdfae4e699a6d4f371137cbe9e740dc958530cb920eb6f43ff9551e17cfbc", size = 332631, upload-time = "2024-10-13T18:46:04.939Z" }, - { url = "https://files.pythonhosted.org/packages/48/c7/27b34206fd5dfe76b2caa08bf22f9212b2d665d5bb2df8a6dd3af498dcf4/yarl-1.15.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:4388c72174868884f76affcdd3656544c426407e0043c89b684d22fb265e04a5", size = 344023, upload-time = "2024-10-13T18:46:06.809Z" }, - { url = "https://files.pythonhosted.org/packages/88/e7/730b130f4f02bd8b00479baf9a57fdea1dc927436ed1d6ba08fa5c36c68e/yarl-1.15.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:f0e1844ad47c7bd5d6fa784f1d4accc5f4168b48999303a868fe0f8597bde715", size = 352290, upload-time = "2024-10-13T18:46:08.676Z" }, - { url = "https://files.pythonhosted.org/packages/84/9b/e8dda28f91a0af67098cddd455e6b540d3f682dda4c0de224215a57dee4a/yarl-1.15.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a5cafb02cf097a82d74403f7e0b6b9df3ffbfe8edf9415ea816314711764a27b", size = 343742, upload-time = "2024-10-13T18:46:10.583Z" }, - { url = "https://files.pythonhosted.org/packages/66/47/b1c6bb85f2b66decbe189e27fcc956ab74670a068655df30ef9a2e15c379/yarl-1.15.2-cp312-cp312-win32.whl", hash = "sha256:156ececdf636143f508770bf8a3a0498de64da5abd890c7dbb42ca9e3b6c05b8", size = 78051, upload-time = "2024-10-13T18:46:12.671Z" }, - { url = "https://files.pythonhosted.org/packages/7d/9e/1a897e5248ec53e96e9f15b3e6928efd5e75d322c6cf666f55c1c063e5c9/yarl-1.15.2-cp312-cp312-win_amd64.whl", hash = "sha256:435aca062444a7f0c884861d2e3ea79883bd1cd19d0a381928b69ae1b85bc51d", size = 84313, upload-time = "2024-10-13T18:46:15.237Z" }, - { url = "https://files.pythonhosted.org/packages/46/ab/be3229898d7eb1149e6ba7fe44f873cf054d275a00b326f2a858c9ff7175/yarl-1.15.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:416f2e3beaeae81e2f7a45dc711258be5bdc79c940a9a270b266c0bec038fb84", size = 135006, upload-time = "2024-10-13T18:46:16.909Z" }, - { url = "https://files.pythonhosted.org/packages/10/10/b91c186b1b0e63951f80481b3e6879bb9f7179d471fe7c4440c9e900e2a3/yarl-1.15.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:173563f3696124372831007e3d4b9821746964a95968628f7075d9231ac6bb33", size = 88121, upload-time = "2024-10-13T18:46:18.702Z" }, - { url = "https://files.pythonhosted.org/packages/bf/1d/4ceaccf836b9591abfde775e84249b847ac4c6c14ee2dd8d15b5b3cede44/yarl-1.15.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9ce2e0f6123a60bd1a7f5ae3b2c49b240c12c132847f17aa990b841a417598a2", size = 85967, upload-time = "2024-10-13T18:46:20.354Z" }, - { url = "https://files.pythonhosted.org/packages/93/bd/c924f22bdb2c5d0ca03a9e64ecc5e041aace138c2a91afff7e2f01edc3a1/yarl-1.15.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eaea112aed589131f73d50d570a6864728bd7c0c66ef6c9154ed7b59f24da611", size = 325615, upload-time = "2024-10-13T18:46:22.057Z" }, - { url = "https://files.pythonhosted.org/packages/59/a5/6226accd5c01cafd57af0d249c7cf9dd12569cd9c78fbd93e8198e7a9d84/yarl-1.15.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e4ca3b9f370f218cc2a0309542cab8d0acdfd66667e7c37d04d617012485f904", size = 334945, upload-time = "2024-10-13T18:46:24.184Z" }, - { url = "https://files.pythonhosted.org/packages/4c/c1/cc6ccdd2bcd0ff7291602d5831754595260f8d2754642dfd34fef1791059/yarl-1.15.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:23ec1d3c31882b2a8a69c801ef58ebf7bae2553211ebbddf04235be275a38548", size = 336701, upload-time = "2024-10-13T18:46:27.038Z" }, - { url = "https://files.pythonhosted.org/packages/ef/ff/39a767ee249444e4b26ea998a526838238f8994c8f274befc1f94dacfb43/yarl-1.15.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:75119badf45f7183e10e348edff5a76a94dc19ba9287d94001ff05e81475967b", size = 330977, upload-time = "2024-10-13T18:46:28.921Z" }, - { url = "https://files.pythonhosted.org/packages/dd/ba/b1fed73f9d39e3e7be8f6786be5a2ab4399c21504c9168c3cadf6e441c2e/yarl-1.15.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:78e6fdc976ec966b99e4daa3812fac0274cc28cd2b24b0d92462e2e5ef90d368", size = 317402, upload-time = "2024-10-13T18:46:30.86Z" }, - { url = "https://files.pythonhosted.org/packages/82/e8/03e3ebb7f558374f29c04868b20ca484d7997f80a0a191490790a8c28058/yarl-1.15.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:8657d3f37f781d987037f9cc20bbc8b40425fa14380c87da0cb8dfce7c92d0fb", size = 331776, upload-time = "2024-10-13T18:46:33.037Z" }, - { url = "https://files.pythonhosted.org/packages/1f/83/90b0f4fd1ecf2602ba4ac50ad0bbc463122208f52dd13f152bbc0d8417dd/yarl-1.15.2-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:93bed8a8084544c6efe8856c362af08a23e959340c87a95687fdbe9c9f280c8b", size = 331585, upload-time = "2024-10-13T18:46:35.275Z" }, - { url = "https://files.pythonhosted.org/packages/c7/f6/1ed7e7f270ae5f9f1174c1f8597b29658f552fee101c26de8b2eb4ca147a/yarl-1.15.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:69d5856d526802cbda768d3e6246cd0d77450fa2a4bc2ea0ea14f0d972c2894b", size = 336395, upload-time = "2024-10-13T18:46:38.003Z" }, - { url = "https://files.pythonhosted.org/packages/e0/3a/4354ed8812909d9ec54a92716a53259b09e6b664209231f2ec5e75f4820d/yarl-1.15.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:ccad2800dfdff34392448c4bf834be124f10a5bc102f254521d931c1c53c455a", size = 342810, upload-time = "2024-10-13T18:46:39.952Z" }, - { url = "https://files.pythonhosted.org/packages/de/cc/39e55e16b1415a87f6d300064965d6cfb2ac8571e11339ccb7dada2444d9/yarl-1.15.2-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:a880372e2e5dbb9258a4e8ff43f13888039abb9dd6d515f28611c54361bc5644", size = 351441, upload-time = "2024-10-13T18:46:41.867Z" }, - { url = "https://files.pythonhosted.org/packages/fb/19/5cd4757079dc9d9f3de3e3831719b695f709a8ce029e70b33350c9d082a7/yarl-1.15.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:c998d0558805860503bc3a595994895ca0f7835e00668dadc673bbf7f5fbfcbe", size = 345875, upload-time = "2024-10-13T18:46:43.824Z" }, - { url = "https://files.pythonhosted.org/packages/83/a0/ef09b54634f73417f1ea4a746456a4372c1b044f07b26e16fa241bd2d94e/yarl-1.15.2-cp313-cp313-win32.whl", hash = "sha256:533a28754e7f7439f217550a497bb026c54072dbe16402b183fdbca2431935a9", size = 302609, upload-time = "2024-10-13T18:46:45.828Z" }, - { url = "https://files.pythonhosted.org/packages/20/9f/f39c37c17929d3975da84c737b96b606b68c495cc4ee86408f10523a1635/yarl-1.15.2-cp313-cp313-win_amd64.whl", hash = "sha256:5838f2b79dc8f96fdc44077c9e4e2e33d7089b10788464609df788eb97d03aad", size = 308252, upload-time = "2024-10-13T18:46:48.042Z" }, - { url = "https://files.pythonhosted.org/packages/7b/1f/544439ce6b7a498327d57ff40f0cd4f24bf4b1c1daf76c8c962dca022e71/yarl-1.15.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:fbbb63bed5fcd70cd3dd23a087cd78e4675fb5a2963b8af53f945cbbca79ae16", size = 138555, upload-time = "2024-10-13T18:46:50.448Z" }, - { url = "https://files.pythonhosted.org/packages/e8/b7/d6f33e7a42832f1e8476d0aabe089be0586a9110b5dfc2cef93444dc7c21/yarl-1.15.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:e2e93b88ecc8f74074012e18d679fb2e9c746f2a56f79cd5e2b1afcf2a8a786b", size = 89844, upload-time = "2024-10-13T18:46:52.297Z" }, - { url = "https://files.pythonhosted.org/packages/93/34/ede8d8ed7350b4b21e33fc4eff71e08de31da697034969b41190132d421f/yarl-1.15.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:af8ff8d7dc07ce873f643de6dfbcd45dc3db2c87462e5c387267197f59e6d776", size = 87671, upload-time = "2024-10-13T18:46:54.104Z" }, - { url = "https://files.pythonhosted.org/packages/fa/51/6d71e92bc54b5788b18f3dc29806f9ce37e12b7c610e8073357717f34b78/yarl-1.15.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:66f629632220a4e7858b58e4857927dd01a850a4cef2fb4044c8662787165cf7", size = 314558, upload-time = "2024-10-13T18:46:55.885Z" }, - { url = "https://files.pythonhosted.org/packages/76/0a/f9ffe503b4ef77cd77c9eefd37717c092e26f2c2dbbdd45700f864831292/yarl-1.15.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:833547179c31f9bec39b49601d282d6f0ea1633620701288934c5f66d88c3e50", size = 327622, upload-time = "2024-10-13T18:46:58.173Z" }, - { url = "https://files.pythonhosted.org/packages/8b/38/8eb602eeb153de0189d572dce4ed81b9b14f71de7c027d330b601b4fdcdc/yarl-1.15.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2aa738e0282be54eede1e3f36b81f1e46aee7ec7602aa563e81e0e8d7b67963f", size = 324447, upload-time = "2024-10-13T18:47:00.263Z" }, - { url = "https://files.pythonhosted.org/packages/c2/1e/1c78c695a4c7b957b5665e46a89ea35df48511dbed301a05c0a8beed0cc3/yarl-1.15.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9a13a07532e8e1c4a5a3afff0ca4553da23409fad65def1b71186fb867eeae8d", size = 319009, upload-time = "2024-10-13T18:47:02.417Z" }, - { url = "https://files.pythonhosted.org/packages/06/a0/7ea93de4ca1991e7f92a8901dcd1585165f547d342f7c6f36f1ea58b75de/yarl-1.15.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c45817e3e6972109d1a2c65091504a537e257bc3c885b4e78a95baa96df6a3f8", size = 307760, upload-time = "2024-10-13T18:47:04.553Z" }, - { url = "https://files.pythonhosted.org/packages/f4/b4/ceaa1f35cfb37fe06af3f7404438abf9a1262dc5df74dba37c90b0615e06/yarl-1.15.2-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:670eb11325ed3a6209339974b276811867defe52f4188fe18dc49855774fa9cf", size = 315038, upload-time = "2024-10-13T18:47:06.482Z" }, - { url = "https://files.pythonhosted.org/packages/da/45/a2ca2b547c56550eefc39e45d61e4b42ae6dbb3e913810b5a0eb53e86412/yarl-1.15.2-cp38-cp38-musllinux_1_2_armv7l.whl", hash = "sha256:d417a4f6943112fae3924bae2af7112562285848d9bcee737fc4ff7cbd450e6c", size = 312898, upload-time = "2024-10-13T18:47:09.291Z" }, - { url = "https://files.pythonhosted.org/packages/ea/e0/f692ba36dedc5b0b22084bba558a7ede053841e247b7dd2adbb9d40450be/yarl-1.15.2-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:bc8936d06cd53fddd4892677d65e98af514c8d78c79864f418bbf78a4a2edde4", size = 319370, upload-time = "2024-10-13T18:47:11.647Z" }, - { url = "https://files.pythonhosted.org/packages/b1/3f/0e382caf39958be6ae61d4bb0c82a68a3c45a494fc8cdc6f55c29757970e/yarl-1.15.2-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:954dde77c404084c2544e572f342aef384240b3e434e06cecc71597e95fd1ce7", size = 332429, upload-time = "2024-10-13T18:47:13.88Z" }, - { url = "https://files.pythonhosted.org/packages/21/6b/c824a4a1c45d67b15b431d4ab83b63462bfcbc710065902e10fa5c2ffd9e/yarl-1.15.2-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:5bc0df728e4def5e15a754521e8882ba5a5121bd6b5a3a0ff7efda5d6558ab3d", size = 333143, upload-time = "2024-10-13T18:47:16.141Z" }, - { url = "https://files.pythonhosted.org/packages/20/76/8af2a1d93fe95b04e284b5d55daaad33aae6e2f6254a1bcdb40e2752af6c/yarl-1.15.2-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:b71862a652f50babab4a43a487f157d26b464b1dedbcc0afda02fd64f3809d04", size = 326687, upload-time = "2024-10-13T18:47:18.179Z" }, - { url = "https://files.pythonhosted.org/packages/1c/53/490830773f907ef8a311cc5d82e5830f75f7692c1adacbdb731d3f1246fd/yarl-1.15.2-cp38-cp38-win32.whl", hash = "sha256:63eab904f8630aed5a68f2d0aeab565dcfc595dc1bf0b91b71d9ddd43dea3aea", size = 78705, upload-time = "2024-10-13T18:47:20.876Z" }, - { url = "https://files.pythonhosted.org/packages/9c/9d/d944e897abf37f50f4fa2d8d6f5fd0ed9413bc8327d3b4cc25ba9694e1ba/yarl-1.15.2-cp38-cp38-win_amd64.whl", hash = "sha256:2cf441c4b6e538ba0d2591574f95d3fdd33f1efafa864faa077d9636ecc0c4e9", size = 84998, upload-time = "2024-10-13T18:47:23.301Z" }, - { url = "https://files.pythonhosted.org/packages/91/1c/1c9d08c29b10499348eedc038cf61b6d96d5ba0e0d69438975845939ed3c/yarl-1.15.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:a32d58f4b521bb98b2c0aa9da407f8bd57ca81f34362bcb090e4a79e9924fefc", size = 138011, upload-time = "2024-10-13T18:47:25.002Z" }, - { url = "https://files.pythonhosted.org/packages/d4/33/2d4a1418bae6d7883c1fcc493be7b6d6fe015919835adc9e8eeba472e9f7/yarl-1.15.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:766dcc00b943c089349d4060b935c76281f6be225e39994c2ccec3a2a36ad627", size = 89618, upload-time = "2024-10-13T18:47:27.587Z" }, - { url = "https://files.pythonhosted.org/packages/78/2e/0024c674a376cfdc722a167a8f308f5779aca615cb7a28d67fbeabf3f697/yarl-1.15.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:bed1b5dbf90bad3bfc19439258c97873eab453c71d8b6869c136346acfe497e7", size = 87347, upload-time = "2024-10-13T18:47:29.671Z" }, - { url = "https://files.pythonhosted.org/packages/c5/08/a01874dabd4ddf475c5c2adc86f7ac329f83a361ee513a97841720ab7b24/yarl-1.15.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ed20a4bdc635f36cb19e630bfc644181dd075839b6fc84cac51c0f381ac472e2", size = 310438, upload-time = "2024-10-13T18:47:31.577Z" }, - { url = "https://files.pythonhosted.org/packages/09/95/691bc6de2c1b0e9c8bbaa5f8f38118d16896ba1a069a09d1fb073d41a093/yarl-1.15.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d538df442c0d9665664ab6dd5fccd0110fa3b364914f9c85b3ef9b7b2e157980", size = 325384, upload-time = "2024-10-13T18:47:33.587Z" }, - { url = "https://files.pythonhosted.org/packages/95/fd/fee11eb3337f48c62d39c5676e6a0e4e318e318900a901b609a3c45394df/yarl-1.15.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c6cf1d92edf936ceedc7afa61b07e9d78a27b15244aa46bbcd534c7458ee1b", size = 321820, upload-time = "2024-10-13T18:47:35.633Z" }, - { url = "https://files.pythonhosted.org/packages/7a/ad/4a2c9bbebaefdce4a69899132f4bf086abbddb738dc6e794a31193bc0854/yarl-1.15.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ce44217ad99ffad8027d2fde0269ae368c86db66ea0571c62a000798d69401fb", size = 314150, upload-time = "2024-10-13T18:47:37.693Z" }, - { url = "https://files.pythonhosted.org/packages/38/7d/552c37bc6c4ae8ea900e44b6c05cb16d50dca72d3782ccd66f53e27e353f/yarl-1.15.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b47a6000a7e833ebfe5886b56a31cb2ff12120b1efd4578a6fcc38df16cc77bd", size = 304202, upload-time = "2024-10-13T18:47:40.411Z" }, - { url = "https://files.pythonhosted.org/packages/2e/f8/c22a158f3337f49775775ecef43fc097a98b20cdce37425b68b9c45a6f94/yarl-1.15.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:e52f77a0cd246086afde8815039f3e16f8d2be51786c0a39b57104c563c5cbb0", size = 310311, upload-time = "2024-10-13T18:47:43.236Z" }, - { url = "https://files.pythonhosted.org/packages/ce/e4/ebce06afa25c2a6c8e6c9a5915cbbc7940a37f3ec38e950e8f346ca908da/yarl-1.15.2-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:f9ca0e6ce7774dc7830dc0cc4bb6b3eec769db667f230e7c770a628c1aa5681b", size = 310645, upload-time = "2024-10-13T18:47:45.24Z" }, - { url = "https://files.pythonhosted.org/packages/0a/34/5504cc8fbd1be959ec0a1e9e9f471fd438c37cb877b0178ce09085b36b51/yarl-1.15.2-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:136f9db0f53c0206db38b8cd0c985c78ded5fd596c9a86ce5c0b92afb91c3a19", size = 313328, upload-time = "2024-10-13T18:47:47.546Z" }, - { url = "https://files.pythonhosted.org/packages/cf/e4/fb3f91a539c6505e347d7d75bc675d291228960ffd6481ced76a15412924/yarl-1.15.2-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:173866d9f7409c0fb514cf6e78952e65816600cb888c68b37b41147349fe0057", size = 330135, upload-time = "2024-10-13T18:47:50.279Z" }, - { url = "https://files.pythonhosted.org/packages/e1/08/a0b27db813f0159e1c8a45f48852afded501de2f527e7613c4dcf436ecf7/yarl-1.15.2-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:6e840553c9c494a35e449a987ca2c4f8372668ee954a03a9a9685075228e5036", size = 327155, upload-time = "2024-10-13T18:47:52.337Z" }, - { url = "https://files.pythonhosted.org/packages/97/4e/b3414dded12d0e2b52eb1964c21a8d8b68495b320004807de770f7b6b53a/yarl-1.15.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:458c0c65802d816a6b955cf3603186de79e8fdb46d4f19abaec4ef0a906f50a7", size = 320810, upload-time = "2024-10-13T18:47:55.067Z" }, - { url = "https://files.pythonhosted.org/packages/bb/ca/e5149c55d1c9dcf3d5b48acd7c71ca8622fd2f61322d0386fe63ba106774/yarl-1.15.2-cp39-cp39-win32.whl", hash = "sha256:5b48388ded01f6f2429a8c55012bdbd1c2a0c3735b3e73e221649e524c34a58d", size = 78686, upload-time = "2024-10-13T18:47:57Z" }, - { url = "https://files.pythonhosted.org/packages/b1/87/f56a80a1abaf65dbf138b821357b51b6cc061756bb7d93f08797950b3881/yarl-1.15.2-cp39-cp39-win_amd64.whl", hash = "sha256:81dadafb3aa124f86dc267a2168f71bbd2bfb163663661ab0038f6e4b8edb810", size = 84818, upload-time = "2024-10-13T18:47:58.76Z" }, - { url = "https://files.pythonhosted.org/packages/46/cf/a28c494decc9c8776b0d7b729c68d26fdafefcedd8d2eab5d9cd767376b2/yarl-1.15.2-py3-none-any.whl", hash = "sha256:0d3105efab7c5c091609abacad33afff33bdff0035bece164c98bcf5a85ef90a", size = 38891, upload-time = "2024-10-13T18:48:00.883Z" }, -] - [[package]] name = "yarl" version = "1.20.1" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.9'", -] dependencies = [ - { name = "idna", marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "multidict", version = "6.6.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "propcache", version = "0.3.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "idna" }, + { name = "multidict" }, + { name = "propcache" }, ] sdist = { url = "https://files.pythonhosted.org/packages/3c/fb/efaa23fa4e45537b827620f04cf8f3cd658b76642205162e072703a5b963/yarl-1.20.1.tar.gz", hash = "sha256:d017a4997ee50c91fd5466cef416231bb82177b93b029906cefc542ce14c35ac", size = 186428, upload-time = "2025-06-10T00:46:09.923Z" } wheels = [ @@ -2307,25 +1349,10 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/b4/2d/2345fce04cfd4bee161bf1e7d9cdc702e3e16109021035dbb24db654a622/yarl-1.20.1-py3-none-any.whl", hash = "sha256:83b8eb083fe4683c6115795d9fc1cfaf2cbbefb19b3a1cb68f6527460f483a77", size = 46542, upload-time = "2025-06-10T00:46:07.521Z" }, ] -[[package]] -name = "zipp" -version = "3.20.2" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version < '3.9'", -] -sdist = { url = "https://files.pythonhosted.org/packages/54/bf/5c0000c44ebc80123ecbdddba1f5dcd94a5ada602a9c225d84b5aaa55e86/zipp-3.20.2.tar.gz", hash = "sha256:bc9eb26f4506fda01b81bcde0ca78103b6e62f991b381fec825435c836edbc29", size = 24199, upload-time = "2024-09-13T13:44:16.101Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/62/8b/5ba542fa83c90e09eac972fc9baca7a88e7e7ca4b221a89251954019308b/zipp-3.20.2-py3-none-any.whl", hash = "sha256:a817ac80d6cf4b23bf7f2828b7cabf326f15a001bea8b1f9b49631780ba28350", size = 9200, upload-time = "2024-09-13T13:44:14.38Z" }, -] - [[package]] name = "zipp" version = "3.21.0" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.9'", -] sdist = { url = "https://files.pythonhosted.org/packages/3f/50/bad581df71744867e9468ebd0bcd6505de3b275e06f202c2cb016e3ff56f/zipp-3.21.0.tar.gz", hash = "sha256:2c9958f6430a2040341a52eb608ed6dd93ef4392e02ffe219417c1b28b5dd1f4", size = 24545, upload-time = "2024-11-10T15:05:20.202Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/b7/1a/7e4798e9339adc931158c9d69ecc34f5e6791489d469f5e50ec15e35f458/zipp-3.21.0-py3-none-any.whl", hash = "sha256:ac1bbe05fd2991f160ebce24ffbac5f6d11d83dc90891255885223d42b3cd931", size = 9630, upload-time = "2024-11-10T15:05:19.275Z" }, From c7cb7dc431d4e370e485e9ae240fb697bf37b2a5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Nov 2025 03:33:41 +0000 Subject: [PATCH 896/993] fix: compat with Python 3.14 --- src/runloop_api_client/_models.py | 11 ++++++++--- tests/test_models.py | 8 ++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index 6a3cd1d26..fcec2cf90 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -2,6 +2,7 @@ import os import inspect +import weakref from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast from datetime import date, datetime from typing_extensions import ( @@ -573,6 +574,9 @@ class CachedDiscriminatorType(Protocol): __discriminator__: DiscriminatorDetails +DISCRIMINATOR_CACHE: weakref.WeakKeyDictionary[type, DiscriminatorDetails] = weakref.WeakKeyDictionary() + + class DiscriminatorDetails: field_name: str """The name of the discriminator field in the variant class, e.g. @@ -615,8 +619,9 @@ def __init__( def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, ...]) -> DiscriminatorDetails | None: - if isinstance(union, CachedDiscriminatorType): - return union.__discriminator__ + cached = DISCRIMINATOR_CACHE.get(union) + if cached is not None: + return cached discriminator_field_name: str | None = None @@ -669,7 +674,7 @@ def _build_discriminated_union_meta(*, union: type, meta_annotations: tuple[Any, discriminator_field=discriminator_field_name, discriminator_alias=discriminator_alias, ) - cast(CachedDiscriminatorType, union).__discriminator__ = details + DISCRIMINATOR_CACHE.setdefault(union, details) return details diff --git a/tests/test_models.py b/tests/test_models.py index 87683d2ad..aac33d2e4 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -9,7 +9,7 @@ from runloop_api_client._utils import PropertyInfo from runloop_api_client._compat import PYDANTIC_V1, parse_obj, model_dump, model_json -from runloop_api_client._models import BaseModel, construct_type +from runloop_api_client._models import DISCRIMINATOR_CACHE, BaseModel, construct_type class BasicModel(BaseModel): @@ -809,7 +809,7 @@ class B(BaseModel): UnionType = cast(Any, Union[A, B]) - assert not hasattr(UnionType, "__discriminator__") + assert not DISCRIMINATOR_CACHE.get(UnionType) m = construct_type( value={"type": "b", "data": "foo"}, type_=cast(Any, Annotated[UnionType, PropertyInfo(discriminator="type")]) @@ -818,7 +818,7 @@ class B(BaseModel): assert m.type == "b" assert m.data == "foo" # type: ignore[comparison-overlap] - discriminator = UnionType.__discriminator__ + discriminator = DISCRIMINATOR_CACHE.get(UnionType) assert discriminator is not None m = construct_type( @@ -830,7 +830,7 @@ class B(BaseModel): # if the discriminator details object stays the same between invocations then # we hit the cache - assert UnionType.__discriminator__ is discriminator + assert DISCRIMINATOR_CACHE.get(UnionType) is discriminator @pytest.mark.skipif(PYDANTIC_V1, reason="TypeAliasType is not supported in Pydantic v1") From a9e8c5f5812a0aa36e78d55ac5c21fbfc6bf9880 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Nov 2025 21:43:45 +0000 Subject: [PATCH 897/993] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0ffcd7329..a2fbbe5eb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-91cec4aeec2421487d5eeece4804ae3b8b47e22bdbb9fc7460feb64a8c10e42f.yml -openapi_spec_hash: 3d8d782e2450d46b8ce6573bad488ea1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb33a5a2af905766647a4cf900026240c83d244c67c7a92dc25c453b4e2ca9d6.yml +openapi_spec_hash: ed79fe718b145466c229630c47943a9e config_hash: 95facb8cef59b5a1b05763b871bf6a4b From 0b973b1af9c1452cc99a0e67ebe54fd0d49f4241 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Nov 2025 22:48:07 +0000 Subject: [PATCH 898/993] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a2fbbe5eb..f5090dac7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb33a5a2af905766647a4cf900026240c83d244c67c7a92dc25c453b4e2ca9d6.yml -openapi_spec_hash: ed79fe718b145466c229630c47943a9e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4f5fe47eea7a16fba1ba473532c7cb9687a113cf97e7b92bac014bca728f9505.yml +openapi_spec_hash: ae55e0436d54e239a548e245fd19a863 config_hash: 95facb8cef59b5a1b05763b871bf6a4b From 6e7367d2487bb77bf48f2e39bff7e58ad191f692 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Nov 2025 03:28:36 +0000 Subject: [PATCH 899/993] fix(compat): update signatures of `model_dump` and `model_dump_json` for Pydantic v1 --- src/runloop_api_client/_models.py | 41 ++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index fcec2cf90..ca9500b2a 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -257,15 +257,16 @@ def model_dump( mode: Literal["json", "python"] | str = "python", include: IncEx | None = None, exclude: IncEx | None = None, + context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, + exclude_computed_fields: bool = False, round_trip: bool = False, warnings: bool | Literal["none", "warn", "error"] = True, - context: dict[str, Any] | None = None, - serialize_as_any: bool = False, fallback: Callable[[Any], Any] | None = None, + serialize_as_any: bool = False, ) -> dict[str, Any]: """Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump @@ -273,16 +274,24 @@ def model_dump( Args: mode: The mode in which `to_python` should run. - If mode is 'json', the dictionary will only contain JSON serializable types. - If mode is 'python', the dictionary may contain any Python objects. - include: A list of fields to include in the output. - exclude: A list of fields to exclude from the output. + If mode is 'json', the output will only contain JSON serializable types. + If mode is 'python', the output may contain non-JSON-serializable Python objects. + include: A set of fields to include in the output. + exclude: A set of fields to exclude from the output. + context: Additional context to pass to the serializer. by_alias: Whether to use the field's alias in the dictionary key if defined. - exclude_unset: Whether to exclude fields that are unset or None from the output. - exclude_defaults: Whether to exclude fields that are set to their default value from the output. - exclude_none: Whether to exclude fields that have a value of `None` from the output. - round_trip: Whether to enable serialization and deserialization round-trip support. - warnings: Whether to log warnings when invalid fields are encountered. + exclude_unset: Whether to exclude fields that have not been explicitly set. + exclude_defaults: Whether to exclude fields that are set to their default value. + exclude_none: Whether to exclude fields that have a value of `None`. + exclude_computed_fields: Whether to exclude computed fields. + While this can be useful for round-tripping, it is usually recommended to use the dedicated + `round_trip` parameter instead. + round_trip: If True, dumped values should be valid as input for non-idempotent types such as Json[T]. + warnings: How to handle serialization errors. False/"none" ignores them, True/"warn" logs errors, + "error" raises a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError]. + fallback: A function to call when an unknown value is encountered. If not provided, + a [`PydanticSerializationError`][pydantic_core.PydanticSerializationError] error is raised. + serialize_as_any: Whether to serialize fields with duck-typing serialization behavior. Returns: A dictionary representation of the model. @@ -299,6 +308,8 @@ def model_dump( raise ValueError("serialize_as_any is only supported in Pydantic v2") if fallback is not None: raise ValueError("fallback is only supported in Pydantic v2") + if exclude_computed_fields != False: + raise ValueError("exclude_computed_fields is only supported in Pydantic v2") dumped = super().dict( # pyright: ignore[reportDeprecated] include=include, exclude=exclude, @@ -315,15 +326,17 @@ def model_dump_json( self, *, indent: int | None = None, + ensure_ascii: bool = False, include: IncEx | None = None, exclude: IncEx | None = None, + context: Any | None = None, by_alias: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, + exclude_computed_fields: bool = False, round_trip: bool = False, warnings: bool | Literal["none", "warn", "error"] = True, - context: dict[str, Any] | None = None, fallback: Callable[[Any], Any] | None = None, serialize_as_any: bool = False, ) -> str: @@ -355,6 +368,10 @@ def model_dump_json( raise ValueError("serialize_as_any is only supported in Pydantic v2") if fallback is not None: raise ValueError("fallback is only supported in Pydantic v2") + if ensure_ascii != False: + raise ValueError("ensure_ascii is only supported in Pydantic v2") + if exclude_computed_fields != False: + raise ValueError("exclude_computed_fields is only supported in Pydantic v2") return super().json( # type: ignore[reportDeprecated] indent=indent, include=include, From e7c9dceb00e3052aaf3cd73d3abd02c941fb5089 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Nov 2025 18:58:23 +0000 Subject: [PATCH 900/993] feat(blueprints): prevent deletion of blueprints with dependent snapshots --- .stats.yml | 8 +- api.md | 15 + src/runloop_api_client/_client.py | 39 +- src/runloop_api_client/pagination.py | 75 ++++ src/runloop_api_client/resources/__init__.py | 14 + src/runloop_api_client/resources/agents.py | 415 ++++++++++++++++++ .../resources/blueprints.py | 14 +- .../resources/devboxes/devboxes.py | 16 +- .../resources/devboxes/disk_snapshots.py | 16 +- src/runloop_api_client/types/__init__.py | 5 + .../types/agent_create_params.py | 18 + .../types/agent_list_params.py | 24 + .../types/agent_list_view.py | 22 + src/runloop_api_client/types/agent_view.py | 22 + .../devbox_list_disk_snapshots_params.py | 3 + .../types/devbox_snapshot_view.py | 3 + .../devboxes/disk_snapshot_list_params.py | 3 + .../types/shared/__init__.py | 1 + .../types/shared/agent_mount_parameters.py | 5 +- .../types/shared/agent_source.py | 62 +++ .../types/shared_params/__init__.py | 1 + .../shared_params/agent_mount_parameters.py | 5 +- .../types/shared_params/agent_source.py | 65 +++ .../devboxes/test_disk_snapshots.py | 2 + tests/api_resources/test_agents.py | 287 ++++++++++++ tests/api_resources/test_devboxes.py | 2 + 26 files changed, 1123 insertions(+), 19 deletions(-) create mode 100644 src/runloop_api_client/resources/agents.py create mode 100644 src/runloop_api_client/types/agent_create_params.py create mode 100644 src/runloop_api_client/types/agent_list_params.py create mode 100644 src/runloop_api_client/types/agent_list_view.py create mode 100644 src/runloop_api_client/types/agent_view.py create mode 100644 src/runloop_api_client/types/shared/agent_source.py create mode 100644 src/runloop_api_client/types/shared_params/agent_source.py create mode 100644 tests/api_resources/test_agents.py diff --git a/.stats.yml b/.stats.yml index f5090dac7..9f4451f29 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4f5fe47eea7a16fba1ba473532c7cb9687a113cf97e7b92bac014bca728f9505.yml -openapi_spec_hash: ae55e0436d54e239a548e245fd19a863 -config_hash: 95facb8cef59b5a1b05763b871bf6a4b +configured_endpoints: 97 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a14147d9603516ef2245584e4e44af8324cb1cbf130c3718bea39ad15b8084d.yml +openapi_spec_hash: bfeae3e75e496683934b941a19396c4b +config_hash: 2363f563f42501d2b1587a4f64bdccaf diff --git a/api.md b/api.md index 811f49ba4..49c26771e 100644 --- a/api.md +++ b/api.md @@ -4,6 +4,7 @@ from runloop_api_client.types import ( AfterIdle, AgentMountParameters, + AgentSource, CodeMountParameters, LaunchParameters, Mount, @@ -47,6 +48,20 @@ Methods: - client.benchmarks.runs.complete(id) -> BenchmarkRunView - client.benchmarks.runs.list_scenario_runs(id, \*\*params) -> SyncBenchmarkRunsCursorIDPage[ScenarioRunView] +# Agents + +Types: + +```python +from runloop_api_client.types import AgentCreateParameters, AgentListView, AgentView +``` + +Methods: + +- client.agents.create(\*\*params) -> AgentView +- client.agents.retrieve(id) -> AgentView +- client.agents.list(\*\*params) -> SyncAgentsCursorIDPage[AgentView] + # Blueprints Types: diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index bdfccf7e5..f4f6d1535 100644 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -31,7 +31,8 @@ ) if TYPE_CHECKING: - from .resources import objects, secrets, devboxes, scenarios, benchmarks, blueprints, repositories + from .resources import agents, objects, secrets, devboxes, scenarios, benchmarks, blueprints, repositories + from .resources.agents import AgentsResource, AsyncAgentsResource from .resources.objects import ObjectsResource, AsyncObjectsResource from .resources.secrets import SecretsResource, AsyncSecretsResource from .resources.blueprints import BlueprintsResource, AsyncBlueprintsResource @@ -106,6 +107,12 @@ def benchmarks(self) -> BenchmarksResource: return BenchmarksResource(self) + @cached_property + def agents(self) -> AgentsResource: + from .resources.agents import AgentsResource + + return AgentsResource(self) + @cached_property def blueprints(self) -> BlueprintsResource: from .resources.blueprints import BlueprintsResource @@ -318,6 +325,12 @@ def benchmarks(self) -> AsyncBenchmarksResource: return AsyncBenchmarksResource(self) + @cached_property + def agents(self) -> AsyncAgentsResource: + from .resources.agents import AsyncAgentsResource + + return AsyncAgentsResource(self) + @cached_property def blueprints(self) -> AsyncBlueprintsResource: from .resources.blueprints import AsyncBlueprintsResource @@ -479,6 +492,12 @@ def benchmarks(self) -> benchmarks.BenchmarksResourceWithRawResponse: return BenchmarksResourceWithRawResponse(self._client.benchmarks) + @cached_property + def agents(self) -> agents.AgentsResourceWithRawResponse: + from .resources.agents import AgentsResourceWithRawResponse + + return AgentsResourceWithRawResponse(self._client.agents) + @cached_property def blueprints(self) -> blueprints.BlueprintsResourceWithRawResponse: from .resources.blueprints import BlueprintsResourceWithRawResponse @@ -528,6 +547,12 @@ def benchmarks(self) -> benchmarks.AsyncBenchmarksResourceWithRawResponse: return AsyncBenchmarksResourceWithRawResponse(self._client.benchmarks) + @cached_property + def agents(self) -> agents.AsyncAgentsResourceWithRawResponse: + from .resources.agents import AsyncAgentsResourceWithRawResponse + + return AsyncAgentsResourceWithRawResponse(self._client.agents) + @cached_property def blueprints(self) -> blueprints.AsyncBlueprintsResourceWithRawResponse: from .resources.blueprints import AsyncBlueprintsResourceWithRawResponse @@ -577,6 +602,12 @@ def benchmarks(self) -> benchmarks.BenchmarksResourceWithStreamingResponse: return BenchmarksResourceWithStreamingResponse(self._client.benchmarks) + @cached_property + def agents(self) -> agents.AgentsResourceWithStreamingResponse: + from .resources.agents import AgentsResourceWithStreamingResponse + + return AgentsResourceWithStreamingResponse(self._client.agents) + @cached_property def blueprints(self) -> blueprints.BlueprintsResourceWithStreamingResponse: from .resources.blueprints import BlueprintsResourceWithStreamingResponse @@ -626,6 +657,12 @@ def benchmarks(self) -> benchmarks.AsyncBenchmarksResourceWithStreamingResponse: return AsyncBenchmarksResourceWithStreamingResponse(self._client.benchmarks) + @cached_property + def agents(self) -> agents.AsyncAgentsResourceWithStreamingResponse: + from .resources.agents import AsyncAgentsResourceWithStreamingResponse + + return AsyncAgentsResourceWithStreamingResponse(self._client.agents) + @cached_property def blueprints(self) -> blueprints.AsyncBlueprintsResourceWithStreamingResponse: from .resources.blueprints import AsyncBlueprintsResourceWithStreamingResponse diff --git a/src/runloop_api_client/pagination.py b/src/runloop_api_client/pagination.py index 734b6996f..a52e69c24 100644 --- a/src/runloop_api_client/pagination.py +++ b/src/runloop_api_client/pagination.py @@ -16,6 +16,8 @@ "AsyncDiskSnapshotsCursorIDPage", "SyncBenchmarksCursorIDPage", "AsyncBenchmarksCursorIDPage", + "SyncAgentsCursorIDPage", + "AsyncAgentsCursorIDPage", "SyncBenchmarkRunsCursorIDPage", "AsyncBenchmarkRunsCursorIDPage", "SyncScenariosCursorIDPage", @@ -56,6 +58,11 @@ class BenchmarksCursorIDPageItem(Protocol): id: str +@runtime_checkable +class AgentsCursorIDPageItem(Protocol): + id: str + + @runtime_checkable class BenchmarkRunsCursorIDPageItem(Protocol): id: str @@ -421,6 +428,74 @@ def next_page_info(self) -> Optional[PageInfo]: return PageInfo(params={"starting_after": item.id}) +class SyncAgentsCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + agents: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + agents = self.agents + if not agents: + return [] + return agents + + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + + @override + def next_page_info(self) -> Optional[PageInfo]: + agents = self.agents + if not agents: + return None + + item = cast(Any, agents[-1]) + if not isinstance(item, AgentsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) + + +class AsyncAgentsCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + agents: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + agents = self.agents + if not agents: + return [] + return agents + + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + + @override + def next_page_info(self) -> Optional[PageInfo]: + agents = self.agents + if not agents: + return None + + item = cast(Any, agents[-1]) + if not isinstance(item, AgentsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) + + class SyncBenchmarkRunsCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): runs: List[_T] has_more: Optional[bool] = None diff --git a/src/runloop_api_client/resources/__init__.py b/src/runloop_api_client/resources/__init__.py index 72ea92468..adafc4644 100644 --- a/src/runloop_api_client/resources/__init__.py +++ b/src/runloop_api_client/resources/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .agents import ( + AgentsResource, + AsyncAgentsResource, + AgentsResourceWithRawResponse, + AsyncAgentsResourceWithRawResponse, + AgentsResourceWithStreamingResponse, + AsyncAgentsResourceWithStreamingResponse, +) from .objects import ( ObjectsResource, AsyncObjectsResource, @@ -64,6 +72,12 @@ "AsyncBenchmarksResourceWithRawResponse", "BenchmarksResourceWithStreamingResponse", "AsyncBenchmarksResourceWithStreamingResponse", + "AgentsResource", + "AsyncAgentsResource", + "AgentsResourceWithRawResponse", + "AsyncAgentsResourceWithRawResponse", + "AgentsResourceWithStreamingResponse", + "AsyncAgentsResourceWithStreamingResponse", "BlueprintsResource", "AsyncBlueprintsResource", "BlueprintsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/agents.py b/src/runloop_api_client/resources/agents.py new file mode 100644 index 000000000..6ff202d74 --- /dev/null +++ b/src/runloop_api_client/resources/agents.py @@ -0,0 +1,415 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +import httpx + +from ..types import agent_list_params, agent_create_params +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from .._utils import maybe_transform, async_maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..pagination import SyncAgentsCursorIDPage, AsyncAgentsCursorIDPage +from .._base_client import AsyncPaginator, make_request_options +from ..types.agent_view import AgentView +from ..types.shared_params.agent_source import AgentSource + +__all__ = ["AgentsResource", "AsyncAgentsResource"] + + +class AgentsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> AgentsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AgentsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AgentsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AgentsResourceWithStreamingResponse(self) + + def create( + self, + *, + name: str, + source: Optional[AgentSource] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> AgentView: + """Create a new Agent with a name and optional public visibility. + + The Agent will be + assigned a unique ID. + + Args: + name: The name of the Agent. + + source: The source configuration for the Agent. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/v1/agents", + body=maybe_transform( + { + "name": name, + "source": source, + }, + agent_create_params.AgentCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=AgentView, + ) + + def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentView: + """ + Retrieve a specific Agent by its unique identifier. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/agents/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentView, + ) + + def list( + self, + *, + is_public: bool | Omit = omit, + limit: int | Omit = omit, + name: str | Omit = omit, + search: str | Omit = omit, + starting_after: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncAgentsCursorIDPage[AgentView]: + """ + List all Agents for the authenticated account with pagination support. + + Args: + is_public: Filter agents by public visibility. + + limit: The limit of items to return. Default is 20. + + name: Filter agents by name (partial match supported). + + search: Search by agent ID or name. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/agents", + page=SyncAgentsCursorIDPage[AgentView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "is_public": is_public, + "limit": limit, + "name": name, + "search": search, + "starting_after": starting_after, + }, + agent_list_params.AgentListParams, + ), + ), + model=AgentView, + ) + + +class AsyncAgentsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncAgentsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncAgentsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAgentsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncAgentsResourceWithStreamingResponse(self) + + async def create( + self, + *, + name: str, + source: Optional[AgentSource] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> AgentView: + """Create a new Agent with a name and optional public visibility. + + The Agent will be + assigned a unique ID. + + Args: + name: The name of the Agent. + + source: The source configuration for the Agent. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/v1/agents", + body=await async_maybe_transform( + { + "name": name, + "source": source, + }, + agent_create_params.AgentCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=AgentView, + ) + + async def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AgentView: + """ + Retrieve a specific Agent by its unique identifier. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/agents/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AgentView, + ) + + def list( + self, + *, + is_public: bool | Omit = omit, + limit: int | Omit = omit, + name: str | Omit = omit, + search: str | Omit = omit, + starting_after: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[AgentView, AsyncAgentsCursorIDPage[AgentView]]: + """ + List all Agents for the authenticated account with pagination support. + + Args: + is_public: Filter agents by public visibility. + + limit: The limit of items to return. Default is 20. + + name: Filter agents by name (partial match supported). + + search: Search by agent ID or name. + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/agents", + page=AsyncAgentsCursorIDPage[AgentView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "is_public": is_public, + "limit": limit, + "name": name, + "search": search, + "starting_after": starting_after, + }, + agent_list_params.AgentListParams, + ), + ), + model=AgentView, + ) + + +class AgentsResourceWithRawResponse: + def __init__(self, agents: AgentsResource) -> None: + self._agents = agents + + self.create = to_raw_response_wrapper( + agents.create, + ) + self.retrieve = to_raw_response_wrapper( + agents.retrieve, + ) + self.list = to_raw_response_wrapper( + agents.list, + ) + + +class AsyncAgentsResourceWithRawResponse: + def __init__(self, agents: AsyncAgentsResource) -> None: + self._agents = agents + + self.create = async_to_raw_response_wrapper( + agents.create, + ) + self.retrieve = async_to_raw_response_wrapper( + agents.retrieve, + ) + self.list = async_to_raw_response_wrapper( + agents.list, + ) + + +class AgentsResourceWithStreamingResponse: + def __init__(self, agents: AgentsResource) -> None: + self._agents = agents + + self.create = to_streamed_response_wrapper( + agents.create, + ) + self.retrieve = to_streamed_response_wrapper( + agents.retrieve, + ) + self.list = to_streamed_response_wrapper( + agents.list, + ) + + +class AsyncAgentsResourceWithStreamingResponse: + def __init__(self, agents: AsyncAgentsResource) -> None: + self._agents = agents + + self.create = async_to_streamed_response_wrapper( + agents.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + agents.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + agents.list, + ) diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index a0e07e83a..fa1390130 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -254,8 +254,11 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> object: - """ - Delete a previously created Blueprint. + """Delete a previously created Blueprint. + + If a blueprint has dependent snapshots, + it cannot be deleted. You can find them by querying: GET + /v1/devboxes/disk_snapshots?source_blueprint_id={blueprint_id}. Args: extra_headers: Send extra headers @@ -762,8 +765,11 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> object: - """ - Delete a previously created Blueprint. + """Delete a previously created Blueprint. + + If a blueprint has dependent snapshots, + it cannot be deleted. You can find them by querying: GET + /v1/devboxes/disk_snapshots?source_blueprint_id={blueprint_id}. Args: extra_headers: Send extra headers diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 5023b17ac..7a06d4ba3 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -825,6 +825,7 @@ def list_disk_snapshots( limit: int | Omit = omit, metadata_key: str | Omit = omit, metadata_key_in: str | Omit = omit, + source_blueprint_id: str | Omit = omit, starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -834,8 +835,8 @@ def list_disk_snapshots( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView]: """ - List all snapshots of a Devbox while optionally filtering by Devbox ID and - metadata. + List all snapshots of a Devbox while optionally filtering by Devbox ID, source + Blueprint ID, and metadata. Args: devbox_id: Devbox ID to filter by. @@ -847,6 +848,8 @@ def list_disk_snapshots( metadata_key_in: Filter snapshots by metadata key with multiple possible values (OR condition). + source_blueprint_id: Source Blueprint ID to filter snapshots by. + starting_after: Load the next page of data starting after the item with the given ID. extra_headers: Send extra headers @@ -871,6 +874,7 @@ def list_disk_snapshots( "limit": limit, "metadata_key": metadata_key, "metadata_key_in": metadata_key_in, + "source_blueprint_id": source_blueprint_id, "starting_after": starting_after, }, devbox_list_disk_snapshots_params.DevboxListDiskSnapshotsParams, @@ -2129,6 +2133,7 @@ def list_disk_snapshots( limit: int | Omit = omit, metadata_key: str | Omit = omit, metadata_key_in: str | Omit = omit, + source_blueprint_id: str | Omit = omit, starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -2138,8 +2143,8 @@ def list_disk_snapshots( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DevboxSnapshotView, AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView]]: """ - List all snapshots of a Devbox while optionally filtering by Devbox ID and - metadata. + List all snapshots of a Devbox while optionally filtering by Devbox ID, source + Blueprint ID, and metadata. Args: devbox_id: Devbox ID to filter by. @@ -2151,6 +2156,8 @@ def list_disk_snapshots( metadata_key_in: Filter snapshots by metadata key with multiple possible values (OR condition). + source_blueprint_id: Source Blueprint ID to filter snapshots by. + starting_after: Load the next page of data starting after the item with the given ID. extra_headers: Send extra headers @@ -2175,6 +2182,7 @@ def list_disk_snapshots( "limit": limit, "metadata_key": metadata_key, "metadata_key_in": metadata_key_in, + "source_blueprint_id": source_blueprint_id, "starting_after": starting_after, }, devbox_list_disk_snapshots_params.DevboxListDiskSnapshotsParams, diff --git a/src/runloop_api_client/resources/devboxes/disk_snapshots.py b/src/runloop_api_client/resources/devboxes/disk_snapshots.py index 3575b41f0..8b20baa8a 100644 --- a/src/runloop_api_client/resources/devboxes/disk_snapshots.py +++ b/src/runloop_api_client/resources/devboxes/disk_snapshots.py @@ -111,6 +111,7 @@ def list( limit: int | Omit = omit, metadata_key: str | Omit = omit, metadata_key_in: str | Omit = omit, + source_blueprint_id: str | Omit = omit, starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -120,8 +121,8 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView]: """ - List all snapshots of a Devbox while optionally filtering by Devbox ID and - metadata. + List all snapshots of a Devbox while optionally filtering by Devbox ID, source + Blueprint ID, and metadata. Args: devbox_id: Devbox ID to filter by. @@ -133,6 +134,8 @@ def list( metadata_key_in: Filter snapshots by metadata key with multiple possible values (OR condition). + source_blueprint_id: Source Blueprint ID to filter snapshots by. + starting_after: Load the next page of data starting after the item with the given ID. extra_headers: Send extra headers @@ -157,6 +160,7 @@ def list( "limit": limit, "metadata_key": metadata_key, "metadata_key_in": metadata_key_in, + "source_blueprint_id": source_blueprint_id, "starting_after": starting_after, }, disk_snapshot_list_params.DiskSnapshotListParams, @@ -326,6 +330,7 @@ def list( limit: int | Omit = omit, metadata_key: str | Omit = omit, metadata_key_in: str | Omit = omit, + source_blueprint_id: str | Omit = omit, starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -335,8 +340,8 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DevboxSnapshotView, AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView]]: """ - List all snapshots of a Devbox while optionally filtering by Devbox ID and - metadata. + List all snapshots of a Devbox while optionally filtering by Devbox ID, source + Blueprint ID, and metadata. Args: devbox_id: Devbox ID to filter by. @@ -348,6 +353,8 @@ def list( metadata_key_in: Filter snapshots by metadata key with multiple possible values (OR condition). + source_blueprint_id: Source Blueprint ID to filter snapshots by. + starting_after: Load the next page of data starting after the item with the given ID. extra_headers: Send extra headers @@ -372,6 +379,7 @@ def list( "limit": limit, "metadata_key": metadata_key, "metadata_key_in": metadata_key_in, + "source_blueprint_id": source_blueprint_id, "starting_after": starting_after, }, disk_snapshot_list_params.DiskSnapshotListParams, diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 2330d5227..4d5168b44 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -6,11 +6,13 @@ Mount as Mount, AfterIdle as AfterIdle, RunProfile as RunProfile, + AgentSource as AgentSource, LaunchParameters as LaunchParameters, CodeMountParameters as CodeMountParameters, AgentMountParameters as AgentMountParameters, ObjectMountParameters as ObjectMountParameters, ) +from .agent_view import AgentView as AgentView from .devbox_view import DevboxView as DevboxView from .object_view import ObjectView as ObjectView from .secret_view import SecretView as SecretView @@ -18,17 +20,20 @@ from .scenario_view import ScenarioView as ScenarioView from .benchmark_view import BenchmarkView as BenchmarkView from .blueprint_view import BlueprintView as BlueprintView +from .agent_list_view import AgentListView as AgentListView from .devbox_list_view import DevboxListView as DevboxListView from .object_list_view import ObjectListView as ObjectListView from .scoring_contract import ScoringContract as ScoringContract from .scoring_function import ScoringFunction as ScoringFunction from .secret_list_view import SecretListView as SecretListView +from .agent_list_params import AgentListParams as AgentListParams from .scenario_run_view import ScenarioRunView as ScenarioRunView from .benchmark_run_view import BenchmarkRunView as BenchmarkRunView from .devbox_list_params import DevboxListParams as DevboxListParams from .devbox_tunnel_view import DevboxTunnelView as DevboxTunnelView from .object_list_params import ObjectListParams as ObjectListParams from .secret_list_params import SecretListParams as SecretListParams +from .agent_create_params import AgentCreateParams as AgentCreateParams from .blueprint_build_log import BlueprintBuildLog as BlueprintBuildLog from .blueprint_list_view import BlueprintListView as BlueprintListView from .input_context_param import InputContextParam as InputContextParam diff --git a/src/runloop_api_client/types/agent_create_params.py b/src/runloop_api_client/types/agent_create_params.py new file mode 100644 index 000000000..1a3372e7e --- /dev/null +++ b/src/runloop_api_client/types/agent_create_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +from .shared_params.agent_source import AgentSource + +__all__ = ["AgentCreateParams"] + + +class AgentCreateParams(TypedDict, total=False): + name: Required[str] + """The name of the Agent.""" + + source: Optional[AgentSource] + """The source configuration for the Agent.""" diff --git a/src/runloop_api_client/types/agent_list_params.py b/src/runloop_api_client/types/agent_list_params.py new file mode 100644 index 000000000..a3199190b --- /dev/null +++ b/src/runloop_api_client/types/agent_list_params.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["AgentListParams"] + + +class AgentListParams(TypedDict, total=False): + is_public: bool + """Filter agents by public visibility.""" + + limit: int + """The limit of items to return. Default is 20.""" + + name: str + """Filter agents by name (partial match supported).""" + + search: str + """Search by agent ID or name.""" + + starting_after: str + """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/agent_list_view.py b/src/runloop_api_client/types/agent_list_view.py new file mode 100644 index 000000000..c2a7be455 --- /dev/null +++ b/src/runloop_api_client/types/agent_list_view.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .agent_view import AgentView + +__all__ = ["AgentListView"] + + +class AgentListView(BaseModel): + agents: List[AgentView] + """The list of Agents.""" + + has_more: bool + """Whether there are more Agents to fetch.""" + + remaining_count: int + """The count of remaining Agents.""" + + total_count: int + """The total count of Agents.""" diff --git a/src/runloop_api_client/types/agent_view.py b/src/runloop_api_client/types/agent_view.py new file mode 100644 index 000000000..bf2520a49 --- /dev/null +++ b/src/runloop_api_client/types/agent_view.py @@ -0,0 +1,22 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel +from .shared.agent_source import AgentSource + +__all__ = ["AgentView"] + + +class AgentView(BaseModel): + id: str + """The unique identifier of the Agent.""" + + is_public: bool + """Whether the Agent is publicly accessible.""" + + name: str + """The name of the Agent.""" + + source: Optional[AgentSource] = None + """The source configuration for the Agent.""" diff --git a/src/runloop_api_client/types/devbox_list_disk_snapshots_params.py b/src/runloop_api_client/types/devbox_list_disk_snapshots_params.py index ad476b208..7ffcf5386 100644 --- a/src/runloop_api_client/types/devbox_list_disk_snapshots_params.py +++ b/src/runloop_api_client/types/devbox_list_disk_snapshots_params.py @@ -25,5 +25,8 @@ class DevboxListDiskSnapshotsParams(TypedDict, total=False): metadata_key_in: Annotated[str, PropertyInfo(alias="metadata[key][in]")] """Filter snapshots by metadata key with multiple possible values (OR condition).""" + source_blueprint_id: str + """Source Blueprint ID to filter snapshots by.""" + starting_after: str """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/devbox_snapshot_view.py b/src/runloop_api_client/types/devbox_snapshot_view.py index 82ae90907..477f99d4e 100644 --- a/src/runloop_api_client/types/devbox_snapshot_view.py +++ b/src/runloop_api_client/types/devbox_snapshot_view.py @@ -25,3 +25,6 @@ class DevboxSnapshotView(BaseModel): name: Optional[str] = None """(Optional) The custom name of the snapshot.""" + + source_blueprint_id: Optional[str] = None + """(Optional) The source Blueprint ID this snapshot was created from.""" diff --git a/src/runloop_api_client/types/devboxes/disk_snapshot_list_params.py b/src/runloop_api_client/types/devboxes/disk_snapshot_list_params.py index e43a55d1d..7b0f3454f 100644 --- a/src/runloop_api_client/types/devboxes/disk_snapshot_list_params.py +++ b/src/runloop_api_client/types/devboxes/disk_snapshot_list_params.py @@ -25,5 +25,8 @@ class DiskSnapshotListParams(TypedDict, total=False): metadata_key_in: Annotated[str, PropertyInfo(alias="metadata[key][in]")] """Filter snapshots by metadata key with multiple possible values (OR condition).""" + source_blueprint_id: str + """Source Blueprint ID to filter snapshots by.""" + starting_after: str """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/shared/__init__.py b/src/runloop_api_client/types/shared/__init__.py index 39a3b079e..696abb529 100644 --- a/src/runloop_api_client/types/shared/__init__.py +++ b/src/runloop_api_client/types/shared/__init__.py @@ -3,6 +3,7 @@ from .mount import Mount as Mount from .after_idle import AfterIdle as AfterIdle from .run_profile import RunProfile as RunProfile +from .agent_source import AgentSource as AgentSource from .launch_parameters import LaunchParameters as LaunchParameters from .code_mount_parameters import CodeMountParameters as CodeMountParameters from .agent_mount_parameters import AgentMountParameters as AgentMountParameters diff --git a/src/runloop_api_client/types/shared/agent_mount_parameters.py b/src/runloop_api_client/types/shared/agent_mount_parameters.py index 5e92a0641..c2b384265 100644 --- a/src/runloop_api_client/types/shared/agent_mount_parameters.py +++ b/src/runloop_api_client/types/shared/agent_mount_parameters.py @@ -15,7 +15,10 @@ class AgentMountParameters(BaseModel): type: Literal["agent_mount"] agent_path: Optional[str] = None - """Optional path to mount the agent on the Devbox. + """Path to mount the agent on the Devbox. Required for git and object agents. Use absolute path (e.g., /home/user/agent) """ + + auth_token: Optional[str] = None + """Optional auth token for private repositories. Only used for git agents.""" diff --git a/src/runloop_api_client/types/shared/agent_source.py b/src/runloop_api_client/types/shared/agent_source.py new file mode 100644 index 000000000..7dc4958d2 --- /dev/null +++ b/src/runloop_api_client/types/shared/agent_source.py @@ -0,0 +1,62 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["AgentSource", "Git", "Npm", "Object", "Pip"] + + +class Git(BaseModel): + repository: str + """Git repository URL""" + + ref: Optional[str] = None + """Optional Git ref (branch/tag/commit), defaults to main/HEAD""" + + setup: Optional[List[str]] = None + """Setup commands to run after cloning""" + + +class Npm(BaseModel): + package_name: str + """NPM package name""" + + npm_version: Optional[str] = None + """NPM version constraint""" + + registry_url: Optional[str] = None + """NPM registry URL""" + + +class Object(BaseModel): + object_id: str + """Object ID""" + + +class Pip(BaseModel): + package_name: str + """Pip package name""" + + pip_version: Optional[str] = None + """Pip version constraint""" + + registry_url: Optional[str] = None + """Pip registry URL""" + + +class AgentSource(BaseModel): + type: str + """Source type: npm, pip, object, or git""" + + git: Optional[Git] = None + """Git source configuration""" + + npm: Optional[Npm] = None + """NPM source configuration""" + + object: Optional[Object] = None + """Object store source configuration""" + + pip: Optional[Pip] = None + """Pip source configuration""" diff --git a/src/runloop_api_client/types/shared_params/__init__.py b/src/runloop_api_client/types/shared_params/__init__.py index 39a3b079e..696abb529 100644 --- a/src/runloop_api_client/types/shared_params/__init__.py +++ b/src/runloop_api_client/types/shared_params/__init__.py @@ -3,6 +3,7 @@ from .mount import Mount as Mount from .after_idle import AfterIdle as AfterIdle from .run_profile import RunProfile as RunProfile +from .agent_source import AgentSource as AgentSource from .launch_parameters import LaunchParameters as LaunchParameters from .code_mount_parameters import CodeMountParameters as CodeMountParameters from .agent_mount_parameters import AgentMountParameters as AgentMountParameters diff --git a/src/runloop_api_client/types/shared_params/agent_mount_parameters.py b/src/runloop_api_client/types/shared_params/agent_mount_parameters.py index eca7e8cf1..def126043 100644 --- a/src/runloop_api_client/types/shared_params/agent_mount_parameters.py +++ b/src/runloop_api_client/types/shared_params/agent_mount_parameters.py @@ -15,7 +15,10 @@ class AgentMountParameters(TypedDict, total=False): type: Required[Literal["agent_mount"]] agent_path: Optional[str] - """Optional path to mount the agent on the Devbox. + """Path to mount the agent on the Devbox. Required for git and object agents. Use absolute path (e.g., /home/user/agent) """ + + auth_token: Optional[str] + """Optional auth token for private repositories. Only used for git agents.""" diff --git a/src/runloop_api_client/types/shared_params/agent_source.py b/src/runloop_api_client/types/shared_params/agent_source.py new file mode 100644 index 000000000..2c1ce71d3 --- /dev/null +++ b/src/runloop_api_client/types/shared_params/agent_source.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +from ..._types import SequenceNotStr + +__all__ = ["AgentSource", "Git", "Npm", "Object", "Pip"] + + +class Git(TypedDict, total=False): + repository: Required[str] + """Git repository URL""" + + ref: Optional[str] + """Optional Git ref (branch/tag/commit), defaults to main/HEAD""" + + setup: Optional[SequenceNotStr[str]] + """Setup commands to run after cloning""" + + +class Npm(TypedDict, total=False): + package_name: Required[str] + """NPM package name""" + + npm_version: Optional[str] + """NPM version constraint""" + + registry_url: Optional[str] + """NPM registry URL""" + + +class Object(TypedDict, total=False): + object_id: Required[str] + """Object ID""" + + +class Pip(TypedDict, total=False): + package_name: Required[str] + """Pip package name""" + + pip_version: Optional[str] + """Pip version constraint""" + + registry_url: Optional[str] + """Pip registry URL""" + + +class AgentSource(TypedDict, total=False): + type: Required[str] + """Source type: npm, pip, object, or git""" + + git: Optional[Git] + """Git source configuration""" + + npm: Optional[Npm] + """NPM source configuration""" + + object: Optional[Object] + """Object store source configuration""" + + pip: Optional[Pip] + """Pip source configuration""" diff --git a/tests/api_resources/devboxes/test_disk_snapshots.py b/tests/api_resources/devboxes/test_disk_snapshots.py index c04e4e971..88e3310a9 100644 --- a/tests/api_resources/devboxes/test_disk_snapshots.py +++ b/tests/api_resources/devboxes/test_disk_snapshots.py @@ -81,6 +81,7 @@ def test_method_list_with_all_params(self, client: Runloop) -> None: limit=0, metadata_key="metadata[key]", metadata_key_in="metadata[key][in]", + source_blueprint_id="source_blueprint_id", starting_after="starting_after", ) assert_matches_type(SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], disk_snapshot, path=["response"]) @@ -247,6 +248,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> limit=0, metadata_key="metadata[key]", metadata_key_in="metadata[key][in]", + source_blueprint_id="source_blueprint_id", starting_after="starting_after", ) assert_matches_type(AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], disk_snapshot, path=["response"]) diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py new file mode 100644 index 000000000..596338b85 --- /dev/null +++ b/tests/api_resources/test_agents.py @@ -0,0 +1,287 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types import AgentView +from runloop_api_client.pagination import SyncAgentsCursorIDPage, AsyncAgentsCursorIDPage + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestAgents: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Runloop) -> None: + agent = client.agents.create( + name="name", + ) + assert_matches_type(AgentView, agent, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Runloop) -> None: + agent = client.agents.create( + name="name", + source={ + "type": "type", + "git": { + "repository": "repository", + "ref": "ref", + "setup": ["string"], + }, + "npm": { + "package_name": "package_name", + "npm_version": "npm_version", + "registry_url": "registry_url", + }, + "object": {"object_id": "object_id"}, + "pip": { + "package_name": "package_name", + "pip_version": "pip_version", + "registry_url": "registry_url", + }, + }, + ) + assert_matches_type(AgentView, agent, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Runloop) -> None: + response = client.agents.with_raw_response.create( + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(AgentView, agent, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Runloop) -> None: + with client.agents.with_streaming_response.create( + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(AgentView, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + agent = client.agents.retrieve( + "id", + ) + assert_matches_type(AgentView, agent, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.agents.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(AgentView, agent, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.agents.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(AgentView, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.agents.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + agent = client.agents.list() + assert_matches_type(SyncAgentsCursorIDPage[AgentView], agent, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + agent = client.agents.list( + is_public=True, + limit=0, + name="name", + search="search", + starting_after="starting_after", + ) + assert_matches_type(SyncAgentsCursorIDPage[AgentView], agent, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.agents.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = response.parse() + assert_matches_type(SyncAgentsCursorIDPage[AgentView], agent, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.agents.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = response.parse() + assert_matches_type(SyncAgentsCursorIDPage[AgentView], agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncAgents: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_create(self, async_client: AsyncRunloop) -> None: + agent = await async_client.agents.create( + name="name", + ) + assert_matches_type(AgentView, agent, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: + agent = await async_client.agents.create( + name="name", + source={ + "type": "type", + "git": { + "repository": "repository", + "ref": "ref", + "setup": ["string"], + }, + "npm": { + "package_name": "package_name", + "npm_version": "npm_version", + "registry_url": "registry_url", + }, + "object": {"object_id": "object_id"}, + "pip": { + "package_name": "package_name", + "pip_version": "pip_version", + "registry_url": "registry_url", + }, + }, + ) + assert_matches_type(AgentView, agent, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: + response = await async_client.agents.with_raw_response.create( + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(AgentView, agent, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: + async with async_client.agents.with_streaming_response.create( + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(AgentView, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + agent = await async_client.agents.retrieve( + "id", + ) + assert_matches_type(AgentView, agent, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.agents.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(AgentView, agent, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.agents.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(AgentView, agent, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.agents.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + agent = await async_client.agents.list() + assert_matches_type(AsyncAgentsCursorIDPage[AgentView], agent, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + agent = await async_client.agents.list( + is_public=True, + limit=0, + name="name", + search="search", + starting_after="starting_after", + ) + assert_matches_type(AsyncAgentsCursorIDPage[AgentView], agent, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.agents.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + agent = await response.parse() + assert_matches_type(AsyncAgentsCursorIDPage[AgentView], agent, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.agents.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + agent = await response.parse() + assert_matches_type(AsyncAgentsCursorIDPage[AgentView], agent, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 7a5dfb304..1ea6ee17d 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -629,6 +629,7 @@ def test_method_list_disk_snapshots_with_all_params(self, client: Runloop) -> No limit=0, metadata_key="metadata[key]", metadata_key_in="metadata[key][in]", + source_blueprint_id="source_blueprint_id", starting_after="starting_after", ) assert_matches_type(SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], devbox, path=["response"]) @@ -1703,6 +1704,7 @@ async def test_method_list_disk_snapshots_with_all_params(self, async_client: As limit=0, metadata_key="metadata[key]", metadata_key_in="metadata[key][in]", + source_blueprint_id="source_blueprint_id", starting_after="starting_after", ) assert_matches_type(AsyncDiskSnapshotsCursorIDPage[DevboxSnapshotView], devbox, path=["response"]) From 9e2c515e4040bbba0b9e36a3fb6fb72e415518fe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Nov 2025 02:18:20 +0000 Subject: [PATCH 901/993] fix(snapshot): added "deleted" status to DevboxSnapshotStatus enum \n fix(storage-object): added ObjectState enum, fixed createObject() to appropriately type content_type and state as the respective enums --- .stats.yml | 4 +- src/runloop_api_client/resources/objects.py | 50 +++++++++++-------- .../devbox_snapshot_async_status_view.py | 2 +- .../types/object_create_params.py | 6 +++ .../types/object_list_params.py | 12 ++--- .../types/object_list_public_params.py | 12 ++--- src/runloop_api_client/types/object_view.py | 5 +- tests/api_resources/test_objects.py | 18 ++++--- 8 files changed, 65 insertions(+), 44 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9f4451f29..a331aec18 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 97 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-4a14147d9603516ef2245584e4e44af8324cb1cbf130c3718bea39ad15b8084d.yml -openapi_spec_hash: bfeae3e75e496683934b941a19396c4b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-9f8a6310d4d9c36d386f5afe17cfc891d05d5911204574645f9f90d9b6864a00.yml +openapi_spec_hash: 3fc0a807bb8d728abe3b7eaff0b9f7ec config_hash: 2363f563f42501d2b1587a4f64bdccaf diff --git a/src/runloop_api_client/resources/objects.py b/src/runloop_api_client/resources/objects.py index 3f83830e6..4d7d2e0a3 100644 --- a/src/runloop_api_client/resources/objects.py +++ b/src/runloop_api_client/resources/objects.py @@ -52,6 +52,7 @@ def create( content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"], name: str, metadata: Optional[Dict[str, str]] | Omit = omit, + ttl_ms: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -72,6 +73,9 @@ def create( metadata: User defined metadata to attach to the object for organization. + ttl_ms: Optional lifetime of the object in milliseconds, after which the object is + automatically deleted. Time starts ticking after the object is created. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -89,6 +93,7 @@ def create( "content_type": content_type, "name": name, "metadata": metadata, + "ttl_ms": ttl_ms, }, object_create_params.ObjectCreateParams, ), @@ -138,12 +143,12 @@ def retrieve( def list( self, *, - content_type: str | Omit = omit, + content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"] | Omit = omit, limit: int | Omit = omit, name: str | Omit = omit, search: str | Omit = omit, starting_after: str | Omit = omit, - state: str | Omit = omit, + state: Literal["UPLOADING", "READ_ONLY", "DELETED", "ERROR"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -155,17 +160,17 @@ def list( List all Objects for the authenticated account with pagination support. Args: - content_type: Filter objects by content type. + content_type: Filter storage objects by content type. limit: The limit of items to return. Default is 20. - name: Filter objects by name (partial match supported). + name: Filter storage objects by name (partial match supported). search: Search by object ID or name. starting_after: Load the next page of data starting after the item with the given ID. - state: Filter objects by state (UPLOADING, READ_ONLY, DELETED). + state: Filter storage objects by state. extra_headers: Send extra headers @@ -328,12 +333,12 @@ def download( def list_public( self, *, - content_type: str | Omit = omit, + content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"] | Omit = omit, limit: int | Omit = omit, name: str | Omit = omit, search: str | Omit = omit, starting_after: str | Omit = omit, - state: str | Omit = omit, + state: Literal["UPLOADING", "READ_ONLY", "DELETED", "ERROR"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -345,17 +350,17 @@ def list_public( List all public Objects with pagination support. Args: - content_type: Filter objects by content type. + content_type: Filter storage objects by content type. limit: The limit of items to return. Default is 20. - name: Filter objects by name (partial match supported). + name: Filter storage objects by name (partial match supported). search: Search by object ID or name. starting_after: Load the next page of data starting after the item with the given ID. - state: Filter objects by state (UPLOADING, READ_ONLY, DELETED). + state: Filter storage objects by state. extra_headers: Send extra headers @@ -415,6 +420,7 @@ async def create( content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"], name: str, metadata: Optional[Dict[str, str]] | Omit = omit, + ttl_ms: Optional[int] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -435,6 +441,9 @@ async def create( metadata: User defined metadata to attach to the object for organization. + ttl_ms: Optional lifetime of the object in milliseconds, after which the object is + automatically deleted. Time starts ticking after the object is created. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -452,6 +461,7 @@ async def create( "content_type": content_type, "name": name, "metadata": metadata, + "ttl_ms": ttl_ms, }, object_create_params.ObjectCreateParams, ), @@ -501,12 +511,12 @@ async def retrieve( def list( self, *, - content_type: str | Omit = omit, + content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"] | Omit = omit, limit: int | Omit = omit, name: str | Omit = omit, search: str | Omit = omit, starting_after: str | Omit = omit, - state: str | Omit = omit, + state: Literal["UPLOADING", "READ_ONLY", "DELETED", "ERROR"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -518,17 +528,17 @@ def list( List all Objects for the authenticated account with pagination support. Args: - content_type: Filter objects by content type. + content_type: Filter storage objects by content type. limit: The limit of items to return. Default is 20. - name: Filter objects by name (partial match supported). + name: Filter storage objects by name (partial match supported). search: Search by object ID or name. starting_after: Load the next page of data starting after the item with the given ID. - state: Filter objects by state (UPLOADING, READ_ONLY, DELETED). + state: Filter storage objects by state. extra_headers: Send extra headers @@ -691,12 +701,12 @@ async def download( def list_public( self, *, - content_type: str | Omit = omit, + content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"] | Omit = omit, limit: int | Omit = omit, name: str | Omit = omit, search: str | Omit = omit, starting_after: str | Omit = omit, - state: str | Omit = omit, + state: Literal["UPLOADING", "READ_ONLY", "DELETED", "ERROR"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -708,17 +718,17 @@ def list_public( List all public Objects with pagination support. Args: - content_type: Filter objects by content type. + content_type: Filter storage objects by content type. limit: The limit of items to return. Default is 20. - name: Filter objects by name (partial match supported). + name: Filter storage objects by name (partial match supported). search: Search by object ID or name. starting_after: Load the next page of data starting after the item with the given ID. - state: Filter objects by state (UPLOADING, READ_ONLY, DELETED). + state: Filter storage objects by state. extra_headers: Send extra headers diff --git a/src/runloop_api_client/types/devboxes/devbox_snapshot_async_status_view.py b/src/runloop_api_client/types/devboxes/devbox_snapshot_async_status_view.py index 2c7ea8eee..11abaa62f 100644 --- a/src/runloop_api_client/types/devboxes/devbox_snapshot_async_status_view.py +++ b/src/runloop_api_client/types/devboxes/devbox_snapshot_async_status_view.py @@ -10,7 +10,7 @@ class DevboxSnapshotAsyncStatusView(BaseModel): - status: Literal["in_progress", "error", "complete"] + status: Literal["in_progress", "error", "complete", "deleted"] """The current status of the snapshot operation.""" error_message: Optional[str] = None diff --git a/src/runloop_api_client/types/object_create_params.py b/src/runloop_api_client/types/object_create_params.py index fe554c188..ce154b4f3 100644 --- a/src/runloop_api_client/types/object_create_params.py +++ b/src/runloop_api_client/types/object_create_params.py @@ -17,3 +17,9 @@ class ObjectCreateParams(TypedDict, total=False): metadata: Optional[Dict[str, str]] """User defined metadata to attach to the object for organization.""" + + ttl_ms: Optional[int] + """ + Optional lifetime of the object in milliseconds, after which the object is + automatically deleted. Time starts ticking after the object is created. + """ diff --git a/src/runloop_api_client/types/object_list_params.py b/src/runloop_api_client/types/object_list_params.py index 044cff81a..084fac54d 100644 --- a/src/runloop_api_client/types/object_list_params.py +++ b/src/runloop_api_client/types/object_list_params.py @@ -2,20 +2,20 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Literal, TypedDict __all__ = ["ObjectListParams"] class ObjectListParams(TypedDict, total=False): - content_type: str - """Filter objects by content type.""" + content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"] + """Filter storage objects by content type.""" limit: int """The limit of items to return. Default is 20.""" name: str - """Filter objects by name (partial match supported).""" + """Filter storage objects by name (partial match supported).""" search: str """Search by object ID or name.""" @@ -23,5 +23,5 @@ class ObjectListParams(TypedDict, total=False): starting_after: str """Load the next page of data starting after the item with the given ID.""" - state: str - """Filter objects by state (UPLOADING, READ_ONLY, DELETED).""" + state: Literal["UPLOADING", "READ_ONLY", "DELETED", "ERROR"] + """Filter storage objects by state.""" diff --git a/src/runloop_api_client/types/object_list_public_params.py b/src/runloop_api_client/types/object_list_public_params.py index a69ef53dd..19b18ba49 100644 --- a/src/runloop_api_client/types/object_list_public_params.py +++ b/src/runloop_api_client/types/object_list_public_params.py @@ -2,20 +2,20 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing_extensions import Literal, TypedDict __all__ = ["ObjectListPublicParams"] class ObjectListPublicParams(TypedDict, total=False): - content_type: str - """Filter objects by content type.""" + content_type: Literal["unspecified", "text", "binary", "gzip", "tar", "tgz"] + """Filter storage objects by content type.""" limit: int """The limit of items to return. Default is 20.""" name: str - """Filter objects by name (partial match supported).""" + """Filter storage objects by name (partial match supported).""" search: str """Search by object ID or name.""" @@ -23,5 +23,5 @@ class ObjectListPublicParams(TypedDict, total=False): starting_after: str """Load the next page of data starting after the item with the given ID.""" - state: str - """Filter objects by state (UPLOADING, READ_ONLY, DELETED).""" + state: Literal["UPLOADING", "READ_ONLY", "DELETED", "ERROR"] + """Filter storage objects by state.""" diff --git a/src/runloop_api_client/types/object_view.py b/src/runloop_api_client/types/object_view.py index b8a2e0f4c..80aea62ed 100644 --- a/src/runloop_api_client/types/object_view.py +++ b/src/runloop_api_client/types/object_view.py @@ -21,9 +21,12 @@ class ObjectView(BaseModel): name: str """The name of the Object.""" - state: str + state: Literal["UPLOADING", "READ_ONLY", "DELETED", "ERROR"] """The current state of the Object.""" + delete_after_time_ms: Optional[int] = None + """The time after which the Object will be deleted in milliseconds since epoch.""" + size_bytes: Optional[int] = None """The size of the Object content in bytes (null until uploaded).""" diff --git a/tests/api_resources/test_objects.py b/tests/api_resources/test_objects.py index cf5a4cd3b..2593e03bf 100644 --- a/tests/api_resources/test_objects.py +++ b/tests/api_resources/test_objects.py @@ -35,6 +35,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: content_type="unspecified", name="name", metadata={"foo": "string"}, + ttl_ms=0, ) assert_matches_type(ObjectView, object_, path=["response"]) @@ -110,12 +111,12 @@ def test_method_list(self, client: Runloop) -> None: @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: object_ = client.objects.list( - content_type="content_type", + content_type="unspecified", limit=0, name="name", search="search", starting_after="starting_after", - state="state", + state="UPLOADING", ) assert_matches_type(SyncObjectsCursorIDPage[ObjectView], object_, path=["response"]) @@ -269,12 +270,12 @@ def test_method_list_public(self, client: Runloop) -> None: @parametrize def test_method_list_public_with_all_params(self, client: Runloop) -> None: object_ = client.objects.list_public( - content_type="content_type", + content_type="unspecified", limit=0, name="name", search="search", starting_after="starting_after", - state="state", + state="UPLOADING", ) assert_matches_type(SyncObjectsCursorIDPage[ObjectView], object_, path=["response"]) @@ -318,6 +319,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - content_type="unspecified", name="name", metadata={"foo": "string"}, + ttl_ms=0, ) assert_matches_type(ObjectView, object_, path=["response"]) @@ -393,12 +395,12 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: object_ = await async_client.objects.list( - content_type="content_type", + content_type="unspecified", limit=0, name="name", search="search", starting_after="starting_after", - state="state", + state="UPLOADING", ) assert_matches_type(AsyncObjectsCursorIDPage[ObjectView], object_, path=["response"]) @@ -552,12 +554,12 @@ async def test_method_list_public(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list_public_with_all_params(self, async_client: AsyncRunloop) -> None: object_ = await async_client.objects.list_public( - content_type="content_type", + content_type="unspecified", limit=0, name="name", search="search", starting_after="starting_after", - state="state", + state="UPLOADING", ) assert_matches_type(AsyncObjectsCursorIDPage[ObjectView], object_, path=["response"]) From 02219e6542e954e96a6dd3a6a65df0983b743fa7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 17 Nov 2025 19:25:14 +0000 Subject: [PATCH 902/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 11d330953..db00cae02 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.66.1" + ".": "0.67.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index eb44c011c..39994fb1c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.66.1" +version = "0.67.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index dc049fffe..d5ccb7242 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.66.1" # x-release-please-version +__version__ = "0.67.0" # x-release-please-version diff --git a/uv.lock b/uv.lock index 0a71acdfd..52ec717e4 100644 --- a/uv.lock +++ b/uv.lock @@ -1032,7 +1032,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "0.66.1" +version = "0.67.0" source = { editable = "." } dependencies = [ { name = "anyio" }, From 1b165dfcc4b4b42898b75c8c0f389ad78d9f3d65 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Nov 2025 01:39:36 +0000 Subject: [PATCH 903/993] feat(object): Added ability to give objects a Time To Live, after which they are automatically deleted.\nfeat(blueprints): Added the ability to attach objects as build contexts that can be referenced in your Dockerfile. --- .stats.yml | 4 +- .../resources/blueprints.py | 44 ++++++++++++ .../types/blueprint_build_parameters.py | 66 +++++++++++++++++- .../types/blueprint_create_params.py | 67 ++++++++++++++++++- .../types/blueprint_preview_params.py | 67 ++++++++++++++++++- src/runloop_api_client/types/devbox_view.py | 3 +- .../types/shared/agent_source.py | 15 ++++- .../types/shared_params/agent_source.py | 15 ++++- tests/api_resources/test_agents.py | 18 +++-- tests/api_resources/test_blueprints.py | 48 +++++++++++++ 10 files changed, 329 insertions(+), 18 deletions(-) diff --git a/.stats.yml b/.stats.yml index a331aec18..2ee72efab 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 97 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-9f8a6310d4d9c36d386f5afe17cfc891d05d5911204574645f9f90d9b6864a00.yml -openapi_spec_hash: 3fc0a807bb8d728abe3b7eaff0b9f7ec +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-779f7a8b0be0c3d2d095c6256d35c5dbb4c28d049f3541384c51a8c215e8a87a.yml +openapi_spec_hash: b4ebc80eeaf4e5b3bcd53c30433cf35e config_hash: 2363f563f42501d2b1587a4f64bdccaf diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index fa1390130..9e0bc37ca 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -62,10 +62,12 @@ def create( base_blueprint_id: Optional[str] | Omit = omit, base_blueprint_name: Optional[str] | Omit = omit, build_args: Optional[Dict[str, str]] | Omit = omit, + build_contexts: Optional[Dict[str, blueprint_create_params.BuildContexts]] | Omit = omit, code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, + local_build_context: Optional[blueprint_create_params.LocalBuildContext] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit, @@ -98,6 +100,11 @@ def create( build_args: (Optional) Arbitrary Docker build args to pass during build. + build_contexts: (Optional) Map of named Docker build contexts. Keys are context names, values + are typed context definitions (object or http). See Docker buildx additional + contexts for details: + https://docs.docker.com/reference/cli/docker/buildx/build/#build-context + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -106,6 +113,8 @@ def create( launch_parameters: Parameters to configure your Devbox at launch time. + local_build_context: (Optional) Local build context stored in object-storage. + metadata: (Optional) User defined metadata for the Blueprint. secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets @@ -137,10 +146,12 @@ def create( "base_blueprint_id": base_blueprint_id, "base_blueprint_name": base_blueprint_name, "build_args": build_args, + "build_contexts": build_contexts, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, + "local_build_context": local_build_context, "metadata": metadata, "secrets": secrets, "services": services, @@ -451,10 +462,12 @@ def preview( base_blueprint_id: Optional[str] | Omit = omit, base_blueprint_name: Optional[str] | Omit = omit, build_args: Optional[Dict[str, str]] | Omit = omit, + build_contexts: Optional[Dict[str, blueprint_preview_params.BuildContexts]] | Omit = omit, code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, + local_build_context: Optional[blueprint_preview_params.LocalBuildContext] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, services: Optional[Iterable[blueprint_preview_params.Service]] | Omit = omit, @@ -485,6 +498,11 @@ def preview( build_args: (Optional) Arbitrary Docker build args to pass during build. + build_contexts: (Optional) Map of named Docker build contexts. Keys are context names, values + are typed context definitions (object or http). See Docker buildx additional + contexts for details: + https://docs.docker.com/reference/cli/docker/buildx/build/#build-context + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -493,6 +511,8 @@ def preview( launch_parameters: Parameters to configure your Devbox at launch time. + local_build_context: (Optional) Local build context stored in object-storage. + metadata: (Optional) User defined metadata for the Blueprint. secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets @@ -524,10 +544,12 @@ def preview( "base_blueprint_id": base_blueprint_id, "base_blueprint_name": base_blueprint_name, "build_args": build_args, + "build_contexts": build_contexts, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, + "local_build_context": local_build_context, "metadata": metadata, "secrets": secrets, "services": services, @@ -573,10 +595,12 @@ async def create( base_blueprint_id: Optional[str] | Omit = omit, base_blueprint_name: Optional[str] | Omit = omit, build_args: Optional[Dict[str, str]] | Omit = omit, + build_contexts: Optional[Dict[str, blueprint_create_params.BuildContexts]] | Omit = omit, code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, + local_build_context: Optional[blueprint_create_params.LocalBuildContext] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit, @@ -609,6 +633,11 @@ async def create( build_args: (Optional) Arbitrary Docker build args to pass during build. + build_contexts: (Optional) Map of named Docker build contexts. Keys are context names, values + are typed context definitions (object or http). See Docker buildx additional + contexts for details: + https://docs.docker.com/reference/cli/docker/buildx/build/#build-context + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -617,6 +646,8 @@ async def create( launch_parameters: Parameters to configure your Devbox at launch time. + local_build_context: (Optional) Local build context stored in object-storage. + metadata: (Optional) User defined metadata for the Blueprint. secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets @@ -648,10 +679,12 @@ async def create( "base_blueprint_id": base_blueprint_id, "base_blueprint_name": base_blueprint_name, "build_args": build_args, + "build_contexts": build_contexts, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, + "local_build_context": local_build_context, "metadata": metadata, "secrets": secrets, "services": services, @@ -962,10 +995,12 @@ async def preview( base_blueprint_id: Optional[str] | Omit = omit, base_blueprint_name: Optional[str] | Omit = omit, build_args: Optional[Dict[str, str]] | Omit = omit, + build_contexts: Optional[Dict[str, blueprint_preview_params.BuildContexts]] | Omit = omit, code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, + local_build_context: Optional[blueprint_preview_params.LocalBuildContext] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, services: Optional[Iterable[blueprint_preview_params.Service]] | Omit = omit, @@ -996,6 +1031,11 @@ async def preview( build_args: (Optional) Arbitrary Docker build args to pass during build. + build_contexts: (Optional) Map of named Docker build contexts. Keys are context names, values + are typed context definitions (object or http). See Docker buildx additional + contexts for details: + https://docs.docker.com/reference/cli/docker/buildx/build/#build-context + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -1004,6 +1044,8 @@ async def preview( launch_parameters: Parameters to configure your Devbox at launch time. + local_build_context: (Optional) Local build context stored in object-storage. + metadata: (Optional) User defined metadata for the Blueprint. secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets @@ -1035,10 +1077,12 @@ async def preview( "base_blueprint_id": base_blueprint_id, "base_blueprint_name": base_blueprint_name, "build_args": build_args, + "build_contexts": build_contexts, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, + "local_build_context": local_build_context, "metadata": metadata, "secrets": secrets, "services": services, diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index 63a92f146..25bac19d7 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -1,12 +1,65 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Dict, List, Optional +from typing_extensions import Literal from .._models import BaseModel from .shared.launch_parameters import LaunchParameters from .shared.code_mount_parameters import CodeMountParameters -__all__ = ["BlueprintBuildParameters", "Service", "ServiceCredentials"] +__all__ = [ + "BlueprintBuildParameters", + "BuildContexts", + "BuildContextsHTTP", + "BuildContextsObject", + "LocalBuildContext", + "LocalBuildContextHTTP", + "LocalBuildContextObject", + "Service", + "ServiceCredentials", +] + + +class BuildContextsHTTP(BaseModel): + url: str + """HTTP(S) URL to a tarball or directory to use as context.""" + + +class BuildContextsObject(BaseModel): + object_id: str + """Handle for a Runloop stored object to use as context.""" + + +class BuildContexts(BaseModel): + type: Literal["OBJECT", "HTTP"] + """Type of the context. Supported values: object, http""" + + http: Optional[BuildContextsHTTP] = None + """HTTP(S) context parameters.""" + + object: Optional[BuildContextsObject] = None + """Object context parameters (named build context).""" + + +class LocalBuildContextHTTP(BaseModel): + url: str + """HTTP(S) URL to a tarball or directory to use as context.""" + + +class LocalBuildContextObject(BaseModel): + object_id: str + """Handle for a Runloop stored object to use as context.""" + + +class LocalBuildContext(BaseModel): + type: Literal["OBJECT", "HTTP"] + """Type of the context. Supported values: object, http""" + + http: Optional[LocalBuildContextHTTP] = None + """HTTP(S) context parameters.""" + + object: Optional[LocalBuildContextObject] = None + """Object context parameters (named build context).""" class ServiceCredentials(BaseModel): @@ -61,6 +114,14 @@ class BlueprintBuildParameters(BaseModel): build_args: Optional[Dict[str, str]] = None """(Optional) Arbitrary Docker build args to pass during build.""" + build_contexts: Optional[Dict[str, BuildContexts]] = None + """(Optional) Map of named Docker build contexts. + + Keys are context names, values are typed context definitions (object or http). + See Docker buildx additional contexts for details: + https://docs.docker.com/reference/cli/docker/buildx/build/#build-context + """ + code_mounts: Optional[List[CodeMountParameters]] = None """A list of code mounts to be included in the Blueprint.""" @@ -73,6 +134,9 @@ class BlueprintBuildParameters(BaseModel): launch_parameters: Optional[LaunchParameters] = None """Parameters to configure your Devbox at launch time.""" + local_build_context: Optional[LocalBuildContext] = None + """(Optional) Local build context stored in object-storage.""" + metadata: Optional[Dict[str, str]] = None """(Optional) User defined metadata for the Blueprint.""" diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index 9d0a15848..d2d94a3a8 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -3,13 +3,23 @@ from __future__ import annotations from typing import Dict, Iterable, Optional -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict from .._types import SequenceNotStr from .shared_params.launch_parameters import LaunchParameters from .shared_params.code_mount_parameters import CodeMountParameters -__all__ = ["BlueprintCreateParams", "Service", "ServiceCredentials"] +__all__ = [ + "BlueprintCreateParams", + "BuildContexts", + "BuildContextsHTTP", + "BuildContextsObject", + "LocalBuildContext", + "LocalBuildContextHTTP", + "LocalBuildContextObject", + "Service", + "ServiceCredentials", +] class BlueprintCreateParams(TypedDict, total=False): @@ -33,6 +43,14 @@ class BlueprintCreateParams(TypedDict, total=False): build_args: Optional[Dict[str, str]] """(Optional) Arbitrary Docker build args to pass during build.""" + build_contexts: Optional[Dict[str, BuildContexts]] + """(Optional) Map of named Docker build contexts. + + Keys are context names, values are typed context definitions (object or http). + See Docker buildx additional contexts for details: + https://docs.docker.com/reference/cli/docker/buildx/build/#build-context + """ + code_mounts: Optional[Iterable[CodeMountParameters]] """A list of code mounts to be included in the Blueprint.""" @@ -45,6 +63,9 @@ class BlueprintCreateParams(TypedDict, total=False): launch_parameters: Optional[LaunchParameters] """Parameters to configure your Devbox at launch time.""" + local_build_context: Optional[LocalBuildContext] + """(Optional) Local build context stored in object-storage.""" + metadata: Optional[Dict[str, str]] """(Optional) User defined metadata for the Blueprint.""" @@ -67,6 +88,48 @@ class BlueprintCreateParams(TypedDict, total=False): """A list of commands to run to set up your system.""" +class BuildContextsHTTP(TypedDict, total=False): + url: Required[str] + """HTTP(S) URL to a tarball or directory to use as context.""" + + +class BuildContextsObject(TypedDict, total=False): + object_id: Required[str] + """Handle for a Runloop stored object to use as context.""" + + +class BuildContexts(TypedDict, total=False): + type: Required[Literal["OBJECT", "HTTP"]] + """Type of the context. Supported values: object, http""" + + http: Optional[BuildContextsHTTP] + """HTTP(S) context parameters.""" + + object: Optional[BuildContextsObject] + """Object context parameters (named build context).""" + + +class LocalBuildContextHTTP(TypedDict, total=False): + url: Required[str] + """HTTP(S) URL to a tarball or directory to use as context.""" + + +class LocalBuildContextObject(TypedDict, total=False): + object_id: Required[str] + """Handle for a Runloop stored object to use as context.""" + + +class LocalBuildContext(TypedDict, total=False): + type: Required[Literal["OBJECT", "HTTP"]] + """Type of the context. Supported values: object, http""" + + http: Optional[LocalBuildContextHTTP] + """HTTP(S) context parameters.""" + + object: Optional[LocalBuildContextObject] + """Object context parameters (named build context).""" + + class ServiceCredentials(TypedDict, total=False): password: Required[str] """The password of the container service.""" diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index 5c1e257f2..c58487655 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -3,13 +3,23 @@ from __future__ import annotations from typing import Dict, Iterable, Optional -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict from .._types import SequenceNotStr from .shared_params.launch_parameters import LaunchParameters from .shared_params.code_mount_parameters import CodeMountParameters -__all__ = ["BlueprintPreviewParams", "Service", "ServiceCredentials"] +__all__ = [ + "BlueprintPreviewParams", + "BuildContexts", + "BuildContextsHTTP", + "BuildContextsObject", + "LocalBuildContext", + "LocalBuildContextHTTP", + "LocalBuildContextObject", + "Service", + "ServiceCredentials", +] class BlueprintPreviewParams(TypedDict, total=False): @@ -33,6 +43,14 @@ class BlueprintPreviewParams(TypedDict, total=False): build_args: Optional[Dict[str, str]] """(Optional) Arbitrary Docker build args to pass during build.""" + build_contexts: Optional[Dict[str, BuildContexts]] + """(Optional) Map of named Docker build contexts. + + Keys are context names, values are typed context definitions (object or http). + See Docker buildx additional contexts for details: + https://docs.docker.com/reference/cli/docker/buildx/build/#build-context + """ + code_mounts: Optional[Iterable[CodeMountParameters]] """A list of code mounts to be included in the Blueprint.""" @@ -45,6 +63,9 @@ class BlueprintPreviewParams(TypedDict, total=False): launch_parameters: Optional[LaunchParameters] """Parameters to configure your Devbox at launch time.""" + local_build_context: Optional[LocalBuildContext] + """(Optional) Local build context stored in object-storage.""" + metadata: Optional[Dict[str, str]] """(Optional) User defined metadata for the Blueprint.""" @@ -67,6 +88,48 @@ class BlueprintPreviewParams(TypedDict, total=False): """A list of commands to run to set up your system.""" +class BuildContextsHTTP(TypedDict, total=False): + url: Required[str] + """HTTP(S) URL to a tarball or directory to use as context.""" + + +class BuildContextsObject(TypedDict, total=False): + object_id: Required[str] + """Handle for a Runloop stored object to use as context.""" + + +class BuildContexts(TypedDict, total=False): + type: Required[Literal["OBJECT", "HTTP"]] + """Type of the context. Supported values: object, http""" + + http: Optional[BuildContextsHTTP] + """HTTP(S) context parameters.""" + + object: Optional[BuildContextsObject] + """Object context parameters (named build context).""" + + +class LocalBuildContextHTTP(TypedDict, total=False): + url: Required[str] + """HTTP(S) URL to a tarball or directory to use as context.""" + + +class LocalBuildContextObject(TypedDict, total=False): + object_id: Required[str] + """Handle for a Runloop stored object to use as context.""" + + +class LocalBuildContext(TypedDict, total=False): + type: Required[Literal["OBJECT", "HTTP"]] + """Type of the context. Supported values: object, http""" + + http: Optional[LocalBuildContextHTTP] + """HTTP(S) context parameters.""" + + object: Optional[LocalBuildContextObject] + """Object context parameters (named build context).""" + + class ServiceCredentials(TypedDict, total=False): password: Required[str] """The password of the container service.""" diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 68240f25d..007af6575 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -18,7 +18,7 @@ class StateTransition(BaseModel): provisioning: Runloop is allocating and booting the necessary infrastructure resources. initializing: Runloop defined boot scripts are running to enable the environment for interaction. running: The Devbox is ready for interaction. - suspending: The Devbox disk is being snaphsotted and as part of suspension. + suspending: The Devbox disk is being snapshotted as part of suspension. suspended: The Devbox disk is saved and no more active compute is being used for the Devbox. resuming: The Devbox disk is being loaded as part of booting a suspended Devbox. failure: The Devbox failed as part of booting or running user @@ -27,6 +27,7 @@ class StateTransition(BaseModel): """ transition_time_ms: Optional[object] = None + """The time the status change occurred""" class DevboxView(BaseModel): diff --git a/src/runloop_api_client/types/shared/agent_source.py b/src/runloop_api_client/types/shared/agent_source.py index 7dc4958d2..25bcbbc1d 100644 --- a/src/runloop_api_client/types/shared/agent_source.py +++ b/src/runloop_api_client/types/shared/agent_source.py @@ -11,17 +11,20 @@ class Git(BaseModel): repository: str """Git repository URL""" + agent_setup: Optional[List[str]] = None + """Setup commands to run after cloning""" + ref: Optional[str] = None """Optional Git ref (branch/tag/commit), defaults to main/HEAD""" - setup: Optional[List[str]] = None - """Setup commands to run after cloning""" - class Npm(BaseModel): package_name: str """NPM package name""" + agent_setup: Optional[List[str]] = None + """Setup commands to run after installation""" + npm_version: Optional[str] = None """NPM version constraint""" @@ -33,11 +36,17 @@ class Object(BaseModel): object_id: str """Object ID""" + agent_setup: Optional[List[str]] = None + """Setup commands to run after unpacking""" + class Pip(BaseModel): package_name: str """Pip package name""" + agent_setup: Optional[List[str]] = None + """Setup commands to run after installation""" + pip_version: Optional[str] = None """Pip version constraint""" diff --git a/src/runloop_api_client/types/shared_params/agent_source.py b/src/runloop_api_client/types/shared_params/agent_source.py index 2c1ce71d3..9f5a50845 100644 --- a/src/runloop_api_client/types/shared_params/agent_source.py +++ b/src/runloop_api_client/types/shared_params/agent_source.py @@ -14,17 +14,20 @@ class Git(TypedDict, total=False): repository: Required[str] """Git repository URL""" + agent_setup: Optional[SequenceNotStr[str]] + """Setup commands to run after cloning""" + ref: Optional[str] """Optional Git ref (branch/tag/commit), defaults to main/HEAD""" - setup: Optional[SequenceNotStr[str]] - """Setup commands to run after cloning""" - class Npm(TypedDict, total=False): package_name: Required[str] """NPM package name""" + agent_setup: Optional[SequenceNotStr[str]] + """Setup commands to run after installation""" + npm_version: Optional[str] """NPM version constraint""" @@ -36,11 +39,17 @@ class Object(TypedDict, total=False): object_id: Required[str] """Object ID""" + agent_setup: Optional[SequenceNotStr[str]] + """Setup commands to run after unpacking""" + class Pip(TypedDict, total=False): package_name: Required[str] """Pip package name""" + agent_setup: Optional[SequenceNotStr[str]] + """Setup commands to run after installation""" + pip_version: Optional[str] """Pip version constraint""" diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index 596338b85..6f8096491 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -33,17 +33,22 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "type": "type", "git": { "repository": "repository", + "agent_setup": ["string"], "ref": "ref", - "setup": ["string"], }, "npm": { "package_name": "package_name", + "agent_setup": ["string"], "npm_version": "npm_version", "registry_url": "registry_url", }, - "object": {"object_id": "object_id"}, + "object": { + "object_id": "object_id", + "agent_setup": ["string"], + }, "pip": { "package_name": "package_name", + "agent_setup": ["string"], "pip_version": "pip_version", "registry_url": "registry_url", }, @@ -170,17 +175,22 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "type": "type", "git": { "repository": "repository", + "agent_setup": ["string"], "ref": "ref", - "setup": ["string"], }, "npm": { "package_name": "package_name", + "agent_setup": ["string"], "npm_version": "npm_version", "registry_url": "registry_url", }, - "object": {"object_id": "object_id"}, + "object": { + "object_id": "object_id", + "agent_setup": ["string"], + }, "pip": { "package_name": "package_name", + "agent_setup": ["string"], "pip_version": "pip_version", "registry_url": "registry_url", }, diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 30ae21d3e..60dd03456 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -36,6 +36,13 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: base_blueprint_id="base_blueprint_id", base_blueprint_name="base_blueprint_name", build_args={"foo": "string"}, + build_contexts={ + "foo": { + "type": "OBJECT", + "http": {"url": "url"}, + "object": {"object_id": "object_id"}, + } + }, code_mounts=[ { "repo_name": "repo_name", @@ -65,6 +72,11 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "username": "username", }, }, + local_build_context={ + "type": "OBJECT", + "http": {"url": "url"}, + "object": {"object_id": "object_id"}, + }, metadata={"foo": "string"}, secrets={"foo": "string"}, services=[ @@ -372,6 +384,13 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: base_blueprint_id="base_blueprint_id", base_blueprint_name="base_blueprint_name", build_args={"foo": "string"}, + build_contexts={ + "foo": { + "type": "OBJECT", + "http": {"url": "url"}, + "object": {"object_id": "object_id"}, + } + }, code_mounts=[ { "repo_name": "repo_name", @@ -401,6 +420,11 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: "username": "username", }, }, + local_build_context={ + "type": "OBJECT", + "http": {"url": "url"}, + "object": {"object_id": "object_id"}, + }, metadata={"foo": "string"}, secrets={"foo": "string"}, services=[ @@ -464,6 +488,13 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - base_blueprint_id="base_blueprint_id", base_blueprint_name="base_blueprint_name", build_args={"foo": "string"}, + build_contexts={ + "foo": { + "type": "OBJECT", + "http": {"url": "url"}, + "object": {"object_id": "object_id"}, + } + }, code_mounts=[ { "repo_name": "repo_name", @@ -493,6 +524,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "username": "username", }, }, + local_build_context={ + "type": "OBJECT", + "http": {"url": "url"}, + "object": {"object_id": "object_id"}, + }, metadata={"foo": "string"}, secrets={"foo": "string"}, services=[ @@ -800,6 +836,13 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) base_blueprint_id="base_blueprint_id", base_blueprint_name="base_blueprint_name", build_args={"foo": "string"}, + build_contexts={ + "foo": { + "type": "OBJECT", + "http": {"url": "url"}, + "object": {"object_id": "object_id"}, + } + }, code_mounts=[ { "repo_name": "repo_name", @@ -829,6 +872,11 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) "username": "username", }, }, + local_build_context={ + "type": "OBJECT", + "http": {"url": "url"}, + "object": {"object_id": "object_id"}, + }, metadata={"foo": "string"}, secrets={"foo": "string"}, services=[ From 26a05454c0670d2d75703c81c695a8d18cddb507 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Nov 2025 00:22:13 +0000 Subject: [PATCH 904/993] feat(blueprints): Cleanup the BuildContext API (#6407)\n\nTest --- .stats.yml | 4 +- .../resources/blueprints.py | 80 +++++++++---------- src/runloop_api_client/types/agent_view.py | 3 + .../types/blueprint_build_parameters.py | 72 ++++------------- .../types/blueprint_create_params.py | 72 ++++------------- .../types/blueprint_preview_params.py | 72 ++++------------- .../types/shared/agent_mount_parameters.py | 11 ++- .../shared_params/agent_mount_parameters.py | 11 ++- tests/api_resources/test_blueprints.py | 80 +++++++++---------- 9 files changed, 150 insertions(+), 255 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2ee72efab..33e553ff2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 97 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-779f7a8b0be0c3d2d095c6256d35c5dbb4c28d049f3541384c51a8c215e8a87a.yml -openapi_spec_hash: b4ebc80eeaf4e5b3bcd53c30433cf35e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-5f33221208c1febba343daf570f73a5086f150a9b128df045ebddc3fe2c86607.yml +openapi_spec_hash: 0aea07130ddbe43a665a13a68231e2ca config_hash: 2363f563f42501d2b1587a4f64bdccaf diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index 9e0bc37ca..d7a82aace 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -62,13 +62,13 @@ def create( base_blueprint_id: Optional[str] | Omit = omit, base_blueprint_name: Optional[str] | Omit = omit, build_args: Optional[Dict[str, str]] | Omit = omit, - build_contexts: Optional[Dict[str, blueprint_create_params.BuildContexts]] | Omit = omit, + build_context: Optional[blueprint_create_params.BuildContext] | Omit = omit, code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, - local_build_context: Optional[blueprint_create_params.LocalBuildContext] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, + named_build_contexts: Optional[Dict[str, blueprint_create_params.NamedBuildContexts]] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, @@ -100,10 +100,7 @@ def create( build_args: (Optional) Arbitrary Docker build args to pass during build. - build_contexts: (Optional) Map of named Docker build contexts. Keys are context names, values - are typed context definitions (object or http). See Docker buildx additional - contexts for details: - https://docs.docker.com/reference/cli/docker/buildx/build/#build-context + build_context: A build context backed by an Object. code_mounts: A list of code mounts to be included in the Blueprint. @@ -113,10 +110,13 @@ def create( launch_parameters: Parameters to configure your Devbox at launch time. - local_build_context: (Optional) Local build context stored in object-storage. - metadata: (Optional) User defined metadata for the Blueprint. + named_build_contexts: (Optional) Map of named build contexts to attach to the Blueprint build, where + the keys are the name used when referencing the contexts in a Dockerfile. See + Docker buildx additional contexts for details: + https://docs.docker.com/reference/cli/docker/buildx/build/#build-context + secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets will be available to commands during the build. Secrets are NOT stored in the blueprint image. Example: {"DB_PASS": "DATABASE_PASSWORD"} makes the secret @@ -146,13 +146,13 @@ def create( "base_blueprint_id": base_blueprint_id, "base_blueprint_name": base_blueprint_name, "build_args": build_args, - "build_contexts": build_contexts, + "build_context": build_context, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, - "local_build_context": local_build_context, "metadata": metadata, + "named_build_contexts": named_build_contexts, "secrets": secrets, "services": services, "system_setup_commands": system_setup_commands, @@ -462,13 +462,13 @@ def preview( base_blueprint_id: Optional[str] | Omit = omit, base_blueprint_name: Optional[str] | Omit = omit, build_args: Optional[Dict[str, str]] | Omit = omit, - build_contexts: Optional[Dict[str, blueprint_preview_params.BuildContexts]] | Omit = omit, + build_context: Optional[blueprint_preview_params.BuildContext] | Omit = omit, code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, - local_build_context: Optional[blueprint_preview_params.LocalBuildContext] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, + named_build_contexts: Optional[Dict[str, blueprint_preview_params.NamedBuildContexts]] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, services: Optional[Iterable[blueprint_preview_params.Service]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, @@ -498,10 +498,7 @@ def preview( build_args: (Optional) Arbitrary Docker build args to pass during build. - build_contexts: (Optional) Map of named Docker build contexts. Keys are context names, values - are typed context definitions (object or http). See Docker buildx additional - contexts for details: - https://docs.docker.com/reference/cli/docker/buildx/build/#build-context + build_context: A build context backed by an Object. code_mounts: A list of code mounts to be included in the Blueprint. @@ -511,10 +508,13 @@ def preview( launch_parameters: Parameters to configure your Devbox at launch time. - local_build_context: (Optional) Local build context stored in object-storage. - metadata: (Optional) User defined metadata for the Blueprint. + named_build_contexts: (Optional) Map of named build contexts to attach to the Blueprint build, where + the keys are the name used when referencing the contexts in a Dockerfile. See + Docker buildx additional contexts for details: + https://docs.docker.com/reference/cli/docker/buildx/build/#build-context + secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets will be available to commands during the build. Secrets are NOT stored in the blueprint image. Example: {"DB_PASS": "DATABASE_PASSWORD"} makes the secret @@ -544,13 +544,13 @@ def preview( "base_blueprint_id": base_blueprint_id, "base_blueprint_name": base_blueprint_name, "build_args": build_args, - "build_contexts": build_contexts, + "build_context": build_context, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, - "local_build_context": local_build_context, "metadata": metadata, + "named_build_contexts": named_build_contexts, "secrets": secrets, "services": services, "system_setup_commands": system_setup_commands, @@ -595,13 +595,13 @@ async def create( base_blueprint_id: Optional[str] | Omit = omit, base_blueprint_name: Optional[str] | Omit = omit, build_args: Optional[Dict[str, str]] | Omit = omit, - build_contexts: Optional[Dict[str, blueprint_create_params.BuildContexts]] | Omit = omit, + build_context: Optional[blueprint_create_params.BuildContext] | Omit = omit, code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, - local_build_context: Optional[blueprint_create_params.LocalBuildContext] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, + named_build_contexts: Optional[Dict[str, blueprint_create_params.NamedBuildContexts]] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, @@ -633,10 +633,7 @@ async def create( build_args: (Optional) Arbitrary Docker build args to pass during build. - build_contexts: (Optional) Map of named Docker build contexts. Keys are context names, values - are typed context definitions (object or http). See Docker buildx additional - contexts for details: - https://docs.docker.com/reference/cli/docker/buildx/build/#build-context + build_context: A build context backed by an Object. code_mounts: A list of code mounts to be included in the Blueprint. @@ -646,10 +643,13 @@ async def create( launch_parameters: Parameters to configure your Devbox at launch time. - local_build_context: (Optional) Local build context stored in object-storage. - metadata: (Optional) User defined metadata for the Blueprint. + named_build_contexts: (Optional) Map of named build contexts to attach to the Blueprint build, where + the keys are the name used when referencing the contexts in a Dockerfile. See + Docker buildx additional contexts for details: + https://docs.docker.com/reference/cli/docker/buildx/build/#build-context + secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets will be available to commands during the build. Secrets are NOT stored in the blueprint image. Example: {"DB_PASS": "DATABASE_PASSWORD"} makes the secret @@ -679,13 +679,13 @@ async def create( "base_blueprint_id": base_blueprint_id, "base_blueprint_name": base_blueprint_name, "build_args": build_args, - "build_contexts": build_contexts, + "build_context": build_context, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, - "local_build_context": local_build_context, "metadata": metadata, + "named_build_contexts": named_build_contexts, "secrets": secrets, "services": services, "system_setup_commands": system_setup_commands, @@ -995,13 +995,13 @@ async def preview( base_blueprint_id: Optional[str] | Omit = omit, base_blueprint_name: Optional[str] | Omit = omit, build_args: Optional[Dict[str, str]] | Omit = omit, - build_contexts: Optional[Dict[str, blueprint_preview_params.BuildContexts]] | Omit = omit, + build_context: Optional[blueprint_preview_params.BuildContext] | Omit = omit, code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, - local_build_context: Optional[blueprint_preview_params.LocalBuildContext] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, + named_build_contexts: Optional[Dict[str, blueprint_preview_params.NamedBuildContexts]] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, services: Optional[Iterable[blueprint_preview_params.Service]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, @@ -1031,10 +1031,7 @@ async def preview( build_args: (Optional) Arbitrary Docker build args to pass during build. - build_contexts: (Optional) Map of named Docker build contexts. Keys are context names, values - are typed context definitions (object or http). See Docker buildx additional - contexts for details: - https://docs.docker.com/reference/cli/docker/buildx/build/#build-context + build_context: A build context backed by an Object. code_mounts: A list of code mounts to be included in the Blueprint. @@ -1044,10 +1041,13 @@ async def preview( launch_parameters: Parameters to configure your Devbox at launch time. - local_build_context: (Optional) Local build context stored in object-storage. - metadata: (Optional) User defined metadata for the Blueprint. + named_build_contexts: (Optional) Map of named build contexts to attach to the Blueprint build, where + the keys are the name used when referencing the contexts in a Dockerfile. See + Docker buildx additional contexts for details: + https://docs.docker.com/reference/cli/docker/buildx/build/#build-context + secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets will be available to commands during the build. Secrets are NOT stored in the blueprint image. Example: {"DB_PASS": "DATABASE_PASSWORD"} makes the secret @@ -1077,13 +1077,13 @@ async def preview( "base_blueprint_id": base_blueprint_id, "base_blueprint_name": base_blueprint_name, "build_args": build_args, - "build_contexts": build_contexts, + "build_context": build_context, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, - "local_build_context": local_build_context, "metadata": metadata, + "named_build_contexts": named_build_contexts, "secrets": secrets, "services": services, "system_setup_commands": system_setup_commands, diff --git a/src/runloop_api_client/types/agent_view.py b/src/runloop_api_client/types/agent_view.py index bf2520a49..77e56d1b8 100644 --- a/src/runloop_api_client/types/agent_view.py +++ b/src/runloop_api_client/types/agent_view.py @@ -12,6 +12,9 @@ class AgentView(BaseModel): id: str """The unique identifier of the Agent.""" + create_time_ms: int + """The creation time of the Agent (Unix timestamp milliseconds).""" + is_public: bool """Whether the Agent is publicly accessible.""" diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index 25bac19d7..cc86468df 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -7,59 +7,21 @@ from .shared.launch_parameters import LaunchParameters from .shared.code_mount_parameters import CodeMountParameters -__all__ = [ - "BlueprintBuildParameters", - "BuildContexts", - "BuildContextsHTTP", - "BuildContextsObject", - "LocalBuildContext", - "LocalBuildContextHTTP", - "LocalBuildContextObject", - "Service", - "ServiceCredentials", -] +__all__ = ["BlueprintBuildParameters", "BuildContext", "NamedBuildContexts", "Service", "ServiceCredentials"] -class BuildContextsHTTP(BaseModel): - url: str - """HTTP(S) URL to a tarball or directory to use as context.""" - - -class BuildContextsObject(BaseModel): +class BuildContext(BaseModel): object_id: str - """Handle for a Runloop stored object to use as context.""" - - -class BuildContexts(BaseModel): - type: Literal["OBJECT", "HTTP"] - """Type of the context. Supported values: object, http""" - - http: Optional[BuildContextsHTTP] = None - """HTTP(S) context parameters.""" + """The ID of an object, whose contents are to be used as a build context.""" - object: Optional[BuildContextsObject] = None - """Object context parameters (named build context).""" + type: Literal["object"] -class LocalBuildContextHTTP(BaseModel): - url: str - """HTTP(S) URL to a tarball or directory to use as context.""" - - -class LocalBuildContextObject(BaseModel): +class NamedBuildContexts(BaseModel): object_id: str - """Handle for a Runloop stored object to use as context.""" - - -class LocalBuildContext(BaseModel): - type: Literal["OBJECT", "HTTP"] - """Type of the context. Supported values: object, http""" + """The ID of an object, whose contents are to be used as a build context.""" - http: Optional[LocalBuildContextHTTP] = None - """HTTP(S) context parameters.""" - - object: Optional[LocalBuildContextObject] = None - """Object context parameters (named build context).""" + type: Literal["object"] class ServiceCredentials(BaseModel): @@ -114,13 +76,8 @@ class BlueprintBuildParameters(BaseModel): build_args: Optional[Dict[str, str]] = None """(Optional) Arbitrary Docker build args to pass during build.""" - build_contexts: Optional[Dict[str, BuildContexts]] = None - """(Optional) Map of named Docker build contexts. - - Keys are context names, values are typed context definitions (object or http). - See Docker buildx additional contexts for details: - https://docs.docker.com/reference/cli/docker/buildx/build/#build-context - """ + build_context: Optional[BuildContext] = None + """A build context backed by an Object.""" code_mounts: Optional[List[CodeMountParameters]] = None """A list of code mounts to be included in the Blueprint.""" @@ -134,12 +91,17 @@ class BlueprintBuildParameters(BaseModel): launch_parameters: Optional[LaunchParameters] = None """Parameters to configure your Devbox at launch time.""" - local_build_context: Optional[LocalBuildContext] = None - """(Optional) Local build context stored in object-storage.""" - metadata: Optional[Dict[str, str]] = None """(Optional) User defined metadata for the Blueprint.""" + named_build_contexts: Optional[Dict[str, NamedBuildContexts]] = None + """ + (Optional) Map of named build contexts to attach to the Blueprint build, where + the keys are the name used when referencing the contexts in a Dockerfile. See + Docker buildx additional contexts for details: + https://docs.docker.com/reference/cli/docker/buildx/build/#build-context + """ + secrets: Optional[Dict[str, str]] = None """(Optional) Map of mount IDs/environment variable names to secret names. diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index d2d94a3a8..a15e6f470 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -9,17 +9,7 @@ from .shared_params.launch_parameters import LaunchParameters from .shared_params.code_mount_parameters import CodeMountParameters -__all__ = [ - "BlueprintCreateParams", - "BuildContexts", - "BuildContextsHTTP", - "BuildContextsObject", - "LocalBuildContext", - "LocalBuildContextHTTP", - "LocalBuildContextObject", - "Service", - "ServiceCredentials", -] +__all__ = ["BlueprintCreateParams", "BuildContext", "NamedBuildContexts", "Service", "ServiceCredentials"] class BlueprintCreateParams(TypedDict, total=False): @@ -43,13 +33,8 @@ class BlueprintCreateParams(TypedDict, total=False): build_args: Optional[Dict[str, str]] """(Optional) Arbitrary Docker build args to pass during build.""" - build_contexts: Optional[Dict[str, BuildContexts]] - """(Optional) Map of named Docker build contexts. - - Keys are context names, values are typed context definitions (object or http). - See Docker buildx additional contexts for details: - https://docs.docker.com/reference/cli/docker/buildx/build/#build-context - """ + build_context: Optional[BuildContext] + """A build context backed by an Object.""" code_mounts: Optional[Iterable[CodeMountParameters]] """A list of code mounts to be included in the Blueprint.""" @@ -63,12 +48,17 @@ class BlueprintCreateParams(TypedDict, total=False): launch_parameters: Optional[LaunchParameters] """Parameters to configure your Devbox at launch time.""" - local_build_context: Optional[LocalBuildContext] - """(Optional) Local build context stored in object-storage.""" - metadata: Optional[Dict[str, str]] """(Optional) User defined metadata for the Blueprint.""" + named_build_contexts: Optional[Dict[str, NamedBuildContexts]] + """ + (Optional) Map of named build contexts to attach to the Blueprint build, where + the keys are the name used when referencing the contexts in a Dockerfile. See + Docker buildx additional contexts for details: + https://docs.docker.com/reference/cli/docker/buildx/build/#build-context + """ + secrets: Optional[Dict[str, str]] """(Optional) Map of mount IDs/environment variable names to secret names. @@ -88,46 +78,18 @@ class BlueprintCreateParams(TypedDict, total=False): """A list of commands to run to set up your system.""" -class BuildContextsHTTP(TypedDict, total=False): - url: Required[str] - """HTTP(S) URL to a tarball or directory to use as context.""" - - -class BuildContextsObject(TypedDict, total=False): +class BuildContext(TypedDict, total=False): object_id: Required[str] - """Handle for a Runloop stored object to use as context.""" - - -class BuildContexts(TypedDict, total=False): - type: Required[Literal["OBJECT", "HTTP"]] - """Type of the context. Supported values: object, http""" - - http: Optional[BuildContextsHTTP] - """HTTP(S) context parameters.""" - - object: Optional[BuildContextsObject] - """Object context parameters (named build context).""" + """The ID of an object, whose contents are to be used as a build context.""" + type: Required[Literal["object"]] -class LocalBuildContextHTTP(TypedDict, total=False): - url: Required[str] - """HTTP(S) URL to a tarball or directory to use as context.""" - -class LocalBuildContextObject(TypedDict, total=False): +class NamedBuildContexts(TypedDict, total=False): object_id: Required[str] - """Handle for a Runloop stored object to use as context.""" - - -class LocalBuildContext(TypedDict, total=False): - type: Required[Literal["OBJECT", "HTTP"]] - """Type of the context. Supported values: object, http""" - - http: Optional[LocalBuildContextHTTP] - """HTTP(S) context parameters.""" + """The ID of an object, whose contents are to be used as a build context.""" - object: Optional[LocalBuildContextObject] - """Object context parameters (named build context).""" + type: Required[Literal["object"]] class ServiceCredentials(TypedDict, total=False): diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index c58487655..81244126d 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -9,17 +9,7 @@ from .shared_params.launch_parameters import LaunchParameters from .shared_params.code_mount_parameters import CodeMountParameters -__all__ = [ - "BlueprintPreviewParams", - "BuildContexts", - "BuildContextsHTTP", - "BuildContextsObject", - "LocalBuildContext", - "LocalBuildContextHTTP", - "LocalBuildContextObject", - "Service", - "ServiceCredentials", -] +__all__ = ["BlueprintPreviewParams", "BuildContext", "NamedBuildContexts", "Service", "ServiceCredentials"] class BlueprintPreviewParams(TypedDict, total=False): @@ -43,13 +33,8 @@ class BlueprintPreviewParams(TypedDict, total=False): build_args: Optional[Dict[str, str]] """(Optional) Arbitrary Docker build args to pass during build.""" - build_contexts: Optional[Dict[str, BuildContexts]] - """(Optional) Map of named Docker build contexts. - - Keys are context names, values are typed context definitions (object or http). - See Docker buildx additional contexts for details: - https://docs.docker.com/reference/cli/docker/buildx/build/#build-context - """ + build_context: Optional[BuildContext] + """A build context backed by an Object.""" code_mounts: Optional[Iterable[CodeMountParameters]] """A list of code mounts to be included in the Blueprint.""" @@ -63,12 +48,17 @@ class BlueprintPreviewParams(TypedDict, total=False): launch_parameters: Optional[LaunchParameters] """Parameters to configure your Devbox at launch time.""" - local_build_context: Optional[LocalBuildContext] - """(Optional) Local build context stored in object-storage.""" - metadata: Optional[Dict[str, str]] """(Optional) User defined metadata for the Blueprint.""" + named_build_contexts: Optional[Dict[str, NamedBuildContexts]] + """ + (Optional) Map of named build contexts to attach to the Blueprint build, where + the keys are the name used when referencing the contexts in a Dockerfile. See + Docker buildx additional contexts for details: + https://docs.docker.com/reference/cli/docker/buildx/build/#build-context + """ + secrets: Optional[Dict[str, str]] """(Optional) Map of mount IDs/environment variable names to secret names. @@ -88,46 +78,18 @@ class BlueprintPreviewParams(TypedDict, total=False): """A list of commands to run to set up your system.""" -class BuildContextsHTTP(TypedDict, total=False): - url: Required[str] - """HTTP(S) URL to a tarball or directory to use as context.""" - - -class BuildContextsObject(TypedDict, total=False): +class BuildContext(TypedDict, total=False): object_id: Required[str] - """Handle for a Runloop stored object to use as context.""" - - -class BuildContexts(TypedDict, total=False): - type: Required[Literal["OBJECT", "HTTP"]] - """Type of the context. Supported values: object, http""" - - http: Optional[BuildContextsHTTP] - """HTTP(S) context parameters.""" - - object: Optional[BuildContextsObject] - """Object context parameters (named build context).""" + """The ID of an object, whose contents are to be used as a build context.""" + type: Required[Literal["object"]] -class LocalBuildContextHTTP(TypedDict, total=False): - url: Required[str] - """HTTP(S) URL to a tarball or directory to use as context.""" - -class LocalBuildContextObject(TypedDict, total=False): +class NamedBuildContexts(TypedDict, total=False): object_id: Required[str] - """Handle for a Runloop stored object to use as context.""" - - -class LocalBuildContext(TypedDict, total=False): - type: Required[Literal["OBJECT", "HTTP"]] - """Type of the context. Supported values: object, http""" - - http: Optional[LocalBuildContextHTTP] - """HTTP(S) context parameters.""" + """The ID of an object, whose contents are to be used as a build context.""" - object: Optional[LocalBuildContextObject] - """Object context parameters (named build context).""" + type: Required[Literal["object"]] class ServiceCredentials(TypedDict, total=False): diff --git a/src/runloop_api_client/types/shared/agent_mount_parameters.py b/src/runloop_api_client/types/shared/agent_mount_parameters.py index c2b384265..6351a19f3 100644 --- a/src/runloop_api_client/types/shared/agent_mount_parameters.py +++ b/src/runloop_api_client/types/shared/agent_mount_parameters.py @@ -9,8 +9,15 @@ class AgentMountParameters(BaseModel): - agent_id: str - """The ID of the agent to mount.""" + agent_id: Optional[str] = None + """The ID of the agent to mount. Either agent_id or name must be set.""" + + agent_name: Optional[str] = None + """The name of the agent to mount. + + Returns the most recent agent with a matching name if no agent id string + provided. Either agent id or name must be set + """ type: Literal["agent_mount"] diff --git a/src/runloop_api_client/types/shared_params/agent_mount_parameters.py b/src/runloop_api_client/types/shared_params/agent_mount_parameters.py index def126043..17c18dc32 100644 --- a/src/runloop_api_client/types/shared_params/agent_mount_parameters.py +++ b/src/runloop_api_client/types/shared_params/agent_mount_parameters.py @@ -9,8 +9,15 @@ class AgentMountParameters(TypedDict, total=False): - agent_id: Required[str] - """The ID of the agent to mount.""" + agent_id: Required[Optional[str]] + """The ID of the agent to mount. Either agent_id or name must be set.""" + + agent_name: Required[Optional[str]] + """The name of the agent to mount. + + Returns the most recent agent with a matching name if no agent id string + provided. Either agent id or name must be set + """ type: Required[Literal["agent_mount"]] diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 60dd03456..11a8ee281 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -36,12 +36,9 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: base_blueprint_id="base_blueprint_id", base_blueprint_name="base_blueprint_name", build_args={"foo": "string"}, - build_contexts={ - "foo": { - "type": "OBJECT", - "http": {"url": "url"}, - "object": {"object_id": "object_id"}, - } + build_context={ + "object_id": "object_id", + "type": "object", }, code_mounts=[ { @@ -72,12 +69,13 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "username": "username", }, }, - local_build_context={ - "type": "OBJECT", - "http": {"url": "url"}, - "object": {"object_id": "object_id"}, - }, metadata={"foo": "string"}, + named_build_contexts={ + "foo": { + "object_id": "object_id", + "type": "object", + } + }, secrets={"foo": "string"}, services=[ { @@ -384,12 +382,9 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: base_blueprint_id="base_blueprint_id", base_blueprint_name="base_blueprint_name", build_args={"foo": "string"}, - build_contexts={ - "foo": { - "type": "OBJECT", - "http": {"url": "url"}, - "object": {"object_id": "object_id"}, - } + build_context={ + "object_id": "object_id", + "type": "object", }, code_mounts=[ { @@ -420,12 +415,13 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: "username": "username", }, }, - local_build_context={ - "type": "OBJECT", - "http": {"url": "url"}, - "object": {"object_id": "object_id"}, - }, metadata={"foo": "string"}, + named_build_contexts={ + "foo": { + "object_id": "object_id", + "type": "object", + } + }, secrets={"foo": "string"}, services=[ { @@ -488,12 +484,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - base_blueprint_id="base_blueprint_id", base_blueprint_name="base_blueprint_name", build_args={"foo": "string"}, - build_contexts={ - "foo": { - "type": "OBJECT", - "http": {"url": "url"}, - "object": {"object_id": "object_id"}, - } + build_context={ + "object_id": "object_id", + "type": "object", }, code_mounts=[ { @@ -524,12 +517,13 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "username": "username", }, }, - local_build_context={ - "type": "OBJECT", - "http": {"url": "url"}, - "object": {"object_id": "object_id"}, - }, metadata={"foo": "string"}, + named_build_contexts={ + "foo": { + "object_id": "object_id", + "type": "object", + } + }, secrets={"foo": "string"}, services=[ { @@ -836,12 +830,9 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) base_blueprint_id="base_blueprint_id", base_blueprint_name="base_blueprint_name", build_args={"foo": "string"}, - build_contexts={ - "foo": { - "type": "OBJECT", - "http": {"url": "url"}, - "object": {"object_id": "object_id"}, - } + build_context={ + "object_id": "object_id", + "type": "object", }, code_mounts=[ { @@ -872,12 +863,13 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) "username": "username", }, }, - local_build_context={ - "type": "OBJECT", - "http": {"url": "url"}, - "object": {"object_id": "object_id"}, - }, metadata={"foo": "string"}, + named_build_contexts={ + "foo": { + "object_id": "object_id", + "type": "object", + } + }, secrets={"foo": "string"}, services=[ { From eaf299f259b73c48c01ed4a4b33df1237230edeb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Nov 2025 01:40:40 +0000 Subject: [PATCH 905/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index db00cae02..0b8a7c68d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.67.0" + ".": "0.68.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 39994fb1c..6ce70117f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.67.0" +version = "0.68.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index d5ccb7242..03a1aaf1c 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.67.0" # x-release-please-version +__version__ = "0.68.0" # x-release-please-version diff --git a/uv.lock b/uv.lock index 52ec717e4..c2bf0f2bc 100644 --- a/uv.lock +++ b/uv.lock @@ -1032,7 +1032,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "0.67.0" +version = "0.68.0" source = { editable = "." } dependencies = [ { name = "anyio" }, From 59584cf11d5693e9a3b0dd196f3a9e9859eda677 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Nov 2025 02:02:40 +0000 Subject: [PATCH 906/993] feat(devbox): unify api for devbox mounts --- .stats.yml | 4 +-- .../resources/devboxes/devboxes.py | 4 +-- .../types/devbox_create_params.py | 2 +- .../types/shared/code_mount_parameters.py | 3 +++ src/runloop_api_client/types/shared/mount.py | 25 ++++++++++++++++--- .../shared_params/code_mount_parameters.py | 4 ++- .../types/shared_params/mount.py | 21 +++++++++++++--- tests/api_resources/test_blueprints.py | 4 +++ tests/api_resources/test_devboxes.py | 2 ++ 9 files changed, 55 insertions(+), 14 deletions(-) diff --git a/.stats.yml b/.stats.yml index 33e553ff2..bc705b998 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 97 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-5f33221208c1febba343daf570f73a5086f150a9b128df045ebddc3fe2c86607.yml -openapi_spec_hash: 0aea07130ddbe43a665a13a68231e2ca +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-0dd27c6877ed117c50fe0af95cee4d54c646d2484368e131b8e3315eba3fffcc.yml +openapi_spec_hash: 68f663172747aef8e66f2b23289efc7b config_hash: 2363f563f42501d2b1587a4f64bdccaf diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 7a06d4ba3..45b79a3ef 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -200,7 +200,7 @@ def create( metadata: User defined metadata to attach to the devbox for organization. - mounts: A list of file system mounts to be included in the Devbox. + mounts: A list of mounts to be included in the Devbox. name: (Optional) A user specified name to give the Devbox. @@ -1508,7 +1508,7 @@ async def create( metadata: User defined metadata to attach to the devbox for organization. - mounts: A list of file system mounts to be included in the Devbox. + mounts: A list of mounts to be included in the Devbox. name: (Optional) A user specified name to give the Devbox. diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index c93dcca81..cc0080136 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -51,7 +51,7 @@ class DevboxCreateParams(TypedDict, total=False): """User defined metadata to attach to the devbox for organization.""" mounts: Optional[Iterable[Mount]] - """A list of file system mounts to be included in the Devbox.""" + """A list of mounts to be included in the Devbox.""" name: Optional[str] """(Optional) A user specified name to give the Devbox.""" diff --git a/src/runloop_api_client/types/shared/code_mount_parameters.py b/src/runloop_api_client/types/shared/code_mount_parameters.py index b430f1513..5e509359b 100644 --- a/src/runloop_api_client/types/shared/code_mount_parameters.py +++ b/src/runloop_api_client/types/shared/code_mount_parameters.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional +from typing_extensions import Literal from ..._models import BaseModel @@ -17,6 +18,8 @@ class CodeMountParameters(BaseModel): repo_owner: str """The owner of the repo.""" + type: Literal["code_mount"] + token: Optional[str] = None """The authentication token necessary to pull repo.""" diff --git a/src/runloop_api_client/types/shared/mount.py b/src/runloop_api_client/types/shared/mount.py index 7fb68f24a..4ebc3eafb 100644 --- a/src/runloop_api_client/types/shared/mount.py +++ b/src/runloop_api_client/types/shared/mount.py @@ -1,12 +1,29 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union -from typing_extensions import Annotated, TypeAlias +from typing import Dict, Union +from typing_extensions import Literal, Annotated, TypeAlias from ..._utils import PropertyInfo +from ..._models import BaseModel +from .code_mount_parameters import CodeMountParameters from .agent_mount_parameters import AgentMountParameters from .object_mount_parameters import ObjectMountParameters -__all__ = ["Mount"] +__all__ = ["Mount", "FileMountParameters"] -Mount: TypeAlias = Annotated[Union[ObjectMountParameters, AgentMountParameters], PropertyInfo(discriminator="type")] + +class FileMountParameters(BaseModel): + files: Dict[str, str] + """Map of file paths to file contents to be written before setup. + + Keys are absolute paths where files should be created, values are the file + contents. + """ + + type: Literal["file_mount"] + + +Mount: TypeAlias = Annotated[ + Union[ObjectMountParameters, AgentMountParameters, CodeMountParameters, FileMountParameters], + PropertyInfo(discriminator="type"), +] diff --git a/src/runloop_api_client/types/shared_params/code_mount_parameters.py b/src/runloop_api_client/types/shared_params/code_mount_parameters.py index 5afa72523..6b3a64511 100644 --- a/src/runloop_api_client/types/shared_params/code_mount_parameters.py +++ b/src/runloop_api_client/types/shared_params/code_mount_parameters.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Optional -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["CodeMountParameters"] @@ -18,6 +18,8 @@ class CodeMountParameters(TypedDict, total=False): repo_owner: Required[str] """The owner of the repo.""" + type: Required[Literal["code_mount"]] + token: Optional[str] """The authentication token necessary to pull repo.""" diff --git a/src/runloop_api_client/types/shared_params/mount.py b/src/runloop_api_client/types/shared_params/mount.py index fb7e05ba7..9f9631013 100644 --- a/src/runloop_api_client/types/shared_params/mount.py +++ b/src/runloop_api_client/types/shared_params/mount.py @@ -2,12 +2,25 @@ from __future__ import annotations -from typing import Union -from typing_extensions import TypeAlias +from typing import Dict, Union +from typing_extensions import Literal, Required, TypeAlias, TypedDict +from .code_mount_parameters import CodeMountParameters from .agent_mount_parameters import AgentMountParameters from .object_mount_parameters import ObjectMountParameters -__all__ = ["Mount"] +__all__ = ["Mount", "FileMountParameters"] -Mount: TypeAlias = Union[ObjectMountParameters, AgentMountParameters] + +class FileMountParameters(TypedDict, total=False): + files: Required[Dict[str, str]] + """Map of file paths to file contents to be written before setup. + + Keys are absolute paths where files should be created, values are the file + contents. + """ + + type: Required[Literal["file_mount"]] + + +Mount: TypeAlias = Union[ObjectMountParameters, AgentMountParameters, CodeMountParameters, FileMountParameters] diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 11a8ee281..786d403a9 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -44,6 +44,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: { "repo_name": "repo_name", "repo_owner": "repo_owner", + "type": "code_mount", "token": "token", "install_command": "install_command", } @@ -390,6 +391,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: { "repo_name": "repo_name", "repo_owner": "repo_owner", + "type": "code_mount", "token": "token", "install_command": "install_command", } @@ -492,6 +494,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - { "repo_name": "repo_name", "repo_owner": "repo_owner", + "type": "code_mount", "token": "token", "install_command": "install_command", } @@ -838,6 +841,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) { "repo_name": "repo_name", "repo_owner": "repo_owner", + "type": "code_mount", "token": "token", "install_command": "install_command", } diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 1ea6ee17d..7a17bb2e3 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -54,6 +54,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: { "repo_name": "repo_name", "repo_owner": "repo_owner", + "type": "code_mount", "token": "token", "install_command": "install_command", } @@ -1129,6 +1130,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - { "repo_name": "repo_name", "repo_owner": "repo_owner", + "type": "code_mount", "token": "token", "install_command": "install_command", } From 58aa0c8c7821b907ca75680e2b7381ca0fb6432c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 22 Nov 2025 01:27:42 +0000 Subject: [PATCH 907/993] chore: hide build context APIs --- .stats.yml | 6 +- api.md | 3 - .../resources/blueprints.py | 44 --- .../resources/devboxes/devboxes.py | 288 ------------------ .../types/blueprint_build_parameters.py | 28 +- .../types/blueprint_create_params.py | 29 +- .../types/blueprint_preview_params.py | 29 +- tests/api_resources/test_blueprints.py | 40 --- tests/api_resources/test_devboxes.py | 228 -------------- 9 files changed, 8 insertions(+), 687 deletions(-) diff --git a/.stats.yml b/.stats.yml index bc705b998..1235f571e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 97 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-0dd27c6877ed117c50fe0af95cee4d54c646d2484368e131b8e3315eba3fffcc.yml -openapi_spec_hash: 68f663172747aef8e66f2b23289efc7b +configured_endpoints: 94 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-907baea7d51fd2660895c74603cf1ff765eb9f62eb10ce6e0c1d17ac1c16abf2.yml +openapi_spec_hash: f1280edb22cdd91238efc2b18e3d324c config_hash: 2363f563f42501d2b1587a4f64bdccaf diff --git a/api.md b/api.md index 49c26771e..5729308ce 100644 --- a/api.md +++ b/api.md @@ -124,15 +124,12 @@ Methods: - client.devboxes.execute(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView -- client.devboxes.keep_alive(id) -> object - client.devboxes.list_disk_snapshots(\*\*params) -> SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView] - client.devboxes.read_file_contents(id, \*\*params) -> str - client.devboxes.remove_tunnel(id, \*\*params) -> object -- client.devboxes.resume(id) -> DevboxView - client.devboxes.shutdown(id) -> DevboxView - client.devboxes.snapshot_disk(id, \*\*params) -> DevboxSnapshotView - client.devboxes.snapshot_disk_async(id, \*\*params) -> DevboxSnapshotView -- client.devboxes.suspend(id) -> DevboxView - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.wait_for_command(execution_id, \*, devbox_id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.write_file_contents(id, \*\*params) -> DevboxExecutionDetailView diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index d7a82aace..fa1390130 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -62,13 +62,11 @@ def create( base_blueprint_id: Optional[str] | Omit = omit, base_blueprint_name: Optional[str] | Omit = omit, build_args: Optional[Dict[str, str]] | Omit = omit, - build_context: Optional[blueprint_create_params.BuildContext] | Omit = omit, code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, - named_build_contexts: Optional[Dict[str, blueprint_create_params.NamedBuildContexts]] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, @@ -100,8 +98,6 @@ def create( build_args: (Optional) Arbitrary Docker build args to pass during build. - build_context: A build context backed by an Object. - code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -112,11 +108,6 @@ def create( metadata: (Optional) User defined metadata for the Blueprint. - named_build_contexts: (Optional) Map of named build contexts to attach to the Blueprint build, where - the keys are the name used when referencing the contexts in a Dockerfile. See - Docker buildx additional contexts for details: - https://docs.docker.com/reference/cli/docker/buildx/build/#build-context - secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets will be available to commands during the build. Secrets are NOT stored in the blueprint image. Example: {"DB_PASS": "DATABASE_PASSWORD"} makes the secret @@ -146,13 +137,11 @@ def create( "base_blueprint_id": base_blueprint_id, "base_blueprint_name": base_blueprint_name, "build_args": build_args, - "build_context": build_context, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, "metadata": metadata, - "named_build_contexts": named_build_contexts, "secrets": secrets, "services": services, "system_setup_commands": system_setup_commands, @@ -462,13 +451,11 @@ def preview( base_blueprint_id: Optional[str] | Omit = omit, base_blueprint_name: Optional[str] | Omit = omit, build_args: Optional[Dict[str, str]] | Omit = omit, - build_context: Optional[blueprint_preview_params.BuildContext] | Omit = omit, code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, - named_build_contexts: Optional[Dict[str, blueprint_preview_params.NamedBuildContexts]] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, services: Optional[Iterable[blueprint_preview_params.Service]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, @@ -498,8 +485,6 @@ def preview( build_args: (Optional) Arbitrary Docker build args to pass during build. - build_context: A build context backed by an Object. - code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -510,11 +495,6 @@ def preview( metadata: (Optional) User defined metadata for the Blueprint. - named_build_contexts: (Optional) Map of named build contexts to attach to the Blueprint build, where - the keys are the name used when referencing the contexts in a Dockerfile. See - Docker buildx additional contexts for details: - https://docs.docker.com/reference/cli/docker/buildx/build/#build-context - secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets will be available to commands during the build. Secrets are NOT stored in the blueprint image. Example: {"DB_PASS": "DATABASE_PASSWORD"} makes the secret @@ -544,13 +524,11 @@ def preview( "base_blueprint_id": base_blueprint_id, "base_blueprint_name": base_blueprint_name, "build_args": build_args, - "build_context": build_context, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, "metadata": metadata, - "named_build_contexts": named_build_contexts, "secrets": secrets, "services": services, "system_setup_commands": system_setup_commands, @@ -595,13 +573,11 @@ async def create( base_blueprint_id: Optional[str] | Omit = omit, base_blueprint_name: Optional[str] | Omit = omit, build_args: Optional[Dict[str, str]] | Omit = omit, - build_context: Optional[blueprint_create_params.BuildContext] | Omit = omit, code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, - named_build_contexts: Optional[Dict[str, blueprint_create_params.NamedBuildContexts]] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, @@ -633,8 +609,6 @@ async def create( build_args: (Optional) Arbitrary Docker build args to pass during build. - build_context: A build context backed by an Object. - code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -645,11 +619,6 @@ async def create( metadata: (Optional) User defined metadata for the Blueprint. - named_build_contexts: (Optional) Map of named build contexts to attach to the Blueprint build, where - the keys are the name used when referencing the contexts in a Dockerfile. See - Docker buildx additional contexts for details: - https://docs.docker.com/reference/cli/docker/buildx/build/#build-context - secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets will be available to commands during the build. Secrets are NOT stored in the blueprint image. Example: {"DB_PASS": "DATABASE_PASSWORD"} makes the secret @@ -679,13 +648,11 @@ async def create( "base_blueprint_id": base_blueprint_id, "base_blueprint_name": base_blueprint_name, "build_args": build_args, - "build_context": build_context, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, "metadata": metadata, - "named_build_contexts": named_build_contexts, "secrets": secrets, "services": services, "system_setup_commands": system_setup_commands, @@ -995,13 +962,11 @@ async def preview( base_blueprint_id: Optional[str] | Omit = omit, base_blueprint_name: Optional[str] | Omit = omit, build_args: Optional[Dict[str, str]] | Omit = omit, - build_context: Optional[blueprint_preview_params.BuildContext] | Omit = omit, code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, - named_build_contexts: Optional[Dict[str, blueprint_preview_params.NamedBuildContexts]] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, services: Optional[Iterable[blueprint_preview_params.Service]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, @@ -1031,8 +996,6 @@ async def preview( build_args: (Optional) Arbitrary Docker build args to pass during build. - build_context: A build context backed by an Object. - code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -1043,11 +1006,6 @@ async def preview( metadata: (Optional) User defined metadata for the Blueprint. - named_build_contexts: (Optional) Map of named build contexts to attach to the Blueprint build, where - the keys are the name used when referencing the contexts in a Dockerfile. See - Docker buildx additional contexts for details: - https://docs.docker.com/reference/cli/docker/buildx/build/#build-context - secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets will be available to commands during the build. Secrets are NOT stored in the blueprint image. Example: {"DB_PASS": "DATABASE_PASSWORD"} makes the secret @@ -1077,13 +1035,11 @@ async def preview( "base_blueprint_id": base_blueprint_id, "base_blueprint_name": base_blueprint_name, "build_args": build_args, - "build_context": build_context, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, "launch_parameters": launch_parameters, "metadata": metadata, - "named_build_contexts": named_build_contexts, "secrets": secrets, "services": services, "system_setup_commands": system_setup_commands, diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 45b79a3ef..2821fc709 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -777,47 +777,6 @@ def execute_sync( cast_to=DevboxExecutionDetailView, ) - def keep_alive( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> object: - """ - Send a 'Keep Alive' signal to a running Devbox that is configured to shutdown on - idle so the idle time resets. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/keep_alive", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=object, - ) - def list_disk_snapshots( self, *, @@ -980,49 +939,6 @@ def remove_tunnel( cast_to=object, ) - def resume( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> DevboxView: - """Resume a suspended Devbox with the disk state captured as suspend time. - - Note - that any previously running processes or daemons will need to be restarted using - the Devbox shell tools. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/resume", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=DevboxView, - ) - def shutdown( self, id: str, @@ -1185,48 +1101,6 @@ def snapshot_disk_async( cast_to=DevboxSnapshotView, ) - def suspend( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> DevboxView: - """ - Suspend a running Devbox and create a disk snapshot to enable resuming the - Devbox later with the same disk. Note this will not snapshot memory state such - as running processes. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/devboxes/{id}/suspend", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=DevboxView, - ) - def upload_file( self, id: str, @@ -2085,47 +1959,6 @@ async def execute_sync( cast_to=DevboxExecutionDetailView, ) - async def keep_alive( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> object: - """ - Send a 'Keep Alive' signal to a running Devbox that is configured to shutdown on - idle so the idle time resets. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/keep_alive", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=object, - ) - def list_disk_snapshots( self, *, @@ -2288,49 +2121,6 @@ async def remove_tunnel( cast_to=object, ) - async def resume( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> DevboxView: - """Resume a suspended Devbox with the disk state captured as suspend time. - - Note - that any previously running processes or daemons will need to be restarted using - the Devbox shell tools. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/resume", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=DevboxView, - ) - async def shutdown( self, id: str, @@ -2493,48 +2283,6 @@ async def snapshot_disk_async( cast_to=DevboxSnapshotView, ) - async def suspend( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> DevboxView: - """ - Suspend a running Devbox and create a disk snapshot to enable resuming the - Devbox later with the same disk. Note this will not snapshot memory state such - as running processes. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/devboxes/{id}/suspend", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=DevboxView, - ) - async def upload_file( self, id: str, @@ -2763,9 +2511,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.execute_sync, # pyright: ignore[reportDeprecated], ) ) - self.keep_alive = to_raw_response_wrapper( - devboxes.keep_alive, - ) self.list_disk_snapshots = to_raw_response_wrapper( devboxes.list_disk_snapshots, ) @@ -2775,9 +2520,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.remove_tunnel = to_raw_response_wrapper( devboxes.remove_tunnel, ) - self.resume = to_raw_response_wrapper( - devboxes.resume, - ) self.shutdown = to_raw_response_wrapper( devboxes.shutdown, ) @@ -2787,9 +2529,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.snapshot_disk_async = to_raw_response_wrapper( devboxes.snapshot_disk_async, ) - self.suspend = to_raw_response_wrapper( - devboxes.suspend, - ) self.upload_file = to_raw_response_wrapper( devboxes.upload_file, ) @@ -2861,9 +2600,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.execute_sync, # pyright: ignore[reportDeprecated], ) ) - self.keep_alive = async_to_raw_response_wrapper( - devboxes.keep_alive, - ) self.list_disk_snapshots = async_to_raw_response_wrapper( devboxes.list_disk_snapshots, ) @@ -2873,9 +2609,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.remove_tunnel = async_to_raw_response_wrapper( devboxes.remove_tunnel, ) - self.resume = async_to_raw_response_wrapper( - devboxes.resume, - ) self.shutdown = async_to_raw_response_wrapper( devboxes.shutdown, ) @@ -2885,9 +2618,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.snapshot_disk_async = async_to_raw_response_wrapper( devboxes.snapshot_disk_async, ) - self.suspend = async_to_raw_response_wrapper( - devboxes.suspend, - ) self.upload_file = async_to_raw_response_wrapper( devboxes.upload_file, ) @@ -2959,9 +2689,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.execute_sync, # pyright: ignore[reportDeprecated], ) ) - self.keep_alive = to_streamed_response_wrapper( - devboxes.keep_alive, - ) self.list_disk_snapshots = to_streamed_response_wrapper( devboxes.list_disk_snapshots, ) @@ -2971,9 +2698,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.remove_tunnel = to_streamed_response_wrapper( devboxes.remove_tunnel, ) - self.resume = to_streamed_response_wrapper( - devboxes.resume, - ) self.shutdown = to_streamed_response_wrapper( devboxes.shutdown, ) @@ -2983,9 +2707,6 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.snapshot_disk_async = to_streamed_response_wrapper( devboxes.snapshot_disk_async, ) - self.suspend = to_streamed_response_wrapper( - devboxes.suspend, - ) self.upload_file = to_streamed_response_wrapper( devboxes.upload_file, ) @@ -3057,9 +2778,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.execute_sync, # pyright: ignore[reportDeprecated], ) ) - self.keep_alive = async_to_streamed_response_wrapper( - devboxes.keep_alive, - ) self.list_disk_snapshots = async_to_streamed_response_wrapper( devboxes.list_disk_snapshots, ) @@ -3069,9 +2787,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.remove_tunnel = async_to_streamed_response_wrapper( devboxes.remove_tunnel, ) - self.resume = async_to_streamed_response_wrapper( - devboxes.resume, - ) self.shutdown = async_to_streamed_response_wrapper( devboxes.shutdown, ) @@ -3081,9 +2796,6 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.snapshot_disk_async = async_to_streamed_response_wrapper( devboxes.snapshot_disk_async, ) - self.suspend = async_to_streamed_response_wrapper( - devboxes.suspend, - ) self.upload_file = async_to_streamed_response_wrapper( devboxes.upload_file, ) diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index cc86468df..63a92f146 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -1,27 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Dict, List, Optional -from typing_extensions import Literal from .._models import BaseModel from .shared.launch_parameters import LaunchParameters from .shared.code_mount_parameters import CodeMountParameters -__all__ = ["BlueprintBuildParameters", "BuildContext", "NamedBuildContexts", "Service", "ServiceCredentials"] - - -class BuildContext(BaseModel): - object_id: str - """The ID of an object, whose contents are to be used as a build context.""" - - type: Literal["object"] - - -class NamedBuildContexts(BaseModel): - object_id: str - """The ID of an object, whose contents are to be used as a build context.""" - - type: Literal["object"] +__all__ = ["BlueprintBuildParameters", "Service", "ServiceCredentials"] class ServiceCredentials(BaseModel): @@ -76,9 +61,6 @@ class BlueprintBuildParameters(BaseModel): build_args: Optional[Dict[str, str]] = None """(Optional) Arbitrary Docker build args to pass during build.""" - build_context: Optional[BuildContext] = None - """A build context backed by an Object.""" - code_mounts: Optional[List[CodeMountParameters]] = None """A list of code mounts to be included in the Blueprint.""" @@ -94,14 +76,6 @@ class BlueprintBuildParameters(BaseModel): metadata: Optional[Dict[str, str]] = None """(Optional) User defined metadata for the Blueprint.""" - named_build_contexts: Optional[Dict[str, NamedBuildContexts]] = None - """ - (Optional) Map of named build contexts to attach to the Blueprint build, where - the keys are the name used when referencing the contexts in a Dockerfile. See - Docker buildx additional contexts for details: - https://docs.docker.com/reference/cli/docker/buildx/build/#build-context - """ - secrets: Optional[Dict[str, str]] = None """(Optional) Map of mount IDs/environment variable names to secret names. diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index a15e6f470..9d0a15848 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Dict, Iterable, Optional -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Required, TypedDict from .._types import SequenceNotStr from .shared_params.launch_parameters import LaunchParameters from .shared_params.code_mount_parameters import CodeMountParameters -__all__ = ["BlueprintCreateParams", "BuildContext", "NamedBuildContexts", "Service", "ServiceCredentials"] +__all__ = ["BlueprintCreateParams", "Service", "ServiceCredentials"] class BlueprintCreateParams(TypedDict, total=False): @@ -33,9 +33,6 @@ class BlueprintCreateParams(TypedDict, total=False): build_args: Optional[Dict[str, str]] """(Optional) Arbitrary Docker build args to pass during build.""" - build_context: Optional[BuildContext] - """A build context backed by an Object.""" - code_mounts: Optional[Iterable[CodeMountParameters]] """A list of code mounts to be included in the Blueprint.""" @@ -51,14 +48,6 @@ class BlueprintCreateParams(TypedDict, total=False): metadata: Optional[Dict[str, str]] """(Optional) User defined metadata for the Blueprint.""" - named_build_contexts: Optional[Dict[str, NamedBuildContexts]] - """ - (Optional) Map of named build contexts to attach to the Blueprint build, where - the keys are the name used when referencing the contexts in a Dockerfile. See - Docker buildx additional contexts for details: - https://docs.docker.com/reference/cli/docker/buildx/build/#build-context - """ - secrets: Optional[Dict[str, str]] """(Optional) Map of mount IDs/environment variable names to secret names. @@ -78,20 +67,6 @@ class BlueprintCreateParams(TypedDict, total=False): """A list of commands to run to set up your system.""" -class BuildContext(TypedDict, total=False): - object_id: Required[str] - """The ID of an object, whose contents are to be used as a build context.""" - - type: Required[Literal["object"]] - - -class NamedBuildContexts(TypedDict, total=False): - object_id: Required[str] - """The ID of an object, whose contents are to be used as a build context.""" - - type: Required[Literal["object"]] - - class ServiceCredentials(TypedDict, total=False): password: Required[str] """The password of the container service.""" diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index 81244126d..5c1e257f2 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Dict, Iterable, Optional -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Required, TypedDict from .._types import SequenceNotStr from .shared_params.launch_parameters import LaunchParameters from .shared_params.code_mount_parameters import CodeMountParameters -__all__ = ["BlueprintPreviewParams", "BuildContext", "NamedBuildContexts", "Service", "ServiceCredentials"] +__all__ = ["BlueprintPreviewParams", "Service", "ServiceCredentials"] class BlueprintPreviewParams(TypedDict, total=False): @@ -33,9 +33,6 @@ class BlueprintPreviewParams(TypedDict, total=False): build_args: Optional[Dict[str, str]] """(Optional) Arbitrary Docker build args to pass during build.""" - build_context: Optional[BuildContext] - """A build context backed by an Object.""" - code_mounts: Optional[Iterable[CodeMountParameters]] """A list of code mounts to be included in the Blueprint.""" @@ -51,14 +48,6 @@ class BlueprintPreviewParams(TypedDict, total=False): metadata: Optional[Dict[str, str]] """(Optional) User defined metadata for the Blueprint.""" - named_build_contexts: Optional[Dict[str, NamedBuildContexts]] - """ - (Optional) Map of named build contexts to attach to the Blueprint build, where - the keys are the name used when referencing the contexts in a Dockerfile. See - Docker buildx additional contexts for details: - https://docs.docker.com/reference/cli/docker/buildx/build/#build-context - """ - secrets: Optional[Dict[str, str]] """(Optional) Map of mount IDs/environment variable names to secret names. @@ -78,20 +67,6 @@ class BlueprintPreviewParams(TypedDict, total=False): """A list of commands to run to set up your system.""" -class BuildContext(TypedDict, total=False): - object_id: Required[str] - """The ID of an object, whose contents are to be used as a build context.""" - - type: Required[Literal["object"]] - - -class NamedBuildContexts(TypedDict, total=False): - object_id: Required[str] - """The ID of an object, whose contents are to be used as a build context.""" - - type: Required[Literal["object"]] - - class ServiceCredentials(TypedDict, total=False): password: Required[str] """The password of the container service.""" diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 786d403a9..b8310545a 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -36,10 +36,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: base_blueprint_id="base_blueprint_id", base_blueprint_name="base_blueprint_name", build_args={"foo": "string"}, - build_context={ - "object_id": "object_id", - "type": "object", - }, code_mounts=[ { "repo_name": "repo_name", @@ -71,12 +67,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: }, }, metadata={"foo": "string"}, - named_build_contexts={ - "foo": { - "object_id": "object_id", - "type": "object", - } - }, secrets={"foo": "string"}, services=[ { @@ -383,10 +373,6 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: base_blueprint_id="base_blueprint_id", base_blueprint_name="base_blueprint_name", build_args={"foo": "string"}, - build_context={ - "object_id": "object_id", - "type": "object", - }, code_mounts=[ { "repo_name": "repo_name", @@ -418,12 +404,6 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: }, }, metadata={"foo": "string"}, - named_build_contexts={ - "foo": { - "object_id": "object_id", - "type": "object", - } - }, secrets={"foo": "string"}, services=[ { @@ -486,10 +466,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - base_blueprint_id="base_blueprint_id", base_blueprint_name="base_blueprint_name", build_args={"foo": "string"}, - build_context={ - "object_id": "object_id", - "type": "object", - }, code_mounts=[ { "repo_name": "repo_name", @@ -521,12 +497,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - }, }, metadata={"foo": "string"}, - named_build_contexts={ - "foo": { - "object_id": "object_id", - "type": "object", - } - }, secrets={"foo": "string"}, services=[ { @@ -833,10 +803,6 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) base_blueprint_id="base_blueprint_id", base_blueprint_name="base_blueprint_name", build_args={"foo": "string"}, - build_context={ - "object_id": "object_id", - "type": "object", - }, code_mounts=[ { "repo_name": "repo_name", @@ -868,12 +834,6 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) }, }, metadata={"foo": "string"}, - named_build_contexts={ - "foo": { - "object_id": "object_id", - "type": "object", - } - }, secrets={"foo": "string"}, services=[ { diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 7a17bb2e3..6044ce237 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -580,44 +580,6 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: command="command", ) - @parametrize - def test_method_keep_alive(self, client: Runloop) -> None: - devbox = client.devboxes.keep_alive( - "id", - ) - assert_matches_type(object, devbox, path=["response"]) - - @parametrize - def test_raw_response_keep_alive(self, client: Runloop) -> None: - response = client.devboxes.with_raw_response.keep_alive( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - devbox = response.parse() - assert_matches_type(object, devbox, path=["response"]) - - @parametrize - def test_streaming_response_keep_alive(self, client: Runloop) -> None: - with client.devboxes.with_streaming_response.keep_alive( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - devbox = response.parse() - assert_matches_type(object, devbox, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_keep_alive(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.with_raw_response.keep_alive( - "", - ) - @parametrize def test_method_list_disk_snapshots(self, client: Runloop) -> None: devbox = client.devboxes.list_disk_snapshots() @@ -739,44 +701,6 @@ def test_path_params_remove_tunnel(self, client: Runloop) -> None: port=0, ) - @parametrize - def test_method_resume(self, client: Runloop) -> None: - devbox = client.devboxes.resume( - "id", - ) - assert_matches_type(DevboxView, devbox, path=["response"]) - - @parametrize - def test_raw_response_resume(self, client: Runloop) -> None: - response = client.devboxes.with_raw_response.resume( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - devbox = response.parse() - assert_matches_type(DevboxView, devbox, path=["response"]) - - @parametrize - def test_streaming_response_resume(self, client: Runloop) -> None: - with client.devboxes.with_streaming_response.resume( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - devbox = response.parse() - assert_matches_type(DevboxView, devbox, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_resume(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.with_raw_response.resume( - "", - ) - @parametrize def test_method_shutdown(self, client: Runloop) -> None: devbox = client.devboxes.shutdown( @@ -911,44 +835,6 @@ def test_path_params_snapshot_disk_async(self, client: Runloop) -> None: id="", ) - @parametrize - def test_method_suspend(self, client: Runloop) -> None: - devbox = client.devboxes.suspend( - "id", - ) - assert_matches_type(DevboxView, devbox, path=["response"]) - - @parametrize - def test_raw_response_suspend(self, client: Runloop) -> None: - response = client.devboxes.with_raw_response.suspend( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - devbox = response.parse() - assert_matches_type(DevboxView, devbox, path=["response"]) - - @parametrize - def test_streaming_response_suspend(self, client: Runloop) -> None: - with client.devboxes.with_streaming_response.suspend( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - devbox = response.parse() - assert_matches_type(DevboxView, devbox, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_suspend(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.with_raw_response.suspend( - "", - ) - @parametrize def test_method_upload_file(self, client: Runloop) -> None: devbox = client.devboxes.upload_file( @@ -1656,44 +1542,6 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non command="command", ) - @parametrize - async def test_method_keep_alive(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.keep_alive( - "id", - ) - assert_matches_type(object, devbox, path=["response"]) - - @parametrize - async def test_raw_response_keep_alive(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.with_raw_response.keep_alive( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - devbox = await response.parse() - assert_matches_type(object, devbox, path=["response"]) - - @parametrize - async def test_streaming_response_keep_alive(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.with_streaming_response.keep_alive( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - devbox = await response.parse() - assert_matches_type(object, devbox, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_keep_alive(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.with_raw_response.keep_alive( - "", - ) - @parametrize async def test_method_list_disk_snapshots(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.list_disk_snapshots() @@ -1815,44 +1663,6 @@ async def test_path_params_remove_tunnel(self, async_client: AsyncRunloop) -> No port=0, ) - @parametrize - async def test_method_resume(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.resume( - "id", - ) - assert_matches_type(DevboxView, devbox, path=["response"]) - - @parametrize - async def test_raw_response_resume(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.with_raw_response.resume( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - devbox = await response.parse() - assert_matches_type(DevboxView, devbox, path=["response"]) - - @parametrize - async def test_streaming_response_resume(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.with_streaming_response.resume( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - devbox = await response.parse() - assert_matches_type(DevboxView, devbox, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_resume(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.with_raw_response.resume( - "", - ) - @parametrize async def test_method_shutdown(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.shutdown( @@ -1987,44 +1797,6 @@ async def test_path_params_snapshot_disk_async(self, async_client: AsyncRunloop) id="", ) - @parametrize - async def test_method_suspend(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.suspend( - "id", - ) - assert_matches_type(DevboxView, devbox, path=["response"]) - - @parametrize - async def test_raw_response_suspend(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.with_raw_response.suspend( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - devbox = await response.parse() - assert_matches_type(DevboxView, devbox, path=["response"]) - - @parametrize - async def test_streaming_response_suspend(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.with_streaming_response.suspend( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - devbox = await response.parse() - assert_matches_type(DevboxView, devbox, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_suspend(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.with_raw_response.suspend( - "", - ) - @parametrize async def test_method_upload_file(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.upload_file( From a5d8e425eb229d611e39b5b521c06080dc0e0585 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 24 Nov 2025 23:40:54 +0000 Subject: [PATCH 908/993] fix(devbox): launch parameter typo --- .stats.yml | 4 ++-- src/runloop_api_client/types/shared/launch_parameters.py | 2 +- .../types/shared_params/launch_parameters.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1235f571e..d57d5f1ec 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-907baea7d51fd2660895c74603cf1ff765eb9f62eb10ce6e0c1d17ac1c16abf2.yml -openapi_spec_hash: f1280edb22cdd91238efc2b18e3d324c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ae41f8669a7ba1eec677634573b55bace4dedcf7027e0c1fee503d7c44472e3e.yml +openapi_spec_hash: 9a3c12559ec74a00adffe7b254757903 config_hash: 2363f563f42501d2b1587a4f64bdccaf diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index 04901ebfc..b45cced7c 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -11,7 +11,7 @@ class UserParameters(BaseModel): uid: int - """User ID (UID) for the Linux user. Must be a positive integer.""" + """User ID (UID) for the Linux user. Must be a non-negative integer.""" username: str """Username for the Linux user.""" diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index 303835be3..5016d2acb 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -13,7 +13,7 @@ class UserParameters(TypedDict, total=False): uid: Required[int] - """User ID (UID) for the Linux user. Must be a positive integer.""" + """User ID (UID) for the Linux user. Must be a non-negative integer.""" username: Required[str] """Username for the Linux user.""" From dc2e551a59e660c41aa3d2182a4d5343de916b72 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Nov 2025 02:37:37 +0000 Subject: [PATCH 909/993] fix(scorer): fixed RL_TEST_CONTEXT to RL_SCORER_CONTEXT --- .stats.yml | 4 ++-- .../types/scenarios/scorer_create_response.py | 2 +- .../types/scenarios/scorer_list_response.py | 2 +- .../types/scenarios/scorer_retrieve_response.py | 2 +- .../types/scenarios/scorer_update_response.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index d57d5f1ec..f02816b21 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ae41f8669a7ba1eec677634573b55bace4dedcf7027e0c1fee503d7c44472e3e.yml -openapi_spec_hash: 9a3c12559ec74a00adffe7b254757903 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c15740e10009ccfaf6cb6ae4463496618c05d033bdd779bf501f5afb0c05ffc9.yml +openapi_spec_hash: a08d1a45d83ed2956ab643d1c6c07a40 config_hash: 2363f563f42501d2b1587a4f64bdccaf diff --git a/src/runloop_api_client/types/scenarios/scorer_create_response.py b/src/runloop_api_client/types/scenarios/scorer_create_response.py index 345779a1d..376c50f70 100644 --- a/src/runloop_api_client/types/scenarios/scorer_create_response.py +++ b/src/runloop_api_client/types/scenarios/scorer_create_response.py @@ -10,7 +10,7 @@ class ScorerCreateResponse(BaseModel): """ID for the scenario scorer.""" bash_script: str - """Bash script that takes in $RL_TEST_CONTEXT as env variable and runs scoring.""" + """Bash script that takes in $RL_SCORER_CONTEXT as env variable and runs scoring.""" type: str """Name of the type of scenario scorer.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_list_response.py b/src/runloop_api_client/types/scenarios/scorer_list_response.py index 8f8b12e15..bdbc9b9de 100644 --- a/src/runloop_api_client/types/scenarios/scorer_list_response.py +++ b/src/runloop_api_client/types/scenarios/scorer_list_response.py @@ -10,7 +10,7 @@ class ScorerListResponse(BaseModel): """ID for the scenario scorer.""" bash_script: str - """Bash script that takes in $RL_TEST_CONTEXT as env variable and runs scoring.""" + """Bash script that takes in $RL_SCORER_CONTEXT as env variable and runs scoring.""" type: str """Name of the type of scenario scorer.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_retrieve_response.py b/src/runloop_api_client/types/scenarios/scorer_retrieve_response.py index f2dd7f0b1..ab0f85231 100644 --- a/src/runloop_api_client/types/scenarios/scorer_retrieve_response.py +++ b/src/runloop_api_client/types/scenarios/scorer_retrieve_response.py @@ -10,7 +10,7 @@ class ScorerRetrieveResponse(BaseModel): """ID for the scenario scorer.""" bash_script: str - """Bash script that takes in $RL_TEST_CONTEXT as env variable and runs scoring.""" + """Bash script that takes in $RL_SCORER_CONTEXT as env variable and runs scoring.""" type: str """Name of the type of scenario scorer.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_update_response.py b/src/runloop_api_client/types/scenarios/scorer_update_response.py index 540107613..60a1b5e4b 100644 --- a/src/runloop_api_client/types/scenarios/scorer_update_response.py +++ b/src/runloop_api_client/types/scenarios/scorer_update_response.py @@ -10,7 +10,7 @@ class ScorerUpdateResponse(BaseModel): """ID for the scenario scorer.""" bash_script: str - """Bash script that takes in $RL_TEST_CONTEXT as env variable and runs scoring.""" + """Bash script that takes in $RL_SCORER_CONTEXT as env variable and runs scoring.""" type: str """Name of the type of scenario scorer.""" From 3f2790fac8521f846c9a73b4bedb97f9ce95986e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Nov 2025 04:08:08 +0000 Subject: [PATCH 910/993] fix(api): don't ignore devbox keep_alive, suspend and resume in api --- .stats.yml | 6 +- api.md | 3 + .../resources/devboxes/devboxes.py | 288 ++++++++++++++++++ tests/api_resources/test_devboxes.py | 228 ++++++++++++++ 4 files changed, 522 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index f02816b21..21ba6b325 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 94 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c15740e10009ccfaf6cb6ae4463496618c05d033bdd779bf501f5afb0c05ffc9.yml -openapi_spec_hash: a08d1a45d83ed2956ab643d1c6c07a40 +configured_endpoints: 97 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d2463b4c27719ea7275c8f587fa2c90e333471fdede11e5f944faa92dfb417d1.yml +openapi_spec_hash: 132c1d9f04583e997df5d7698e155fff config_hash: 2363f563f42501d2b1587a4f64bdccaf diff --git a/api.md b/api.md index 5729308ce..49c26771e 100644 --- a/api.md +++ b/api.md @@ -124,12 +124,15 @@ Methods: - client.devboxes.execute(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView +- client.devboxes.keep_alive(id) -> object - client.devboxes.list_disk_snapshots(\*\*params) -> SyncDiskSnapshotsCursorIDPage[DevboxSnapshotView] - client.devboxes.read_file_contents(id, \*\*params) -> str - client.devboxes.remove_tunnel(id, \*\*params) -> object +- client.devboxes.resume(id) -> DevboxView - client.devboxes.shutdown(id) -> DevboxView - client.devboxes.snapshot_disk(id, \*\*params) -> DevboxSnapshotView - client.devboxes.snapshot_disk_async(id, \*\*params) -> DevboxSnapshotView +- client.devboxes.suspend(id) -> DevboxView - client.devboxes.upload_file(id, \*\*params) -> object - client.devboxes.wait_for_command(execution_id, \*, devbox_id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.write_file_contents(id, \*\*params) -> DevboxExecutionDetailView diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2821fc709..45b79a3ef 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -777,6 +777,47 @@ def execute_sync( cast_to=DevboxExecutionDetailView, ) + def keep_alive( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> object: + """ + Send a 'Keep Alive' signal to a running Devbox that is configured to shutdown on + idle so the idle time resets. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/keep_alive", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=object, + ) + def list_disk_snapshots( self, *, @@ -939,6 +980,49 @@ def remove_tunnel( cast_to=object, ) + def resume( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> DevboxView: + """Resume a suspended Devbox with the disk state captured as suspend time. + + Note + that any previously running processes or daemons will need to be restarted using + the Devbox shell tools. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/resume", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=DevboxView, + ) + def shutdown( self, id: str, @@ -1101,6 +1185,48 @@ def snapshot_disk_async( cast_to=DevboxSnapshotView, ) + def suspend( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> DevboxView: + """ + Suspend a running Devbox and create a disk snapshot to enable resuming the + Devbox later with the same disk. Note this will not snapshot memory state such + as running processes. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/suspend", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=DevboxView, + ) + def upload_file( self, id: str, @@ -1959,6 +2085,47 @@ async def execute_sync( cast_to=DevboxExecutionDetailView, ) + async def keep_alive( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> object: + """ + Send a 'Keep Alive' signal to a running Devbox that is configured to shutdown on + idle so the idle time resets. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/keep_alive", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=object, + ) + def list_disk_snapshots( self, *, @@ -2121,6 +2288,49 @@ async def remove_tunnel( cast_to=object, ) + async def resume( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> DevboxView: + """Resume a suspended Devbox with the disk state captured as suspend time. + + Note + that any previously running processes or daemons will need to be restarted using + the Devbox shell tools. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/resume", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=DevboxView, + ) + async def shutdown( self, id: str, @@ -2283,6 +2493,48 @@ async def snapshot_disk_async( cast_to=DevboxSnapshotView, ) + async def suspend( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> DevboxView: + """ + Suspend a running Devbox and create a disk snapshot to enable resuming the + Devbox later with the same disk. Note this will not snapshot memory state such + as running processes. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/suspend", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=DevboxView, + ) + async def upload_file( self, id: str, @@ -2511,6 +2763,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.execute_sync, # pyright: ignore[reportDeprecated], ) ) + self.keep_alive = to_raw_response_wrapper( + devboxes.keep_alive, + ) self.list_disk_snapshots = to_raw_response_wrapper( devboxes.list_disk_snapshots, ) @@ -2520,6 +2775,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.remove_tunnel = to_raw_response_wrapper( devboxes.remove_tunnel, ) + self.resume = to_raw_response_wrapper( + devboxes.resume, + ) self.shutdown = to_raw_response_wrapper( devboxes.shutdown, ) @@ -2529,6 +2787,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.snapshot_disk_async = to_raw_response_wrapper( devboxes.snapshot_disk_async, ) + self.suspend = to_raw_response_wrapper( + devboxes.suspend, + ) self.upload_file = to_raw_response_wrapper( devboxes.upload_file, ) @@ -2600,6 +2861,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.execute_sync, # pyright: ignore[reportDeprecated], ) ) + self.keep_alive = async_to_raw_response_wrapper( + devboxes.keep_alive, + ) self.list_disk_snapshots = async_to_raw_response_wrapper( devboxes.list_disk_snapshots, ) @@ -2609,6 +2873,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.remove_tunnel = async_to_raw_response_wrapper( devboxes.remove_tunnel, ) + self.resume = async_to_raw_response_wrapper( + devboxes.resume, + ) self.shutdown = async_to_raw_response_wrapper( devboxes.shutdown, ) @@ -2618,6 +2885,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.snapshot_disk_async = async_to_raw_response_wrapper( devboxes.snapshot_disk_async, ) + self.suspend = async_to_raw_response_wrapper( + devboxes.suspend, + ) self.upload_file = async_to_raw_response_wrapper( devboxes.upload_file, ) @@ -2689,6 +2959,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.execute_sync, # pyright: ignore[reportDeprecated], ) ) + self.keep_alive = to_streamed_response_wrapper( + devboxes.keep_alive, + ) self.list_disk_snapshots = to_streamed_response_wrapper( devboxes.list_disk_snapshots, ) @@ -2698,6 +2971,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.remove_tunnel = to_streamed_response_wrapper( devboxes.remove_tunnel, ) + self.resume = to_streamed_response_wrapper( + devboxes.resume, + ) self.shutdown = to_streamed_response_wrapper( devboxes.shutdown, ) @@ -2707,6 +2983,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.snapshot_disk_async = to_streamed_response_wrapper( devboxes.snapshot_disk_async, ) + self.suspend = to_streamed_response_wrapper( + devboxes.suspend, + ) self.upload_file = to_streamed_response_wrapper( devboxes.upload_file, ) @@ -2778,6 +3057,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.execute_sync, # pyright: ignore[reportDeprecated], ) ) + self.keep_alive = async_to_streamed_response_wrapper( + devboxes.keep_alive, + ) self.list_disk_snapshots = async_to_streamed_response_wrapper( devboxes.list_disk_snapshots, ) @@ -2787,6 +3069,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.remove_tunnel = async_to_streamed_response_wrapper( devboxes.remove_tunnel, ) + self.resume = async_to_streamed_response_wrapper( + devboxes.resume, + ) self.shutdown = async_to_streamed_response_wrapper( devboxes.shutdown, ) @@ -2796,6 +3081,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.snapshot_disk_async = async_to_streamed_response_wrapper( devboxes.snapshot_disk_async, ) + self.suspend = async_to_streamed_response_wrapper( + devboxes.suspend, + ) self.upload_file = async_to_streamed_response_wrapper( devboxes.upload_file, ) diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 6044ce237..7a17bb2e3 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -580,6 +580,44 @@ def test_path_params_execute_sync(self, client: Runloop) -> None: command="command", ) + @parametrize + def test_method_keep_alive(self, client: Runloop) -> None: + devbox = client.devboxes.keep_alive( + "id", + ) + assert_matches_type(object, devbox, path=["response"]) + + @parametrize + def test_raw_response_keep_alive(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.keep_alive( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(object, devbox, path=["response"]) + + @parametrize + def test_streaming_response_keep_alive(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.keep_alive( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(object, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_keep_alive(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.keep_alive( + "", + ) + @parametrize def test_method_list_disk_snapshots(self, client: Runloop) -> None: devbox = client.devboxes.list_disk_snapshots() @@ -701,6 +739,44 @@ def test_path_params_remove_tunnel(self, client: Runloop) -> None: port=0, ) + @parametrize + def test_method_resume(self, client: Runloop) -> None: + devbox = client.devboxes.resume( + "id", + ) + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + def test_raw_response_resume(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.resume( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + def test_streaming_response_resume(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.resume( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_resume(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.resume( + "", + ) + @parametrize def test_method_shutdown(self, client: Runloop) -> None: devbox = client.devboxes.shutdown( @@ -835,6 +911,44 @@ def test_path_params_snapshot_disk_async(self, client: Runloop) -> None: id="", ) + @parametrize + def test_method_suspend(self, client: Runloop) -> None: + devbox = client.devboxes.suspend( + "id", + ) + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + def test_raw_response_suspend(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.suspend( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + def test_streaming_response_suspend(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.suspend( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_suspend(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.suspend( + "", + ) + @parametrize def test_method_upload_file(self, client: Runloop) -> None: devbox = client.devboxes.upload_file( @@ -1542,6 +1656,44 @@ async def test_path_params_execute_sync(self, async_client: AsyncRunloop) -> Non command="command", ) + @parametrize + async def test_method_keep_alive(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.keep_alive( + "id", + ) + assert_matches_type(object, devbox, path=["response"]) + + @parametrize + async def test_raw_response_keep_alive(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.keep_alive( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(object, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_keep_alive(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.keep_alive( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(object, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_keep_alive(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.keep_alive( + "", + ) + @parametrize async def test_method_list_disk_snapshots(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.list_disk_snapshots() @@ -1663,6 +1815,44 @@ async def test_path_params_remove_tunnel(self, async_client: AsyncRunloop) -> No port=0, ) + @parametrize + async def test_method_resume(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.resume( + "id", + ) + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + async def test_raw_response_resume(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.resume( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_resume(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.resume( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_resume(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.resume( + "", + ) + @parametrize async def test_method_shutdown(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.shutdown( @@ -1797,6 +1987,44 @@ async def test_path_params_snapshot_disk_async(self, async_client: AsyncRunloop) id="", ) + @parametrize + async def test_method_suspend(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.suspend( + "id", + ) + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + async def test_raw_response_suspend(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.suspend( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_suspend(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.suspend( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(DevboxView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_suspend(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.suspend( + "", + ) + @parametrize async def test_method_upload_file(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.upload_file( From 8db265b885c078c1abfbc40d069d432db3bdf734 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Nov 2025 22:36:17 +0000 Subject: [PATCH 911/993] feat(blueprints): Add build context to the OpenAPI spec (#6494) --- .stats.yml | 4 ++-- src/runloop_api_client/resources/blueprints.py | 16 ++++++++++++++++ .../types/blueprint_build_parameters.py | 13 ++++++++++++- .../types/blueprint_create_params.py | 14 ++++++++++++-- .../types/blueprint_preview_params.py | 14 ++++++++++++-- src/runloop_api_client/types/shared/mount.py | 11 +++++------ .../types/shared/run_profile.py | 6 +++++- .../types/shared_params/mount.py | 11 +++++------ .../types/shared_params/run_profile.py | 6 +++++- tests/api_resources/test_benchmarks.py | 14 ++++++++++++++ tests/api_resources/test_blueprints.py | 16 ++++++++++++++++ tests/api_resources/test_scenarios.py | 14 ++++++++++++++ 12 files changed, 118 insertions(+), 21 deletions(-) diff --git a/.stats.yml b/.stats.yml index 21ba6b325..a7dd140f8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 97 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d2463b4c27719ea7275c8f587fa2c90e333471fdede11e5f944faa92dfb417d1.yml -openapi_spec_hash: 132c1d9f04583e997df5d7698e155fff +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b1e4697ee11a301905abe34736d6a2e74a2200c2f9bade48b6f50ee2d65a814f.yml +openapi_spec_hash: 3ebe459b324ae2757ba3bee9d1484e90 config_hash: 2363f563f42501d2b1587a4f64bdccaf diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index fa1390130..96f9963c8 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -62,6 +62,7 @@ def create( base_blueprint_id: Optional[str] | Omit = omit, base_blueprint_name: Optional[str] | Omit = omit, build_args: Optional[Dict[str, str]] | Omit = omit, + build_context: Optional[blueprint_create_params.BuildContext] | Omit = omit, code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, @@ -98,6 +99,8 @@ def create( build_args: (Optional) Arbitrary Docker build args to pass during build. + build_context: A build context backed by an Object. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -137,6 +140,7 @@ def create( "base_blueprint_id": base_blueprint_id, "base_blueprint_name": base_blueprint_name, "build_args": build_args, + "build_context": build_context, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, @@ -451,6 +455,7 @@ def preview( base_blueprint_id: Optional[str] | Omit = omit, base_blueprint_name: Optional[str] | Omit = omit, build_args: Optional[Dict[str, str]] | Omit = omit, + build_context: Optional[blueprint_preview_params.BuildContext] | Omit = omit, code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, @@ -485,6 +490,8 @@ def preview( build_args: (Optional) Arbitrary Docker build args to pass during build. + build_context: A build context backed by an Object. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -524,6 +531,7 @@ def preview( "base_blueprint_id": base_blueprint_id, "base_blueprint_name": base_blueprint_name, "build_args": build_args, + "build_context": build_context, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, @@ -573,6 +581,7 @@ async def create( base_blueprint_id: Optional[str] | Omit = omit, base_blueprint_name: Optional[str] | Omit = omit, build_args: Optional[Dict[str, str]] | Omit = omit, + build_context: Optional[blueprint_create_params.BuildContext] | Omit = omit, code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, @@ -609,6 +618,8 @@ async def create( build_args: (Optional) Arbitrary Docker build args to pass during build. + build_context: A build context backed by an Object. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -648,6 +659,7 @@ async def create( "base_blueprint_id": base_blueprint_id, "base_blueprint_name": base_blueprint_name, "build_args": build_args, + "build_context": build_context, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, @@ -962,6 +974,7 @@ async def preview( base_blueprint_id: Optional[str] | Omit = omit, base_blueprint_name: Optional[str] | Omit = omit, build_args: Optional[Dict[str, str]] | Omit = omit, + build_context: Optional[blueprint_preview_params.BuildContext] | Omit = omit, code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit, dockerfile: Optional[str] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, @@ -996,6 +1009,8 @@ async def preview( build_args: (Optional) Arbitrary Docker build args to pass during build. + build_context: A build context backed by an Object. + code_mounts: A list of code mounts to be included in the Blueprint. dockerfile: Dockerfile contents to be used to build the Blueprint. @@ -1035,6 +1050,7 @@ async def preview( "base_blueprint_id": base_blueprint_id, "base_blueprint_name": base_blueprint_name, "build_args": build_args, + "build_context": build_context, "code_mounts": code_mounts, "dockerfile": dockerfile, "file_mounts": file_mounts, diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index 63a92f146..129a8047a 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -1,12 +1,20 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Dict, List, Optional +from typing_extensions import Literal from .._models import BaseModel from .shared.launch_parameters import LaunchParameters from .shared.code_mount_parameters import CodeMountParameters -__all__ = ["BlueprintBuildParameters", "Service", "ServiceCredentials"] +__all__ = ["BlueprintBuildParameters", "BuildContext", "Service", "ServiceCredentials"] + + +class BuildContext(BaseModel): + object_id: str + """The ID of an object, whose contents are to be used as a build context.""" + + type: Literal["object"] class ServiceCredentials(BaseModel): @@ -61,6 +69,9 @@ class BlueprintBuildParameters(BaseModel): build_args: Optional[Dict[str, str]] = None """(Optional) Arbitrary Docker build args to pass during build.""" + build_context: Optional[BuildContext] = None + """A build context backed by an Object.""" + code_mounts: Optional[List[CodeMountParameters]] = None """A list of code mounts to be included in the Blueprint.""" diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index 9d0a15848..d82de7f35 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Dict, Iterable, Optional -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict from .._types import SequenceNotStr from .shared_params.launch_parameters import LaunchParameters from .shared_params.code_mount_parameters import CodeMountParameters -__all__ = ["BlueprintCreateParams", "Service", "ServiceCredentials"] +__all__ = ["BlueprintCreateParams", "BuildContext", "Service", "ServiceCredentials"] class BlueprintCreateParams(TypedDict, total=False): @@ -33,6 +33,9 @@ class BlueprintCreateParams(TypedDict, total=False): build_args: Optional[Dict[str, str]] """(Optional) Arbitrary Docker build args to pass during build.""" + build_context: Optional[BuildContext] + """A build context backed by an Object.""" + code_mounts: Optional[Iterable[CodeMountParameters]] """A list of code mounts to be included in the Blueprint.""" @@ -67,6 +70,13 @@ class BlueprintCreateParams(TypedDict, total=False): """A list of commands to run to set up your system.""" +class BuildContext(TypedDict, total=False): + object_id: Required[str] + """The ID of an object, whose contents are to be used as a build context.""" + + type: Required[Literal["object"]] + + class ServiceCredentials(TypedDict, total=False): password: Required[str] """The password of the container service.""" diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index 5c1e257f2..9f6c4d9bc 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Dict, Iterable, Optional -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict from .._types import SequenceNotStr from .shared_params.launch_parameters import LaunchParameters from .shared_params.code_mount_parameters import CodeMountParameters -__all__ = ["BlueprintPreviewParams", "Service", "ServiceCredentials"] +__all__ = ["BlueprintPreviewParams", "BuildContext", "Service", "ServiceCredentials"] class BlueprintPreviewParams(TypedDict, total=False): @@ -33,6 +33,9 @@ class BlueprintPreviewParams(TypedDict, total=False): build_args: Optional[Dict[str, str]] """(Optional) Arbitrary Docker build args to pass during build.""" + build_context: Optional[BuildContext] + """A build context backed by an Object.""" + code_mounts: Optional[Iterable[CodeMountParameters]] """A list of code mounts to be included in the Blueprint.""" @@ -67,6 +70,13 @@ class BlueprintPreviewParams(TypedDict, total=False): """A list of commands to run to set up your system.""" +class BuildContext(TypedDict, total=False): + object_id: Required[str] + """The ID of an object, whose contents are to be used as a build context.""" + + type: Required[Literal["object"]] + + class ServiceCredentials(TypedDict, total=False): password: Required[str] """The password of the container service.""" diff --git a/src/runloop_api_client/types/shared/mount.py b/src/runloop_api_client/types/shared/mount.py index 4ebc3eafb..9f8186386 100644 --- a/src/runloop_api_client/types/shared/mount.py +++ b/src/runloop_api_client/types/shared/mount.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Union +from typing import Union from typing_extensions import Literal, Annotated, TypeAlias from ..._utils import PropertyInfo @@ -13,12 +13,11 @@ class FileMountParameters(BaseModel): - files: Dict[str, str] - """Map of file paths to file contents to be written before setup. + content: str + """Content of the file to mount.""" - Keys are absolute paths where files should be created, values are the file - contents. - """ + target: str + """Target path where the file should be mounted.""" type: Literal["file_mount"] diff --git a/src/runloop_api_client/types/shared/run_profile.py b/src/runloop_api_client/types/shared/run_profile.py index 21a29ef38..21cf31f92 100644 --- a/src/runloop_api_client/types/shared/run_profile.py +++ b/src/runloop_api_client/types/shared/run_profile.py @@ -1,9 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Dict, Optional +from typing import Dict, List, Optional from pydantic import Field as FieldInfo +from .mount import Mount from ..._models import BaseModel from .launch_parameters import LaunchParameters @@ -21,6 +22,9 @@ class RunProfile(BaseModel): launch_parameters: Optional[LaunchParameters] = FieldInfo(alias="launchParameters", default=None) """Additional runtime LaunchParameters to apply after the devbox starts.""" + mounts: Optional[List[Mount]] = None + """A list of mounts to be included in the scenario run.""" + purpose: Optional[str] = None """Purpose of the run.""" diff --git a/src/runloop_api_client/types/shared_params/mount.py b/src/runloop_api_client/types/shared_params/mount.py index 9f9631013..1b680e810 100644 --- a/src/runloop_api_client/types/shared_params/mount.py +++ b/src/runloop_api_client/types/shared_params/mount.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Union +from typing import Union from typing_extensions import Literal, Required, TypeAlias, TypedDict from .code_mount_parameters import CodeMountParameters @@ -13,12 +13,11 @@ class FileMountParameters(TypedDict, total=False): - files: Required[Dict[str, str]] - """Map of file paths to file contents to be written before setup. + content: Required[str] + """Content of the file to mount.""" - Keys are absolute paths where files should be created, values are the file - contents. - """ + target: Required[str] + """Target path where the file should be mounted.""" type: Required[Literal["file_mount"]] diff --git a/src/runloop_api_client/types/shared_params/run_profile.py b/src/runloop_api_client/types/shared_params/run_profile.py index 20816c36d..10f82d5f7 100644 --- a/src/runloop_api_client/types/shared_params/run_profile.py +++ b/src/runloop_api_client/types/shared_params/run_profile.py @@ -2,9 +2,10 @@ from __future__ import annotations -from typing import Dict, Optional +from typing import Dict, Iterable, Optional from typing_extensions import Annotated, TypedDict +from .mount import Mount from ..._utils import PropertyInfo from .launch_parameters import LaunchParameters @@ -22,6 +23,9 @@ class RunProfile(TypedDict, total=False): launch_parameters: Annotated[Optional[LaunchParameters], PropertyInfo(alias="launchParameters")] """Additional runtime LaunchParameters to apply after the devbox starts.""" + mounts: Optional[Iterable[Mount]] + """A list of mounts to be included in the scenario run.""" + purpose: Optional[str] """Purpose of the run.""" diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py index 0a40742ee..891756def 100644 --- a/tests/api_resources/test_benchmarks.py +++ b/tests/api_resources/test_benchmarks.py @@ -307,6 +307,13 @@ def test_method_start_run_with_all_params(self, client: Runloop) -> None: "username": "username", }, }, + "mounts": [ + { + "object_id": "object_id", + "object_path": "object_path", + "type": "object_mount", + } + ], "purpose": "purpose", "secrets": {"foo": "string"}, }, @@ -628,6 +635,13 @@ async def test_method_start_run_with_all_params(self, async_client: AsyncRunloop "username": "username", }, }, + "mounts": [ + { + "object_id": "object_id", + "object_path": "object_path", + "type": "object_mount", + } + ], "purpose": "purpose", "secrets": {"foo": "string"}, }, diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index b8310545a..1c45cbfb6 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -36,6 +36,10 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: base_blueprint_id="base_blueprint_id", base_blueprint_name="base_blueprint_name", build_args={"foo": "string"}, + build_context={ + "object_id": "object_id", + "type": "object", + }, code_mounts=[ { "repo_name": "repo_name", @@ -373,6 +377,10 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: base_blueprint_id="base_blueprint_id", base_blueprint_name="base_blueprint_name", build_args={"foo": "string"}, + build_context={ + "object_id": "object_id", + "type": "object", + }, code_mounts=[ { "repo_name": "repo_name", @@ -466,6 +474,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - base_blueprint_id="base_blueprint_id", base_blueprint_name="base_blueprint_name", build_args={"foo": "string"}, + build_context={ + "object_id": "object_id", + "type": "object", + }, code_mounts=[ { "repo_name": "repo_name", @@ -803,6 +815,10 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) base_blueprint_id="base_blueprint_id", base_blueprint_name="base_blueprint_name", build_args={"foo": "string"}, + build_context={ + "object_id": "object_id", + "type": "object", + }, code_mounts=[ { "repo_name": "repo_name", diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index be50c0a77..b9dadb8b9 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -383,6 +383,13 @@ def test_method_start_run_with_all_params(self, client: Runloop) -> None: "username": "username", }, }, + "mounts": [ + { + "object_id": "object_id", + "object_path": "object_path", + "type": "object_mount", + } + ], "purpose": "purpose", "secrets": {"foo": "string"}, }, @@ -781,6 +788,13 @@ async def test_method_start_run_with_all_params(self, async_client: AsyncRunloop "username": "username", }, }, + "mounts": [ + { + "object_id": "object_id", + "object_path": "object_path", + "type": "object_mount", + } + ], "purpose": "purpose", "secrets": {"foo": "string"}, }, From c0825ce5770734a6bde89f02109351ee9ad5dc1a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Nov 2025 23:45:27 +0000 Subject: [PATCH 912/993] chore(mounts): Update documentation for deprecated fields to direct the user to the replacement API --- .stats.yml | 4 ++-- src/runloop_api_client/resources/devboxes/devboxes.py | 8 ++++---- src/runloop_api_client/types/devbox_create_params.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index a7dd140f8..0ab1f506b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 97 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b1e4697ee11a301905abe34736d6a2e74a2200c2f9bade48b6f50ee2d65a814f.yml -openapi_spec_hash: 3ebe459b324ae2757ba3bee9d1484e90 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-cb2d725f71e87810cd872eacd70e867ca10f94980fdf9c78bb2844c02ee47bf3.yml +openapi_spec_hash: 16ce3e9184fc2afdee66db18a83a96e8 config_hash: 2363f563f42501d2b1587a4f64bdccaf diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 45b79a3ef..03100a64c 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -186,7 +186,7 @@ def create( successfully built Blueprint with the given name. Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified. - code_mounts: A list of code mounts to be included in the Devbox. + code_mounts: A list of code mounts to be included in the Devbox. Use mounts instead. entrypoint: (Optional) When specified, the Devbox will run this script as its main executable. The devbox lifecycle will be bound to entrypoint, shutting down when @@ -194,7 +194,7 @@ def create( environment_variables: (Optional) Environment variables used to configure your Devbox. - file_mounts: (Optional) Map of paths and file contents to write before setup.. + file_mounts: Map of paths and file contents to write before setup. Use mounts instead. launch_parameters: Parameters to configure the resources and launch time behavior of the Devbox. @@ -1494,7 +1494,7 @@ async def create( successfully built Blueprint with the given name. Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified. - code_mounts: A list of code mounts to be included in the Devbox. + code_mounts: A list of code mounts to be included in the Devbox. Use mounts instead. entrypoint: (Optional) When specified, the Devbox will run this script as its main executable. The devbox lifecycle will be bound to entrypoint, shutting down when @@ -1502,7 +1502,7 @@ async def create( environment_variables: (Optional) Environment variables used to configure your Devbox. - file_mounts: (Optional) Map of paths and file contents to write before setup.. + file_mounts: Map of paths and file contents to write before setup. Use mounts instead. launch_parameters: Parameters to configure the resources and launch time behavior of the Devbox. diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index cc0080136..4cecd0e72 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -29,7 +29,7 @@ class DevboxCreateParams(TypedDict, total=False): """ code_mounts: Optional[Iterable[CodeMountParameters]] - """A list of code mounts to be included in the Devbox.""" + """A list of code mounts to be included in the Devbox. Use mounts instead.""" entrypoint: Optional[str] """ @@ -42,7 +42,7 @@ class DevboxCreateParams(TypedDict, total=False): """(Optional) Environment variables used to configure your Devbox.""" file_mounts: Optional[Dict[str, str]] - """(Optional) Map of paths and file contents to write before setup..""" + """Map of paths and file contents to write before setup. Use mounts instead.""" launch_parameters: Optional[LaunchParameters] """Parameters to configure the resources and launch time behavior of the Devbox.""" From 7b312cb8979123b3d15711fdb1e7d0caa3737dd6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Nov 2025 03:48:27 +0000 Subject: [PATCH 913/993] chore: update uv.lock --- pyproject.toml | 4 +- requirements-dev.lock | 74 +- scripts/test | 11 +- uv.lock | 2199 +++++++++++++++++++++++++---------------- 4 files changed, 1394 insertions(+), 894 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6ce70117f..749dd15f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Operating System :: OS Independent", "Operating System :: POSIX", "Operating System :: MacOS", @@ -69,7 +70,8 @@ pydantic-v1 = [ "pydantic>=1.9.0,<2", ] pydantic-v2 = [ - "pydantic>=2,<3", + "pydantic~=2.0 ; python_full_version < '3.14'", + "pydantic~=2.12 ; python_full_version >= '3.14'", ] [build-system] diff --git a/requirements-dev.lock b/requirements-dev.lock index 06562358b..bdd2eecdb 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -3,24 +3,26 @@ -e . annotated-types==0.7.0 # via pydantic -anyio==4.8.0 +anyio==4.11.0 # via # httpx # runloop-api-client -certifi==2024.12.14 +backports-asyncio-runner==1.2.0 ; python_full_version < '3.11' + # via pytest-asyncio +certifi==2025.11.12 # via # httpcore # httpx colorama==0.4.6 ; sys_platform == 'win32' # via pytest -dirty-equals==0.9.0 +dirty-equals==0.11 distro==1.9.0 # via runloop-api-client -exceptiongroup==1.2.2 ; python_full_version < '3.11' +exceptiongroup==1.3.1 ; python_full_version < '3.11' # via # anyio # pytest -execnet==2.1.1 +execnet==2.1.2 # via pytest-xdist h11==0.16.0 # via httpcore @@ -30,65 +32,81 @@ httpx==0.28.1 # via # respx # runloop-api-client -idna==3.10 +idna==3.11 # via # anyio # httpx -importlib-metadata==8.6.1 -iniconfig==2.0.0 +importlib-metadata==8.7.0 +iniconfig==2.1.0 ; python_full_version < '3.10' # via pytest -markdown-it-py==3.0.0 +iniconfig==2.3.0 ; python_full_version >= '3.10' + # via pytest +markdown-it-py==3.0.0 ; python_full_version < '3.10' + # via rich +markdown-it-py==4.0.0 ; python_full_version >= '3.10' # via rich mdurl==0.1.2 # via markdown-it-py -mypy==1.14.1 -mypy-extensions==1.0.0 +mypy==1.18.2 +mypy-extensions==1.1.0 # via mypy nodeenv==1.9.1 # via pyright -packaging==24.2 +packaging==25.0 # via pytest -pluggy==1.5.0 +pathspec==0.12.1 + # via mypy +pluggy==1.6.0 # via pytest -pydantic==2.10.3 +pydantic==2.12.4 # via runloop-api-client -pydantic-core==2.27.1 +pydantic-core==2.41.5 # via pydantic -pygments==2.19.1 +pygments==2.19.2 # via # pytest # rich pyright==1.1.399 -pytest==8.4.1 +pytest==8.4.2 ; python_full_version < '3.10' # via # pytest-asyncio # pytest-xdist -pytest-asyncio==0.24.0 -pytest-xdist==3.7.0 -python-dateutil==2.9.0.post0 +pytest==9.0.1 ; python_full_version >= '3.10' + # via + # pytest-asyncio + # pytest-xdist +pytest-asyncio==1.2.0 ; python_full_version < '3.10' +pytest-asyncio==1.3.0 ; python_full_version >= '3.10' +pytest-xdist==3.8.0 +python-dateutil==2.9.0.post0 ; python_full_version < '3.10' # via time-machine respx==0.22.0 -rich==13.9.4 -ruff==0.9.4 -six==1.17.0 +rich==14.2.0 +ruff==0.14.6 +six==1.17.0 ; python_full_version < '3.10' # via python-dateutil sniffio==1.3.1 # via # anyio # runloop-api-client -time-machine==2.16.0 -tomli==2.2.1 ; python_full_version < '3.11' +time-machine==2.19.0 ; python_full_version < '3.10' +time-machine==3.1.0 ; python_full_version >= '3.10' +tomli==2.3.0 ; python_full_version < '3.11' # via # mypy # pytest -typing-extensions==4.12.2 +typing-extensions==4.15.0 # via # anyio + # exceptiongroup # mypy # pydantic # pydantic-core # pyright - # rich + # pytest-asyncio # runloop-api-client -zipp==3.21.0 + # typing-inspection +typing-inspection==0.4.2 + # via pydantic +zipp==3.23.0 # via importlib-metadata diff --git a/scripts/test b/scripts/test index f87b13bef..a93b8a259 100755 --- a/scripts/test +++ b/scripts/test @@ -58,8 +58,11 @@ function run_tests() { echo "==> Running tests with Pydantic v2" uv run --isolated --all-extras pytest "$@" - echo "==> Running tests with Pydantic v1" - uv run --isolated --all-extras --group=pydantic-v1 pytest "$@" + # Pydantic v1 does not support Python 3.14, skip these tests + if [[ "$UV_PYTHON" != "3.14" ]]; then + echo "==> Running tests with Pydantic v1" + uv run --isolated --all-extras --group=pydantic-v1 pytest "$@" + fi } # If UV_PYTHON is already set in the environment, just run the command once @@ -71,6 +74,6 @@ else echo "==> Running tests for Python 3.9" UV_PYTHON=3.9 run_tests "$@" - echo "==> Running tests for Python 3.13" - UV_PYTHON=3.13 run_tests "$@" + echo "==> Running tests for Python 3.14" + UV_PYTHON=3.14 run_tests "$@" fi diff --git a/uv.lock b/uv.lock index c2bf0f2bc..e89970ac1 100644 --- a/uv.lock +++ b/uv.lock @@ -1,6 +1,15 @@ version = 1 revision = 3 requires-python = ">=3.9" +resolution-markers = [ + "python_full_version >= '3.14' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version >= '3.10' and python_full_version < '3.14' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version < '3.10' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version >= '3.10' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra != 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version < '3.10' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra != 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version >= '3.10' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra != 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version < '3.10' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra != 'group-18-runloop-api-client-pydantic-v2'", +] conflicts = [[ { package = "runloop-api-client", group = "pydantic-v1" }, { package = "runloop-api-client", group = "pydantic-v2" }, @@ -17,7 +26,7 @@ wheels = [ [[package]] name = "aiohttp" -version = "3.12.13" +version = "3.13.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "aiohappyeyeballs" }, @@ -29,93 +38,127 @@ dependencies = [ { name = "propcache" }, { name = "yarl" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/42/6e/ab88e7cb2a4058bed2f7870276454f85a7c56cd6da79349eb314fc7bbcaa/aiohttp-3.12.13.tar.gz", hash = "sha256:47e2da578528264a12e4e3dd8dd72a7289e5f812758fe086473fab037a10fcce", size = 7819160, upload-time = "2025-06-14T15:15:41.354Z" } +sdist = { url = "https://files.pythonhosted.org/packages/1c/ce/3b83ebba6b3207a7135e5fcaba49706f8a4b6008153b4e30540c982fae26/aiohttp-3.13.2.tar.gz", hash = "sha256:40176a52c186aefef6eb3cad2cdd30cd06e3afbe88fe8ab2af9c0b90f228daca", size = 7837994, upload-time = "2025-10-28T20:59:39.937Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/8b/2d/27e4347660723738b01daa3f5769d56170f232bf4695dd4613340da135bb/aiohttp-3.12.13-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:5421af8f22a98f640261ee48aae3a37f0c41371e99412d55eaf2f8a46d5dad29", size = 702090, upload-time = "2025-06-14T15:12:58.938Z" }, - { url = "https://files.pythonhosted.org/packages/10/0b/4a8e0468ee8f2b9aff3c05f2c3a6be1dfc40b03f68a91b31041d798a9510/aiohttp-3.12.13-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0fcda86f6cb318ba36ed8f1396a6a4a3fd8f856f84d426584392083d10da4de0", size = 478440, upload-time = "2025-06-14T15:13:02.981Z" }, - { url = "https://files.pythonhosted.org/packages/b9/c8/2086df2f9a842b13feb92d071edf756be89250f404f10966b7bc28317f17/aiohttp-3.12.13-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:4cd71c9fb92aceb5a23c4c39d8ecc80389c178eba9feab77f19274843eb9412d", size = 466215, upload-time = "2025-06-14T15:13:04.817Z" }, - { url = "https://files.pythonhosted.org/packages/a7/3d/d23e5bd978bc8012a65853959b13bd3b55c6e5afc172d89c26ad6624c52b/aiohttp-3.12.13-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:34ebf1aca12845066c963016655dac897651e1544f22a34c9b461ac3b4b1d3aa", size = 1648271, upload-time = "2025-06-14T15:13:06.532Z" }, - { url = "https://files.pythonhosted.org/packages/31/31/e00122447bb137591c202786062f26dd383574c9f5157144127077d5733e/aiohttp-3.12.13-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:893a4639694c5b7edd4bdd8141be296042b6806e27cc1d794e585c43010cc294", size = 1622329, upload-time = "2025-06-14T15:13:08.394Z" }, - { url = "https://files.pythonhosted.org/packages/04/01/caef70be3ac38986969045f21f5fb802ce517b3f371f0615206bf8aa6423/aiohttp-3.12.13-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:663d8ee3ffb3494502ebcccb49078faddbb84c1d870f9c1dd5a29e85d1f747ce", size = 1694734, upload-time = "2025-06-14T15:13:09.979Z" }, - { url = "https://files.pythonhosted.org/packages/3f/15/328b71fedecf69a9fd2306549b11c8966e420648a3938d75d3ed5bcb47f6/aiohttp-3.12.13-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f0f8f6a85a0006ae2709aa4ce05749ba2cdcb4b43d6c21a16c8517c16593aabe", size = 1737049, upload-time = "2025-06-14T15:13:11.672Z" }, - { url = "https://files.pythonhosted.org/packages/e6/7a/d85866a642158e1147c7da5f93ad66b07e5452a84ec4258e5f06b9071e92/aiohttp-3.12.13-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1582745eb63df267c92d8b61ca655a0ce62105ef62542c00a74590f306be8cb5", size = 1641715, upload-time = "2025-06-14T15:13:13.548Z" }, - { url = "https://files.pythonhosted.org/packages/14/57/3588800d5d2f5f3e1cb6e7a72747d1abc1e67ba5048e8b845183259c2e9b/aiohttp-3.12.13-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d59227776ee2aa64226f7e086638baa645f4b044f2947dbf85c76ab11dcba073", size = 1581836, upload-time = "2025-06-14T15:13:15.086Z" }, - { url = "https://files.pythonhosted.org/packages/2f/55/c913332899a916d85781aa74572f60fd98127449b156ad9c19e23135b0e4/aiohttp-3.12.13-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:06b07c418bde1c8e737d8fa67741072bd3f5b0fb66cf8c0655172188c17e5fa6", size = 1625685, upload-time = "2025-06-14T15:13:17.163Z" }, - { url = "https://files.pythonhosted.org/packages/4c/34/26cded195f3bff128d6a6d58d7a0be2ae7d001ea029e0fe9008dcdc6a009/aiohttp-3.12.13-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:9445c1842680efac0f81d272fd8db7163acfcc2b1436e3f420f4c9a9c5a50795", size = 1636471, upload-time = "2025-06-14T15:13:19.086Z" }, - { url = "https://files.pythonhosted.org/packages/19/21/70629ca006820fccbcec07f3cd5966cbd966e2d853d6da55339af85555b9/aiohttp-3.12.13-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:09c4767af0b0b98c724f5d47f2bf33395c8986995b0a9dab0575ca81a554a8c0", size = 1611923, upload-time = "2025-06-14T15:13:20.997Z" }, - { url = "https://files.pythonhosted.org/packages/31/80/7fa3f3bebf533aa6ae6508b51ac0de9965e88f9654fa679cc1a29d335a79/aiohttp-3.12.13-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:f3854fbde7a465318ad8d3fc5bef8f059e6d0a87e71a0d3360bb56c0bf87b18a", size = 1691511, upload-time = "2025-06-14T15:13:22.54Z" }, - { url = "https://files.pythonhosted.org/packages/0f/7a/359974653a3cdd3e9cee8ca10072a662c3c0eb46a359c6a1f667b0296e2f/aiohttp-3.12.13-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:2332b4c361c05ecd381edb99e2a33733f3db906739a83a483974b3df70a51b40", size = 1714751, upload-time = "2025-06-14T15:13:24.366Z" }, - { url = "https://files.pythonhosted.org/packages/2d/24/0aa03d522171ce19064347afeefadb008be31ace0bbb7d44ceb055700a14/aiohttp-3.12.13-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:1561db63fa1b658cd94325d303933553ea7d89ae09ff21cc3bcd41b8521fbbb6", size = 1643090, upload-time = "2025-06-14T15:13:26.231Z" }, - { url = "https://files.pythonhosted.org/packages/86/2e/7d4b0026a41e4b467e143221c51b279083b7044a4b104054f5c6464082ff/aiohttp-3.12.13-cp310-cp310-win32.whl", hash = "sha256:a0be857f0b35177ba09d7c472825d1b711d11c6d0e8a2052804e3b93166de1ad", size = 427526, upload-time = "2025-06-14T15:13:27.988Z" }, - { url = "https://files.pythonhosted.org/packages/17/de/34d998da1e7f0de86382160d039131e9b0af1962eebfe53dda2b61d250e7/aiohttp-3.12.13-cp310-cp310-win_amd64.whl", hash = "sha256:fcc30ad4fb5cb41a33953292d45f54ef4066746d625992aeac33b8c681173178", size = 450734, upload-time = "2025-06-14T15:13:29.394Z" }, - { url = "https://files.pythonhosted.org/packages/6a/65/5566b49553bf20ffed6041c665a5504fb047cefdef1b701407b8ce1a47c4/aiohttp-3.12.13-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:7c229b1437aa2576b99384e4be668af1db84b31a45305d02f61f5497cfa6f60c", size = 709401, upload-time = "2025-06-14T15:13:30.774Z" }, - { url = "https://files.pythonhosted.org/packages/14/b5/48e4cc61b54850bdfafa8fe0b641ab35ad53d8e5a65ab22b310e0902fa42/aiohttp-3.12.13-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:04076d8c63471e51e3689c93940775dc3d12d855c0c80d18ac5a1c68f0904358", size = 481669, upload-time = "2025-06-14T15:13:32.316Z" }, - { url = "https://files.pythonhosted.org/packages/04/4f/e3f95c8b2a20a0437d51d41d5ccc4a02970d8ad59352efb43ea2841bd08e/aiohttp-3.12.13-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:55683615813ce3601640cfaa1041174dc956d28ba0511c8cbd75273eb0587014", size = 469933, upload-time = "2025-06-14T15:13:34.104Z" }, - { url = "https://files.pythonhosted.org/packages/41/c9/c5269f3b6453b1cfbd2cfbb6a777d718c5f086a3727f576c51a468b03ae2/aiohttp-3.12.13-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:921bc91e602d7506d37643e77819cb0b840d4ebb5f8d6408423af3d3bf79a7b7", size = 1740128, upload-time = "2025-06-14T15:13:35.604Z" }, - { url = "https://files.pythonhosted.org/packages/6f/49/a3f76caa62773d33d0cfaa842bdf5789a78749dbfe697df38ab1badff369/aiohttp-3.12.13-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e72d17fe0974ddeae8ed86db297e23dba39c7ac36d84acdbb53df2e18505a013", size = 1688796, upload-time = "2025-06-14T15:13:37.125Z" }, - { url = "https://files.pythonhosted.org/packages/ad/e4/556fccc4576dc22bf18554b64cc873b1a3e5429a5bdb7bbef7f5d0bc7664/aiohttp-3.12.13-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0653d15587909a52e024a261943cf1c5bdc69acb71f411b0dd5966d065a51a47", size = 1787589, upload-time = "2025-06-14T15:13:38.745Z" }, - { url = "https://files.pythonhosted.org/packages/b9/3d/d81b13ed48e1a46734f848e26d55a7391708421a80336e341d2aef3b6db2/aiohttp-3.12.13-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a77b48997c66722c65e157c06c74332cdf9c7ad00494b85ec43f324e5c5a9b9a", size = 1826635, upload-time = "2025-06-14T15:13:40.733Z" }, - { url = "https://files.pythonhosted.org/packages/75/a5/472e25f347da88459188cdaadd1f108f6292f8a25e62d226e63f860486d1/aiohttp-3.12.13-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d6946bae55fd36cfb8e4092c921075cde029c71c7cb571d72f1079d1e4e013bc", size = 1729095, upload-time = "2025-06-14T15:13:42.312Z" }, - { url = "https://files.pythonhosted.org/packages/b9/fe/322a78b9ac1725bfc59dfc301a5342e73d817592828e4445bd8f4ff83489/aiohttp-3.12.13-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4f95db8c8b219bcf294a53742c7bda49b80ceb9d577c8e7aa075612b7f39ffb7", size = 1666170, upload-time = "2025-06-14T15:13:44.884Z" }, - { url = "https://files.pythonhosted.org/packages/7a/77/ec80912270e231d5e3839dbd6c065472b9920a159ec8a1895cf868c2708e/aiohttp-3.12.13-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:03d5eb3cfb4949ab4c74822fb3326cd9655c2b9fe22e4257e2100d44215b2e2b", size = 1714444, upload-time = "2025-06-14T15:13:46.401Z" }, - { url = "https://files.pythonhosted.org/packages/21/b2/fb5aedbcb2b58d4180e58500e7c23ff8593258c27c089abfbcc7db65bd40/aiohttp-3.12.13-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:6383dd0ffa15515283c26cbf41ac8e6705aab54b4cbb77bdb8935a713a89bee9", size = 1709604, upload-time = "2025-06-14T15:13:48.377Z" }, - { url = "https://files.pythonhosted.org/packages/e3/15/a94c05f7c4dc8904f80b6001ad6e07e035c58a8ebfcc15e6b5d58500c858/aiohttp-3.12.13-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:6548a411bc8219b45ba2577716493aa63b12803d1e5dc70508c539d0db8dbf5a", size = 1689786, upload-time = "2025-06-14T15:13:50.401Z" }, - { url = "https://files.pythonhosted.org/packages/1d/fd/0d2e618388f7a7a4441eed578b626bda9ec6b5361cd2954cfc5ab39aa170/aiohttp-3.12.13-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:81b0fcbfe59a4ca41dc8f635c2a4a71e63f75168cc91026c61be665945739e2d", size = 1783389, upload-time = "2025-06-14T15:13:51.945Z" }, - { url = "https://files.pythonhosted.org/packages/a6/6b/6986d0c75996ef7e64ff7619b9b7449b1d1cbbe05c6755e65d92f1784fe9/aiohttp-3.12.13-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:6a83797a0174e7995e5edce9dcecc517c642eb43bc3cba296d4512edf346eee2", size = 1803853, upload-time = "2025-06-14T15:13:53.533Z" }, - { url = "https://files.pythonhosted.org/packages/21/65/cd37b38f6655d95dd07d496b6d2f3924f579c43fd64b0e32b547b9c24df5/aiohttp-3.12.13-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:a5734d8469a5633a4e9ffdf9983ff7cdb512524645c7a3d4bc8a3de45b935ac3", size = 1716909, upload-time = "2025-06-14T15:13:55.148Z" }, - { url = "https://files.pythonhosted.org/packages/fd/20/2de7012427dc116714c38ca564467f6143aec3d5eca3768848d62aa43e62/aiohttp-3.12.13-cp311-cp311-win32.whl", hash = "sha256:fef8d50dfa482925bb6b4c208b40d8e9fa54cecba923dc65b825a72eed9a5dbd", size = 427036, upload-time = "2025-06-14T15:13:57.076Z" }, - { url = "https://files.pythonhosted.org/packages/f8/b6/98518bcc615ef998a64bef371178b9afc98ee25895b4f476c428fade2220/aiohttp-3.12.13-cp311-cp311-win_amd64.whl", hash = "sha256:9a27da9c3b5ed9d04c36ad2df65b38a96a37e9cfba6f1381b842d05d98e6afe9", size = 451427, upload-time = "2025-06-14T15:13:58.505Z" }, - { url = "https://files.pythonhosted.org/packages/b4/6a/ce40e329788013cd190b1d62bbabb2b6a9673ecb6d836298635b939562ef/aiohttp-3.12.13-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0aa580cf80558557285b49452151b9c69f2fa3ad94c5c9e76e684719a8791b73", size = 700491, upload-time = "2025-06-14T15:14:00.048Z" }, - { url = "https://files.pythonhosted.org/packages/28/d9/7150d5cf9163e05081f1c5c64a0cdf3c32d2f56e2ac95db2a28fe90eca69/aiohttp-3.12.13-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b103a7e414b57e6939cc4dece8e282cfb22043efd0c7298044f6594cf83ab347", size = 475104, upload-time = "2025-06-14T15:14:01.691Z" }, - { url = "https://files.pythonhosted.org/packages/f8/91/d42ba4aed039ce6e449b3e2db694328756c152a79804e64e3da5bc19dffc/aiohttp-3.12.13-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:78f64e748e9e741d2eccff9597d09fb3cd962210e5b5716047cbb646dc8fe06f", size = 467948, upload-time = "2025-06-14T15:14:03.561Z" }, - { url = "https://files.pythonhosted.org/packages/99/3b/06f0a632775946981d7c4e5a865cddb6e8dfdbaed2f56f9ade7bb4a1039b/aiohttp-3.12.13-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:29c955989bf4c696d2ededc6b0ccb85a73623ae6e112439398935362bacfaaf6", size = 1714742, upload-time = "2025-06-14T15:14:05.558Z" }, - { url = "https://files.pythonhosted.org/packages/92/a6/2552eebad9ec5e3581a89256276009e6a974dc0793632796af144df8b740/aiohttp-3.12.13-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:d640191016763fab76072c87d8854a19e8e65d7a6fcfcbf017926bdbbb30a7e5", size = 1697393, upload-time = "2025-06-14T15:14:07.194Z" }, - { url = "https://files.pythonhosted.org/packages/d8/9f/bd08fdde114b3fec7a021381b537b21920cdd2aa29ad48c5dffd8ee314f1/aiohttp-3.12.13-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4dc507481266b410dede95dd9f26c8d6f5a14315372cc48a6e43eac652237d9b", size = 1752486, upload-time = "2025-06-14T15:14:08.808Z" }, - { url = "https://files.pythonhosted.org/packages/f7/e1/affdea8723aec5bd0959171b5490dccd9a91fcc505c8c26c9f1dca73474d/aiohttp-3.12.13-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8a94daa873465d518db073bd95d75f14302e0208a08e8c942b2f3f1c07288a75", size = 1798643, upload-time = "2025-06-14T15:14:10.767Z" }, - { url = "https://files.pythonhosted.org/packages/f3/9d/666d856cc3af3a62ae86393baa3074cc1d591a47d89dc3bf16f6eb2c8d32/aiohttp-3.12.13-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:177f52420cde4ce0bb9425a375d95577fe082cb5721ecb61da3049b55189e4e6", size = 1718082, upload-time = "2025-06-14T15:14:12.38Z" }, - { url = "https://files.pythonhosted.org/packages/f3/ce/3c185293843d17be063dada45efd2712bb6bf6370b37104b4eda908ffdbd/aiohttp-3.12.13-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0f7df1f620ec40f1a7fbcb99ea17d7326ea6996715e78f71a1c9a021e31b96b8", size = 1633884, upload-time = "2025-06-14T15:14:14.415Z" }, - { url = "https://files.pythonhosted.org/packages/3a/5b/f3413f4b238113be35dfd6794e65029250d4b93caa0974ca572217745bdb/aiohttp-3.12.13-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3062d4ad53b36e17796dce1c0d6da0ad27a015c321e663657ba1cc7659cfc710", size = 1694943, upload-time = "2025-06-14T15:14:16.48Z" }, - { url = "https://files.pythonhosted.org/packages/82/c8/0e56e8bf12081faca85d14a6929ad5c1263c146149cd66caa7bc12255b6d/aiohttp-3.12.13-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:8605e22d2a86b8e51ffb5253d9045ea73683d92d47c0b1438e11a359bdb94462", size = 1716398, upload-time = "2025-06-14T15:14:18.589Z" }, - { url = "https://files.pythonhosted.org/packages/ea/f3/33192b4761f7f9b2f7f4281365d925d663629cfaea093a64b658b94fc8e1/aiohttp-3.12.13-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:54fbbe6beafc2820de71ece2198458a711e224e116efefa01b7969f3e2b3ddae", size = 1657051, upload-time = "2025-06-14T15:14:20.223Z" }, - { url = "https://files.pythonhosted.org/packages/5e/0b/26ddd91ca8f84c48452431cb4c5dd9523b13bc0c9766bda468e072ac9e29/aiohttp-3.12.13-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:050bd277dfc3768b606fd4eae79dd58ceda67d8b0b3c565656a89ae34525d15e", size = 1736611, upload-time = "2025-06-14T15:14:21.988Z" }, - { url = "https://files.pythonhosted.org/packages/c3/8d/e04569aae853302648e2c138a680a6a2f02e374c5b6711732b29f1e129cc/aiohttp-3.12.13-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:2637a60910b58f50f22379b6797466c3aa6ae28a6ab6404e09175ce4955b4e6a", size = 1764586, upload-time = "2025-06-14T15:14:23.979Z" }, - { url = "https://files.pythonhosted.org/packages/ac/98/c193c1d1198571d988454e4ed75adc21c55af247a9fda08236602921c8c8/aiohttp-3.12.13-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e986067357550d1aaa21cfe9897fa19e680110551518a5a7cf44e6c5638cb8b5", size = 1724197, upload-time = "2025-06-14T15:14:25.692Z" }, - { url = "https://files.pythonhosted.org/packages/e7/9e/07bb8aa11eec762c6b1ff61575eeeb2657df11ab3d3abfa528d95f3e9337/aiohttp-3.12.13-cp312-cp312-win32.whl", hash = "sha256:ac941a80aeea2aaae2875c9500861a3ba356f9ff17b9cb2dbfb5cbf91baaf5bf", size = 421771, upload-time = "2025-06-14T15:14:27.364Z" }, - { url = "https://files.pythonhosted.org/packages/52/66/3ce877e56ec0813069cdc9607cd979575859c597b6fb9b4182c6d5f31886/aiohttp-3.12.13-cp312-cp312-win_amd64.whl", hash = "sha256:671f41e6146a749b6c81cb7fd07f5a8356d46febdaaaf07b0e774ff04830461e", size = 447869, upload-time = "2025-06-14T15:14:29.05Z" }, - { url = "https://files.pythonhosted.org/packages/11/0f/db19abdf2d86aa1deec3c1e0e5ea46a587b97c07a16516b6438428b3a3f8/aiohttp-3.12.13-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:d4a18e61f271127465bdb0e8ff36e8f02ac4a32a80d8927aa52371e93cd87938", size = 694910, upload-time = "2025-06-14T15:14:30.604Z" }, - { url = "https://files.pythonhosted.org/packages/d5/81/0ab551e1b5d7f1339e2d6eb482456ccbe9025605b28eed2b1c0203aaaade/aiohttp-3.12.13-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:532542cb48691179455fab429cdb0d558b5e5290b033b87478f2aa6af5d20ace", size = 472566, upload-time = "2025-06-14T15:14:32.275Z" }, - { url = "https://files.pythonhosted.org/packages/34/3f/6b7d336663337672d29b1f82d1f252ec1a040fe2d548f709d3f90fa2218a/aiohttp-3.12.13-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:d7eea18b52f23c050ae9db5d01f3d264ab08f09e7356d6f68e3f3ac2de9dfabb", size = 464856, upload-time = "2025-06-14T15:14:34.132Z" }, - { url = "https://files.pythonhosted.org/packages/26/7f/32ca0f170496aa2ab9b812630fac0c2372c531b797e1deb3deb4cea904bd/aiohttp-3.12.13-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ad7c8e5c25f2a26842a7c239de3f7b6bfb92304593ef997c04ac49fb703ff4d7", size = 1703683, upload-time = "2025-06-14T15:14:36.034Z" }, - { url = "https://files.pythonhosted.org/packages/ec/53/d5513624b33a811c0abea8461e30a732294112318276ce3dbf047dbd9d8b/aiohttp-3.12.13-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:6af355b483e3fe9d7336d84539fef460120c2f6e50e06c658fe2907c69262d6b", size = 1684946, upload-time = "2025-06-14T15:14:38Z" }, - { url = "https://files.pythonhosted.org/packages/37/72/4c237dd127827b0247dc138d3ebd49c2ded6114c6991bbe969058575f25f/aiohttp-3.12.13-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a95cf9f097498f35c88e3609f55bb47b28a5ef67f6888f4390b3d73e2bac6177", size = 1737017, upload-time = "2025-06-14T15:14:39.951Z" }, - { url = "https://files.pythonhosted.org/packages/0d/67/8a7eb3afa01e9d0acc26e1ef847c1a9111f8b42b82955fcd9faeb84edeb4/aiohttp-3.12.13-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b8ed8c38a1c584fe99a475a8f60eefc0b682ea413a84c6ce769bb19a7ff1c5ef", size = 1786390, upload-time = "2025-06-14T15:14:42.151Z" }, - { url = "https://files.pythonhosted.org/packages/48/19/0377df97dd0176ad23cd8cad4fd4232cfeadcec6c1b7f036315305c98e3f/aiohttp-3.12.13-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7a0b9170d5d800126b5bc89d3053a2363406d6e327afb6afaeda2d19ee8bb103", size = 1708719, upload-time = "2025-06-14T15:14:44.039Z" }, - { url = "https://files.pythonhosted.org/packages/61/97/ade1982a5c642b45f3622255173e40c3eed289c169f89d00eeac29a89906/aiohttp-3.12.13-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:372feeace612ef8eb41f05ae014a92121a512bd5067db8f25101dd88a8db11da", size = 1622424, upload-time = "2025-06-14T15:14:45.945Z" }, - { url = "https://files.pythonhosted.org/packages/99/ab/00ad3eea004e1d07ccc406e44cfe2b8da5acb72f8c66aeeb11a096798868/aiohttp-3.12.13-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a946d3702f7965d81f7af7ea8fb03bb33fe53d311df48a46eeca17e9e0beed2d", size = 1675447, upload-time = "2025-06-14T15:14:47.911Z" }, - { url = "https://files.pythonhosted.org/packages/3f/fe/74e5ce8b2ccaba445fe0087abc201bfd7259431d92ae608f684fcac5d143/aiohttp-3.12.13-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:a0c4725fae86555bbb1d4082129e21de7264f4ab14baf735278c974785cd2041", size = 1707110, upload-time = "2025-06-14T15:14:50.334Z" }, - { url = "https://files.pythonhosted.org/packages/ef/c4/39af17807f694f7a267bd8ab1fbacf16ad66740862192a6c8abac2bff813/aiohttp-3.12.13-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:9b28ea2f708234f0a5c44eb6c7d9eb63a148ce3252ba0140d050b091b6e842d1", size = 1649706, upload-time = "2025-06-14T15:14:52.378Z" }, - { url = "https://files.pythonhosted.org/packages/38/e8/f5a0a5f44f19f171d8477059aa5f28a158d7d57fe1a46c553e231f698435/aiohttp-3.12.13-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:d4f5becd2a5791829f79608c6f3dc745388162376f310eb9c142c985f9441cc1", size = 1725839, upload-time = "2025-06-14T15:14:54.617Z" }, - { url = "https://files.pythonhosted.org/packages/fd/ac/81acc594c7f529ef4419d3866913f628cd4fa9cab17f7bf410a5c3c04c53/aiohttp-3.12.13-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:60f2ce6b944e97649051d5f5cc0f439360690b73909230e107fd45a359d3e911", size = 1759311, upload-time = "2025-06-14T15:14:56.597Z" }, - { url = "https://files.pythonhosted.org/packages/38/0d/aabe636bd25c6ab7b18825e5a97d40024da75152bec39aa6ac8b7a677630/aiohttp-3.12.13-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:69fc1909857401b67bf599c793f2183fbc4804717388b0b888f27f9929aa41f3", size = 1708202, upload-time = "2025-06-14T15:14:58.598Z" }, - { url = "https://files.pythonhosted.org/packages/1f/ab/561ef2d8a223261683fb95a6283ad0d36cb66c87503f3a7dde7afe208bb2/aiohttp-3.12.13-cp313-cp313-win32.whl", hash = "sha256:7d7e68787a2046b0e44ba5587aa723ce05d711e3a3665b6b7545328ac8e3c0dd", size = 420794, upload-time = "2025-06-14T15:15:00.939Z" }, - { url = "https://files.pythonhosted.org/packages/9d/47/b11d0089875a23bff0abd3edb5516bcd454db3fefab8604f5e4b07bd6210/aiohttp-3.12.13-cp313-cp313-win_amd64.whl", hash = "sha256:5a178390ca90419bfd41419a809688c368e63c86bd725e1186dd97f6b89c2706", size = 446735, upload-time = "2025-06-14T15:15:02.858Z" }, - { url = "https://files.pythonhosted.org/packages/05/7e/0f6b2b4797ac364b6ecc9176bb2dd24d4a9aeaa77ecb093c7f87e44dfbd6/aiohttp-3.12.13-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:36f6c973e003dc9b0bb4e8492a643641ea8ef0e97ff7aaa5c0f53d68839357b4", size = 704988, upload-time = "2025-06-14T15:15:04.705Z" }, - { url = "https://files.pythonhosted.org/packages/52/38/d51ea984c777b203959030895c1c8b1f9aac754f8e919e4942edce05958e/aiohttp-3.12.13-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6cbfc73179bd67c229eb171e2e3745d2afd5c711ccd1e40a68b90427f282eab1", size = 479967, upload-time = "2025-06-14T15:15:06.575Z" }, - { url = "https://files.pythonhosted.org/packages/9d/0a/62f1c2914840eb2184939e773b65e1e5d6b651b78134798263467f0d2467/aiohttp-3.12.13-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1e8b27b2d414f7e3205aa23bb4a692e935ef877e3a71f40d1884f6e04fd7fa74", size = 467373, upload-time = "2025-06-14T15:15:08.788Z" }, - { url = "https://files.pythonhosted.org/packages/7b/4e/327a4b56bb940afb03ee45d5fd1ef7dae5ed6617889d61ed8abf0548310b/aiohttp-3.12.13-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eabded0c2b2ef56243289112c48556c395d70150ce4220d9008e6b4b3dd15690", size = 1642326, upload-time = "2025-06-14T15:15:10.74Z" }, - { url = "https://files.pythonhosted.org/packages/55/5d/f0277aad4d85a56cd6102335d5111c7c6d1f98cb760aa485e4fe11a24f52/aiohttp-3.12.13-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:003038e83f1a3ff97409999995ec02fe3008a1d675478949643281141f54751d", size = 1616820, upload-time = "2025-06-14T15:15:12.77Z" }, - { url = "https://files.pythonhosted.org/packages/f2/ff/909193459a6d32ee806d9f7ae2342c940ee97d2c1416140c5aec3bd6bfc0/aiohttp-3.12.13-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1b6f46613031dbc92bdcaad9c4c22c7209236ec501f9c0c5f5f0b6a689bf50f3", size = 1690448, upload-time = "2025-06-14T15:15:14.754Z" }, - { url = "https://files.pythonhosted.org/packages/45/e7/14d09183849e9bd69d8d5bf7df0ab7603996b83b00540e0890eeefa20e1e/aiohttp-3.12.13-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c332c6bb04650d59fb94ed96491f43812549a3ba6e7a16a218e612f99f04145e", size = 1729763, upload-time = "2025-06-14T15:15:16.783Z" }, - { url = "https://files.pythonhosted.org/packages/55/01/07b980d6226574cc2d157fa4978a3d77270a4e860193a579630a81b30e30/aiohttp-3.12.13-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3fea41a2c931fb582cb15dc86a3037329e7b941df52b487a9f8b5aa960153cbd", size = 1636002, upload-time = "2025-06-14T15:15:18.871Z" }, - { url = "https://files.pythonhosted.org/packages/73/cf/20a1f75ca3d8e48065412e80b79bb1c349e26a4fa51d660be186a9c0c1e3/aiohttp-3.12.13-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:846104f45d18fb390efd9b422b27d8f3cf8853f1218c537f36e71a385758c896", size = 1571003, upload-time = "2025-06-14T15:15:20.95Z" }, - { url = "https://files.pythonhosted.org/packages/e1/99/09520d83e5964d6267074be9c66698e2003dfe8c66465813f57b029dec8c/aiohttp-3.12.13-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:5d6c85ac7dd350f8da2520bac8205ce99df4435b399fa7f4dc4a70407073e390", size = 1618964, upload-time = "2025-06-14T15:15:23.155Z" }, - { url = "https://files.pythonhosted.org/packages/3a/01/c68f2c7632441fbbfc4a835e003e61eb1d63531857b0a2b73c9698846fa8/aiohttp-3.12.13-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:5a1ecce0ed281bec7da8550da052a6b89552db14d0a0a45554156f085a912f48", size = 1629103, upload-time = "2025-06-14T15:15:25.209Z" }, - { url = "https://files.pythonhosted.org/packages/fb/fe/f9540bf12fa443d8870ecab70260c02140ed8b4c37884a2e1050bdd689a2/aiohttp-3.12.13-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:5304d74867028cca8f64f1cc1215eb365388033c5a691ea7aa6b0dc47412f495", size = 1605745, upload-time = "2025-06-14T15:15:27.604Z" }, - { url = "https://files.pythonhosted.org/packages/91/d7/526f1d16ca01e0c995887097b31e39c2e350dc20c1071e9b2dcf63a86fcd/aiohttp-3.12.13-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:64d1f24ee95a2d1e094a4cd7a9b7d34d08db1bbcb8aa9fb717046b0a884ac294", size = 1693348, upload-time = "2025-06-14T15:15:30.151Z" }, - { url = "https://files.pythonhosted.org/packages/cd/0a/c103fdaab6fbde7c5f10450b5671dca32cea99800b1303ee8194a799bbb9/aiohttp-3.12.13-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:119c79922a7001ca6a9e253228eb39b793ea994fd2eccb79481c64b5f9d2a055", size = 1709023, upload-time = "2025-06-14T15:15:32.881Z" }, - { url = "https://files.pythonhosted.org/packages/2f/bc/b8d14e754b5e0bf9ecf6df4b930f2cbd6eaaafcdc1b2f9271968747fb6e3/aiohttp-3.12.13-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:bb18f00396d22e2f10cd8825d671d9f9a3ba968d708a559c02a627536b36d91c", size = 1638691, upload-time = "2025-06-14T15:15:35.033Z" }, - { url = "https://files.pythonhosted.org/packages/a4/7b/44b77bf4c48d95d81af5c57e79337d0d51350a85a84e9997a99a6205c441/aiohttp-3.12.13-cp39-cp39-win32.whl", hash = "sha256:0022de47ef63fd06b065d430ac79c6b0bd24cdae7feaf0e8c6bac23b805a23a8", size = 428365, upload-time = "2025-06-14T15:15:37.369Z" }, - { url = "https://files.pythonhosted.org/packages/e5/cb/aaa022eb993e7d51928dc22d743ed17addb40142250e829701c5e6679615/aiohttp-3.12.13-cp39-cp39-win_amd64.whl", hash = "sha256:29e08111ccf81b2734ae03f1ad1cb03b9615e7d8f616764f22f71209c094f122", size = 451652, upload-time = "2025-06-14T15:15:39.079Z" }, + { url = "https://files.pythonhosted.org/packages/6d/34/939730e66b716b76046dedfe0842995842fa906ccc4964bba414ff69e429/aiohttp-3.13.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:2372b15a5f62ed37789a6b383ff7344fc5b9f243999b0cd9b629d8bc5f5b4155", size = 736471, upload-time = "2025-10-28T20:55:27.924Z" }, + { url = "https://files.pythonhosted.org/packages/fd/cf/dcbdf2df7f6ca72b0bb4c0b4509701f2d8942cf54e29ca197389c214c07f/aiohttp-3.13.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e7f8659a48995edee7229522984bd1009c1213929c769c2daa80b40fe49a180c", size = 493985, upload-time = "2025-10-28T20:55:29.456Z" }, + { url = "https://files.pythonhosted.org/packages/9d/87/71c8867e0a1d0882dcbc94af767784c3cb381c1c4db0943ab4aae4fed65e/aiohttp-3.13.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:939ced4a7add92296b0ad38892ce62b98c619288a081170695c6babe4f50e636", size = 489274, upload-time = "2025-10-28T20:55:31.134Z" }, + { url = "https://files.pythonhosted.org/packages/38/0f/46c24e8dae237295eaadd113edd56dee96ef6462adf19b88592d44891dc5/aiohttp-3.13.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6315fb6977f1d0dd41a107c527fee2ed5ab0550b7d885bc15fee20ccb17891da", size = 1668171, upload-time = "2025-10-28T20:55:36.065Z" }, + { url = "https://files.pythonhosted.org/packages/eb/c6/4cdfb4440d0e28483681a48f69841fa5e39366347d66ef808cbdadddb20e/aiohttp-3.13.2-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:6e7352512f763f760baaed2637055c49134fd1d35b37c2dedfac35bfe5cf8725", size = 1636036, upload-time = "2025-10-28T20:55:37.576Z" }, + { url = "https://files.pythonhosted.org/packages/84/37/8708cf678628216fb678ab327a4e1711c576d6673998f4f43e86e9ae90dd/aiohttp-3.13.2-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e09a0a06348a2dd73e7213353c90d709502d9786219f69b731f6caa0efeb46f5", size = 1727975, upload-time = "2025-10-28T20:55:39.457Z" }, + { url = "https://files.pythonhosted.org/packages/e6/2e/3ebfe12fdcb9b5f66e8a0a42dffcd7636844c8a018f261efb2419f68220b/aiohttp-3.13.2-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a09a6d073fb5789456545bdee2474d14395792faa0527887f2f4ec1a486a59d3", size = 1815823, upload-time = "2025-10-28T20:55:40.958Z" }, + { url = "https://files.pythonhosted.org/packages/a1/4f/ca2ef819488cbb41844c6cf92ca6dd15b9441e6207c58e5ae0e0fc8d70ad/aiohttp-3.13.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b59d13c443f8e049d9e94099c7e412e34610f1f49be0f230ec656a10692a5802", size = 1669374, upload-time = "2025-10-28T20:55:42.745Z" }, + { url = "https://files.pythonhosted.org/packages/f8/fe/1fe2e1179a0d91ce09c99069684aab619bf2ccde9b20bd6ca44f8837203e/aiohttp-3.13.2-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:20db2d67985d71ca033443a1ba2001c4b5693fe09b0e29f6d9358a99d4d62a8a", size = 1555315, upload-time = "2025-10-28T20:55:44.264Z" }, + { url = "https://files.pythonhosted.org/packages/5a/2b/f3781899b81c45d7cbc7140cddb8a3481c195e7cbff8e36374759d2ab5a5/aiohttp-3.13.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:960c2fc686ba27b535f9fd2b52d87ecd7e4fd1cf877f6a5cba8afb5b4a8bd204", size = 1639140, upload-time = "2025-10-28T20:55:46.626Z" }, + { url = "https://files.pythonhosted.org/packages/72/27/c37e85cd3ece6f6c772e549bd5a253d0c122557b25855fb274224811e4f2/aiohttp-3.13.2-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:6c00dbcf5f0d88796151e264a8eab23de2997c9303dd7c0bf622e23b24d3ce22", size = 1645496, upload-time = "2025-10-28T20:55:48.933Z" }, + { url = "https://files.pythonhosted.org/packages/66/20/3af1ab663151bd3780b123e907761cdb86ec2c4e44b2d9b195ebc91fbe37/aiohttp-3.13.2-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:fed38a5edb7945f4d1bcabe2fcd05db4f6ec7e0e82560088b754f7e08d93772d", size = 1697625, upload-time = "2025-10-28T20:55:50.377Z" }, + { url = "https://files.pythonhosted.org/packages/95/eb/ae5cab15efa365e13d56b31b0d085a62600298bf398a7986f8388f73b598/aiohttp-3.13.2-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:b395bbca716c38bef3c764f187860e88c724b342c26275bc03e906142fc5964f", size = 1542025, upload-time = "2025-10-28T20:55:51.861Z" }, + { url = "https://files.pythonhosted.org/packages/e9/2d/1683e8d67ec72d911397fe4e575688d2a9b8f6a6e03c8fdc9f3fd3d4c03f/aiohttp-3.13.2-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:204ffff2426c25dfda401ba08da85f9c59525cdc42bda26660463dd1cbcfec6f", size = 1714918, upload-time = "2025-10-28T20:55:53.515Z" }, + { url = "https://files.pythonhosted.org/packages/99/a2/ffe8e0e1c57c5e542d47ffa1fcf95ef2b3ea573bf7c4d2ee877252431efc/aiohttp-3.13.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:05c4dd3c48fb5f15db31f57eb35374cb0c09afdde532e7fb70a75aede0ed30f6", size = 1656113, upload-time = "2025-10-28T20:55:55.438Z" }, + { url = "https://files.pythonhosted.org/packages/0d/42/d511aff5c3a2b06c09d7d214f508a4ad8ac7799817f7c3d23e7336b5e896/aiohttp-3.13.2-cp310-cp310-win32.whl", hash = "sha256:e574a7d61cf10351d734bcddabbe15ede0eaa8a02070d85446875dc11189a251", size = 432290, upload-time = "2025-10-28T20:55:56.96Z" }, + { url = "https://files.pythonhosted.org/packages/8b/ea/1c2eb7098b5bad4532994f2b7a8228d27674035c9b3234fe02c37469ef14/aiohttp-3.13.2-cp310-cp310-win_amd64.whl", hash = "sha256:364f55663085d658b8462a1c3f17b2b84a5c2e1ba858e1b79bff7b2e24ad1514", size = 455075, upload-time = "2025-10-28T20:55:58.373Z" }, + { url = "https://files.pythonhosted.org/packages/35/74/b321e7d7ca762638cdf8cdeceb39755d9c745aff7a64c8789be96ddf6e96/aiohttp-3.13.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:4647d02df098f6434bafd7f32ad14942f05a9caa06c7016fdcc816f343997dd0", size = 743409, upload-time = "2025-10-28T20:56:00.354Z" }, + { url = "https://files.pythonhosted.org/packages/99/3d/91524b905ec473beaf35158d17f82ef5a38033e5809fe8742e3657cdbb97/aiohttp-3.13.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e3403f24bcb9c3b29113611c3c16a2a447c3953ecf86b79775e7be06f7ae7ccb", size = 497006, upload-time = "2025-10-28T20:56:01.85Z" }, + { url = "https://files.pythonhosted.org/packages/eb/d3/7f68bc02a67716fe80f063e19adbd80a642e30682ce74071269e17d2dba1/aiohttp-3.13.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:43dff14e35aba17e3d6d5ba628858fb8cb51e30f44724a2d2f0c75be492c55e9", size = 493195, upload-time = "2025-10-28T20:56:03.314Z" }, + { url = "https://files.pythonhosted.org/packages/98/31/913f774a4708775433b7375c4f867d58ba58ead833af96c8af3621a0d243/aiohttp-3.13.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e2a9ea08e8c58bb17655630198833109227dea914cd20be660f52215f6de5613", size = 1747759, upload-time = "2025-10-28T20:56:04.904Z" }, + { url = "https://files.pythonhosted.org/packages/e8/63/04efe156f4326f31c7c4a97144f82132c3bb21859b7bb84748d452ccc17c/aiohttp-3.13.2-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:53b07472f235eb80e826ad038c9d106c2f653584753f3ddab907c83f49eedead", size = 1704456, upload-time = "2025-10-28T20:56:06.986Z" }, + { url = "https://files.pythonhosted.org/packages/8e/02/4e16154d8e0a9cf4ae76f692941fd52543bbb148f02f098ca73cab9b1c1b/aiohttp-3.13.2-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e736c93e9c274fce6419af4aac199984d866e55f8a4cec9114671d0ea9688780", size = 1807572, upload-time = "2025-10-28T20:56:08.558Z" }, + { url = "https://files.pythonhosted.org/packages/34/58/b0583defb38689e7f06798f0285b1ffb3a6fb371f38363ce5fd772112724/aiohttp-3.13.2-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:ff5e771f5dcbc81c64898c597a434f7682f2259e0cd666932a913d53d1341d1a", size = 1895954, upload-time = "2025-10-28T20:56:10.545Z" }, + { url = "https://files.pythonhosted.org/packages/6b/f3/083907ee3437425b4e376aa58b2c915eb1a33703ec0dc30040f7ae3368c6/aiohttp-3.13.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a3b6fb0c207cc661fa0bf8c66d8d9b657331ccc814f4719468af61034b478592", size = 1747092, upload-time = "2025-10-28T20:56:12.118Z" }, + { url = "https://files.pythonhosted.org/packages/ac/61/98a47319b4e425cc134e05e5f3fc512bf9a04bf65aafd9fdcda5d57ec693/aiohttp-3.13.2-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:97a0895a8e840ab3520e2288db7cace3a1981300d48babeb50e7425609e2e0ab", size = 1606815, upload-time = "2025-10-28T20:56:14.191Z" }, + { url = "https://files.pythonhosted.org/packages/97/4b/e78b854d82f66bb974189135d31fce265dee0f5344f64dd0d345158a5973/aiohttp-3.13.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:9e8f8afb552297aca127c90cb840e9a1d4bfd6a10d7d8f2d9176e1acc69bad30", size = 1723789, upload-time = "2025-10-28T20:56:16.101Z" }, + { url = "https://files.pythonhosted.org/packages/ed/fc/9d2ccc794fc9b9acd1379d625c3a8c64a45508b5091c546dea273a41929e/aiohttp-3.13.2-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:ed2f9c7216e53c3df02264f25d824b079cc5914f9e2deba94155190ef648ee40", size = 1718104, upload-time = "2025-10-28T20:56:17.655Z" }, + { url = "https://files.pythonhosted.org/packages/66/65/34564b8765ea5c7d79d23c9113135d1dd3609173da13084830f1507d56cf/aiohttp-3.13.2-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:99c5280a329d5fa18ef30fd10c793a190d996567667908bef8a7f81f8202b948", size = 1785584, upload-time = "2025-10-28T20:56:19.238Z" }, + { url = "https://files.pythonhosted.org/packages/30/be/f6a7a426e02fc82781afd62016417b3948e2207426d90a0e478790d1c8a4/aiohttp-3.13.2-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:2ca6ffef405fc9c09a746cb5d019c1672cd7f402542e379afc66b370833170cf", size = 1595126, upload-time = "2025-10-28T20:56:20.836Z" }, + { url = "https://files.pythonhosted.org/packages/e5/c7/8e22d5d28f94f67d2af496f14a83b3c155d915d1fe53d94b66d425ec5b42/aiohttp-3.13.2-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:47f438b1a28e926c37632bff3c44df7d27c9b57aaf4e34b1def3c07111fdb782", size = 1800665, upload-time = "2025-10-28T20:56:22.922Z" }, + { url = "https://files.pythonhosted.org/packages/d1/11/91133c8b68b1da9fc16555706aa7276fdf781ae2bb0876c838dd86b8116e/aiohttp-3.13.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9acda8604a57bb60544e4646a4615c1866ee6c04a8edef9b8ee6fd1d8fa2ddc8", size = 1739532, upload-time = "2025-10-28T20:56:25.924Z" }, + { url = "https://files.pythonhosted.org/packages/17/6b/3747644d26a998774b21a616016620293ddefa4d63af6286f389aedac844/aiohttp-3.13.2-cp311-cp311-win32.whl", hash = "sha256:868e195e39b24aaa930b063c08bb0c17924899c16c672a28a65afded9c46c6ec", size = 431876, upload-time = "2025-10-28T20:56:27.524Z" }, + { url = "https://files.pythonhosted.org/packages/c3/63/688462108c1a00eb9f05765331c107f95ae86f6b197b865d29e930b7e462/aiohttp-3.13.2-cp311-cp311-win_amd64.whl", hash = "sha256:7fd19df530c292542636c2a9a85854fab93474396a52f1695e799186bbd7f24c", size = 456205, upload-time = "2025-10-28T20:56:29.062Z" }, + { url = "https://files.pythonhosted.org/packages/29/9b/01f00e9856d0a73260e86dd8ed0c2234a466c5c1712ce1c281548df39777/aiohttp-3.13.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:b1e56bab2e12b2b9ed300218c351ee2a3d8c8fdab5b1ec6193e11a817767e47b", size = 737623, upload-time = "2025-10-28T20:56:30.797Z" }, + { url = "https://files.pythonhosted.org/packages/5a/1b/4be39c445e2b2bd0aab4ba736deb649fabf14f6757f405f0c9685019b9e9/aiohttp-3.13.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:364e25edaabd3d37b1db1f0cbcee8c73c9a3727bfa262b83e5e4cf3489a2a9dc", size = 492664, upload-time = "2025-10-28T20:56:32.708Z" }, + { url = "https://files.pythonhosted.org/packages/28/66/d35dcfea8050e131cdd731dff36434390479b4045a8d0b9d7111b0a968f1/aiohttp-3.13.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c5c94825f744694c4b8db20b71dba9a257cd2ba8e010a803042123f3a25d50d7", size = 491808, upload-time = "2025-10-28T20:56:34.57Z" }, + { url = "https://files.pythonhosted.org/packages/00/29/8e4609b93e10a853b65f8291e64985de66d4f5848c5637cddc70e98f01f8/aiohttp-3.13.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ba2715d842ffa787be87cbfce150d5e88c87a98e0b62e0f5aa489169a393dbbb", size = 1738863, upload-time = "2025-10-28T20:56:36.377Z" }, + { url = "https://files.pythonhosted.org/packages/9d/fa/4ebdf4adcc0def75ced1a0d2d227577cd7b1b85beb7edad85fcc87693c75/aiohttp-3.13.2-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:585542825c4bc662221fb257889e011a5aa00f1ae4d75d1d246a5225289183e3", size = 1700586, upload-time = "2025-10-28T20:56:38.034Z" }, + { url = "https://files.pythonhosted.org/packages/da/04/73f5f02ff348a3558763ff6abe99c223381b0bace05cd4530a0258e52597/aiohttp-3.13.2-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:39d02cb6025fe1aabca329c5632f48c9532a3dabccd859e7e2f110668972331f", size = 1768625, upload-time = "2025-10-28T20:56:39.75Z" }, + { url = "https://files.pythonhosted.org/packages/f8/49/a825b79ffec124317265ca7d2344a86bcffeb960743487cb11988ffb3494/aiohttp-3.13.2-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:e67446b19e014d37342f7195f592a2a948141d15a312fe0e700c2fd2f03124f6", size = 1867281, upload-time = "2025-10-28T20:56:41.471Z" }, + { url = "https://files.pythonhosted.org/packages/b9/48/adf56e05f81eac31edcfae45c90928f4ad50ef2e3ea72cb8376162a368f8/aiohttp-3.13.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4356474ad6333e41ccefd39eae869ba15a6c5299c9c01dfdcfdd5c107be4363e", size = 1752431, upload-time = "2025-10-28T20:56:43.162Z" }, + { url = "https://files.pythonhosted.org/packages/30/ab/593855356eead019a74e862f21523db09c27f12fd24af72dbc3555b9bfd9/aiohttp-3.13.2-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:eeacf451c99b4525f700f078becff32c32ec327b10dcf31306a8a52d78166de7", size = 1562846, upload-time = "2025-10-28T20:56:44.85Z" }, + { url = "https://files.pythonhosted.org/packages/39/0f/9f3d32271aa8dc35036e9668e31870a9d3b9542dd6b3e2c8a30931cb27ae/aiohttp-3.13.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:d8a9b889aeabd7a4e9af0b7f4ab5ad94d42e7ff679aaec6d0db21e3b639ad58d", size = 1699606, upload-time = "2025-10-28T20:56:46.519Z" }, + { url = "https://files.pythonhosted.org/packages/2c/3c/52d2658c5699b6ef7692a3f7128b2d2d4d9775f2a68093f74bca06cf01e1/aiohttp-3.13.2-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:fa89cb11bc71a63b69568d5b8a25c3ca25b6d54c15f907ca1c130d72f320b76b", size = 1720663, upload-time = "2025-10-28T20:56:48.528Z" }, + { url = "https://files.pythonhosted.org/packages/9b/d4/8f8f3ff1fb7fb9e3f04fcad4e89d8a1cd8fc7d05de67e3de5b15b33008ff/aiohttp-3.13.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:8aa7c807df234f693fed0ecd507192fc97692e61fee5702cdc11155d2e5cadc8", size = 1737939, upload-time = "2025-10-28T20:56:50.77Z" }, + { url = "https://files.pythonhosted.org/packages/03/d3/ddd348f8a27a634daae39a1b8e291ff19c77867af438af844bf8b7e3231b/aiohttp-3.13.2-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:9eb3e33fdbe43f88c3c75fa608c25e7c47bbd80f48d012763cb67c47f39a7e16", size = 1555132, upload-time = "2025-10-28T20:56:52.568Z" }, + { url = "https://files.pythonhosted.org/packages/39/b8/46790692dc46218406f94374903ba47552f2f9f90dad554eed61bfb7b64c/aiohttp-3.13.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:9434bc0d80076138ea986833156c5a48c9c7a8abb0c96039ddbb4afc93184169", size = 1764802, upload-time = "2025-10-28T20:56:54.292Z" }, + { url = "https://files.pythonhosted.org/packages/ba/e4/19ce547b58ab2a385e5f0b8aa3db38674785085abcf79b6e0edd1632b12f/aiohttp-3.13.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:ff15c147b2ad66da1f2cbb0622313f2242d8e6e8f9b79b5206c84523a4473248", size = 1719512, upload-time = "2025-10-28T20:56:56.428Z" }, + { url = "https://files.pythonhosted.org/packages/70/30/6355a737fed29dcb6dfdd48682d5790cb5eab050f7b4e01f49b121d3acad/aiohttp-3.13.2-cp312-cp312-win32.whl", hash = "sha256:27e569eb9d9e95dbd55c0fc3ec3a9335defbf1d8bc1d20171a49f3c4c607b93e", size = 426690, upload-time = "2025-10-28T20:56:58.736Z" }, + { url = "https://files.pythonhosted.org/packages/0a/0d/b10ac09069973d112de6ef980c1f6bb31cb7dcd0bc363acbdad58f927873/aiohttp-3.13.2-cp312-cp312-win_amd64.whl", hash = "sha256:8709a0f05d59a71f33fd05c17fc11fcb8c30140506e13c2f5e8ee1b8964e1b45", size = 453465, upload-time = "2025-10-28T20:57:00.795Z" }, + { url = "https://files.pythonhosted.org/packages/bf/78/7e90ca79e5aa39f9694dcfd74f4720782d3c6828113bb1f3197f7e7c4a56/aiohttp-3.13.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:7519bdc7dfc1940d201651b52bf5e03f5503bda45ad6eacf64dda98be5b2b6be", size = 732139, upload-time = "2025-10-28T20:57:02.455Z" }, + { url = "https://files.pythonhosted.org/packages/db/ed/1f59215ab6853fbaa5c8495fa6cbc39edfc93553426152b75d82a5f32b76/aiohttp-3.13.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:088912a78b4d4f547a1f19c099d5a506df17eacec3c6f4375e2831ec1d995742", size = 490082, upload-time = "2025-10-28T20:57:04.784Z" }, + { url = "https://files.pythonhosted.org/packages/68/7b/fe0fe0f5e05e13629d893c760465173a15ad0039c0a5b0d0040995c8075e/aiohttp-3.13.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5276807b9de9092af38ed23ce120539ab0ac955547b38563a9ba4f5b07b95293", size = 489035, upload-time = "2025-10-28T20:57:06.894Z" }, + { url = "https://files.pythonhosted.org/packages/d2/04/db5279e38471b7ac801d7d36a57d1230feeee130bbe2a74f72731b23c2b1/aiohttp-3.13.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1237c1375eaef0db4dcd7c2559f42e8af7b87ea7d295b118c60c36a6e61cb811", size = 1720387, upload-time = "2025-10-28T20:57:08.685Z" }, + { url = "https://files.pythonhosted.org/packages/31/07/8ea4326bd7dae2bd59828f69d7fdc6e04523caa55e4a70f4a8725a7e4ed2/aiohttp-3.13.2-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:96581619c57419c3d7d78703d5b78c1e5e5fc0172d60f555bdebaced82ded19a", size = 1688314, upload-time = "2025-10-28T20:57:10.693Z" }, + { url = "https://files.pythonhosted.org/packages/48/ab/3d98007b5b87ffd519d065225438cc3b668b2f245572a8cb53da5dd2b1bc/aiohttp-3.13.2-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a2713a95b47374169409d18103366de1050fe0ea73db358fc7a7acb2880422d4", size = 1756317, upload-time = "2025-10-28T20:57:12.563Z" }, + { url = "https://files.pythonhosted.org/packages/97/3d/801ca172b3d857fafb7b50c7c03f91b72b867a13abca982ed6b3081774ef/aiohttp-3.13.2-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:228a1cd556b3caca590e9511a89444925da87d35219a49ab5da0c36d2d943a6a", size = 1858539, upload-time = "2025-10-28T20:57:14.623Z" }, + { url = "https://files.pythonhosted.org/packages/f7/0d/4764669bdf47bd472899b3d3db91fffbe925c8e3038ec591a2fd2ad6a14d/aiohttp-3.13.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ac6cde5fba8d7d8c6ac963dbb0256a9854e9fafff52fbcc58fdf819357892c3e", size = 1739597, upload-time = "2025-10-28T20:57:16.399Z" }, + { url = "https://files.pythonhosted.org/packages/c4/52/7bd3c6693da58ba16e657eb904a5b6decfc48ecd06e9ac098591653b1566/aiohttp-3.13.2-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f2bef8237544f4e42878c61cef4e2839fee6346dc60f5739f876a9c50be7fcdb", size = 1555006, upload-time = "2025-10-28T20:57:18.288Z" }, + { url = "https://files.pythonhosted.org/packages/48/30/9586667acec5993b6f41d2ebcf96e97a1255a85f62f3c653110a5de4d346/aiohttp-3.13.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:16f15a4eac3bc2d76c45f7ebdd48a65d41b242eb6c31c2245463b40b34584ded", size = 1683220, upload-time = "2025-10-28T20:57:20.241Z" }, + { url = "https://files.pythonhosted.org/packages/71/01/3afe4c96854cfd7b30d78333852e8e851dceaec1c40fd00fec90c6402dd2/aiohttp-3.13.2-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:bb7fb776645af5cc58ab804c58d7eba545a97e047254a52ce89c157b5af6cd0b", size = 1712570, upload-time = "2025-10-28T20:57:22.253Z" }, + { url = "https://files.pythonhosted.org/packages/11/2c/22799d8e720f4697a9e66fd9c02479e40a49de3de2f0bbe7f9f78a987808/aiohttp-3.13.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:e1b4951125ec10c70802f2cb09736c895861cd39fd9dcb35107b4dc8ae6220b8", size = 1733407, upload-time = "2025-10-28T20:57:24.37Z" }, + { url = "https://files.pythonhosted.org/packages/34/cb/90f15dd029f07cebbd91f8238a8b363978b530cd128488085b5703683594/aiohttp-3.13.2-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:550bf765101ae721ee1d37d8095f47b1f220650f85fe1af37a90ce75bab89d04", size = 1550093, upload-time = "2025-10-28T20:57:26.257Z" }, + { url = "https://files.pythonhosted.org/packages/69/46/12dce9be9d3303ecbf4d30ad45a7683dc63d90733c2d9fe512be6716cd40/aiohttp-3.13.2-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:fe91b87fc295973096251e2d25a811388e7d8adf3bd2b97ef6ae78bc4ac6c476", size = 1758084, upload-time = "2025-10-28T20:57:28.349Z" }, + { url = "https://files.pythonhosted.org/packages/f9/c8/0932b558da0c302ffd639fc6362a313b98fdf235dc417bc2493da8394df7/aiohttp-3.13.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e0c8e31cfcc4592cb200160344b2fb6ae0f9e4effe06c644b5a125d4ae5ebe23", size = 1716987, upload-time = "2025-10-28T20:57:30.233Z" }, + { url = "https://files.pythonhosted.org/packages/5d/8b/f5bd1a75003daed099baec373aed678f2e9b34f2ad40d85baa1368556396/aiohttp-3.13.2-cp313-cp313-win32.whl", hash = "sha256:0740f31a60848d6edb296a0df827473eede90c689b8f9f2a4cdde74889eb2254", size = 425859, upload-time = "2025-10-28T20:57:32.105Z" }, + { url = "https://files.pythonhosted.org/packages/5d/28/a8a9fc6957b2cee8902414e41816b5ab5536ecf43c3b1843c10e82c559b2/aiohttp-3.13.2-cp313-cp313-win_amd64.whl", hash = "sha256:a88d13e7ca367394908f8a276b89d04a3652044612b9a408a0bb22a5ed976a1a", size = 452192, upload-time = "2025-10-28T20:57:34.166Z" }, + { url = "https://files.pythonhosted.org/packages/9b/36/e2abae1bd815f01c957cbf7be817b3043304e1c87bad526292a0410fdcf9/aiohttp-3.13.2-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:2475391c29230e063ef53a66669b7b691c9bfc3f1426a0f7bcdf1216bdbac38b", size = 735234, upload-time = "2025-10-28T20:57:36.415Z" }, + { url = "https://files.pythonhosted.org/packages/ca/e3/1ee62dde9b335e4ed41db6bba02613295a0d5b41f74a783c142745a12763/aiohttp-3.13.2-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:f33c8748abef4d8717bb20e8fb1b3e07c6adacb7fd6beaae971a764cf5f30d61", size = 490733, upload-time = "2025-10-28T20:57:38.205Z" }, + { url = "https://files.pythonhosted.org/packages/1a/aa/7a451b1d6a04e8d15a362af3e9b897de71d86feac3babf8894545d08d537/aiohttp-3.13.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:ae32f24bbfb7dbb485a24b30b1149e2f200be94777232aeadba3eecece4d0aa4", size = 491303, upload-time = "2025-10-28T20:57:40.122Z" }, + { url = "https://files.pythonhosted.org/packages/57/1e/209958dbb9b01174870f6a7538cd1f3f28274fdbc88a750c238e2c456295/aiohttp-3.13.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5d7f02042c1f009ffb70067326ef183a047425bb2ff3bc434ead4dd4a4a66a2b", size = 1717965, upload-time = "2025-10-28T20:57:42.28Z" }, + { url = "https://files.pythonhosted.org/packages/08/aa/6a01848d6432f241416bc4866cae8dc03f05a5a884d2311280f6a09c73d6/aiohttp-3.13.2-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:93655083005d71cd6c072cdab54c886e6570ad2c4592139c3fb967bfc19e4694", size = 1667221, upload-time = "2025-10-28T20:57:44.869Z" }, + { url = "https://files.pythonhosted.org/packages/87/4f/36c1992432d31bbc789fa0b93c768d2e9047ec8c7177e5cd84ea85155f36/aiohttp-3.13.2-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:0db1e24b852f5f664cd728db140cf11ea0e82450471232a394b3d1a540b0f906", size = 1757178, upload-time = "2025-10-28T20:57:47.216Z" }, + { url = "https://files.pythonhosted.org/packages/ac/b4/8e940dfb03b7e0f68a82b88fd182b9be0a65cb3f35612fe38c038c3112cf/aiohttp-3.13.2-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b009194665bcd128e23eaddef362e745601afa4641930848af4c8559e88f18f9", size = 1838001, upload-time = "2025-10-28T20:57:49.337Z" }, + { url = "https://files.pythonhosted.org/packages/d7/ef/39f3448795499c440ab66084a9db7d20ca7662e94305f175a80f5b7e0072/aiohttp-3.13.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c038a8fdc8103cd51dbd986ecdce141473ffd9775a7a8057a6ed9c3653478011", size = 1716325, upload-time = "2025-10-28T20:57:51.327Z" }, + { url = "https://files.pythonhosted.org/packages/d7/51/b311500ffc860b181c05d91c59a1313bdd05c82960fdd4035a15740d431e/aiohttp-3.13.2-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:66bac29b95a00db411cd758fea0e4b9bdba6d549dfe333f9a945430f5f2cc5a6", size = 1547978, upload-time = "2025-10-28T20:57:53.554Z" }, + { url = "https://files.pythonhosted.org/packages/31/64/b9d733296ef79815226dab8c586ff9e3df41c6aff2e16c06697b2d2e6775/aiohttp-3.13.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:4ebf9cfc9ba24a74cf0718f04aac2a3bbe745902cc7c5ebc55c0f3b5777ef213", size = 1682042, upload-time = "2025-10-28T20:57:55.617Z" }, + { url = "https://files.pythonhosted.org/packages/3f/30/43d3e0f9d6473a6db7d472104c4eff4417b1e9df01774cb930338806d36b/aiohttp-3.13.2-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:a4b88ebe35ce54205c7074f7302bd08a4cb83256a3e0870c72d6f68a3aaf8e49", size = 1680085, upload-time = "2025-10-28T20:57:57.59Z" }, + { url = "https://files.pythonhosted.org/packages/16/51/c709f352c911b1864cfd1087577760ced64b3e5bee2aa88b8c0c8e2e4972/aiohttp-3.13.2-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:98c4fb90bb82b70a4ed79ca35f656f4281885be076f3f970ce315402b53099ae", size = 1728238, upload-time = "2025-10-28T20:57:59.525Z" }, + { url = "https://files.pythonhosted.org/packages/19/e2/19bd4c547092b773caeb48ff5ae4b1ae86756a0ee76c16727fcfd281404b/aiohttp-3.13.2-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:ec7534e63ae0f3759df3a1ed4fa6bc8f75082a924b590619c0dd2f76d7043caa", size = 1544395, upload-time = "2025-10-28T20:58:01.914Z" }, + { url = "https://files.pythonhosted.org/packages/cf/87/860f2803b27dfc5ed7be532832a3498e4919da61299b4a1f8eb89b8ff44d/aiohttp-3.13.2-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:5b927cf9b935a13e33644cbed6c8c4b2d0f25b713d838743f8fe7191b33829c4", size = 1742965, upload-time = "2025-10-28T20:58:03.972Z" }, + { url = "https://files.pythonhosted.org/packages/67/7f/db2fc7618925e8c7a601094d5cbe539f732df4fb570740be88ed9e40e99a/aiohttp-3.13.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:88d6c017966a78c5265d996c19cdb79235be5e6412268d7e2ce7dee339471b7a", size = 1697585, upload-time = "2025-10-28T20:58:06.189Z" }, + { url = "https://files.pythonhosted.org/packages/0c/07/9127916cb09bb38284db5036036042b7b2c514c8ebaeee79da550c43a6d6/aiohttp-3.13.2-cp314-cp314-win32.whl", hash = "sha256:f7c183e786e299b5d6c49fb43a769f8eb8e04a2726a2bd5887b98b5cc2d67940", size = 431621, upload-time = "2025-10-28T20:58:08.636Z" }, + { url = "https://files.pythonhosted.org/packages/fb/41/554a8a380df6d3a2bba8a7726429a23f4ac62aaf38de43bb6d6cde7b4d4d/aiohttp-3.13.2-cp314-cp314-win_amd64.whl", hash = "sha256:fe242cd381e0fb65758faf5ad96c2e460df6ee5b2de1072fe97e4127927e00b4", size = 457627, upload-time = "2025-10-28T20:58:11Z" }, + { url = "https://files.pythonhosted.org/packages/c7/8e/3824ef98c039d3951cb65b9205a96dd2b20f22241ee17d89c5701557c826/aiohttp-3.13.2-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:f10d9c0b0188fe85398c61147bbd2a657d616c876863bfeff43376e0e3134673", size = 767360, upload-time = "2025-10-28T20:58:13.358Z" }, + { url = "https://files.pythonhosted.org/packages/a4/0f/6a03e3fc7595421274fa34122c973bde2d89344f8a881b728fa8c774e4f1/aiohttp-3.13.2-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:e7c952aefdf2460f4ae55c5e9c3e80aa72f706a6317e06020f80e96253b1accd", size = 504616, upload-time = "2025-10-28T20:58:15.339Z" }, + { url = "https://files.pythonhosted.org/packages/c6/aa/ed341b670f1bc8a6f2c6a718353d13b9546e2cef3544f573c6a1ff0da711/aiohttp-3.13.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c20423ce14771d98353d2e25e83591fa75dfa90a3c1848f3d7c68243b4fbded3", size = 509131, upload-time = "2025-10-28T20:58:17.693Z" }, + { url = "https://files.pythonhosted.org/packages/7f/f0/c68dac234189dae5c4bbccc0f96ce0cc16b76632cfc3a08fff180045cfa4/aiohttp-3.13.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e96eb1a34396e9430c19d8338d2ec33015e4a87ef2b4449db94c22412e25ccdf", size = 1864168, upload-time = "2025-10-28T20:58:20.113Z" }, + { url = "https://files.pythonhosted.org/packages/8f/65/75a9a76db8364b5d0e52a0c20eabc5d52297385d9af9c35335b924fafdee/aiohttp-3.13.2-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:23fb0783bc1a33640036465019d3bba069942616a6a2353c6907d7fe1ccdaf4e", size = 1719200, upload-time = "2025-10-28T20:58:22.583Z" }, + { url = "https://files.pythonhosted.org/packages/f5/55/8df2ed78d7f41d232f6bd3ff866b6f617026551aa1d07e2f03458f964575/aiohttp-3.13.2-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:2e1a9bea6244a1d05a4e57c295d69e159a5c50d8ef16aa390948ee873478d9a5", size = 1843497, upload-time = "2025-10-28T20:58:24.672Z" }, + { url = "https://files.pythonhosted.org/packages/e9/e0/94d7215e405c5a02ccb6a35c7a3a6cfff242f457a00196496935f700cde5/aiohttp-3.13.2-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:0a3d54e822688b56e9f6b5816fb3de3a3a64660efac64e4c2dc435230ad23bad", size = 1935703, upload-time = "2025-10-28T20:58:26.758Z" }, + { url = "https://files.pythonhosted.org/packages/0b/78/1eeb63c3f9b2d1015a4c02788fb543141aad0a03ae3f7a7b669b2483f8d4/aiohttp-3.13.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7a653d872afe9f33497215745da7a943d1dc15b728a9c8da1c3ac423af35178e", size = 1792738, upload-time = "2025-10-28T20:58:29.787Z" }, + { url = "https://files.pythonhosted.org/packages/41/75/aaf1eea4c188e51538c04cc568040e3082db263a57086ea74a7d38c39e42/aiohttp-3.13.2-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:56d36e80d2003fa3fc0207fac644216d8532e9504a785ef9a8fd013f84a42c61", size = 1624061, upload-time = "2025-10-28T20:58:32.529Z" }, + { url = "https://files.pythonhosted.org/packages/9b/c2/3b6034de81fbcc43de8aeb209073a2286dfb50b86e927b4efd81cf848197/aiohttp-3.13.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:78cd586d8331fb8e241c2dd6b2f4061778cc69e150514b39a9e28dd050475661", size = 1789201, upload-time = "2025-10-28T20:58:34.618Z" }, + { url = "https://files.pythonhosted.org/packages/c9/38/c15dcf6d4d890217dae79d7213988f4e5fe6183d43893a9cf2fe9e84ca8d/aiohttp-3.13.2-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:20b10bbfbff766294fe99987f7bb3b74fdd2f1a2905f2562132641ad434dcf98", size = 1776868, upload-time = "2025-10-28T20:58:38.835Z" }, + { url = "https://files.pythonhosted.org/packages/04/75/f74fd178ac81adf4f283a74847807ade5150e48feda6aef024403716c30c/aiohttp-3.13.2-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:9ec49dff7e2b3c85cdeaa412e9d438f0ecd71676fde61ec57027dd392f00c693", size = 1790660, upload-time = "2025-10-28T20:58:41.507Z" }, + { url = "https://files.pythonhosted.org/packages/e7/80/7368bd0d06b16b3aba358c16b919e9c46cf11587dc572091031b0e9e3ef0/aiohttp-3.13.2-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:94f05348c4406450f9d73d38efb41d669ad6cd90c7ee194810d0eefbfa875a7a", size = 1617548, upload-time = "2025-10-28T20:58:43.674Z" }, + { url = "https://files.pythonhosted.org/packages/7d/4b/a6212790c50483cb3212e507378fbe26b5086d73941e1ec4b56a30439688/aiohttp-3.13.2-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:fa4dcb605c6f82a80c7f95713c2b11c3b8e9893b3ebd2bc9bde93165ed6107be", size = 1817240, upload-time = "2025-10-28T20:58:45.787Z" }, + { url = "https://files.pythonhosted.org/packages/ff/f7/ba5f0ba4ea8d8f3c32850912944532b933acbf0f3a75546b89269b9b7dde/aiohttp-3.13.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:cf00e5db968c3f67eccd2778574cf64d8b27d95b237770aa32400bd7a1ca4f6c", size = 1762334, upload-time = "2025-10-28T20:58:47.936Z" }, + { url = "https://files.pythonhosted.org/packages/7e/83/1a5a1856574588b1cad63609ea9ad75b32a8353ac995d830bf5da9357364/aiohttp-3.13.2-cp314-cp314t-win32.whl", hash = "sha256:d23b5fe492b0805a50d3371e8a728a9134d8de5447dce4c885f5587294750734", size = 464685, upload-time = "2025-10-28T20:58:50.642Z" }, + { url = "https://files.pythonhosted.org/packages/9f/4d/d22668674122c08f4d56972297c51a624e64b3ed1efaa40187607a7cb66e/aiohttp-3.13.2-cp314-cp314t-win_amd64.whl", hash = "sha256:ff0a7b0a82a7ab905cbda74006318d1b12e37c797eb1b0d4eb3e316cf47f658f", size = 498093, upload-time = "2025-10-28T20:58:52.782Z" }, + { url = "https://files.pythonhosted.org/packages/04/4a/3da532fdf51b5e58fffa1a86d6569184cb1bf4bf81cd4434b6541a8d14fd/aiohttp-3.13.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:7fbdf5ad6084f1940ce88933de34b62358d0f4a0b6ec097362dcd3e5a65a4989", size = 739009, upload-time = "2025-10-28T20:58:55.682Z" }, + { url = "https://files.pythonhosted.org/packages/89/74/fefa6f7939cdc1d77e5cad712004e675a8847dccc589dcc3abca7feaed73/aiohttp-3.13.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7c3a50345635a02db61792c85bb86daffac05330f6473d524f1a4e3ef9d0046d", size = 495308, upload-time = "2025-10-28T20:58:58.408Z" }, + { url = "https://files.pythonhosted.org/packages/4e/b4/a0638ae1f12d09a0dc558870968a2f19a1eba1b10ad0a85ef142ddb40b50/aiohttp-3.13.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0e87dff73f46e969af38ab3f7cb75316a7c944e2e574ff7c933bc01b10def7f5", size = 490624, upload-time = "2025-10-28T20:59:00.479Z" }, + { url = "https://files.pythonhosted.org/packages/02/73/361cd4cac9d98a5a4183d1f26faf7b777330f8dba838c5aae2412862bdd0/aiohttp-3.13.2-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2adebd4577724dcae085665f294cc57c8701ddd4d26140504db622b8d566d7aa", size = 1662968, upload-time = "2025-10-28T20:59:03.105Z" }, + { url = "https://files.pythonhosted.org/packages/9e/93/ce2ca7584555a6c7dd78f2e6b539a96c5172d88815e13a05a576e14a5a22/aiohttp-3.13.2-cp39-cp39-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e036a3a645fe92309ec34b918394bb377950cbb43039a97edae6c08db64b23e2", size = 1627117, upload-time = "2025-10-28T20:59:05.274Z" }, + { url = "https://files.pythonhosted.org/packages/a6/42/7ee0e699111f5fc20a69b3203e8f5d5da0b681f270b90bc088d15e339980/aiohttp-3.13.2-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:23ad365e30108c422d0b4428cf271156dd56790f6dd50d770b8e360e6c5ab2e6", size = 1724037, upload-time = "2025-10-28T20:59:07.522Z" }, + { url = "https://files.pythonhosted.org/packages/66/88/67ad5ff11dd61dd1d7882cda39f085d5fca31cf7e2143f5173429d8a591e/aiohttp-3.13.2-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:1f9b2c2d4b9d958b1f9ae0c984ec1dd6b6689e15c75045be8ccb4011426268ca", size = 1812899, upload-time = "2025-10-28T20:59:11.698Z" }, + { url = "https://files.pythonhosted.org/packages/60/1b/a46f6e1c2a347b9c7a789292279c159b327fadecbf8340f3b05fffff1151/aiohttp-3.13.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3a92cf4b9bea33e15ecbaa5c59921be0f23222608143d025c989924f7e3e0c07", size = 1660961, upload-time = "2025-10-28T20:59:14.425Z" }, + { url = "https://files.pythonhosted.org/packages/44/cc/1af9e466eafd9b5d8922238c69aaf95b656137add4c5db65f63ee129bf3c/aiohttp-3.13.2-cp39-cp39-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:070599407f4954021509193404c4ac53153525a19531051661440644728ba9a7", size = 1553851, upload-time = "2025-10-28T20:59:17.044Z" }, + { url = "https://files.pythonhosted.org/packages/e5/d1/9e5f4f40f9d0ee5668e9b5e7ebfb0eaf371cc09da03785decdc5da56f4b3/aiohttp-3.13.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:29562998ec66f988d49fb83c9b01694fa927186b781463f376c5845c121e4e0b", size = 1634260, upload-time = "2025-10-28T20:59:19.378Z" }, + { url = "https://files.pythonhosted.org/packages/83/2e/5d065091c4ae8b55a153f458f19308191bad3b62a89496aa081385486338/aiohttp-3.13.2-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:4dd3db9d0f4ebca1d887d76f7cdbcd1116ac0d05a9221b9dad82c64a62578c4d", size = 1639499, upload-time = "2025-10-28T20:59:22.013Z" }, + { url = "https://files.pythonhosted.org/packages/a3/de/58ae6dc73691a51ff16f69a94d13657bf417456fa0fdfed2b59dd6b4c293/aiohttp-3.13.2-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:d7bc4b7f9c4921eba72677cd9fedd2308f4a4ca3e12fab58935295ad9ea98700", size = 1694087, upload-time = "2025-10-28T20:59:24.773Z" }, + { url = "https://files.pythonhosted.org/packages/45/fe/4d9df516268867d83041b6c073ee15cd532dbea58b82d675a7e1cf2ec24c/aiohttp-3.13.2-cp39-cp39-musllinux_1_2_riscv64.whl", hash = "sha256:dacd50501cd017f8cccb328da0c90823511d70d24a323196826d923aad865901", size = 1540532, upload-time = "2025-10-28T20:59:27.982Z" }, + { url = "https://files.pythonhosted.org/packages/24/e7/a802619308232499482bf30b3530efb5d141481cfd61850368350fb1acb5/aiohttp-3.13.2-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:8b2f1414f6a1e0683f212ec80e813f4abef94c739fd090b66c9adf9d2a05feac", size = 1710369, upload-time = "2025-10-28T20:59:30.363Z" }, + { url = "https://files.pythonhosted.org/packages/62/08/e8593f39f025efe96ef59550d17cf097222d84f6f84798bedac5bf037fce/aiohttp-3.13.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:04c3971421576ed24c191f610052bcb2f059e395bc2489dd99e397f9bc466329", size = 1649296, upload-time = "2025-10-28T20:59:33.285Z" }, + { url = "https://files.pythonhosted.org/packages/e5/fd/ffbc1b6aa46fc6c284af4a438b2c7eab79af1c8ac4b6d2ced185c17f403e/aiohttp-3.13.2-cp39-cp39-win32.whl", hash = "sha256:9f377d0a924e5cc94dc620bc6366fc3e889586a7f18b748901cf016c916e2084", size = 432980, upload-time = "2025-10-28T20:59:35.515Z" }, + { url = "https://files.pythonhosted.org/packages/ad/a9/d47e7873175a4d8aed425f2cdea2df700b2dd44fac024ffbd83455a69a50/aiohttp-3.13.2-cp39-cp39-win_amd64.whl", hash = "sha256:9c705601e16c03466cb72011bd1af55d68fa65b045356d8f96c216e5f6db0fa5", size = 456021, upload-time = "2025-10-28T20:59:37.659Z" }, ] [[package]] @@ -142,7 +185,7 @@ wheels = [ [[package]] name = "anyio" -version = "4.8.0" +version = "4.11.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "exceptiongroup", marker = "python_full_version < '3.11' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, @@ -150,9 +193,9 @@ dependencies = [ { name = "sniffio" }, { name = "typing-extensions", marker = "python_full_version < '3.13' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/a3/73/199a98fc2dae33535d6b8e8e6ec01f8c1d76c9adb096c6b7d64823038cde/anyio-4.8.0.tar.gz", hash = "sha256:1d9fe889df5212298c0c0723fa20479d1b94883a2df44bd3897aa91083316f7a", size = 181126, upload-time = "2025-01-05T13:13:11.095Z" } +sdist = { url = "https://files.pythonhosted.org/packages/c6/78/7d432127c41b50bccba979505f272c16cbcadcc33645d5fa3a738110ae75/anyio-4.11.0.tar.gz", hash = "sha256:82a8d0b81e318cc5ce71a5f1f8b5c4e63619620b63141ef8c995fa0db95a57c4", size = 219094, upload-time = "2025-09-23T09:19:12.58Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/46/eb/e7f063ad1fec6b3178a3cd82d1a3c4de82cccf283fc42746168188e1cdd5/anyio-4.8.0-py3-none-any.whl", hash = "sha256:b5011f270ab5eb0abf13385f851315585cc37ef330dd88e27ec3d34d651fd47a", size = 96041, upload-time = "2025-01-05T13:13:07.985Z" }, + { url = "https://files.pythonhosted.org/packages/15/b3/9b1a8074496371342ec1e796a96f99c82c945a339cd81a8e73de28b4cf9e/anyio-4.11.0-py3-none-any.whl", hash = "sha256:0287e96f4d26d4149305414d4e3bc32f0dcd0862365a4bddea19d7a1ec38c4fc", size = 109097, upload-time = "2025-09-23T09:19:10.601Z" }, ] [[package]] @@ -166,20 +209,29 @@ wheels = [ [[package]] name = "attrs" -version = "25.3.0" +version = "25.4.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/6b/5c/685e6633917e101e5dcb62b9dd76946cbb57c26e133bae9e0cd36033c0a9/attrs-25.4.0.tar.gz", hash = "sha256:16d5969b87f0859ef33a48b35d55ac1be6e42ae49d5e853b597db70c35c57e11", size = 934251, upload-time = "2025-10-06T13:54:44.725Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3a/2a/7cc015f5b9f5db42b7d48157e23356022889fc354a2813c15934b7cb5c0e/attrs-25.4.0-py3-none-any.whl", hash = "sha256:adcf7e2a1fb3b36ac48d97835bb6d8ade15b8dcce26aba8bf1d14847b57a3373", size = 67615, upload-time = "2025-10-06T13:54:43.17Z" }, +] + +[[package]] +name = "backports-asyncio-runner" +version = "1.2.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/5a/b0/1367933a8532ee6ff8d63537de4f1177af4bff9f3e829baf7331f595bb24/attrs-25.3.0.tar.gz", hash = "sha256:75d7cefc7fb576747b2c81b4442d4d4a1ce0900973527c011d1030fd3bf4af1b", size = 812032, upload-time = "2025-03-13T11:10:22.779Z" } +sdist = { url = "https://files.pythonhosted.org/packages/8e/ff/70dca7d7cb1cbc0edb2c6cc0c38b65cba36cccc491eca64cabd5fe7f8670/backports_asyncio_runner-1.2.0.tar.gz", hash = "sha256:a5aa7b2b7d8f8bfcaa2b57313f70792df84e32a2a746f585213373f900b42162", size = 69893, upload-time = "2025-07-02T02:27:15.685Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/77/06/bb80f5f86020c4551da315d78b3ab75e8228f89f0162f2c3a819e407941a/attrs-25.3.0-py3-none-any.whl", hash = "sha256:427318ce031701fea540783410126f03899a97ffc6f61596ad581ac2e40e3bc3", size = 63815, upload-time = "2025-03-13T11:10:21.14Z" }, + { url = "https://files.pythonhosted.org/packages/a0/59/76ab57e3fe74484f48a53f8e337171b4a2349e506eabe136d7e01d059086/backports_asyncio_runner-1.2.0-py3-none-any.whl", hash = "sha256:0da0a936a8aeb554eccb426dc55af3ba63bcdc69fa1a600b5bb305413a4477b5", size = 12313, upload-time = "2025-07-02T02:27:14.263Z" }, ] [[package]] name = "certifi" -version = "2024.12.14" +version = "2025.11.12" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/0f/bd/1d41ee578ce09523c81a15426705dd20969f5abf006d1afe8aeff0dd776a/certifi-2024.12.14.tar.gz", hash = "sha256:b650d30f370c2b724812bee08008be0c4163b163ddaec3f2546c1caf65f191db", size = 166010, upload-time = "2024-12-14T13:52:38.02Z" } +sdist = { url = "https://files.pythonhosted.org/packages/a2/8c/58f469717fa48465e4a50c014a0400602d3c437d7c0c468e17ada824da3a/certifi-2025.11.12.tar.gz", hash = "sha256:d8ab5478f2ecd78af242878415affce761ca6bc54a22a27e026d7c25357c3316", size = 160538, upload-time = "2025-11-12T02:54:51.517Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/a5/32/8f6669fc4798494966bf446c8c4a162e0b5d893dff088afddf76414f70e1/certifi-2024.12.14-py3-none-any.whl", hash = "sha256:1275f7a45be9464efc1173084eaa30f866fe2e47d389406136d332ed4967ec56", size = 164927, upload-time = "2024-12-14T13:52:36.114Z" }, + { url = "https://files.pythonhosted.org/packages/70/7d/9bc192684cea499815ff478dfcdc13835ddf401365057044fb721ec6bddb/certifi-2025.11.12-py3-none-any.whl", hash = "sha256:97de8790030bbd5c2d96b7ec782fc2f7820ef8dba6db909ccf95449f2d062d4b", size = 159438, upload-time = "2025-11-12T02:54:49.735Z" }, ] [[package]] @@ -193,11 +245,11 @@ wheels = [ [[package]] name = "dirty-equals" -version = "0.9.0" +version = "0.11" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/b0/99/133892f401ced5a27e641a473c547d5fbdb39af8f85dac8a9d633ea3e7a7/dirty_equals-0.9.0.tar.gz", hash = "sha256:17f515970b04ed7900b733c95fd8091f4f85e52f1fb5f268757f25c858eb1f7b", size = 50412, upload-time = "2025-01-11T23:23:40.491Z" } +sdist = { url = "https://files.pythonhosted.org/packages/30/1d/c5913ac9d6615515a00f4bdc71356d302437cb74ff2e9aaccd3c14493b78/dirty_equals-0.11.tar.gz", hash = "sha256:f4ac74ee88f2d11e2fa0f65eb30ee4f07105c5f86f4dc92b09eb1138775027c3", size = 128067, upload-time = "2025-11-17T01:51:24.451Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/77/0c/03cc99bf3b6328604b10829de3460f2b2ad3373200c45665c38508e550c6/dirty_equals-0.9.0-py3-none-any.whl", hash = "sha256:ff4d027f5cfa1b69573af00f7ba9043ea652dbdce3fe5cbe828e478c7346db9c", size = 28226, upload-time = "2025-01-11T23:23:37.489Z" }, + { url = "https://files.pythonhosted.org/packages/bb/8d/dbff05239043271dbeace563a7686212a3dd517864a35623fe4d4a64ca19/dirty_equals-0.11-py3-none-any.whl", hash = "sha256:b1d7093273fc2f9be12f443a8ead954ef6daaf6746fd42ef3a5616433ee85286", size = 28051, upload-time = "2025-11-17T01:51:22.849Z" }, ] [[package]] @@ -211,131 +263,160 @@ wheels = [ [[package]] name = "exceptiongroup" -version = "1.2.2" +version = "1.3.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/09/35/2495c4ac46b980e4ca1f6ad6db102322ef3ad2410b79fdde159a4b0f3b92/exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc", size = 28883, upload-time = "2024-07-12T22:26:00.161Z" } +dependencies = [ + { name = "typing-extensions", marker = "python_full_version < '3.13' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/50/79/66800aadf48771f6b62f7eb014e352e5d06856655206165d775e675a02c9/exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219", size = 30371, upload-time = "2025-11-21T23:01:54.787Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/02/cc/b7e31358aac6ed1ef2bb790a9746ac2c69bcb3c8588b41616914eb106eaf/exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b", size = 16453, upload-time = "2024-07-12T22:25:58.476Z" }, + { url = "https://files.pythonhosted.org/packages/8a/0e/97c33bf5009bdbac74fd2beace167cab3f978feb69cc36f1ef79360d6c4e/exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598", size = 16740, upload-time = "2025-11-21T23:01:53.443Z" }, ] [[package]] name = "execnet" -version = "2.1.1" +version = "2.1.2" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/bb/ff/b4c0dc78fbe20c3e59c0c7334de0c27eb4001a2b2017999af398bf730817/execnet-2.1.1.tar.gz", hash = "sha256:5189b52c6121c24feae288166ab41b32549c7e2348652736540b9e6e7d4e72e3", size = 166524, upload-time = "2024-04-08T09:04:19.245Z" } +sdist = { url = "https://files.pythonhosted.org/packages/bf/89/780e11f9588d9e7128a3f87788354c7946a9cbb1401ad38a48c4db9a4f07/execnet-2.1.2.tar.gz", hash = "sha256:63d83bfdd9a23e35b9c6a3261412324f964c2ec8dcd8d3c6916ee9373e0befcd", size = 166622, upload-time = "2025-11-12T09:56:37.75Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/43/09/2aea36ff60d16dd8879bdb2f5b3ee0ba8d08cbbdcdfe870e695ce3784385/execnet-2.1.1-py3-none-any.whl", hash = "sha256:26dee51f1b80cebd6d0ca8e74dd8745419761d3bef34163928cbebbdc4749fdc", size = 40612, upload-time = "2024-04-08T09:04:17.414Z" }, + { url = "https://files.pythonhosted.org/packages/ab/84/02fc1827e8cdded4aa65baef11296a9bbe595c474f0d6d758af082d849fd/execnet-2.1.2-py3-none-any.whl", hash = "sha256:67fba928dd5a544b783f6056f449e5e3931a5c378b128bc18501f7ea79e296ec", size = 40708, upload-time = "2025-11-12T09:56:36.333Z" }, ] [[package]] name = "frozenlist" -version = "1.7.0" +version = "1.8.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/79/b1/b64018016eeb087db503b038296fd782586432b9c077fc5c7839e9cb6ef6/frozenlist-1.7.0.tar.gz", hash = "sha256:2e310d81923c2437ea8670467121cc3e9b0f76d3043cc1d2331d56c7fb7a3a8f", size = 45078, upload-time = "2025-06-09T23:02:35.538Z" } +sdist = { url = "https://files.pythonhosted.org/packages/2d/f5/c831fac6cc817d26fd54c7eaccd04ef7e0288806943f7cc5bbf69f3ac1f0/frozenlist-1.8.0.tar.gz", hash = "sha256:3ede829ed8d842f6cd48fc7081d7a41001a56f1f38603f9d49bf3020d59a31ad", size = 45875, upload-time = "2025-10-06T05:38:17.865Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/af/36/0da0a49409f6b47cc2d060dc8c9040b897b5902a8a4e37d9bc1deb11f680/frozenlist-1.7.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:cc4df77d638aa2ed703b878dd093725b72a824c3c546c076e8fdf276f78ee84a", size = 81304, upload-time = "2025-06-09T22:59:46.226Z" }, - { url = "https://files.pythonhosted.org/packages/77/f0/77c11d13d39513b298e267b22eb6cb559c103d56f155aa9a49097221f0b6/frozenlist-1.7.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:716a9973a2cc963160394f701964fe25012600f3d311f60c790400b00e568b61", size = 47735, upload-time = "2025-06-09T22:59:48.133Z" }, - { url = "https://files.pythonhosted.org/packages/37/12/9d07fa18971a44150593de56b2f2947c46604819976784bcf6ea0d5db43b/frozenlist-1.7.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a0fd1bad056a3600047fb9462cff4c5322cebc59ebf5d0a3725e0ee78955001d", size = 46775, upload-time = "2025-06-09T22:59:49.564Z" }, - { url = "https://files.pythonhosted.org/packages/70/34/f73539227e06288fcd1f8a76853e755b2b48bca6747e99e283111c18bcd4/frozenlist-1.7.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3789ebc19cb811163e70fe2bd354cea097254ce6e707ae42e56f45e31e96cb8e", size = 224644, upload-time = "2025-06-09T22:59:51.35Z" }, - { url = "https://files.pythonhosted.org/packages/fb/68/c1d9c2f4a6e438e14613bad0f2973567586610cc22dcb1e1241da71de9d3/frozenlist-1.7.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:af369aa35ee34f132fcfad5be45fbfcde0e3a5f6a1ec0712857f286b7d20cca9", size = 222125, upload-time = "2025-06-09T22:59:52.884Z" }, - { url = "https://files.pythonhosted.org/packages/b9/d0/98e8f9a515228d708344d7c6986752be3e3192d1795f748c24bcf154ad99/frozenlist-1.7.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ac64b6478722eeb7a3313d494f8342ef3478dff539d17002f849101b212ef97c", size = 233455, upload-time = "2025-06-09T22:59:54.74Z" }, - { url = "https://files.pythonhosted.org/packages/79/df/8a11bcec5600557f40338407d3e5bea80376ed1c01a6c0910fcfdc4b8993/frozenlist-1.7.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f89f65d85774f1797239693cef07ad4c97fdd0639544bad9ac4b869782eb1981", size = 227339, upload-time = "2025-06-09T22:59:56.187Z" }, - { url = "https://files.pythonhosted.org/packages/50/82/41cb97d9c9a5ff94438c63cc343eb7980dac4187eb625a51bdfdb7707314/frozenlist-1.7.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1073557c941395fdfcfac13eb2456cb8aad89f9de27bae29fabca8e563b12615", size = 212969, upload-time = "2025-06-09T22:59:57.604Z" }, - { url = "https://files.pythonhosted.org/packages/13/47/f9179ee5ee4f55629e4f28c660b3fdf2775c8bfde8f9c53f2de2d93f52a9/frozenlist-1.7.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1ed8d2fa095aae4bdc7fdd80351009a48d286635edffee66bf865e37a9125c50", size = 222862, upload-time = "2025-06-09T22:59:59.498Z" }, - { url = "https://files.pythonhosted.org/packages/1a/52/df81e41ec6b953902c8b7e3a83bee48b195cb0e5ec2eabae5d8330c78038/frozenlist-1.7.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:24c34bea555fe42d9f928ba0a740c553088500377448febecaa82cc3e88aa1fa", size = 222492, upload-time = "2025-06-09T23:00:01.026Z" }, - { url = "https://files.pythonhosted.org/packages/84/17/30d6ea87fa95a9408245a948604b82c1a4b8b3e153cea596421a2aef2754/frozenlist-1.7.0-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:69cac419ac6a6baad202c85aaf467b65ac860ac2e7f2ac1686dc40dbb52f6577", size = 238250, upload-time = "2025-06-09T23:00:03.401Z" }, - { url = "https://files.pythonhosted.org/packages/8f/00/ecbeb51669e3c3df76cf2ddd66ae3e48345ec213a55e3887d216eb4fbab3/frozenlist-1.7.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:960d67d0611f4c87da7e2ae2eacf7ea81a5be967861e0c63cf205215afbfac59", size = 218720, upload-time = "2025-06-09T23:00:05.282Z" }, - { url = "https://files.pythonhosted.org/packages/1a/c0/c224ce0e0eb31cc57f67742071bb470ba8246623c1823a7530be0e76164c/frozenlist-1.7.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:41be2964bd4b15bf575e5daee5a5ce7ed3115320fb3c2b71fca05582ffa4dc9e", size = 232585, upload-time = "2025-06-09T23:00:07.962Z" }, - { url = "https://files.pythonhosted.org/packages/55/3c/34cb694abf532f31f365106deebdeac9e45c19304d83cf7d51ebbb4ca4d1/frozenlist-1.7.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:46d84d49e00c9429238a7ce02dc0be8f6d7cd0cd405abd1bebdc991bf27c15bd", size = 234248, upload-time = "2025-06-09T23:00:09.428Z" }, - { url = "https://files.pythonhosted.org/packages/98/c0/2052d8b6cecda2e70bd81299e3512fa332abb6dcd2969b9c80dfcdddbf75/frozenlist-1.7.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:15900082e886edb37480335d9d518cec978afc69ccbc30bd18610b7c1b22a718", size = 221621, upload-time = "2025-06-09T23:00:11.32Z" }, - { url = "https://files.pythonhosted.org/packages/c5/bf/7dcebae315436903b1d98ffb791a09d674c88480c158aa171958a3ac07f0/frozenlist-1.7.0-cp310-cp310-win32.whl", hash = "sha256:400ddd24ab4e55014bba442d917203c73b2846391dd42ca5e38ff52bb18c3c5e", size = 39578, upload-time = "2025-06-09T23:00:13.526Z" }, - { url = "https://files.pythonhosted.org/packages/8f/5f/f69818f017fa9a3d24d1ae39763e29b7f60a59e46d5f91b9c6b21622f4cd/frozenlist-1.7.0-cp310-cp310-win_amd64.whl", hash = "sha256:6eb93efb8101ef39d32d50bce242c84bcbddb4f7e9febfa7b524532a239b4464", size = 43830, upload-time = "2025-06-09T23:00:14.98Z" }, - { url = "https://files.pythonhosted.org/packages/34/7e/803dde33760128acd393a27eb002f2020ddb8d99d30a44bfbaab31c5f08a/frozenlist-1.7.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:aa51e147a66b2d74de1e6e2cf5921890de6b0f4820b257465101d7f37b49fb5a", size = 82251, upload-time = "2025-06-09T23:00:16.279Z" }, - { url = "https://files.pythonhosted.org/packages/75/a9/9c2c5760b6ba45eae11334db454c189d43d34a4c0b489feb2175e5e64277/frozenlist-1.7.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:9b35db7ce1cd71d36ba24f80f0c9e7cff73a28d7a74e91fe83e23d27c7828750", size = 48183, upload-time = "2025-06-09T23:00:17.698Z" }, - { url = "https://files.pythonhosted.org/packages/47/be/4038e2d869f8a2da165f35a6befb9158c259819be22eeaf9c9a8f6a87771/frozenlist-1.7.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:34a69a85e34ff37791e94542065c8416c1afbf820b68f720452f636d5fb990cd", size = 47107, upload-time = "2025-06-09T23:00:18.952Z" }, - { url = "https://files.pythonhosted.org/packages/79/26/85314b8a83187c76a37183ceed886381a5f992975786f883472fcb6dc5f2/frozenlist-1.7.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4a646531fa8d82c87fe4bb2e596f23173caec9185bfbca5d583b4ccfb95183e2", size = 237333, upload-time = "2025-06-09T23:00:20.275Z" }, - { url = "https://files.pythonhosted.org/packages/1f/fd/e5b64f7d2c92a41639ffb2ad44a6a82f347787abc0c7df5f49057cf11770/frozenlist-1.7.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:79b2ffbba483f4ed36a0f236ccb85fbb16e670c9238313709638167670ba235f", size = 231724, upload-time = "2025-06-09T23:00:21.705Z" }, - { url = "https://files.pythonhosted.org/packages/20/fb/03395c0a43a5976af4bf7534759d214405fbbb4c114683f434dfdd3128ef/frozenlist-1.7.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a26f205c9ca5829cbf82bb2a84b5c36f7184c4316617d7ef1b271a56720d6b30", size = 245842, upload-time = "2025-06-09T23:00:23.148Z" }, - { url = "https://files.pythonhosted.org/packages/d0/15/c01c8e1dffdac5d9803507d824f27aed2ba76b6ed0026fab4d9866e82f1f/frozenlist-1.7.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bcacfad3185a623fa11ea0e0634aac7b691aa925d50a440f39b458e41c561d98", size = 239767, upload-time = "2025-06-09T23:00:25.103Z" }, - { url = "https://files.pythonhosted.org/packages/14/99/3f4c6fe882c1f5514b6848aa0a69b20cb5e5d8e8f51a339d48c0e9305ed0/frozenlist-1.7.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:72c1b0fe8fe451b34f12dce46445ddf14bd2a5bcad7e324987194dc8e3a74c86", size = 224130, upload-time = "2025-06-09T23:00:27.061Z" }, - { url = "https://files.pythonhosted.org/packages/4d/83/220a374bd7b2aeba9d0725130665afe11de347d95c3620b9b82cc2fcab97/frozenlist-1.7.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:61d1a5baeaac6c0798ff6edfaeaa00e0e412d49946c53fae8d4b8e8b3566c4ae", size = 235301, upload-time = "2025-06-09T23:00:29.02Z" }, - { url = "https://files.pythonhosted.org/packages/03/3c/3e3390d75334a063181625343e8daab61b77e1b8214802cc4e8a1bb678fc/frozenlist-1.7.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:7edf5c043c062462f09b6820de9854bf28cc6cc5b6714b383149745e287181a8", size = 234606, upload-time = "2025-06-09T23:00:30.514Z" }, - { url = "https://files.pythonhosted.org/packages/23/1e/58232c19608b7a549d72d9903005e2d82488f12554a32de2d5fb59b9b1ba/frozenlist-1.7.0-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:d50ac7627b3a1bd2dcef6f9da89a772694ec04d9a61b66cf87f7d9446b4a0c31", size = 248372, upload-time = "2025-06-09T23:00:31.966Z" }, - { url = "https://files.pythonhosted.org/packages/c0/a4/e4a567e01702a88a74ce8a324691e62a629bf47d4f8607f24bf1c7216e7f/frozenlist-1.7.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:ce48b2fece5aeb45265bb7a58259f45027db0abff478e3077e12b05b17fb9da7", size = 229860, upload-time = "2025-06-09T23:00:33.375Z" }, - { url = "https://files.pythonhosted.org/packages/73/a6/63b3374f7d22268b41a9db73d68a8233afa30ed164c46107b33c4d18ecdd/frozenlist-1.7.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:fe2365ae915a1fafd982c146754e1de6ab3478def8a59c86e1f7242d794f97d5", size = 245893, upload-time = "2025-06-09T23:00:35.002Z" }, - { url = "https://files.pythonhosted.org/packages/6d/eb/d18b3f6e64799a79673c4ba0b45e4cfbe49c240edfd03a68be20002eaeaa/frozenlist-1.7.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:45a6f2fdbd10e074e8814eb98b05292f27bad7d1883afbe009d96abdcf3bc898", size = 246323, upload-time = "2025-06-09T23:00:36.468Z" }, - { url = "https://files.pythonhosted.org/packages/5a/f5/720f3812e3d06cd89a1d5db9ff6450088b8f5c449dae8ffb2971a44da506/frozenlist-1.7.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:21884e23cffabb157a9dd7e353779077bf5b8f9a58e9b262c6caad2ef5f80a56", size = 233149, upload-time = "2025-06-09T23:00:37.963Z" }, - { url = "https://files.pythonhosted.org/packages/69/68/03efbf545e217d5db8446acfd4c447c15b7c8cf4dbd4a58403111df9322d/frozenlist-1.7.0-cp311-cp311-win32.whl", hash = "sha256:284d233a8953d7b24f9159b8a3496fc1ddc00f4db99c324bd5fb5f22d8698ea7", size = 39565, upload-time = "2025-06-09T23:00:39.753Z" }, - { url = "https://files.pythonhosted.org/packages/58/17/fe61124c5c333ae87f09bb67186d65038834a47d974fc10a5fadb4cc5ae1/frozenlist-1.7.0-cp311-cp311-win_amd64.whl", hash = "sha256:387cbfdcde2f2353f19c2f66bbb52406d06ed77519ac7ee21be0232147c2592d", size = 44019, upload-time = "2025-06-09T23:00:40.988Z" }, - { url = "https://files.pythonhosted.org/packages/ef/a2/c8131383f1e66adad5f6ecfcce383d584ca94055a34d683bbb24ac5f2f1c/frozenlist-1.7.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:3dbf9952c4bb0e90e98aec1bd992b3318685005702656bc6f67c1a32b76787f2", size = 81424, upload-time = "2025-06-09T23:00:42.24Z" }, - { url = "https://files.pythonhosted.org/packages/4c/9d/02754159955088cb52567337d1113f945b9e444c4960771ea90eb73de8db/frozenlist-1.7.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:1f5906d3359300b8a9bb194239491122e6cf1444c2efb88865426f170c262cdb", size = 47952, upload-time = "2025-06-09T23:00:43.481Z" }, - { url = "https://files.pythonhosted.org/packages/01/7a/0046ef1bd6699b40acd2067ed6d6670b4db2f425c56980fa21c982c2a9db/frozenlist-1.7.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:3dabd5a8f84573c8d10d8859a50ea2dec01eea372031929871368c09fa103478", size = 46688, upload-time = "2025-06-09T23:00:44.793Z" }, - { url = "https://files.pythonhosted.org/packages/d6/a2/a910bafe29c86997363fb4c02069df4ff0b5bc39d33c5198b4e9dd42d8f8/frozenlist-1.7.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aa57daa5917f1738064f302bf2626281a1cb01920c32f711fbc7bc36111058a8", size = 243084, upload-time = "2025-06-09T23:00:46.125Z" }, - { url = "https://files.pythonhosted.org/packages/64/3e/5036af9d5031374c64c387469bfcc3af537fc0f5b1187d83a1cf6fab1639/frozenlist-1.7.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c193dda2b6d49f4c4398962810fa7d7c78f032bf45572b3e04dd5249dff27e08", size = 233524, upload-time = "2025-06-09T23:00:47.73Z" }, - { url = "https://files.pythonhosted.org/packages/06/39/6a17b7c107a2887e781a48ecf20ad20f1c39d94b2a548c83615b5b879f28/frozenlist-1.7.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bfe2b675cf0aaa6d61bf8fbffd3c274b3c9b7b1623beb3809df8a81399a4a9c4", size = 248493, upload-time = "2025-06-09T23:00:49.742Z" }, - { url = "https://files.pythonhosted.org/packages/be/00/711d1337c7327d88c44d91dd0f556a1c47fb99afc060ae0ef66b4d24793d/frozenlist-1.7.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8fc5d5cda37f62b262405cf9652cf0856839c4be8ee41be0afe8858f17f4c94b", size = 244116, upload-time = "2025-06-09T23:00:51.352Z" }, - { url = "https://files.pythonhosted.org/packages/24/fe/74e6ec0639c115df13d5850e75722750adabdc7de24e37e05a40527ca539/frozenlist-1.7.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b0d5ce521d1dd7d620198829b87ea002956e4319002ef0bc8d3e6d045cb4646e", size = 224557, upload-time = "2025-06-09T23:00:52.855Z" }, - { url = "https://files.pythonhosted.org/packages/8d/db/48421f62a6f77c553575201e89048e97198046b793f4a089c79a6e3268bd/frozenlist-1.7.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:488d0a7d6a0008ca0db273c542098a0fa9e7dfaa7e57f70acef43f32b3f69dca", size = 241820, upload-time = "2025-06-09T23:00:54.43Z" }, - { url = "https://files.pythonhosted.org/packages/1d/fa/cb4a76bea23047c8462976ea7b7a2bf53997a0ca171302deae9d6dd12096/frozenlist-1.7.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:15a7eaba63983d22c54d255b854e8108e7e5f3e89f647fc854bd77a237e767df", size = 236542, upload-time = "2025-06-09T23:00:56.409Z" }, - { url = "https://files.pythonhosted.org/packages/5d/32/476a4b5cfaa0ec94d3f808f193301debff2ea42288a099afe60757ef6282/frozenlist-1.7.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:1eaa7e9c6d15df825bf255649e05bd8a74b04a4d2baa1ae46d9c2d00b2ca2cb5", size = 249350, upload-time = "2025-06-09T23:00:58.468Z" }, - { url = "https://files.pythonhosted.org/packages/8d/ba/9a28042f84a6bf8ea5dbc81cfff8eaef18d78b2a1ad9d51c7bc5b029ad16/frozenlist-1.7.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:e4389e06714cfa9d47ab87f784a7c5be91d3934cd6e9a7b85beef808297cc025", size = 225093, upload-time = "2025-06-09T23:01:00.015Z" }, - { url = "https://files.pythonhosted.org/packages/bc/29/3a32959e68f9cf000b04e79ba574527c17e8842e38c91d68214a37455786/frozenlist-1.7.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:73bd45e1488c40b63fe5a7df892baf9e2a4d4bb6409a2b3b78ac1c6236178e01", size = 245482, upload-time = "2025-06-09T23:01:01.474Z" }, - { url = "https://files.pythonhosted.org/packages/80/e8/edf2f9e00da553f07f5fa165325cfc302dead715cab6ac8336a5f3d0adc2/frozenlist-1.7.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:99886d98e1643269760e5fe0df31e5ae7050788dd288947f7f007209b8c33f08", size = 249590, upload-time = "2025-06-09T23:01:02.961Z" }, - { url = "https://files.pythonhosted.org/packages/1c/80/9a0eb48b944050f94cc51ee1c413eb14a39543cc4f760ed12657a5a3c45a/frozenlist-1.7.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:290a172aae5a4c278c6da8a96222e6337744cd9c77313efe33d5670b9f65fc43", size = 237785, upload-time = "2025-06-09T23:01:05.095Z" }, - { url = "https://files.pythonhosted.org/packages/f3/74/87601e0fb0369b7a2baf404ea921769c53b7ae00dee7dcfe5162c8c6dbf0/frozenlist-1.7.0-cp312-cp312-win32.whl", hash = "sha256:426c7bc70e07cfebc178bc4c2bf2d861d720c4fff172181eeb4a4c41d4ca2ad3", size = 39487, upload-time = "2025-06-09T23:01:06.54Z" }, - { url = "https://files.pythonhosted.org/packages/0b/15/c026e9a9fc17585a9d461f65d8593d281fedf55fbf7eb53f16c6df2392f9/frozenlist-1.7.0-cp312-cp312-win_amd64.whl", hash = "sha256:563b72efe5da92e02eb68c59cb37205457c977aa7a449ed1b37e6939e5c47c6a", size = 43874, upload-time = "2025-06-09T23:01:07.752Z" }, - { url = "https://files.pythonhosted.org/packages/24/90/6b2cebdabdbd50367273c20ff6b57a3dfa89bd0762de02c3a1eb42cb6462/frozenlist-1.7.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ee80eeda5e2a4e660651370ebffd1286542b67e268aa1ac8d6dbe973120ef7ee", size = 79791, upload-time = "2025-06-09T23:01:09.368Z" }, - { url = "https://files.pythonhosted.org/packages/83/2e/5b70b6a3325363293fe5fc3ae74cdcbc3e996c2a11dde2fd9f1fb0776d19/frozenlist-1.7.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:d1a81c85417b914139e3a9b995d4a1c84559afc839a93cf2cb7f15e6e5f6ed2d", size = 47165, upload-time = "2025-06-09T23:01:10.653Z" }, - { url = "https://files.pythonhosted.org/packages/f4/25/a0895c99270ca6966110f4ad98e87e5662eab416a17e7fd53c364bf8b954/frozenlist-1.7.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:cbb65198a9132ebc334f237d7b0df163e4de83fb4f2bdfe46c1e654bdb0c5d43", size = 45881, upload-time = "2025-06-09T23:01:12.296Z" }, - { url = "https://files.pythonhosted.org/packages/19/7c/71bb0bbe0832793c601fff68cd0cf6143753d0c667f9aec93d3c323f4b55/frozenlist-1.7.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dab46c723eeb2c255a64f9dc05b8dd601fde66d6b19cdb82b2e09cc6ff8d8b5d", size = 232409, upload-time = "2025-06-09T23:01:13.641Z" }, - { url = "https://files.pythonhosted.org/packages/c0/45/ed2798718910fe6eb3ba574082aaceff4528e6323f9a8570be0f7028d8e9/frozenlist-1.7.0-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:6aeac207a759d0dedd2e40745575ae32ab30926ff4fa49b1635def65806fddee", size = 225132, upload-time = "2025-06-09T23:01:15.264Z" }, - { url = "https://files.pythonhosted.org/packages/ba/e2/8417ae0f8eacb1d071d4950f32f229aa6bf68ab69aab797b72a07ea68d4f/frozenlist-1.7.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bd8c4e58ad14b4fa7802b8be49d47993182fdd4023393899632c88fd8cd994eb", size = 237638, upload-time = "2025-06-09T23:01:16.752Z" }, - { url = "https://files.pythonhosted.org/packages/f8/b7/2ace5450ce85f2af05a871b8c8719b341294775a0a6c5585d5e6170f2ce7/frozenlist-1.7.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:04fb24d104f425da3540ed83cbfc31388a586a7696142004c577fa61c6298c3f", size = 233539, upload-time = "2025-06-09T23:01:18.202Z" }, - { url = "https://files.pythonhosted.org/packages/46/b9/6989292c5539553dba63f3c83dc4598186ab2888f67c0dc1d917e6887db6/frozenlist-1.7.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6a5c505156368e4ea6b53b5ac23c92d7edc864537ff911d2fb24c140bb175e60", size = 215646, upload-time = "2025-06-09T23:01:19.649Z" }, - { url = "https://files.pythonhosted.org/packages/72/31/bc8c5c99c7818293458fe745dab4fd5730ff49697ccc82b554eb69f16a24/frozenlist-1.7.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8bd7eb96a675f18aa5c553eb7ddc24a43c8c18f22e1f9925528128c052cdbe00", size = 232233, upload-time = "2025-06-09T23:01:21.175Z" }, - { url = "https://files.pythonhosted.org/packages/59/52/460db4d7ba0811b9ccb85af996019f5d70831f2f5f255f7cc61f86199795/frozenlist-1.7.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:05579bf020096fe05a764f1f84cd104a12f78eaab68842d036772dc6d4870b4b", size = 227996, upload-time = "2025-06-09T23:01:23.098Z" }, - { url = "https://files.pythonhosted.org/packages/ba/c9/f4b39e904c03927b7ecf891804fd3b4df3db29b9e487c6418e37988d6e9d/frozenlist-1.7.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:376b6222d114e97eeec13d46c486facd41d4f43bab626b7c3f6a8b4e81a5192c", size = 242280, upload-time = "2025-06-09T23:01:24.808Z" }, - { url = "https://files.pythonhosted.org/packages/b8/33/3f8d6ced42f162d743e3517781566b8481322be321b486d9d262adf70bfb/frozenlist-1.7.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:0aa7e176ebe115379b5b1c95b4096fb1c17cce0847402e227e712c27bdb5a949", size = 217717, upload-time = "2025-06-09T23:01:26.28Z" }, - { url = "https://files.pythonhosted.org/packages/3e/e8/ad683e75da6ccef50d0ab0c2b2324b32f84fc88ceee778ed79b8e2d2fe2e/frozenlist-1.7.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:3fbba20e662b9c2130dc771e332a99eff5da078b2b2648153a40669a6d0e36ca", size = 236644, upload-time = "2025-06-09T23:01:27.887Z" }, - { url = "https://files.pythonhosted.org/packages/b2/14/8d19ccdd3799310722195a72ac94ddc677541fb4bef4091d8e7775752360/frozenlist-1.7.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:f3f4410a0a601d349dd406b5713fec59b4cee7e71678d5b17edda7f4655a940b", size = 238879, upload-time = "2025-06-09T23:01:29.524Z" }, - { url = "https://files.pythonhosted.org/packages/ce/13/c12bf657494c2fd1079a48b2db49fa4196325909249a52d8f09bc9123fd7/frozenlist-1.7.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e2cdfaaec6a2f9327bf43c933c0319a7c429058e8537c508964a133dffee412e", size = 232502, upload-time = "2025-06-09T23:01:31.287Z" }, - { url = "https://files.pythonhosted.org/packages/d7/8b/e7f9dfde869825489382bc0d512c15e96d3964180c9499efcec72e85db7e/frozenlist-1.7.0-cp313-cp313-win32.whl", hash = "sha256:5fc4df05a6591c7768459caba1b342d9ec23fa16195e744939ba5914596ae3e1", size = 39169, upload-time = "2025-06-09T23:01:35.503Z" }, - { url = "https://files.pythonhosted.org/packages/35/89/a487a98d94205d85745080a37860ff5744b9820a2c9acbcdd9440bfddf98/frozenlist-1.7.0-cp313-cp313-win_amd64.whl", hash = "sha256:52109052b9791a3e6b5d1b65f4b909703984b770694d3eb64fad124c835d7cba", size = 43219, upload-time = "2025-06-09T23:01:36.784Z" }, - { url = "https://files.pythonhosted.org/packages/56/d5/5c4cf2319a49eddd9dd7145e66c4866bdc6f3dbc67ca3d59685149c11e0d/frozenlist-1.7.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:a6f86e4193bb0e235ef6ce3dde5cbabed887e0b11f516ce8a0f4d3b33078ec2d", size = 84345, upload-time = "2025-06-09T23:01:38.295Z" }, - { url = "https://files.pythonhosted.org/packages/a4/7d/ec2c1e1dc16b85bc9d526009961953df9cec8481b6886debb36ec9107799/frozenlist-1.7.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:82d664628865abeb32d90ae497fb93df398a69bb3434463d172b80fc25b0dd7d", size = 48880, upload-time = "2025-06-09T23:01:39.887Z" }, - { url = "https://files.pythonhosted.org/packages/69/86/f9596807b03de126e11e7d42ac91e3d0b19a6599c714a1989a4e85eeefc4/frozenlist-1.7.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:912a7e8375a1c9a68325a902f3953191b7b292aa3c3fb0d71a216221deca460b", size = 48498, upload-time = "2025-06-09T23:01:41.318Z" }, - { url = "https://files.pythonhosted.org/packages/5e/cb/df6de220f5036001005f2d726b789b2c0b65f2363b104bbc16f5be8084f8/frozenlist-1.7.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9537c2777167488d539bc5de2ad262efc44388230e5118868e172dd4a552b146", size = 292296, upload-time = "2025-06-09T23:01:42.685Z" }, - { url = "https://files.pythonhosted.org/packages/83/1f/de84c642f17c8f851a2905cee2dae401e5e0daca9b5ef121e120e19aa825/frozenlist-1.7.0-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:f34560fb1b4c3e30ba35fa9a13894ba39e5acfc5f60f57d8accde65f46cc5e74", size = 273103, upload-time = "2025-06-09T23:01:44.166Z" }, - { url = "https://files.pythonhosted.org/packages/88/3c/c840bfa474ba3fa13c772b93070893c6e9d5c0350885760376cbe3b6c1b3/frozenlist-1.7.0-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:acd03d224b0175f5a850edc104ac19040d35419eddad04e7cf2d5986d98427f1", size = 292869, upload-time = "2025-06-09T23:01:45.681Z" }, - { url = "https://files.pythonhosted.org/packages/a6/1c/3efa6e7d5a39a1d5ef0abeb51c48fb657765794a46cf124e5aca2c7a592c/frozenlist-1.7.0-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f2038310bc582f3d6a09b3816ab01737d60bf7b1ec70f5356b09e84fb7408ab1", size = 291467, upload-time = "2025-06-09T23:01:47.234Z" }, - { url = "https://files.pythonhosted.org/packages/4f/00/d5c5e09d4922c395e2f2f6b79b9a20dab4b67daaf78ab92e7729341f61f6/frozenlist-1.7.0-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b8c05e4c8e5f36e5e088caa1bf78a687528f83c043706640a92cb76cd6999384", size = 266028, upload-time = "2025-06-09T23:01:48.819Z" }, - { url = "https://files.pythonhosted.org/packages/4e/27/72765be905619dfde25a7f33813ac0341eb6b076abede17a2e3fbfade0cb/frozenlist-1.7.0-cp313-cp313t-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:765bb588c86e47d0b68f23c1bee323d4b703218037765dcf3f25c838c6fecceb", size = 284294, upload-time = "2025-06-09T23:01:50.394Z" }, - { url = "https://files.pythonhosted.org/packages/88/67/c94103a23001b17808eb7dd1200c156bb69fb68e63fcf0693dde4cd6228c/frozenlist-1.7.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:32dc2e08c67d86d0969714dd484fd60ff08ff81d1a1e40a77dd34a387e6ebc0c", size = 281898, upload-time = "2025-06-09T23:01:52.234Z" }, - { url = "https://files.pythonhosted.org/packages/42/34/a3e2c00c00f9e2a9db5653bca3fec306349e71aff14ae45ecc6d0951dd24/frozenlist-1.7.0-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:c0303e597eb5a5321b4de9c68e9845ac8f290d2ab3f3e2c864437d3c5a30cd65", size = 290465, upload-time = "2025-06-09T23:01:53.788Z" }, - { url = "https://files.pythonhosted.org/packages/bb/73/f89b7fbce8b0b0c095d82b008afd0590f71ccb3dee6eee41791cf8cd25fd/frozenlist-1.7.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:a47f2abb4e29b3a8d0b530f7c3598badc6b134562b1a5caee867f7c62fee51e3", size = 266385, upload-time = "2025-06-09T23:01:55.769Z" }, - { url = "https://files.pythonhosted.org/packages/cd/45/e365fdb554159462ca12df54bc59bfa7a9a273ecc21e99e72e597564d1ae/frozenlist-1.7.0-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:3d688126c242a6fabbd92e02633414d40f50bb6002fa4cf995a1d18051525657", size = 288771, upload-time = "2025-06-09T23:01:57.4Z" }, - { url = "https://files.pythonhosted.org/packages/00/11/47b6117002a0e904f004d70ec5194fe9144f117c33c851e3d51c765962d0/frozenlist-1.7.0-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:4e7e9652b3d367c7bd449a727dc79d5043f48b88d0cbfd4f9f1060cf2b414104", size = 288206, upload-time = "2025-06-09T23:01:58.936Z" }, - { url = "https://files.pythonhosted.org/packages/40/37/5f9f3c3fd7f7746082ec67bcdc204db72dad081f4f83a503d33220a92973/frozenlist-1.7.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:1a85e345b4c43db8b842cab1feb41be5cc0b10a1830e6295b69d7310f99becaf", size = 282620, upload-time = "2025-06-09T23:02:00.493Z" }, - { url = "https://files.pythonhosted.org/packages/0b/31/8fbc5af2d183bff20f21aa743b4088eac4445d2bb1cdece449ae80e4e2d1/frozenlist-1.7.0-cp313-cp313t-win32.whl", hash = "sha256:3a14027124ddb70dfcee5148979998066897e79f89f64b13328595c4bdf77c81", size = 43059, upload-time = "2025-06-09T23:02:02.072Z" }, - { url = "https://files.pythonhosted.org/packages/bb/ed/41956f52105b8dbc26e457c5705340c67c8cc2b79f394b79bffc09d0e938/frozenlist-1.7.0-cp313-cp313t-win_amd64.whl", hash = "sha256:3bf8010d71d4507775f658e9823210b7427be36625b387221642725b515dcf3e", size = 47516, upload-time = "2025-06-09T23:02:03.779Z" }, - { url = "https://files.pythonhosted.org/packages/dd/b1/ee59496f51cd244039330015d60f13ce5a54a0f2bd8d79e4a4a375ab7469/frozenlist-1.7.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:cea3dbd15aea1341ea2de490574a4a37ca080b2ae24e4b4f4b51b9057b4c3630", size = 82434, upload-time = "2025-06-09T23:02:05.195Z" }, - { url = "https://files.pythonhosted.org/packages/75/e1/d518391ce36a6279b3fa5bc14327dde80bcb646bb50d059c6ca0756b8d05/frozenlist-1.7.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7d536ee086b23fecc36c2073c371572374ff50ef4db515e4e503925361c24f71", size = 48232, upload-time = "2025-06-09T23:02:07.728Z" }, - { url = "https://files.pythonhosted.org/packages/b7/8d/a0d04f28b6e821a9685c22e67b5fb798a5a7b68752f104bfbc2dccf080c4/frozenlist-1.7.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:dfcebf56f703cb2e346315431699f00db126d158455e513bd14089d992101e44", size = 47186, upload-time = "2025-06-09T23:02:09.243Z" }, - { url = "https://files.pythonhosted.org/packages/93/3a/a5334c0535c8b7c78eeabda1579179e44fe3d644e07118e59a2276dedaf1/frozenlist-1.7.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:974c5336e61d6e7eb1ea5b929cb645e882aadab0095c5a6974a111e6479f8878", size = 226617, upload-time = "2025-06-09T23:02:10.949Z" }, - { url = "https://files.pythonhosted.org/packages/0a/67/8258d971f519dc3f278c55069a775096cda6610a267b53f6248152b72b2f/frozenlist-1.7.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c70db4a0ab5ab20878432c40563573229a7ed9241506181bba12f6b7d0dc41cb", size = 224179, upload-time = "2025-06-09T23:02:12.603Z" }, - { url = "https://files.pythonhosted.org/packages/fc/89/8225905bf889b97c6d935dd3aeb45668461e59d415cb019619383a8a7c3b/frozenlist-1.7.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1137b78384eebaf70560a36b7b229f752fb64d463d38d1304939984d5cb887b6", size = 235783, upload-time = "2025-06-09T23:02:14.678Z" }, - { url = "https://files.pythonhosted.org/packages/54/6e/ef52375aa93d4bc510d061df06205fa6dcfd94cd631dd22956b09128f0d4/frozenlist-1.7.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e793a9f01b3e8b5c0bc646fb59140ce0efcc580d22a3468d70766091beb81b35", size = 229210, upload-time = "2025-06-09T23:02:16.313Z" }, - { url = "https://files.pythonhosted.org/packages/ee/55/62c87d1a6547bfbcd645df10432c129100c5bd0fd92a384de6e3378b07c1/frozenlist-1.7.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:74739ba8e4e38221d2c5c03d90a7e542cb8ad681915f4ca8f68d04f810ee0a87", size = 215994, upload-time = "2025-06-09T23:02:17.9Z" }, - { url = "https://files.pythonhosted.org/packages/45/d2/263fea1f658b8ad648c7d94d18a87bca7e8c67bd6a1bbf5445b1bd5b158c/frozenlist-1.7.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1e63344c4e929b1a01e29bc184bbb5fd82954869033765bfe8d65d09e336a677", size = 225122, upload-time = "2025-06-09T23:02:19.479Z" }, - { url = "https://files.pythonhosted.org/packages/7b/22/7145e35d12fb368d92124f679bea87309495e2e9ddf14c6533990cb69218/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2ea2a7369eb76de2217a842f22087913cdf75f63cf1307b9024ab82dfb525938", size = 224019, upload-time = "2025-06-09T23:02:20.969Z" }, - { url = "https://files.pythonhosted.org/packages/44/1e/7dae8c54301beb87bcafc6144b9a103bfd2c8f38078c7902984c9a0c4e5b/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:836b42f472a0e006e02499cef9352ce8097f33df43baaba3e0a28a964c26c7d2", size = 239925, upload-time = "2025-06-09T23:02:22.466Z" }, - { url = "https://files.pythonhosted.org/packages/4b/1e/99c93e54aa382e949a98976a73b9b20c3aae6d9d893f31bbe4991f64e3a8/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:e22b9a99741294b2571667c07d9f8cceec07cb92aae5ccda39ea1b6052ed4319", size = 220881, upload-time = "2025-06-09T23:02:24.521Z" }, - { url = "https://files.pythonhosted.org/packages/5e/9c/ca5105fa7fb5abdfa8837581be790447ae051da75d32f25c8f81082ffc45/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:9a19e85cc503d958abe5218953df722748d87172f71b73cf3c9257a91b999890", size = 234046, upload-time = "2025-06-09T23:02:26.206Z" }, - { url = "https://files.pythonhosted.org/packages/8d/4d/e99014756093b4ddbb67fb8f0df11fe7a415760d69ace98e2ac6d5d43402/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:f22dac33bb3ee8fe3e013aa7b91dc12f60d61d05b7fe32191ffa84c3aafe77bd", size = 235756, upload-time = "2025-06-09T23:02:27.79Z" }, - { url = "https://files.pythonhosted.org/packages/8b/72/a19a40bcdaa28a51add2aaa3a1a294ec357f36f27bd836a012e070c5e8a5/frozenlist-1.7.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:9ccec739a99e4ccf664ea0775149f2749b8a6418eb5b8384b4dc0a7d15d304cb", size = 222894, upload-time = "2025-06-09T23:02:29.848Z" }, - { url = "https://files.pythonhosted.org/packages/08/49/0042469993e023a758af81db68c76907cd29e847d772334d4d201cbe9a42/frozenlist-1.7.0-cp39-cp39-win32.whl", hash = "sha256:b3950f11058310008a87757f3eee16a8e1ca97979833239439586857bc25482e", size = 39848, upload-time = "2025-06-09T23:02:31.413Z" }, - { url = "https://files.pythonhosted.org/packages/5a/45/827d86ee475c877f5f766fbc23fb6acb6fada9e52f1c9720e2ba3eae32da/frozenlist-1.7.0-cp39-cp39-win_amd64.whl", hash = "sha256:43a82fce6769c70f2f5a06248b614a7d268080a9d20f7457ef10ecee5af82b63", size = 44102, upload-time = "2025-06-09T23:02:32.808Z" }, - { url = "https://files.pythonhosted.org/packages/ee/45/b82e3c16be2182bff01179db177fe144d58b5dc787a7d4492c6ed8b9317f/frozenlist-1.7.0-py3-none-any.whl", hash = "sha256:9a5af342e34f7e97caf8c995864c7a396418ae2859cc6fdf1b1073020d516a7e", size = 13106, upload-time = "2025-06-09T23:02:34.204Z" }, + { url = "https://files.pythonhosted.org/packages/83/4a/557715d5047da48d54e659203b9335be7bfaafda2c3f627b7c47e0b3aaf3/frozenlist-1.8.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:b37f6d31b3dcea7deb5e9696e529a6aa4a898adc33db82da12e4c60a7c4d2011", size = 86230, upload-time = "2025-10-06T05:35:23.699Z" }, + { url = "https://files.pythonhosted.org/packages/a2/fb/c85f9fed3ea8fe8740e5b46a59cc141c23b842eca617da8876cfce5f760e/frozenlist-1.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ef2b7b394f208233e471abc541cc6991f907ffd47dc72584acee3147899d6565", size = 49621, upload-time = "2025-10-06T05:35:25.341Z" }, + { url = "https://files.pythonhosted.org/packages/63/70/26ca3f06aace16f2352796b08704338d74b6d1a24ca38f2771afbb7ed915/frozenlist-1.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a88f062f072d1589b7b46e951698950e7da00442fc1cacbe17e19e025dc327ad", size = 49889, upload-time = "2025-10-06T05:35:26.797Z" }, + { url = "https://files.pythonhosted.org/packages/5d/ed/c7895fd2fde7f3ee70d248175f9b6cdf792fb741ab92dc59cd9ef3bd241b/frozenlist-1.8.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:f57fb59d9f385710aa7060e89410aeb5058b99e62f4d16b08b91986b9a2140c2", size = 219464, upload-time = "2025-10-06T05:35:28.254Z" }, + { url = "https://files.pythonhosted.org/packages/6b/83/4d587dccbfca74cb8b810472392ad62bfa100bf8108c7223eb4c4fa2f7b3/frozenlist-1.8.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:799345ab092bee59f01a915620b5d014698547afd011e691a208637312db9186", size = 221649, upload-time = "2025-10-06T05:35:29.454Z" }, + { url = "https://files.pythonhosted.org/packages/6a/c6/fd3b9cd046ec5fff9dab66831083bc2077006a874a2d3d9247dea93ddf7e/frozenlist-1.8.0-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c23c3ff005322a6e16f71bf8692fcf4d5a304aaafe1e262c98c6d4adc7be863e", size = 219188, upload-time = "2025-10-06T05:35:30.951Z" }, + { url = "https://files.pythonhosted.org/packages/ce/80/6693f55eb2e085fc8afb28cf611448fb5b90e98e068fa1d1b8d8e66e5c7d/frozenlist-1.8.0-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8a76ea0f0b9dfa06f254ee06053d93a600865b3274358ca48a352ce4f0798450", size = 231748, upload-time = "2025-10-06T05:35:32.101Z" }, + { url = "https://files.pythonhosted.org/packages/97/d6/e9459f7c5183854abd989ba384fe0cc1a0fb795a83c033f0571ec5933ca4/frozenlist-1.8.0-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c7366fe1418a6133d5aa824ee53d406550110984de7637d65a178010f759c6ef", size = 236351, upload-time = "2025-10-06T05:35:33.834Z" }, + { url = "https://files.pythonhosted.org/packages/97/92/24e97474b65c0262e9ecd076e826bfd1d3074adcc165a256e42e7b8a7249/frozenlist-1.8.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:13d23a45c4cebade99340c4165bd90eeb4a56c6d8a9d8aa49568cac19a6d0dc4", size = 218767, upload-time = "2025-10-06T05:35:35.205Z" }, + { url = "https://files.pythonhosted.org/packages/ee/bf/dc394a097508f15abff383c5108cb8ad880d1f64a725ed3b90d5c2fbf0bb/frozenlist-1.8.0-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:e4a3408834f65da56c83528fb52ce7911484f0d1eaf7b761fc66001db1646eff", size = 235887, upload-time = "2025-10-06T05:35:36.354Z" }, + { url = "https://files.pythonhosted.org/packages/40/90/25b201b9c015dbc999a5baf475a257010471a1fa8c200c843fd4abbee725/frozenlist-1.8.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:42145cd2748ca39f32801dad54aeea10039da6f86e303659db90db1c4b614c8c", size = 228785, upload-time = "2025-10-06T05:35:37.949Z" }, + { url = "https://files.pythonhosted.org/packages/84/f4/b5bc148df03082f05d2dd30c089e269acdbe251ac9a9cf4e727b2dbb8a3d/frozenlist-1.8.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:e2de870d16a7a53901e41b64ffdf26f2fbb8917b3e6ebf398098d72c5b20bd7f", size = 230312, upload-time = "2025-10-06T05:35:39.178Z" }, + { url = "https://files.pythonhosted.org/packages/db/4b/87e95b5d15097c302430e647136b7d7ab2398a702390cf4c8601975709e7/frozenlist-1.8.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:20e63c9493d33ee48536600d1a5c95eefc870cd71e7ab037763d1fbb89cc51e7", size = 217650, upload-time = "2025-10-06T05:35:40.377Z" }, + { url = "https://files.pythonhosted.org/packages/e5/70/78a0315d1fea97120591a83e0acd644da638c872f142fd72a6cebee825f3/frozenlist-1.8.0-cp310-cp310-win32.whl", hash = "sha256:adbeebaebae3526afc3c96fad434367cafbfd1b25d72369a9e5858453b1bb71a", size = 39659, upload-time = "2025-10-06T05:35:41.863Z" }, + { url = "https://files.pythonhosted.org/packages/66/aa/3f04523fb189a00e147e60c5b2205126118f216b0aa908035c45336e27e4/frozenlist-1.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:667c3777ca571e5dbeb76f331562ff98b957431df140b54c85fd4d52eea8d8f6", size = 43837, upload-time = "2025-10-06T05:35:43.205Z" }, + { url = "https://files.pythonhosted.org/packages/39/75/1135feecdd7c336938bd55b4dc3b0dfc46d85b9be12ef2628574b28de776/frozenlist-1.8.0-cp310-cp310-win_arm64.whl", hash = "sha256:80f85f0a7cc86e7a54c46d99c9e1318ff01f4687c172ede30fd52d19d1da1c8e", size = 39989, upload-time = "2025-10-06T05:35:44.596Z" }, + { url = "https://files.pythonhosted.org/packages/bc/03/077f869d540370db12165c0aa51640a873fb661d8b315d1d4d67b284d7ac/frozenlist-1.8.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:09474e9831bc2b2199fad6da3c14c7b0fbdd377cce9d3d77131be28906cb7d84", size = 86912, upload-time = "2025-10-06T05:35:45.98Z" }, + { url = "https://files.pythonhosted.org/packages/df/b5/7610b6bd13e4ae77b96ba85abea1c8cb249683217ef09ac9e0ae93f25a91/frozenlist-1.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:17c883ab0ab67200b5f964d2b9ed6b00971917d5d8a92df149dc2c9779208ee9", size = 50046, upload-time = "2025-10-06T05:35:47.009Z" }, + { url = "https://files.pythonhosted.org/packages/6e/ef/0e8f1fe32f8a53dd26bdd1f9347efe0778b0fddf62789ea683f4cc7d787d/frozenlist-1.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:fa47e444b8ba08fffd1c18e8cdb9a75db1b6a27f17507522834ad13ed5922b93", size = 50119, upload-time = "2025-10-06T05:35:48.38Z" }, + { url = "https://files.pythonhosted.org/packages/11/b1/71a477adc7c36e5fb628245dfbdea2166feae310757dea848d02bd0689fd/frozenlist-1.8.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:2552f44204b744fba866e573be4c1f9048d6a324dfe14475103fd51613eb1d1f", size = 231067, upload-time = "2025-10-06T05:35:49.97Z" }, + { url = "https://files.pythonhosted.org/packages/45/7e/afe40eca3a2dc19b9904c0f5d7edfe82b5304cb831391edec0ac04af94c2/frozenlist-1.8.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:957e7c38f250991e48a9a73e6423db1bb9dd14e722a10f6b8bb8e16a0f55f695", size = 233160, upload-time = "2025-10-06T05:35:51.729Z" }, + { url = "https://files.pythonhosted.org/packages/a6/aa/7416eac95603ce428679d273255ffc7c998d4132cfae200103f164b108aa/frozenlist-1.8.0-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:8585e3bb2cdea02fc88ffa245069c36555557ad3609e83be0ec71f54fd4abb52", size = 228544, upload-time = "2025-10-06T05:35:53.246Z" }, + { url = "https://files.pythonhosted.org/packages/8b/3d/2a2d1f683d55ac7e3875e4263d28410063e738384d3adc294f5ff3d7105e/frozenlist-1.8.0-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:edee74874ce20a373d62dc28b0b18b93f645633c2943fd90ee9d898550770581", size = 243797, upload-time = "2025-10-06T05:35:54.497Z" }, + { url = "https://files.pythonhosted.org/packages/78/1e/2d5565b589e580c296d3bb54da08d206e797d941a83a6fdea42af23be79c/frozenlist-1.8.0-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c9a63152fe95756b85f31186bddf42e4c02c6321207fd6601a1c89ebac4fe567", size = 247923, upload-time = "2025-10-06T05:35:55.861Z" }, + { url = "https://files.pythonhosted.org/packages/aa/c3/65872fcf1d326a7f101ad4d86285c403c87be7d832b7470b77f6d2ed5ddc/frozenlist-1.8.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:b6db2185db9be0a04fecf2f241c70b63b1a242e2805be291855078f2b404dd6b", size = 230886, upload-time = "2025-10-06T05:35:57.399Z" }, + { url = "https://files.pythonhosted.org/packages/a0/76/ac9ced601d62f6956f03cc794f9e04c81719509f85255abf96e2510f4265/frozenlist-1.8.0-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:f4be2e3d8bc8aabd566f8d5b8ba7ecc09249d74ba3c9ed52e54dc23a293f0b92", size = 245731, upload-time = "2025-10-06T05:35:58.563Z" }, + { url = "https://files.pythonhosted.org/packages/b9/49/ecccb5f2598daf0b4a1415497eba4c33c1e8ce07495eb07d2860c731b8d5/frozenlist-1.8.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:c8d1634419f39ea6f5c427ea2f90ca85126b54b50837f31497f3bf38266e853d", size = 241544, upload-time = "2025-10-06T05:35:59.719Z" }, + { url = "https://files.pythonhosted.org/packages/53/4b/ddf24113323c0bbcc54cb38c8b8916f1da7165e07b8e24a717b4a12cbf10/frozenlist-1.8.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:1a7fa382a4a223773ed64242dbe1c9c326ec09457e6b8428efb4118c685c3dfd", size = 241806, upload-time = "2025-10-06T05:36:00.959Z" }, + { url = "https://files.pythonhosted.org/packages/a7/fb/9b9a084d73c67175484ba2789a59f8eebebd0827d186a8102005ce41e1ba/frozenlist-1.8.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:11847b53d722050808926e785df837353bd4d75f1d494377e59b23594d834967", size = 229382, upload-time = "2025-10-06T05:36:02.22Z" }, + { url = "https://files.pythonhosted.org/packages/95/a3/c8fb25aac55bf5e12dae5c5aa6a98f85d436c1dc658f21c3ac73f9fa95e5/frozenlist-1.8.0-cp311-cp311-win32.whl", hash = "sha256:27c6e8077956cf73eadd514be8fb04d77fc946a7fe9f7fe167648b0b9085cc25", size = 39647, upload-time = "2025-10-06T05:36:03.409Z" }, + { url = "https://files.pythonhosted.org/packages/0a/f5/603d0d6a02cfd4c8f2a095a54672b3cf967ad688a60fb9faf04fc4887f65/frozenlist-1.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:ac913f8403b36a2c8610bbfd25b8013488533e71e62b4b4adce9c86c8cea905b", size = 44064, upload-time = "2025-10-06T05:36:04.368Z" }, + { url = "https://files.pythonhosted.org/packages/5d/16/c2c9ab44e181f043a86f9a8f84d5124b62dbcb3a02c0977ec72b9ac1d3e0/frozenlist-1.8.0-cp311-cp311-win_arm64.whl", hash = "sha256:d4d3214a0f8394edfa3e303136d0575eece0745ff2b47bd2cb2e66dd92d4351a", size = 39937, upload-time = "2025-10-06T05:36:05.669Z" }, + { url = "https://files.pythonhosted.org/packages/69/29/948b9aa87e75820a38650af445d2ef2b6b8a6fab1a23b6bb9e4ef0be2d59/frozenlist-1.8.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:78f7b9e5d6f2fdb88cdde9440dc147259b62b9d3b019924def9f6478be254ac1", size = 87782, upload-time = "2025-10-06T05:36:06.649Z" }, + { url = "https://files.pythonhosted.org/packages/64/80/4f6e318ee2a7c0750ed724fa33a4bdf1eacdc5a39a7a24e818a773cd91af/frozenlist-1.8.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:229bf37d2e4acdaf808fd3f06e854a4a7a3661e871b10dc1f8f1896a3b05f18b", size = 50594, upload-time = "2025-10-06T05:36:07.69Z" }, + { url = "https://files.pythonhosted.org/packages/2b/94/5c8a2b50a496b11dd519f4a24cb5496cf125681dd99e94c604ccdea9419a/frozenlist-1.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f833670942247a14eafbb675458b4e61c82e002a148f49e68257b79296e865c4", size = 50448, upload-time = "2025-10-06T05:36:08.78Z" }, + { url = "https://files.pythonhosted.org/packages/6a/bd/d91c5e39f490a49df14320f4e8c80161cfcce09f1e2cde1edd16a551abb3/frozenlist-1.8.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:494a5952b1c597ba44e0e78113a7266e656b9794eec897b19ead706bd7074383", size = 242411, upload-time = "2025-10-06T05:36:09.801Z" }, + { url = "https://files.pythonhosted.org/packages/8f/83/f61505a05109ef3293dfb1ff594d13d64a2324ac3482be2cedc2be818256/frozenlist-1.8.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:96f423a119f4777a4a056b66ce11527366a8bb92f54e541ade21f2374433f6d4", size = 243014, upload-time = "2025-10-06T05:36:11.394Z" }, + { url = "https://files.pythonhosted.org/packages/d8/cb/cb6c7b0f7d4023ddda30cf56b8b17494eb3a79e3fda666bf735f63118b35/frozenlist-1.8.0-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3462dd9475af2025c31cc61be6652dfa25cbfb56cbbf52f4ccfe029f38decaf8", size = 234909, upload-time = "2025-10-06T05:36:12.598Z" }, + { url = "https://files.pythonhosted.org/packages/31/c5/cd7a1f3b8b34af009fb17d4123c5a778b44ae2804e3ad6b86204255f9ec5/frozenlist-1.8.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c4c800524c9cd9bac5166cd6f55285957fcfc907db323e193f2afcd4d9abd69b", size = 250049, upload-time = "2025-10-06T05:36:14.065Z" }, + { url = "https://files.pythonhosted.org/packages/c0/01/2f95d3b416c584a1e7f0e1d6d31998c4a795f7544069ee2e0962a4b60740/frozenlist-1.8.0-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d6a5df73acd3399d893dafc71663ad22534b5aa4f94e8a2fabfe856c3c1b6a52", size = 256485, upload-time = "2025-10-06T05:36:15.39Z" }, + { url = "https://files.pythonhosted.org/packages/ce/03/024bf7720b3abaebcff6d0793d73c154237b85bdf67b7ed55e5e9596dc9a/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:405e8fe955c2280ce66428b3ca55e12b3c4e9c336fb2103a4937e891c69a4a29", size = 237619, upload-time = "2025-10-06T05:36:16.558Z" }, + { url = "https://files.pythonhosted.org/packages/69/fa/f8abdfe7d76b731f5d8bd217827cf6764d4f1d9763407e42717b4bed50a0/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:908bd3f6439f2fef9e85031b59fd4f1297af54415fb60e4254a95f75b3cab3f3", size = 250320, upload-time = "2025-10-06T05:36:17.821Z" }, + { url = "https://files.pythonhosted.org/packages/f5/3c/b051329f718b463b22613e269ad72138cc256c540f78a6de89452803a47d/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:294e487f9ec720bd8ffcebc99d575f7eff3568a08a253d1ee1a0378754b74143", size = 246820, upload-time = "2025-10-06T05:36:19.046Z" }, + { url = "https://files.pythonhosted.org/packages/0f/ae/58282e8f98e444b3f4dd42448ff36fa38bef29e40d40f330b22e7108f565/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:74c51543498289c0c43656701be6b077f4b265868fa7f8a8859c197006efb608", size = 250518, upload-time = "2025-10-06T05:36:20.763Z" }, + { url = "https://files.pythonhosted.org/packages/8f/96/007e5944694d66123183845a106547a15944fbbb7154788cbf7272789536/frozenlist-1.8.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:776f352e8329135506a1d6bf16ac3f87bc25b28e765949282dcc627af36123aa", size = 239096, upload-time = "2025-10-06T05:36:22.129Z" }, + { url = "https://files.pythonhosted.org/packages/66/bb/852b9d6db2fa40be96f29c0d1205c306288f0684df8fd26ca1951d461a56/frozenlist-1.8.0-cp312-cp312-win32.whl", hash = "sha256:433403ae80709741ce34038da08511d4a77062aa924baf411ef73d1146e74faf", size = 39985, upload-time = "2025-10-06T05:36:23.661Z" }, + { url = "https://files.pythonhosted.org/packages/b8/af/38e51a553dd66eb064cdf193841f16f077585d4d28394c2fa6235cb41765/frozenlist-1.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:34187385b08f866104f0c0617404c8eb08165ab1272e884abc89c112e9c00746", size = 44591, upload-time = "2025-10-06T05:36:24.958Z" }, + { url = "https://files.pythonhosted.org/packages/a7/06/1dc65480ab147339fecc70797e9c2f69d9cea9cf38934ce08df070fdb9cb/frozenlist-1.8.0-cp312-cp312-win_arm64.whl", hash = "sha256:fe3c58d2f5db5fbd18c2987cba06d51b0529f52bc3a6cdc33d3f4eab725104bd", size = 40102, upload-time = "2025-10-06T05:36:26.333Z" }, + { url = "https://files.pythonhosted.org/packages/2d/40/0832c31a37d60f60ed79e9dfb5a92e1e2af4f40a16a29abcc7992af9edff/frozenlist-1.8.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:8d92f1a84bb12d9e56f818b3a746f3efba93c1b63c8387a73dde655e1e42282a", size = 85717, upload-time = "2025-10-06T05:36:27.341Z" }, + { url = "https://files.pythonhosted.org/packages/30/ba/b0b3de23f40bc55a7057bd38434e25c34fa48e17f20ee273bbde5e0650f3/frozenlist-1.8.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:96153e77a591c8adc2ee805756c61f59fef4cf4073a9275ee86fe8cba41241f7", size = 49651, upload-time = "2025-10-06T05:36:28.855Z" }, + { url = "https://files.pythonhosted.org/packages/0c/ab/6e5080ee374f875296c4243c381bbdef97a9ac39c6e3ce1d5f7d42cb78d6/frozenlist-1.8.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f21f00a91358803399890ab167098c131ec2ddd5f8f5fd5fe9c9f2c6fcd91e40", size = 49417, upload-time = "2025-10-06T05:36:29.877Z" }, + { url = "https://files.pythonhosted.org/packages/d5/4e/e4691508f9477ce67da2015d8c00acd751e6287739123113a9fca6f1604e/frozenlist-1.8.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:fb30f9626572a76dfe4293c7194a09fb1fe93ba94c7d4f720dfae3b646b45027", size = 234391, upload-time = "2025-10-06T05:36:31.301Z" }, + { url = "https://files.pythonhosted.org/packages/40/76/c202df58e3acdf12969a7895fd6f3bc016c642e6726aa63bd3025e0fc71c/frozenlist-1.8.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:eaa352d7047a31d87dafcacbabe89df0aa506abb5b1b85a2fb91bc3faa02d822", size = 233048, upload-time = "2025-10-06T05:36:32.531Z" }, + { url = "https://files.pythonhosted.org/packages/f9/c0/8746afb90f17b73ca5979c7a3958116e105ff796e718575175319b5bb4ce/frozenlist-1.8.0-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:03ae967b4e297f58f8c774c7eabcce57fe3c2434817d4385c50661845a058121", size = 226549, upload-time = "2025-10-06T05:36:33.706Z" }, + { url = "https://files.pythonhosted.org/packages/7e/eb/4c7eefc718ff72f9b6c4893291abaae5fbc0c82226a32dcd8ef4f7a5dbef/frozenlist-1.8.0-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f6292f1de555ffcc675941d65fffffb0a5bcd992905015f85d0592201793e0e5", size = 239833, upload-time = "2025-10-06T05:36:34.947Z" }, + { url = "https://files.pythonhosted.org/packages/c2/4e/e5c02187cf704224f8b21bee886f3d713ca379535f16893233b9d672ea71/frozenlist-1.8.0-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:29548f9b5b5e3460ce7378144c3010363d8035cea44bc0bf02d57f5a685e084e", size = 245363, upload-time = "2025-10-06T05:36:36.534Z" }, + { url = "https://files.pythonhosted.org/packages/1f/96/cb85ec608464472e82ad37a17f844889c36100eed57bea094518bf270692/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ec3cc8c5d4084591b4237c0a272cc4f50a5b03396a47d9caaf76f5d7b38a4f11", size = 229314, upload-time = "2025-10-06T05:36:38.582Z" }, + { url = "https://files.pythonhosted.org/packages/5d/6f/4ae69c550e4cee66b57887daeebe006fe985917c01d0fff9caab9883f6d0/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:517279f58009d0b1f2e7c1b130b377a349405da3f7621ed6bfae50b10adf20c1", size = 243365, upload-time = "2025-10-06T05:36:40.152Z" }, + { url = "https://files.pythonhosted.org/packages/7a/58/afd56de246cf11780a40a2c28dc7cbabbf06337cc8ddb1c780a2d97e88d8/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:db1e72ede2d0d7ccb213f218df6a078a9c09a7de257c2fe8fcef16d5925230b1", size = 237763, upload-time = "2025-10-06T05:36:41.355Z" }, + { url = "https://files.pythonhosted.org/packages/cb/36/cdfaf6ed42e2644740d4a10452d8e97fa1c062e2a8006e4b09f1b5fd7d63/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:b4dec9482a65c54a5044486847b8a66bf10c9cb4926d42927ec4e8fd5db7fed8", size = 240110, upload-time = "2025-10-06T05:36:42.716Z" }, + { url = "https://files.pythonhosted.org/packages/03/a8/9ea226fbefad669f11b52e864c55f0bd57d3c8d7eb07e9f2e9a0b39502e1/frozenlist-1.8.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:21900c48ae04d13d416f0e1e0c4d81f7931f73a9dfa0b7a8746fb2fe7dd970ed", size = 233717, upload-time = "2025-10-06T05:36:44.251Z" }, + { url = "https://files.pythonhosted.org/packages/1e/0b/1b5531611e83ba7d13ccc9988967ea1b51186af64c42b7a7af465dcc9568/frozenlist-1.8.0-cp313-cp313-win32.whl", hash = "sha256:8b7b94a067d1c504ee0b16def57ad5738701e4ba10cec90529f13fa03c833496", size = 39628, upload-time = "2025-10-06T05:36:45.423Z" }, + { url = "https://files.pythonhosted.org/packages/d8/cf/174c91dbc9cc49bc7b7aab74d8b734e974d1faa8f191c74af9b7e80848e6/frozenlist-1.8.0-cp313-cp313-win_amd64.whl", hash = "sha256:878be833caa6a3821caf85eb39c5ba92d28e85df26d57afb06b35b2efd937231", size = 43882, upload-time = "2025-10-06T05:36:46.796Z" }, + { url = "https://files.pythonhosted.org/packages/c1/17/502cd212cbfa96eb1388614fe39a3fc9ab87dbbe042b66f97acb57474834/frozenlist-1.8.0-cp313-cp313-win_arm64.whl", hash = "sha256:44389d135b3ff43ba8cc89ff7f51f5a0bb6b63d829c8300f79a2fe4fe61bcc62", size = 39676, upload-time = "2025-10-06T05:36:47.8Z" }, + { url = "https://files.pythonhosted.org/packages/d2/5c/3bbfaa920dfab09e76946a5d2833a7cbdf7b9b4a91c714666ac4855b88b4/frozenlist-1.8.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:e25ac20a2ef37e91c1b39938b591457666a0fa835c7783c3a8f33ea42870db94", size = 89235, upload-time = "2025-10-06T05:36:48.78Z" }, + { url = "https://files.pythonhosted.org/packages/d2/d6/f03961ef72166cec1687e84e8925838442b615bd0b8854b54923ce5b7b8a/frozenlist-1.8.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:07cdca25a91a4386d2e76ad992916a85038a9b97561bf7a3fd12d5d9ce31870c", size = 50742, upload-time = "2025-10-06T05:36:49.837Z" }, + { url = "https://files.pythonhosted.org/packages/1e/bb/a6d12b7ba4c3337667d0e421f7181c82dda448ce4e7ad7ecd249a16fa806/frozenlist-1.8.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:4e0c11f2cc6717e0a741f84a527c52616140741cd812a50422f83dc31749fb52", size = 51725, upload-time = "2025-10-06T05:36:50.851Z" }, + { url = "https://files.pythonhosted.org/packages/bc/71/d1fed0ffe2c2ccd70b43714c6cab0f4188f09f8a67a7914a6b46ee30f274/frozenlist-1.8.0-cp313-cp313t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:b3210649ee28062ea6099cfda39e147fa1bc039583c8ee4481cb7811e2448c51", size = 284533, upload-time = "2025-10-06T05:36:51.898Z" }, + { url = "https://files.pythonhosted.org/packages/c9/1f/fb1685a7b009d89f9bf78a42d94461bc06581f6e718c39344754a5d9bada/frozenlist-1.8.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:581ef5194c48035a7de2aefc72ac6539823bb71508189e5de01d60c9dcd5fa65", size = 292506, upload-time = "2025-10-06T05:36:53.101Z" }, + { url = "https://files.pythonhosted.org/packages/e6/3b/b991fe1612703f7e0d05c0cf734c1b77aaf7c7d321df4572e8d36e7048c8/frozenlist-1.8.0-cp313-cp313t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3ef2d026f16a2b1866e1d86fc4e1291e1ed8a387b2c333809419a2f8b3a77b82", size = 274161, upload-time = "2025-10-06T05:36:54.309Z" }, + { url = "https://files.pythonhosted.org/packages/ca/ec/c5c618767bcdf66e88945ec0157d7f6c4a1322f1473392319b7a2501ded7/frozenlist-1.8.0-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5500ef82073f599ac84d888e3a8c1f77ac831183244bfd7f11eaa0289fb30714", size = 294676, upload-time = "2025-10-06T05:36:55.566Z" }, + { url = "https://files.pythonhosted.org/packages/7c/ce/3934758637d8f8a88d11f0585d6495ef54b2044ed6ec84492a91fa3b27aa/frozenlist-1.8.0-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:50066c3997d0091c411a66e710f4e11752251e6d2d73d70d8d5d4c76442a199d", size = 300638, upload-time = "2025-10-06T05:36:56.758Z" }, + { url = "https://files.pythonhosted.org/packages/fc/4f/a7e4d0d467298f42de4b41cbc7ddaf19d3cfeabaf9ff97c20c6c7ee409f9/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:5c1c8e78426e59b3f8005e9b19f6ff46e5845895adbde20ece9218319eca6506", size = 283067, upload-time = "2025-10-06T05:36:57.965Z" }, + { url = "https://files.pythonhosted.org/packages/dc/48/c7b163063d55a83772b268e6d1affb960771b0e203b632cfe09522d67ea5/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:eefdba20de0d938cec6a89bd4d70f346a03108a19b9df4248d3cf0d88f1b0f51", size = 292101, upload-time = "2025-10-06T05:36:59.237Z" }, + { url = "https://files.pythonhosted.org/packages/9f/d0/2366d3c4ecdc2fd391e0afa6e11500bfba0ea772764d631bbf82f0136c9d/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:cf253e0e1c3ceb4aaff6df637ce033ff6535fb8c70a764a8f46aafd3d6ab798e", size = 289901, upload-time = "2025-10-06T05:37:00.811Z" }, + { url = "https://files.pythonhosted.org/packages/b8/94/daff920e82c1b70e3618a2ac39fbc01ae3e2ff6124e80739ce5d71c9b920/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:032efa2674356903cd0261c4317a561a6850f3ac864a63fc1583147fb05a79b0", size = 289395, upload-time = "2025-10-06T05:37:02.115Z" }, + { url = "https://files.pythonhosted.org/packages/e3/20/bba307ab4235a09fdcd3cc5508dbabd17c4634a1af4b96e0f69bfe551ebd/frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:6da155091429aeba16851ecb10a9104a108bcd32f6c1642867eadaee401c1c41", size = 283659, upload-time = "2025-10-06T05:37:03.711Z" }, + { url = "https://files.pythonhosted.org/packages/fd/00/04ca1c3a7a124b6de4f8a9a17cc2fcad138b4608e7a3fc5877804b8715d7/frozenlist-1.8.0-cp313-cp313t-win32.whl", hash = "sha256:0f96534f8bfebc1a394209427d0f8a63d343c9779cda6fc25e8e121b5fd8555b", size = 43492, upload-time = "2025-10-06T05:37:04.915Z" }, + { url = "https://files.pythonhosted.org/packages/59/5e/c69f733a86a94ab10f68e496dc6b7e8bc078ebb415281d5698313e3af3a1/frozenlist-1.8.0-cp313-cp313t-win_amd64.whl", hash = "sha256:5d63a068f978fc69421fb0e6eb91a9603187527c86b7cd3f534a5b77a592b888", size = 48034, upload-time = "2025-10-06T05:37:06.343Z" }, + { url = "https://files.pythonhosted.org/packages/16/6c/be9d79775d8abe79b05fa6d23da99ad6e7763a1d080fbae7290b286093fd/frozenlist-1.8.0-cp313-cp313t-win_arm64.whl", hash = "sha256:bf0a7e10b077bf5fb9380ad3ae8ce20ef919a6ad93b4552896419ac7e1d8e042", size = 41749, upload-time = "2025-10-06T05:37:07.431Z" }, + { url = "https://files.pythonhosted.org/packages/f1/c8/85da824b7e7b9b6e7f7705b2ecaf9591ba6f79c1177f324c2735e41d36a2/frozenlist-1.8.0-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:cee686f1f4cadeb2136007ddedd0aaf928ab95216e7691c63e50a8ec066336d0", size = 86127, upload-time = "2025-10-06T05:37:08.438Z" }, + { url = "https://files.pythonhosted.org/packages/8e/e8/a1185e236ec66c20afd72399522f142c3724c785789255202d27ae992818/frozenlist-1.8.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:119fb2a1bd47307e899c2fac7f28e85b9a543864df47aa7ec9d3c1b4545f096f", size = 49698, upload-time = "2025-10-06T05:37:09.48Z" }, + { url = "https://files.pythonhosted.org/packages/a1/93/72b1736d68f03fda5fdf0f2180fb6caaae3894f1b854d006ac61ecc727ee/frozenlist-1.8.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4970ece02dbc8c3a92fcc5228e36a3e933a01a999f7094ff7c23fbd2beeaa67c", size = 49749, upload-time = "2025-10-06T05:37:10.569Z" }, + { url = "https://files.pythonhosted.org/packages/a7/b2/fabede9fafd976b991e9f1b9c8c873ed86f202889b864756f240ce6dd855/frozenlist-1.8.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:cba69cb73723c3f329622e34bdbf5ce1f80c21c290ff04256cff1cd3c2036ed2", size = 231298, upload-time = "2025-10-06T05:37:11.993Z" }, + { url = "https://files.pythonhosted.org/packages/3a/3b/d9b1e0b0eed36e70477ffb8360c49c85c8ca8ef9700a4e6711f39a6e8b45/frozenlist-1.8.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:778a11b15673f6f1df23d9586f83c4846c471a8af693a22e066508b77d201ec8", size = 232015, upload-time = "2025-10-06T05:37:13.194Z" }, + { url = "https://files.pythonhosted.org/packages/dc/94/be719d2766c1138148564a3960fc2c06eb688da592bdc25adcf856101be7/frozenlist-1.8.0-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0325024fe97f94c41c08872db482cf8ac4800d80e79222c6b0b7b162d5b13686", size = 225038, upload-time = "2025-10-06T05:37:14.577Z" }, + { url = "https://files.pythonhosted.org/packages/e4/09/6712b6c5465f083f52f50cf74167b92d4ea2f50e46a9eea0523d658454ae/frozenlist-1.8.0-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:97260ff46b207a82a7567b581ab4190bd4dfa09f4db8a8b49d1a958f6aa4940e", size = 240130, upload-time = "2025-10-06T05:37:15.781Z" }, + { url = "https://files.pythonhosted.org/packages/f8/d4/cd065cdcf21550b54f3ce6a22e143ac9e4836ca42a0de1022da8498eac89/frozenlist-1.8.0-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:54b2077180eb7f83dd52c40b2750d0a9f175e06a42e3213ce047219de902717a", size = 242845, upload-time = "2025-10-06T05:37:17.037Z" }, + { url = "https://files.pythonhosted.org/packages/62/c3/f57a5c8c70cd1ead3d5d5f776f89d33110b1addae0ab010ad774d9a44fb9/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:2f05983daecab868a31e1da44462873306d3cbfd76d1f0b5b69c473d21dbb128", size = 229131, upload-time = "2025-10-06T05:37:18.221Z" }, + { url = "https://files.pythonhosted.org/packages/6c/52/232476fe9cb64f0742f3fde2b7d26c1dac18b6d62071c74d4ded55e0ef94/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:33f48f51a446114bc5d251fb2954ab0164d5be02ad3382abcbfe07e2531d650f", size = 240542, upload-time = "2025-10-06T05:37:19.771Z" }, + { url = "https://files.pythonhosted.org/packages/5f/85/07bf3f5d0fb5414aee5f47d33c6f5c77bfe49aac680bfece33d4fdf6a246/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:154e55ec0655291b5dd1b8731c637ecdb50975a2ae70c606d100750a540082f7", size = 237308, upload-time = "2025-10-06T05:37:20.969Z" }, + { url = "https://files.pythonhosted.org/packages/11/99/ae3a33d5befd41ac0ca2cc7fd3aa707c9c324de2e89db0e0f45db9a64c26/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:4314debad13beb564b708b4a496020e5306c7333fa9a3ab90374169a20ffab30", size = 238210, upload-time = "2025-10-06T05:37:22.252Z" }, + { url = "https://files.pythonhosted.org/packages/b2/60/b1d2da22f4970e7a155f0adde9b1435712ece01b3cd45ba63702aea33938/frozenlist-1.8.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:073f8bf8becba60aa931eb3bc420b217bb7d5b8f4750e6f8b3be7f3da85d38b7", size = 231972, upload-time = "2025-10-06T05:37:23.5Z" }, + { url = "https://files.pythonhosted.org/packages/3f/ab/945b2f32de889993b9c9133216c068b7fcf257d8595a0ac420ac8677cab0/frozenlist-1.8.0-cp314-cp314-win32.whl", hash = "sha256:bac9c42ba2ac65ddc115d930c78d24ab8d4f465fd3fc473cdedfccadb9429806", size = 40536, upload-time = "2025-10-06T05:37:25.581Z" }, + { url = "https://files.pythonhosted.org/packages/59/ad/9caa9b9c836d9ad6f067157a531ac48b7d36499f5036d4141ce78c230b1b/frozenlist-1.8.0-cp314-cp314-win_amd64.whl", hash = "sha256:3e0761f4d1a44f1d1a47996511752cf3dcec5bbdd9cc2b4fe595caf97754b7a0", size = 44330, upload-time = "2025-10-06T05:37:26.928Z" }, + { url = "https://files.pythonhosted.org/packages/82/13/e6950121764f2676f43534c555249f57030150260aee9dcf7d64efda11dd/frozenlist-1.8.0-cp314-cp314-win_arm64.whl", hash = "sha256:d1eaff1d00c7751b7c6662e9c5ba6eb2c17a2306ba5e2a37f24ddf3cc953402b", size = 40627, upload-time = "2025-10-06T05:37:28.075Z" }, + { url = "https://files.pythonhosted.org/packages/c0/c7/43200656ecc4e02d3f8bc248df68256cd9572b3f0017f0a0c4e93440ae23/frozenlist-1.8.0-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:d3bb933317c52d7ea5004a1c442eef86f426886fba134ef8cf4226ea6ee1821d", size = 89238, upload-time = "2025-10-06T05:37:29.373Z" }, + { url = "https://files.pythonhosted.org/packages/d1/29/55c5f0689b9c0fb765055629f472c0de484dcaf0acee2f7707266ae3583c/frozenlist-1.8.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:8009897cdef112072f93a0efdce29cd819e717fd2f649ee3016efd3cd885a7ed", size = 50738, upload-time = "2025-10-06T05:37:30.792Z" }, + { url = "https://files.pythonhosted.org/packages/ba/7d/b7282a445956506fa11da8c2db7d276adcbf2b17d8bb8407a47685263f90/frozenlist-1.8.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:2c5dcbbc55383e5883246d11fd179782a9d07a986c40f49abe89ddf865913930", size = 51739, upload-time = "2025-10-06T05:37:32.127Z" }, + { url = "https://files.pythonhosted.org/packages/62/1c/3d8622e60d0b767a5510d1d3cf21065b9db874696a51ea6d7a43180a259c/frozenlist-1.8.0-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:39ecbc32f1390387d2aa4f5a995e465e9e2f79ba3adcac92d68e3e0afae6657c", size = 284186, upload-time = "2025-10-06T05:37:33.21Z" }, + { url = "https://files.pythonhosted.org/packages/2d/14/aa36d5f85a89679a85a1d44cd7a6657e0b1c75f61e7cad987b203d2daca8/frozenlist-1.8.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:92db2bf818d5cc8d9c1f1fc56b897662e24ea5adb36ad1f1d82875bd64e03c24", size = 292196, upload-time = "2025-10-06T05:37:36.107Z" }, + { url = "https://files.pythonhosted.org/packages/05/23/6bde59eb55abd407d34f77d39a5126fb7b4f109a3f611d3929f14b700c66/frozenlist-1.8.0-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:2dc43a022e555de94c3b68a4ef0b11c4f747d12c024a520c7101709a2144fb37", size = 273830, upload-time = "2025-10-06T05:37:37.663Z" }, + { url = "https://files.pythonhosted.org/packages/d2/3f/22cff331bfad7a8afa616289000ba793347fcd7bc275f3b28ecea2a27909/frozenlist-1.8.0-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:cb89a7f2de3602cfed448095bab3f178399646ab7c61454315089787df07733a", size = 294289, upload-time = "2025-10-06T05:37:39.261Z" }, + { url = "https://files.pythonhosted.org/packages/a4/89/5b057c799de4838b6c69aa82b79705f2027615e01be996d2486a69ca99c4/frozenlist-1.8.0-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:33139dc858c580ea50e7e60a1b0ea003efa1fd42e6ec7fdbad78fff65fad2fd2", size = 300318, upload-time = "2025-10-06T05:37:43.213Z" }, + { url = "https://files.pythonhosted.org/packages/30/de/2c22ab3eb2a8af6d69dc799e48455813bab3690c760de58e1bf43b36da3e/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:168c0969a329b416119507ba30b9ea13688fafffac1b7822802537569a1cb0ef", size = 282814, upload-time = "2025-10-06T05:37:45.337Z" }, + { url = "https://files.pythonhosted.org/packages/59/f7/970141a6a8dbd7f556d94977858cfb36fa9b66e0892c6dd780d2219d8cd8/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:28bd570e8e189d7f7b001966435f9dac6718324b5be2990ac496cf1ea9ddb7fe", size = 291762, upload-time = "2025-10-06T05:37:46.657Z" }, + { url = "https://files.pythonhosted.org/packages/c1/15/ca1adae83a719f82df9116d66f5bb28bb95557b3951903d39135620ef157/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:b2a095d45c5d46e5e79ba1e5b9cb787f541a8dee0433836cea4b96a2c439dcd8", size = 289470, upload-time = "2025-10-06T05:37:47.946Z" }, + { url = "https://files.pythonhosted.org/packages/ac/83/dca6dc53bf657d371fbc88ddeb21b79891e747189c5de990b9dfff2ccba1/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:eab8145831a0d56ec9c4139b6c3e594c7a83c2c8be25d5bcf2d86136a532287a", size = 289042, upload-time = "2025-10-06T05:37:49.499Z" }, + { url = "https://files.pythonhosted.org/packages/96/52/abddd34ca99be142f354398700536c5bd315880ed0a213812bc491cff5e4/frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:974b28cf63cc99dfb2188d8d222bc6843656188164848c4f679e63dae4b0708e", size = 283148, upload-time = "2025-10-06T05:37:50.745Z" }, + { url = "https://files.pythonhosted.org/packages/af/d3/76bd4ed4317e7119c2b7f57c3f6934aba26d277acc6309f873341640e21f/frozenlist-1.8.0-cp314-cp314t-win32.whl", hash = "sha256:342c97bf697ac5480c0a7ec73cd700ecfa5a8a40ac923bd035484616efecc2df", size = 44676, upload-time = "2025-10-06T05:37:52.222Z" }, + { url = "https://files.pythonhosted.org/packages/89/76/c615883b7b521ead2944bb3480398cbb07e12b7b4e4d073d3752eb721558/frozenlist-1.8.0-cp314-cp314t-win_amd64.whl", hash = "sha256:06be8f67f39c8b1dc671f5d83aaefd3358ae5cdcf8314552c57e7ed3e6475bdd", size = 49451, upload-time = "2025-10-06T05:37:53.425Z" }, + { url = "https://files.pythonhosted.org/packages/e0/a3/5982da14e113d07b325230f95060e2169f5311b1017ea8af2a29b374c289/frozenlist-1.8.0-cp314-cp314t-win_arm64.whl", hash = "sha256:102e6314ca4da683dca92e3b1355490fed5f313b768500084fbe6371fddfdb79", size = 42507, upload-time = "2025-10-06T05:37:54.513Z" }, + { url = "https://files.pythonhosted.org/packages/c2/59/ae5cdac87a00962122ea37bb346d41b66aec05f9ce328fa2b9e216f8967b/frozenlist-1.8.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:d8b7138e5cd0647e4523d6685b0eac5d4be9a184ae9634492f25c6eb38c12a47", size = 86967, upload-time = "2025-10-06T05:37:55.607Z" }, + { url = "https://files.pythonhosted.org/packages/8a/10/17059b2db5a032fd9323c41c39e9d1f5f9d0c8f04d1e4e3e788573086e61/frozenlist-1.8.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:a6483e309ca809f1efd154b4d37dc6d9f61037d6c6a81c2dc7a15cb22c8c5dca", size = 49984, upload-time = "2025-10-06T05:37:57.049Z" }, + { url = "https://files.pythonhosted.org/packages/4b/de/ad9d82ca8e5fa8f0c636e64606553c79e2b859ad253030b62a21fe9986f5/frozenlist-1.8.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1b9290cf81e95e93fdf90548ce9d3c1211cf574b8e3f4b3b7cb0537cf2227068", size = 50240, upload-time = "2025-10-06T05:37:58.145Z" }, + { url = "https://files.pythonhosted.org/packages/4e/45/3dfb7767c2a67d123650122b62ce13c731b6c745bc14424eea67678b508c/frozenlist-1.8.0-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:59a6a5876ca59d1b63af8cd5e7ffffb024c3dc1e9cf9301b21a2e76286505c95", size = 219472, upload-time = "2025-10-06T05:37:59.239Z" }, + { url = "https://files.pythonhosted.org/packages/0b/bf/5bf23d913a741b960d5c1dac7c1985d8a2a1d015772b2d18ea168b08e7ff/frozenlist-1.8.0-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6dc4126390929823e2d2d9dc79ab4046ed74680360fc5f38b585c12c66cdf459", size = 221531, upload-time = "2025-10-06T05:38:00.521Z" }, + { url = "https://files.pythonhosted.org/packages/d0/03/27ec393f3b55860859f4b74cdc8c2a4af3dbf3533305e8eacf48a4fd9a54/frozenlist-1.8.0-cp39-cp39-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:332db6b2563333c5671fecacd085141b5800cb866be16d5e3eb15a2086476675", size = 219211, upload-time = "2025-10-06T05:38:01.842Z" }, + { url = "https://files.pythonhosted.org/packages/3a/ad/0fd00c404fa73fe9b169429e9a972d5ed807973c40ab6b3cf9365a33d360/frozenlist-1.8.0-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9ff15928d62a0b80bb875655c39bf517938c7d589554cbd2669be42d97c2cb61", size = 231775, upload-time = "2025-10-06T05:38:03.384Z" }, + { url = "https://files.pythonhosted.org/packages/8a/c3/86962566154cb4d2995358bc8331bfc4ea19d07db1a96f64935a1607f2b6/frozenlist-1.8.0-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:7bf6cdf8e07c8151fba6fe85735441240ec7f619f935a5205953d58009aef8c6", size = 236631, upload-time = "2025-10-06T05:38:04.609Z" }, + { url = "https://files.pythonhosted.org/packages/ea/9e/6ffad161dbd83782d2c66dc4d378a9103b31770cb1e67febf43aea42d202/frozenlist-1.8.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:48e6d3f4ec5c7273dfe83ff27c91083c6c9065af655dc2684d2c200c94308bb5", size = 218632, upload-time = "2025-10-06T05:38:05.917Z" }, + { url = "https://files.pythonhosted.org/packages/58/b2/4677eee46e0a97f9b30735e6ad0bf6aba3e497986066eb68807ac85cf60f/frozenlist-1.8.0-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:1a7607e17ad33361677adcd1443edf6f5da0ce5e5377b798fba20fae194825f3", size = 235967, upload-time = "2025-10-06T05:38:07.614Z" }, + { url = "https://files.pythonhosted.org/packages/05/f3/86e75f8639c5a93745ca7addbbc9de6af56aebb930d233512b17e46f6493/frozenlist-1.8.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:5a3a935c3a4e89c733303a2d5a7c257ea44af3a56c8202df486b7f5de40f37e1", size = 228799, upload-time = "2025-10-06T05:38:08.845Z" }, + { url = "https://files.pythonhosted.org/packages/30/00/39aad3a7f0d98f5eb1d99a3c311215674ed87061aecee7851974b335c050/frozenlist-1.8.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:940d4a017dbfed9daf46a3b086e1d2167e7012ee297fef9e1c545c4d022f5178", size = 230566, upload-time = "2025-10-06T05:38:10.52Z" }, + { url = "https://files.pythonhosted.org/packages/0d/4d/aa144cac44568d137846ddc4d5210fb5d9719eb1d7ec6fa2728a54b5b94a/frozenlist-1.8.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:b9be22a69a014bc47e78072d0ecae716f5eb56c15238acca0f43d6eb8e4a5bda", size = 217715, upload-time = "2025-10-06T05:38:11.832Z" }, + { url = "https://files.pythonhosted.org/packages/64/4c/8f665921667509d25a0dd72540513bc86b356c95541686f6442a3283019f/frozenlist-1.8.0-cp39-cp39-win32.whl", hash = "sha256:1aa77cb5697069af47472e39612976ed05343ff2e84a3dcf15437b232cbfd087", size = 39933, upload-time = "2025-10-06T05:38:13.061Z" }, + { url = "https://files.pythonhosted.org/packages/79/bd/bcc926f87027fad5e59926ff12d136e1082a115025d33c032d1cd69ab377/frozenlist-1.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:7398c222d1d405e796970320036b1b563892b65809d9e5261487bb2c7f7b5c6a", size = 44121, upload-time = "2025-10-06T05:38:14.572Z" }, + { url = "https://files.pythonhosted.org/packages/4c/07/9c2e4eb7584af4b705237b971b89a4155a8e57599c4483a131a39256a9a0/frozenlist-1.8.0-cp39-cp39-win_arm64.whl", hash = "sha256:b4f3b365f31c6cd4af24545ca0a244a53688cad8834e32f56831c4923b50a103", size = 40312, upload-time = "2025-10-06T05:38:15.699Z" }, + { url = "https://files.pythonhosted.org/packages/9a/9a/e35b4a917281c0b8419d4207f4334c8e8c5dbf4f3f5f9ada73958d937dcc/frozenlist-1.8.0-py3-none-any.whl", hash = "sha256:0c18a16eab41e82c295618a77502e17b195883241c563b00f0aa5106fc4eaa0d", size = 13409, upload-time = "2025-10-06T05:38:16.721Z" }, ] [[package]] @@ -390,46 +471,85 @@ wheels = [ [[package]] name = "idna" -version = "3.10" +version = "3.11" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f1/70/7703c29685631f5a7590aa73f1f1d3fa9a380e654b86af429e0934a32f7d/idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9", size = 190490, upload-time = "2024-09-15T18:07:39.745Z" } +sdist = { url = "https://files.pythonhosted.org/packages/6f/6d/0703ccc57f3a7233505399edb88de3cbd678da106337b9fcde432b65ed60/idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902", size = 194582, upload-time = "2025-10-12T14:55:20.501Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/76/c6/c88e154df9c4e1a2a66ccf0005a88dfb2650c1dffb6f5ce603dfbd452ce3/idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3", size = 70442, upload-time = "2024-09-15T18:07:37.964Z" }, + { url = "https://files.pythonhosted.org/packages/0e/61/66938bbb5fc52dbdf84594873d5b51fb1f7c7794e9c0f5bd885f30bc507b/idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea", size = 71008, upload-time = "2025-10-12T14:55:18.883Z" }, ] [[package]] name = "importlib-metadata" -version = "8.6.1" +version = "8.7.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "zipp" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/33/08/c1395a292bb23fd03bdf572a1357c5a733d3eecbab877641ceacab23db6e/importlib_metadata-8.6.1.tar.gz", hash = "sha256:310b41d755445d74569f993ccfc22838295d9fe005425094fad953d7f15c8580", size = 55767, upload-time = "2025-01-20T22:21:30.429Z" } +sdist = { url = "https://files.pythonhosted.org/packages/76/66/650a33bd90f786193e4de4b3ad86ea60b53c89b669a5c7be931fac31cdb0/importlib_metadata-8.7.0.tar.gz", hash = "sha256:d13b81ad223b890aa16c5471f2ac3056cf76c5f10f82d6f9292f0b415f389000", size = 56641, upload-time = "2025-04-27T15:29:01.736Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/79/9d/0fb148dc4d6fa4a7dd1d8378168d9b4cd8d4560a6fbf6f0121c5fc34eb68/importlib_metadata-8.6.1-py3-none-any.whl", hash = "sha256:02a89390c1e15fdfdc0d7c6b25cb3e62650d0494005c97d6f148bf5b9787525e", size = 26971, upload-time = "2025-01-20T22:21:29.177Z" }, + { url = "https://files.pythonhosted.org/packages/20/b0/36bd937216ec521246249be3bf9855081de4c5e06a0c9b4219dbeda50373/importlib_metadata-8.7.0-py3-none-any.whl", hash = "sha256:e5dd1551894c77868a30651cef00984d50e1002d06942a7101d34870c5f02afd", size = 27656, upload-time = "2025-04-27T15:29:00.214Z" }, ] [[package]] name = "iniconfig" -version = "2.0.0" +version = "2.1.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d7/4b/cbd8e699e64a6f16ca3a8220661b5f83792b3017d0f79807cb8708d33913/iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", size = 4646, upload-time = "2023-01-07T11:08:11.254Z" } +resolution-markers = [ + "python_full_version < '3.10'", +] +sdist = { url = "https://files.pythonhosted.org/packages/f2/97/ebf4da567aa6827c909642694d71c9fcf53e5b504f2d96afea02718862f3/iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7", size = 4793, upload-time = "2025-03-19T20:09:59.721Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374", size = 5892, upload-time = "2023-01-07T11:08:09.864Z" }, + { url = "https://files.pythonhosted.org/packages/2c/e1/e6716421ea10d38022b952c159d5161ca1193197fb744506875fbb87ea7b/iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760", size = 6050, upload-time = "2025-03-19T20:10:01.071Z" }, +] + +[[package]] +name = "iniconfig" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.14' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version >= '3.10' and python_full_version < '3.14' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version >= '3.10' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra != 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version >= '3.10' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra != 'group-18-runloop-api-client-pydantic-v2'", +] +sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, ] [[package]] name = "markdown-it-py" version = "3.0.0" source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.10'", +] dependencies = [ - { name = "mdurl" }, + { name = "mdurl", marker = "python_full_version < '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, ] sdist = { url = "https://files.pythonhosted.org/packages/38/71/3b932df36c1a044d397a1f92d1cf91ee0a503d91e470cbd670aa66b07ed0/markdown-it-py-3.0.0.tar.gz", hash = "sha256:e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb", size = 74596, upload-time = "2023-06-03T06:41:14.443Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/42/d7/1ec15b46af6af88f19b8e5ffea08fa375d433c998b8a7639e76935c14f1f/markdown_it_py-3.0.0-py3-none-any.whl", hash = "sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1", size = 87528, upload-time = "2023-06-03T06:41:11.019Z" }, ] +[[package]] +name = "markdown-it-py" +version = "4.0.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.14' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version >= '3.10' and python_full_version < '3.14' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version >= '3.10' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra != 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version >= '3.10' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra != 'group-18-runloop-api-client-pydantic-v2'", +] +dependencies = [ + { name = "mdurl", marker = "python_full_version >= '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/5b/f5/4ec618ed16cc4f8fb3b701563655a69816155e79e24a17b651541804721d/markdown_it_py-4.0.0.tar.gz", hash = "sha256:cb0a2b4aa34f932c007117b194e945bd74e0ec24133ceb5bac59009cda1cb9f3", size = 73070, upload-time = "2025-08-11T12:57:52.854Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/94/54/e7d793b573f298e1c9013b8c4dade17d481164aa517d1d7148619c2cedbf/markdown_it_py-4.0.0-py3-none-any.whl", hash = "sha256:87327c59b172c5011896038353a81343b6754500a08cd7a4973bb48c6d578147", size = 87321, upload-time = "2025-08-11T12:57:51.923Z" }, +] + [[package]] name = "mdurl" version = "0.1.2" @@ -441,175 +561,218 @@ wheels = [ [[package]] name = "multidict" -version = "6.6.3" +version = "6.7.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "typing-extensions", marker = "python_full_version < '3.11' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/3d/2c/5dad12e82fbdf7470f29bff2171484bf07cb3b16ada60a6589af8f376440/multidict-6.6.3.tar.gz", hash = "sha256:798a9eb12dab0a6c2e29c1de6f3468af5cb2da6053a20dfa3344907eed0937cc", size = 101006, upload-time = "2025-06-30T15:53:46.929Z" } +sdist = { url = "https://files.pythonhosted.org/packages/80/1e/5492c365f222f907de1039b91f922b93fa4f764c713ee858d235495d8f50/multidict-6.7.0.tar.gz", hash = "sha256:c6e99d9a65ca282e578dfea819cfa9c0a62b2499d8677392e09feaf305e9e6f5", size = 101834, upload-time = "2025-10-06T14:52:30.657Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/0b/67/414933982bce2efce7cbcb3169eaaf901e0f25baec69432b4874dfb1f297/multidict-6.6.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a2be5b7b35271f7fff1397204ba6708365e3d773579fe2a30625e16c4b4ce817", size = 77017, upload-time = "2025-06-30T15:50:58.931Z" }, - { url = "https://files.pythonhosted.org/packages/8a/fe/d8a3ee1fad37dc2ef4f75488b0d9d4f25bf204aad8306cbab63d97bff64a/multidict-6.6.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:12f4581d2930840295c461764b9a65732ec01250b46c6b2c510d7ee68872b140", size = 44897, upload-time = "2025-06-30T15:51:00.999Z" }, - { url = "https://files.pythonhosted.org/packages/1f/e0/265d89af8c98240265d82b8cbcf35897f83b76cd59ee3ab3879050fd8c45/multidict-6.6.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:dd7793bab517e706c9ed9d7310b06c8672fd0aeee5781bfad612f56b8e0f7d14", size = 44574, upload-time = "2025-06-30T15:51:02.449Z" }, - { url = "https://files.pythonhosted.org/packages/e6/05/6b759379f7e8e04ccc97cfb2a5dcc5cdbd44a97f072b2272dc51281e6a40/multidict-6.6.3-cp310-cp310-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:72d8815f2cd3cf3df0f83cac3f3ef801d908b2d90409ae28102e0553af85545a", size = 225729, upload-time = "2025-06-30T15:51:03.794Z" }, - { url = "https://files.pythonhosted.org/packages/4e/f5/8d5a15488edd9a91fa4aad97228d785df208ed6298580883aa3d9def1959/multidict-6.6.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:531e331a2ee53543ab32b16334e2deb26f4e6b9b28e41f8e0c87e99a6c8e2d69", size = 242515, upload-time = "2025-06-30T15:51:05.002Z" }, - { url = "https://files.pythonhosted.org/packages/6e/b5/a8f317d47d0ac5bb746d6d8325885c8967c2a8ce0bb57be5399e3642cccb/multidict-6.6.3-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:42ca5aa9329a63be8dc49040f63817d1ac980e02eeddba763a9ae5b4027b9c9c", size = 222224, upload-time = "2025-06-30T15:51:06.148Z" }, - { url = "https://files.pythonhosted.org/packages/76/88/18b2a0d5e80515fa22716556061189c2853ecf2aa2133081ebbe85ebea38/multidict-6.6.3-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:208b9b9757060b9faa6f11ab4bc52846e4f3c2fb8b14d5680c8aac80af3dc751", size = 253124, upload-time = "2025-06-30T15:51:07.375Z" }, - { url = "https://files.pythonhosted.org/packages/62/bf/ebfcfd6b55a1b05ef16d0775ae34c0fe15e8dab570d69ca9941073b969e7/multidict-6.6.3-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:acf6b97bd0884891af6a8b43d0f586ab2fcf8e717cbd47ab4bdddc09e20652d8", size = 251529, upload-time = "2025-06-30T15:51:08.691Z" }, - { url = "https://files.pythonhosted.org/packages/44/11/780615a98fd3775fc309d0234d563941af69ade2df0bb82c91dda6ddaea1/multidict-6.6.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:68e9e12ed00e2089725669bdc88602b0b6f8d23c0c95e52b95f0bc69f7fe9b55", size = 241627, upload-time = "2025-06-30T15:51:10.605Z" }, - { url = "https://files.pythonhosted.org/packages/28/3d/35f33045e21034b388686213752cabc3a1b9d03e20969e6fa8f1b1d82db1/multidict-6.6.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:05db2f66c9addb10cfa226e1acb363450fab2ff8a6df73c622fefe2f5af6d4e7", size = 239351, upload-time = "2025-06-30T15:51:12.18Z" }, - { url = "https://files.pythonhosted.org/packages/6e/cc/ff84c03b95b430015d2166d9aae775a3985d757b94f6635010d0038d9241/multidict-6.6.3-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:0db58da8eafb514db832a1b44f8fa7906fdd102f7d982025f816a93ba45e3dcb", size = 233429, upload-time = "2025-06-30T15:51:13.533Z" }, - { url = "https://files.pythonhosted.org/packages/2e/f0/8cd49a0b37bdea673a4b793c2093f2f4ba8e7c9d6d7c9bd672fd6d38cd11/multidict-6.6.3-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:14117a41c8fdb3ee19c743b1c027da0736fdb79584d61a766da53d399b71176c", size = 243094, upload-time = "2025-06-30T15:51:14.815Z" }, - { url = "https://files.pythonhosted.org/packages/96/19/5d9a0cfdafe65d82b616a45ae950975820289069f885328e8185e64283c2/multidict-6.6.3-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:877443eaaabcd0b74ff32ebeed6f6176c71850feb7d6a1d2db65945256ea535c", size = 248957, upload-time = "2025-06-30T15:51:16.076Z" }, - { url = "https://files.pythonhosted.org/packages/e6/dc/c90066151da87d1e489f147b9b4327927241e65f1876702fafec6729c014/multidict-6.6.3-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:70b72e749a4f6e7ed8fb334fa8d8496384840319512746a5f42fa0aec79f4d61", size = 243590, upload-time = "2025-06-30T15:51:17.413Z" }, - { url = "https://files.pythonhosted.org/packages/ec/39/458afb0cccbb0ee9164365273be3e039efddcfcb94ef35924b7dbdb05db0/multidict-6.6.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:43571f785b86afd02b3855c5ac8e86ec921b760298d6f82ff2a61daf5a35330b", size = 237487, upload-time = "2025-06-30T15:51:19.039Z" }, - { url = "https://files.pythonhosted.org/packages/35/38/0016adac3990426610a081787011177e661875546b434f50a26319dc8372/multidict-6.6.3-cp310-cp310-win32.whl", hash = "sha256:20c5a0c3c13a15fd5ea86c42311859f970070e4e24de5a550e99d7c271d76318", size = 41390, upload-time = "2025-06-30T15:51:20.362Z" }, - { url = "https://files.pythonhosted.org/packages/f3/d2/17897a8f3f2c5363d969b4c635aa40375fe1f09168dc09a7826780bfb2a4/multidict-6.6.3-cp310-cp310-win_amd64.whl", hash = "sha256:ab0a34a007704c625e25a9116c6770b4d3617a071c8a7c30cd338dfbadfe6485", size = 45954, upload-time = "2025-06-30T15:51:21.383Z" }, - { url = "https://files.pythonhosted.org/packages/2d/5f/d4a717c1e457fe44072e33fa400d2b93eb0f2819c4d669381f925b7cba1f/multidict-6.6.3-cp310-cp310-win_arm64.whl", hash = "sha256:769841d70ca8bdd140a715746199fc6473414bd02efd678d75681d2d6a8986c5", size = 42981, upload-time = "2025-06-30T15:51:22.809Z" }, - { url = "https://files.pythonhosted.org/packages/08/f0/1a39863ced51f639c81a5463fbfa9eb4df59c20d1a8769ab9ef4ca57ae04/multidict-6.6.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:18f4eba0cbac3546b8ae31e0bbc55b02c801ae3cbaf80c247fcdd89b456ff58c", size = 76445, upload-time = "2025-06-30T15:51:24.01Z" }, - { url = "https://files.pythonhosted.org/packages/c9/0e/a7cfa451c7b0365cd844e90b41e21fab32edaa1e42fc0c9f68461ce44ed7/multidict-6.6.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ef43b5dd842382329e4797c46f10748d8c2b6e0614f46b4afe4aee9ac33159df", size = 44610, upload-time = "2025-06-30T15:51:25.158Z" }, - { url = "https://files.pythonhosted.org/packages/c6/bb/a14a4efc5ee748cc1904b0748be278c31b9295ce5f4d2ef66526f410b94d/multidict-6.6.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:bf9bd1fd5eec01494e0f2e8e446a74a85d5e49afb63d75a9934e4a5423dba21d", size = 44267, upload-time = "2025-06-30T15:51:26.326Z" }, - { url = "https://files.pythonhosted.org/packages/c2/f8/410677d563c2d55e063ef74fe578f9d53fe6b0a51649597a5861f83ffa15/multidict-6.6.3-cp311-cp311-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:5bd8d6f793a787153956cd35e24f60485bf0651c238e207b9a54f7458b16d539", size = 230004, upload-time = "2025-06-30T15:51:27.491Z" }, - { url = "https://files.pythonhosted.org/packages/fd/df/2b787f80059314a98e1ec6a4cc7576244986df3e56b3c755e6fc7c99e038/multidict-6.6.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1bf99b4daf908c73856bd87ee0a2499c3c9a3d19bb04b9c6025e66af3fd07462", size = 247196, upload-time = "2025-06-30T15:51:28.762Z" }, - { url = "https://files.pythonhosted.org/packages/05/f2/f9117089151b9a8ab39f9019620d10d9718eec2ac89e7ca9d30f3ec78e96/multidict-6.6.3-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0b9e59946b49dafaf990fd9c17ceafa62976e8471a14952163d10a7a630413a9", size = 225337, upload-time = "2025-06-30T15:51:30.025Z" }, - { url = "https://files.pythonhosted.org/packages/93/2d/7115300ec5b699faa152c56799b089a53ed69e399c3c2d528251f0aeda1a/multidict-6.6.3-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e2db616467070d0533832d204c54eea6836a5e628f2cb1e6dfd8cd6ba7277cb7", size = 257079, upload-time = "2025-06-30T15:51:31.716Z" }, - { url = "https://files.pythonhosted.org/packages/15/ea/ff4bab367623e39c20d3b07637225c7688d79e4f3cc1f3b9f89867677f9a/multidict-6.6.3-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:7394888236621f61dcdd25189b2768ae5cc280f041029a5bcf1122ac63df79f9", size = 255461, upload-time = "2025-06-30T15:51:33.029Z" }, - { url = "https://files.pythonhosted.org/packages/74/07/2c9246cda322dfe08be85f1b8739646f2c4c5113a1422d7a407763422ec4/multidict-6.6.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f114d8478733ca7388e7c7e0ab34b72547476b97009d643644ac33d4d3fe1821", size = 246611, upload-time = "2025-06-30T15:51:34.47Z" }, - { url = "https://files.pythonhosted.org/packages/a8/62/279c13d584207d5697a752a66ffc9bb19355a95f7659140cb1b3cf82180e/multidict-6.6.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:cdf22e4db76d323bcdc733514bf732e9fb349707c98d341d40ebcc6e9318ef3d", size = 243102, upload-time = "2025-06-30T15:51:36.525Z" }, - { url = "https://files.pythonhosted.org/packages/69/cc/e06636f48c6d51e724a8bc8d9e1db5f136fe1df066d7cafe37ef4000f86a/multidict-6.6.3-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:e995a34c3d44ab511bfc11aa26869b9d66c2d8c799fa0e74b28a473a692532d6", size = 238693, upload-time = "2025-06-30T15:51:38.278Z" }, - { url = "https://files.pythonhosted.org/packages/89/a4/66c9d8fb9acf3b226cdd468ed009537ac65b520aebdc1703dd6908b19d33/multidict-6.6.3-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:766a4a5996f54361d8d5a9050140aa5362fe48ce51c755a50c0bc3706460c430", size = 246582, upload-time = "2025-06-30T15:51:39.709Z" }, - { url = "https://files.pythonhosted.org/packages/cf/01/c69e0317be556e46257826d5449feb4e6aa0d18573e567a48a2c14156f1f/multidict-6.6.3-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:3893a0d7d28a7fe6ca7a1f760593bc13038d1d35daf52199d431b61d2660602b", size = 253355, upload-time = "2025-06-30T15:51:41.013Z" }, - { url = "https://files.pythonhosted.org/packages/c0/da/9cc1da0299762d20e626fe0042e71b5694f9f72d7d3f9678397cbaa71b2b/multidict-6.6.3-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:934796c81ea996e61914ba58064920d6cad5d99140ac3167901eb932150e2e56", size = 247774, upload-time = "2025-06-30T15:51:42.291Z" }, - { url = "https://files.pythonhosted.org/packages/e6/91/b22756afec99cc31105ddd4a52f95ab32b1a4a58f4d417979c570c4a922e/multidict-6.6.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9ed948328aec2072bc00f05d961ceadfd3e9bfc2966c1319aeaf7b7c21219183", size = 242275, upload-time = "2025-06-30T15:51:43.642Z" }, - { url = "https://files.pythonhosted.org/packages/be/f1/adcc185b878036a20399d5be5228f3cbe7f823d78985d101d425af35c800/multidict-6.6.3-cp311-cp311-win32.whl", hash = "sha256:9f5b28c074c76afc3e4c610c488e3493976fe0e596dd3db6c8ddfbb0134dcac5", size = 41290, upload-time = "2025-06-30T15:51:45.264Z" }, - { url = "https://files.pythonhosted.org/packages/e0/d4/27652c1c6526ea6b4f5ddd397e93f4232ff5de42bea71d339bc6a6cc497f/multidict-6.6.3-cp311-cp311-win_amd64.whl", hash = "sha256:bc7f6fbc61b1c16050a389c630da0b32fc6d4a3d191394ab78972bf5edc568c2", size = 45942, upload-time = "2025-06-30T15:51:46.377Z" }, - { url = "https://files.pythonhosted.org/packages/16/18/23f4932019804e56d3c2413e237f866444b774b0263bcb81df2fdecaf593/multidict-6.6.3-cp311-cp311-win_arm64.whl", hash = "sha256:d4e47d8faffaae822fb5cba20937c048d4f734f43572e7079298a6c39fb172cb", size = 42880, upload-time = "2025-06-30T15:51:47.561Z" }, - { url = "https://files.pythonhosted.org/packages/0e/a0/6b57988ea102da0623ea814160ed78d45a2645e4bbb499c2896d12833a70/multidict-6.6.3-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:056bebbeda16b2e38642d75e9e5310c484b7c24e3841dc0fb943206a72ec89d6", size = 76514, upload-time = "2025-06-30T15:51:48.728Z" }, - { url = "https://files.pythonhosted.org/packages/07/7a/d1e92665b0850c6c0508f101f9cf0410c1afa24973e1115fe9c6a185ebf7/multidict-6.6.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:e5f481cccb3c5c5e5de5d00b5141dc589c1047e60d07e85bbd7dea3d4580d63f", size = 45394, upload-time = "2025-06-30T15:51:49.986Z" }, - { url = "https://files.pythonhosted.org/packages/52/6f/dd104490e01be6ef8bf9573705d8572f8c2d2c561f06e3826b081d9e6591/multidict-6.6.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:10bea2ee839a759ee368b5a6e47787f399b41e70cf0c20d90dfaf4158dfb4e55", size = 43590, upload-time = "2025-06-30T15:51:51.331Z" }, - { url = "https://files.pythonhosted.org/packages/44/fe/06e0e01b1b0611e6581b7fd5a85b43dacc08b6cea3034f902f383b0873e5/multidict-6.6.3-cp312-cp312-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:2334cfb0fa9549d6ce2c21af2bfbcd3ac4ec3646b1b1581c88e3e2b1779ec92b", size = 237292, upload-time = "2025-06-30T15:51:52.584Z" }, - { url = "https://files.pythonhosted.org/packages/ce/71/4f0e558fb77696b89c233c1ee2d92f3e1d5459070a0e89153c9e9e804186/multidict-6.6.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b8fee016722550a2276ca2cb5bb624480e0ed2bd49125b2b73b7010b9090e888", size = 258385, upload-time = "2025-06-30T15:51:53.913Z" }, - { url = "https://files.pythonhosted.org/packages/e3/25/cca0e68228addad24903801ed1ab42e21307a1b4b6dd2cf63da5d3ae082a/multidict-6.6.3-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e5511cb35f5c50a2db21047c875eb42f308c5583edf96bd8ebf7d770a9d68f6d", size = 242328, upload-time = "2025-06-30T15:51:55.672Z" }, - { url = "https://files.pythonhosted.org/packages/6e/a3/46f2d420d86bbcb8fe660b26a10a219871a0fbf4d43cb846a4031533f3e0/multidict-6.6.3-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:712b348f7f449948e0a6c4564a21c7db965af900973a67db432d724619b3c680", size = 268057, upload-time = "2025-06-30T15:51:57.037Z" }, - { url = "https://files.pythonhosted.org/packages/9e/73/1c743542fe00794a2ec7466abd3f312ccb8fad8dff9f36d42e18fb1ec33e/multidict-6.6.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:e4e15d2138ee2694e038e33b7c3da70e6b0ad8868b9f8094a72e1414aeda9c1a", size = 269341, upload-time = "2025-06-30T15:51:59.111Z" }, - { url = "https://files.pythonhosted.org/packages/a4/11/6ec9dcbe2264b92778eeb85407d1df18812248bf3506a5a1754bc035db0c/multidict-6.6.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8df25594989aebff8a130f7899fa03cbfcc5d2b5f4a461cf2518236fe6f15961", size = 256081, upload-time = "2025-06-30T15:52:00.533Z" }, - { url = "https://files.pythonhosted.org/packages/9b/2b/631b1e2afeb5f1696846d747d36cda075bfdc0bc7245d6ba5c319278d6c4/multidict-6.6.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:159ca68bfd284a8860f8d8112cf0521113bffd9c17568579e4d13d1f1dc76b65", size = 253581, upload-time = "2025-06-30T15:52:02.43Z" }, - { url = "https://files.pythonhosted.org/packages/bf/0e/7e3b93f79efeb6111d3bf9a1a69e555ba1d07ad1c11bceb56b7310d0d7ee/multidict-6.6.3-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:e098c17856a8c9ade81b4810888c5ad1914099657226283cab3062c0540b0643", size = 250750, upload-time = "2025-06-30T15:52:04.26Z" }, - { url = "https://files.pythonhosted.org/packages/ad/9e/086846c1d6601948e7de556ee464a2d4c85e33883e749f46b9547d7b0704/multidict-6.6.3-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:67c92ed673049dec52d7ed39f8cf9ebbadf5032c774058b4406d18c8f8fe7063", size = 251548, upload-time = "2025-06-30T15:52:06.002Z" }, - { url = "https://files.pythonhosted.org/packages/8c/7b/86ec260118e522f1a31550e87b23542294880c97cfbf6fb18cc67b044c66/multidict-6.6.3-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:bd0578596e3a835ef451784053cfd327d607fc39ea1a14812139339a18a0dbc3", size = 262718, upload-time = "2025-06-30T15:52:07.707Z" }, - { url = "https://files.pythonhosted.org/packages/8c/bd/22ce8f47abb0be04692c9fc4638508b8340987b18691aa7775d927b73f72/multidict-6.6.3-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:346055630a2df2115cd23ae271910b4cae40f4e336773550dca4889b12916e75", size = 259603, upload-time = "2025-06-30T15:52:09.58Z" }, - { url = "https://files.pythonhosted.org/packages/07/9c/91b7ac1691be95cd1f4a26e36a74b97cda6aa9820632d31aab4410f46ebd/multidict-6.6.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:555ff55a359302b79de97e0468e9ee80637b0de1fce77721639f7cd9440b3a10", size = 251351, upload-time = "2025-06-30T15:52:10.947Z" }, - { url = "https://files.pythonhosted.org/packages/6f/5c/4d7adc739884f7a9fbe00d1eac8c034023ef8bad71f2ebe12823ca2e3649/multidict-6.6.3-cp312-cp312-win32.whl", hash = "sha256:73ab034fb8d58ff85c2bcbadc470efc3fafeea8affcf8722855fb94557f14cc5", size = 41860, upload-time = "2025-06-30T15:52:12.334Z" }, - { url = "https://files.pythonhosted.org/packages/6a/a3/0fbc7afdf7cb1aa12a086b02959307848eb6bcc8f66fcb66c0cb57e2a2c1/multidict-6.6.3-cp312-cp312-win_amd64.whl", hash = "sha256:04cbcce84f63b9af41bad04a54d4cc4e60e90c35b9e6ccb130be2d75b71f8c17", size = 45982, upload-time = "2025-06-30T15:52:13.6Z" }, - { url = "https://files.pythonhosted.org/packages/b8/95/8c825bd70ff9b02462dc18d1295dd08d3e9e4eb66856d292ffa62cfe1920/multidict-6.6.3-cp312-cp312-win_arm64.whl", hash = "sha256:0f1130b896ecb52d2a1e615260f3ea2af55fa7dc3d7c3003ba0c3121a759b18b", size = 43210, upload-time = "2025-06-30T15:52:14.893Z" }, - { url = "https://files.pythonhosted.org/packages/52/1d/0bebcbbb4f000751fbd09957257903d6e002943fc668d841a4cf2fb7f872/multidict-6.6.3-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:540d3c06d48507357a7d57721e5094b4f7093399a0106c211f33540fdc374d55", size = 75843, upload-time = "2025-06-30T15:52:16.155Z" }, - { url = "https://files.pythonhosted.org/packages/07/8f/cbe241b0434cfe257f65c2b1bcf9e8d5fb52bc708c5061fb29b0fed22bdf/multidict-6.6.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:9c19cea2a690f04247d43f366d03e4eb110a0dc4cd1bbeee4d445435428ed35b", size = 45053, upload-time = "2025-06-30T15:52:17.429Z" }, - { url = "https://files.pythonhosted.org/packages/32/d2/0b3b23f9dbad5b270b22a3ac3ea73ed0a50ef2d9a390447061178ed6bdb8/multidict-6.6.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:7af039820cfd00effec86bda5d8debef711a3e86a1d3772e85bea0f243a4bd65", size = 43273, upload-time = "2025-06-30T15:52:19.346Z" }, - { url = "https://files.pythonhosted.org/packages/fd/fe/6eb68927e823999e3683bc49678eb20374ba9615097d085298fd5b386564/multidict-6.6.3-cp313-cp313-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:500b84f51654fdc3944e936f2922114349bf8fdcac77c3092b03449f0e5bc2b3", size = 237124, upload-time = "2025-06-30T15:52:20.773Z" }, - { url = "https://files.pythonhosted.org/packages/e7/ab/320d8507e7726c460cb77117848b3834ea0d59e769f36fdae495f7669929/multidict-6.6.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f3fc723ab8a5c5ed6c50418e9bfcd8e6dceba6c271cee6728a10a4ed8561520c", size = 256892, upload-time = "2025-06-30T15:52:22.242Z" }, - { url = "https://files.pythonhosted.org/packages/76/60/38ee422db515ac69834e60142a1a69111ac96026e76e8e9aa347fd2e4591/multidict-6.6.3-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:94c47ea3ade005b5976789baaed66d4de4480d0a0bf31cef6edaa41c1e7b56a6", size = 240547, upload-time = "2025-06-30T15:52:23.736Z" }, - { url = "https://files.pythonhosted.org/packages/27/fb/905224fde2dff042b030c27ad95a7ae744325cf54b890b443d30a789b80e/multidict-6.6.3-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:dbc7cf464cc6d67e83e136c9f55726da3a30176f020a36ead246eceed87f1cd8", size = 266223, upload-time = "2025-06-30T15:52:25.185Z" }, - { url = "https://files.pythonhosted.org/packages/76/35/dc38ab361051beae08d1a53965e3e1a418752fc5be4d3fb983c5582d8784/multidict-6.6.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:900eb9f9da25ada070f8ee4a23f884e0ee66fe4e1a38c3af644256a508ad81ca", size = 267262, upload-time = "2025-06-30T15:52:26.969Z" }, - { url = "https://files.pythonhosted.org/packages/1f/a3/0a485b7f36e422421b17e2bbb5a81c1af10eac1d4476f2ff92927c730479/multidict-6.6.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7c6df517cf177da5d47ab15407143a89cd1a23f8b335f3a28d57e8b0a3dbb884", size = 254345, upload-time = "2025-06-30T15:52:28.467Z" }, - { url = "https://files.pythonhosted.org/packages/b4/59/bcdd52c1dab7c0e0d75ff19cac751fbd5f850d1fc39172ce809a74aa9ea4/multidict-6.6.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:4ef421045f13879e21c994b36e728d8e7d126c91a64b9185810ab51d474f27e7", size = 252248, upload-time = "2025-06-30T15:52:29.938Z" }, - { url = "https://files.pythonhosted.org/packages/bb/a4/2d96aaa6eae8067ce108d4acee6f45ced5728beda55c0f02ae1072c730d1/multidict-6.6.3-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:6c1e61bb4f80895c081790b6b09fa49e13566df8fbff817da3f85b3a8192e36b", size = 250115, upload-time = "2025-06-30T15:52:31.416Z" }, - { url = "https://files.pythonhosted.org/packages/25/d2/ed9f847fa5c7d0677d4f02ea2c163d5e48573de3f57bacf5670e43a5ffaa/multidict-6.6.3-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:e5e8523bb12d7623cd8300dbd91b9e439a46a028cd078ca695eb66ba31adee3c", size = 249649, upload-time = "2025-06-30T15:52:32.996Z" }, - { url = "https://files.pythonhosted.org/packages/1f/af/9155850372563fc550803d3f25373308aa70f59b52cff25854086ecb4a79/multidict-6.6.3-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:ef58340cc896219e4e653dade08fea5c55c6df41bcc68122e3be3e9d873d9a7b", size = 261203, upload-time = "2025-06-30T15:52:34.521Z" }, - { url = "https://files.pythonhosted.org/packages/36/2f/c6a728f699896252cf309769089568a33c6439626648843f78743660709d/multidict-6.6.3-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:fc9dc435ec8699e7b602b94fe0cd4703e69273a01cbc34409af29e7820f777f1", size = 258051, upload-time = "2025-06-30T15:52:35.999Z" }, - { url = "https://files.pythonhosted.org/packages/d0/60/689880776d6b18fa2b70f6cc74ff87dd6c6b9b47bd9cf74c16fecfaa6ad9/multidict-6.6.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:9e864486ef4ab07db5e9cb997bad2b681514158d6954dd1958dfb163b83d53e6", size = 249601, upload-time = "2025-06-30T15:52:37.473Z" }, - { url = "https://files.pythonhosted.org/packages/75/5e/325b11f2222a549019cf2ef879c1f81f94a0d40ace3ef55cf529915ba6cc/multidict-6.6.3-cp313-cp313-win32.whl", hash = "sha256:5633a82fba8e841bc5c5c06b16e21529573cd654f67fd833650a215520a6210e", size = 41683, upload-time = "2025-06-30T15:52:38.927Z" }, - { url = "https://files.pythonhosted.org/packages/b1/ad/cf46e73f5d6e3c775cabd2a05976547f3f18b39bee06260369a42501f053/multidict-6.6.3-cp313-cp313-win_amd64.whl", hash = "sha256:e93089c1570a4ad54c3714a12c2cef549dc9d58e97bcded193d928649cab78e9", size = 45811, upload-time = "2025-06-30T15:52:40.207Z" }, - { url = "https://files.pythonhosted.org/packages/c5/c9/2e3fe950db28fb7c62e1a5f46e1e38759b072e2089209bc033c2798bb5ec/multidict-6.6.3-cp313-cp313-win_arm64.whl", hash = "sha256:c60b401f192e79caec61f166da9c924e9f8bc65548d4246842df91651e83d600", size = 43056, upload-time = "2025-06-30T15:52:41.575Z" }, - { url = "https://files.pythonhosted.org/packages/3a/58/aaf8114cf34966e084a8cc9517771288adb53465188843d5a19862cb6dc3/multidict-6.6.3-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:02fd8f32d403a6ff13864b0851f1f523d4c988051eea0471d4f1fd8010f11134", size = 82811, upload-time = "2025-06-30T15:52:43.281Z" }, - { url = "https://files.pythonhosted.org/packages/71/af/5402e7b58a1f5b987a07ad98f2501fdba2a4f4b4c30cf114e3ce8db64c87/multidict-6.6.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:f3aa090106b1543f3f87b2041eef3c156c8da2aed90c63a2fbed62d875c49c37", size = 48304, upload-time = "2025-06-30T15:52:45.026Z" }, - { url = "https://files.pythonhosted.org/packages/39/65/ab3c8cafe21adb45b24a50266fd747147dec7847425bc2a0f6934b3ae9ce/multidict-6.6.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:e924fb978615a5e33ff644cc42e6aa241effcf4f3322c09d4f8cebde95aff5f8", size = 46775, upload-time = "2025-06-30T15:52:46.459Z" }, - { url = "https://files.pythonhosted.org/packages/49/ba/9fcc1b332f67cc0c0c8079e263bfab6660f87fe4e28a35921771ff3eea0d/multidict-6.6.3-cp313-cp313t-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:b9fe5a0e57c6dbd0e2ce81ca66272282c32cd11d31658ee9553849d91289e1c1", size = 229773, upload-time = "2025-06-30T15:52:47.88Z" }, - { url = "https://files.pythonhosted.org/packages/a4/14/0145a251f555f7c754ce2dcbcd012939bbd1f34f066fa5d28a50e722a054/multidict-6.6.3-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b24576f208793ebae00280c59927c3b7c2a3b1655e443a25f753c4611bc1c373", size = 250083, upload-time = "2025-06-30T15:52:49.366Z" }, - { url = "https://files.pythonhosted.org/packages/9e/d4/d5c0bd2bbb173b586c249a151a26d2fb3ec7d53c96e42091c9fef4e1f10c/multidict-6.6.3-cp313-cp313t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:135631cb6c58eac37d7ac0df380294fecdc026b28837fa07c02e459c7fb9c54e", size = 228980, upload-time = "2025-06-30T15:52:50.903Z" }, - { url = "https://files.pythonhosted.org/packages/21/32/c9a2d8444a50ec48c4733ccc67254100c10e1c8ae8e40c7a2d2183b59b97/multidict-6.6.3-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:274d416b0df887aef98f19f21578653982cfb8a05b4e187d4a17103322eeaf8f", size = 257776, upload-time = "2025-06-30T15:52:52.764Z" }, - { url = "https://files.pythonhosted.org/packages/68/d0/14fa1699f4ef629eae08ad6201c6b476098f5efb051b296f4c26be7a9fdf/multidict-6.6.3-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:e252017a817fad7ce05cafbe5711ed40faeb580e63b16755a3a24e66fa1d87c0", size = 256882, upload-time = "2025-06-30T15:52:54.596Z" }, - { url = "https://files.pythonhosted.org/packages/da/88/84a27570fbe303c65607d517a5f147cd2fc046c2d1da02b84b17b9bdc2aa/multidict-6.6.3-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2e4cc8d848cd4fe1cdee28c13ea79ab0ed37fc2e89dd77bac86a2e7959a8c3bc", size = 247816, upload-time = "2025-06-30T15:52:56.175Z" }, - { url = "https://files.pythonhosted.org/packages/1c/60/dca352a0c999ce96a5d8b8ee0b2b9f729dcad2e0b0c195f8286269a2074c/multidict-6.6.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9e236a7094b9c4c1b7585f6b9cca34b9d833cf079f7e4c49e6a4a6ec9bfdc68f", size = 245341, upload-time = "2025-06-30T15:52:57.752Z" }, - { url = "https://files.pythonhosted.org/packages/50/ef/433fa3ed06028f03946f3993223dada70fb700f763f70c00079533c34578/multidict-6.6.3-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:e0cb0ab69915c55627c933f0b555a943d98ba71b4d1c57bc0d0a66e2567c7471", size = 235854, upload-time = "2025-06-30T15:52:59.74Z" }, - { url = "https://files.pythonhosted.org/packages/1b/1f/487612ab56fbe35715320905215a57fede20de7db40a261759690dc80471/multidict-6.6.3-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:81ef2f64593aba09c5212a3d0f8c906a0d38d710a011f2f42759704d4557d3f2", size = 243432, upload-time = "2025-06-30T15:53:01.602Z" }, - { url = "https://files.pythonhosted.org/packages/da/6f/ce8b79de16cd885c6f9052c96a3671373d00c59b3ee635ea93e6e81b8ccf/multidict-6.6.3-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:b9cbc60010de3562545fa198bfc6d3825df430ea96d2cc509c39bd71e2e7d648", size = 252731, upload-time = "2025-06-30T15:53:03.517Z" }, - { url = "https://files.pythonhosted.org/packages/bb/fe/a2514a6aba78e5abefa1624ca85ae18f542d95ac5cde2e3815a9fbf369aa/multidict-6.6.3-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:70d974eaaa37211390cd02ef93b7e938de564bbffa866f0b08d07e5e65da783d", size = 247086, upload-time = "2025-06-30T15:53:05.48Z" }, - { url = "https://files.pythonhosted.org/packages/8c/22/b788718d63bb3cce752d107a57c85fcd1a212c6c778628567c9713f9345a/multidict-6.6.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:3713303e4a6663c6d01d648a68f2848701001f3390a030edaaf3fc949c90bf7c", size = 243338, upload-time = "2025-06-30T15:53:07.522Z" }, - { url = "https://files.pythonhosted.org/packages/22/d6/fdb3d0670819f2228f3f7d9af613d5e652c15d170c83e5f1c94fbc55a25b/multidict-6.6.3-cp313-cp313t-win32.whl", hash = "sha256:639ecc9fe7cd73f2495f62c213e964843826f44505a3e5d82805aa85cac6f89e", size = 47812, upload-time = "2025-06-30T15:53:09.263Z" }, - { url = "https://files.pythonhosted.org/packages/b6/d6/a9d2c808f2c489ad199723197419207ecbfbc1776f6e155e1ecea9c883aa/multidict-6.6.3-cp313-cp313t-win_amd64.whl", hash = "sha256:9f97e181f344a0ef3881b573d31de8542cc0dbc559ec68c8f8b5ce2c2e91646d", size = 53011, upload-time = "2025-06-30T15:53:11.038Z" }, - { url = "https://files.pythonhosted.org/packages/f2/40/b68001cba8188dd267590a111f9661b6256debc327137667e832bf5d66e8/multidict-6.6.3-cp313-cp313t-win_arm64.whl", hash = "sha256:ce8b7693da41a3c4fde5871c738a81490cea5496c671d74374c8ab889e1834fb", size = 45254, upload-time = "2025-06-30T15:53:12.421Z" }, - { url = "https://files.pythonhosted.org/packages/d2/64/ba29bd6dfc895e592b2f20f92378e692ac306cf25dd0be2f8e0a0f898edb/multidict-6.6.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:c8161b5a7778d3137ea2ee7ae8a08cce0010de3b00ac671c5ebddeaa17cefd22", size = 76959, upload-time = "2025-06-30T15:53:13.827Z" }, - { url = "https://files.pythonhosted.org/packages/ca/cd/872ae4c134257dacebff59834983c1615d6ec863b6e3d360f3203aad8400/multidict-6.6.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1328201ee930f069961ae707d59c6627ac92e351ed5b92397cf534d1336ce557", size = 44864, upload-time = "2025-06-30T15:53:15.658Z" }, - { url = "https://files.pythonhosted.org/packages/15/35/d417d8f62f2886784b76df60522d608aba39dfc83dd53b230ca71f2d4c53/multidict-6.6.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b1db4d2093d6b235de76932febf9d50766cf49a5692277b2c28a501c9637f616", size = 44540, upload-time = "2025-06-30T15:53:17.208Z" }, - { url = "https://files.pythonhosted.org/packages/85/59/25cddf781f12cddb2386baa29744a3fdd160eb705539b48065f0cffd86d5/multidict-6.6.3-cp39-cp39-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:53becb01dd8ebd19d1724bebe369cfa87e4e7f29abbbe5c14c98ce4c383e16cd", size = 224075, upload-time = "2025-06-30T15:53:18.705Z" }, - { url = "https://files.pythonhosted.org/packages/c4/21/4055b6a527954c572498a8068c26bd3b75f2b959080e17e12104b592273c/multidict-6.6.3-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:41bb9d1d4c303886e2d85bade86e59885112a7f4277af5ad47ab919a2251f306", size = 240535, upload-time = "2025-06-30T15:53:20.359Z" }, - { url = "https://files.pythonhosted.org/packages/58/98/17f1f80bdba0b2fef49cf4ba59cebf8a81797f745f547abb5c9a4039df62/multidict-6.6.3-cp39-cp39-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:775b464d31dac90f23192af9c291dc9f423101857e33e9ebf0020a10bfcf4144", size = 219361, upload-time = "2025-06-30T15:53:22.371Z" }, - { url = "https://files.pythonhosted.org/packages/f8/0e/a5e595fdd0820069f0c29911d5dc9dc3a75ec755ae733ce59a4e6962ae42/multidict-6.6.3-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:d04d01f0a913202205a598246cf77826fe3baa5a63e9f6ccf1ab0601cf56eca0", size = 251207, upload-time = "2025-06-30T15:53:24.307Z" }, - { url = "https://files.pythonhosted.org/packages/66/9e/0f51e4cffea2daf24c137feabc9ec848ce50f8379c9badcbac00b41ab55e/multidict-6.6.3-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d25594d3b38a2e6cabfdcafef339f754ca6e81fbbdb6650ad773ea9775af35ab", size = 249749, upload-time = "2025-06-30T15:53:26.056Z" }, - { url = "https://files.pythonhosted.org/packages/49/a0/a7cfc13c9a71ceb8c1c55457820733af9ce01e121139271f7b13e30c29d2/multidict-6.6.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:35712f1748d409e0707b165bf49f9f17f9e28ae85470c41615778f8d4f7d9609", size = 239202, upload-time = "2025-06-30T15:53:28.096Z" }, - { url = "https://files.pythonhosted.org/packages/c7/50/7ae0d1149ac71cab6e20bb7faf2a1868435974994595dadfdb7377f7140f/multidict-6.6.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:1c8082e5814b662de8589d6a06c17e77940d5539080cbab9fe6794b5241b76d9", size = 237269, upload-time = "2025-06-30T15:53:30.124Z" }, - { url = "https://files.pythonhosted.org/packages/b4/ac/2d0bf836c9c63a57360d57b773359043b371115e1c78ff648993bf19abd0/multidict-6.6.3-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:61af8a4b771f1d4d000b3168c12c3120ccf7284502a94aa58c68a81f5afac090", size = 232961, upload-time = "2025-06-30T15:53:31.766Z" }, - { url = "https://files.pythonhosted.org/packages/85/e1/68a65f069df298615591e70e48bfd379c27d4ecb252117c18bf52eebc237/multidict-6.6.3-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:448e4a9afccbf297577f2eaa586f07067441e7b63c8362a3540ba5a38dc0f14a", size = 240863, upload-time = "2025-06-30T15:53:33.488Z" }, - { url = "https://files.pythonhosted.org/packages/ae/ab/702f1baca649f88ea1dc6259fc2aa4509f4ad160ba48c8e61fbdb4a5a365/multidict-6.6.3-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:233ad16999afc2bbd3e534ad8dbe685ef8ee49a37dbc2cdc9514e57b6d589ced", size = 246800, upload-time = "2025-06-30T15:53:35.21Z" }, - { url = "https://files.pythonhosted.org/packages/5e/0b/726e690bfbf887985a8710ef2f25f1d6dd184a35bd3b36429814f810a2fc/multidict-6.6.3-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:bb933c891cd4da6bdcc9733d048e994e22e1883287ff7540c2a0f3b117605092", size = 242034, upload-time = "2025-06-30T15:53:36.913Z" }, - { url = "https://files.pythonhosted.org/packages/73/bb/839486b27bcbcc2e0d875fb9d4012b4b6aa99639137343106aa7210e047a/multidict-6.6.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:37b09ca60998e87734699e88c2363abfd457ed18cfbf88e4009a4e83788e63ed", size = 235377, upload-time = "2025-06-30T15:53:38.618Z" }, - { url = "https://files.pythonhosted.org/packages/e3/46/574d75ab7b9ae8690fe27e89f5fcd0121633112b438edfb9ed2be8be096b/multidict-6.6.3-cp39-cp39-win32.whl", hash = "sha256:f54cb79d26d0cd420637d184af38f0668558f3c4bbe22ab7ad830e67249f2e0b", size = 41420, upload-time = "2025-06-30T15:53:40.309Z" }, - { url = "https://files.pythonhosted.org/packages/78/c3/8b3bc755508b777868349f4bfa844d3d31832f075ee800a3d6f1807338c5/multidict-6.6.3-cp39-cp39-win_amd64.whl", hash = "sha256:295adc9c0551e5d5214b45cf29ca23dbc28c2d197a9c30d51aed9e037cb7c578", size = 46124, upload-time = "2025-06-30T15:53:41.984Z" }, - { url = "https://files.pythonhosted.org/packages/b2/30/5a66e7e4550e80975faee5b5dd9e9bd09194d2fd8f62363119b9e46e204b/multidict-6.6.3-cp39-cp39-win_arm64.whl", hash = "sha256:15332783596f227db50fb261c2c251a58ac3873c457f3a550a95d5c0aa3c770d", size = 42973, upload-time = "2025-06-30T15:53:43.505Z" }, - { url = "https://files.pythonhosted.org/packages/d8/30/9aec301e9772b098c1f5c0ca0279237c9766d94b97802e9888010c64b0ed/multidict-6.6.3-py3-none-any.whl", hash = "sha256:8db10f29c7541fc5da4defd8cd697e1ca429db743fa716325f236079b96f775a", size = 12313, upload-time = "2025-06-30T15:53:45.437Z" }, + { url = "https://files.pythonhosted.org/packages/a9/63/7bdd4adc330abcca54c85728db2327130e49e52e8c3ce685cec44e0f2e9f/multidict-6.7.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:9f474ad5acda359c8758c8accc22032c6abe6dc87a8be2440d097785e27a9349", size = 77153, upload-time = "2025-10-06T14:48:26.409Z" }, + { url = "https://files.pythonhosted.org/packages/3f/bb/b6c35ff175ed1a3142222b78455ee31be71a8396ed3ab5280fbe3ebe4e85/multidict-6.7.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:4b7a9db5a870f780220e931d0002bbfd88fb53aceb6293251e2c839415c1b20e", size = 44993, upload-time = "2025-10-06T14:48:28.4Z" }, + { url = "https://files.pythonhosted.org/packages/e0/1f/064c77877c5fa6df6d346e68075c0f6998547afe952d6471b4c5f6a7345d/multidict-6.7.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:03ca744319864e92721195fa28c7a3b2bc7b686246b35e4078c1e4d0eb5466d3", size = 44607, upload-time = "2025-10-06T14:48:29.581Z" }, + { url = "https://files.pythonhosted.org/packages/04/7a/bf6aa92065dd47f287690000b3d7d332edfccb2277634cadf6a810463c6a/multidict-6.7.0-cp310-cp310-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:f0e77e3c0008bc9316e662624535b88d360c3a5d3f81e15cf12c139a75250046", size = 241847, upload-time = "2025-10-06T14:48:32.107Z" }, + { url = "https://files.pythonhosted.org/packages/94/39/297a8de920f76eda343e4ce05f3b489f0ab3f9504f2576dfb37b7c08ca08/multidict-6.7.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:08325c9e5367aa379a3496aa9a022fe8837ff22e00b94db256d3a1378c76ab32", size = 242616, upload-time = "2025-10-06T14:48:34.054Z" }, + { url = "https://files.pythonhosted.org/packages/39/3a/d0eee2898cfd9d654aea6cb8c4addc2f9756e9a7e09391cfe55541f917f7/multidict-6.7.0-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e2862408c99f84aa571ab462d25236ef9cb12a602ea959ba9c9009a54902fc73", size = 222333, upload-time = "2025-10-06T14:48:35.9Z" }, + { url = "https://files.pythonhosted.org/packages/05/48/3b328851193c7a4240815b71eea165b49248867bbb6153a0aee227a0bb47/multidict-6.7.0-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:4d72a9a2d885f5c208b0cb91ff2ed43636bb7e345ec839ff64708e04f69a13cc", size = 253239, upload-time = "2025-10-06T14:48:37.302Z" }, + { url = "https://files.pythonhosted.org/packages/b1/ca/0706a98c8d126a89245413225ca4a3fefc8435014de309cf8b30acb68841/multidict-6.7.0-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:478cc36476687bac1514d651cbbaa94b86b0732fb6855c60c673794c7dd2da62", size = 251618, upload-time = "2025-10-06T14:48:38.963Z" }, + { url = "https://files.pythonhosted.org/packages/5e/4f/9c7992f245554d8b173f6f0a048ad24b3e645d883f096857ec2c0822b8bd/multidict-6.7.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6843b28b0364dc605f21481c90fadb5f60d9123b442eb8a726bb74feef588a84", size = 241655, upload-time = "2025-10-06T14:48:40.312Z" }, + { url = "https://files.pythonhosted.org/packages/31/79/26a85991ae67efd1c0b1fc2e0c275b8a6aceeb155a68861f63f87a798f16/multidict-6.7.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:23bfeee5316266e5ee2d625df2d2c602b829435fc3a235c2ba2131495706e4a0", size = 239245, upload-time = "2025-10-06T14:48:41.848Z" }, + { url = "https://files.pythonhosted.org/packages/14/1e/75fa96394478930b79d0302eaf9a6c69f34005a1a5251ac8b9c336486ec9/multidict-6.7.0-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:680878b9f3d45c31e1f730eef731f9b0bc1da456155688c6745ee84eb818e90e", size = 233523, upload-time = "2025-10-06T14:48:43.749Z" }, + { url = "https://files.pythonhosted.org/packages/b2/5e/085544cb9f9c4ad2b5d97467c15f856df8d9bac410cffd5c43991a5d878b/multidict-6.7.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:eb866162ef2f45063acc7a53a88ef6fe8bf121d45c30ea3c9cd87ce7e191a8d4", size = 243129, upload-time = "2025-10-06T14:48:45.225Z" }, + { url = "https://files.pythonhosted.org/packages/b9/c3/e9d9e2f20c9474e7a8fcef28f863c5cbd29bb5adce6b70cebe8bdad0039d/multidict-6.7.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:df0e3bf7993bdbeca5ac25aa859cf40d39019e015c9c91809ba7093967f7a648", size = 248999, upload-time = "2025-10-06T14:48:46.703Z" }, + { url = "https://files.pythonhosted.org/packages/b5/3f/df171b6efa3239ae33b97b887e42671cd1d94d460614bfb2c30ffdab3b95/multidict-6.7.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:661709cdcd919a2ece2234f9bae7174e5220c80b034585d7d8a755632d3e2111", size = 243711, upload-time = "2025-10-06T14:48:48.146Z" }, + { url = "https://files.pythonhosted.org/packages/3c/2f/9b5564888c4e14b9af64c54acf149263721a283aaf4aa0ae89b091d5d8c1/multidict-6.7.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:096f52730c3fb8ed419db2d44391932b63891b2c5ed14850a7e215c0ba9ade36", size = 237504, upload-time = "2025-10-06T14:48:49.447Z" }, + { url = "https://files.pythonhosted.org/packages/6c/3a/0bd6ca0f7d96d790542d591c8c3354c1e1b6bfd2024d4d92dc3d87485ec7/multidict-6.7.0-cp310-cp310-win32.whl", hash = "sha256:afa8a2978ec65d2336305550535c9c4ff50ee527914328c8677b3973ade52b85", size = 41422, upload-time = "2025-10-06T14:48:50.789Z" }, + { url = "https://files.pythonhosted.org/packages/00/35/f6a637ea2c75f0d3b7c7d41b1189189acff0d9deeb8b8f35536bb30f5e33/multidict-6.7.0-cp310-cp310-win_amd64.whl", hash = "sha256:b15b3afff74f707b9275d5ba6a91ae8f6429c3ffb29bbfd216b0b375a56f13d7", size = 46050, upload-time = "2025-10-06T14:48:51.938Z" }, + { url = "https://files.pythonhosted.org/packages/e7/b8/f7bf8329b39893d02d9d95cf610c75885d12fc0f402b1c894e1c8e01c916/multidict-6.7.0-cp310-cp310-win_arm64.whl", hash = "sha256:4b73189894398d59131a66ff157837b1fafea9974be486d036bb3d32331fdbf0", size = 43153, upload-time = "2025-10-06T14:48:53.146Z" }, + { url = "https://files.pythonhosted.org/packages/34/9e/5c727587644d67b2ed479041e4b1c58e30afc011e3d45d25bbe35781217c/multidict-6.7.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:4d409aa42a94c0b3fa617708ef5276dfe81012ba6753a0370fcc9d0195d0a1fc", size = 76604, upload-time = "2025-10-06T14:48:54.277Z" }, + { url = "https://files.pythonhosted.org/packages/17/e4/67b5c27bd17c085a5ea8f1ec05b8a3e5cba0ca734bfcad5560fb129e70ca/multidict-6.7.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:14c9e076eede3b54c636f8ce1c9c252b5f057c62131211f0ceeec273810c9721", size = 44715, upload-time = "2025-10-06T14:48:55.445Z" }, + { url = "https://files.pythonhosted.org/packages/4d/e1/866a5d77be6ea435711bef2a4291eed11032679b6b28b56b4776ab06ba3e/multidict-6.7.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4c09703000a9d0fa3c3404b27041e574cc7f4df4c6563873246d0e11812a94b6", size = 44332, upload-time = "2025-10-06T14:48:56.706Z" }, + { url = "https://files.pythonhosted.org/packages/31/61/0c2d50241ada71ff61a79518db85ada85fdabfcf395d5968dae1cbda04e5/multidict-6.7.0-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:a265acbb7bb33a3a2d626afbe756371dce0279e7b17f4f4eda406459c2b5ff1c", size = 245212, upload-time = "2025-10-06T14:48:58.042Z" }, + { url = "https://files.pythonhosted.org/packages/ac/e0/919666a4e4b57fff1b57f279be1c9316e6cdc5de8a8b525d76f6598fefc7/multidict-6.7.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:51cb455de290ae462593e5b1cb1118c5c22ea7f0d3620d9940bf695cea5a4bd7", size = 246671, upload-time = "2025-10-06T14:49:00.004Z" }, + { url = "https://files.pythonhosted.org/packages/a1/cc/d027d9c5a520f3321b65adea289b965e7bcbd2c34402663f482648c716ce/multidict-6.7.0-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:db99677b4457c7a5c5a949353e125ba72d62b35f74e26da141530fbb012218a7", size = 225491, upload-time = "2025-10-06T14:49:01.393Z" }, + { url = "https://files.pythonhosted.org/packages/75/c4/bbd633980ce6155a28ff04e6a6492dd3335858394d7bb752d8b108708558/multidict-6.7.0-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f470f68adc395e0183b92a2f4689264d1ea4b40504a24d9882c27375e6662bb9", size = 257322, upload-time = "2025-10-06T14:49:02.745Z" }, + { url = "https://files.pythonhosted.org/packages/4c/6d/d622322d344f1f053eae47e033b0b3f965af01212de21b10bcf91be991fb/multidict-6.7.0-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:0db4956f82723cc1c270de9c6e799b4c341d327762ec78ef82bb962f79cc07d8", size = 254694, upload-time = "2025-10-06T14:49:04.15Z" }, + { url = "https://files.pythonhosted.org/packages/a8/9f/78f8761c2705d4c6d7516faed63c0ebdac569f6db1bef95e0d5218fdc146/multidict-6.7.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3e56d780c238f9e1ae66a22d2adf8d16f485381878250db8d496623cd38b22bd", size = 246715, upload-time = "2025-10-06T14:49:05.967Z" }, + { url = "https://files.pythonhosted.org/packages/78/59/950818e04f91b9c2b95aab3d923d9eabd01689d0dcd889563988e9ea0fd8/multidict-6.7.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:9d14baca2ee12c1a64740d4531356ba50b82543017f3ad6de0deb943c5979abb", size = 243189, upload-time = "2025-10-06T14:49:07.37Z" }, + { url = "https://files.pythonhosted.org/packages/7a/3d/77c79e1934cad2ee74991840f8a0110966d9599b3af95964c0cd79bb905b/multidict-6.7.0-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:295a92a76188917c7f99cda95858c822f9e4aae5824246bba9b6b44004ddd0a6", size = 237845, upload-time = "2025-10-06T14:49:08.759Z" }, + { url = "https://files.pythonhosted.org/packages/63/1b/834ce32a0a97a3b70f86437f685f880136677ac00d8bce0027e9fd9c2db7/multidict-6.7.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:39f1719f57adbb767ef592a50ae5ebb794220d1188f9ca93de471336401c34d2", size = 246374, upload-time = "2025-10-06T14:49:10.574Z" }, + { url = "https://files.pythonhosted.org/packages/23/ef/43d1c3ba205b5dec93dc97f3fba179dfa47910fc73aaaea4f7ceb41cec2a/multidict-6.7.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:0a13fb8e748dfc94749f622de065dd5c1def7e0d2216dba72b1d8069a389c6ff", size = 253345, upload-time = "2025-10-06T14:49:12.331Z" }, + { url = "https://files.pythonhosted.org/packages/6b/03/eaf95bcc2d19ead522001f6a650ef32811aa9e3624ff0ad37c445c7a588c/multidict-6.7.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:e3aa16de190d29a0ea1b48253c57d99a68492c8dd8948638073ab9e74dc9410b", size = 246940, upload-time = "2025-10-06T14:49:13.821Z" }, + { url = "https://files.pythonhosted.org/packages/e8/df/ec8a5fd66ea6cd6f525b1fcbb23511b033c3e9bc42b81384834ffa484a62/multidict-6.7.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:a048ce45dcdaaf1defb76b2e684f997fb5abf74437b6cb7b22ddad934a964e34", size = 242229, upload-time = "2025-10-06T14:49:15.603Z" }, + { url = "https://files.pythonhosted.org/packages/8a/a2/59b405d59fd39ec86d1142630e9049243015a5f5291ba49cadf3c090c541/multidict-6.7.0-cp311-cp311-win32.whl", hash = "sha256:a90af66facec4cebe4181b9e62a68be65e45ac9b52b67de9eec118701856e7ff", size = 41308, upload-time = "2025-10-06T14:49:16.871Z" }, + { url = "https://files.pythonhosted.org/packages/32/0f/13228f26f8b882c34da36efa776c3b7348455ec383bab4a66390e42963ae/multidict-6.7.0-cp311-cp311-win_amd64.whl", hash = "sha256:95b5ffa4349df2887518bb839409bcf22caa72d82beec453216802f475b23c81", size = 46037, upload-time = "2025-10-06T14:49:18.457Z" }, + { url = "https://files.pythonhosted.org/packages/84/1f/68588e31b000535a3207fd3c909ebeec4fb36b52c442107499c18a896a2a/multidict-6.7.0-cp311-cp311-win_arm64.whl", hash = "sha256:329aa225b085b6f004a4955271a7ba9f1087e39dcb7e65f6284a988264a63912", size = 43023, upload-time = "2025-10-06T14:49:19.648Z" }, + { url = "https://files.pythonhosted.org/packages/c2/9e/9f61ac18d9c8b475889f32ccfa91c9f59363480613fc807b6e3023d6f60b/multidict-6.7.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:8a3862568a36d26e650a19bb5cbbba14b71789032aebc0423f8cc5f150730184", size = 76877, upload-time = "2025-10-06T14:49:20.884Z" }, + { url = "https://files.pythonhosted.org/packages/38/6f/614f09a04e6184f8824268fce4bc925e9849edfa654ddd59f0b64508c595/multidict-6.7.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:960c60b5849b9b4f9dcc9bea6e3626143c252c74113df2c1540aebce70209b45", size = 45467, upload-time = "2025-10-06T14:49:22.054Z" }, + { url = "https://files.pythonhosted.org/packages/b3/93/c4f67a436dd026f2e780c433277fff72be79152894d9fc36f44569cab1a6/multidict-6.7.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2049be98fb57a31b4ccf870bf377af2504d4ae35646a19037ec271e4c07998aa", size = 43834, upload-time = "2025-10-06T14:49:23.566Z" }, + { url = "https://files.pythonhosted.org/packages/7f/f5/013798161ca665e4a422afbc5e2d9e4070142a9ff8905e482139cd09e4d0/multidict-6.7.0-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:0934f3843a1860dd465d38895c17fce1f1cb37295149ab05cd1b9a03afacb2a7", size = 250545, upload-time = "2025-10-06T14:49:24.882Z" }, + { url = "https://files.pythonhosted.org/packages/71/2f/91dbac13e0ba94669ea5119ba267c9a832f0cb65419aca75549fcf09a3dc/multidict-6.7.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b3e34f3a1b8131ba06f1a73adab24f30934d148afcd5f5de9a73565a4404384e", size = 258305, upload-time = "2025-10-06T14:49:26.778Z" }, + { url = "https://files.pythonhosted.org/packages/ef/b0/754038b26f6e04488b48ac621f779c341338d78503fb45403755af2df477/multidict-6.7.0-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:efbb54e98446892590dc2458c19c10344ee9a883a79b5cec4bc34d6656e8d546", size = 242363, upload-time = "2025-10-06T14:49:28.562Z" }, + { url = "https://files.pythonhosted.org/packages/87/15/9da40b9336a7c9fa606c4cf2ed80a649dffeb42b905d4f63a1d7eb17d746/multidict-6.7.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a35c5fc61d4f51eb045061e7967cfe3123d622cd500e8868e7c0c592a09fedc4", size = 268375, upload-time = "2025-10-06T14:49:29.96Z" }, + { url = "https://files.pythonhosted.org/packages/82/72/c53fcade0cc94dfaad583105fd92b3a783af2091eddcb41a6d5a52474000/multidict-6.7.0-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:29fe6740ebccba4175af1b9b87bf553e9c15cd5868ee967e010efcf94e4fd0f1", size = 269346, upload-time = "2025-10-06T14:49:31.404Z" }, + { url = "https://files.pythonhosted.org/packages/0d/e2/9baffdae21a76f77ef8447f1a05a96ec4bc0a24dae08767abc0a2fe680b8/multidict-6.7.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:123e2a72e20537add2f33a79e605f6191fba2afda4cbb876e35c1a7074298a7d", size = 256107, upload-time = "2025-10-06T14:49:32.974Z" }, + { url = "https://files.pythonhosted.org/packages/3c/06/3f06f611087dc60d65ef775f1fb5aca7c6d61c6db4990e7cda0cef9b1651/multidict-6.7.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:b284e319754366c1aee2267a2036248b24eeb17ecd5dc16022095e747f2f4304", size = 253592, upload-time = "2025-10-06T14:49:34.52Z" }, + { url = "https://files.pythonhosted.org/packages/20/24/54e804ec7945b6023b340c412ce9c3f81e91b3bf5fa5ce65558740141bee/multidict-6.7.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:803d685de7be4303b5a657b76e2f6d1240e7e0a8aa2968ad5811fa2285553a12", size = 251024, upload-time = "2025-10-06T14:49:35.956Z" }, + { url = "https://files.pythonhosted.org/packages/14/48/011cba467ea0b17ceb938315d219391d3e421dfd35928e5dbdc3f4ae76ef/multidict-6.7.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:c04a328260dfd5db8c39538f999f02779012268f54614902d0afc775d44e0a62", size = 251484, upload-time = "2025-10-06T14:49:37.631Z" }, + { url = "https://files.pythonhosted.org/packages/0d/2f/919258b43bb35b99fa127435cfb2d91798eb3a943396631ef43e3720dcf4/multidict-6.7.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:8a19cdb57cd3df4cd865849d93ee14920fb97224300c88501f16ecfa2604b4e0", size = 263579, upload-time = "2025-10-06T14:49:39.502Z" }, + { url = "https://files.pythonhosted.org/packages/31/22/a0e884d86b5242b5a74cf08e876bdf299e413016b66e55511f7a804a366e/multidict-6.7.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:9b2fd74c52accced7e75de26023b7dccee62511a600e62311b918ec5c168fc2a", size = 259654, upload-time = "2025-10-06T14:49:41.32Z" }, + { url = "https://files.pythonhosted.org/packages/b2/e5/17e10e1b5c5f5a40f2fcbb45953c9b215f8a4098003915e46a93f5fcaa8f/multidict-6.7.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:3e8bfdd0e487acf992407a140d2589fe598238eaeffa3da8448d63a63cd363f8", size = 251511, upload-time = "2025-10-06T14:49:46.021Z" }, + { url = "https://files.pythonhosted.org/packages/e3/9a/201bb1e17e7af53139597069c375e7b0dcbd47594604f65c2d5359508566/multidict-6.7.0-cp312-cp312-win32.whl", hash = "sha256:dd32a49400a2c3d52088e120ee00c1e3576cbff7e10b98467962c74fdb762ed4", size = 41895, upload-time = "2025-10-06T14:49:48.718Z" }, + { url = "https://files.pythonhosted.org/packages/46/e2/348cd32faad84eaf1d20cce80e2bb0ef8d312c55bca1f7fa9865e7770aaf/multidict-6.7.0-cp312-cp312-win_amd64.whl", hash = "sha256:92abb658ef2d7ef22ac9f8bb88e8b6c3e571671534e029359b6d9e845923eb1b", size = 46073, upload-time = "2025-10-06T14:49:50.28Z" }, + { url = "https://files.pythonhosted.org/packages/25/ec/aad2613c1910dce907480e0c3aa306905830f25df2e54ccc9dea450cb5aa/multidict-6.7.0-cp312-cp312-win_arm64.whl", hash = "sha256:490dab541a6a642ce1a9d61a4781656b346a55c13038f0b1244653828e3a83ec", size = 43226, upload-time = "2025-10-06T14:49:52.304Z" }, + { url = "https://files.pythonhosted.org/packages/d2/86/33272a544eeb36d66e4d9a920602d1a2f57d4ebea4ef3cdfe5a912574c95/multidict-6.7.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:bee7c0588aa0076ce77c0ea5d19a68d76ad81fcd9fe8501003b9a24f9d4000f6", size = 76135, upload-time = "2025-10-06T14:49:54.26Z" }, + { url = "https://files.pythonhosted.org/packages/91/1c/eb97db117a1ebe46d457a3d235a7b9d2e6dcab174f42d1b67663dd9e5371/multidict-6.7.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:7ef6b61cad77091056ce0e7ce69814ef72afacb150b7ac6a3e9470def2198159", size = 45117, upload-time = "2025-10-06T14:49:55.82Z" }, + { url = "https://files.pythonhosted.org/packages/f1/d8/6c3442322e41fb1dd4de8bd67bfd11cd72352ac131f6368315617de752f1/multidict-6.7.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9c0359b1ec12b1d6849c59f9d319610b7f20ef990a6d454ab151aa0e3b9f78ca", size = 43472, upload-time = "2025-10-06T14:49:57.048Z" }, + { url = "https://files.pythonhosted.org/packages/75/3f/e2639e80325af0b6c6febdf8e57cc07043ff15f57fa1ef808f4ccb5ac4cd/multidict-6.7.0-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:cd240939f71c64bd658f186330603aac1a9a81bf6273f523fca63673cb7378a8", size = 249342, upload-time = "2025-10-06T14:49:58.368Z" }, + { url = "https://files.pythonhosted.org/packages/5d/cc/84e0585f805cbeaa9cbdaa95f9a3d6aed745b9d25700623ac89a6ecff400/multidict-6.7.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a60a4d75718a5efa473ebd5ab685786ba0c67b8381f781d1be14da49f1a2dc60", size = 257082, upload-time = "2025-10-06T14:49:59.89Z" }, + { url = "https://files.pythonhosted.org/packages/b0/9c/ac851c107c92289acbbf5cfb485694084690c1b17e555f44952c26ddc5bd/multidict-6.7.0-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:53a42d364f323275126aff81fb67c5ca1b7a04fda0546245730a55c8c5f24bc4", size = 240704, upload-time = "2025-10-06T14:50:01.485Z" }, + { url = "https://files.pythonhosted.org/packages/50/cc/5f93e99427248c09da95b62d64b25748a5f5c98c7c2ab09825a1d6af0e15/multidict-6.7.0-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:3b29b980d0ddbecb736735ee5bef69bb2ddca56eff603c86f3f29a1128299b4f", size = 266355, upload-time = "2025-10-06T14:50:02.955Z" }, + { url = "https://files.pythonhosted.org/packages/ec/0c/2ec1d883ceb79c6f7f6d7ad90c919c898f5d1c6ea96d322751420211e072/multidict-6.7.0-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f8a93b1c0ed2d04b97a5e9336fd2d33371b9a6e29ab7dd6503d63407c20ffbaf", size = 267259, upload-time = "2025-10-06T14:50:04.446Z" }, + { url = "https://files.pythonhosted.org/packages/c6/2d/f0b184fa88d6630aa267680bdb8623fb69cb0d024b8c6f0d23f9a0f406d3/multidict-6.7.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9ff96e8815eecacc6645da76c413eb3b3d34cfca256c70b16b286a687d013c32", size = 254903, upload-time = "2025-10-06T14:50:05.98Z" }, + { url = "https://files.pythonhosted.org/packages/06/c9/11ea263ad0df7dfabcad404feb3c0dd40b131bc7f232d5537f2fb1356951/multidict-6.7.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:7516c579652f6a6be0e266aec0acd0db80829ca305c3d771ed898538804c2036", size = 252365, upload-time = "2025-10-06T14:50:07.511Z" }, + { url = "https://files.pythonhosted.org/packages/41/88/d714b86ee2c17d6e09850c70c9d310abac3d808ab49dfa16b43aba9d53fd/multidict-6.7.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:040f393368e63fb0f3330e70c26bfd336656bed925e5cbe17c9da839a6ab13ec", size = 250062, upload-time = "2025-10-06T14:50:09.074Z" }, + { url = "https://files.pythonhosted.org/packages/15/fe/ad407bb9e818c2b31383f6131ca19ea7e35ce93cf1310fce69f12e89de75/multidict-6.7.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:b3bc26a951007b1057a1c543af845f1c7e3e71cc240ed1ace7bf4484aa99196e", size = 249683, upload-time = "2025-10-06T14:50:10.714Z" }, + { url = "https://files.pythonhosted.org/packages/8c/a4/a89abdb0229e533fb925e7c6e5c40201c2873efebc9abaf14046a4536ee6/multidict-6.7.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:7b022717c748dd1992a83e219587aabe45980d88969f01b316e78683e6285f64", size = 261254, upload-time = "2025-10-06T14:50:12.28Z" }, + { url = "https://files.pythonhosted.org/packages/8d/aa/0e2b27bd88b40a4fb8dc53dd74eecac70edaa4c1dd0707eb2164da3675b3/multidict-6.7.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:9600082733859f00d79dee64effc7aef1beb26adb297416a4ad2116fd61374bd", size = 257967, upload-time = "2025-10-06T14:50:14.16Z" }, + { url = "https://files.pythonhosted.org/packages/d0/8e/0c67b7120d5d5f6d874ed85a085f9dc770a7f9d8813e80f44a9fec820bb7/multidict-6.7.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:94218fcec4d72bc61df51c198d098ce2b378e0ccbac41ddbed5ef44092913288", size = 250085, upload-time = "2025-10-06T14:50:15.639Z" }, + { url = "https://files.pythonhosted.org/packages/ba/55/b73e1d624ea4b8fd4dd07a3bb70f6e4c7c6c5d9d640a41c6ffe5cdbd2a55/multidict-6.7.0-cp313-cp313-win32.whl", hash = "sha256:a37bd74c3fa9d00be2d7b8eca074dc56bd8077ddd2917a839bd989612671ed17", size = 41713, upload-time = "2025-10-06T14:50:17.066Z" }, + { url = "https://files.pythonhosted.org/packages/32/31/75c59e7d3b4205075b4c183fa4ca398a2daf2303ddf616b04ae6ef55cffe/multidict-6.7.0-cp313-cp313-win_amd64.whl", hash = "sha256:30d193c6cc6d559db42b6bcec8a5d395d34d60c9877a0b71ecd7c204fcf15390", size = 45915, upload-time = "2025-10-06T14:50:18.264Z" }, + { url = "https://files.pythonhosted.org/packages/31/2a/8987831e811f1184c22bc2e45844934385363ee61c0a2dcfa8f71b87e608/multidict-6.7.0-cp313-cp313-win_arm64.whl", hash = "sha256:ea3334cabe4d41b7ccd01e4d349828678794edbc2d3ae97fc162a3312095092e", size = 43077, upload-time = "2025-10-06T14:50:19.853Z" }, + { url = "https://files.pythonhosted.org/packages/e8/68/7b3a5170a382a340147337b300b9eb25a9ddb573bcdfff19c0fa3f31ffba/multidict-6.7.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:ad9ce259f50abd98a1ca0aa6e490b58c316a0fce0617f609723e40804add2c00", size = 83114, upload-time = "2025-10-06T14:50:21.223Z" }, + { url = "https://files.pythonhosted.org/packages/55/5c/3fa2d07c84df4e302060f555bbf539310980362236ad49f50eeb0a1c1eb9/multidict-6.7.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:07f5594ac6d084cbb5de2df218d78baf55ef150b91f0ff8a21cc7a2e3a5a58eb", size = 48442, upload-time = "2025-10-06T14:50:22.871Z" }, + { url = "https://files.pythonhosted.org/packages/fc/56/67212d33239797f9bd91962bb899d72bb0f4c35a8652dcdb8ed049bef878/multidict-6.7.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:0591b48acf279821a579282444814a2d8d0af624ae0bc600aa4d1b920b6e924b", size = 46885, upload-time = "2025-10-06T14:50:24.258Z" }, + { url = "https://files.pythonhosted.org/packages/46/d1/908f896224290350721597a61a69cd19b89ad8ee0ae1f38b3f5cd12ea2ac/multidict-6.7.0-cp313-cp313t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:749a72584761531d2b9467cfbdfd29487ee21124c304c4b6cb760d8777b27f9c", size = 242588, upload-time = "2025-10-06T14:50:25.716Z" }, + { url = "https://files.pythonhosted.org/packages/ab/67/8604288bbd68680eee0ab568fdcb56171d8b23a01bcd5cb0c8fedf6e5d99/multidict-6.7.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6b4c3d199f953acd5b446bf7c0de1fe25d94e09e79086f8dc2f48a11a129cdf1", size = 249966, upload-time = "2025-10-06T14:50:28.192Z" }, + { url = "https://files.pythonhosted.org/packages/20/33/9228d76339f1ba51e3efef7da3ebd91964d3006217aae13211653193c3ff/multidict-6.7.0-cp313-cp313t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:9fb0211dfc3b51efea2f349ec92c114d7754dd62c01f81c3e32b765b70c45c9b", size = 228618, upload-time = "2025-10-06T14:50:29.82Z" }, + { url = "https://files.pythonhosted.org/packages/f8/2d/25d9b566d10cab1c42b3b9e5b11ef79c9111eaf4463b8c257a3bd89e0ead/multidict-6.7.0-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a027ec240fe73a8d6281872690b988eed307cd7d91b23998ff35ff577ca688b5", size = 257539, upload-time = "2025-10-06T14:50:31.731Z" }, + { url = "https://files.pythonhosted.org/packages/b6/b1/8d1a965e6637fc33de3c0d8f414485c2b7e4af00f42cab3d84e7b955c222/multidict-6.7.0-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d1d964afecdf3a8288789df2f5751dc0a8261138c3768d9af117ed384e538fad", size = 256345, upload-time = "2025-10-06T14:50:33.26Z" }, + { url = "https://files.pythonhosted.org/packages/ba/0c/06b5a8adbdeedada6f4fb8d8f193d44a347223b11939b42953eeb6530b6b/multidict-6.7.0-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:caf53b15b1b7df9fbd0709aa01409000a2b4dd03a5f6f5cc548183c7c8f8b63c", size = 247934, upload-time = "2025-10-06T14:50:34.808Z" }, + { url = "https://files.pythonhosted.org/packages/8f/31/b2491b5fe167ca044c6eb4b8f2c9f3b8a00b24c432c365358eadac5d7625/multidict-6.7.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:654030da3197d927f05a536a66186070e98765aa5142794c9904555d3a9d8fb5", size = 245243, upload-time = "2025-10-06T14:50:36.436Z" }, + { url = "https://files.pythonhosted.org/packages/61/1a/982913957cb90406c8c94f53001abd9eafc271cb3e70ff6371590bec478e/multidict-6.7.0-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:2090d3718829d1e484706a2f525e50c892237b2bf9b17a79b059cb98cddc2f10", size = 235878, upload-time = "2025-10-06T14:50:37.953Z" }, + { url = "https://files.pythonhosted.org/packages/be/c0/21435d804c1a1cf7a2608593f4d19bca5bcbd7a81a70b253fdd1c12af9c0/multidict-6.7.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:2d2cfeec3f6f45651b3d408c4acec0ebf3daa9bc8a112a084206f5db5d05b754", size = 243452, upload-time = "2025-10-06T14:50:39.574Z" }, + { url = "https://files.pythonhosted.org/packages/54/0a/4349d540d4a883863191be6eb9a928846d4ec0ea007d3dcd36323bb058ac/multidict-6.7.0-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:4ef089f985b8c194d341eb2c24ae6e7408c9a0e2e5658699c92f497437d88c3c", size = 252312, upload-time = "2025-10-06T14:50:41.612Z" }, + { url = "https://files.pythonhosted.org/packages/26/64/d5416038dbda1488daf16b676e4dbfd9674dde10a0cc8f4fc2b502d8125d/multidict-6.7.0-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:e93a0617cd16998784bf4414c7e40f17a35d2350e5c6f0bd900d3a8e02bd3762", size = 246935, upload-time = "2025-10-06T14:50:43.972Z" }, + { url = "https://files.pythonhosted.org/packages/9f/8c/8290c50d14e49f35e0bd4abc25e1bc7711149ca9588ab7d04f886cdf03d9/multidict-6.7.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:f0feece2ef8ebc42ed9e2e8c78fc4aa3cf455733b507c09ef7406364c94376c6", size = 243385, upload-time = "2025-10-06T14:50:45.648Z" }, + { url = "https://files.pythonhosted.org/packages/ef/a0/f83ae75e42d694b3fbad3e047670e511c138be747bc713cf1b10d5096416/multidict-6.7.0-cp313-cp313t-win32.whl", hash = "sha256:19a1d55338ec1be74ef62440ca9e04a2f001a04d0cc49a4983dc320ff0f3212d", size = 47777, upload-time = "2025-10-06T14:50:47.154Z" }, + { url = "https://files.pythonhosted.org/packages/dc/80/9b174a92814a3830b7357307a792300f42c9e94664b01dee8e457551fa66/multidict-6.7.0-cp313-cp313t-win_amd64.whl", hash = "sha256:3da4fb467498df97e986af166b12d01f05d2e04f978a9c1c680ea1988e0bc4b6", size = 53104, upload-time = "2025-10-06T14:50:48.851Z" }, + { url = "https://files.pythonhosted.org/packages/cc/28/04baeaf0428d95bb7a7bea0e691ba2f31394338ba424fb0679a9ed0f4c09/multidict-6.7.0-cp313-cp313t-win_arm64.whl", hash = "sha256:b4121773c49a0776461f4a904cdf6264c88e42218aaa8407e803ca8025872792", size = 45503, upload-time = "2025-10-06T14:50:50.16Z" }, + { url = "https://files.pythonhosted.org/packages/e2/b1/3da6934455dd4b261d4c72f897e3a5728eba81db59959f3a639245891baa/multidict-6.7.0-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:3bab1e4aff7adaa34410f93b1f8e57c4b36b9af0426a76003f441ee1d3c7e842", size = 75128, upload-time = "2025-10-06T14:50:51.92Z" }, + { url = "https://files.pythonhosted.org/packages/14/2c/f069cab5b51d175a1a2cb4ccdf7a2c2dabd58aa5bd933fa036a8d15e2404/multidict-6.7.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:b8512bac933afc3e45fb2b18da8e59b78d4f408399a960339598374d4ae3b56b", size = 44410, upload-time = "2025-10-06T14:50:53.275Z" }, + { url = "https://files.pythonhosted.org/packages/42/e2/64bb41266427af6642b6b128e8774ed84c11b80a90702c13ac0a86bb10cc/multidict-6.7.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:79dcf9e477bc65414ebfea98ffd013cb39552b5ecd62908752e0e413d6d06e38", size = 43205, upload-time = "2025-10-06T14:50:54.911Z" }, + { url = "https://files.pythonhosted.org/packages/02/68/6b086fef8a3f1a8541b9236c594f0c9245617c29841f2e0395d979485cde/multidict-6.7.0-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:31bae522710064b5cbeddaf2e9f32b1abab70ac6ac91d42572502299e9953128", size = 245084, upload-time = "2025-10-06T14:50:56.369Z" }, + { url = "https://files.pythonhosted.org/packages/15/ee/f524093232007cd7a75c1d132df70f235cfd590a7c9eaccd7ff422ef4ae8/multidict-6.7.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4a0df7ff02397bb63e2fd22af2c87dfa39e8c7f12947bc524dbdc528282c7e34", size = 252667, upload-time = "2025-10-06T14:50:57.991Z" }, + { url = "https://files.pythonhosted.org/packages/02/a5/eeb3f43ab45878f1895118c3ef157a480db58ede3f248e29b5354139c2c9/multidict-6.7.0-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:7a0222514e8e4c514660e182d5156a415c13ef0aabbd71682fc714e327b95e99", size = 233590, upload-time = "2025-10-06T14:50:59.589Z" }, + { url = "https://files.pythonhosted.org/packages/6a/1e/76d02f8270b97269d7e3dbd45644b1785bda457b474315f8cf999525a193/multidict-6.7.0-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:2397ab4daaf2698eb51a76721e98db21ce4f52339e535725de03ea962b5a3202", size = 264112, upload-time = "2025-10-06T14:51:01.183Z" }, + { url = "https://files.pythonhosted.org/packages/76/0b/c28a70ecb58963847c2a8efe334904cd254812b10e535aefb3bcce513918/multidict-6.7.0-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:8891681594162635948a636c9fe0ff21746aeb3dd5463f6e25d9bea3a8a39ca1", size = 261194, upload-time = "2025-10-06T14:51:02.794Z" }, + { url = "https://files.pythonhosted.org/packages/b4/63/2ab26e4209773223159b83aa32721b4021ffb08102f8ac7d689c943fded1/multidict-6.7.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:18706cc31dbf402a7945916dd5cddf160251b6dab8a2c5f3d6d5a55949f676b3", size = 248510, upload-time = "2025-10-06T14:51:04.724Z" }, + { url = "https://files.pythonhosted.org/packages/93/cd/06c1fa8282af1d1c46fd55c10a7930af652afdce43999501d4d68664170c/multidict-6.7.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:f844a1bbf1d207dd311a56f383f7eda2d0e134921d45751842d8235e7778965d", size = 248395, upload-time = "2025-10-06T14:51:06.306Z" }, + { url = "https://files.pythonhosted.org/packages/99/ac/82cb419dd6b04ccf9e7e61befc00c77614fc8134362488b553402ecd55ce/multidict-6.7.0-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:d4393e3581e84e5645506923816b9cc81f5609a778c7e7534054091acc64d1c6", size = 239520, upload-time = "2025-10-06T14:51:08.091Z" }, + { url = "https://files.pythonhosted.org/packages/fa/f3/a0f9bf09493421bd8716a362e0cd1d244f5a6550f5beffdd6b47e885b331/multidict-6.7.0-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:fbd18dc82d7bf274b37aa48d664534330af744e03bccf696d6f4c6042e7d19e7", size = 245479, upload-time = "2025-10-06T14:51:10.365Z" }, + { url = "https://files.pythonhosted.org/packages/8d/01/476d38fc73a212843f43c852b0eee266b6971f0e28329c2184a8df90c376/multidict-6.7.0-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:b6234e14f9314731ec45c42fc4554b88133ad53a09092cc48a88e771c125dadb", size = 258903, upload-time = "2025-10-06T14:51:12.466Z" }, + { url = "https://files.pythonhosted.org/packages/49/6d/23faeb0868adba613b817d0e69c5f15531b24d462af8012c4f6de4fa8dc3/multidict-6.7.0-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:08d4379f9744d8f78d98c8673c06e202ffa88296f009c71bbafe8a6bf847d01f", size = 252333, upload-time = "2025-10-06T14:51:14.48Z" }, + { url = "https://files.pythonhosted.org/packages/1e/cc/48d02ac22b30fa247f7dad82866e4b1015431092f4ba6ebc7e77596e0b18/multidict-6.7.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:9fe04da3f79387f450fd0061d4dd2e45a72749d31bf634aecc9e27f24fdc4b3f", size = 243411, upload-time = "2025-10-06T14:51:16.072Z" }, + { url = "https://files.pythonhosted.org/packages/4a/03/29a8bf5a18abf1fe34535c88adbdfa88c9fb869b5a3b120692c64abe8284/multidict-6.7.0-cp314-cp314-win32.whl", hash = "sha256:fbafe31d191dfa7c4c51f7a6149c9fb7e914dcf9ffead27dcfd9f1ae382b3885", size = 40940, upload-time = "2025-10-06T14:51:17.544Z" }, + { url = "https://files.pythonhosted.org/packages/82/16/7ed27b680791b939de138f906d5cf2b4657b0d45ca6f5dd6236fdddafb1a/multidict-6.7.0-cp314-cp314-win_amd64.whl", hash = "sha256:2f67396ec0310764b9222a1728ced1ab638f61aadc6226f17a71dd9324f9a99c", size = 45087, upload-time = "2025-10-06T14:51:18.875Z" }, + { url = "https://files.pythonhosted.org/packages/cd/3c/e3e62eb35a1950292fe39315d3c89941e30a9d07d5d2df42965ab041da43/multidict-6.7.0-cp314-cp314-win_arm64.whl", hash = "sha256:ba672b26069957ee369cfa7fc180dde1fc6f176eaf1e6beaf61fbebbd3d9c000", size = 42368, upload-time = "2025-10-06T14:51:20.225Z" }, + { url = "https://files.pythonhosted.org/packages/8b/40/cd499bd0dbc5f1136726db3153042a735fffd0d77268e2ee20d5f33c010f/multidict-6.7.0-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:c1dcc7524066fa918c6a27d61444d4ee7900ec635779058571f70d042d86ed63", size = 82326, upload-time = "2025-10-06T14:51:21.588Z" }, + { url = "https://files.pythonhosted.org/packages/13/8a/18e031eca251c8df76daf0288e6790561806e439f5ce99a170b4af30676b/multidict-6.7.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:27e0b36c2d388dc7b6ced3406671b401e84ad7eb0656b8f3a2f46ed0ce483718", size = 48065, upload-time = "2025-10-06T14:51:22.93Z" }, + { url = "https://files.pythonhosted.org/packages/40/71/5e6701277470a87d234e433fb0a3a7deaf3bcd92566e421e7ae9776319de/multidict-6.7.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:2a7baa46a22e77f0988e3b23d4ede5513ebec1929e34ee9495be535662c0dfe2", size = 46475, upload-time = "2025-10-06T14:51:24.352Z" }, + { url = "https://files.pythonhosted.org/packages/fe/6a/bab00cbab6d9cfb57afe1663318f72ec28289ea03fd4e8236bb78429893a/multidict-6.7.0-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:7bf77f54997a9166a2f5675d1201520586439424c2511723a7312bdb4bcc034e", size = 239324, upload-time = "2025-10-06T14:51:25.822Z" }, + { url = "https://files.pythonhosted.org/packages/2a/5f/8de95f629fc22a7769ade8b41028e3e5a822c1f8904f618d175945a81ad3/multidict-6.7.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e011555abada53f1578d63389610ac8a5400fc70ce71156b0aa30d326f1a5064", size = 246877, upload-time = "2025-10-06T14:51:27.604Z" }, + { url = "https://files.pythonhosted.org/packages/23/b4/38881a960458f25b89e9f4a4fdcb02ac101cfa710190db6e5528841e67de/multidict-6.7.0-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:28b37063541b897fd6a318007373930a75ca6d6ac7c940dbe14731ffdd8d498e", size = 225824, upload-time = "2025-10-06T14:51:29.664Z" }, + { url = "https://files.pythonhosted.org/packages/1e/39/6566210c83f8a261575f18e7144736059f0c460b362e96e9cf797a24b8e7/multidict-6.7.0-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:05047ada7a2fde2631a0ed706f1fd68b169a681dfe5e4cf0f8e4cb6618bbc2cd", size = 253558, upload-time = "2025-10-06T14:51:31.684Z" }, + { url = "https://files.pythonhosted.org/packages/00/a3/67f18315100f64c269f46e6c0319fa87ba68f0f64f2b8e7fd7c72b913a0b/multidict-6.7.0-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:716133f7d1d946a4e1b91b1756b23c088881e70ff180c24e864c26192ad7534a", size = 252339, upload-time = "2025-10-06T14:51:33.699Z" }, + { url = "https://files.pythonhosted.org/packages/c8/2a/1cb77266afee2458d82f50da41beba02159b1d6b1f7973afc9a1cad1499b/multidict-6.7.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d1bed1b467ef657f2a0ae62844a607909ef1c6889562de5e1d505f74457d0b96", size = 244895, upload-time = "2025-10-06T14:51:36.189Z" }, + { url = "https://files.pythonhosted.org/packages/dd/72/09fa7dd487f119b2eb9524946ddd36e2067c08510576d43ff68469563b3b/multidict-6.7.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:ca43bdfa5d37bd6aee89d85e1d0831fb86e25541be7e9d376ead1b28974f8e5e", size = 241862, upload-time = "2025-10-06T14:51:41.291Z" }, + { url = "https://files.pythonhosted.org/packages/65/92/bc1f8bd0853d8669300f732c801974dfc3702c3eeadae2f60cef54dc69d7/multidict-6.7.0-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:44b546bd3eb645fd26fb949e43c02a25a2e632e2ca21a35e2e132c8105dc8599", size = 232376, upload-time = "2025-10-06T14:51:43.55Z" }, + { url = "https://files.pythonhosted.org/packages/09/86/ac39399e5cb9d0c2ac8ef6e10a768e4d3bc933ac808d49c41f9dc23337eb/multidict-6.7.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:a6ef16328011d3f468e7ebc326f24c1445f001ca1dec335b2f8e66bed3006394", size = 240272, upload-time = "2025-10-06T14:51:45.265Z" }, + { url = "https://files.pythonhosted.org/packages/3d/b6/fed5ac6b8563ec72df6cb1ea8dac6d17f0a4a1f65045f66b6d3bf1497c02/multidict-6.7.0-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:5aa873cbc8e593d361ae65c68f85faadd755c3295ea2c12040ee146802f23b38", size = 248774, upload-time = "2025-10-06T14:51:46.836Z" }, + { url = "https://files.pythonhosted.org/packages/6b/8d/b954d8c0dc132b68f760aefd45870978deec6818897389dace00fcde32ff/multidict-6.7.0-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:3d7b6ccce016e29df4b7ca819659f516f0bc7a4b3efa3bb2012ba06431b044f9", size = 242731, upload-time = "2025-10-06T14:51:48.541Z" }, + { url = "https://files.pythonhosted.org/packages/16/9d/a2dac7009125d3540c2f54e194829ea18ac53716c61b655d8ed300120b0f/multidict-6.7.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:171b73bd4ee683d307599b66793ac80981b06f069b62eea1c9e29c9241aa66b0", size = 240193, upload-time = "2025-10-06T14:51:50.355Z" }, + { url = "https://files.pythonhosted.org/packages/39/ca/c05f144128ea232ae2178b008d5011d4e2cea86e4ee8c85c2631b1b94802/multidict-6.7.0-cp314-cp314t-win32.whl", hash = "sha256:b2d7f80c4e1fd010b07cb26820aae86b7e73b681ee4889684fb8d2d4537aab13", size = 48023, upload-time = "2025-10-06T14:51:51.883Z" }, + { url = "https://files.pythonhosted.org/packages/ba/8f/0a60e501584145588be1af5cc829265701ba3c35a64aec8e07cbb71d39bb/multidict-6.7.0-cp314-cp314t-win_amd64.whl", hash = "sha256:09929cab6fcb68122776d575e03c6cc64ee0b8fca48d17e135474b042ce515cd", size = 53507, upload-time = "2025-10-06T14:51:53.672Z" }, + { url = "https://files.pythonhosted.org/packages/7f/ae/3148b988a9c6239903e786eac19c889fab607c31d6efa7fb2147e5680f23/multidict-6.7.0-cp314-cp314t-win_arm64.whl", hash = "sha256:cc41db090ed742f32bd2d2c721861725e6109681eddf835d0a82bd3a5c382827", size = 44804, upload-time = "2025-10-06T14:51:55.415Z" }, + { url = "https://files.pythonhosted.org/packages/90/d7/4cf84257902265c4250769ac49f4eaab81c182ee9aff8bf59d2714dbb174/multidict-6.7.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:363eb68a0a59bd2303216d2346e6c441ba10d36d1f9969fcb6f1ba700de7bb5c", size = 77073, upload-time = "2025-10-06T14:51:57.386Z" }, + { url = "https://files.pythonhosted.org/packages/6d/51/194e999630a656e76c2965a1590d12faa5cd528170f2abaa04423e09fe8d/multidict-6.7.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d874eb056410ca05fed180b6642e680373688efafc7f077b2a2f61811e873a40", size = 44928, upload-time = "2025-10-06T14:51:58.791Z" }, + { url = "https://files.pythonhosted.org/packages/e5/6b/2a195373c33068c9158e0941d0b46cfcc9c1d894ca2eb137d1128081dff0/multidict-6.7.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:8b55d5497b51afdfde55925e04a022f1de14d4f4f25cdfd4f5d9b0aa96166851", size = 44581, upload-time = "2025-10-06T14:52:00.174Z" }, + { url = "https://files.pythonhosted.org/packages/69/7b/7f4f2e644b6978bf011a5fd9a5ebb7c21de3f38523b1f7897d36a1ac1311/multidict-6.7.0-cp39-cp39-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:f8e5c0031b90ca9ce555e2e8fd5c3b02a25f14989cbc310701823832c99eb687", size = 239901, upload-time = "2025-10-06T14:52:02.416Z" }, + { url = "https://files.pythonhosted.org/packages/3c/b5/952c72786710a031aa204a9adf7db66d7f97a2c6573889d58b9e60fe6702/multidict-6.7.0-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9cf41880c991716f3c7cec48e2f19ae4045fc9db5fc9cff27347ada24d710bb5", size = 240534, upload-time = "2025-10-06T14:52:04.105Z" }, + { url = "https://files.pythonhosted.org/packages/f3/ef/109fe1f2471e4c458c74242c7e4a833f2d9fc8a6813cd7ee345b0bad18f9/multidict-6.7.0-cp39-cp39-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:8cfc12a8630a29d601f48d47787bd7eb730e475e83edb5d6c5084317463373eb", size = 219545, upload-time = "2025-10-06T14:52:06.208Z" }, + { url = "https://files.pythonhosted.org/packages/42/bd/327d91288114967f9fe90dc53de70aa3fec1b9073e46aa32c4828f771a87/multidict-6.7.0-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:3996b50c3237c4aec17459217c1e7bbdead9a22a0fcd3c365564fbd16439dde6", size = 251187, upload-time = "2025-10-06T14:52:08.049Z" }, + { url = "https://files.pythonhosted.org/packages/f4/13/a8b078ebbaceb7819fd28cd004413c33b98f1b70d542a62e6a00b74fb09f/multidict-6.7.0-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:7f5170993a0dd3ab871c74f45c0a21a4e2c37a2f2b01b5f722a2ad9c6650469e", size = 249379, upload-time = "2025-10-06T14:52:09.831Z" }, + { url = "https://files.pythonhosted.org/packages/e3/6d/ab12e1246be4d65d1f55de1e6f6aaa9b8120eddcfdd1d290439c7833d5ce/multidict-6.7.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ec81878ddf0e98817def1e77d4f50dae5ef5b0e4fe796fae3bd674304172416e", size = 239241, upload-time = "2025-10-06T14:52:11.561Z" }, + { url = "https://files.pythonhosted.org/packages/bb/d7/079a93625208c173b8fa756396814397c0fd9fee61ef87b75a748820b86e/multidict-6.7.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:9281bf5b34f59afbc6b1e477a372e9526b66ca446f4bf62592839c195a718b32", size = 237418, upload-time = "2025-10-06T14:52:13.671Z" }, + { url = "https://files.pythonhosted.org/packages/c9/29/03777c2212274aa9440918d604dc9d6af0e6b4558c611c32c3dcf1a13870/multidict-6.7.0-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:68af405971779d8b37198726f2b6fe3955db846fee42db7a4286fc542203934c", size = 232987, upload-time = "2025-10-06T14:52:15.708Z" }, + { url = "https://files.pythonhosted.org/packages/d9/00/11188b68d85a84e8050ee34724d6ded19ad03975caebe0c8dcb2829b37bf/multidict-6.7.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:3ba3ef510467abb0667421a286dc906e30eb08569365f5cdb131d7aff7c2dd84", size = 240985, upload-time = "2025-10-06T14:52:17.317Z" }, + { url = "https://files.pythonhosted.org/packages/df/0c/12eef6aeda21859c6cdf7d75bd5516d83be3efe3d8cc45fd1a3037f5b9dc/multidict-6.7.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:b61189b29081a20c7e4e0b49b44d5d44bb0dc92be3c6d06a11cc043f81bf9329", size = 246855, upload-time = "2025-10-06T14:52:19.096Z" }, + { url = "https://files.pythonhosted.org/packages/69/f6/076120fd8bb3975f09228e288e08bff6b9f1bfd5166397c7ba284f622ab2/multidict-6.7.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:fb287618b9c7aa3bf8d825f02d9201b2f13078a5ed3b293c8f4d953917d84d5e", size = 241804, upload-time = "2025-10-06T14:52:21.166Z" }, + { url = "https://files.pythonhosted.org/packages/5f/51/41bb950c81437b88a93e6ddfca1d8763569ae861e638442838c4375f7497/multidict-6.7.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:521f33e377ff64b96c4c556b81c55d0cfffb96a11c194fd0c3f1e56f3d8dd5a4", size = 235321, upload-time = "2025-10-06T14:52:23.208Z" }, + { url = "https://files.pythonhosted.org/packages/5a/cf/5bbd31f055199d56c1f6b04bbadad3ccb24e6d5d4db75db774fc6d6674b8/multidict-6.7.0-cp39-cp39-win32.whl", hash = "sha256:ce8fdc2dca699f8dbf055a61d73eaa10482569ad20ee3c36ef9641f69afa8c91", size = 41435, upload-time = "2025-10-06T14:52:24.735Z" }, + { url = "https://files.pythonhosted.org/packages/af/01/547ffe9c2faec91c26965c152f3fea6cff068b6037401f61d310cc861ff4/multidict-6.7.0-cp39-cp39-win_amd64.whl", hash = "sha256:7e73299c99939f089dd9b2120a04a516b95cdf8c1cd2b18c53ebf0de80b1f18f", size = 46193, upload-time = "2025-10-06T14:52:26.101Z" }, + { url = "https://files.pythonhosted.org/packages/27/77/cfa5461d1d2651d6fc24216c92b4a21d4e385a41c46e0d9f3b070675167b/multidict-6.7.0-cp39-cp39-win_arm64.whl", hash = "sha256:6bdce131e14b04fd34a809b6380dbfd826065c3e2fe8a50dbae659fa0c390546", size = 43118, upload-time = "2025-10-06T14:52:27.876Z" }, + { url = "https://files.pythonhosted.org/packages/b7/da/7d22601b625e241d4f23ef1ebff8acfc60da633c9e7e7922e24d10f592b3/multidict-6.7.0-py3-none-any.whl", hash = "sha256:394fc5c42a333c9ffc3e421a4c85e08580d990e08b99f6bf35b4132114c5dcb3", size = 12317, upload-time = "2025-10-06T14:52:29.272Z" }, ] [[package]] name = "mypy" -version = "1.14.1" +version = "1.18.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "mypy-extensions" }, + { name = "pathspec" }, { name = "tomli", marker = "python_full_version < '3.11' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/b9/eb/2c92d8ea1e684440f54fa49ac5d9a5f19967b7b472a281f419e69a8d228e/mypy-1.14.1.tar.gz", hash = "sha256:7ec88144fe9b510e8475ec2f5f251992690fcf89ccb4500b214b4226abcd32d6", size = 3216051, upload-time = "2024-12-30T16:39:07.335Z" } +sdist = { url = "https://files.pythonhosted.org/packages/c0/77/8f0d0001ffad290cef2f7f216f96c814866248a0b92a722365ed54648e7e/mypy-1.18.2.tar.gz", hash = "sha256:06a398102a5f203d7477b2923dda3634c36727fa5c237d8f859ef90c42a9924b", size = 3448846, upload-time = "2025-09-19T00:11:10.519Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/9b/7a/87ae2adb31d68402da6da1e5f30c07ea6063e9f09b5e7cfc9dfa44075e74/mypy-1.14.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:52686e37cf13d559f668aa398dd7ddf1f92c5d613e4f8cb262be2fb4fedb0fcb", size = 11211002, upload-time = "2024-12-30T16:37:22.435Z" }, - { url = "https://files.pythonhosted.org/packages/e1/23/eada4c38608b444618a132be0d199b280049ded278b24cbb9d3fc59658e4/mypy-1.14.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1fb545ca340537d4b45d3eecdb3def05e913299ca72c290326be19b3804b39c0", size = 10358400, upload-time = "2024-12-30T16:37:53.526Z" }, - { url = "https://files.pythonhosted.org/packages/43/c9/d6785c6f66241c62fd2992b05057f404237deaad1566545e9f144ced07f5/mypy-1.14.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:90716d8b2d1f4cd503309788e51366f07c56635a3309b0f6a32547eaaa36a64d", size = 12095172, upload-time = "2024-12-30T16:37:50.332Z" }, - { url = "https://files.pythonhosted.org/packages/c3/62/daa7e787770c83c52ce2aaf1a111eae5893de9e004743f51bfcad9e487ec/mypy-1.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2ae753f5c9fef278bcf12e1a564351764f2a6da579d4a81347e1d5a15819997b", size = 12828732, upload-time = "2024-12-30T16:37:29.96Z" }, - { url = "https://files.pythonhosted.org/packages/1b/a2/5fb18318a3637f29f16f4e41340b795da14f4751ef4f51c99ff39ab62e52/mypy-1.14.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:e0fe0f5feaafcb04505bcf439e991c6d8f1bf8b15f12b05feeed96e9e7bf1427", size = 13012197, upload-time = "2024-12-30T16:38:05.037Z" }, - { url = "https://files.pythonhosted.org/packages/28/99/e153ce39105d164b5f02c06c35c7ba958aaff50a2babba7d080988b03fe7/mypy-1.14.1-cp310-cp310-win_amd64.whl", hash = "sha256:7d54bd85b925e501c555a3227f3ec0cfc54ee8b6930bd6141ec872d1c572f81f", size = 9780836, upload-time = "2024-12-30T16:37:19.726Z" }, - { url = "https://files.pythonhosted.org/packages/da/11/a9422850fd506edbcdc7f6090682ecceaf1f87b9dd847f9df79942da8506/mypy-1.14.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f995e511de847791c3b11ed90084a7a0aafdc074ab88c5a9711622fe4751138c", size = 11120432, upload-time = "2024-12-30T16:37:11.533Z" }, - { url = "https://files.pythonhosted.org/packages/b6/9e/47e450fd39078d9c02d620545b2cb37993a8a8bdf7db3652ace2f80521ca/mypy-1.14.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d64169ec3b8461311f8ce2fd2eb5d33e2d0f2c7b49116259c51d0d96edee48d1", size = 10279515, upload-time = "2024-12-30T16:37:40.724Z" }, - { url = "https://files.pythonhosted.org/packages/01/b5/6c8d33bd0f851a7692a8bfe4ee75eb82b6983a3cf39e5e32a5d2a723f0c1/mypy-1.14.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ba24549de7b89b6381b91fbc068d798192b1b5201987070319889e93038967a8", size = 12025791, upload-time = "2024-12-30T16:36:58.73Z" }, - { url = "https://files.pythonhosted.org/packages/f0/4c/e10e2c46ea37cab5c471d0ddaaa9a434dc1d28650078ac1b56c2d7b9b2e4/mypy-1.14.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:183cf0a45457d28ff9d758730cd0210419ac27d4d3f285beda038c9083363b1f", size = 12749203, upload-time = "2024-12-30T16:37:03.741Z" }, - { url = "https://files.pythonhosted.org/packages/88/55/beacb0c69beab2153a0f57671ec07861d27d735a0faff135a494cd4f5020/mypy-1.14.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f2a0ecc86378f45347f586e4163d1769dd81c5a223d577fe351f26b179e148b1", size = 12885900, upload-time = "2024-12-30T16:37:57.948Z" }, - { url = "https://files.pythonhosted.org/packages/a2/75/8c93ff7f315c4d086a2dfcde02f713004357d70a163eddb6c56a6a5eff40/mypy-1.14.1-cp311-cp311-win_amd64.whl", hash = "sha256:ad3301ebebec9e8ee7135d8e3109ca76c23752bac1e717bc84cd3836b4bf3eae", size = 9777869, upload-time = "2024-12-30T16:37:33.428Z" }, - { url = "https://files.pythonhosted.org/packages/43/1b/b38c079609bb4627905b74fc6a49849835acf68547ac33d8ceb707de5f52/mypy-1.14.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:30ff5ef8519bbc2e18b3b54521ec319513a26f1bba19a7582e7b1f58a6e69f14", size = 11266668, upload-time = "2024-12-30T16:38:02.211Z" }, - { url = "https://files.pythonhosted.org/packages/6b/75/2ed0d2964c1ffc9971c729f7a544e9cd34b2cdabbe2d11afd148d7838aa2/mypy-1.14.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:cb9f255c18052343c70234907e2e532bc7e55a62565d64536dbc7706a20b78b9", size = 10254060, upload-time = "2024-12-30T16:37:46.131Z" }, - { url = "https://files.pythonhosted.org/packages/a1/5f/7b8051552d4da3c51bbe8fcafffd76a6823779101a2b198d80886cd8f08e/mypy-1.14.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8b4e3413e0bddea671012b063e27591b953d653209e7a4fa5e48759cda77ca11", size = 11933167, upload-time = "2024-12-30T16:37:43.534Z" }, - { url = "https://files.pythonhosted.org/packages/04/90/f53971d3ac39d8b68bbaab9a4c6c58c8caa4d5fd3d587d16f5927eeeabe1/mypy-1.14.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:553c293b1fbdebb6c3c4030589dab9fafb6dfa768995a453d8a5d3b23784af2e", size = 12864341, upload-time = "2024-12-30T16:37:36.249Z" }, - { url = "https://files.pythonhosted.org/packages/03/d2/8bc0aeaaf2e88c977db41583559319f1821c069e943ada2701e86d0430b7/mypy-1.14.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fad79bfe3b65fe6a1efaed97b445c3d37f7be9fdc348bdb2d7cac75579607c89", size = 12972991, upload-time = "2024-12-30T16:37:06.743Z" }, - { url = "https://files.pythonhosted.org/packages/6f/17/07815114b903b49b0f2cf7499f1c130e5aa459411596668267535fe9243c/mypy-1.14.1-cp312-cp312-win_amd64.whl", hash = "sha256:8fa2220e54d2946e94ab6dbb3ba0a992795bd68b16dc852db33028df2b00191b", size = 9879016, upload-time = "2024-12-30T16:37:15.02Z" }, - { url = "https://files.pythonhosted.org/packages/9e/15/bb6a686901f59222275ab228453de741185f9d54fecbaacec041679496c6/mypy-1.14.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:92c3ed5afb06c3a8e188cb5da4984cab9ec9a77ba956ee419c68a388b4595255", size = 11252097, upload-time = "2024-12-30T16:37:25.144Z" }, - { url = "https://files.pythonhosted.org/packages/f8/b3/8b0f74dfd072c802b7fa368829defdf3ee1566ba74c32a2cb2403f68024c/mypy-1.14.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:dbec574648b3e25f43d23577309b16534431db4ddc09fda50841f1e34e64ed34", size = 10239728, upload-time = "2024-12-30T16:38:08.634Z" }, - { url = "https://files.pythonhosted.org/packages/c5/9b/4fd95ab20c52bb5b8c03cc49169be5905d931de17edfe4d9d2986800b52e/mypy-1.14.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8c6d94b16d62eb3e947281aa7347d78236688e21081f11de976376cf010eb31a", size = 11924965, upload-time = "2024-12-30T16:38:12.132Z" }, - { url = "https://files.pythonhosted.org/packages/56/9d/4a236b9c57f5d8f08ed346914b3f091a62dd7e19336b2b2a0d85485f82ff/mypy-1.14.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d4b19b03fdf54f3c5b2fa474c56b4c13c9dbfb9a2db4370ede7ec11a2c5927d9", size = 12867660, upload-time = "2024-12-30T16:38:17.342Z" }, - { url = "https://files.pythonhosted.org/packages/40/88/a61a5497e2f68d9027de2bb139c7bb9abaeb1be1584649fa9d807f80a338/mypy-1.14.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:0c911fde686394753fff899c409fd4e16e9b294c24bfd5e1ea4675deae1ac6fd", size = 12969198, upload-time = "2024-12-30T16:38:32.839Z" }, - { url = "https://files.pythonhosted.org/packages/54/da/3d6fc5d92d324701b0c23fb413c853892bfe0e1dbe06c9138037d459756b/mypy-1.14.1-cp313-cp313-win_amd64.whl", hash = "sha256:8b21525cb51671219f5307be85f7e646a153e5acc656e5cebf64bfa076c50107", size = 9885276, upload-time = "2024-12-30T16:38:20.828Z" }, - { url = "https://files.pythonhosted.org/packages/ca/1f/186d133ae2514633f8558e78cd658070ba686c0e9275c5a5c24a1e1f0d67/mypy-1.14.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3888a1816d69f7ab92092f785a462944b3ca16d7c470d564165fe703b0970c35", size = 11200493, upload-time = "2024-12-30T16:38:26.935Z" }, - { url = "https://files.pythonhosted.org/packages/af/fc/4842485d034e38a4646cccd1369f6b1ccd7bc86989c52770d75d719a9941/mypy-1.14.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:46c756a444117c43ee984bd055db99e498bc613a70bbbc120272bd13ca579fbc", size = 10357702, upload-time = "2024-12-30T16:38:50.623Z" }, - { url = "https://files.pythonhosted.org/packages/b4/e6/457b83f2d701e23869cfec013a48a12638f75b9d37612a9ddf99072c1051/mypy-1.14.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:27fc248022907e72abfd8e22ab1f10e903915ff69961174784a3900a8cba9ad9", size = 12091104, upload-time = "2024-12-30T16:38:53.735Z" }, - { url = "https://files.pythonhosted.org/packages/f1/bf/76a569158db678fee59f4fd30b8e7a0d75bcbaeef49edd882a0d63af6d66/mypy-1.14.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:499d6a72fb7e5de92218db961f1a66d5f11783f9ae549d214617edab5d4dbdbb", size = 12830167, upload-time = "2024-12-30T16:38:56.437Z" }, - { url = "https://files.pythonhosted.org/packages/43/bc/0bc6b694b3103de9fed61867f1c8bd33336b913d16831431e7cb48ef1c92/mypy-1.14.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:57961db9795eb566dc1d1b4e9139ebc4c6b0cb6e7254ecde69d1552bf7613f60", size = 13013834, upload-time = "2024-12-30T16:38:59.204Z" }, - { url = "https://files.pythonhosted.org/packages/b0/79/5f5ec47849b6df1e6943d5fd8e6632fbfc04b4fd4acfa5a5a9535d11b4e2/mypy-1.14.1-cp39-cp39-win_amd64.whl", hash = "sha256:07ba89fdcc9451f2ebb02853deb6aaaa3d2239a236669a63ab3801bbf923ef5c", size = 9781231, upload-time = "2024-12-30T16:39:05.124Z" }, - { url = "https://files.pythonhosted.org/packages/a0/b5/32dd67b69a16d088e533962e5044e51004176a9952419de0370cdaead0f8/mypy-1.14.1-py3-none-any.whl", hash = "sha256:b66a60cc4073aeb8ae00057f9c1f64d49e90f918fbcef9a977eb121da8b8f1d1", size = 2752905, upload-time = "2024-12-30T16:38:42.021Z" }, + { url = "https://files.pythonhosted.org/packages/03/6f/657961a0743cff32e6c0611b63ff1c1970a0b482ace35b069203bf705187/mypy-1.18.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c1eab0cf6294dafe397c261a75f96dc2c31bffe3b944faa24db5def4e2b0f77c", size = 12807973, upload-time = "2025-09-19T00:10:35.282Z" }, + { url = "https://files.pythonhosted.org/packages/10/e9/420822d4f661f13ca8900f5fa239b40ee3be8b62b32f3357df9a3045a08b/mypy-1.18.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:7a780ca61fc239e4865968ebc5240bb3bf610ef59ac398de9a7421b54e4a207e", size = 11896527, upload-time = "2025-09-19T00:10:55.791Z" }, + { url = "https://files.pythonhosted.org/packages/aa/73/a05b2bbaa7005f4642fcfe40fb73f2b4fb6bb44229bd585b5878e9a87ef8/mypy-1.18.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:448acd386266989ef11662ce3c8011fd2a7b632e0ec7d61a98edd8e27472225b", size = 12507004, upload-time = "2025-09-19T00:11:05.411Z" }, + { url = "https://files.pythonhosted.org/packages/4f/01/f6e4b9f0d031c11ccbd6f17da26564f3a0f3c4155af344006434b0a05a9d/mypy-1.18.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f9e171c465ad3901dc652643ee4bffa8e9fef4d7d0eece23b428908c77a76a66", size = 13245947, upload-time = "2025-09-19T00:10:46.923Z" }, + { url = "https://files.pythonhosted.org/packages/d7/97/19727e7499bfa1ae0773d06afd30ac66a58ed7437d940c70548634b24185/mypy-1.18.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:592ec214750bc00741af1f80cbf96b5013d81486b7bb24cb052382c19e40b428", size = 13499217, upload-time = "2025-09-19T00:09:39.472Z" }, + { url = "https://files.pythonhosted.org/packages/9f/4f/90dc8c15c1441bf31cf0f9918bb077e452618708199e530f4cbd5cede6ff/mypy-1.18.2-cp310-cp310-win_amd64.whl", hash = "sha256:7fb95f97199ea11769ebe3638c29b550b5221e997c63b14ef93d2e971606ebed", size = 9766753, upload-time = "2025-09-19T00:10:49.161Z" }, + { url = "https://files.pythonhosted.org/packages/88/87/cafd3ae563f88f94eec33f35ff722d043e09832ea8530ef149ec1efbaf08/mypy-1.18.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:807d9315ab9d464125aa9fcf6d84fde6e1dc67da0b6f80e7405506b8ac72bc7f", size = 12731198, upload-time = "2025-09-19T00:09:44.857Z" }, + { url = "https://files.pythonhosted.org/packages/0f/e0/1e96c3d4266a06d4b0197ace5356d67d937d8358e2ee3ffac71faa843724/mypy-1.18.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:776bb00de1778caf4db739c6e83919c1d85a448f71979b6a0edd774ea8399341", size = 11817879, upload-time = "2025-09-19T00:09:47.131Z" }, + { url = "https://files.pythonhosted.org/packages/72/ef/0c9ba89eb03453e76bdac5a78b08260a848c7bfc5d6603634774d9cd9525/mypy-1.18.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1379451880512ffce14505493bd9fe469e0697543717298242574882cf8cdb8d", size = 12427292, upload-time = "2025-09-19T00:10:22.472Z" }, + { url = "https://files.pythonhosted.org/packages/1a/52/ec4a061dd599eb8179d5411d99775bec2a20542505988f40fc2fee781068/mypy-1.18.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1331eb7fd110d60c24999893320967594ff84c38ac6d19e0a76c5fd809a84c86", size = 13163750, upload-time = "2025-09-19T00:09:51.472Z" }, + { url = "https://files.pythonhosted.org/packages/c4/5f/2cf2ceb3b36372d51568f2208c021870fe7834cf3186b653ac6446511839/mypy-1.18.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:3ca30b50a51e7ba93b00422e486cbb124f1c56a535e20eff7b2d6ab72b3b2e37", size = 13351827, upload-time = "2025-09-19T00:09:58.311Z" }, + { url = "https://files.pythonhosted.org/packages/c8/7d/2697b930179e7277529eaaec1513f8de622818696857f689e4a5432e5e27/mypy-1.18.2-cp311-cp311-win_amd64.whl", hash = "sha256:664dc726e67fa54e14536f6e1224bcfce1d9e5ac02426d2326e2bb4e081d1ce8", size = 9757983, upload-time = "2025-09-19T00:10:09.071Z" }, + { url = "https://files.pythonhosted.org/packages/07/06/dfdd2bc60c66611dd8335f463818514733bc763e4760dee289dcc33df709/mypy-1.18.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:33eca32dd124b29400c31d7cf784e795b050ace0e1f91b8dc035672725617e34", size = 12908273, upload-time = "2025-09-19T00:10:58.321Z" }, + { url = "https://files.pythonhosted.org/packages/81/14/6a9de6d13a122d5608e1a04130724caf9170333ac5a924e10f670687d3eb/mypy-1.18.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a3c47adf30d65e89b2dcd2fa32f3aeb5e94ca970d2c15fcb25e297871c8e4764", size = 11920910, upload-time = "2025-09-19T00:10:20.043Z" }, + { url = "https://files.pythonhosted.org/packages/5f/a9/b29de53e42f18e8cc547e38daa9dfa132ffdc64f7250e353f5c8cdd44bee/mypy-1.18.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5d6c838e831a062f5f29d11c9057c6009f60cb294fea33a98422688181fe2893", size = 12465585, upload-time = "2025-09-19T00:10:33.005Z" }, + { url = "https://files.pythonhosted.org/packages/77/ae/6c3d2c7c61ff21f2bee938c917616c92ebf852f015fb55917fd6e2811db2/mypy-1.18.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:01199871b6110a2ce984bde85acd481232d17413868c9807e95c1b0739a58914", size = 13348562, upload-time = "2025-09-19T00:10:11.51Z" }, + { url = "https://files.pythonhosted.org/packages/4d/31/aec68ab3b4aebdf8f36d191b0685d99faa899ab990753ca0fee60fb99511/mypy-1.18.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a2afc0fa0b0e91b4599ddfe0f91e2c26c2b5a5ab263737e998d6817874c5f7c8", size = 13533296, upload-time = "2025-09-19T00:10:06.568Z" }, + { url = "https://files.pythonhosted.org/packages/9f/83/abcb3ad9478fca3ebeb6a5358bb0b22c95ea42b43b7789c7fb1297ca44f4/mypy-1.18.2-cp312-cp312-win_amd64.whl", hash = "sha256:d8068d0afe682c7c4897c0f7ce84ea77f6de953262b12d07038f4d296d547074", size = 9828828, upload-time = "2025-09-19T00:10:28.203Z" }, + { url = "https://files.pythonhosted.org/packages/5f/04/7f462e6fbba87a72bc8097b93f6842499c428a6ff0c81dd46948d175afe8/mypy-1.18.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:07b8b0f580ca6d289e69209ec9d3911b4a26e5abfde32228a288eb79df129fcc", size = 12898728, upload-time = "2025-09-19T00:10:01.33Z" }, + { url = "https://files.pythonhosted.org/packages/99/5b/61ed4efb64f1871b41fd0b82d29a64640f3516078f6c7905b68ab1ad8b13/mypy-1.18.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:ed4482847168439651d3feee5833ccedbf6657e964572706a2adb1f7fa4dfe2e", size = 11910758, upload-time = "2025-09-19T00:10:42.607Z" }, + { url = "https://files.pythonhosted.org/packages/3c/46/d297d4b683cc89a6e4108c4250a6a6b717f5fa96e1a30a7944a6da44da35/mypy-1.18.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c3ad2afadd1e9fea5cf99a45a822346971ede8685cc581ed9cd4d42eaf940986", size = 12475342, upload-time = "2025-09-19T00:11:00.371Z" }, + { url = "https://files.pythonhosted.org/packages/83/45/4798f4d00df13eae3bfdf726c9244bcb495ab5bd588c0eed93a2f2dd67f3/mypy-1.18.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a431a6f1ef14cf8c144c6b14793a23ec4eae3db28277c358136e79d7d062f62d", size = 13338709, upload-time = "2025-09-19T00:11:03.358Z" }, + { url = "https://files.pythonhosted.org/packages/d7/09/479f7358d9625172521a87a9271ddd2441e1dab16a09708f056e97007207/mypy-1.18.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:7ab28cc197f1dd77a67e1c6f35cd1f8e8b73ed2217e4fc005f9e6a504e46e7ba", size = 13529806, upload-time = "2025-09-19T00:10:26.073Z" }, + { url = "https://files.pythonhosted.org/packages/71/cf/ac0f2c7e9d0ea3c75cd99dff7aec1c9df4a1376537cb90e4c882267ee7e9/mypy-1.18.2-cp313-cp313-win_amd64.whl", hash = "sha256:0e2785a84b34a72ba55fb5daf079a1003a34c05b22238da94fcae2bbe46f3544", size = 9833262, upload-time = "2025-09-19T00:10:40.035Z" }, + { url = "https://files.pythonhosted.org/packages/5a/0c/7d5300883da16f0063ae53996358758b2a2df2a09c72a5061fa79a1f5006/mypy-1.18.2-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:62f0e1e988ad41c2a110edde6c398383a889d95b36b3e60bcf155f5164c4fdce", size = 12893775, upload-time = "2025-09-19T00:10:03.814Z" }, + { url = "https://files.pythonhosted.org/packages/50/df/2cffbf25737bdb236f60c973edf62e3e7b4ee1c25b6878629e88e2cde967/mypy-1.18.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:8795a039bab805ff0c1dfdb8cd3344642c2b99b8e439d057aba30850b8d3423d", size = 11936852, upload-time = "2025-09-19T00:10:51.631Z" }, + { url = "https://files.pythonhosted.org/packages/be/50/34059de13dd269227fb4a03be1faee6e2a4b04a2051c82ac0a0b5a773c9a/mypy-1.18.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6ca1e64b24a700ab5ce10133f7ccd956a04715463d30498e64ea8715236f9c9c", size = 12480242, upload-time = "2025-09-19T00:11:07.955Z" }, + { url = "https://files.pythonhosted.org/packages/5b/11/040983fad5132d85914c874a2836252bbc57832065548885b5bb5b0d4359/mypy-1.18.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d924eef3795cc89fecf6bedc6ed32b33ac13e8321344f6ddbf8ee89f706c05cb", size = 13326683, upload-time = "2025-09-19T00:09:55.572Z" }, + { url = "https://files.pythonhosted.org/packages/e9/ba/89b2901dd77414dd7a8c8729985832a5735053be15b744c18e4586e506ef/mypy-1.18.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:20c02215a080e3a2be3aa50506c67242df1c151eaba0dcbc1e4e557922a26075", size = 13514749, upload-time = "2025-09-19T00:10:44.827Z" }, + { url = "https://files.pythonhosted.org/packages/25/bc/cc98767cffd6b2928ba680f3e5bc969c4152bf7c2d83f92f5a504b92b0eb/mypy-1.18.2-cp314-cp314-win_amd64.whl", hash = "sha256:749b5f83198f1ca64345603118a6f01a4e99ad4bf9d103ddc5a3200cc4614adf", size = 9982959, upload-time = "2025-09-19T00:10:37.344Z" }, + { url = "https://files.pythonhosted.org/packages/3f/a6/490ff491d8ecddf8ab91762d4f67635040202f76a44171420bcbe38ceee5/mypy-1.18.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:25a9c8fb67b00599f839cf472713f54249a62efd53a54b565eb61956a7e3296b", size = 12807230, upload-time = "2025-09-19T00:09:49.471Z" }, + { url = "https://files.pythonhosted.org/packages/eb/2e/60076fc829645d167ece9e80db9e8375648d210dab44cc98beb5b322a826/mypy-1.18.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c2b9c7e284ee20e7598d6f42e13ca40b4928e6957ed6813d1ab6348aa3f47133", size = 11895666, upload-time = "2025-09-19T00:10:53.678Z" }, + { url = "https://files.pythonhosted.org/packages/97/4a/1e2880a2a5dda4dc8d9ecd1a7e7606bc0b0e14813637eeda40c38624e037/mypy-1.18.2-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d6985ed057513e344e43a26cc1cd815c7a94602fb6a3130a34798625bc2f07b6", size = 12499608, upload-time = "2025-09-19T00:09:36.204Z" }, + { url = "https://files.pythonhosted.org/packages/00/81/a117f1b73a3015b076b20246b1f341c34a578ebd9662848c6b80ad5c4138/mypy-1.18.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:22f27105f1525ec024b5c630c0b9f36d5c1cc4d447d61fe51ff4bd60633f47ac", size = 13244551, upload-time = "2025-09-19T00:10:17.531Z" }, + { url = "https://files.pythonhosted.org/packages/9b/61/b9f48e1714ce87c7bf0358eb93f60663740ebb08f9ea886ffc670cea7933/mypy-1.18.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:030c52d0ea8144e721e49b1f68391e39553d7451f0c3f8a7565b59e19fcb608b", size = 13491552, upload-time = "2025-09-19T00:10:13.753Z" }, + { url = "https://files.pythonhosted.org/packages/c9/66/b2c0af3b684fa80d1b27501a8bdd3d2daa467ea3992a8aa612f5ca17c2db/mypy-1.18.2-cp39-cp39-win_amd64.whl", hash = "sha256:aa5e07ac1a60a253445797e42b8b2963c9675563a94f11291ab40718b016a7a0", size = 9765635, upload-time = "2025-09-19T00:10:30.993Z" }, + { url = "https://files.pythonhosted.org/packages/87/e3/be76d87158ebafa0309946c4a73831974d4d6ab4f4ef40c3b53a385a66fd/mypy-1.18.2-py3-none-any.whl", hash = "sha256:22a1748707dd62b58d2ae53562ffc4d7f8bcc727e8ac7cbc69c053ddc874d47e", size = 2352367, upload-time = "2025-09-19T00:10:15.489Z" }, ] [[package]] name = "mypy-extensions" -version = "1.0.0" +version = "1.1.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/98/a4/1ab47638b92648243faf97a5aeb6ea83059cc3624972ab6b8d2316078d3f/mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782", size = 4433, upload-time = "2023-02-04T12:11:27.157Z" } +sdist = { url = "https://files.pythonhosted.org/packages/a2/6e/371856a3fb9d31ca8dac321cda606860fa4548858c0cc45d9d1d4ca2628b/mypy_extensions-1.1.0.tar.gz", hash = "sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558", size = 6343, upload-time = "2025-04-22T14:54:24.164Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/2a/e2/5d3f6ada4297caebe1a2add3b126fe800c96f56dbe5d1988a2cbe0b267aa/mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d", size = 4695, upload-time = "2023-02-04T12:11:25.002Z" }, + { url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload-time = "2025-04-22T14:54:22.983Z" }, ] [[package]] @@ -623,292 +786,371 @@ wheels = [ [[package]] name = "packaging" -version = "24.2" +version = "25.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a1/d4/1fc4078c65507b51b96ca8f8c3ba19e6a61c8253c72794544580a7b6c24d/packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f", size = 165727, upload-time = "2025-04-19T11:48:59.673Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", size = 66469, upload-time = "2025-04-19T11:48:57.875Z" }, +] + +[[package]] +name = "pathspec" +version = "0.12.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d0/63/68dbb6eb2de9cb10ee4c9c14a0148804425e13c4fb20d61cce69f53106da/packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f", size = 163950, upload-time = "2024-11-08T09:47:47.202Z" } +sdist = { url = "https://files.pythonhosted.org/packages/ca/bc/f35b8446f4531a7cb215605d100cd88b7ac6f44ab3fc94870c120ab3adbf/pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712", size = 51043, upload-time = "2023-12-10T22:30:45Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451, upload-time = "2024-11-08T09:47:44.722Z" }, + { url = "https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08", size = 31191, upload-time = "2023-12-10T22:30:43.14Z" }, ] [[package]] name = "pluggy" -version = "1.5.0" +version = "1.6.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/96/2d/02d4312c973c6050a18b314a5ad0b3210edb65a906f868e31c111dede4a6/pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1", size = 67955, upload-time = "2024-04-20T21:34:42.531Z" } +sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/88/5f/e351af9a41f866ac3f1fac4ca0613908d9a41741cfcf2228f4ad853b697d/pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669", size = 20556, upload-time = "2024-04-20T21:34:40.434Z" }, + { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, ] [[package]] name = "propcache" -version = "0.3.2" +version = "0.4.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a6/16/43264e4a779dd8588c21a70f0709665ee8f611211bdd2c87d952cfa7c776/propcache-0.3.2.tar.gz", hash = "sha256:20d7d62e4e7ef05f221e0db2856b979540686342e7dd9973b815599c7057e168", size = 44139, upload-time = "2025-06-09T22:56:06.081Z" } +sdist = { url = "https://files.pythonhosted.org/packages/9e/da/e9fc233cf63743258bff22b3dfa7ea5baef7b5bc324af47a0ad89b8ffc6f/propcache-0.4.1.tar.gz", hash = "sha256:f48107a8c637e80362555f37ecf49abe20370e557cc4ab374f04ec4423c97c3d", size = 46442, upload-time = "2025-10-08T19:49:02.291Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/ab/14/510deed325e262afeb8b360043c5d7c960da7d3ecd6d6f9496c9c56dc7f4/propcache-0.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:22d9962a358aedbb7a2e36187ff273adeaab9743373a272976d2e348d08c7770", size = 73178, upload-time = "2025-06-09T22:53:40.126Z" }, - { url = "https://files.pythonhosted.org/packages/cd/4e/ad52a7925ff01c1325653a730c7ec3175a23f948f08626a534133427dcff/propcache-0.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0d0fda578d1dc3f77b6b5a5dce3b9ad69a8250a891760a548df850a5e8da87f3", size = 43133, upload-time = "2025-06-09T22:53:41.965Z" }, - { url = "https://files.pythonhosted.org/packages/63/7c/e9399ba5da7780871db4eac178e9c2e204c23dd3e7d32df202092a1ed400/propcache-0.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3def3da3ac3ce41562d85db655d18ebac740cb3fa4367f11a52b3da9d03a5cc3", size = 43039, upload-time = "2025-06-09T22:53:43.268Z" }, - { url = "https://files.pythonhosted.org/packages/22/e1/58da211eb8fdc6fc854002387d38f415a6ca5f5c67c1315b204a5d3e9d7a/propcache-0.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9bec58347a5a6cebf239daba9bda37dffec5b8d2ce004d9fe4edef3d2815137e", size = 201903, upload-time = "2025-06-09T22:53:44.872Z" }, - { url = "https://files.pythonhosted.org/packages/c4/0a/550ea0f52aac455cb90111c8bab995208443e46d925e51e2f6ebdf869525/propcache-0.3.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:55ffda449a507e9fbd4aca1a7d9aa6753b07d6166140e5a18d2ac9bc49eac220", size = 213362, upload-time = "2025-06-09T22:53:46.707Z" }, - { url = "https://files.pythonhosted.org/packages/5a/af/9893b7d878deda9bb69fcf54600b247fba7317761b7db11fede6e0f28bd0/propcache-0.3.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:64a67fb39229a8a8491dd42f864e5e263155e729c2e7ff723d6e25f596b1e8cb", size = 210525, upload-time = "2025-06-09T22:53:48.547Z" }, - { url = "https://files.pythonhosted.org/packages/7c/bb/38fd08b278ca85cde36d848091ad2b45954bc5f15cce494bb300b9285831/propcache-0.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9da1cf97b92b51253d5b68cf5a2b9e0dafca095e36b7f2da335e27dc6172a614", size = 198283, upload-time = "2025-06-09T22:53:50.067Z" }, - { url = "https://files.pythonhosted.org/packages/78/8c/9fe55bd01d362bafb413dfe508c48753111a1e269737fa143ba85693592c/propcache-0.3.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5f559e127134b07425134b4065be45b166183fdcb433cb6c24c8e4149056ad50", size = 191872, upload-time = "2025-06-09T22:53:51.438Z" }, - { url = "https://files.pythonhosted.org/packages/54/14/4701c33852937a22584e08abb531d654c8bcf7948a8f87ad0a4822394147/propcache-0.3.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:aff2e4e06435d61f11a428360a932138d0ec288b0a31dd9bd78d200bd4a2b339", size = 199452, upload-time = "2025-06-09T22:53:53.229Z" }, - { url = "https://files.pythonhosted.org/packages/16/44/447f2253d859602095356007657ee535e0093215ea0b3d1d6a41d16e5201/propcache-0.3.2-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:4927842833830942a5d0a56e6f4839bc484785b8e1ce8d287359794818633ba0", size = 191567, upload-time = "2025-06-09T22:53:54.541Z" }, - { url = "https://files.pythonhosted.org/packages/f2/b3/e4756258749bb2d3b46defcff606a2f47410bab82be5824a67e84015b267/propcache-0.3.2-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:6107ddd08b02654a30fb8ad7a132021759d750a82578b94cd55ee2772b6ebea2", size = 193015, upload-time = "2025-06-09T22:53:56.44Z" }, - { url = "https://files.pythonhosted.org/packages/1e/df/e6d3c7574233164b6330b9fd697beeac402afd367280e6dc377bb99b43d9/propcache-0.3.2-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:70bd8b9cd6b519e12859c99f3fc9a93f375ebd22a50296c3a295028bea73b9e7", size = 204660, upload-time = "2025-06-09T22:53:57.839Z" }, - { url = "https://files.pythonhosted.org/packages/b2/53/e4d31dd5170b4a0e2e6b730f2385a96410633b4833dc25fe5dffd1f73294/propcache-0.3.2-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:2183111651d710d3097338dd1893fcf09c9f54e27ff1a8795495a16a469cc90b", size = 206105, upload-time = "2025-06-09T22:53:59.638Z" }, - { url = "https://files.pythonhosted.org/packages/7f/fe/74d54cf9fbe2a20ff786e5f7afcfde446588f0cf15fb2daacfbc267b866c/propcache-0.3.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:fb075ad271405dcad8e2a7ffc9a750a3bf70e533bd86e89f0603e607b93aa64c", size = 196980, upload-time = "2025-06-09T22:54:01.071Z" }, - { url = "https://files.pythonhosted.org/packages/22/ec/c469c9d59dada8a7679625e0440b544fe72e99311a4679c279562051f6fc/propcache-0.3.2-cp310-cp310-win32.whl", hash = "sha256:404d70768080d3d3bdb41d0771037da19d8340d50b08e104ca0e7f9ce55fce70", size = 37679, upload-time = "2025-06-09T22:54:03.003Z" }, - { url = "https://files.pythonhosted.org/packages/38/35/07a471371ac89d418f8d0b699c75ea6dca2041fbda360823de21f6a9ce0a/propcache-0.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:7435d766f978b4ede777002e6b3b6641dd229cd1da8d3d3106a45770365f9ad9", size = 41459, upload-time = "2025-06-09T22:54:04.134Z" }, - { url = "https://files.pythonhosted.org/packages/80/8d/e8b436717ab9c2cfc23b116d2c297305aa4cd8339172a456d61ebf5669b8/propcache-0.3.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:0b8d2f607bd8f80ddc04088bc2a037fdd17884a6fcadc47a96e334d72f3717be", size = 74207, upload-time = "2025-06-09T22:54:05.399Z" }, - { url = "https://files.pythonhosted.org/packages/d6/29/1e34000e9766d112171764b9fa3226fa0153ab565d0c242c70e9945318a7/propcache-0.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:06766d8f34733416e2e34f46fea488ad5d60726bb9481d3cddf89a6fa2d9603f", size = 43648, upload-time = "2025-06-09T22:54:08.023Z" }, - { url = "https://files.pythonhosted.org/packages/46/92/1ad5af0df781e76988897da39b5f086c2bf0f028b7f9bd1f409bb05b6874/propcache-0.3.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a2dc1f4a1df4fecf4e6f68013575ff4af84ef6f478fe5344317a65d38a8e6dc9", size = 43496, upload-time = "2025-06-09T22:54:09.228Z" }, - { url = "https://files.pythonhosted.org/packages/b3/ce/e96392460f9fb68461fabab3e095cb00c8ddf901205be4eae5ce246e5b7e/propcache-0.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:be29c4f4810c5789cf10ddf6af80b041c724e629fa51e308a7a0fb19ed1ef7bf", size = 217288, upload-time = "2025-06-09T22:54:10.466Z" }, - { url = "https://files.pythonhosted.org/packages/c5/2a/866726ea345299f7ceefc861a5e782b045545ae6940851930a6adaf1fca6/propcache-0.3.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:59d61f6970ecbd8ff2e9360304d5c8876a6abd4530cb752c06586849ac8a9dc9", size = 227456, upload-time = "2025-06-09T22:54:11.828Z" }, - { url = "https://files.pythonhosted.org/packages/de/03/07d992ccb6d930398689187e1b3c718339a1c06b8b145a8d9650e4726166/propcache-0.3.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:62180e0b8dbb6b004baec00a7983e4cc52f5ada9cd11f48c3528d8cfa7b96a66", size = 225429, upload-time = "2025-06-09T22:54:13.823Z" }, - { url = "https://files.pythonhosted.org/packages/5d/e6/116ba39448753b1330f48ab8ba927dcd6cf0baea8a0ccbc512dfb49ba670/propcache-0.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c144ca294a204c470f18cf4c9d78887810d04a3e2fbb30eea903575a779159df", size = 213472, upload-time = "2025-06-09T22:54:15.232Z" }, - { url = "https://files.pythonhosted.org/packages/a6/85/f01f5d97e54e428885a5497ccf7f54404cbb4f906688a1690cd51bf597dc/propcache-0.3.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c5c2a784234c28854878d68978265617aa6dc0780e53d44b4d67f3651a17a9a2", size = 204480, upload-time = "2025-06-09T22:54:17.104Z" }, - { url = "https://files.pythonhosted.org/packages/e3/79/7bf5ab9033b8b8194cc3f7cf1aaa0e9c3256320726f64a3e1f113a812dce/propcache-0.3.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:5745bc7acdafa978ca1642891b82c19238eadc78ba2aaa293c6863b304e552d7", size = 214530, upload-time = "2025-06-09T22:54:18.512Z" }, - { url = "https://files.pythonhosted.org/packages/31/0b/bd3e0c00509b609317df4a18e6b05a450ef2d9a963e1d8bc9c9415d86f30/propcache-0.3.2-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:c0075bf773d66fa8c9d41f66cc132ecc75e5bb9dd7cce3cfd14adc5ca184cb95", size = 205230, upload-time = "2025-06-09T22:54:19.947Z" }, - { url = "https://files.pythonhosted.org/packages/7a/23/fae0ff9b54b0de4e819bbe559508da132d5683c32d84d0dc2ccce3563ed4/propcache-0.3.2-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:5f57aa0847730daceff0497f417c9de353c575d8da3579162cc74ac294c5369e", size = 206754, upload-time = "2025-06-09T22:54:21.716Z" }, - { url = "https://files.pythonhosted.org/packages/b7/7f/ad6a3c22630aaa5f618b4dc3c3598974a72abb4c18e45a50b3cdd091eb2f/propcache-0.3.2-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:eef914c014bf72d18efb55619447e0aecd5fb7c2e3fa7441e2e5d6099bddff7e", size = 218430, upload-time = "2025-06-09T22:54:23.17Z" }, - { url = "https://files.pythonhosted.org/packages/5b/2c/ba4f1c0e8a4b4c75910742f0d333759d441f65a1c7f34683b4a74c0ee015/propcache-0.3.2-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:2a4092e8549031e82facf3decdbc0883755d5bbcc62d3aea9d9e185549936dcf", size = 223884, upload-time = "2025-06-09T22:54:25.539Z" }, - { url = "https://files.pythonhosted.org/packages/88/e4/ebe30fc399e98572019eee82ad0caf512401661985cbd3da5e3140ffa1b0/propcache-0.3.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:85871b050f174bc0bfb437efbdb68aaf860611953ed12418e4361bc9c392749e", size = 211480, upload-time = "2025-06-09T22:54:26.892Z" }, - { url = "https://files.pythonhosted.org/packages/96/0a/7d5260b914e01d1d0906f7f38af101f8d8ed0dc47426219eeaf05e8ea7c2/propcache-0.3.2-cp311-cp311-win32.whl", hash = "sha256:36c8d9b673ec57900c3554264e630d45980fd302458e4ac801802a7fd2ef7897", size = 37757, upload-time = "2025-06-09T22:54:28.241Z" }, - { url = "https://files.pythonhosted.org/packages/e1/2d/89fe4489a884bc0da0c3278c552bd4ffe06a1ace559db5ef02ef24ab446b/propcache-0.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:e53af8cb6a781b02d2ea079b5b853ba9430fcbe18a8e3ce647d5982a3ff69f39", size = 41500, upload-time = "2025-06-09T22:54:29.4Z" }, - { url = "https://files.pythonhosted.org/packages/a8/42/9ca01b0a6f48e81615dca4765a8f1dd2c057e0540f6116a27dc5ee01dfb6/propcache-0.3.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:8de106b6c84506b31c27168582cd3cb3000a6412c16df14a8628e5871ff83c10", size = 73674, upload-time = "2025-06-09T22:54:30.551Z" }, - { url = "https://files.pythonhosted.org/packages/af/6e/21293133beb550f9c901bbece755d582bfaf2176bee4774000bd4dd41884/propcache-0.3.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:28710b0d3975117239c76600ea351934ac7b5ff56e60953474342608dbbb6154", size = 43570, upload-time = "2025-06-09T22:54:32.296Z" }, - { url = "https://files.pythonhosted.org/packages/0c/c8/0393a0a3a2b8760eb3bde3c147f62b20044f0ddac81e9d6ed7318ec0d852/propcache-0.3.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ce26862344bdf836650ed2487c3d724b00fbfec4233a1013f597b78c1cb73615", size = 43094, upload-time = "2025-06-09T22:54:33.929Z" }, - { url = "https://files.pythonhosted.org/packages/37/2c/489afe311a690399d04a3e03b069225670c1d489eb7b044a566511c1c498/propcache-0.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bca54bd347a253af2cf4544bbec232ab982f4868de0dd684246b67a51bc6b1db", size = 226958, upload-time = "2025-06-09T22:54:35.186Z" }, - { url = "https://files.pythonhosted.org/packages/9d/ca/63b520d2f3d418c968bf596839ae26cf7f87bead026b6192d4da6a08c467/propcache-0.3.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:55780d5e9a2ddc59711d727226bb1ba83a22dd32f64ee15594b9392b1f544eb1", size = 234894, upload-time = "2025-06-09T22:54:36.708Z" }, - { url = "https://files.pythonhosted.org/packages/11/60/1d0ed6fff455a028d678df30cc28dcee7af77fa2b0e6962ce1df95c9a2a9/propcache-0.3.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:035e631be25d6975ed87ab23153db6a73426a48db688070d925aa27e996fe93c", size = 233672, upload-time = "2025-06-09T22:54:38.062Z" }, - { url = "https://files.pythonhosted.org/packages/37/7c/54fd5301ef38505ab235d98827207176a5c9b2aa61939b10a460ca53e123/propcache-0.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ee6f22b6eaa39297c751d0e80c0d3a454f112f5c6481214fcf4c092074cecd67", size = 224395, upload-time = "2025-06-09T22:54:39.634Z" }, - { url = "https://files.pythonhosted.org/packages/ee/1a/89a40e0846f5de05fdc6779883bf46ba980e6df4d2ff8fb02643de126592/propcache-0.3.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7ca3aee1aa955438c4dba34fc20a9f390e4c79967257d830f137bd5a8a32ed3b", size = 212510, upload-time = "2025-06-09T22:54:41.565Z" }, - { url = "https://files.pythonhosted.org/packages/5e/33/ca98368586c9566a6b8d5ef66e30484f8da84c0aac3f2d9aec6d31a11bd5/propcache-0.3.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:7a4f30862869fa2b68380d677cc1c5fcf1e0f2b9ea0cf665812895c75d0ca3b8", size = 222949, upload-time = "2025-06-09T22:54:43.038Z" }, - { url = "https://files.pythonhosted.org/packages/ba/11/ace870d0aafe443b33b2f0b7efdb872b7c3abd505bfb4890716ad7865e9d/propcache-0.3.2-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:b77ec3c257d7816d9f3700013639db7491a434644c906a2578a11daf13176251", size = 217258, upload-time = "2025-06-09T22:54:44.376Z" }, - { url = "https://files.pythonhosted.org/packages/5b/d2/86fd6f7adffcfc74b42c10a6b7db721d1d9ca1055c45d39a1a8f2a740a21/propcache-0.3.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:cab90ac9d3f14b2d5050928483d3d3b8fb6b4018893fc75710e6aa361ecb2474", size = 213036, upload-time = "2025-06-09T22:54:46.243Z" }, - { url = "https://files.pythonhosted.org/packages/07/94/2d7d1e328f45ff34a0a284cf5a2847013701e24c2a53117e7c280a4316b3/propcache-0.3.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:0b504d29f3c47cf6b9e936c1852246c83d450e8e063d50562115a6be6d3a2535", size = 227684, upload-time = "2025-06-09T22:54:47.63Z" }, - { url = "https://files.pythonhosted.org/packages/b7/05/37ae63a0087677e90b1d14710e532ff104d44bc1efa3b3970fff99b891dc/propcache-0.3.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:ce2ac2675a6aa41ddb2a0c9cbff53780a617ac3d43e620f8fd77ba1c84dcfc06", size = 234562, upload-time = "2025-06-09T22:54:48.982Z" }, - { url = "https://files.pythonhosted.org/packages/a4/7c/3f539fcae630408d0bd8bf3208b9a647ccad10976eda62402a80adf8fc34/propcache-0.3.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:62b4239611205294cc433845b914131b2a1f03500ff3c1ed093ed216b82621e1", size = 222142, upload-time = "2025-06-09T22:54:50.424Z" }, - { url = "https://files.pythonhosted.org/packages/7c/d2/34b9eac8c35f79f8a962546b3e97e9d4b990c420ee66ac8255d5d9611648/propcache-0.3.2-cp312-cp312-win32.whl", hash = "sha256:df4a81b9b53449ebc90cc4deefb052c1dd934ba85012aa912c7ea7b7e38b60c1", size = 37711, upload-time = "2025-06-09T22:54:52.072Z" }, - { url = "https://files.pythonhosted.org/packages/19/61/d582be5d226cf79071681d1b46b848d6cb03d7b70af7063e33a2787eaa03/propcache-0.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:7046e79b989d7fe457bb755844019e10f693752d169076138abf17f31380800c", size = 41479, upload-time = "2025-06-09T22:54:53.234Z" }, - { url = "https://files.pythonhosted.org/packages/dc/d1/8c747fafa558c603c4ca19d8e20b288aa0c7cda74e9402f50f31eb65267e/propcache-0.3.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ca592ed634a73ca002967458187109265e980422116c0a107cf93d81f95af945", size = 71286, upload-time = "2025-06-09T22:54:54.369Z" }, - { url = "https://files.pythonhosted.org/packages/61/99/d606cb7986b60d89c36de8a85d58764323b3a5ff07770a99d8e993b3fa73/propcache-0.3.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:9ecb0aad4020e275652ba3975740f241bd12a61f1a784df044cf7477a02bc252", size = 42425, upload-time = "2025-06-09T22:54:55.642Z" }, - { url = "https://files.pythonhosted.org/packages/8c/96/ef98f91bbb42b79e9bb82bdd348b255eb9d65f14dbbe3b1594644c4073f7/propcache-0.3.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:7f08f1cc28bd2eade7a8a3d2954ccc673bb02062e3e7da09bc75d843386b342f", size = 41846, upload-time = "2025-06-09T22:54:57.246Z" }, - { url = "https://files.pythonhosted.org/packages/5b/ad/3f0f9a705fb630d175146cd7b1d2bf5555c9beaed54e94132b21aac098a6/propcache-0.3.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d1a342c834734edb4be5ecb1e9fb48cb64b1e2320fccbd8c54bf8da8f2a84c33", size = 208871, upload-time = "2025-06-09T22:54:58.975Z" }, - { url = "https://files.pythonhosted.org/packages/3a/38/2085cda93d2c8b6ec3e92af2c89489a36a5886b712a34ab25de9fbca7992/propcache-0.3.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8a544caaae1ac73f1fecfae70ded3e93728831affebd017d53449e3ac052ac1e", size = 215720, upload-time = "2025-06-09T22:55:00.471Z" }, - { url = "https://files.pythonhosted.org/packages/61/c1/d72ea2dc83ac7f2c8e182786ab0fc2c7bd123a1ff9b7975bee671866fe5f/propcache-0.3.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:310d11aa44635298397db47a3ebce7db99a4cc4b9bbdfcf6c98a60c8d5261cf1", size = 215203, upload-time = "2025-06-09T22:55:01.834Z" }, - { url = "https://files.pythonhosted.org/packages/af/81/b324c44ae60c56ef12007105f1460d5c304b0626ab0cc6b07c8f2a9aa0b8/propcache-0.3.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c1396592321ac83157ac03a2023aa6cc4a3cc3cfdecb71090054c09e5a7cce3", size = 206365, upload-time = "2025-06-09T22:55:03.199Z" }, - { url = "https://files.pythonhosted.org/packages/09/73/88549128bb89e66d2aff242488f62869014ae092db63ccea53c1cc75a81d/propcache-0.3.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8cabf5b5902272565e78197edb682017d21cf3b550ba0460ee473753f28d23c1", size = 196016, upload-time = "2025-06-09T22:55:04.518Z" }, - { url = "https://files.pythonhosted.org/packages/b9/3f/3bdd14e737d145114a5eb83cb172903afba7242f67c5877f9909a20d948d/propcache-0.3.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:0a2f2235ac46a7aa25bdeb03a9e7060f6ecbd213b1f9101c43b3090ffb971ef6", size = 205596, upload-time = "2025-06-09T22:55:05.942Z" }, - { url = "https://files.pythonhosted.org/packages/0f/ca/2f4aa819c357d3107c3763d7ef42c03980f9ed5c48c82e01e25945d437c1/propcache-0.3.2-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:92b69e12e34869a6970fd2f3da91669899994b47c98f5d430b781c26f1d9f387", size = 200977, upload-time = "2025-06-09T22:55:07.792Z" }, - { url = "https://files.pythonhosted.org/packages/cd/4a/e65276c7477533c59085251ae88505caf6831c0e85ff8b2e31ebcbb949b1/propcache-0.3.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:54e02207c79968ebbdffc169591009f4474dde3b4679e16634d34c9363ff56b4", size = 197220, upload-time = "2025-06-09T22:55:09.173Z" }, - { url = "https://files.pythonhosted.org/packages/7c/54/fc7152e517cf5578278b242396ce4d4b36795423988ef39bb8cd5bf274c8/propcache-0.3.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:4adfb44cb588001f68c5466579d3f1157ca07f7504fc91ec87862e2b8e556b88", size = 210642, upload-time = "2025-06-09T22:55:10.62Z" }, - { url = "https://files.pythonhosted.org/packages/b9/80/abeb4a896d2767bf5f1ea7b92eb7be6a5330645bd7fb844049c0e4045d9d/propcache-0.3.2-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:fd3e6019dc1261cd0291ee8919dd91fbab7b169bb76aeef6c716833a3f65d206", size = 212789, upload-time = "2025-06-09T22:55:12.029Z" }, - { url = "https://files.pythonhosted.org/packages/b3/db/ea12a49aa7b2b6d68a5da8293dcf50068d48d088100ac016ad92a6a780e6/propcache-0.3.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4c181cad81158d71c41a2bce88edce078458e2dd5ffee7eddd6b05da85079f43", size = 205880, upload-time = "2025-06-09T22:55:13.45Z" }, - { url = "https://files.pythonhosted.org/packages/d1/e5/9076a0bbbfb65d1198007059c65639dfd56266cf8e477a9707e4b1999ff4/propcache-0.3.2-cp313-cp313-win32.whl", hash = "sha256:8a08154613f2249519e549de2330cf8e2071c2887309a7b07fb56098f5170a02", size = 37220, upload-time = "2025-06-09T22:55:15.284Z" }, - { url = "https://files.pythonhosted.org/packages/d3/f5/b369e026b09a26cd77aa88d8fffd69141d2ae00a2abaaf5380d2603f4b7f/propcache-0.3.2-cp313-cp313-win_amd64.whl", hash = "sha256:e41671f1594fc4ab0a6dec1351864713cb3a279910ae8b58f884a88a0a632c05", size = 40678, upload-time = "2025-06-09T22:55:16.445Z" }, - { url = "https://files.pythonhosted.org/packages/a4/3a/6ece377b55544941a08d03581c7bc400a3c8cd3c2865900a68d5de79e21f/propcache-0.3.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:9a3cf035bbaf035f109987d9d55dc90e4b0e36e04bbbb95af3055ef17194057b", size = 76560, upload-time = "2025-06-09T22:55:17.598Z" }, - { url = "https://files.pythonhosted.org/packages/0c/da/64a2bb16418740fa634b0e9c3d29edff1db07f56d3546ca2d86ddf0305e1/propcache-0.3.2-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:156c03d07dc1323d8dacaa221fbe028c5c70d16709cdd63502778e6c3ccca1b0", size = 44676, upload-time = "2025-06-09T22:55:18.922Z" }, - { url = "https://files.pythonhosted.org/packages/36/7b/f025e06ea51cb72c52fb87e9b395cced02786610b60a3ed51da8af017170/propcache-0.3.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:74413c0ba02ba86f55cf60d18daab219f7e531620c15f1e23d95563f505efe7e", size = 44701, upload-time = "2025-06-09T22:55:20.106Z" }, - { url = "https://files.pythonhosted.org/packages/a4/00/faa1b1b7c3b74fc277f8642f32a4c72ba1d7b2de36d7cdfb676db7f4303e/propcache-0.3.2-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f066b437bb3fa39c58ff97ab2ca351db465157d68ed0440abecb21715eb24b28", size = 276934, upload-time = "2025-06-09T22:55:21.5Z" }, - { url = "https://files.pythonhosted.org/packages/74/ab/935beb6f1756e0476a4d5938ff44bf0d13a055fed880caf93859b4f1baf4/propcache-0.3.2-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f1304b085c83067914721e7e9d9917d41ad87696bf70f0bc7dee450e9c71ad0a", size = 278316, upload-time = "2025-06-09T22:55:22.918Z" }, - { url = "https://files.pythonhosted.org/packages/f8/9d/994a5c1ce4389610838d1caec74bdf0e98b306c70314d46dbe4fcf21a3e2/propcache-0.3.2-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ab50cef01b372763a13333b4e54021bdcb291fc9a8e2ccb9c2df98be51bcde6c", size = 282619, upload-time = "2025-06-09T22:55:24.651Z" }, - { url = "https://files.pythonhosted.org/packages/2b/00/a10afce3d1ed0287cef2e09506d3be9822513f2c1e96457ee369adb9a6cd/propcache-0.3.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fad3b2a085ec259ad2c2842666b2a0a49dea8463579c606426128925af1ed725", size = 265896, upload-time = "2025-06-09T22:55:26.049Z" }, - { url = "https://files.pythonhosted.org/packages/2e/a8/2aa6716ffa566ca57c749edb909ad27884680887d68517e4be41b02299f3/propcache-0.3.2-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:261fa020c1c14deafd54c76b014956e2f86991af198c51139faf41c4d5e83892", size = 252111, upload-time = "2025-06-09T22:55:27.381Z" }, - { url = "https://files.pythonhosted.org/packages/36/4f/345ca9183b85ac29c8694b0941f7484bf419c7f0fea2d1e386b4f7893eed/propcache-0.3.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:46d7f8aa79c927e5f987ee3a80205c987717d3659f035c85cf0c3680526bdb44", size = 268334, upload-time = "2025-06-09T22:55:28.747Z" }, - { url = "https://files.pythonhosted.org/packages/3e/ca/fcd54f78b59e3f97b3b9715501e3147f5340167733d27db423aa321e7148/propcache-0.3.2-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:6d8f3f0eebf73e3c0ff0e7853f68be638b4043c65a70517bb575eff54edd8dbe", size = 255026, upload-time = "2025-06-09T22:55:30.184Z" }, - { url = "https://files.pythonhosted.org/packages/8b/95/8e6a6bbbd78ac89c30c225210a5c687790e532ba4088afb8c0445b77ef37/propcache-0.3.2-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:03c89c1b14a5452cf15403e291c0ccd7751d5b9736ecb2c5bab977ad6c5bcd81", size = 250724, upload-time = "2025-06-09T22:55:31.646Z" }, - { url = "https://files.pythonhosted.org/packages/ee/b0/0dd03616142baba28e8b2d14ce5df6631b4673850a3d4f9c0f9dd714a404/propcache-0.3.2-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:0cc17efde71e12bbaad086d679ce575268d70bc123a5a71ea7ad76f70ba30bba", size = 268868, upload-time = "2025-06-09T22:55:33.209Z" }, - { url = "https://files.pythonhosted.org/packages/c5/98/2c12407a7e4fbacd94ddd32f3b1e3d5231e77c30ef7162b12a60e2dd5ce3/propcache-0.3.2-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:acdf05d00696bc0447e278bb53cb04ca72354e562cf88ea6f9107df8e7fd9770", size = 271322, upload-time = "2025-06-09T22:55:35.065Z" }, - { url = "https://files.pythonhosted.org/packages/35/91/9cb56efbb428b006bb85db28591e40b7736847b8331d43fe335acf95f6c8/propcache-0.3.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:4445542398bd0b5d32df908031cb1b30d43ac848e20470a878b770ec2dcc6330", size = 265778, upload-time = "2025-06-09T22:55:36.45Z" }, - { url = "https://files.pythonhosted.org/packages/9a/4c/b0fe775a2bdd01e176b14b574be679d84fc83958335790f7c9a686c1f468/propcache-0.3.2-cp313-cp313t-win32.whl", hash = "sha256:f86e5d7cd03afb3a1db8e9f9f6eff15794e79e791350ac48a8c924e6f439f394", size = 41175, upload-time = "2025-06-09T22:55:38.436Z" }, - { url = "https://files.pythonhosted.org/packages/a4/ff/47f08595e3d9b5e149c150f88d9714574f1a7cbd89fe2817158a952674bf/propcache-0.3.2-cp313-cp313t-win_amd64.whl", hash = "sha256:9704bedf6e7cbe3c65eca4379a9b53ee6a83749f047808cbb5044d40d7d72198", size = 44857, upload-time = "2025-06-09T22:55:39.687Z" }, - { url = "https://files.pythonhosted.org/packages/6c/39/8ea9bcfaaff16fd0b0fc901ee522e24c9ec44b4ca0229cfffb8066a06959/propcache-0.3.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:a7fad897f14d92086d6b03fdd2eb844777b0c4d7ec5e3bac0fbae2ab0602bbe5", size = 74678, upload-time = "2025-06-09T22:55:41.227Z" }, - { url = "https://files.pythonhosted.org/packages/d3/85/cab84c86966e1d354cf90cdc4ba52f32f99a5bca92a1529d666d957d7686/propcache-0.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1f43837d4ca000243fd7fd6301947d7cb93360d03cd08369969450cc6b2ce3b4", size = 43829, upload-time = "2025-06-09T22:55:42.417Z" }, - { url = "https://files.pythonhosted.org/packages/23/f7/9cb719749152d8b26d63801b3220ce2d3931312b2744d2b3a088b0ee9947/propcache-0.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:261df2e9474a5949c46e962065d88eb9b96ce0f2bd30e9d3136bcde84befd8f2", size = 43729, upload-time = "2025-06-09T22:55:43.651Z" }, - { url = "https://files.pythonhosted.org/packages/a2/a2/0b2b5a210ff311260002a315f6f9531b65a36064dfb804655432b2f7d3e3/propcache-0.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e514326b79e51f0a177daab1052bc164d9d9e54133797a3a58d24c9c87a3fe6d", size = 204483, upload-time = "2025-06-09T22:55:45.327Z" }, - { url = "https://files.pythonhosted.org/packages/3f/e0/7aff5de0c535f783b0c8be5bdb750c305c1961d69fbb136939926e155d98/propcache-0.3.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d4a996adb6904f85894570301939afeee65f072b4fd265ed7e569e8d9058e4ec", size = 217425, upload-time = "2025-06-09T22:55:46.729Z" }, - { url = "https://files.pythonhosted.org/packages/92/1d/65fa889eb3b2a7d6e4ed3c2b568a9cb8817547a1450b572de7bf24872800/propcache-0.3.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:76cace5d6b2a54e55b137669b30f31aa15977eeed390c7cbfb1dafa8dfe9a701", size = 214723, upload-time = "2025-06-09T22:55:48.342Z" }, - { url = "https://files.pythonhosted.org/packages/9a/e2/eecf6989870988dfd731de408a6fa366e853d361a06c2133b5878ce821ad/propcache-0.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:31248e44b81d59d6addbb182c4720f90b44e1efdc19f58112a3c3a1615fb47ef", size = 200166, upload-time = "2025-06-09T22:55:49.775Z" }, - { url = "https://files.pythonhosted.org/packages/12/06/c32be4950967f18f77489268488c7cdc78cbfc65a8ba8101b15e526b83dc/propcache-0.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:abb7fa19dbf88d3857363e0493b999b8011eea856b846305d8c0512dfdf8fbb1", size = 194004, upload-time = "2025-06-09T22:55:51.335Z" }, - { url = "https://files.pythonhosted.org/packages/46/6c/17b521a6b3b7cbe277a4064ff0aa9129dd8c89f425a5a9b6b4dd51cc3ff4/propcache-0.3.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:d81ac3ae39d38588ad0549e321e6f773a4e7cc68e7751524a22885d5bbadf886", size = 203075, upload-time = "2025-06-09T22:55:52.681Z" }, - { url = "https://files.pythonhosted.org/packages/62/cb/3bdba2b736b3e45bc0e40f4370f745b3e711d439ffbffe3ae416393eece9/propcache-0.3.2-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:cc2782eb0f7a16462285b6f8394bbbd0e1ee5f928034e941ffc444012224171b", size = 195407, upload-time = "2025-06-09T22:55:54.048Z" }, - { url = "https://files.pythonhosted.org/packages/29/bd/760c5c6a60a4a2c55a421bc34a25ba3919d49dee411ddb9d1493bb51d46e/propcache-0.3.2-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:db429c19a6c7e8a1c320e6a13c99799450f411b02251fb1b75e6217cf4a14fcb", size = 196045, upload-time = "2025-06-09T22:55:55.485Z" }, - { url = "https://files.pythonhosted.org/packages/76/58/ced2757a46f55b8c84358d6ab8de4faf57cba831c51e823654da7144b13a/propcache-0.3.2-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:21d8759141a9e00a681d35a1f160892a36fb6caa715ba0b832f7747da48fb6ea", size = 208432, upload-time = "2025-06-09T22:55:56.884Z" }, - { url = "https://files.pythonhosted.org/packages/bb/ec/d98ea8d5a4d8fe0e372033f5254eddf3254344c0c5dc6c49ab84349e4733/propcache-0.3.2-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:2ca6d378f09adb13837614ad2754fa8afaee330254f404299611bce41a8438cb", size = 210100, upload-time = "2025-06-09T22:55:58.498Z" }, - { url = "https://files.pythonhosted.org/packages/56/84/b6d8a7ecf3f62d7dd09d9d10bbf89fad6837970ef868b35b5ffa0d24d9de/propcache-0.3.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:34a624af06c048946709f4278b4176470073deda88d91342665d95f7c6270fbe", size = 200712, upload-time = "2025-06-09T22:55:59.906Z" }, - { url = "https://files.pythonhosted.org/packages/bf/32/889f4903ddfe4a9dc61da71ee58b763758cf2d608fe1decede06e6467f8d/propcache-0.3.2-cp39-cp39-win32.whl", hash = "sha256:4ba3fef1c30f306b1c274ce0b8baaa2c3cdd91f645c48f06394068f37d3837a1", size = 38187, upload-time = "2025-06-09T22:56:01.212Z" }, - { url = "https://files.pythonhosted.org/packages/67/74/d666795fb9ba1dc139d30de64f3b6fd1ff9c9d3d96ccfdb992cd715ce5d2/propcache-0.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:7a2368eed65fc69a7a7a40b27f22e85e7627b74216f0846b04ba5c116e191ec9", size = 42025, upload-time = "2025-06-09T22:56:02.875Z" }, - { url = "https://files.pythonhosted.org/packages/cc/35/cc0aaecf278bb4575b8555f2b137de5ab821595ddae9da9d3cd1da4072c7/propcache-0.3.2-py3-none-any.whl", hash = "sha256:98f1ec44fb675f5052cccc8e609c46ed23a35a1cfd18545ad4e29002d858a43f", size = 12663, upload-time = "2025-06-09T22:56:04.484Z" }, + { url = "https://files.pythonhosted.org/packages/3c/0e/934b541323035566a9af292dba85a195f7b78179114f2c6ebb24551118a9/propcache-0.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7c2d1fa3201efaf55d730400d945b5b3ab6e672e100ba0f9a409d950ab25d7db", size = 79534, upload-time = "2025-10-08T19:46:02.083Z" }, + { url = "https://files.pythonhosted.org/packages/a1/6b/db0d03d96726d995dc7171286c6ba9d8d14251f37433890f88368951a44e/propcache-0.4.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1eb2994229cc8ce7fe9b3db88f5465f5fd8651672840b2e426b88cdb1a30aac8", size = 45526, upload-time = "2025-10-08T19:46:03.884Z" }, + { url = "https://files.pythonhosted.org/packages/e4/c3/82728404aea669e1600f304f2609cde9e665c18df5a11cdd57ed73c1dceb/propcache-0.4.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:66c1f011f45a3b33d7bcb22daed4b29c0c9e2224758b6be00686731e1b46f925", size = 47263, upload-time = "2025-10-08T19:46:05.405Z" }, + { url = "https://files.pythonhosted.org/packages/df/1b/39313ddad2bf9187a1432654c38249bab4562ef535ef07f5eb6eb04d0b1b/propcache-0.4.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9a52009f2adffe195d0b605c25ec929d26b36ef986ba85244891dee3b294df21", size = 201012, upload-time = "2025-10-08T19:46:07.165Z" }, + { url = "https://files.pythonhosted.org/packages/5b/01/f1d0b57d136f294a142acf97f4ed58c8e5b974c21e543000968357115011/propcache-0.4.1-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5d4e2366a9c7b837555cf02fb9be2e3167d333aff716332ef1b7c3a142ec40c5", size = 209491, upload-time = "2025-10-08T19:46:08.909Z" }, + { url = "https://files.pythonhosted.org/packages/a1/c8/038d909c61c5bb039070b3fb02ad5cccdb1dde0d714792e251cdb17c9c05/propcache-0.4.1-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:9d2b6caef873b4f09e26ea7e33d65f42b944837563a47a94719cc3544319a0db", size = 215319, upload-time = "2025-10-08T19:46:10.7Z" }, + { url = "https://files.pythonhosted.org/packages/08/57/8c87e93142b2c1fa2408e45695205a7ba05fb5db458c0bf5c06ba0e09ea6/propcache-0.4.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2b16ec437a8c8a965ecf95739448dd938b5c7f56e67ea009f4300d8df05f32b7", size = 196856, upload-time = "2025-10-08T19:46:12.003Z" }, + { url = "https://files.pythonhosted.org/packages/42/df/5615fec76aa561987a534759b3686008a288e73107faa49a8ae5795a9f7a/propcache-0.4.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:296f4c8ed03ca7476813fe666c9ea97869a8d7aec972618671b33a38a5182ef4", size = 193241, upload-time = "2025-10-08T19:46:13.495Z" }, + { url = "https://files.pythonhosted.org/packages/d5/21/62949eb3a7a54afe8327011c90aca7e03547787a88fb8bd9726806482fea/propcache-0.4.1-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:1f0978529a418ebd1f49dad413a2b68af33f85d5c5ca5c6ca2a3bed375a7ac60", size = 190552, upload-time = "2025-10-08T19:46:14.938Z" }, + { url = "https://files.pythonhosted.org/packages/30/ee/ab4d727dd70806e5b4de96a798ae7ac6e4d42516f030ee60522474b6b332/propcache-0.4.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:fd138803047fb4c062b1c1dd95462f5209456bfab55c734458f15d11da288f8f", size = 200113, upload-time = "2025-10-08T19:46:16.695Z" }, + { url = "https://files.pythonhosted.org/packages/8a/0b/38b46208e6711b016aa8966a3ac793eee0d05c7159d8342aa27fc0bc365e/propcache-0.4.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:8c9b3cbe4584636d72ff556d9036e0c9317fa27b3ac1f0f558e7e84d1c9c5900", size = 200778, upload-time = "2025-10-08T19:46:18.023Z" }, + { url = "https://files.pythonhosted.org/packages/cf/81/5abec54355ed344476bee711e9f04815d4b00a311ab0535599204eecc257/propcache-0.4.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:f93243fdc5657247533273ac4f86ae106cc6445a0efacb9a1bfe982fcfefd90c", size = 193047, upload-time = "2025-10-08T19:46:19.449Z" }, + { url = "https://files.pythonhosted.org/packages/ec/b6/1f237c04e32063cb034acd5f6ef34ef3a394f75502e72703545631ab1ef6/propcache-0.4.1-cp310-cp310-win32.whl", hash = "sha256:a0ee98db9c5f80785b266eb805016e36058ac72c51a064040f2bc43b61101cdb", size = 38093, upload-time = "2025-10-08T19:46:20.643Z" }, + { url = "https://files.pythonhosted.org/packages/a6/67/354aac4e0603a15f76439caf0427781bcd6797f370377f75a642133bc954/propcache-0.4.1-cp310-cp310-win_amd64.whl", hash = "sha256:1cdb7988c4e5ac7f6d175a28a9aa0c94cb6f2ebe52756a3c0cda98d2809a9e37", size = 41638, upload-time = "2025-10-08T19:46:21.935Z" }, + { url = "https://files.pythonhosted.org/packages/e0/e1/74e55b9fd1a4c209ff1a9a824bf6c8b3d1fc5a1ac3eabe23462637466785/propcache-0.4.1-cp310-cp310-win_arm64.whl", hash = "sha256:d82ad62b19645419fe79dd63b3f9253e15b30e955c0170e5cebc350c1844e581", size = 38229, upload-time = "2025-10-08T19:46:23.368Z" }, + { url = "https://files.pythonhosted.org/packages/8c/d4/4e2c9aaf7ac2242b9358f98dccd8f90f2605402f5afeff6c578682c2c491/propcache-0.4.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:60a8fda9644b7dfd5dece8c61d8a85e271cb958075bfc4e01083c148b61a7caf", size = 80208, upload-time = "2025-10-08T19:46:24.597Z" }, + { url = "https://files.pythonhosted.org/packages/c2/21/d7b68e911f9c8e18e4ae43bdbc1e1e9bbd971f8866eb81608947b6f585ff/propcache-0.4.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c30b53e7e6bda1d547cabb47c825f3843a0a1a42b0496087bb58d8fedf9f41b5", size = 45777, upload-time = "2025-10-08T19:46:25.733Z" }, + { url = "https://files.pythonhosted.org/packages/d3/1d/11605e99ac8ea9435651ee71ab4cb4bf03f0949586246476a25aadfec54a/propcache-0.4.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6918ecbd897443087a3b7cd978d56546a812517dcaaca51b49526720571fa93e", size = 47647, upload-time = "2025-10-08T19:46:27.304Z" }, + { url = "https://files.pythonhosted.org/packages/58/1a/3c62c127a8466c9c843bccb503d40a273e5cc69838805f322e2826509e0d/propcache-0.4.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3d902a36df4e5989763425a8ab9e98cd8ad5c52c823b34ee7ef307fd50582566", size = 214929, upload-time = "2025-10-08T19:46:28.62Z" }, + { url = "https://files.pythonhosted.org/packages/56/b9/8fa98f850960b367c4b8fe0592e7fc341daa7a9462e925228f10a60cf74f/propcache-0.4.1-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a9695397f85973bb40427dedddf70d8dc4a44b22f1650dd4af9eedf443d45165", size = 221778, upload-time = "2025-10-08T19:46:30.358Z" }, + { url = "https://files.pythonhosted.org/packages/46/a6/0ab4f660eb59649d14b3d3d65c439421cf2f87fe5dd68591cbe3c1e78a89/propcache-0.4.1-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2bb07ffd7eaad486576430c89f9b215f9e4be68c4866a96e97db9e97fead85dc", size = 228144, upload-time = "2025-10-08T19:46:32.607Z" }, + { url = "https://files.pythonhosted.org/packages/52/6a/57f43e054fb3d3a56ac9fc532bc684fc6169a26c75c353e65425b3e56eef/propcache-0.4.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fd6f30fdcf9ae2a70abd34da54f18da086160e4d7d9251f81f3da0ff84fc5a48", size = 210030, upload-time = "2025-10-08T19:46:33.969Z" }, + { url = "https://files.pythonhosted.org/packages/40/e2/27e6feebb5f6b8408fa29f5efbb765cd54c153ac77314d27e457a3e993b7/propcache-0.4.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:fc38cba02d1acba4e2869eef1a57a43dfbd3d49a59bf90dda7444ec2be6a5570", size = 208252, upload-time = "2025-10-08T19:46:35.309Z" }, + { url = "https://files.pythonhosted.org/packages/9e/f8/91c27b22ccda1dbc7967f921c42825564fa5336a01ecd72eb78a9f4f53c2/propcache-0.4.1-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:67fad6162281e80e882fb3ec355398cf72864a54069d060321f6cd0ade95fe85", size = 202064, upload-time = "2025-10-08T19:46:36.993Z" }, + { url = "https://files.pythonhosted.org/packages/f2/26/7f00bd6bd1adba5aafe5f4a66390f243acab58eab24ff1a08bebb2ef9d40/propcache-0.4.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:f10207adf04d08bec185bae14d9606a1444715bc99180f9331c9c02093e1959e", size = 212429, upload-time = "2025-10-08T19:46:38.398Z" }, + { url = "https://files.pythonhosted.org/packages/84/89/fd108ba7815c1117ddca79c228f3f8a15fc82a73bca8b142eb5de13b2785/propcache-0.4.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:e9b0d8d0845bbc4cfcdcbcdbf5086886bc8157aa963c31c777ceff7846c77757", size = 216727, upload-time = "2025-10-08T19:46:39.732Z" }, + { url = "https://files.pythonhosted.org/packages/79/37/3ec3f7e3173e73f1d600495d8b545b53802cbf35506e5732dd8578db3724/propcache-0.4.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:981333cb2f4c1896a12f4ab92a9cc8f09ea664e9b7dbdc4eff74627af3a11c0f", size = 205097, upload-time = "2025-10-08T19:46:41.025Z" }, + { url = "https://files.pythonhosted.org/packages/61/b0/b2631c19793f869d35f47d5a3a56fb19e9160d3c119f15ac7344fc3ccae7/propcache-0.4.1-cp311-cp311-win32.whl", hash = "sha256:f1d2f90aeec838a52f1c1a32fe9a619fefd5e411721a9117fbf82aea638fe8a1", size = 38084, upload-time = "2025-10-08T19:46:42.693Z" }, + { url = "https://files.pythonhosted.org/packages/f4/78/6cce448e2098e9f3bfc91bb877f06aa24b6ccace872e39c53b2f707c4648/propcache-0.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:364426a62660f3f699949ac8c621aad6977be7126c5807ce48c0aeb8e7333ea6", size = 41637, upload-time = "2025-10-08T19:46:43.778Z" }, + { url = "https://files.pythonhosted.org/packages/9c/e9/754f180cccd7f51a39913782c74717c581b9cc8177ad0e949f4d51812383/propcache-0.4.1-cp311-cp311-win_arm64.whl", hash = "sha256:e53f3a38d3510c11953f3e6a33f205c6d1b001129f972805ca9b42fc308bc239", size = 38064, upload-time = "2025-10-08T19:46:44.872Z" }, + { url = "https://files.pythonhosted.org/packages/a2/0f/f17b1b2b221d5ca28b4b876e8bb046ac40466513960646bda8e1853cdfa2/propcache-0.4.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:e153e9cd40cc8945138822807139367f256f89c6810c2634a4f6902b52d3b4e2", size = 80061, upload-time = "2025-10-08T19:46:46.075Z" }, + { url = "https://files.pythonhosted.org/packages/76/47/8ccf75935f51448ba9a16a71b783eb7ef6b9ee60f5d14c7f8a8a79fbeed7/propcache-0.4.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:cd547953428f7abb73c5ad82cbb32109566204260d98e41e5dfdc682eb7f8403", size = 46037, upload-time = "2025-10-08T19:46:47.23Z" }, + { url = "https://files.pythonhosted.org/packages/0a/b6/5c9a0e42df4d00bfb4a3cbbe5cf9f54260300c88a0e9af1f47ca5ce17ac0/propcache-0.4.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f048da1b4f243fc44f205dfd320933a951b8d89e0afd4c7cacc762a8b9165207", size = 47324, upload-time = "2025-10-08T19:46:48.384Z" }, + { url = "https://files.pythonhosted.org/packages/9e/d3/6c7ee328b39a81ee877c962469f1e795f9db87f925251efeb0545e0020d0/propcache-0.4.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ec17c65562a827bba85e3872ead335f95405ea1674860d96483a02f5c698fa72", size = 225505, upload-time = "2025-10-08T19:46:50.055Z" }, + { url = "https://files.pythonhosted.org/packages/01/5d/1c53f4563490b1d06a684742cc6076ef944bc6457df6051b7d1a877c057b/propcache-0.4.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:405aac25c6394ef275dee4c709be43745d36674b223ba4eb7144bf4d691b7367", size = 230242, upload-time = "2025-10-08T19:46:51.815Z" }, + { url = "https://files.pythonhosted.org/packages/20/e1/ce4620633b0e2422207c3cb774a0ee61cac13abc6217763a7b9e2e3f4a12/propcache-0.4.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:0013cb6f8dde4b2a2f66903b8ba740bdfe378c943c4377a200551ceb27f379e4", size = 238474, upload-time = "2025-10-08T19:46:53.208Z" }, + { url = "https://files.pythonhosted.org/packages/46/4b/3aae6835b8e5f44ea6a68348ad90f78134047b503765087be2f9912140ea/propcache-0.4.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:15932ab57837c3368b024473a525e25d316d8353016e7cc0e5ba9eb343fbb1cf", size = 221575, upload-time = "2025-10-08T19:46:54.511Z" }, + { url = "https://files.pythonhosted.org/packages/6e/a5/8a5e8678bcc9d3a1a15b9a29165640d64762d424a16af543f00629c87338/propcache-0.4.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:031dce78b9dc099f4c29785d9cf5577a3faf9ebf74ecbd3c856a7b92768c3df3", size = 216736, upload-time = "2025-10-08T19:46:56.212Z" }, + { url = "https://files.pythonhosted.org/packages/f1/63/b7b215eddeac83ca1c6b934f89d09a625aa9ee4ba158338854c87210cc36/propcache-0.4.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:ab08df6c9a035bee56e31af99be621526bd237bea9f32def431c656b29e41778", size = 213019, upload-time = "2025-10-08T19:46:57.595Z" }, + { url = "https://files.pythonhosted.org/packages/57/74/f580099a58c8af587cac7ba19ee7cb418506342fbbe2d4a4401661cca886/propcache-0.4.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:4d7af63f9f93fe593afbf104c21b3b15868efb2c21d07d8732c0c4287e66b6a6", size = 220376, upload-time = "2025-10-08T19:46:59.067Z" }, + { url = "https://files.pythonhosted.org/packages/c4/ee/542f1313aff7eaf19c2bb758c5d0560d2683dac001a1c96d0774af799843/propcache-0.4.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:cfc27c945f422e8b5071b6e93169679e4eb5bf73bbcbf1ba3ae3a83d2f78ebd9", size = 226988, upload-time = "2025-10-08T19:47:00.544Z" }, + { url = "https://files.pythonhosted.org/packages/8f/18/9c6b015dd9c6930f6ce2229e1f02fb35298b847f2087ea2b436a5bfa7287/propcache-0.4.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:35c3277624a080cc6ec6f847cbbbb5b49affa3598c4535a0a4682a697aaa5c75", size = 215615, upload-time = "2025-10-08T19:47:01.968Z" }, + { url = "https://files.pythonhosted.org/packages/80/9e/e7b85720b98c45a45e1fca6a177024934dc9bc5f4d5dd04207f216fc33ed/propcache-0.4.1-cp312-cp312-win32.whl", hash = "sha256:671538c2262dadb5ba6395e26c1731e1d52534bfe9ae56d0b5573ce539266aa8", size = 38066, upload-time = "2025-10-08T19:47:03.503Z" }, + { url = "https://files.pythonhosted.org/packages/54/09/d19cff2a5aaac632ec8fc03737b223597b1e347416934c1b3a7df079784c/propcache-0.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:cb2d222e72399fcf5890d1d5cc1060857b9b236adff2792ff48ca2dfd46c81db", size = 41655, upload-time = "2025-10-08T19:47:04.973Z" }, + { url = "https://files.pythonhosted.org/packages/68/ab/6b5c191bb5de08036a8c697b265d4ca76148efb10fa162f14af14fb5f076/propcache-0.4.1-cp312-cp312-win_arm64.whl", hash = "sha256:204483131fb222bdaaeeea9f9e6c6ed0cac32731f75dfc1d4a567fc1926477c1", size = 37789, upload-time = "2025-10-08T19:47:06.077Z" }, + { url = "https://files.pythonhosted.org/packages/bf/df/6d9c1b6ac12b003837dde8a10231a7344512186e87b36e855bef32241942/propcache-0.4.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:43eedf29202c08550aac1d14e0ee619b0430aaef78f85864c1a892294fbc28cf", size = 77750, upload-time = "2025-10-08T19:47:07.648Z" }, + { url = "https://files.pythonhosted.org/packages/8b/e8/677a0025e8a2acf07d3418a2e7ba529c9c33caf09d3c1f25513023c1db56/propcache-0.4.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:d62cdfcfd89ccb8de04e0eda998535c406bf5e060ffd56be6c586cbcc05b3311", size = 44780, upload-time = "2025-10-08T19:47:08.851Z" }, + { url = "https://files.pythonhosted.org/packages/89/a4/92380f7ca60f99ebae761936bc48a72a639e8a47b29050615eef757cb2a7/propcache-0.4.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:cae65ad55793da34db5f54e4029b89d3b9b9490d8abe1b4c7ab5d4b8ec7ebf74", size = 46308, upload-time = "2025-10-08T19:47:09.982Z" }, + { url = "https://files.pythonhosted.org/packages/2d/48/c5ac64dee5262044348d1d78a5f85dd1a57464a60d30daee946699963eb3/propcache-0.4.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:333ddb9031d2704a301ee3e506dc46b1fe5f294ec198ed6435ad5b6a085facfe", size = 208182, upload-time = "2025-10-08T19:47:11.319Z" }, + { url = "https://files.pythonhosted.org/packages/c6/0c/cd762dd011a9287389a6a3eb43aa30207bde253610cca06824aeabfe9653/propcache-0.4.1-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:fd0858c20f078a32cf55f7e81473d96dcf3b93fd2ccdb3d40fdf54b8573df3af", size = 211215, upload-time = "2025-10-08T19:47:13.146Z" }, + { url = "https://files.pythonhosted.org/packages/30/3e/49861e90233ba36890ae0ca4c660e95df565b2cd15d4a68556ab5865974e/propcache-0.4.1-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:678ae89ebc632c5c204c794f8dab2837c5f159aeb59e6ed0539500400577298c", size = 218112, upload-time = "2025-10-08T19:47:14.913Z" }, + { url = "https://files.pythonhosted.org/packages/f1/8b/544bc867e24e1bd48f3118cecd3b05c694e160a168478fa28770f22fd094/propcache-0.4.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d472aeb4fbf9865e0c6d622d7f4d54a4e101a89715d8904282bb5f9a2f476c3f", size = 204442, upload-time = "2025-10-08T19:47:16.277Z" }, + { url = "https://files.pythonhosted.org/packages/50/a6/4282772fd016a76d3e5c0df58380a5ea64900afd836cec2c2f662d1b9bb3/propcache-0.4.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:4d3df5fa7e36b3225954fba85589da77a0fe6a53e3976de39caf04a0db4c36f1", size = 199398, upload-time = "2025-10-08T19:47:17.962Z" }, + { url = "https://files.pythonhosted.org/packages/3e/ec/d8a7cd406ee1ddb705db2139f8a10a8a427100347bd698e7014351c7af09/propcache-0.4.1-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:ee17f18d2498f2673e432faaa71698032b0127ebf23ae5974eeaf806c279df24", size = 196920, upload-time = "2025-10-08T19:47:19.355Z" }, + { url = "https://files.pythonhosted.org/packages/f6/6c/f38ab64af3764f431e359f8baf9e0a21013e24329e8b85d2da32e8ed07ca/propcache-0.4.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:580e97762b950f993ae618e167e7be9256b8353c2dcd8b99ec100eb50f5286aa", size = 203748, upload-time = "2025-10-08T19:47:21.338Z" }, + { url = "https://files.pythonhosted.org/packages/d6/e3/fa846bd70f6534d647886621388f0a265254d30e3ce47e5c8e6e27dbf153/propcache-0.4.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:501d20b891688eb8e7aa903021f0b72d5a55db40ffaab27edefd1027caaafa61", size = 205877, upload-time = "2025-10-08T19:47:23.059Z" }, + { url = "https://files.pythonhosted.org/packages/e2/39/8163fc6f3133fea7b5f2827e8eba2029a0277ab2c5beee6c1db7b10fc23d/propcache-0.4.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:9a0bd56e5b100aef69bd8562b74b46254e7c8812918d3baa700c8a8009b0af66", size = 199437, upload-time = "2025-10-08T19:47:24.445Z" }, + { url = "https://files.pythonhosted.org/packages/93/89/caa9089970ca49c7c01662bd0eeedfe85494e863e8043565aeb6472ce8fe/propcache-0.4.1-cp313-cp313-win32.whl", hash = "sha256:bcc9aaa5d80322bc2fb24bb7accb4a30f81e90ab8d6ba187aec0744bc302ad81", size = 37586, upload-time = "2025-10-08T19:47:25.736Z" }, + { url = "https://files.pythonhosted.org/packages/f5/ab/f76ec3c3627c883215b5c8080debb4394ef5a7a29be811f786415fc1e6fd/propcache-0.4.1-cp313-cp313-win_amd64.whl", hash = "sha256:381914df18634f5494334d201e98245c0596067504b9372d8cf93f4bb23e025e", size = 40790, upload-time = "2025-10-08T19:47:26.847Z" }, + { url = "https://files.pythonhosted.org/packages/59/1b/e71ae98235f8e2ba5004d8cb19765a74877abf189bc53fc0c80d799e56c3/propcache-0.4.1-cp313-cp313-win_arm64.whl", hash = "sha256:8873eb4460fd55333ea49b7d189749ecf6e55bf85080f11b1c4530ed3034cba1", size = 37158, upload-time = "2025-10-08T19:47:27.961Z" }, + { url = "https://files.pythonhosted.org/packages/83/ce/a31bbdfc24ee0dcbba458c8175ed26089cf109a55bbe7b7640ed2470cfe9/propcache-0.4.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:92d1935ee1f8d7442da9c0c4fa7ac20d07e94064184811b685f5c4fada64553b", size = 81451, upload-time = "2025-10-08T19:47:29.445Z" }, + { url = "https://files.pythonhosted.org/packages/25/9c/442a45a470a68456e710d96cacd3573ef26a1d0a60067e6a7d5e655621ed/propcache-0.4.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:473c61b39e1460d386479b9b2f337da492042447c9b685f28be4f74d3529e566", size = 46374, upload-time = "2025-10-08T19:47:30.579Z" }, + { url = "https://files.pythonhosted.org/packages/f4/bf/b1d5e21dbc3b2e889ea4327044fb16312a736d97640fb8b6aa3f9c7b3b65/propcache-0.4.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:c0ef0aaafc66fbd87842a3fe3902fd889825646bc21149eafe47be6072725835", size = 48396, upload-time = "2025-10-08T19:47:31.79Z" }, + { url = "https://files.pythonhosted.org/packages/f4/04/5b4c54a103d480e978d3c8a76073502b18db0c4bc17ab91b3cb5092ad949/propcache-0.4.1-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f95393b4d66bfae908c3ca8d169d5f79cd65636ae15b5e7a4f6e67af675adb0e", size = 275950, upload-time = "2025-10-08T19:47:33.481Z" }, + { url = "https://files.pythonhosted.org/packages/b4/c1/86f846827fb969c4b78b0af79bba1d1ea2156492e1b83dea8b8a6ae27395/propcache-0.4.1-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c07fda85708bc48578467e85099645167a955ba093be0a2dcba962195676e859", size = 273856, upload-time = "2025-10-08T19:47:34.906Z" }, + { url = "https://files.pythonhosted.org/packages/36/1d/fc272a63c8d3bbad6878c336c7a7dea15e8f2d23a544bda43205dfa83ada/propcache-0.4.1-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:af223b406d6d000830c6f65f1e6431783fc3f713ba3e6cc8c024d5ee96170a4b", size = 280420, upload-time = "2025-10-08T19:47:36.338Z" }, + { url = "https://files.pythonhosted.org/packages/07/0c/01f2219d39f7e53d52e5173bcb09c976609ba30209912a0680adfb8c593a/propcache-0.4.1-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a78372c932c90ee474559c5ddfffd718238e8673c340dc21fe45c5b8b54559a0", size = 263254, upload-time = "2025-10-08T19:47:37.692Z" }, + { url = "https://files.pythonhosted.org/packages/2d/18/cd28081658ce597898f0c4d174d4d0f3c5b6d4dc27ffafeef835c95eb359/propcache-0.4.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:564d9f0d4d9509e1a870c920a89b2fec951b44bf5ba7d537a9e7c1ccec2c18af", size = 261205, upload-time = "2025-10-08T19:47:39.659Z" }, + { url = "https://files.pythonhosted.org/packages/7a/71/1f9e22eb8b8316701c2a19fa1f388c8a3185082607da8e406a803c9b954e/propcache-0.4.1-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:17612831fda0138059cc5546f4d12a2aacfb9e47068c06af35c400ba58ba7393", size = 247873, upload-time = "2025-10-08T19:47:41.084Z" }, + { url = "https://files.pythonhosted.org/packages/4a/65/3d4b61f36af2b4eddba9def857959f1016a51066b4f1ce348e0cf7881f58/propcache-0.4.1-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:41a89040cb10bd345b3c1a873b2bf36413d48da1def52f268a055f7398514874", size = 262739, upload-time = "2025-10-08T19:47:42.51Z" }, + { url = "https://files.pythonhosted.org/packages/2a/42/26746ab087faa77c1c68079b228810436ccd9a5ce9ac85e2b7307195fd06/propcache-0.4.1-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:e35b88984e7fa64aacecea39236cee32dd9bd8c55f57ba8a75cf2399553f9bd7", size = 263514, upload-time = "2025-10-08T19:47:43.927Z" }, + { url = "https://files.pythonhosted.org/packages/94/13/630690fe201f5502d2403dd3cfd451ed8858fe3c738ee88d095ad2ff407b/propcache-0.4.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:6f8b465489f927b0df505cbe26ffbeed4d6d8a2bbc61ce90eb074ff129ef0ab1", size = 257781, upload-time = "2025-10-08T19:47:45.448Z" }, + { url = "https://files.pythonhosted.org/packages/92/f7/1d4ec5841505f423469efbfc381d64b7b467438cd5a4bbcbb063f3b73d27/propcache-0.4.1-cp313-cp313t-win32.whl", hash = "sha256:2ad890caa1d928c7c2965b48f3a3815c853180831d0e5503d35cf00c472f4717", size = 41396, upload-time = "2025-10-08T19:47:47.202Z" }, + { url = "https://files.pythonhosted.org/packages/48/f0/615c30622316496d2cbbc29f5985f7777d3ada70f23370608c1d3e081c1f/propcache-0.4.1-cp313-cp313t-win_amd64.whl", hash = "sha256:f7ee0e597f495cf415bcbd3da3caa3bd7e816b74d0d52b8145954c5e6fd3ff37", size = 44897, upload-time = "2025-10-08T19:47:48.336Z" }, + { url = "https://files.pythonhosted.org/packages/fd/ca/6002e46eccbe0e33dcd4069ef32f7f1c9e243736e07adca37ae8c4830ec3/propcache-0.4.1-cp313-cp313t-win_arm64.whl", hash = "sha256:929d7cbe1f01bb7baffb33dc14eb5691c95831450a26354cd210a8155170c93a", size = 39789, upload-time = "2025-10-08T19:47:49.876Z" }, + { url = "https://files.pythonhosted.org/packages/8e/5c/bca52d654a896f831b8256683457ceddd490ec18d9ec50e97dfd8fc726a8/propcache-0.4.1-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:3f7124c9d820ba5548d431afb4632301acf965db49e666aa21c305cbe8c6de12", size = 78152, upload-time = "2025-10-08T19:47:51.051Z" }, + { url = "https://files.pythonhosted.org/packages/65/9b/03b04e7d82a5f54fb16113d839f5ea1ede58a61e90edf515f6577c66fa8f/propcache-0.4.1-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:c0d4b719b7da33599dfe3b22d3db1ef789210a0597bc650b7cee9c77c2be8c5c", size = 44869, upload-time = "2025-10-08T19:47:52.594Z" }, + { url = "https://files.pythonhosted.org/packages/b2/fa/89a8ef0468d5833a23fff277b143d0573897cf75bd56670a6d28126c7d68/propcache-0.4.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:9f302f4783709a78240ebc311b793f123328716a60911d667e0c036bc5dcbded", size = 46596, upload-time = "2025-10-08T19:47:54.073Z" }, + { url = "https://files.pythonhosted.org/packages/86/bd/47816020d337f4a746edc42fe8d53669965138f39ee117414c7d7a340cfe/propcache-0.4.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c80ee5802e3fb9ea37938e7eecc307fb984837091d5fd262bb37238b1ae97641", size = 206981, upload-time = "2025-10-08T19:47:55.715Z" }, + { url = "https://files.pythonhosted.org/packages/df/f6/c5fa1357cc9748510ee55f37173eb31bfde6d94e98ccd9e6f033f2fc06e1/propcache-0.4.1-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:ed5a841e8bb29a55fb8159ed526b26adc5bdd7e8bd7bf793ce647cb08656cdf4", size = 211490, upload-time = "2025-10-08T19:47:57.499Z" }, + { url = "https://files.pythonhosted.org/packages/80/1e/e5889652a7c4a3846683401a48f0f2e5083ce0ec1a8a5221d8058fbd1adf/propcache-0.4.1-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:55c72fd6ea2da4c318e74ffdf93c4fe4e926051133657459131a95c846d16d44", size = 215371, upload-time = "2025-10-08T19:47:59.317Z" }, + { url = "https://files.pythonhosted.org/packages/b2/f2/889ad4b2408f72fe1a4f6a19491177b30ea7bf1a0fd5f17050ca08cfc882/propcache-0.4.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8326e144341460402713f91df60ade3c999d601e7eb5ff8f6f7862d54de0610d", size = 201424, upload-time = "2025-10-08T19:48:00.67Z" }, + { url = "https://files.pythonhosted.org/packages/27/73/033d63069b57b0812c8bd19f311faebeceb6ba31b8f32b73432d12a0b826/propcache-0.4.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:060b16ae65bc098da7f6d25bf359f1f31f688384858204fe5d652979e0015e5b", size = 197566, upload-time = "2025-10-08T19:48:02.604Z" }, + { url = "https://files.pythonhosted.org/packages/dc/89/ce24f3dc182630b4e07aa6d15f0ff4b14ed4b9955fae95a0b54c58d66c05/propcache-0.4.1-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:89eb3fa9524f7bec9de6e83cf3faed9d79bffa560672c118a96a171a6f55831e", size = 193130, upload-time = "2025-10-08T19:48:04.499Z" }, + { url = "https://files.pythonhosted.org/packages/a9/24/ef0d5fd1a811fb5c609278d0209c9f10c35f20581fcc16f818da959fc5b4/propcache-0.4.1-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:dee69d7015dc235f526fe80a9c90d65eb0039103fe565776250881731f06349f", size = 202625, upload-time = "2025-10-08T19:48:06.213Z" }, + { url = "https://files.pythonhosted.org/packages/f5/02/98ec20ff5546f68d673df2f7a69e8c0d076b5abd05ca882dc7ee3a83653d/propcache-0.4.1-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:5558992a00dfd54ccbc64a32726a3357ec93825a418a401f5cc67df0ac5d9e49", size = 204209, upload-time = "2025-10-08T19:48:08.432Z" }, + { url = "https://files.pythonhosted.org/packages/a0/87/492694f76759b15f0467a2a93ab68d32859672b646aa8a04ce4864e7932d/propcache-0.4.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:c9b822a577f560fbd9554812526831712c1436d2c046cedee4c3796d3543b144", size = 197797, upload-time = "2025-10-08T19:48:09.968Z" }, + { url = "https://files.pythonhosted.org/packages/ee/36/66367de3575db1d2d3f3d177432bd14ee577a39d3f5d1b3d5df8afe3b6e2/propcache-0.4.1-cp314-cp314-win32.whl", hash = "sha256:ab4c29b49d560fe48b696cdcb127dd36e0bc2472548f3bf56cc5cb3da2b2984f", size = 38140, upload-time = "2025-10-08T19:48:11.232Z" }, + { url = "https://files.pythonhosted.org/packages/0c/2a/a758b47de253636e1b8aef181c0b4f4f204bf0dd964914fb2af90a95b49b/propcache-0.4.1-cp314-cp314-win_amd64.whl", hash = "sha256:5a103c3eb905fcea0ab98be99c3a9a5ab2de60228aa5aceedc614c0281cf6153", size = 41257, upload-time = "2025-10-08T19:48:12.707Z" }, + { url = "https://files.pythonhosted.org/packages/34/5e/63bd5896c3fec12edcbd6f12508d4890d23c265df28c74b175e1ef9f4f3b/propcache-0.4.1-cp314-cp314-win_arm64.whl", hash = "sha256:74c1fb26515153e482e00177a1ad654721bf9207da8a494a0c05e797ad27b992", size = 38097, upload-time = "2025-10-08T19:48:13.923Z" }, + { url = "https://files.pythonhosted.org/packages/99/85/9ff785d787ccf9bbb3f3106f79884a130951436f58392000231b4c737c80/propcache-0.4.1-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:824e908bce90fb2743bd6b59db36eb4f45cd350a39637c9f73b1c1ea66f5b75f", size = 81455, upload-time = "2025-10-08T19:48:15.16Z" }, + { url = "https://files.pythonhosted.org/packages/90/85/2431c10c8e7ddb1445c1f7c4b54d886e8ad20e3c6307e7218f05922cad67/propcache-0.4.1-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:c2b5e7db5328427c57c8e8831abda175421b709672f6cfc3d630c3b7e2146393", size = 46372, upload-time = "2025-10-08T19:48:16.424Z" }, + { url = "https://files.pythonhosted.org/packages/01/20/b0972d902472da9bcb683fa595099911f4d2e86e5683bcc45de60dd05dc3/propcache-0.4.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:6f6ff873ed40292cd4969ef5310179afd5db59fdf055897e282485043fc80ad0", size = 48411, upload-time = "2025-10-08T19:48:17.577Z" }, + { url = "https://files.pythonhosted.org/packages/e2/e3/7dc89f4f21e8f99bad3d5ddb3a3389afcf9da4ac69e3deb2dcdc96e74169/propcache-0.4.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:49a2dc67c154db2c1463013594c458881a069fcf98940e61a0569016a583020a", size = 275712, upload-time = "2025-10-08T19:48:18.901Z" }, + { url = "https://files.pythonhosted.org/packages/20/67/89800c8352489b21a8047c773067644e3897f02ecbbd610f4d46b7f08612/propcache-0.4.1-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:005f08e6a0529984491e37d8dbc3dd86f84bd78a8ceb5fa9a021f4c48d4984be", size = 273557, upload-time = "2025-10-08T19:48:20.762Z" }, + { url = "https://files.pythonhosted.org/packages/e2/a1/b52b055c766a54ce6d9c16d9aca0cad8059acd9637cdf8aa0222f4a026ef/propcache-0.4.1-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5c3310452e0d31390da9035c348633b43d7e7feb2e37be252be6da45abd1abcc", size = 280015, upload-time = "2025-10-08T19:48:22.592Z" }, + { url = "https://files.pythonhosted.org/packages/48/c8/33cee30bd890672c63743049f3c9e4be087e6780906bfc3ec58528be59c1/propcache-0.4.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4c3c70630930447f9ef1caac7728c8ad1c56bc5015338b20fed0d08ea2480b3a", size = 262880, upload-time = "2025-10-08T19:48:23.947Z" }, + { url = "https://files.pythonhosted.org/packages/0c/b1/8f08a143b204b418285c88b83d00edbd61afbc2c6415ffafc8905da7038b/propcache-0.4.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:8e57061305815dfc910a3634dcf584f08168a8836e6999983569f51a8544cd89", size = 260938, upload-time = "2025-10-08T19:48:25.656Z" }, + { url = "https://files.pythonhosted.org/packages/cf/12/96e4664c82ca2f31e1c8dff86afb867348979eb78d3cb8546a680287a1e9/propcache-0.4.1-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:521a463429ef54143092c11a77e04056dd00636f72e8c45b70aaa3140d639726", size = 247641, upload-time = "2025-10-08T19:48:27.207Z" }, + { url = "https://files.pythonhosted.org/packages/18/ed/e7a9cfca28133386ba52278136d42209d3125db08d0a6395f0cba0c0285c/propcache-0.4.1-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:120c964da3fdc75e3731aa392527136d4ad35868cc556fd09bb6d09172d9a367", size = 262510, upload-time = "2025-10-08T19:48:28.65Z" }, + { url = "https://files.pythonhosted.org/packages/f5/76/16d8bf65e8845dd62b4e2b57444ab81f07f40caa5652b8969b87ddcf2ef6/propcache-0.4.1-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:d8f353eb14ee3441ee844ade4277d560cdd68288838673273b978e3d6d2c8f36", size = 263161, upload-time = "2025-10-08T19:48:30.133Z" }, + { url = "https://files.pythonhosted.org/packages/e7/70/c99e9edb5d91d5ad8a49fa3c1e8285ba64f1476782fed10ab251ff413ba1/propcache-0.4.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:ab2943be7c652f09638800905ee1bab2c544e537edb57d527997a24c13dc1455", size = 257393, upload-time = "2025-10-08T19:48:31.567Z" }, + { url = "https://files.pythonhosted.org/packages/08/02/87b25304249a35c0915d236575bc3574a323f60b47939a2262b77632a3ee/propcache-0.4.1-cp314-cp314t-win32.whl", hash = "sha256:05674a162469f31358c30bcaa8883cb7829fa3110bf9c0991fe27d7896c42d85", size = 42546, upload-time = "2025-10-08T19:48:32.872Z" }, + { url = "https://files.pythonhosted.org/packages/cb/ef/3c6ecf8b317aa982f309835e8f96987466123c6e596646d4e6a1dfcd080f/propcache-0.4.1-cp314-cp314t-win_amd64.whl", hash = "sha256:990f6b3e2a27d683cb7602ed6c86f15ee6b43b1194736f9baaeb93d0016633b1", size = 46259, upload-time = "2025-10-08T19:48:34.226Z" }, + { url = "https://files.pythonhosted.org/packages/c4/2d/346e946d4951f37eca1e4f55be0f0174c52cd70720f84029b02f296f4a38/propcache-0.4.1-cp314-cp314t-win_arm64.whl", hash = "sha256:ecef2343af4cc68e05131e45024ba34f6095821988a9d0a02aa7c73fcc448aa9", size = 40428, upload-time = "2025-10-08T19:48:35.441Z" }, + { url = "https://files.pythonhosted.org/packages/9b/01/0ebaec9003f5d619a7475165961f8e3083cf8644d704b60395df3601632d/propcache-0.4.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:3d233076ccf9e450c8b3bc6720af226b898ef5d051a2d145f7d765e6e9f9bcff", size = 80277, upload-time = "2025-10-08T19:48:36.647Z" }, + { url = "https://files.pythonhosted.org/packages/34/58/04af97ac586b4ef6b9026c3fd36ee7798b737a832f5d3440a4280dcebd3a/propcache-0.4.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:357f5bb5c377a82e105e44bd3d52ba22b616f7b9773714bff93573988ef0a5fb", size = 45865, upload-time = "2025-10-08T19:48:37.859Z" }, + { url = "https://files.pythonhosted.org/packages/7c/19/b65d98ae21384518b291d9939e24a8aeac4fdb5101b732576f8f7540e834/propcache-0.4.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:cbc3b6dfc728105b2a57c06791eb07a94229202ea75c59db644d7d496b698cac", size = 47636, upload-time = "2025-10-08T19:48:39.038Z" }, + { url = "https://files.pythonhosted.org/packages/b3/0f/317048c6d91c356c7154dca5af019e6effeb7ee15fa6a6db327cc19e12b4/propcache-0.4.1-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:182b51b421f0501952d938dc0b0eb45246a5b5153c50d42b495ad5fb7517c888", size = 201126, upload-time = "2025-10-08T19:48:40.774Z" }, + { url = "https://files.pythonhosted.org/packages/71/69/0b2a7a5a6ee83292b4b997dbd80549d8ce7d40b6397c1646c0d9495f5a85/propcache-0.4.1-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:4b536b39c5199b96fc6245eb5fb796c497381d3942f169e44e8e392b29c9ebcc", size = 209837, upload-time = "2025-10-08T19:48:42.167Z" }, + { url = "https://files.pythonhosted.org/packages/a5/92/c699ac495a6698df6e497fc2de27af4b6ace10d8e76528357ce153722e45/propcache-0.4.1-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:db65d2af507bbfbdcedb254a11149f894169d90488dd3e7190f7cdcb2d6cd57a", size = 215578, upload-time = "2025-10-08T19:48:43.56Z" }, + { url = "https://files.pythonhosted.org/packages/b3/ee/14de81c5eb02c0ee4f500b4e39c4e1bd0677c06e72379e6ab18923c773fc/propcache-0.4.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fd2dbc472da1f772a4dae4fa24be938a6c544671a912e30529984dd80400cd88", size = 197187, upload-time = "2025-10-08T19:48:45.309Z" }, + { url = "https://files.pythonhosted.org/packages/1d/94/48dce9aaa6d8dd5a0859bad75158ec522546d4ac23f8e2f05fac469477dd/propcache-0.4.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:daede9cd44e0f8bdd9e6cc9a607fc81feb80fae7a5fc6cecaff0e0bb32e42d00", size = 193478, upload-time = "2025-10-08T19:48:47.743Z" }, + { url = "https://files.pythonhosted.org/packages/60/b5/0516b563e801e1ace212afde869a0596a0d7115eec0b12d296d75633fb29/propcache-0.4.1-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:71b749281b816793678ae7f3d0d84bd36e694953822eaad408d682efc5ca18e0", size = 190650, upload-time = "2025-10-08T19:48:49.373Z" }, + { url = "https://files.pythonhosted.org/packages/24/89/e0f7d4a5978cd56f8cd67735f74052f257dc471ec901694e430f0d1572fe/propcache-0.4.1-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:0002004213ee1f36cfb3f9a42b5066100c44276b9b72b4e1504cddd3d692e86e", size = 200251, upload-time = "2025-10-08T19:48:51.4Z" }, + { url = "https://files.pythonhosted.org/packages/06/7d/a1fac863d473876ed4406c914f2e14aa82d2f10dd207c9e16fc383cc5a24/propcache-0.4.1-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:fe49d0a85038f36ba9e3ffafa1103e61170b28e95b16622e11be0a0ea07c6781", size = 200919, upload-time = "2025-10-08T19:48:53.227Z" }, + { url = "https://files.pythonhosted.org/packages/c3/4e/f86a256ff24944cf5743e4e6c6994e3526f6acfcfb55e21694c2424f758c/propcache-0.4.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:99d43339c83aaf4d32bda60928231848eee470c6bda8d02599cc4cebe872d183", size = 193211, upload-time = "2025-10-08T19:48:55.027Z" }, + { url = "https://files.pythonhosted.org/packages/6e/3f/3fbad5f4356b068f1b047d300a6ff2c66614d7030f078cd50be3fec04228/propcache-0.4.1-cp39-cp39-win32.whl", hash = "sha256:a129e76735bc792794d5177069691c3217898b9f5cee2b2661471e52ffe13f19", size = 38314, upload-time = "2025-10-08T19:48:56.792Z" }, + { url = "https://files.pythonhosted.org/packages/a4/45/d78d136c3a3d215677abb886785aae744da2c3005bcb99e58640c56529b1/propcache-0.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:948dab269721ae9a87fd16c514a0a2c2a1bdb23a9a61b969b0f9d9ee2968546f", size = 41912, upload-time = "2025-10-08T19:48:57.995Z" }, + { url = "https://files.pythonhosted.org/packages/fc/2a/b0632941f25139f4e58450b307242951f7c2717a5704977c6d5323a800af/propcache-0.4.1-cp39-cp39-win_arm64.whl", hash = "sha256:5fd37c406dd6dc85aa743e214cef35dc54bbdd1419baac4f6ae5e5b1a2976938", size = 38450, upload-time = "2025-10-08T19:48:59.349Z" }, + { url = "https://files.pythonhosted.org/packages/5b/5a/bc7b4a4ef808fa59a816c17b20c4bef6884daebbdf627ff2a161da67da19/propcache-0.4.1-py3-none-any.whl", hash = "sha256:af2a6052aeb6cf17d3e46ee169099044fd8224cbaf75c76a2ef596e8163e2237", size = 13305, upload-time = "2025-10-08T19:49:00.792Z" }, ] [[package]] name = "pydantic" -version = "1.10.22" +version = "1.10.24" source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.10'", + "python_full_version < '3.10'", +] dependencies = [ { name = "typing-extensions", marker = "extra == 'group-18-runloop-api-client-pydantic-v1'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/9a/57/5996c63f0deec09e9e901a2b838247c97c6844999562eac4e435bcb83938/pydantic-1.10.22.tar.gz", hash = "sha256:ee1006cebd43a8e7158fb7190bb8f4e2da9649719bff65d0c287282ec38dec6d", size = 356771, upload-time = "2025-04-24T13:38:43.605Z" } +sdist = { url = "https://files.pythonhosted.org/packages/ae/8d/7b346ed940c3e0f9eee7db9be37915a6dac0d9535d736e2ca47a81a066f3/pydantic-1.10.24.tar.gz", hash = "sha256:7e6d1af1bd3d2312079f28c9baf2aafb4a452a06b50717526e5ac562e37baa53", size = 357314, upload-time = "2025-09-25T01:36:33.065Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/88/92/91eb5c75a1460292e1f2f3e577122574ebb942fbac19ad2369ff00b9eb24/pydantic-1.10.22-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:57889565ccc1e5b7b73343329bbe6198ebc472e3ee874af2fa1865cfe7048228", size = 2852481, upload-time = "2025-04-24T13:36:55.045Z" }, - { url = "https://files.pythonhosted.org/packages/08/f3/dd54b49fc5caaed06f5a0d0a5ec35a81cf722cd6b42455f408dad1ef3f7d/pydantic-1.10.22-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:90729e22426de79bc6a3526b4c45ec4400caf0d4f10d7181ba7f12c01bb3897d", size = 2585586, upload-time = "2025-04-24T13:36:58.453Z" }, - { url = "https://files.pythonhosted.org/packages/ec/9b/48d10180cc614ffb66da486e99bc1f8b639fb44edf322864f2fb161e2351/pydantic-1.10.22-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f8684d347f351554ec94fdcb507983d3116dc4577fb8799fed63c65869a2d10", size = 3336974, upload-time = "2025-04-24T13:37:00.652Z" }, - { url = "https://files.pythonhosted.org/packages/ff/80/b55ad0029ae8e7b8b5c81ad7c4e800774a52107d26f70c6696857dc733d5/pydantic-1.10.22-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c8dad498ceff2d9ef1d2e2bc6608f5b59b8e1ba2031759b22dfb8c16608e1802", size = 3362338, upload-time = "2025-04-24T13:37:02.42Z" }, - { url = "https://files.pythonhosted.org/packages/65/e0/8a5cd2cd29a5632581ba466f5792194b2a568aa052ce9da9ba98b634debf/pydantic-1.10.22-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:fac529cc654d4575cf8de191cce354b12ba705f528a0a5c654de6d01f76cd818", size = 3519505, upload-time = "2025-04-24T13:37:04.322Z" }, - { url = "https://files.pythonhosted.org/packages/38/c5/c776d03ec374f22860802b2cee057b41e866be3c80826b53d4c001692db3/pydantic-1.10.22-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:4148232aded8dd1dd13cf910a01b32a763c34bd79a0ab4d1ee66164fcb0b7b9d", size = 3485878, upload-time = "2025-04-24T13:37:06.102Z" }, - { url = "https://files.pythonhosted.org/packages/d1/a2/1efd064513a2c1bcb5c2b0e022cdf77d132ef7f7f20d91bb439d759f6a88/pydantic-1.10.22-cp310-cp310-win_amd64.whl", hash = "sha256:ece68105d9e436db45d8650dc375c760cc85a6793ae019c08769052902dca7db", size = 2299673, upload-time = "2025-04-24T13:37:07.969Z" }, - { url = "https://files.pythonhosted.org/packages/42/03/e435ed85a9abda29e3fbdb49c572fe4131a68c6daf3855a01eebda9e1b27/pydantic-1.10.22-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:8e530a8da353f791ad89e701c35787418605d35085f4bdda51b416946070e938", size = 2845682, upload-time = "2025-04-24T13:37:10.142Z" }, - { url = "https://files.pythonhosted.org/packages/72/ea/4a625035672f6c06d3f1c7e33aa0af6bf1929991e27017e98b9c2064ae0b/pydantic-1.10.22-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:654322b85642e9439d7de4c83cb4084ddd513df7ff8706005dada43b34544946", size = 2553286, upload-time = "2025-04-24T13:37:11.946Z" }, - { url = "https://files.pythonhosted.org/packages/a4/f0/424ad837746e69e9f061ba9be68c2a97aef7376d1911692904d8efbcd322/pydantic-1.10.22-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a8bece75bd1b9fc1c32b57a32831517943b1159ba18b4ba32c0d431d76a120ae", size = 3141232, upload-time = "2025-04-24T13:37:14.394Z" }, - { url = "https://files.pythonhosted.org/packages/14/67/4979c19e8cfd092085a292485e0b42d74e4eeefbb8cd726aa8ba38d06294/pydantic-1.10.22-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eccb58767f13c6963dcf96d02cb8723ebb98b16692030803ac075d2439c07b0f", size = 3214272, upload-time = "2025-04-24T13:37:16.201Z" }, - { url = "https://files.pythonhosted.org/packages/1a/04/32339ce43e97519d19e7759902515c750edbf4832a13063a4ab157f83f42/pydantic-1.10.22-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:7778e6200ff8ed5f7052c1516617423d22517ad36cc7a3aedd51428168e3e5e8", size = 3321646, upload-time = "2025-04-24T13:37:19.086Z" }, - { url = "https://files.pythonhosted.org/packages/92/35/dffc1b29cb7198aadab68d75447191e59bdbc1f1d2d51826c9a4460d372f/pydantic-1.10.22-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:bffe02767d27c39af9ca7dc7cd479c00dda6346bb62ffc89e306f665108317a2", size = 3244258, upload-time = "2025-04-24T13:37:20.929Z" }, - { url = "https://files.pythonhosted.org/packages/11/c5/c4ce6ebe7f528a879441eabd2c6dd9e2e4c54f320a8c9344ba93b3aa8701/pydantic-1.10.22-cp311-cp311-win_amd64.whl", hash = "sha256:23bc19c55427091b8e589bc08f635ab90005f2dc99518f1233386f46462c550a", size = 2309702, upload-time = "2025-04-24T13:37:23.296Z" }, - { url = "https://files.pythonhosted.org/packages/f6/a3/ec66239ed7c9e90edfb85b23b6b18eb290ed7aa05f54837cdcb6a14faa98/pydantic-1.10.22-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:92d0f97828a075a71d9efc65cf75db5f149b4d79a38c89648a63d2932894d8c9", size = 2794865, upload-time = "2025-04-24T13:37:25.087Z" }, - { url = "https://files.pythonhosted.org/packages/49/6a/99cf3fee612d93210c85f45a161e98c1c5b45b6dcadb21c9f1f838fa9e28/pydantic-1.10.22-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6af5a2811b6b95b58b829aeac5996d465a5f0c7ed84bd871d603cf8646edf6ff", size = 2534212, upload-time = "2025-04-24T13:37:26.848Z" }, - { url = "https://files.pythonhosted.org/packages/f1/e6/0f8882775cd9a60b221103ee7d6a89e10eb5a892d877c398df0da7140704/pydantic-1.10.22-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6cf06d8d40993e79af0ab2102ef5da77b9ddba51248e4cb27f9f3f591fbb096e", size = 2994027, upload-time = "2025-04-24T13:37:28.683Z" }, - { url = "https://files.pythonhosted.org/packages/e7/a3/f20fdecbaa2a2721a6a8ee9e4f344d1f72bd7d56e679371c3f2be15eb8c8/pydantic-1.10.22-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:184b7865b171a6057ad97f4a17fbac81cec29bd103e996e7add3d16b0d95f609", size = 3036716, upload-time = "2025-04-24T13:37:30.547Z" }, - { url = "https://files.pythonhosted.org/packages/1f/83/dab34436d830c38706685acc77219fc2a209fea2a2301a1b05a2865b28bf/pydantic-1.10.22-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:923ad861677ab09d89be35d36111156063a7ebb44322cdb7b49266e1adaba4bb", size = 3171801, upload-time = "2025-04-24T13:37:32.474Z" }, - { url = "https://files.pythonhosted.org/packages/1e/6e/b64deccb8a7304d584088972437ea3091e9d99d27a8e7bf2bd08e29ae84e/pydantic-1.10.22-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:82d9a3da1686443fb854c8d2ab9a473251f8f4cdd11b125522efb4d7c646e7bc", size = 3123560, upload-time = "2025-04-24T13:37:34.855Z" }, - { url = "https://files.pythonhosted.org/packages/08/9a/90d1ab704329a7ae8666354be84b5327d655764003974364767c9d307d3a/pydantic-1.10.22-cp312-cp312-win_amd64.whl", hash = "sha256:1612604929af4c602694a7f3338b18039d402eb5ddfbf0db44f1ebfaf07f93e7", size = 2191378, upload-time = "2025-04-24T13:37:36.649Z" }, - { url = "https://files.pythonhosted.org/packages/47/8f/67befe3607b342dd6eb80237134ebcc6e8db42138609306eaf2b30e1f273/pydantic-1.10.22-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:b259dc89c9abcd24bf42f31951fb46c62e904ccf4316393f317abeeecda39978", size = 2797042, upload-time = "2025-04-24T13:37:38.753Z" }, - { url = "https://files.pythonhosted.org/packages/aa/91/bfde7d301f8e1c4cff949b3f1eb2c9b27bdd4b2368da0fe88e7350bbe4bc/pydantic-1.10.22-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9238aa0964d80c0908d2f385e981add58faead4412ca80ef0fa352094c24e46d", size = 2538572, upload-time = "2025-04-24T13:37:41.653Z" }, - { url = "https://files.pythonhosted.org/packages/d7/ce/1b0097ece420354df77d2f01c72278fb43770c8ed732d6b7a303c0c70875/pydantic-1.10.22-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f8029f05b04080e3f1a550575a1bca747c0ea4be48e2d551473d47fd768fc1b", size = 2986271, upload-time = "2025-04-24T13:37:43.551Z" }, - { url = "https://files.pythonhosted.org/packages/eb/4c/e257edfd5a0025a428aee7a2835e21b51c76a6b1c8994bcccb14d5721eea/pydantic-1.10.22-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5c06918894f119e0431a36c9393bc7cceeb34d1feeb66670ef9b9ca48c073937", size = 3015617, upload-time = "2025-04-24T13:37:45.466Z" }, - { url = "https://files.pythonhosted.org/packages/00/17/ecf46ff31fd62d382424a07ed60540d4479094204bebeebb6dea597e88c3/pydantic-1.10.22-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:e205311649622ee8fc1ec9089bd2076823797f5cd2c1e3182dc0e12aab835b35", size = 3164222, upload-time = "2025-04-24T13:37:47.35Z" }, - { url = "https://files.pythonhosted.org/packages/1a/47/2d55ec452c9a87347234bbbc70df268e1f081154b1851f0db89638558a1c/pydantic-1.10.22-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:815f0a73d5688d6dd0796a7edb9eca7071bfef961a7b33f91e618822ae7345b7", size = 3117572, upload-time = "2025-04-24T13:37:49.339Z" }, - { url = "https://files.pythonhosted.org/packages/03/2f/30359a36245b029bec7e442dd780fc242c66e66ad7dd5b50af2dcfd41ff3/pydantic-1.10.22-cp313-cp313-win_amd64.whl", hash = "sha256:9dfce71d42a5cde10e78a469e3d986f656afc245ab1b97c7106036f088dd91f8", size = 2174666, upload-time = "2025-04-24T13:37:51.114Z" }, - { url = "https://files.pythonhosted.org/packages/01/6f/9658e94018bc7c4e71863fb0f1ea8d30f8b3439e17df7aa710b2bb72dbca/pydantic-1.10.22-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ec54c89b2568b258bb30d7348ac4d82bec1b58b377fb56a00441e2ac66b24587", size = 2854460, upload-time = "2025-04-24T13:38:23.753Z" }, - { url = "https://files.pythonhosted.org/packages/b8/b3/5184ec7d3423a37c193ffaeced03921f4c34d226f3c6852653784f37d38b/pydantic-1.10.22-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:d8f1d1a1532e4f3bcab4e34e8d2197a7def4b67072acd26cfa60e92d75803a48", size = 2587418, upload-time = "2025-04-24T13:38:26.449Z" }, - { url = "https://files.pythonhosted.org/packages/90/25/27d769c5dc7491df5faebfc49a26f83ca2e070a9a788c67fde4c4e51d68b/pydantic-1.10.22-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8ad83ca35508c27eae1005b6b61f369f78aae6d27ead2135ec156a2599910121", size = 3331289, upload-time = "2025-04-24T13:38:29.262Z" }, - { url = "https://files.pythonhosted.org/packages/ed/18/7abe334d3d4de02ef2bbcc079a5782c53b868572b8d74aef2927d4f5b125/pydantic-1.10.22-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:53cdb44b78c420f570ff16b071ea8cd5a477635c6b0efc343c8a91e3029bbf1a", size = 3361613, upload-time = "2025-04-24T13:38:31.575Z" }, - { url = "https://files.pythonhosted.org/packages/68/95/6e649d14718969582ed35d1d70cb24a1ee825c65bec51e3275849d5aab8a/pydantic-1.10.22-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:16d0a5ae9d98264186ce31acdd7686ec05fd331fab9d68ed777d5cb2d1514e5e", size = 3520268, upload-time = "2025-04-24T13:38:33.835Z" }, - { url = "https://files.pythonhosted.org/packages/e9/87/eb3408e1c040a6d9f703e089d26a723d6c41f23a192e86bd7584d037d576/pydantic-1.10.22-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:8aee040e25843f036192b1a1af62117504a209a043aa8db12e190bb86ad7e611", size = 3483434, upload-time = "2025-04-24T13:38:36.078Z" }, - { url = "https://files.pythonhosted.org/packages/a8/13/ec2e52439137768d1bb0d4955b890f788c23f4aab2cfe9eef9e2b55584de/pydantic-1.10.22-cp39-cp39-win_amd64.whl", hash = "sha256:7f691eec68dbbfca497d3c11b92a3e5987393174cbedf03ec7a4184c35c2def6", size = 2301586, upload-time = "2025-04-24T13:38:39.351Z" }, - { url = "https://files.pythonhosted.org/packages/e9/e0/1ed151a56869be1588ad2d8cda9f8c1d95b16f74f09a7cea879ca9b63a8b/pydantic-1.10.22-py3-none-any.whl", hash = "sha256:343037d608bcbd34df937ac259708bfc83664dadf88afe8516c4f282d7d471a9", size = 166503, upload-time = "2025-04-24T13:38:41.374Z" }, + { url = "https://files.pythonhosted.org/packages/f9/6e/71eb0c860bf888e73243fbc22be79c47e68180b65b33036efb5a1f1085de/pydantic-1.10.24-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:eef07ea2fba12f9188cfa2c50cb3eaa6516b56c33e2a8cc3cd288b4190ee6c0c", size = 2494239, upload-time = "2025-09-25T01:35:02.451Z" }, + { url = "https://files.pythonhosted.org/packages/fd/1f/a2c09049c2ec33b88b111aa99e4bbfe9e821914dcf2ce662e00fa1423fa8/pydantic-1.10.24-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5a42033fac69b9f1f867ecc3a2159f0e94dceb1abfc509ad57e9e88d49774683", size = 2302370, upload-time = "2025-09-25T01:35:05.386Z" }, + { url = "https://files.pythonhosted.org/packages/70/73/fde9af3a76cc5714880828eee50c0f7f1b263d2c77a74c65ba19325b4706/pydantic-1.10.24-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c626596c1b95dc6d45f7129f10b6743fbb50f29d942d25a22b2ceead670c067d", size = 2960499, upload-time = "2025-09-25T01:35:07.243Z" }, + { url = "https://files.pythonhosted.org/packages/1d/d5/9fd98afa478020e9bad54a9ec6e42ba71f8a1a7f6df4d12ce5be76b0a96a/pydantic-1.10.24-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8057172868b0d98f95e6fcddcc5f75d01570e85c6308702dd2c50ea673bc197b", size = 3031125, upload-time = "2025-09-25T01:35:09.048Z" }, + { url = "https://files.pythonhosted.org/packages/1c/99/2fc6df8644c096dc6e3347e1793868a758df874eaf5ba52ca8b5a80e42d8/pydantic-1.10.24-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:82f951210ebcdb778b1d93075af43adcd04e9ebfd4f44b1baa8eeb21fbd71e36", size = 3099888, upload-time = "2025-09-25T01:35:10.894Z" }, + { url = "https://files.pythonhosted.org/packages/71/71/2f4c115951140f525136089da491b0bb4b7d24de8d697913afedde3f326c/pydantic-1.10.24-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:b66e4892d8ae005f436a5c5f1519ecf837574d8414b1c93860fb3c13943d9b37", size = 3038385, upload-time = "2025-09-25T01:35:12.744Z" }, + { url = "https://files.pythonhosted.org/packages/ec/6d/d3893a9b8479a0ea9357ba4a1eb84a5776a80705b5409bda4ad9e7ca0804/pydantic-1.10.24-cp310-cp310-win_amd64.whl", hash = "sha256:50d9f8a207c07f347d4b34806dc576872000d9a60fd481ed9eb78ea8512e0666", size = 2093504, upload-time = "2025-09-25T01:35:14.439Z" }, + { url = "https://files.pythonhosted.org/packages/bd/b5/1b49b94e99ae4cad5f034c4b33e9ab481e53238fb55b59ffed5c6e6ee4cf/pydantic-1.10.24-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:70152291488f8d2bbcf2027b5c28c27724c78a7949c91b466d28ad75d6d12702", size = 2526778, upload-time = "2025-09-25T01:35:16.448Z" }, + { url = "https://files.pythonhosted.org/packages/87/d8/63fb1850ca93511b324d709f1c5bd31131039f9b93d0bc2ae210285db6d1/pydantic-1.10.24-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:956b30638272c51c85caaff76851b60db4b339022c0ee6eca677c41e3646255b", size = 2307760, upload-time = "2025-09-25T01:35:18.234Z" }, + { url = "https://files.pythonhosted.org/packages/2a/b8/428453ce573b8898afaf39a5ce32f7dbacf54f8aad9ce9c0abf19a1cdb2c/pydantic-1.10.24-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bed9d6eea5fabbc6978c42e947190c7bd628ddaff3b56fc963fe696c3710ccd6", size = 2902586, upload-time = "2025-09-25T01:35:20.118Z" }, + { url = "https://files.pythonhosted.org/packages/96/e0/68b5eb3c26b5e7136a8946f00f6d2eb8ef2fde530fcf6b491c66e3989d0d/pydantic-1.10.24-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:af8e2b3648128b8cadb1a71e2f8092a6f42d4ca123fad7a8d7ce6db8938b1db3", size = 2976378, upload-time = "2025-09-25T01:35:22.077Z" }, + { url = "https://files.pythonhosted.org/packages/93/8c/2c6c46b7bc265ba35bad019c63f77d9ef44fabc026353768d7e6ea16dd51/pydantic-1.10.24-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:076fff9da02ca716e4c8299c68512fdfbeac32fdefc9c160e6f80bdadca0993d", size = 3063515, upload-time = "2025-09-25T01:35:24.048Z" }, + { url = "https://files.pythonhosted.org/packages/84/be/a051e26eff43b6af69f968c1085cdf9069628a7c3614a9836d3ce71327e4/pydantic-1.10.24-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:8f2447ca88a7e14fd4d268857521fb37535c53a367b594fa2d7c2551af905993", size = 2988590, upload-time = "2025-09-25T01:35:25.794Z" }, + { url = "https://files.pythonhosted.org/packages/da/d8/f1aca10d538a0f18d2c99f7e84d3bb5c4abb6bd499272d6c4fc21f39af30/pydantic-1.10.24-cp311-cp311-win_amd64.whl", hash = "sha256:58d42a7c344882c00e3bb7c6c8c6f62db2e3aafa671f307271c45ad96e8ccf7a", size = 2096524, upload-time = "2025-09-25T01:35:27.367Z" }, + { url = "https://files.pythonhosted.org/packages/79/4b/73b59168d0babc14fb40b56795bde269d15709ef33de888e12e4f0add5ea/pydantic-1.10.24-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:17e7610119483f03954569c18d4de16f4e92f1585f20975414033ac2d4a96624", size = 2533707, upload-time = "2025-09-25T01:35:28.953Z" }, + { url = "https://files.pythonhosted.org/packages/6d/36/18e6f421a23ddceecfc5d3800d0e86af05e85574aa9e88cc9e29222db066/pydantic-1.10.24-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:e24435a9970dcb2b35648f2cf57505d4bd414fcca1a404c82e28d948183fe0a6", size = 2322935, upload-time = "2025-09-25T01:35:30.838Z" }, + { url = "https://files.pythonhosted.org/packages/05/14/4d3fc4bea30add2f2f3c287e931b276f7e304bcb322fe5b2c05a76ccdee7/pydantic-1.10.24-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a9e92b9c78d7f3cfa085c21c110e7000894446e24a836d006aabfc6ae3f1813", size = 2779568, upload-time = "2025-09-25T01:35:32.309Z" }, + { url = "https://files.pythonhosted.org/packages/15/32/5349a7b6675d4384f07f9d461d8230de877b2b913529aa20e659c84bab07/pydantic-1.10.24-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ef14dfa7c98b314a3e449e92df6f1479cafe74c626952f353ff0176b075070de", size = 2829163, upload-time = "2025-09-25T01:35:34.294Z" }, + { url = "https://files.pythonhosted.org/packages/f0/00/4d93755e279e8975f7f33adc0af0e9d9aa0db58bcd9c807227d65b396311/pydantic-1.10.24-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:52219b4e70c1db185cfd103a804e416384e1c8950168a2d4f385664c7c35d21a", size = 2912003, upload-time = "2025-09-25T01:35:35.935Z" }, + { url = "https://files.pythonhosted.org/packages/db/0c/c839c2a9cf14185c7b5dcc0959d3c3d4a00da400fe02565abf04a7dff6e0/pydantic-1.10.24-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:5ce0986799248082e9a5a026c9b5d2f9fa2e24d2afb9b0eace9104334a58fdc1", size = 2859825, upload-time = "2025-09-25T01:35:37.657Z" }, + { url = "https://files.pythonhosted.org/packages/cb/0c/f0b8e35033322c176574d6f431455c8d6e3f63811a2c5a00c96b2b97a393/pydantic-1.10.24-cp312-cp312-win_amd64.whl", hash = "sha256:874a78e4ed821258295a472e325eee7de3d91ba7a61d0639ce1b0367a3c63d4c", size = 1969911, upload-time = "2025-09-25T01:35:39.479Z" }, + { url = "https://files.pythonhosted.org/packages/bd/56/9168c282af2bb8bdb102981a9ff0ed41ab4d3735a52b732b2d2ad0e14018/pydantic-1.10.24-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:265788a1120285c4955f8b3d52b3ea6a52c7a74db097c4c13a4d3567f0c6df3c", size = 2589497, upload-time = "2025-09-25T01:35:41.141Z" }, + { url = "https://files.pythonhosted.org/packages/9c/eb/eb4b0e2988a2889a1905c3196f859509e62c208830889d2382928b92fdd2/pydantic-1.10.24-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:d255bebd927e5f1e026b32605684f7b6fc36a13e62b07cb97b29027b91657def", size = 2351231, upload-time = "2025-09-25T01:35:43.221Z" }, + { url = "https://files.pythonhosted.org/packages/1e/be/7451b633ffdc2d28de582a339af2275c3ffcca789dda97d8ac9133f0c616/pydantic-1.10.24-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d6e45dbc79a44e34c2c83ef1fcb56ff663040474dcf4dfc452db24a1de0f7574", size = 2762972, upload-time = "2025-09-25T01:35:45.304Z" }, + { url = "https://files.pythonhosted.org/packages/9e/fb/5de3cfde0b808f2fa0538ec1f1c186f44d905ecbcc96ba22e2cac1f30b23/pydantic-1.10.24-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:af31565b12a7db5bfa5fe8c3a4f8fda4d32f5c2929998b1b241f1c22e9ab6e69", size = 2801015, upload-time = "2025-09-25T01:35:46.774Z" }, + { url = "https://files.pythonhosted.org/packages/2f/6a/9b6b51d19d1af57e8864caff08ce5e8554388b91dc41987ce49315bce3e1/pydantic-1.10.24-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:9c377fc30d9ca40dbff5fd79c5a5e1f0d6fff040fa47a18851bb6b0bd040a5d8", size = 2890844, upload-time = "2025-09-25T01:35:48.724Z" }, + { url = "https://files.pythonhosted.org/packages/27/ca/1ab6b16bd792c8a1fb54949d8b5eef8032d672932ca4afc3048e4febfcdc/pydantic-1.10.24-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:b644d6f14b2ce617d6def21622f9ba73961a16b7dffdba7f6692e2f66fa05d00", size = 2850844, upload-time = "2025-09-25T01:35:50.279Z" }, + { url = "https://files.pythonhosted.org/packages/86/5f/fcc5635818113858a6b37099fed6b860a15b27bb1d0fb270ceb50d0a91b6/pydantic-1.10.24-cp313-cp313-win_amd64.whl", hash = "sha256:0cbbf306124ae41cc153fdc2559b37faa1bec9a23ef7b082c1756d1315ceffe6", size = 1971713, upload-time = "2025-09-25T01:35:52.027Z" }, + { url = "https://files.pythonhosted.org/packages/a9/29/62dd3ffcf7d003f53e834942e9651c2ddd9dc6fb59e6619317e0ed37cf6b/pydantic-1.10.24-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:25fb9a69a21d711deb5acefdab9ff8fb49e6cc77fdd46d38217d433bff2e3de2", size = 2504290, upload-time = "2025-09-25T01:36:16.661Z" }, + { url = "https://files.pythonhosted.org/packages/f2/83/ef9c4be8e7fc96f52320296aed34f7cbe50fa0219833cc2756e611b644f2/pydantic-1.10.24-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6af36a8fb3072526b5b38d3f341b12d8f423188e7d185f130c0079fe02cdec7f", size = 2311007, upload-time = "2025-09-25T01:36:18.75Z" }, + { url = "https://files.pythonhosted.org/packages/1c/b7/ec7da8fbaac8c8100b05301a81fac6b2b7446961edb91bbef4b564834abf/pydantic-1.10.24-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5fc35569dfd15d3b3fc06a22abee0a45fdde0784be644e650a8769cd0b2abd94", size = 2968514, upload-time = "2025-09-25T01:36:20.511Z" }, + { url = "https://files.pythonhosted.org/packages/49/84/9e218a35008fbc32dac2974a35a4bd88d7deb0f5b572cf46ccf003a06310/pydantic-1.10.24-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fac7fbcb65171959973f3136d0792c3d1668bc01fd414738f0898b01f692f1b4", size = 3039539, upload-time = "2025-09-25T01:36:24.359Z" }, + { url = "https://files.pythonhosted.org/packages/b0/2f/b13a8c2d641e3af3fbba136202a9808025ee7cde4b1326ce1aabd1c79d51/pydantic-1.10.24-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:fc3f4a6544517380658b63b144c7d43d5276a343012913b7e5d18d9fba2f12bb", size = 3108949, upload-time = "2025-09-25T01:36:26.138Z" }, + { url = "https://files.pythonhosted.org/packages/1f/57/dccbf080b35b9797f4d477f4c59935e39e4493cd507f31b5ca5ee49c930d/pydantic-1.10.24-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:415c638ca5fd57b915a62dd38c18c8e0afe5adf5527be6f8ce16b4636b616816", size = 3049395, upload-time = "2025-09-25T01:36:27.782Z" }, + { url = "https://files.pythonhosted.org/packages/a2/ff/2a25855a1495fcbe1d3b8c782276994575e98ce2218dbf57c1f2eee7c894/pydantic-1.10.24-cp39-cp39-win_amd64.whl", hash = "sha256:a5bf94042efbc6ab56b18a5921f426ebbeefc04f554a911d76029e7be9057d01", size = 2100530, upload-time = "2025-09-25T01:36:29.932Z" }, + { url = "https://files.pythonhosted.org/packages/46/7f/a168d7077f85f85128aa5636abf13c804c06235c786f1881e659703899a4/pydantic-1.10.24-py3-none-any.whl", hash = "sha256:093768eba26db55a88b12f3073017e3fdee319ef60d3aef5c6c04a4e484db193", size = 166727, upload-time = "2025-09-25T01:36:31.732Z" }, ] [[package]] name = "pydantic" -version = "2.10.3" +version = "2.12.4" source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.14' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version >= '3.10' and python_full_version < '3.14' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version < '3.10' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version >= '3.10' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra != 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version < '3.10' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra != 'group-18-runloop-api-client-pydantic-v2'", +] dependencies = [ - { name = "annotated-types" }, - { name = "pydantic-core" }, - { name = "typing-extensions" }, + { name = "annotated-types", marker = "extra == 'group-18-runloop-api-client-pydantic-v2' or extra != 'group-18-runloop-api-client-pydantic-v1'" }, + { name = "pydantic-core", marker = "extra == 'group-18-runloop-api-client-pydantic-v2' or extra != 'group-18-runloop-api-client-pydantic-v1'" }, + { name = "typing-extensions", marker = "extra == 'group-18-runloop-api-client-pydantic-v2' or extra != 'group-18-runloop-api-client-pydantic-v1'" }, + { name = "typing-inspection", marker = "extra == 'group-18-runloop-api-client-pydantic-v2' or extra != 'group-18-runloop-api-client-pydantic-v1'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/45/0f/27908242621b14e649a84e62b133de45f84c255eecb350ab02979844a788/pydantic-2.10.3.tar.gz", hash = "sha256:cb5ac360ce894ceacd69c403187900a02c4b20b693a9dd1d643e1effab9eadf9", size = 786486, upload-time = "2024-12-03T15:59:02.347Z" } +sdist = { url = "https://files.pythonhosted.org/packages/96/ad/a17bc283d7d81837c061c49e3eaa27a45991759a1b7eae1031921c6bd924/pydantic-2.12.4.tar.gz", hash = "sha256:0f8cb9555000a4b5b617f66bfd2566264c4984b27589d3b845685983e8ea85ac", size = 821038, upload-time = "2025-11-05T10:50:08.59Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/62/51/72c18c55cf2f46ff4f91ebcc8f75aa30f7305f3d726be3f4ebffb4ae972b/pydantic-2.10.3-py3-none-any.whl", hash = "sha256:be04d85bbc7b65651c5f8e6b9976ed9c6f41782a55524cef079a34a0bb82144d", size = 456997, upload-time = "2024-12-03T15:58:59.867Z" }, + { url = "https://files.pythonhosted.org/packages/82/2f/e68750da9b04856e2a7ec56fc6f034a5a79775e9b9a81882252789873798/pydantic-2.12.4-py3-none-any.whl", hash = "sha256:92d3d202a745d46f9be6df459ac5a064fdaa3c1c4cd8adcfa332ccf3c05f871e", size = 463400, upload-time = "2025-11-05T10:50:06.732Z" }, ] [[package]] name = "pydantic-core" -version = "2.27.1" +version = "2.41.5" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "typing-extensions" }, + { name = "typing-extensions", marker = "extra == 'group-18-runloop-api-client-pydantic-v2' or extra != 'group-18-runloop-api-client-pydantic-v1'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/a6/9f/7de1f19b6aea45aeb441838782d68352e71bfa98ee6fa048d5041991b33e/pydantic_core-2.27.1.tar.gz", hash = "sha256:62a763352879b84aa31058fc931884055fd75089cccbd9d58bb6afd01141b235", size = 412785, upload-time = "2024-11-22T00:24:49.865Z" } +sdist = { url = "https://files.pythonhosted.org/packages/71/70/23b021c950c2addd24ec408e9ab05d59b035b39d97cdc1130e1bce647bb6/pydantic_core-2.41.5.tar.gz", hash = "sha256:08daa51ea16ad373ffd5e7606252cc32f07bc72b28284b6bc9c6df804816476e", size = 460952, upload-time = "2025-11-04T13:43:49.098Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/6e/ce/60fd96895c09738648c83f3f00f595c807cb6735c70d3306b548cc96dd49/pydantic_core-2.27.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:71a5e35c75c021aaf400ac048dacc855f000bdfed91614b4a726f7432f1f3d6a", size = 1897984, upload-time = "2024-11-22T00:21:25.431Z" }, - { url = "https://files.pythonhosted.org/packages/fd/b9/84623d6b6be98cc209b06687d9bca5a7b966ffed008d15225dd0d20cce2e/pydantic_core-2.27.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f82d068a2d6ecfc6e054726080af69a6764a10015467d7d7b9f66d6ed5afa23b", size = 1807491, upload-time = "2024-11-22T00:21:27.318Z" }, - { url = "https://files.pythonhosted.org/packages/01/72/59a70165eabbc93b1111d42df9ca016a4aa109409db04304829377947028/pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:121ceb0e822f79163dd4699e4c54f5ad38b157084d97b34de8b232bcaad70278", size = 1831953, upload-time = "2024-11-22T00:21:28.606Z" }, - { url = "https://files.pythonhosted.org/packages/7c/0c/24841136476adafd26f94b45bb718a78cb0500bd7b4f8d667b67c29d7b0d/pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4603137322c18eaf2e06a4495f426aa8d8388940f3c457e7548145011bb68e05", size = 1856071, upload-time = "2024-11-22T00:21:29.931Z" }, - { url = "https://files.pythonhosted.org/packages/53/5e/c32957a09cceb2af10d7642df45d1e3dbd8596061f700eac93b801de53c0/pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a33cd6ad9017bbeaa9ed78a2e0752c5e250eafb9534f308e7a5f7849b0b1bfb4", size = 2038439, upload-time = "2024-11-22T00:21:32.245Z" }, - { url = "https://files.pythonhosted.org/packages/e4/8f/979ab3eccd118b638cd6d8f980fea8794f45018255a36044dea40fe579d4/pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:15cc53a3179ba0fcefe1e3ae50beb2784dede4003ad2dfd24f81bba4b23a454f", size = 2787416, upload-time = "2024-11-22T00:21:33.708Z" }, - { url = "https://files.pythonhosted.org/packages/02/1d/00f2e4626565b3b6d3690dab4d4fe1a26edd6a20e53749eb21ca892ef2df/pydantic_core-2.27.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:45d9c5eb9273aa50999ad6adc6be5e0ecea7e09dbd0d31bd0c65a55a2592ca08", size = 2134548, upload-time = "2024-11-22T00:21:35.823Z" }, - { url = "https://files.pythonhosted.org/packages/9d/46/3112621204128b90898adc2e721a3cd6cf5626504178d6f32c33b5a43b79/pydantic_core-2.27.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8bf7b66ce12a2ac52d16f776b31d16d91033150266eb796967a7e4621707e4f6", size = 1989882, upload-time = "2024-11-22T00:21:37.872Z" }, - { url = "https://files.pythonhosted.org/packages/49/ec/557dd4ff5287ffffdf16a31d08d723de6762bb1b691879dc4423392309bc/pydantic_core-2.27.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:655d7dd86f26cb15ce8a431036f66ce0318648f8853d709b4167786ec2fa4807", size = 1995829, upload-time = "2024-11-22T00:21:39.966Z" }, - { url = "https://files.pythonhosted.org/packages/6e/b2/610dbeb74d8d43921a7234555e4c091cb050a2bdb8cfea86d07791ce01c5/pydantic_core-2.27.1-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:5556470f1a2157031e676f776c2bc20acd34c1990ca5f7e56f1ebf938b9ab57c", size = 2091257, upload-time = "2024-11-22T00:21:41.99Z" }, - { url = "https://files.pythonhosted.org/packages/8c/7f/4bf8e9d26a9118521c80b229291fa9558a07cdd9a968ec2d5c1026f14fbc/pydantic_core-2.27.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f69ed81ab24d5a3bd93861c8c4436f54afdf8e8cc421562b0c7504cf3be58206", size = 2143894, upload-time = "2024-11-22T00:21:44.193Z" }, - { url = "https://files.pythonhosted.org/packages/1f/1c/875ac7139c958f4390f23656fe696d1acc8edf45fb81e4831960f12cd6e4/pydantic_core-2.27.1-cp310-none-win32.whl", hash = "sha256:f5a823165e6d04ccea61a9f0576f345f8ce40ed533013580e087bd4d7442b52c", size = 1816081, upload-time = "2024-11-22T00:21:45.468Z" }, - { url = "https://files.pythonhosted.org/packages/d7/41/55a117acaeda25ceae51030b518032934f251b1dac3704a53781383e3491/pydantic_core-2.27.1-cp310-none-win_amd64.whl", hash = "sha256:57866a76e0b3823e0b56692d1a0bf722bffb324839bb5b7226a7dbd6c9a40b17", size = 1981109, upload-time = "2024-11-22T00:21:47.452Z" }, - { url = "https://files.pythonhosted.org/packages/27/39/46fe47f2ad4746b478ba89c561cafe4428e02b3573df882334bd2964f9cb/pydantic_core-2.27.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:ac3b20653bdbe160febbea8aa6c079d3df19310d50ac314911ed8cc4eb7f8cb8", size = 1895553, upload-time = "2024-11-22T00:21:48.859Z" }, - { url = "https://files.pythonhosted.org/packages/1c/00/0804e84a78b7fdb394fff4c4f429815a10e5e0993e6ae0e0b27dd20379ee/pydantic_core-2.27.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a5a8e19d7c707c4cadb8c18f5f60c843052ae83c20fa7d44f41594c644a1d330", size = 1807220, upload-time = "2024-11-22T00:21:50.354Z" }, - { url = "https://files.pythonhosted.org/packages/01/de/df51b3bac9820d38371f5a261020f505025df732ce566c2a2e7970b84c8c/pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7f7059ca8d64fea7f238994c97d91f75965216bcbe5f695bb44f354893f11d52", size = 1829727, upload-time = "2024-11-22T00:21:51.722Z" }, - { url = "https://files.pythonhosted.org/packages/5f/d9/c01d19da8f9e9fbdb2bf99f8358d145a312590374d0dc9dd8dbe484a9cde/pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bed0f8a0eeea9fb72937ba118f9db0cb7e90773462af7962d382445f3005e5a4", size = 1854282, upload-time = "2024-11-22T00:21:53.098Z" }, - { url = "https://files.pythonhosted.org/packages/5f/84/7db66eb12a0dc88c006abd6f3cbbf4232d26adfd827a28638c540d8f871d/pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a3cb37038123447cf0f3ea4c74751f6a9d7afef0eb71aa07bf5f652b5e6a132c", size = 2037437, upload-time = "2024-11-22T00:21:55.185Z" }, - { url = "https://files.pythonhosted.org/packages/34/ac/a2537958db8299fbabed81167d58cc1506049dba4163433524e06a7d9f4c/pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:84286494f6c5d05243456e04223d5a9417d7f443c3b76065e75001beb26f88de", size = 2780899, upload-time = "2024-11-22T00:21:56.633Z" }, - { url = "https://files.pythonhosted.org/packages/4a/c1/3e38cd777ef832c4fdce11d204592e135ddeedb6c6f525478a53d1c7d3e5/pydantic_core-2.27.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:acc07b2cfc5b835444b44a9956846b578d27beeacd4b52e45489e93276241025", size = 2135022, upload-time = "2024-11-22T00:21:59.154Z" }, - { url = "https://files.pythonhosted.org/packages/7a/69/b9952829f80fd555fe04340539d90e000a146f2a003d3fcd1e7077c06c71/pydantic_core-2.27.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4fefee876e07a6e9aad7a8c8c9f85b0cdbe7df52b8a9552307b09050f7512c7e", size = 1987969, upload-time = "2024-11-22T00:22:01.325Z" }, - { url = "https://files.pythonhosted.org/packages/05/72/257b5824d7988af43460c4e22b63932ed651fe98804cc2793068de7ec554/pydantic_core-2.27.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:258c57abf1188926c774a4c94dd29237e77eda19462e5bb901d88adcab6af919", size = 1994625, upload-time = "2024-11-22T00:22:03.447Z" }, - { url = "https://files.pythonhosted.org/packages/73/c3/78ed6b7f3278a36589bcdd01243189ade7fc9b26852844938b4d7693895b/pydantic_core-2.27.1-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:35c14ac45fcfdf7167ca76cc80b2001205a8d5d16d80524e13508371fb8cdd9c", size = 2090089, upload-time = "2024-11-22T00:22:04.941Z" }, - { url = "https://files.pythonhosted.org/packages/8d/c8/b4139b2f78579960353c4cd987e035108c93a78371bb19ba0dc1ac3b3220/pydantic_core-2.27.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d1b26e1dff225c31897696cab7d4f0a315d4c0d9e8666dbffdb28216f3b17fdc", size = 2142496, upload-time = "2024-11-22T00:22:06.57Z" }, - { url = "https://files.pythonhosted.org/packages/3e/f8/171a03e97eb36c0b51981efe0f78460554a1d8311773d3d30e20c005164e/pydantic_core-2.27.1-cp311-none-win32.whl", hash = "sha256:2cdf7d86886bc6982354862204ae3b2f7f96f21a3eb0ba5ca0ac42c7b38598b9", size = 1811758, upload-time = "2024-11-22T00:22:08.445Z" }, - { url = "https://files.pythonhosted.org/packages/6a/fe/4e0e63c418c1c76e33974a05266e5633e879d4061f9533b1706a86f77d5b/pydantic_core-2.27.1-cp311-none-win_amd64.whl", hash = "sha256:3af385b0cee8df3746c3f406f38bcbfdc9041b5c2d5ce3e5fc6637256e60bbc5", size = 1980864, upload-time = "2024-11-22T00:22:10Z" }, - { url = "https://files.pythonhosted.org/packages/50/fc/93f7238a514c155a8ec02fc7ac6376177d449848115e4519b853820436c5/pydantic_core-2.27.1-cp311-none-win_arm64.whl", hash = "sha256:81f2ec23ddc1b476ff96563f2e8d723830b06dceae348ce02914a37cb4e74b89", size = 1864327, upload-time = "2024-11-22T00:22:11.478Z" }, - { url = "https://files.pythonhosted.org/packages/be/51/2e9b3788feb2aebff2aa9dfbf060ec739b38c05c46847601134cc1fed2ea/pydantic_core-2.27.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9cbd94fc661d2bab2bc702cddd2d3370bbdcc4cd0f8f57488a81bcce90c7a54f", size = 1895239, upload-time = "2024-11-22T00:22:13.775Z" }, - { url = "https://files.pythonhosted.org/packages/7b/9e/f8063952e4a7d0127f5d1181addef9377505dcce3be224263b25c4f0bfd9/pydantic_core-2.27.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5f8c4718cd44ec1580e180cb739713ecda2bdee1341084c1467802a417fe0f02", size = 1805070, upload-time = "2024-11-22T00:22:15.438Z" }, - { url = "https://files.pythonhosted.org/packages/2c/9d/e1d6c4561d262b52e41b17a7ef8301e2ba80b61e32e94520271029feb5d8/pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:15aae984e46de8d376df515f00450d1522077254ef6b7ce189b38ecee7c9677c", size = 1828096, upload-time = "2024-11-22T00:22:17.892Z" }, - { url = "https://files.pythonhosted.org/packages/be/65/80ff46de4266560baa4332ae3181fffc4488ea7d37282da1a62d10ab89a4/pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1ba5e3963344ff25fc8c40da90f44b0afca8cfd89d12964feb79ac1411a260ac", size = 1857708, upload-time = "2024-11-22T00:22:19.412Z" }, - { url = "https://files.pythonhosted.org/packages/d5/ca/3370074ad758b04d9562b12ecdb088597f4d9d13893a48a583fb47682cdf/pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:992cea5f4f3b29d6b4f7f1726ed8ee46c8331c6b4eed6db5b40134c6fe1768bb", size = 2037751, upload-time = "2024-11-22T00:22:20.979Z" }, - { url = "https://files.pythonhosted.org/packages/b1/e2/4ab72d93367194317b99d051947c071aef6e3eb95f7553eaa4208ecf9ba4/pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0325336f348dbee6550d129b1627cb8f5351a9dc91aad141ffb96d4937bd9529", size = 2733863, upload-time = "2024-11-22T00:22:22.951Z" }, - { url = "https://files.pythonhosted.org/packages/8a/c6/8ae0831bf77f356bb73127ce5a95fe115b10f820ea480abbd72d3cc7ccf3/pydantic_core-2.27.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7597c07fbd11515f654d6ece3d0e4e5093edc30a436c63142d9a4b8e22f19c35", size = 2161161, upload-time = "2024-11-22T00:22:24.785Z" }, - { url = "https://files.pythonhosted.org/packages/f1/f4/b2fe73241da2429400fc27ddeaa43e35562f96cf5b67499b2de52b528cad/pydantic_core-2.27.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3bbd5d8cc692616d5ef6fbbbd50dbec142c7e6ad9beb66b78a96e9c16729b089", size = 1993294, upload-time = "2024-11-22T00:22:27.076Z" }, - { url = "https://files.pythonhosted.org/packages/77/29/4bb008823a7f4cc05828198153f9753b3bd4c104d93b8e0b1bfe4e187540/pydantic_core-2.27.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:dc61505e73298a84a2f317255fcc72b710b72980f3a1f670447a21efc88f8381", size = 2001468, upload-time = "2024-11-22T00:22:29.346Z" }, - { url = "https://files.pythonhosted.org/packages/f2/a9/0eaceeba41b9fad851a4107e0cf999a34ae8f0d0d1f829e2574f3d8897b0/pydantic_core-2.27.1-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:e1f735dc43da318cad19b4173dd1ffce1d84aafd6c9b782b3abc04a0d5a6f5bb", size = 2091413, upload-time = "2024-11-22T00:22:30.984Z" }, - { url = "https://files.pythonhosted.org/packages/d8/36/eb8697729725bc610fd73940f0d860d791dc2ad557faaefcbb3edbd2b349/pydantic_core-2.27.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:f4e5658dbffe8843a0f12366a4c2d1c316dbe09bb4dfbdc9d2d9cd6031de8aae", size = 2154735, upload-time = "2024-11-22T00:22:32.616Z" }, - { url = "https://files.pythonhosted.org/packages/52/e5/4f0fbd5c5995cc70d3afed1b5c754055bb67908f55b5cb8000f7112749bf/pydantic_core-2.27.1-cp312-none-win32.whl", hash = "sha256:672ebbe820bb37988c4d136eca2652ee114992d5d41c7e4858cdd90ea94ffe5c", size = 1833633, upload-time = "2024-11-22T00:22:35.027Z" }, - { url = "https://files.pythonhosted.org/packages/ee/f2/c61486eee27cae5ac781305658779b4a6b45f9cc9d02c90cb21b940e82cc/pydantic_core-2.27.1-cp312-none-win_amd64.whl", hash = "sha256:66ff044fd0bb1768688aecbe28b6190f6e799349221fb0de0e6f4048eca14c16", size = 1986973, upload-time = "2024-11-22T00:22:37.502Z" }, - { url = "https://files.pythonhosted.org/packages/df/a6/e3f12ff25f250b02f7c51be89a294689d175ac76e1096c32bf278f29ca1e/pydantic_core-2.27.1-cp312-none-win_arm64.whl", hash = "sha256:9a3b0793b1bbfd4146304e23d90045f2a9b5fd5823aa682665fbdaf2a6c28f3e", size = 1883215, upload-time = "2024-11-22T00:22:39.186Z" }, - { url = "https://files.pythonhosted.org/packages/0f/d6/91cb99a3c59d7b072bded9959fbeab0a9613d5a4935773c0801f1764c156/pydantic_core-2.27.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:f216dbce0e60e4d03e0c4353c7023b202d95cbaeff12e5fd2e82ea0a66905073", size = 1895033, upload-time = "2024-11-22T00:22:41.087Z" }, - { url = "https://files.pythonhosted.org/packages/07/42/d35033f81a28b27dedcade9e967e8a40981a765795c9ebae2045bcef05d3/pydantic_core-2.27.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a2e02889071850bbfd36b56fd6bc98945e23670773bc7a76657e90e6b6603c08", size = 1807542, upload-time = "2024-11-22T00:22:43.341Z" }, - { url = "https://files.pythonhosted.org/packages/41/c2/491b59e222ec7e72236e512108ecad532c7f4391a14e971c963f624f7569/pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42b0e23f119b2b456d07ca91b307ae167cc3f6c846a7b169fca5326e32fdc6cf", size = 1827854, upload-time = "2024-11-22T00:22:44.96Z" }, - { url = "https://files.pythonhosted.org/packages/e3/f3/363652651779113189cefdbbb619b7b07b7a67ebb6840325117cc8cc3460/pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:764be71193f87d460a03f1f7385a82e226639732214b402f9aa61f0d025f0737", size = 1857389, upload-time = "2024-11-22T00:22:47.305Z" }, - { url = "https://files.pythonhosted.org/packages/5f/97/be804aed6b479af5a945daec7538d8bf358d668bdadde4c7888a2506bdfb/pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1c00666a3bd2f84920a4e94434f5974d7bbc57e461318d6bb34ce9cdbbc1f6b2", size = 2037934, upload-time = "2024-11-22T00:22:49.093Z" }, - { url = "https://files.pythonhosted.org/packages/42/01/295f0bd4abf58902917e342ddfe5f76cf66ffabfc57c2e23c7681a1a1197/pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3ccaa88b24eebc0f849ce0a4d09e8a408ec5a94afff395eb69baf868f5183107", size = 2735176, upload-time = "2024-11-22T00:22:50.822Z" }, - { url = "https://files.pythonhosted.org/packages/9d/a0/cd8e9c940ead89cc37812a1a9f310fef59ba2f0b22b4e417d84ab09fa970/pydantic_core-2.27.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c65af9088ac534313e1963443d0ec360bb2b9cba6c2909478d22c2e363d98a51", size = 2160720, upload-time = "2024-11-22T00:22:52.638Z" }, - { url = "https://files.pythonhosted.org/packages/73/ae/9d0980e286627e0aeca4c352a60bd760331622c12d576e5ea4441ac7e15e/pydantic_core-2.27.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:206b5cf6f0c513baffaeae7bd817717140770c74528f3e4c3e1cec7871ddd61a", size = 1992972, upload-time = "2024-11-22T00:22:54.31Z" }, - { url = "https://files.pythonhosted.org/packages/bf/ba/ae4480bc0292d54b85cfb954e9d6bd226982949f8316338677d56541b85f/pydantic_core-2.27.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:062f60e512fc7fff8b8a9d680ff0ddaaef0193dba9fa83e679c0c5f5fbd018bc", size = 2001477, upload-time = "2024-11-22T00:22:56.451Z" }, - { url = "https://files.pythonhosted.org/packages/55/b7/e26adf48c2f943092ce54ae14c3c08d0d221ad34ce80b18a50de8ed2cba8/pydantic_core-2.27.1-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:a0697803ed7d4af5e4c1adf1670af078f8fcab7a86350e969f454daf598c4960", size = 2091186, upload-time = "2024-11-22T00:22:58.226Z" }, - { url = "https://files.pythonhosted.org/packages/ba/cc/8491fff5b608b3862eb36e7d29d36a1af1c945463ca4c5040bf46cc73f40/pydantic_core-2.27.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:58ca98a950171f3151c603aeea9303ef6c235f692fe555e883591103da709b23", size = 2154429, upload-time = "2024-11-22T00:22:59.985Z" }, - { url = "https://files.pythonhosted.org/packages/78/d8/c080592d80edd3441ab7f88f865f51dae94a157fc64283c680e9f32cf6da/pydantic_core-2.27.1-cp313-none-win32.whl", hash = "sha256:8065914ff79f7eab1599bd80406681f0ad08f8e47c880f17b416c9f8f7a26d05", size = 1833713, upload-time = "2024-11-22T00:23:01.715Z" }, - { url = "https://files.pythonhosted.org/packages/83/84/5ab82a9ee2538ac95a66e51f6838d6aba6e0a03a42aa185ad2fe404a4e8f/pydantic_core-2.27.1-cp313-none-win_amd64.whl", hash = "sha256:ba630d5e3db74c79300d9a5bdaaf6200172b107f263c98a0539eeecb857b2337", size = 1987897, upload-time = "2024-11-22T00:23:03.497Z" }, - { url = "https://files.pythonhosted.org/packages/df/c3/b15fb833926d91d982fde29c0624c9f225da743c7af801dace0d4e187e71/pydantic_core-2.27.1-cp313-none-win_arm64.whl", hash = "sha256:45cf8588c066860b623cd11c4ba687f8d7175d5f7ef65f7129df8a394c502de5", size = 1882983, upload-time = "2024-11-22T00:23:05.983Z" }, - { url = "https://files.pythonhosted.org/packages/bc/6a/d741ce0c7da75ce9b394636a406aace00ad992ae417935ef2ad2e67fb970/pydantic_core-2.27.1-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:e9386266798d64eeb19dd3677051f5705bf873e98e15897ddb7d76f477131967", size = 1898376, upload-time = "2024-11-22T00:23:35.233Z" }, - { url = "https://files.pythonhosted.org/packages/bd/68/6ba18e30f10c7051bc55f1dffeadbee51454b381c91846104892a6d3b9cd/pydantic_core-2.27.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4228b5b646caa73f119b1ae756216b59cc6e2267201c27d3912b592c5e323b60", size = 1777246, upload-time = "2024-11-22T00:23:37.134Z" }, - { url = "https://files.pythonhosted.org/packages/36/b8/6f1b7c5f068c00dfe179b8762bc1d32c75c0e9f62c9372174b1b64a74aa8/pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0b3dfe500de26c52abe0477dde16192ac39c98f05bf2d80e76102d394bd13854", size = 1832148, upload-time = "2024-11-22T00:23:39.206Z" }, - { url = "https://files.pythonhosted.org/packages/d9/83/83ff64d599847f080a93df119e856e3bd93063cced04b9a27eb66d863831/pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:aee66be87825cdf72ac64cb03ad4c15ffef4143dbf5c113f64a5ff4f81477bf9", size = 1856371, upload-time = "2024-11-22T00:23:41.206Z" }, - { url = "https://files.pythonhosted.org/packages/72/e9/974e6c73f59627c446833ecc306cadd199edab40abcfa093372a5a5c0156/pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3b748c44bb9f53031c8cbc99a8a061bc181c1000c60a30f55393b6e9c45cc5bd", size = 2038686, upload-time = "2024-11-22T00:23:43.274Z" }, - { url = "https://files.pythonhosted.org/packages/5e/bb/5e912d02dcf29aebb2da35e5a1a26088c39ffc0b1ea81242ee9db6f1f730/pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5ca038c7f6a0afd0b2448941b6ef9d5e1949e999f9e5517692eb6da58e9d44be", size = 2785725, upload-time = "2024-11-22T00:23:45.233Z" }, - { url = "https://files.pythonhosted.org/packages/85/d7/936846087424c882d89c853711687230cd60179a67c79c34c99b64f92625/pydantic_core-2.27.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6e0bd57539da59a3e4671b90a502da9a28c72322a4f17866ba3ac63a82c4498e", size = 2135177, upload-time = "2024-11-22T00:23:48.382Z" }, - { url = "https://files.pythonhosted.org/packages/82/72/5a386e5ce8d3e933c3f283e61357474181c39383f38afffc15a6152fa1c5/pydantic_core-2.27.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ac6c2c45c847bbf8f91930d88716a0fb924b51e0c6dad329b793d670ec5db792", size = 1989877, upload-time = "2024-11-22T00:23:50.417Z" }, - { url = "https://files.pythonhosted.org/packages/ce/5c/b1c417a5fd67ce132d78d16a6ba7629dc7f188dbd4f7c30ef58111ee5147/pydantic_core-2.27.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b94d4ba43739bbe8b0ce4262bcc3b7b9f31459ad120fb595627eaeb7f9b9ca01", size = 1996006, upload-time = "2024-11-22T00:23:52.534Z" }, - { url = "https://files.pythonhosted.org/packages/dd/04/4e18f2c42b29929882f30e4c09a3a039555158995a4ac730a73585198a66/pydantic_core-2.27.1-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:00e6424f4b26fe82d44577b4c842d7df97c20be6439e8e685d0d715feceb9fb9", size = 2091441, upload-time = "2024-11-22T00:23:54.618Z" }, - { url = "https://files.pythonhosted.org/packages/06/84/5a332345b7efb5ab361f916eaf7316ef010e72417e8c7dd3d34462ee9840/pydantic_core-2.27.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:38de0a70160dd97540335b7ad3a74571b24f1dc3ed33f815f0880682e6880131", size = 2144471, upload-time = "2024-11-22T00:23:57.437Z" }, - { url = "https://files.pythonhosted.org/packages/54/58/23caa58c35d36627156789c0fb562264c12cfdb451c75eb275535188a96f/pydantic_core-2.27.1-cp39-none-win32.whl", hash = "sha256:7ccebf51efc61634f6c2344da73e366c75e735960b5654b63d7e6f69a5885fa3", size = 1816563, upload-time = "2024-11-22T00:23:59.45Z" }, - { url = "https://files.pythonhosted.org/packages/f7/9c/e83f08adc8e222b43c7f11d98b27eba08f21bcb259bcbf74743ce903c49c/pydantic_core-2.27.1-cp39-none-win_amd64.whl", hash = "sha256:a57847b090d7892f123726202b7daa20df6694cbd583b67a592e856bff603d6c", size = 1983137, upload-time = "2024-11-22T00:24:01.606Z" }, - { url = "https://files.pythonhosted.org/packages/7c/60/e5eb2d462595ba1f622edbe7b1d19531e510c05c405f0b87c80c1e89d5b1/pydantic_core-2.27.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:3fa80ac2bd5856580e242dbc202db873c60a01b20309c8319b5c5986fbe53ce6", size = 1894016, upload-time = "2024-11-22T00:24:03.815Z" }, - { url = "https://files.pythonhosted.org/packages/61/20/da7059855225038c1c4326a840908cc7ca72c7198cb6addb8b92ec81c1d6/pydantic_core-2.27.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:d950caa237bb1954f1b8c9227b5065ba6875ac9771bb8ec790d956a699b78676", size = 1771648, upload-time = "2024-11-22T00:24:05.981Z" }, - { url = "https://files.pythonhosted.org/packages/8f/fc/5485cf0b0bb38da31d1d292160a4d123b5977841ddc1122c671a30b76cfd/pydantic_core-2.27.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0e4216e64d203e39c62df627aa882f02a2438d18a5f21d7f721621f7a5d3611d", size = 1826929, upload-time = "2024-11-22T00:24:08.163Z" }, - { url = "https://files.pythonhosted.org/packages/a1/ff/fb1284a210e13a5f34c639efc54d51da136074ffbe25ec0c279cf9fbb1c4/pydantic_core-2.27.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:02a3d637bd387c41d46b002f0e49c52642281edacd2740e5a42f7017feea3f2c", size = 1980591, upload-time = "2024-11-22T00:24:10.291Z" }, - { url = "https://files.pythonhosted.org/packages/f1/14/77c1887a182d05af74f6aeac7b740da3a74155d3093ccc7ee10b900cc6b5/pydantic_core-2.27.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:161c27ccce13b6b0c8689418da3885d3220ed2eae2ea5e9b2f7f3d48f1d52c27", size = 1981326, upload-time = "2024-11-22T00:24:13.169Z" }, - { url = "https://files.pythonhosted.org/packages/06/aa/6f1b2747f811a9c66b5ef39d7f02fbb200479784c75e98290d70004b1253/pydantic_core-2.27.1-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:19910754e4cc9c63bc1c7f6d73aa1cfee82f42007e407c0f413695c2f7ed777f", size = 1989205, upload-time = "2024-11-22T00:24:16.049Z" }, - { url = "https://files.pythonhosted.org/packages/7a/d2/8ce2b074d6835f3c88d85f6d8a399790043e9fdb3d0e43455e72d19df8cc/pydantic_core-2.27.1-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:e173486019cc283dc9778315fa29a363579372fe67045e971e89b6365cc035ed", size = 2079616, upload-time = "2024-11-22T00:24:19.099Z" }, - { url = "https://files.pythonhosted.org/packages/65/71/af01033d4e58484c3db1e5d13e751ba5e3d6b87cc3368533df4c50932c8b/pydantic_core-2.27.1-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:af52d26579b308921b73b956153066481f064875140ccd1dfd4e77db89dbb12f", size = 2133265, upload-time = "2024-11-22T00:24:21.397Z" }, - { url = "https://files.pythonhosted.org/packages/33/72/f881b5e18fbb67cf2fb4ab253660de3c6899dbb2dba409d0b757e3559e3d/pydantic_core-2.27.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:981fb88516bd1ae8b0cbbd2034678a39dedc98752f264ac9bc5839d3923fa04c", size = 2001864, upload-time = "2024-11-22T00:24:24.354Z" }, - { url = "https://files.pythonhosted.org/packages/85/3e/f6f75ba36678fee11dd07a7729e9ed172ecf31e3f50a5d636e9605eee2af/pydantic_core-2.27.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5fde892e6c697ce3e30c61b239330fc5d569a71fefd4eb6512fc6caec9dd9e2f", size = 1894250, upload-time = "2024-11-22T00:24:26.603Z" }, - { url = "https://files.pythonhosted.org/packages/d3/2d/a40578918e2eb5b4ee0d206a4fb6c4040c2bf14e28d29fba9bd7e7659d16/pydantic_core-2.27.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:816f5aa087094099fff7edabb5e01cc370eb21aa1a1d44fe2d2aefdfb5599b31", size = 1772035, upload-time = "2024-11-22T00:24:29.721Z" }, - { url = "https://files.pythonhosted.org/packages/7f/ee/0377e9f4ca5a47e8885f670a65c0a647ddf9ce98d50bf7547cf8e1ee5771/pydantic_core-2.27.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9c10c309e18e443ddb108f0ef64e8729363adbfd92d6d57beec680f6261556f3", size = 1827025, upload-time = "2024-11-22T00:24:32.054Z" }, - { url = "https://files.pythonhosted.org/packages/fe/0b/a24d9ef762d05bebdfafd6d5d176b990728fa9ec8ea7b6040d6fb5f3caaa/pydantic_core-2.27.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:98476c98b02c8e9b2eec76ac4156fd006628b1b2d0ef27e548ffa978393fd154", size = 1980927, upload-time = "2024-11-22T00:24:34.285Z" }, - { url = "https://files.pythonhosted.org/packages/00/bd/deadc1722eb7dfdf787a3bbcd32eabbdcc36931fd48671a850e1b9f2cd77/pydantic_core-2.27.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c3027001c28434e7ca5a6e1e527487051136aa81803ac812be51802150d880dd", size = 1980918, upload-time = "2024-11-22T00:24:36.588Z" }, - { url = "https://files.pythonhosted.org/packages/f0/05/5d09d0b0e92053d538927308ea1d35cb25ab543d9c3e2eb2d7653bc73690/pydantic_core-2.27.1-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:7699b1df36a48169cdebda7ab5a2bac265204003f153b4bd17276153d997670a", size = 1989990, upload-time = "2024-11-22T00:24:39.101Z" }, - { url = "https://files.pythonhosted.org/packages/5b/7e/f7191346d1c3ac66049f618ee331359f8552a8b68a2daf916003c30b6dc8/pydantic_core-2.27.1-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:1c39b07d90be6b48968ddc8c19e7585052088fd7ec8d568bb31ff64c70ae3c97", size = 2079871, upload-time = "2024-11-22T00:24:42.191Z" }, - { url = "https://files.pythonhosted.org/packages/f3/65/2caf4f7ad65413a137d43cb9578c54d1abd3224be786ad840263c1bf9e0f/pydantic_core-2.27.1-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:46ccfe3032b3915586e469d4972973f893c0a2bb65669194a5bdea9bacc088c2", size = 2133569, upload-time = "2024-11-22T00:24:44.508Z" }, - { url = "https://files.pythonhosted.org/packages/fd/ab/718d9a1c41bb8d3e0e04d15b68b8afc135f8fcf552705b62f226225065c7/pydantic_core-2.27.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:62ba45e21cf6571d7f716d903b5b7b6d2617e2d5d67c0923dc47b9d41369f840", size = 2002035, upload-time = "2024-11-22T00:24:46.917Z" }, + { url = "https://files.pythonhosted.org/packages/c6/90/32c9941e728d564b411d574d8ee0cf09b12ec978cb22b294995bae5549a5/pydantic_core-2.41.5-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:77b63866ca88d804225eaa4af3e664c5faf3568cea95360d21f4725ab6e07146", size = 2107298, upload-time = "2025-11-04T13:39:04.116Z" }, + { url = "https://files.pythonhosted.org/packages/fb/a8/61c96a77fe28993d9a6fb0f4127e05430a267b235a124545d79fea46dd65/pydantic_core-2.41.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:dfa8a0c812ac681395907e71e1274819dec685fec28273a28905df579ef137e2", size = 1901475, upload-time = "2025-11-04T13:39:06.055Z" }, + { url = "https://files.pythonhosted.org/packages/5d/b6/338abf60225acc18cdc08b4faef592d0310923d19a87fba1faf05af5346e/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5921a4d3ca3aee735d9fd163808f5e8dd6c6972101e4adbda9a4667908849b97", size = 1918815, upload-time = "2025-11-04T13:39:10.41Z" }, + { url = "https://files.pythonhosted.org/packages/d1/1c/2ed0433e682983d8e8cba9c8d8ef274d4791ec6a6f24c58935b90e780e0a/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e25c479382d26a2a41b7ebea1043564a937db462816ea07afa8a44c0866d52f9", size = 2065567, upload-time = "2025-11-04T13:39:12.244Z" }, + { url = "https://files.pythonhosted.org/packages/b3/24/cf84974ee7d6eae06b9e63289b7b8f6549d416b5c199ca2d7ce13bbcf619/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f547144f2966e1e16ae626d8ce72b4cfa0caedc7fa28052001c94fb2fcaa1c52", size = 2230442, upload-time = "2025-11-04T13:39:13.962Z" }, + { url = "https://files.pythonhosted.org/packages/fd/21/4e287865504b3edc0136c89c9c09431be326168b1eb7841911cbc877a995/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6f52298fbd394f9ed112d56f3d11aabd0d5bd27beb3084cc3d8ad069483b8941", size = 2350956, upload-time = "2025-11-04T13:39:15.889Z" }, + { url = "https://files.pythonhosted.org/packages/a8/76/7727ef2ffa4b62fcab916686a68a0426b9b790139720e1934e8ba797e238/pydantic_core-2.41.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:100baa204bb412b74fe285fb0f3a385256dad1d1879f0a5cb1499ed2e83d132a", size = 2068253, upload-time = "2025-11-04T13:39:17.403Z" }, + { url = "https://files.pythonhosted.org/packages/d5/8c/a4abfc79604bcb4c748e18975c44f94f756f08fb04218d5cb87eb0d3a63e/pydantic_core-2.41.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:05a2c8852530ad2812cb7914dc61a1125dc4e06252ee98e5638a12da6cc6fb6c", size = 2177050, upload-time = "2025-11-04T13:39:19.351Z" }, + { url = "https://files.pythonhosted.org/packages/67/b1/de2e9a9a79b480f9cb0b6e8b6ba4c50b18d4e89852426364c66aa82bb7b3/pydantic_core-2.41.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:29452c56df2ed968d18d7e21f4ab0ac55e71dc59524872f6fc57dcf4a3249ed2", size = 2147178, upload-time = "2025-11-04T13:39:21Z" }, + { url = "https://files.pythonhosted.org/packages/16/c1/dfb33f837a47b20417500efaa0378adc6635b3c79e8369ff7a03c494b4ac/pydantic_core-2.41.5-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:d5160812ea7a8a2ffbe233d8da666880cad0cbaf5d4de74ae15c313213d62556", size = 2341833, upload-time = "2025-11-04T13:39:22.606Z" }, + { url = "https://files.pythonhosted.org/packages/47/36/00f398642a0f4b815a9a558c4f1dca1b4020a7d49562807d7bc9ff279a6c/pydantic_core-2.41.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:df3959765b553b9440adfd3c795617c352154e497a4eaf3752555cfb5da8fc49", size = 2321156, upload-time = "2025-11-04T13:39:25.843Z" }, + { url = "https://files.pythonhosted.org/packages/7e/70/cad3acd89fde2010807354d978725ae111ddf6d0ea46d1ea1775b5c1bd0c/pydantic_core-2.41.5-cp310-cp310-win32.whl", hash = "sha256:1f8d33a7f4d5a7889e60dc39856d76d09333d8a6ed0f5f1190635cbec70ec4ba", size = 1989378, upload-time = "2025-11-04T13:39:27.92Z" }, + { url = "https://files.pythonhosted.org/packages/76/92/d338652464c6c367e5608e4488201702cd1cbb0f33f7b6a85a60fe5f3720/pydantic_core-2.41.5-cp310-cp310-win_amd64.whl", hash = "sha256:62de39db01b8d593e45871af2af9e497295db8d73b085f6bfd0b18c83c70a8f9", size = 2013622, upload-time = "2025-11-04T13:39:29.848Z" }, + { url = "https://files.pythonhosted.org/packages/e8/72/74a989dd9f2084b3d9530b0915fdda64ac48831c30dbf7c72a41a5232db8/pydantic_core-2.41.5-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:a3a52f6156e73e7ccb0f8cced536adccb7042be67cb45f9562e12b319c119da6", size = 2105873, upload-time = "2025-11-04T13:39:31.373Z" }, + { url = "https://files.pythonhosted.org/packages/12/44/37e403fd9455708b3b942949e1d7febc02167662bf1a7da5b78ee1ea2842/pydantic_core-2.41.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7f3bf998340c6d4b0c9a2f02d6a400e51f123b59565d74dc60d252ce888c260b", size = 1899826, upload-time = "2025-11-04T13:39:32.897Z" }, + { url = "https://files.pythonhosted.org/packages/33/7f/1d5cab3ccf44c1935a359d51a8a2a9e1a654b744b5e7f80d41b88d501eec/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:378bec5c66998815d224c9ca994f1e14c0c21cb95d2f52b6021cc0b2a58f2a5a", size = 1917869, upload-time = "2025-11-04T13:39:34.469Z" }, + { url = "https://files.pythonhosted.org/packages/6e/6a/30d94a9674a7fe4f4744052ed6c5e083424510be1e93da5bc47569d11810/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e7b576130c69225432866fe2f4a469a85a54ade141d96fd396dffcf607b558f8", size = 2063890, upload-time = "2025-11-04T13:39:36.053Z" }, + { url = "https://files.pythonhosted.org/packages/50/be/76e5d46203fcb2750e542f32e6c371ffa9b8ad17364cf94bb0818dbfb50c/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6cb58b9c66f7e4179a2d5e0f849c48eff5c1fca560994d6eb6543abf955a149e", size = 2229740, upload-time = "2025-11-04T13:39:37.753Z" }, + { url = "https://files.pythonhosted.org/packages/d3/ee/fed784df0144793489f87db310a6bbf8118d7b630ed07aa180d6067e653a/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:88942d3a3dff3afc8288c21e565e476fc278902ae4d6d134f1eeda118cc830b1", size = 2350021, upload-time = "2025-11-04T13:39:40.94Z" }, + { url = "https://files.pythonhosted.org/packages/c8/be/8fed28dd0a180dca19e72c233cbf58efa36df055e5b9d90d64fd1740b828/pydantic_core-2.41.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f31d95a179f8d64d90f6831d71fa93290893a33148d890ba15de25642c5d075b", size = 2066378, upload-time = "2025-11-04T13:39:42.523Z" }, + { url = "https://files.pythonhosted.org/packages/b0/3b/698cf8ae1d536a010e05121b4958b1257f0b5522085e335360e53a6b1c8b/pydantic_core-2.41.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c1df3d34aced70add6f867a8cf413e299177e0c22660cc767218373d0779487b", size = 2175761, upload-time = "2025-11-04T13:39:44.553Z" }, + { url = "https://files.pythonhosted.org/packages/b8/ba/15d537423939553116dea94ce02f9c31be0fa9d0b806d427e0308ec17145/pydantic_core-2.41.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:4009935984bd36bd2c774e13f9a09563ce8de4abaa7226f5108262fa3e637284", size = 2146303, upload-time = "2025-11-04T13:39:46.238Z" }, + { url = "https://files.pythonhosted.org/packages/58/7f/0de669bf37d206723795f9c90c82966726a2ab06c336deba4735b55af431/pydantic_core-2.41.5-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:34a64bc3441dc1213096a20fe27e8e128bd3ff89921706e83c0b1ac971276594", size = 2340355, upload-time = "2025-11-04T13:39:48.002Z" }, + { url = "https://files.pythonhosted.org/packages/e5/de/e7482c435b83d7e3c3ee5ee4451f6e8973cff0eb6007d2872ce6383f6398/pydantic_core-2.41.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:c9e19dd6e28fdcaa5a1de679aec4141f691023916427ef9bae8584f9c2fb3b0e", size = 2319875, upload-time = "2025-11-04T13:39:49.705Z" }, + { url = "https://files.pythonhosted.org/packages/fe/e6/8c9e81bb6dd7560e33b9053351c29f30c8194b72f2d6932888581f503482/pydantic_core-2.41.5-cp311-cp311-win32.whl", hash = "sha256:2c010c6ded393148374c0f6f0bf89d206bf3217f201faa0635dcd56bd1520f6b", size = 1987549, upload-time = "2025-11-04T13:39:51.842Z" }, + { url = "https://files.pythonhosted.org/packages/11/66/f14d1d978ea94d1bc21fc98fcf570f9542fe55bfcc40269d4e1a21c19bf7/pydantic_core-2.41.5-cp311-cp311-win_amd64.whl", hash = "sha256:76ee27c6e9c7f16f47db7a94157112a2f3a00e958bc626e2f4ee8bec5c328fbe", size = 2011305, upload-time = "2025-11-04T13:39:53.485Z" }, + { url = "https://files.pythonhosted.org/packages/56/d8/0e271434e8efd03186c5386671328154ee349ff0354d83c74f5caaf096ed/pydantic_core-2.41.5-cp311-cp311-win_arm64.whl", hash = "sha256:4bc36bbc0b7584de96561184ad7f012478987882ebf9f9c389b23f432ea3d90f", size = 1972902, upload-time = "2025-11-04T13:39:56.488Z" }, + { url = "https://files.pythonhosted.org/packages/5f/5d/5f6c63eebb5afee93bcaae4ce9a898f3373ca23df3ccaef086d0233a35a7/pydantic_core-2.41.5-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:f41a7489d32336dbf2199c8c0a215390a751c5b014c2c1c5366e817202e9cdf7", size = 2110990, upload-time = "2025-11-04T13:39:58.079Z" }, + { url = "https://files.pythonhosted.org/packages/aa/32/9c2e8ccb57c01111e0fd091f236c7b371c1bccea0fa85247ac55b1e2b6b6/pydantic_core-2.41.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:070259a8818988b9a84a449a2a7337c7f430a22acc0859c6b110aa7212a6d9c0", size = 1896003, upload-time = "2025-11-04T13:39:59.956Z" }, + { url = "https://files.pythonhosted.org/packages/68/b8/a01b53cb0e59139fbc9e4fda3e9724ede8de279097179be4ff31f1abb65a/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e96cea19e34778f8d59fe40775a7a574d95816eb150850a85a7a4c8f4b94ac69", size = 1919200, upload-time = "2025-11-04T13:40:02.241Z" }, + { url = "https://files.pythonhosted.org/packages/38/de/8c36b5198a29bdaade07b5985e80a233a5ac27137846f3bc2d3b40a47360/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ed2e99c456e3fadd05c991f8f437ef902e00eedf34320ba2b0842bd1c3ca3a75", size = 2052578, upload-time = "2025-11-04T13:40:04.401Z" }, + { url = "https://files.pythonhosted.org/packages/00/b5/0e8e4b5b081eac6cb3dbb7e60a65907549a1ce035a724368c330112adfdd/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:65840751b72fbfd82c3c640cff9284545342a4f1eb1586ad0636955b261b0b05", size = 2208504, upload-time = "2025-11-04T13:40:06.072Z" }, + { url = "https://files.pythonhosted.org/packages/77/56/87a61aad59c7c5b9dc8caad5a41a5545cba3810c3e828708b3d7404f6cef/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e536c98a7626a98feb2d3eaf75944ef6f3dbee447e1f841eae16f2f0a72d8ddc", size = 2335816, upload-time = "2025-11-04T13:40:07.835Z" }, + { url = "https://files.pythonhosted.org/packages/0d/76/941cc9f73529988688a665a5c0ecff1112b3d95ab48f81db5f7606f522d3/pydantic_core-2.41.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eceb81a8d74f9267ef4081e246ffd6d129da5d87e37a77c9bde550cb04870c1c", size = 2075366, upload-time = "2025-11-04T13:40:09.804Z" }, + { url = "https://files.pythonhosted.org/packages/d3/43/ebef01f69baa07a482844faaa0a591bad1ef129253ffd0cdaa9d8a7f72d3/pydantic_core-2.41.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d38548150c39b74aeeb0ce8ee1d8e82696f4a4e16ddc6de7b1d8823f7de4b9b5", size = 2171698, upload-time = "2025-11-04T13:40:12.004Z" }, + { url = "https://files.pythonhosted.org/packages/b1/87/41f3202e4193e3bacfc2c065fab7706ebe81af46a83d3e27605029c1f5a6/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:c23e27686783f60290e36827f9c626e63154b82b116d7fe9adba1fda36da706c", size = 2132603, upload-time = "2025-11-04T13:40:13.868Z" }, + { url = "https://files.pythonhosted.org/packages/49/7d/4c00df99cb12070b6bccdef4a195255e6020a550d572768d92cc54dba91a/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:482c982f814460eabe1d3bb0adfdc583387bd4691ef00b90575ca0d2b6fe2294", size = 2329591, upload-time = "2025-11-04T13:40:15.672Z" }, + { url = "https://files.pythonhosted.org/packages/cc/6a/ebf4b1d65d458f3cda6a7335d141305dfa19bdc61140a884d165a8a1bbc7/pydantic_core-2.41.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:bfea2a5f0b4d8d43adf9d7b8bf019fb46fdd10a2e5cde477fbcb9d1fa08c68e1", size = 2319068, upload-time = "2025-11-04T13:40:17.532Z" }, + { url = "https://files.pythonhosted.org/packages/49/3b/774f2b5cd4192d5ab75870ce4381fd89cf218af999515baf07e7206753f0/pydantic_core-2.41.5-cp312-cp312-win32.whl", hash = "sha256:b74557b16e390ec12dca509bce9264c3bbd128f8a2c376eaa68003d7f327276d", size = 1985908, upload-time = "2025-11-04T13:40:19.309Z" }, + { url = "https://files.pythonhosted.org/packages/86/45/00173a033c801cacf67c190fef088789394feaf88a98a7035b0e40d53dc9/pydantic_core-2.41.5-cp312-cp312-win_amd64.whl", hash = "sha256:1962293292865bca8e54702b08a4f26da73adc83dd1fcf26fbc875b35d81c815", size = 2020145, upload-time = "2025-11-04T13:40:21.548Z" }, + { url = "https://files.pythonhosted.org/packages/f9/22/91fbc821fa6d261b376a3f73809f907cec5ca6025642c463d3488aad22fb/pydantic_core-2.41.5-cp312-cp312-win_arm64.whl", hash = "sha256:1746d4a3d9a794cacae06a5eaaccb4b8643a131d45fbc9af23e353dc0a5ba5c3", size = 1976179, upload-time = "2025-11-04T13:40:23.393Z" }, + { url = "https://files.pythonhosted.org/packages/87/06/8806241ff1f70d9939f9af039c6c35f2360cf16e93c2ca76f184e76b1564/pydantic_core-2.41.5-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:941103c9be18ac8daf7b7adca8228f8ed6bb7a1849020f643b3a14d15b1924d9", size = 2120403, upload-time = "2025-11-04T13:40:25.248Z" }, + { url = "https://files.pythonhosted.org/packages/94/02/abfa0e0bda67faa65fef1c84971c7e45928e108fe24333c81f3bfe35d5f5/pydantic_core-2.41.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:112e305c3314f40c93998e567879e887a3160bb8689ef3d2c04b6cc62c33ac34", size = 1896206, upload-time = "2025-11-04T13:40:27.099Z" }, + { url = "https://files.pythonhosted.org/packages/15/df/a4c740c0943e93e6500f9eb23f4ca7ec9bf71b19e608ae5b579678c8d02f/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cbaad15cb0c90aa221d43c00e77bb33c93e8d36e0bf74760cd00e732d10a6a0", size = 1919307, upload-time = "2025-11-04T13:40:29.806Z" }, + { url = "https://files.pythonhosted.org/packages/9a/e3/6324802931ae1d123528988e0e86587c2072ac2e5394b4bc2bc34b61ff6e/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:03ca43e12fab6023fc79d28ca6b39b05f794ad08ec2feccc59a339b02f2b3d33", size = 2063258, upload-time = "2025-11-04T13:40:33.544Z" }, + { url = "https://files.pythonhosted.org/packages/c9/d4/2230d7151d4957dd79c3044ea26346c148c98fbf0ee6ebd41056f2d62ab5/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:dc799088c08fa04e43144b164feb0c13f9a0bc40503f8df3e9fde58a3c0c101e", size = 2214917, upload-time = "2025-11-04T13:40:35.479Z" }, + { url = "https://files.pythonhosted.org/packages/e6/9f/eaac5df17a3672fef0081b6c1bb0b82b33ee89aa5cec0d7b05f52fd4a1fa/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:97aeba56665b4c3235a0e52b2c2f5ae9cd071b8a8310ad27bddb3f7fb30e9aa2", size = 2332186, upload-time = "2025-11-04T13:40:37.436Z" }, + { url = "https://files.pythonhosted.org/packages/cf/4e/35a80cae583a37cf15604b44240e45c05e04e86f9cfd766623149297e971/pydantic_core-2.41.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:406bf18d345822d6c21366031003612b9c77b3e29ffdb0f612367352aab7d586", size = 2073164, upload-time = "2025-11-04T13:40:40.289Z" }, + { url = "https://files.pythonhosted.org/packages/bf/e3/f6e262673c6140dd3305d144d032f7bd5f7497d3871c1428521f19f9efa2/pydantic_core-2.41.5-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b93590ae81f7010dbe380cdeab6f515902ebcbefe0b9327cc4804d74e93ae69d", size = 2179146, upload-time = "2025-11-04T13:40:42.809Z" }, + { url = "https://files.pythonhosted.org/packages/75/c7/20bd7fc05f0c6ea2056a4565c6f36f8968c0924f19b7d97bbfea55780e73/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:01a3d0ab748ee531f4ea6c3e48ad9dac84ddba4b0d82291f87248f2f9de8d740", size = 2137788, upload-time = "2025-11-04T13:40:44.752Z" }, + { url = "https://files.pythonhosted.org/packages/3a/8d/34318ef985c45196e004bc46c6eab2eda437e744c124ef0dbe1ff2c9d06b/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:6561e94ba9dacc9c61bce40e2d6bdc3bfaa0259d3ff36ace3b1e6901936d2e3e", size = 2340133, upload-time = "2025-11-04T13:40:46.66Z" }, + { url = "https://files.pythonhosted.org/packages/9c/59/013626bf8c78a5a5d9350d12e7697d3d4de951a75565496abd40ccd46bee/pydantic_core-2.41.5-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:915c3d10f81bec3a74fbd4faebe8391013ba61e5a1a8d48c4455b923bdda7858", size = 2324852, upload-time = "2025-11-04T13:40:48.575Z" }, + { url = "https://files.pythonhosted.org/packages/1a/d9/c248c103856f807ef70c18a4f986693a46a8ffe1602e5d361485da502d20/pydantic_core-2.41.5-cp313-cp313-win32.whl", hash = "sha256:650ae77860b45cfa6e2cdafc42618ceafab3a2d9a3811fcfbd3bbf8ac3c40d36", size = 1994679, upload-time = "2025-11-04T13:40:50.619Z" }, + { url = "https://files.pythonhosted.org/packages/9e/8b/341991b158ddab181cff136acd2552c9f35bd30380422a639c0671e99a91/pydantic_core-2.41.5-cp313-cp313-win_amd64.whl", hash = "sha256:79ec52ec461e99e13791ec6508c722742ad745571f234ea6255bed38c6480f11", size = 2019766, upload-time = "2025-11-04T13:40:52.631Z" }, + { url = "https://files.pythonhosted.org/packages/73/7d/f2f9db34af103bea3e09735bb40b021788a5e834c81eedb541991badf8f5/pydantic_core-2.41.5-cp313-cp313-win_arm64.whl", hash = "sha256:3f84d5c1b4ab906093bdc1ff10484838aca54ef08de4afa9de0f5f14d69639cd", size = 1981005, upload-time = "2025-11-04T13:40:54.734Z" }, + { url = "https://files.pythonhosted.org/packages/ea/28/46b7c5c9635ae96ea0fbb779e271a38129df2550f763937659ee6c5dbc65/pydantic_core-2.41.5-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:3f37a19d7ebcdd20b96485056ba9e8b304e27d9904d233d7b1015db320e51f0a", size = 2119622, upload-time = "2025-11-04T13:40:56.68Z" }, + { url = "https://files.pythonhosted.org/packages/74/1a/145646e5687e8d9a1e8d09acb278c8535ebe9e972e1f162ed338a622f193/pydantic_core-2.41.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1d1d9764366c73f996edd17abb6d9d7649a7eb690006ab6adbda117717099b14", size = 1891725, upload-time = "2025-11-04T13:40:58.807Z" }, + { url = "https://files.pythonhosted.org/packages/23/04/e89c29e267b8060b40dca97bfc64a19b2a3cf99018167ea1677d96368273/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:25e1c2af0fce638d5f1988b686f3b3ea8cd7de5f244ca147c777769e798a9cd1", size = 1915040, upload-time = "2025-11-04T13:41:00.853Z" }, + { url = "https://files.pythonhosted.org/packages/84/a3/15a82ac7bd97992a82257f777b3583d3e84bdb06ba6858f745daa2ec8a85/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:506d766a8727beef16b7adaeb8ee6217c64fc813646b424d0804d67c16eddb66", size = 2063691, upload-time = "2025-11-04T13:41:03.504Z" }, + { url = "https://files.pythonhosted.org/packages/74/9b/0046701313c6ef08c0c1cf0e028c67c770a4e1275ca73131563c5f2a310a/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4819fa52133c9aa3c387b3328f25c1facc356491e6135b459f1de698ff64d869", size = 2213897, upload-time = "2025-11-04T13:41:05.804Z" }, + { url = "https://files.pythonhosted.org/packages/8a/cd/6bac76ecd1b27e75a95ca3a9a559c643b3afcd2dd62086d4b7a32a18b169/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2b761d210c9ea91feda40d25b4efe82a1707da2ef62901466a42492c028553a2", size = 2333302, upload-time = "2025-11-04T13:41:07.809Z" }, + { url = "https://files.pythonhosted.org/packages/4c/d2/ef2074dc020dd6e109611a8be4449b98cd25e1b9b8a303c2f0fca2f2bcf7/pydantic_core-2.41.5-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:22f0fb8c1c583a3b6f24df2470833b40207e907b90c928cc8d3594b76f874375", size = 2064877, upload-time = "2025-11-04T13:41:09.827Z" }, + { url = "https://files.pythonhosted.org/packages/18/66/e9db17a9a763d72f03de903883c057b2592c09509ccfe468187f2a2eef29/pydantic_core-2.41.5-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2782c870e99878c634505236d81e5443092fba820f0373997ff75f90f68cd553", size = 2180680, upload-time = "2025-11-04T13:41:12.379Z" }, + { url = "https://files.pythonhosted.org/packages/d3/9e/3ce66cebb929f3ced22be85d4c2399b8e85b622db77dad36b73c5387f8f8/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:0177272f88ab8312479336e1d777f6b124537d47f2123f89cb37e0accea97f90", size = 2138960, upload-time = "2025-11-04T13:41:14.627Z" }, + { url = "https://files.pythonhosted.org/packages/a6/62/205a998f4327d2079326b01abee48e502ea739d174f0a89295c481a2272e/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:63510af5e38f8955b8ee5687740d6ebf7c2a0886d15a6d65c32814613681bc07", size = 2339102, upload-time = "2025-11-04T13:41:16.868Z" }, + { url = "https://files.pythonhosted.org/packages/3c/0d/f05e79471e889d74d3d88f5bd20d0ed189ad94c2423d81ff8d0000aab4ff/pydantic_core-2.41.5-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:e56ba91f47764cc14f1daacd723e3e82d1a89d783f0f5afe9c364b8bb491ccdb", size = 2326039, upload-time = "2025-11-04T13:41:18.934Z" }, + { url = "https://files.pythonhosted.org/packages/ec/e1/e08a6208bb100da7e0c4b288eed624a703f4d129bde2da475721a80cab32/pydantic_core-2.41.5-cp314-cp314-win32.whl", hash = "sha256:aec5cf2fd867b4ff45b9959f8b20ea3993fc93e63c7363fe6851424c8a7e7c23", size = 1995126, upload-time = "2025-11-04T13:41:21.418Z" }, + { url = "https://files.pythonhosted.org/packages/48/5d/56ba7b24e9557f99c9237e29f5c09913c81eeb2f3217e40e922353668092/pydantic_core-2.41.5-cp314-cp314-win_amd64.whl", hash = "sha256:8e7c86f27c585ef37c35e56a96363ab8de4e549a95512445b85c96d3e2f7c1bf", size = 2015489, upload-time = "2025-11-04T13:41:24.076Z" }, + { url = "https://files.pythonhosted.org/packages/4e/bb/f7a190991ec9e3e0ba22e4993d8755bbc4a32925c0b5b42775c03e8148f9/pydantic_core-2.41.5-cp314-cp314-win_arm64.whl", hash = "sha256:e672ba74fbc2dc8eea59fb6d4aed6845e6905fc2a8afe93175d94a83ba2a01a0", size = 1977288, upload-time = "2025-11-04T13:41:26.33Z" }, + { url = "https://files.pythonhosted.org/packages/92/ed/77542d0c51538e32e15afe7899d79efce4b81eee631d99850edc2f5e9349/pydantic_core-2.41.5-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:8566def80554c3faa0e65ac30ab0932b9e3a5cd7f8323764303d468e5c37595a", size = 2120255, upload-time = "2025-11-04T13:41:28.569Z" }, + { url = "https://files.pythonhosted.org/packages/bb/3d/6913dde84d5be21e284439676168b28d8bbba5600d838b9dca99de0fad71/pydantic_core-2.41.5-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:b80aa5095cd3109962a298ce14110ae16b8c1aece8b72f9dafe81cf597ad80b3", size = 1863760, upload-time = "2025-11-04T13:41:31.055Z" }, + { url = "https://files.pythonhosted.org/packages/5a/f0/e5e6b99d4191da102f2b0eb9687aaa7f5bea5d9964071a84effc3e40f997/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3006c3dd9ba34b0c094c544c6006cc79e87d8612999f1a5d43b769b89181f23c", size = 1878092, upload-time = "2025-11-04T13:41:33.21Z" }, + { url = "https://files.pythonhosted.org/packages/71/48/36fb760642d568925953bcc8116455513d6e34c4beaa37544118c36aba6d/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:72f6c8b11857a856bcfa48c86f5368439f74453563f951e473514579d44aa612", size = 2053385, upload-time = "2025-11-04T13:41:35.508Z" }, + { url = "https://files.pythonhosted.org/packages/20/25/92dc684dd8eb75a234bc1c764b4210cf2646479d54b47bf46061657292a8/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5cb1b2f9742240e4bb26b652a5aeb840aa4b417c7748b6f8387927bc6e45e40d", size = 2218832, upload-time = "2025-11-04T13:41:37.732Z" }, + { url = "https://files.pythonhosted.org/packages/e2/09/f53e0b05023d3e30357d82eb35835d0f6340ca344720a4599cd663dca599/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bd3d54f38609ff308209bd43acea66061494157703364ae40c951f83ba99a1a9", size = 2327585, upload-time = "2025-11-04T13:41:40Z" }, + { url = "https://files.pythonhosted.org/packages/aa/4e/2ae1aa85d6af35a39b236b1b1641de73f5a6ac4d5a7509f77b814885760c/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2ff4321e56e879ee8d2a879501c8e469414d948f4aba74a2d4593184eb326660", size = 2041078, upload-time = "2025-11-04T13:41:42.323Z" }, + { url = "https://files.pythonhosted.org/packages/cd/13/2e215f17f0ef326fc72afe94776edb77525142c693767fc347ed6288728d/pydantic_core-2.41.5-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d0d2568a8c11bf8225044aa94409e21da0cb09dcdafe9ecd10250b2baad531a9", size = 2173914, upload-time = "2025-11-04T13:41:45.221Z" }, + { url = "https://files.pythonhosted.org/packages/02/7a/f999a6dcbcd0e5660bc348a3991c8915ce6599f4f2c6ac22f01d7a10816c/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:a39455728aabd58ceabb03c90e12f71fd30fa69615760a075b9fec596456ccc3", size = 2129560, upload-time = "2025-11-04T13:41:47.474Z" }, + { url = "https://files.pythonhosted.org/packages/3a/b1/6c990ac65e3b4c079a4fb9f5b05f5b013afa0f4ed6780a3dd236d2cbdc64/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:239edca560d05757817c13dc17c50766136d21f7cd0fac50295499ae24f90fdf", size = 2329244, upload-time = "2025-11-04T13:41:49.992Z" }, + { url = "https://files.pythonhosted.org/packages/d9/02/3c562f3a51afd4d88fff8dffb1771b30cfdfd79befd9883ee094f5b6c0d8/pydantic_core-2.41.5-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:2a5e06546e19f24c6a96a129142a75cee553cc018ffee48a460059b1185f4470", size = 2331955, upload-time = "2025-11-04T13:41:54.079Z" }, + { url = "https://files.pythonhosted.org/packages/5c/96/5fb7d8c3c17bc8c62fdb031c47d77a1af698f1d7a406b0f79aaa1338f9ad/pydantic_core-2.41.5-cp314-cp314t-win32.whl", hash = "sha256:b4ececa40ac28afa90871c2cc2b9ffd2ff0bf749380fbdf57d165fd23da353aa", size = 1988906, upload-time = "2025-11-04T13:41:56.606Z" }, + { url = "https://files.pythonhosted.org/packages/22/ed/182129d83032702912c2e2d8bbe33c036f342cc735737064668585dac28f/pydantic_core-2.41.5-cp314-cp314t-win_amd64.whl", hash = "sha256:80aa89cad80b32a912a65332f64a4450ed00966111b6615ca6816153d3585a8c", size = 1981607, upload-time = "2025-11-04T13:41:58.889Z" }, + { url = "https://files.pythonhosted.org/packages/9f/ed/068e41660b832bb0b1aa5b58011dea2a3fe0ba7861ff38c4d4904c1c1a99/pydantic_core-2.41.5-cp314-cp314t-win_arm64.whl", hash = "sha256:35b44f37a3199f771c3eaa53051bc8a70cd7b54f333531c59e29fd4db5d15008", size = 1974769, upload-time = "2025-11-04T13:42:01.186Z" }, + { url = "https://files.pythonhosted.org/packages/54/db/160dffb57ed9a3705c4cbcbff0ac03bdae45f1ca7d58ab74645550df3fbd/pydantic_core-2.41.5-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:8bfeaf8735be79f225f3fefab7f941c712aaca36f1128c9d7e2352ee1aa87bdf", size = 2107999, upload-time = "2025-11-04T13:42:03.885Z" }, + { url = "https://files.pythonhosted.org/packages/a3/7d/88e7de946f60d9263cc84819f32513520b85c0f8322f9b8f6e4afc938383/pydantic_core-2.41.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:346285d28e4c8017da95144c7f3acd42740d637ff41946af5ce6e5e420502dd5", size = 1929745, upload-time = "2025-11-04T13:42:06.075Z" }, + { url = "https://files.pythonhosted.org/packages/d5/c2/aef51e5b283780e85e99ff19db0f05842d2d4a8a8cd15e63b0280029b08f/pydantic_core-2.41.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a75dafbf87d6276ddc5b2bf6fae5254e3d0876b626eb24969a574fff9149ee5d", size = 1920220, upload-time = "2025-11-04T13:42:08.457Z" }, + { url = "https://files.pythonhosted.org/packages/c7/97/492ab10f9ac8695cd76b2fdb24e9e61f394051df71594e9bcc891c9f586e/pydantic_core-2.41.5-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7b93a4d08587e2b7e7882de461e82b6ed76d9026ce91ca7915e740ecc7855f60", size = 2067296, upload-time = "2025-11-04T13:42:10.817Z" }, + { url = "https://files.pythonhosted.org/packages/ec/23/984149650e5269c59a2a4c41d234a9570adc68ab29981825cfaf4cfad8f4/pydantic_core-2.41.5-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e8465ab91a4bd96d36dde3263f06caa6a8a6019e4113f24dc753d79a8b3a3f82", size = 2231548, upload-time = "2025-11-04T13:42:13.843Z" }, + { url = "https://files.pythonhosted.org/packages/71/0c/85bcbb885b9732c28bec67a222dbed5ed2d77baee1f8bba2002e8cd00c5c/pydantic_core-2.41.5-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:299e0a22e7ae2b85c1a57f104538b2656e8ab1873511fd718a1c1c6f149b77b5", size = 2362571, upload-time = "2025-11-04T13:42:16.208Z" }, + { url = "https://files.pythonhosted.org/packages/c0/4a/412d2048be12c334003e9b823a3fa3d038e46cc2d64dd8aab50b31b65499/pydantic_core-2.41.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:707625ef0983fcfb461acfaf14de2067c5942c6bb0f3b4c99158bed6fedd3cf3", size = 2068175, upload-time = "2025-11-04T13:42:18.911Z" }, + { url = "https://files.pythonhosted.org/packages/73/f4/c58b6a776b502d0a5540ad02e232514285513572060f0d78f7832ca3c98b/pydantic_core-2.41.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f41eb9797986d6ebac5e8edff36d5cef9de40def462311b3eb3eeded1431e425", size = 2177203, upload-time = "2025-11-04T13:42:22.578Z" }, + { url = "https://files.pythonhosted.org/packages/ed/ae/f06ea4c7e7a9eead3d165e7623cd2ea0cb788e277e4f935af63fc98fa4e6/pydantic_core-2.41.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0384e2e1021894b1ff5a786dbf94771e2986ebe2869533874d7e43bc79c6f504", size = 2148191, upload-time = "2025-11-04T13:42:24.89Z" }, + { url = "https://files.pythonhosted.org/packages/c1/57/25a11dcdc656bf5f8b05902c3c2934ac3ea296257cc4a3f79a6319e61856/pydantic_core-2.41.5-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:f0cd744688278965817fd0839c4a4116add48d23890d468bc436f78beb28abf5", size = 2343907, upload-time = "2025-11-04T13:42:27.683Z" }, + { url = "https://files.pythonhosted.org/packages/96/82/e33d5f4933d7a03327c0c43c65d575e5919d4974ffc026bc917a5f7b9f61/pydantic_core-2.41.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:753e230374206729bf0a807954bcc6c150d3743928a73faffee51ac6557a03c3", size = 2322174, upload-time = "2025-11-04T13:42:30.776Z" }, + { url = "https://files.pythonhosted.org/packages/81/45/4091be67ce9f469e81656f880f3506f6a5624121ec5eb3eab37d7581897d/pydantic_core-2.41.5-cp39-cp39-win32.whl", hash = "sha256:873e0d5b4fb9b89ef7c2d2a963ea7d02879d9da0da8d9d4933dee8ee86a8b460", size = 1990353, upload-time = "2025-11-04T13:42:33.111Z" }, + { url = "https://files.pythonhosted.org/packages/44/8a/a98aede18db6e9cd5d66bcacd8a409fcf8134204cdede2e7de35c5a2c5ef/pydantic_core-2.41.5-cp39-cp39-win_amd64.whl", hash = "sha256:e4f4a984405e91527a0d62649ee21138f8e3d0ef103be488c1dc11a80d7f184b", size = 2015698, upload-time = "2025-11-04T13:42:35.484Z" }, + { url = "https://files.pythonhosted.org/packages/11/72/90fda5ee3b97e51c494938a4a44c3a35a9c96c19bba12372fb9c634d6f57/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-macosx_10_12_x86_64.whl", hash = "sha256:b96d5f26b05d03cc60f11a7761a5ded1741da411e7fe0909e27a5e6a0cb7b034", size = 2115441, upload-time = "2025-11-04T13:42:39.557Z" }, + { url = "https://files.pythonhosted.org/packages/1f/53/8942f884fa33f50794f119012dc6a1a02ac43a56407adaac20463df8e98f/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-macosx_11_0_arm64.whl", hash = "sha256:634e8609e89ceecea15e2d61bc9ac3718caaaa71963717bf3c8f38bfde64242c", size = 1930291, upload-time = "2025-11-04T13:42:42.169Z" }, + { url = "https://files.pythonhosted.org/packages/79/c8/ecb9ed9cd942bce09fc888ee960b52654fbdbede4ba6c2d6e0d3b1d8b49c/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:93e8740d7503eb008aa2df04d3b9735f845d43ae845e6dcd2be0b55a2da43cd2", size = 1948632, upload-time = "2025-11-04T13:42:44.564Z" }, + { url = "https://files.pythonhosted.org/packages/2e/1b/687711069de7efa6af934e74f601e2a4307365e8fdc404703afc453eab26/pydantic_core-2.41.5-graalpy311-graalpy242_311_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f15489ba13d61f670dcc96772e733aad1a6f9c429cc27574c6cdaed82d0146ad", size = 2138905, upload-time = "2025-11-04T13:42:47.156Z" }, + { url = "https://files.pythonhosted.org/packages/09/32/59b0c7e63e277fa7911c2fc70ccfb45ce4b98991e7ef37110663437005af/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:7da7087d756b19037bc2c06edc6c170eeef3c3bafcb8f532ff17d64dc427adfd", size = 2110495, upload-time = "2025-11-04T13:42:49.689Z" }, + { url = "https://files.pythonhosted.org/packages/aa/81/05e400037eaf55ad400bcd318c05bb345b57e708887f07ddb2d20e3f0e98/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:aabf5777b5c8ca26f7824cb4a120a740c9588ed58df9b2d196ce92fba42ff8dc", size = 1915388, upload-time = "2025-11-04T13:42:52.215Z" }, + { url = "https://files.pythonhosted.org/packages/6e/0d/e3549b2399f71d56476b77dbf3cf8937cec5cd70536bdc0e374a421d0599/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c007fe8a43d43b3969e8469004e9845944f1a80e6acd47c150856bb87f230c56", size = 1942879, upload-time = "2025-11-04T13:42:56.483Z" }, + { url = "https://files.pythonhosted.org/packages/f7/07/34573da085946b6a313d7c42f82f16e8920bfd730665de2d11c0c37a74b5/pydantic_core-2.41.5-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:76d0819de158cd855d1cbb8fcafdf6f5cf1eb8e470abe056d5d161106e38062b", size = 2139017, upload-time = "2025-11-04T13:42:59.471Z" }, + { url = "https://files.pythonhosted.org/packages/e6/b0/1a2aa41e3b5a4ba11420aba2d091b2d17959c8d1519ece3627c371951e73/pydantic_core-2.41.5-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:b5819cd790dbf0c5eb9f82c73c16b39a65dd6dd4d1439dcdea7816ec9adddab8", size = 2103351, upload-time = "2025-11-04T13:43:02.058Z" }, + { url = "https://files.pythonhosted.org/packages/a4/ee/31b1f0020baaf6d091c87900ae05c6aeae101fa4e188e1613c80e4f1ea31/pydantic_core-2.41.5-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:5a4e67afbc95fa5c34cf27d9089bca7fcab4e51e57278d710320a70b956d1b9a", size = 1925363, upload-time = "2025-11-04T13:43:05.159Z" }, + { url = "https://files.pythonhosted.org/packages/e1/89/ab8e86208467e467a80deaca4e434adac37b10a9d134cd2f99b28a01e483/pydantic_core-2.41.5-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ece5c59f0ce7d001e017643d8d24da587ea1f74f6993467d85ae8a5ef9d4f42b", size = 2135615, upload-time = "2025-11-04T13:43:08.116Z" }, + { url = "https://files.pythonhosted.org/packages/99/0a/99a53d06dd0348b2008f2f30884b34719c323f16c3be4e6cc1203b74a91d/pydantic_core-2.41.5-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:16f80f7abe3351f8ea6858914ddc8c77e02578544a0ebc15b4c2e1a0e813b0b2", size = 2175369, upload-time = "2025-11-04T13:43:12.49Z" }, + { url = "https://files.pythonhosted.org/packages/6d/94/30ca3b73c6d485b9bb0bc66e611cff4a7138ff9736b7e66bcf0852151636/pydantic_core-2.41.5-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:33cb885e759a705b426baada1fe68cbb0a2e68e34c5d0d0289a364cf01709093", size = 2144218, upload-time = "2025-11-04T13:43:15.431Z" }, + { url = "https://files.pythonhosted.org/packages/87/57/31b4f8e12680b739a91f472b5671294236b82586889ef764b5fbc6669238/pydantic_core-2.41.5-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:c8d8b4eb992936023be7dee581270af5c6e0697a8559895f527f5b7105ecd36a", size = 2329951, upload-time = "2025-11-04T13:43:18.062Z" }, + { url = "https://files.pythonhosted.org/packages/7d/73/3c2c8edef77b8f7310e6fb012dbc4b8551386ed575b9eb6fb2506e28a7eb/pydantic_core-2.41.5-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:242a206cd0318f95cd21bdacff3fcc3aab23e79bba5cac3db5a841c9ef9c6963", size = 2318428, upload-time = "2025-11-04T13:43:20.679Z" }, + { url = "https://files.pythonhosted.org/packages/2f/02/8559b1f26ee0d502c74f9cca5c0d2fd97e967e083e006bbbb4e97f3a043a/pydantic_core-2.41.5-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:d3a978c4f57a597908b7e697229d996d77a6d3c94901e9edee593adada95ce1a", size = 2147009, upload-time = "2025-11-04T13:43:23.286Z" }, + { url = "https://files.pythonhosted.org/packages/5f/9b/1b3f0e9f9305839d7e84912f9e8bfbd191ed1b1ef48083609f0dabde978c/pydantic_core-2.41.5-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:b2379fa7ed44ddecb5bfe4e48577d752db9fc10be00a6b7446e9663ba143de26", size = 2101980, upload-time = "2025-11-04T13:43:25.97Z" }, + { url = "https://files.pythonhosted.org/packages/a4/ed/d71fefcb4263df0da6a85b5d8a7508360f2f2e9b3bf5814be9c8bccdccc1/pydantic_core-2.41.5-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:266fb4cbf5e3cbd0b53669a6d1b039c45e3ce651fd5442eff4d07c2cc8d66808", size = 1923865, upload-time = "2025-11-04T13:43:28.763Z" }, + { url = "https://files.pythonhosted.org/packages/ce/3a/626b38db460d675f873e4444b4bb030453bbe7b4ba55df821d026a0493c4/pydantic_core-2.41.5-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:58133647260ea01e4d0500089a8c4f07bd7aa6ce109682b1426394988d8aaacc", size = 2134256, upload-time = "2025-11-04T13:43:31.71Z" }, + { url = "https://files.pythonhosted.org/packages/83/d9/8412d7f06f616bbc053d30cb4e5f76786af3221462ad5eee1f202021eb4e/pydantic_core-2.41.5-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:287dad91cfb551c363dc62899a80e9e14da1f0e2b6ebde82c806612ca2a13ef1", size = 2174762, upload-time = "2025-11-04T13:43:34.744Z" }, + { url = "https://files.pythonhosted.org/packages/55/4c/162d906b8e3ba3a99354e20faa1b49a85206c47de97a639510a0e673f5da/pydantic_core-2.41.5-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:03b77d184b9eb40240ae9fd676ca364ce1085f203e1b1256f8ab9984dca80a84", size = 2143141, upload-time = "2025-11-04T13:43:37.701Z" }, + { url = "https://files.pythonhosted.org/packages/1f/f2/f11dd73284122713f5f89fc940f370d035fa8e1e078d446b3313955157fe/pydantic_core-2.41.5-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:a668ce24de96165bb239160b3d854943128f4334822900534f2fe947930e5770", size = 2330317, upload-time = "2025-11-04T13:43:40.406Z" }, + { url = "https://files.pythonhosted.org/packages/88/9d/b06ca6acfe4abb296110fb1273a4d848a0bfb2ff65f3ee92127b3244e16b/pydantic_core-2.41.5-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f14f8f046c14563f8eb3f45f499cc658ab8d10072961e07225e507adb700e93f", size = 2316992, upload-time = "2025-11-04T13:43:43.602Z" }, + { url = "https://files.pythonhosted.org/packages/36/c7/cfc8e811f061c841d7990b0201912c3556bfeb99cdcb7ed24adc8d6f8704/pydantic_core-2.41.5-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:56121965f7a4dc965bff783d70b907ddf3d57f6eba29b6d2e5dabfaf07799c51", size = 2145302, upload-time = "2025-11-04T13:43:46.64Z" }, ] [[package]] name = "pygments" -version = "2.19.1" +version = "2.19.2" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/7c/2d/c3338d48ea6cc0feb8446d8e6937e1408088a72a39937982cc6111d17f84/pygments-2.19.1.tar.gz", hash = "sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f", size = 4968581, upload-time = "2025-01-06T17:26:30.443Z" } +sdist = { url = "https://files.pythonhosted.org/packages/b0/77/a5b8c569bf593b0140bde72ea885a803b82086995367bf2037de0159d924/pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887", size = 4968631, upload-time = "2025-06-21T13:39:12.283Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/8a/0b/9fcc47d19c48b59121088dd6da2488a49d5f72dacf8262e2790a1d2c7d15/pygments-2.19.1-py3-none-any.whl", hash = "sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c", size = 1225293, upload-time = "2025-01-06T17:26:25.553Z" }, + { url = "https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b", size = 1225217, upload-time = "2025-06-21T13:39:07.939Z" }, ] [[package]] @@ -926,45 +1168,98 @@ wheels = [ [[package]] name = "pytest" -version = "8.4.1" +version = "8.4.2" source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.10'", +] dependencies = [ - { name = "colorama", marker = "sys_platform == 'win32' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "exceptiongroup", marker = "python_full_version < '3.11' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "iniconfig" }, - { name = "packaging" }, - { name = "pluggy" }, - { name = "pygments" }, - { name = "tomli", marker = "python_full_version < '3.11' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "colorama", marker = "(python_full_version < '3.10' and sys_platform == 'win32') or (python_full_version >= '3.10' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2') or (sys_platform != 'win32' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "exceptiongroup", marker = "python_full_version < '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "iniconfig", version = "2.1.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "packaging", marker = "python_full_version < '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pluggy", marker = "python_full_version < '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pygments", marker = "python_full_version < '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "tomli", marker = "python_full_version < '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a3/5c/00a0e072241553e1a7496d638deababa67c5058571567b92a7eaa258397c/pytest-8.4.2.tar.gz", hash = "sha256:86c0d0b93306b961d58d62a4db4879f27fe25513d4b969df351abdddb3c30e01", size = 1519618, upload-time = "2025-09-04T14:34:22.711Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a8/a4/20da314d277121d6534b3a980b29035dcd51e6744bd79075a6ce8fa4eb8d/pytest-8.4.2-py3-none-any.whl", hash = "sha256:872f880de3fc3a5bdc88a11b39c9710c3497a547cfa9320bc3c5e62fbf272e79", size = 365750, upload-time = "2025-09-04T14:34:20.226Z" }, +] + +[[package]] +name = "pytest" +version = "9.0.1" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.14' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version >= '3.10' and python_full_version < '3.14' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version >= '3.10' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra != 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version >= '3.10' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra != 'group-18-runloop-api-client-pydantic-v2'", ] -sdist = { url = "https://files.pythonhosted.org/packages/08/ba/45911d754e8eba3d5a841a5ce61a65a685ff1798421ac054f85aa8747dfb/pytest-8.4.1.tar.gz", hash = "sha256:7c67fd69174877359ed9371ec3af8a3d2b04741818c51e5e99cc1742251fa93c", size = 1517714, upload-time = "2025-06-18T05:48:06.109Z" } +dependencies = [ + { name = "colorama", marker = "(python_full_version >= '3.10' and sys_platform == 'win32') or (python_full_version < '3.10' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2') or (sys_platform != 'win32' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "exceptiongroup", marker = "python_full_version == '3.10.*' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "iniconfig", version = "2.3.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "packaging", marker = "python_full_version >= '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pluggy", marker = "python_full_version >= '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pygments", marker = "python_full_version >= '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "tomli", marker = "python_full_version == '3.10.*' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/07/56/f013048ac4bc4c1d9be45afd4ab209ea62822fb1598f40687e6bf45dcea4/pytest-9.0.1.tar.gz", hash = "sha256:3e9c069ea73583e255c3b21cf46b8d3c56f6e3a1a8f6da94ccb0fcf57b9d73c8", size = 1564125, upload-time = "2025-11-12T13:05:09.333Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/29/16/c8a903f4c4dffe7a12843191437d7cd8e32751d5de349d45d3fe69544e87/pytest-8.4.1-py3-none-any.whl", hash = "sha256:539c70ba6fcead8e78eebbf1115e8b589e7565830d7d006a8723f19ac8a0afb7", size = 365474, upload-time = "2025-06-18T05:48:03.955Z" }, + { url = "https://files.pythonhosted.org/packages/0b/8b/6300fb80f858cda1c51ffa17075df5d846757081d11ab4aa35cef9e6258b/pytest-9.0.1-py3-none-any.whl", hash = "sha256:67be0030d194df2dfa7b556f2e56fb3c3315bd5c8822c6951162b92b32ce7dad", size = 373668, upload-time = "2025-11-12T13:05:07.379Z" }, ] [[package]] name = "pytest-asyncio" -version = "0.24.0" +version = "1.2.0" source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.10'", +] dependencies = [ - { name = "pytest" }, + { name = "backports-asyncio-runner", marker = "python_full_version < '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pytest", version = "8.4.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "typing-extensions", marker = "python_full_version < '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/42/86/9e3c5f48f7b7b638b216e4b9e645f54d199d7abbbab7a64a13b4e12ba10f/pytest_asyncio-1.2.0.tar.gz", hash = "sha256:c609a64a2a8768462d0c99811ddb8bd2583c33fd33cf7f21af1c142e824ffb57", size = 50119, upload-time = "2025-09-12T07:33:53.816Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/93/2fa34714b7a4ae72f2f8dad66ba17dd9a2c793220719e736dda28b7aec27/pytest_asyncio-1.2.0-py3-none-any.whl", hash = "sha256:8e17ae5e46d8e7efe51ab6494dd2010f4ca8dae51652aa3c8d55acf50bfb2e99", size = 15095, upload-time = "2025-09-12T07:33:52.639Z" }, +] + +[[package]] +name = "pytest-asyncio" +version = "1.3.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.14' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version >= '3.10' and python_full_version < '3.14' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version >= '3.10' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra != 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version >= '3.10' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra != 'group-18-runloop-api-client-pydantic-v2'", +] +dependencies = [ + { name = "backports-asyncio-runner", marker = "python_full_version == '3.10.*' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pytest", version = "9.0.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "typing-extensions", marker = "(python_full_version >= '3.10' and python_full_version < '3.13') or (python_full_version < '3.10' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2') or (python_full_version >= '3.13' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/52/6d/c6cf50ce320cf8611df7a1254d86233b3df7cc07f9b5f5cbcb82e08aa534/pytest_asyncio-0.24.0.tar.gz", hash = "sha256:d081d828e576d85f875399194281e92bf8a68d60d72d1a2faf2feddb6c46b276", size = 49855, upload-time = "2024-08-22T08:03:18.145Z" } +sdist = { url = "https://files.pythonhosted.org/packages/90/2c/8af215c0f776415f3590cac4f9086ccefd6fd463befeae41cd4d3f193e5a/pytest_asyncio-1.3.0.tar.gz", hash = "sha256:d7f52f36d231b80ee124cd216ffb19369aa168fc10095013c6b014a34d3ee9e5", size = 50087, upload-time = "2025-11-10T16:07:47.256Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/96/31/6607dab48616902f76885dfcf62c08d929796fc3b2d2318faf9fd54dbed9/pytest_asyncio-0.24.0-py3-none-any.whl", hash = "sha256:a811296ed596b69bf0b6f3dc40f83bcaf341b155a269052d82efa2b25ac7037b", size = 18024, upload-time = "2024-08-22T08:03:15.536Z" }, + { url = "https://files.pythonhosted.org/packages/e5/35/f8b19922b6a25bc0880171a2f1a003eaeb93657475193ab516fd87cac9da/pytest_asyncio-1.3.0-py3-none-any.whl", hash = "sha256:611e26147c7f77640e6d0a92a38ed17c3e9848063698d5c93d5aa7aa11cebff5", size = 15075, upload-time = "2025-11-10T16:07:45.537Z" }, ] [[package]] name = "pytest-xdist" -version = "3.7.0" +version = "3.8.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "execnet" }, - { name = "pytest" }, + { name = "pytest", version = "8.4.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pytest", version = "9.0.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/49/dc/865845cfe987b21658e871d16e0a24e871e00884c545f246dd8f6f69edda/pytest_xdist-3.7.0.tar.gz", hash = "sha256:f9248c99a7c15b7d2f90715df93610353a485827bc06eefb6566d23f6400f126", size = 87550, upload-time = "2025-05-26T21:18:20.251Z" } +sdist = { url = "https://files.pythonhosted.org/packages/78/b4/439b179d1ff526791eb921115fca8e44e596a13efeda518b9d845a619450/pytest_xdist-3.8.0.tar.gz", hash = "sha256:7e578125ec9bc6050861aa93f2d59f1d8d085595d6551c2c90b6f4fad8d3a9f1", size = 88069, upload-time = "2025-07-01T13:30:59.346Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/0d/b2/0e802fde6f1c5b2f7ae7e9ad42b83fd4ecebac18a8a8c2f2f14e39dce6e1/pytest_xdist-3.7.0-py3-none-any.whl", hash = "sha256:7d3fbd255998265052435eb9daa4e99b62e6fb9cfb6efd1f858d4d8c0c7f0ca0", size = 46142, upload-time = "2025-05-26T21:18:18.759Z" }, + { url = "https://files.pythonhosted.org/packages/ca/31/d4e37e9e550c2b92a9cbc2e4d0b7420a27224968580b5a447f420847c975/pytest_xdist-3.8.0-py3-none-any.whl", hash = "sha256:202ca578cfeb7370784a8c33d6d05bc6e13b4f25b5053c30a152269fd10f0b88", size = 46396, upload-time = "2025-07-01T13:30:56.632Z" }, ] [[package]] @@ -972,7 +1267,7 @@ name = "python-dateutil" version = "2.9.0.post0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "six" }, + { name = "six", marker = "python_full_version < '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, ] sdist = { url = "https://files.pythonhosted.org/packages/66/c0/0c8b6ad9f17a802ee498c46e004a0eb49bc148f2fd230864601a86dcf6db/python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", size = 342432, upload-time = "2024-03-01T18:36:20.211Z" } wheels = [ @@ -993,41 +1288,42 @@ wheels = [ [[package]] name = "rich" -version = "13.9.4" +version = "14.2.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "markdown-it-py" }, + { name = "markdown-it-py", version = "3.0.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "markdown-it-py", version = "4.0.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, { name = "pygments" }, - { name = "typing-extensions", marker = "python_full_version < '3.11' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/ab/3a/0316b28d0761c6734d6bc14e770d85506c986c85ffb239e688eeaab2c2bc/rich-13.9.4.tar.gz", hash = "sha256:439594978a49a09530cff7ebc4b5c7103ef57baf48d5ea3184f21d9a2befa098", size = 223149, upload-time = "2024-11-01T16:43:57.873Z" } +sdist = { url = "https://files.pythonhosted.org/packages/fb/d2/8920e102050a0de7bfabeb4c4614a49248cf8d5d7a8d01885fbb24dc767a/rich-14.2.0.tar.gz", hash = "sha256:73ff50c7c0c1c77c8243079283f4edb376f0f6442433aecb8ce7e6d0b92d1fe4", size = 219990, upload-time = "2025-10-09T14:16:53.064Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/19/71/39c7c0d87f8d4e6c020a393182060eaefeeae6c01dab6a84ec346f2567df/rich-13.9.4-py3-none-any.whl", hash = "sha256:6049d5e6ec054bf2779ab3358186963bac2ea89175919d699e378b99738c2a90", size = 242424, upload-time = "2024-11-01T16:43:55.817Z" }, + { url = "https://files.pythonhosted.org/packages/25/7a/b0178788f8dc6cafce37a212c99565fa1fe7872c70c6c9c1e1a372d9d88f/rich-14.2.0-py3-none-any.whl", hash = "sha256:76bc51fe2e57d2b1be1f96c524b890b816e334ab4c1e45888799bfaab0021edd", size = 243393, upload-time = "2025-10-09T14:16:51.245Z" }, ] [[package]] name = "ruff" -version = "0.9.4" +version = "0.14.6" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/c0/17/529e78f49fc6f8076f50d985edd9a2cf011d1dbadb1cdeacc1d12afc1d26/ruff-0.9.4.tar.gz", hash = "sha256:6907ee3529244bb0ed066683e075f09285b38dd5b4039370df6ff06041ca19e7", size = 3599458, upload-time = "2025-01-30T18:09:51.03Z" } +sdist = { url = "https://files.pythonhosted.org/packages/52/f0/62b5a1a723fe183650109407fa56abb433b00aa1c0b9ba555f9c4efec2c6/ruff-0.14.6.tar.gz", hash = "sha256:6f0c742ca6a7783a736b867a263b9a7a80a45ce9bee391eeda296895f1b4e1cc", size = 5669501, upload-time = "2025-11-21T14:26:17.903Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/b6/f8/3fafb7804d82e0699a122101b5bee5f0d6e17c3a806dcbc527bb7d3f5b7a/ruff-0.9.4-py3-none-linux_armv6l.whl", hash = "sha256:64e73d25b954f71ff100bb70f39f1ee09e880728efb4250c632ceed4e4cdf706", size = 11668400, upload-time = "2025-01-30T18:08:46.508Z" }, - { url = "https://files.pythonhosted.org/packages/2e/a6/2efa772d335da48a70ab2c6bb41a096c8517ca43c086ea672d51079e3d1f/ruff-0.9.4-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:6ce6743ed64d9afab4fafeaea70d3631b4d4b28b592db21a5c2d1f0ef52934bf", size = 11628395, upload-time = "2025-01-30T18:08:50.87Z" }, - { url = "https://files.pythonhosted.org/packages/dc/d7/cd822437561082f1c9d7225cc0d0fbb4bad117ad7ac3c41cd5d7f0fa948c/ruff-0.9.4-py3-none-macosx_11_0_arm64.whl", hash = "sha256:54499fb08408e32b57360f6f9de7157a5fec24ad79cb3f42ef2c3f3f728dfe2b", size = 11090052, upload-time = "2025-01-30T18:08:54.498Z" }, - { url = "https://files.pythonhosted.org/packages/9e/67/3660d58e893d470abb9a13f679223368ff1684a4ef40f254a0157f51b448/ruff-0.9.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:37c892540108314a6f01f105040b5106aeb829fa5fb0561d2dcaf71485021137", size = 11882221, upload-time = "2025-01-30T18:08:57.784Z" }, - { url = "https://files.pythonhosted.org/packages/79/d1/757559995c8ba5f14dfec4459ef2dd3fcea82ac43bc4e7c7bf47484180c0/ruff-0.9.4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:de9edf2ce4b9ddf43fd93e20ef635a900e25f622f87ed6e3047a664d0e8f810e", size = 11424862, upload-time = "2025-01-30T18:09:01.167Z" }, - { url = "https://files.pythonhosted.org/packages/c0/96/7915a7c6877bb734caa6a2af424045baf6419f685632469643dbd8eb2958/ruff-0.9.4-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:87c90c32357c74f11deb7fbb065126d91771b207bf9bfaaee01277ca59b574ec", size = 12626735, upload-time = "2025-01-30T18:09:05.312Z" }, - { url = "https://files.pythonhosted.org/packages/0e/cc/dadb9b35473d7cb17c7ffe4737b4377aeec519a446ee8514123ff4a26091/ruff-0.9.4-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:56acd6c694da3695a7461cc55775f3a409c3815ac467279dfa126061d84b314b", size = 13255976, upload-time = "2025-01-30T18:09:09.425Z" }, - { url = "https://files.pythonhosted.org/packages/5f/c3/ad2dd59d3cabbc12df308cced780f9c14367f0321e7800ca0fe52849da4c/ruff-0.9.4-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e0c93e7d47ed951b9394cf352d6695b31498e68fd5782d6cbc282425655f687a", size = 12752262, upload-time = "2025-01-30T18:09:13.112Z" }, - { url = "https://files.pythonhosted.org/packages/c7/17/5f1971e54bd71604da6788efd84d66d789362b1105e17e5ccc53bba0289b/ruff-0.9.4-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1d4c8772670aecf037d1bf7a07c39106574d143b26cfe5ed1787d2f31e800214", size = 14401648, upload-time = "2025-01-30T18:09:17.086Z" }, - { url = "https://files.pythonhosted.org/packages/30/24/6200b13ea611b83260501b6955b764bb320e23b2b75884c60ee7d3f0b68e/ruff-0.9.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bfc5f1d7afeda8d5d37660eeca6d389b142d7f2b5a1ab659d9214ebd0e025231", size = 12414702, upload-time = "2025-01-30T18:09:21.672Z" }, - { url = "https://files.pythonhosted.org/packages/34/cb/f5d50d0c4ecdcc7670e348bd0b11878154bc4617f3fdd1e8ad5297c0d0ba/ruff-0.9.4-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:faa935fc00ae854d8b638c16a5f1ce881bc3f67446957dd6f2af440a5fc8526b", size = 11859608, upload-time = "2025-01-30T18:09:25.663Z" }, - { url = "https://files.pythonhosted.org/packages/d6/f4/9c8499ae8426da48363bbb78d081b817b0f64a9305f9b7f87eab2a8fb2c1/ruff-0.9.4-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:a6c634fc6f5a0ceae1ab3e13c58183978185d131a29c425e4eaa9f40afe1e6d6", size = 11485702, upload-time = "2025-01-30T18:09:28.903Z" }, - { url = "https://files.pythonhosted.org/packages/18/59/30490e483e804ccaa8147dd78c52e44ff96e1c30b5a95d69a63163cdb15b/ruff-0.9.4-py3-none-musllinux_1_2_i686.whl", hash = "sha256:433dedf6ddfdec7f1ac7575ec1eb9844fa60c4c8c2f8887a070672b8d353d34c", size = 12067782, upload-time = "2025-01-30T18:09:32.371Z" }, - { url = "https://files.pythonhosted.org/packages/3d/8c/893fa9551760b2f8eb2a351b603e96f15af167ceaf27e27ad873570bc04c/ruff-0.9.4-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:d612dbd0f3a919a8cc1d12037168bfa536862066808960e0cc901404b77968f0", size = 12483087, upload-time = "2025-01-30T18:09:36.124Z" }, - { url = "https://files.pythonhosted.org/packages/23/15/f6751c07c21ca10e3f4a51ea495ca975ad936d780c347d9808bcedbd7182/ruff-0.9.4-py3-none-win32.whl", hash = "sha256:db1192ddda2200671f9ef61d9597fcef89d934f5d1705e571a93a67fb13a4402", size = 9852302, upload-time = "2025-01-30T18:09:40.013Z" }, - { url = "https://files.pythonhosted.org/packages/12/41/2d2d2c6a72e62566f730e49254f602dfed23019c33b5b21ea8f8917315a1/ruff-0.9.4-py3-none-win_amd64.whl", hash = "sha256:05bebf4cdbe3ef75430d26c375773978950bbf4ee3c95ccb5448940dc092408e", size = 10850051, upload-time = "2025-01-30T18:09:43.42Z" }, - { url = "https://files.pythonhosted.org/packages/c6/e6/3d6ec3bc3d254e7f005c543a661a41c3e788976d0e52a1ada195bd664344/ruff-0.9.4-py3-none-win_arm64.whl", hash = "sha256:585792f1e81509e38ac5123492f8875fbc36f3ede8185af0a26df348e5154f41", size = 10078251, upload-time = "2025-01-30T18:09:48.01Z" }, + { url = "https://files.pythonhosted.org/packages/67/d2/7dd544116d107fffb24a0064d41a5d2ed1c9d6372d142f9ba108c8e39207/ruff-0.14.6-py3-none-linux_armv6l.whl", hash = "sha256:d724ac2f1c240dbd01a2ae98db5d1d9a5e1d9e96eba999d1c48e30062df578a3", size = 13326119, upload-time = "2025-11-21T14:25:24.2Z" }, + { url = "https://files.pythonhosted.org/packages/36/6a/ad66d0a3315d6327ed6b01f759d83df3c4d5f86c30462121024361137b6a/ruff-0.14.6-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:9f7539ea257aa4d07b7ce87aed580e485c40143f2473ff2f2b75aee003186004", size = 13526007, upload-time = "2025-11-21T14:25:26.906Z" }, + { url = "https://files.pythonhosted.org/packages/a3/9d/dae6db96df28e0a15dea8e986ee393af70fc97fd57669808728080529c37/ruff-0.14.6-py3-none-macosx_11_0_arm64.whl", hash = "sha256:7f6007e55b90a2a7e93083ba48a9f23c3158c433591c33ee2e99a49b889c6332", size = 12676572, upload-time = "2025-11-21T14:25:29.826Z" }, + { url = "https://files.pythonhosted.org/packages/76/a4/f319e87759949062cfee1b26245048e92e2acce900ad3a909285f9db1859/ruff-0.14.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0a8e7b9d73d8728b68f632aa8e824ef041d068d231d8dbc7808532d3629a6bef", size = 13140745, upload-time = "2025-11-21T14:25:32.788Z" }, + { url = "https://files.pythonhosted.org/packages/95/d3/248c1efc71a0a8ed4e8e10b4b2266845d7dfc7a0ab64354afe049eaa1310/ruff-0.14.6-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d50d45d4553a3ebcbd33e7c5e0fe6ca4aafd9a9122492de357205c2c48f00775", size = 13076486, upload-time = "2025-11-21T14:25:35.601Z" }, + { url = "https://files.pythonhosted.org/packages/a5/19/b68d4563fe50eba4b8c92aa842149bb56dd24d198389c0ed12e7faff4f7d/ruff-0.14.6-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:118548dd121f8a21bfa8ab2c5b80e5b4aed67ead4b7567790962554f38e598ce", size = 13727563, upload-time = "2025-11-21T14:25:38.514Z" }, + { url = "https://files.pythonhosted.org/packages/47/ac/943169436832d4b0e867235abbdb57ce3a82367b47e0280fa7b4eabb7593/ruff-0.14.6-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:57256efafbfefcb8748df9d1d766062f62b20150691021f8ab79e2d919f7c11f", size = 15199755, upload-time = "2025-11-21T14:25:41.516Z" }, + { url = "https://files.pythonhosted.org/packages/c9/b9/288bb2399860a36d4bb0541cb66cce3c0f4156aaff009dc8499be0c24bf2/ruff-0.14.6-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ff18134841e5c68f8e5df1999a64429a02d5549036b394fafbe410f886e1989d", size = 14850608, upload-time = "2025-11-21T14:25:44.428Z" }, + { url = "https://files.pythonhosted.org/packages/ee/b1/a0d549dd4364e240f37e7d2907e97ee80587480d98c7799d2d8dc7a2f605/ruff-0.14.6-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:29c4b7ec1e66a105d5c27bd57fa93203637d66a26d10ca9809dc7fc18ec58440", size = 14118754, upload-time = "2025-11-21T14:25:47.214Z" }, + { url = "https://files.pythonhosted.org/packages/13/ac/9b9fe63716af8bdfddfacd0882bc1586f29985d3b988b3c62ddce2e202c3/ruff-0.14.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:167843a6f78680746d7e226f255d920aeed5e4ad9c03258094a2d49d3028b105", size = 13949214, upload-time = "2025-11-21T14:25:50.002Z" }, + { url = "https://files.pythonhosted.org/packages/12/27/4dad6c6a77fede9560b7df6802b1b697e97e49ceabe1f12baf3ea20862e9/ruff-0.14.6-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:16a33af621c9c523b1ae006b1b99b159bf5ac7e4b1f20b85b2572455018e0821", size = 14106112, upload-time = "2025-11-21T14:25:52.841Z" }, + { url = "https://files.pythonhosted.org/packages/6a/db/23e322d7177873eaedea59a7932ca5084ec5b7e20cb30f341ab594130a71/ruff-0.14.6-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:1432ab6e1ae2dc565a7eea707d3b03a0c234ef401482a6f1621bc1f427c2ff55", size = 13035010, upload-time = "2025-11-21T14:25:55.536Z" }, + { url = "https://files.pythonhosted.org/packages/a8/9c/20e21d4d69dbb35e6a1df7691e02f363423658a20a2afacf2a2c011800dc/ruff-0.14.6-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:4c55cfbbe7abb61eb914bfd20683d14cdfb38a6d56c6c66efa55ec6570ee4e71", size = 13054082, upload-time = "2025-11-21T14:25:58.625Z" }, + { url = "https://files.pythonhosted.org/packages/66/25/906ee6a0464c3125c8d673c589771a974965c2be1a1e28b5c3b96cb6ef88/ruff-0.14.6-py3-none-musllinux_1_2_i686.whl", hash = "sha256:efea3c0f21901a685fff4befda6d61a1bf4cb43de16da87e8226a281d614350b", size = 13303354, upload-time = "2025-11-21T14:26:01.816Z" }, + { url = "https://files.pythonhosted.org/packages/4c/58/60577569e198d56922b7ead07b465f559002b7b11d53f40937e95067ca1c/ruff-0.14.6-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:344d97172576d75dc6afc0e9243376dbe1668559c72de1864439c4fc95f78185", size = 14054487, upload-time = "2025-11-21T14:26:05.058Z" }, + { url = "https://files.pythonhosted.org/packages/67/0b/8e4e0639e4cc12547f41cb771b0b44ec8225b6b6a93393176d75fe6f7d40/ruff-0.14.6-py3-none-win32.whl", hash = "sha256:00169c0c8b85396516fdd9ce3446c7ca20c2a8f90a77aa945ba6b8f2bfe99e85", size = 13013361, upload-time = "2025-11-21T14:26:08.152Z" }, + { url = "https://files.pythonhosted.org/packages/fb/02/82240553b77fd1341f80ebb3eaae43ba011c7a91b4224a9f317d8e6591af/ruff-0.14.6-py3-none-win_amd64.whl", hash = "sha256:390e6480c5e3659f8a4c8d6a0373027820419ac14fa0d2713bd8e6c3e125b8b9", size = 14432087, upload-time = "2025-11-21T14:26:10.891Z" }, + { url = "https://files.pythonhosted.org/packages/a5/1f/93f9b0fad9470e4c829a5bb678da4012f0c710d09331b860ee555216f4ea/ruff-0.14.6-py3-none-win_arm64.whl", hash = "sha256:d43c81fbeae52cfa8728d8766bbf46ee4298c888072105815b392da70ca836b2", size = 13520930, upload-time = "2025-11-21T14:26:13.951Z" }, ] [[package]] @@ -1038,8 +1334,8 @@ dependencies = [ { name = "anyio" }, { name = "distro" }, { name = "httpx" }, - { name = "pydantic", version = "1.10.22", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'group-18-runloop-api-client-pydantic-v1'" }, - { name = "pydantic", version = "2.10.3", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'group-18-runloop-api-client-pydantic-v2' or extra != 'group-18-runloop-api-client-pydantic-v1'" }, + { name = "pydantic", version = "1.10.24", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'group-18-runloop-api-client-pydantic-v1'" }, + { name = "pydantic", version = "2.12.4", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'group-18-runloop-api-client-pydantic-v2' or extra != 'group-18-runloop-api-client-pydantic-v1'" }, { name = "sniffio" }, { name = "typing-extensions" }, ] @@ -1056,19 +1352,22 @@ dev = [ { name = "importlib-metadata" }, { name = "mypy" }, { name = "pyright" }, - { name = "pytest" }, - { name = "pytest-asyncio" }, + { name = "pytest", version = "8.4.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pytest", version = "9.0.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pytest-asyncio", version = "1.2.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pytest-asyncio", version = "1.3.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, { name = "pytest-xdist" }, { name = "respx" }, { name = "rich" }, { name = "ruff" }, - { name = "time-machine" }, + { name = "time-machine", version = "2.19.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "time-machine", version = "3.1.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, ] pydantic-v1 = [ - { name = "pydantic", version = "1.10.22", source = { registry = "https://pypi.org/simple" } }, + { name = "pydantic", version = "1.10.24", source = { registry = "https://pypi.org/simple" } }, ] pydantic-v2 = [ - { name = "pydantic", version = "2.10.3", source = { registry = "https://pypi.org/simple" } }, + { name = "pydantic", version = "2.12.4", source = { registry = "https://pypi.org/simple" } }, ] [package.metadata] @@ -1099,7 +1398,10 @@ dev = [ { name = "time-machine" }, ] pydantic-v1 = [{ name = "pydantic", specifier = ">=1.9.0,<2" }] -pydantic-v2 = [{ name = "pydantic", specifier = ">=2,<3" }] +pydantic-v2 = [ + { name = "pydantic", marker = "python_full_version < '3.14'", specifier = "~=2.0" }, + { name = "pydantic", marker = "python_full_version >= '3.14'", specifier = "~=2.12" }, +] [[package]] name = "six" @@ -1121,239 +1423,414 @@ wheels = [ [[package]] name = "time-machine" -version = "2.16.0" +version = "2.19.0" source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.10'", +] dependencies = [ - { name = "python-dateutil" }, + { name = "python-dateutil", marker = "python_full_version < '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f8/a4/1b5fdd165f61b67f445fac2a7feb0c655118edef429cd09ff5a8067f7f1d/time_machine-2.19.0.tar.gz", hash = "sha256:7c5065a8b3f2bbb449422c66ef71d114d3f909c276a6469642ecfffb6a0fcd29", size = 14576, upload-time = "2025-08-19T17:22:08.402Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9d/8f/19125611ebbcb3a14da14cd982b9eb4573e2733db60c9f1fbf6a39534f40/time_machine-2.19.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:b5169018ef47206997b46086ce01881cd3a4666fd2998c9d76a87858ca3e49e9", size = 19659, upload-time = "2025-08-19T17:20:30.062Z" }, + { url = "https://files.pythonhosted.org/packages/74/da/9b0a928321e7822a3ff96dbd1eae089883848e30e9e1b149b85fb96ba56b/time_machine-2.19.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:85bb7ed440fccf6f6d0c8f7d68d849e7c3d1f771d5e0b2cdf871fa6561da569f", size = 15157, upload-time = "2025-08-19T17:20:31.931Z" }, + { url = "https://files.pythonhosted.org/packages/36/ff/d7e943422038f5f2161fe2c2d791e64a45be691ef946020b20f3a6efc4d4/time_machine-2.19.0-cp310-cp310-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:a3b12028af1cdc09ccd595be2168b7b26f206c1e190090b048598fbe278beb8e", size = 32860, upload-time = "2025-08-19T17:20:33.241Z" }, + { url = "https://files.pythonhosted.org/packages/fc/80/2b0f1070ed9808ee7da7a6da62a4a0b776957cb4d861578348f86446e778/time_machine-2.19.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:c261f073086cf081d1443cbf7684148c662659d3d139d06b772bfe3fe7cc71a6", size = 34510, upload-time = "2025-08-19T17:20:34.221Z" }, + { url = "https://files.pythonhosted.org/packages/ef/b4/48038691c8d89924b36c83335a73adeeb68c884f5a1da08a5b17b8a956f3/time_machine-2.19.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:011954d951230a9f1079f22b39ed1a3a9abb50ee297dfb8c557c46351659d94d", size = 36204, upload-time = "2025-08-19T17:20:35.163Z" }, + { url = "https://files.pythonhosted.org/packages/37/2e/60e8adb541df195e83cb74b720b2cfb1f22ed99c5a7f8abf2a9ab3442cb5/time_machine-2.19.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:b0f83308b29c7872006803f2e77318874eb84d0654f2afe0e48e3822e7a2e39b", size = 34936, upload-time = "2025-08-19T17:20:36.61Z" }, + { url = "https://files.pythonhosted.org/packages/5e/72/e8cee59c6cd99dd3b25b8001a0253e779a286aa8f44d5b40777cbd66210b/time_machine-2.19.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:39733ef844e2984620ec9382a42d00cccc4757d75a5dd572be8c2572e86e50b9", size = 32932, upload-time = "2025-08-19T17:20:37.901Z" }, + { url = "https://files.pythonhosted.org/packages/2c/eb/83f300d93c1504965d944e03679f1c943a923bce2d0fdfadef0e2e22cc13/time_machine-2.19.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:f8db99f6334432e9ffbf00c215caf2ae9773f17cec08304d77e9e90febc3507b", size = 34010, upload-time = "2025-08-19T17:20:39.202Z" }, + { url = "https://files.pythonhosted.org/packages/e1/77/f35f2500e04daac5033a22fbfd17e68467822b8406ee77966bf222ccaa26/time_machine-2.19.0-cp310-cp310-win32.whl", hash = "sha256:72bf66cd19e27ffd26516b9cbe676d50c2e0b026153289765dfe0cf406708128", size = 17121, upload-time = "2025-08-19T17:20:40.108Z" }, + { url = "https://files.pythonhosted.org/packages/db/df/32d3e0404be1760a64a44caab2af34b07e952bfe00a23134fea9ddba3e8a/time_machine-2.19.0-cp310-cp310-win_amd64.whl", hash = "sha256:46f1c945934ce3d6b4f388b8e581fce7f87ec891ea90d7128e19520e434f96f0", size = 17957, upload-time = "2025-08-19T17:20:41.079Z" }, + { url = "https://files.pythonhosted.org/packages/66/df/598a71a1afb4b509a4587273b76590b16d9110a3e9106f01eedc68d02bb2/time_machine-2.19.0-cp310-cp310-win_arm64.whl", hash = "sha256:fb4897c7a5120a4fd03f0670f332d83b7e55645886cd8864a71944c4c2e5b35b", size = 16821, upload-time = "2025-08-19T17:20:41.967Z" }, + { url = "https://files.pythonhosted.org/packages/1d/ed/4815ebcc9b6c14273f692b9be38a9b09eae52a7e532407cc61a51912b121/time_machine-2.19.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:5ee91664880434d98e41585c3446dac7180ec408c786347451ddfca110d19296", size = 19342, upload-time = "2025-08-19T17:20:43.207Z" }, + { url = "https://files.pythonhosted.org/packages/ee/08/154cce8b11b60d8238b0b751b8901d369999f4e8f7c3a5f917caa5d95b0b/time_machine-2.19.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ed3732b83a893d1c7b8cabde762968b4dc5680ee0d305b3ecca9bb516f4e3862", size = 14978, upload-time = "2025-08-19T17:20:44.134Z" }, + { url = "https://files.pythonhosted.org/packages/c7/b7/b689d8c8eeca7af375cfcd64973e49e83aa817cc00f80f98548d42c0eb50/time_machine-2.19.0-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:6ba0303e9cc9f7f947e344f501e26bedfb68fab521e3c2729d370f4f332d2d55", size = 30964, upload-time = "2025-08-19T17:20:45.366Z" }, + { url = "https://files.pythonhosted.org/packages/80/91/38bf9c79674e95ce32e23c267055f281dff651eec77ed32a677db3dc011a/time_machine-2.19.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:2851825b524a988ee459c37c1c26bdfaa7eff78194efb2b562ea497a6f375b0a", size = 32606, upload-time = "2025-08-19T17:20:46.693Z" }, + { url = "https://files.pythonhosted.org/packages/19/4a/e9222d85d4de68975a5e799f539a9d32f3a134a9101fca0a61fa6aa33d68/time_machine-2.19.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:68d32b09ecfd7fef59255c091e8e7c24dd117f882c4880b5c7ab8c5c32a98f89", size = 34405, upload-time = "2025-08-19T17:20:48.032Z" }, + { url = "https://files.pythonhosted.org/packages/14/e2/09480d608d42d6876f9ff74593cfc9197a7eb2c31381a74fb2b145575b65/time_machine-2.19.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:60c46ab527bf2fa144b530f639cc9e12803524c9e1f111dc8c8f493bb6586eeb", size = 33181, upload-time = "2025-08-19T17:20:48.937Z" }, + { url = "https://files.pythonhosted.org/packages/84/64/f9359e000fad32d9066305c48abc527241d608bcdf77c19d67d66e268455/time_machine-2.19.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:56f26ab9f0201c453d18fe76bb7d1cf05fe58c1b9d9cb0c7d243d05132e01292", size = 31036, upload-time = "2025-08-19T17:20:50.276Z" }, + { url = "https://files.pythonhosted.org/packages/71/0d/fab2aacec71e3e482bd7fce0589381f9414a4a97f8766bddad04ad047b7b/time_machine-2.19.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:6c806cf3c1185baa1d807b7f51bed0db7a6506832c961d5d1b4c94c775749bc0", size = 32145, upload-time = "2025-08-19T17:20:51.449Z" }, + { url = "https://files.pythonhosted.org/packages/44/fb/faeba2405fb27553f7b28db441a500e2064ffdb2dcba001ee315fdd2c121/time_machine-2.19.0-cp311-cp311-win32.whl", hash = "sha256:b30039dfd89855c12138095bee39c540b4633cbc3684580d684ef67a99a91587", size = 17004, upload-time = "2025-08-19T17:20:52.38Z" }, + { url = "https://files.pythonhosted.org/packages/2f/84/87e483d660ca669426192969280366635c845c3154a9fe750be546ed3afc/time_machine-2.19.0-cp311-cp311-win_amd64.whl", hash = "sha256:13ed8b34430f1de79905877f5600adffa626793ab4546a70a99fb72c6a3350d8", size = 17822, upload-time = "2025-08-19T17:20:53.348Z" }, + { url = "https://files.pythonhosted.org/packages/41/f4/ebf7bbf5047854a528adaf54a5e8780bc5f7f0104c298ab44566a3053bf8/time_machine-2.19.0-cp311-cp311-win_arm64.whl", hash = "sha256:cc29a50a0257d8750b08056b66d7225daab47606832dea1a69e8b017323bf511", size = 16680, upload-time = "2025-08-19T17:20:54.26Z" }, + { url = "https://files.pythonhosted.org/packages/9b/aa/7e00614d339e4d687f6e96e312a1566022528427d237ec639df66c4547bc/time_machine-2.19.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:c85cf437dc3c07429456d8d6670ac90ecbd8241dcd0fbf03e8db2800576f91ff", size = 19308, upload-time = "2025-08-19T17:20:55.25Z" }, + { url = "https://files.pythonhosted.org/packages/ab/3c/bde3c757394f5bca2fbc1528d4117960a26c38f9b160bf471b38d2378d8f/time_machine-2.19.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d9238897e8ef54acdf59f5dff16f59ca0720e7c02d820c56b4397c11db5d3eb9", size = 15019, upload-time = "2025-08-19T17:20:56.204Z" }, + { url = "https://files.pythonhosted.org/packages/c8/e0/8ca916dd918018352d377f1f5226ee071cfbeb7dbbde2b03d14a411ac2b1/time_machine-2.19.0-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:e312c7d5d6bfffb96c6a7b39ff29e3046de100d7efaa3c01552654cfbd08f14c", size = 33079, upload-time = "2025-08-19T17:20:57.166Z" }, + { url = "https://files.pythonhosted.org/packages/48/69/184a0209f02dd0cb5e01e8d13cd4c97a5f389c4e3d09b95160dd676ad1e7/time_machine-2.19.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:714c40b2c90d1c57cc403382d5a9cf16e504cb525bfe9650095317da3c3d62b5", size = 34925, upload-time = "2025-08-19T17:20:58.117Z" }, + { url = "https://files.pythonhosted.org/packages/43/42/4bbf4309e8e57cea1086eb99052d97ff6ddecc1ab6a3b07aa4512f8bf963/time_machine-2.19.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2eaa1c675d500dc3ccae19e9fb1feff84458a68c132bbea47a80cc3dd2df7072", size = 36384, upload-time = "2025-08-19T17:20:59.108Z" }, + { url = "https://files.pythonhosted.org/packages/b1/af/9f510dc1719157348c1a2e87423aed406589070b54b503cb237d9bf3a4fe/time_machine-2.19.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e77a414e9597988af53b2b2e67242c9d2f409769df0d264b6d06fda8ca3360d4", size = 34881, upload-time = "2025-08-19T17:21:00.116Z" }, + { url = "https://files.pythonhosted.org/packages/ca/28/61764a635c70cc76c76ba582dfdc1a84834cddaeb96789023af5214426b2/time_machine-2.19.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:cd93996970e11c382b04d4937c3cd0b0167adeef14725ece35aae88d8a01733c", size = 32931, upload-time = "2025-08-19T17:21:01.095Z" }, + { url = "https://files.pythonhosted.org/packages/b6/e0/f028d93b266e6ade8aca5851f76ebbc605b2905cdc29981a2943b43e1a6c/time_machine-2.19.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:8e20a6d8d6e23174bd7e931e134d9610b136db460b249d07e84ecdad029ec352", size = 34241, upload-time = "2025-08-19T17:21:02.052Z" }, + { url = "https://files.pythonhosted.org/packages/7d/a6/36d1950ed1d3f613158024cf1dcc73db1d9ef0b9117cf51ef2e37dc06499/time_machine-2.19.0-cp312-cp312-win32.whl", hash = "sha256:95afc9bc65228b27be80c2756799c20b8eb97c4ef382a9b762b6d7888bc84099", size = 17021, upload-time = "2025-08-19T17:21:03.374Z" }, + { url = "https://files.pythonhosted.org/packages/b1/0d/e2dce93355abda3cac69e77fe96566757e98b8fe7fdcbddce89c9ced3f5f/time_machine-2.19.0-cp312-cp312-win_amd64.whl", hash = "sha256:e84909af950e2448f4e2562ea5759c946248c99ab380d2b47d79b62bd76fa236", size = 17857, upload-time = "2025-08-19T17:21:04.331Z" }, + { url = "https://files.pythonhosted.org/packages/eb/28/50ae6fb83b7feeeca7a461c0dc156cf7ef5e6ef594a600d06634fde6a2cb/time_machine-2.19.0-cp312-cp312-win_arm64.whl", hash = "sha256:0390a1ea9fa7e9d772a39b7c61b34fdcca80eb9ffac339cc0441c6c714c81470", size = 16677, upload-time = "2025-08-19T17:21:05.39Z" }, + { url = "https://files.pythonhosted.org/packages/a9/b8/24ebce67aa531bae2cbe164bb3f4abc6467dc31f3aead35e77f5a075ea3e/time_machine-2.19.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:5e172866753e6041d3b29f3037dc47c20525176a494a71bbd0998dfdc4f11f2f", size = 19373, upload-time = "2025-08-19T17:21:06.701Z" }, + { url = "https://files.pythonhosted.org/packages/53/a5/c9a5240fd2f845d3ff9fa26f8c8eaa29f7239af9d65007e61d212250f15b/time_machine-2.19.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f70f68379bd6f542ae6775cce9a4fa3dcc20bf7959c42eaef871c14469e18097", size = 15056, upload-time = "2025-08-19T17:21:07.667Z" }, + { url = "https://files.pythonhosted.org/packages/b9/92/66cce5d2fb2a5e68459aca85fd18a7e2d216f725988940cd83f96630f2f1/time_machine-2.19.0-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:e69e0b0f694728a00e72891ef8dd00c7542952cb1c87237db594b6b27d504a96", size = 33172, upload-time = "2025-08-19T17:21:08.619Z" }, + { url = "https://files.pythonhosted.org/packages/ae/20/b499e9ab4364cd466016c33dcdf4f56629ca4c20b865bd4196d229f31d92/time_machine-2.19.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:3ae0a8b869574301ec5637e32c270c7384cca5cd6e230f07af9d29271a7fa293", size = 35042, upload-time = "2025-08-19T17:21:09.622Z" }, + { url = "https://files.pythonhosted.org/packages/41/32/b252d3d32791eb16c07d553c820dbc33d9c7fa771de3d1c602190bded2b7/time_machine-2.19.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:554e4317de90e2f7605ff80d153c8bb56b38c0d0c0279feb17e799521e987b8c", size = 36535, upload-time = "2025-08-19T17:21:10.571Z" }, + { url = "https://files.pythonhosted.org/packages/98/cf/4d0470062b9742e1b040ab81bad04d1a5d1de09806507bb6188989cfa1a7/time_machine-2.19.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:6567a5ec5538ed550539ac29be11b3cb36af1f9894e2a72940cba0292cc7c3c9", size = 34945, upload-time = "2025-08-19T17:21:11.538Z" }, + { url = "https://files.pythonhosted.org/packages/24/71/2f741b29d98b1c18f6777a32236497c3d3264b6077e431cea4695684c8a1/time_machine-2.19.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:82e9ffe8dfff07b0d810a2ad015a82cd78c6a237f6c7cf185fa7f747a3256f8a", size = 33014, upload-time = "2025-08-19T17:21:12.858Z" }, + { url = "https://files.pythonhosted.org/packages/e8/83/ca8dba6106562843fd99f672e5aaf95badbc10f4f13f7cfe8d8640a7019d/time_machine-2.19.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:7e1c4e578cdd69b3531d8dd3fbcb92a0cd879dadb912ee37af99c3a9e3c0d285", size = 34350, upload-time = "2025-08-19T17:21:13.923Z" }, + { url = "https://files.pythonhosted.org/packages/21/7f/34fe540450e18d0a993240100e4b86e8d03d831b92af8bb6ddb2662dc6fc/time_machine-2.19.0-cp313-cp313-win32.whl", hash = "sha256:72dbd4cbc3d96dec9dd281ddfbb513982102776b63e4e039f83afb244802a9e5", size = 17047, upload-time = "2025-08-19T17:21:14.874Z" }, + { url = "https://files.pythonhosted.org/packages/bf/5d/c8be73df82c7ebe7cd133279670e89b8b110af3ce1412c551caa9d08e625/time_machine-2.19.0-cp313-cp313-win_amd64.whl", hash = "sha256:e17e3e089ac95f9a145ce07ff615e3c85674f7de36f2d92aaf588493a23ffb4b", size = 17868, upload-time = "2025-08-19T17:21:15.819Z" }, + { url = "https://files.pythonhosted.org/packages/92/13/2dfd3b8fb285308f61cd7aa9bfa96f46ddf916e3549a0f0afd094c556599/time_machine-2.19.0-cp313-cp313-win_arm64.whl", hash = "sha256:149072aff8e3690e14f4916103d898ea0d5d9c95531b6aa0995251c299533f7b", size = 16710, upload-time = "2025-08-19T17:21:16.748Z" }, + { url = "https://files.pythonhosted.org/packages/05/c1/deebb361727d2c5790f9d4d874be1b19afd41f4375581df465e6718b46a2/time_machine-2.19.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:f3589fee1ed0ab6ee424a55b0ea1ec694c4ba64cc26895bcd7d99f3d1bc6a28a", size = 20053, upload-time = "2025-08-19T17:21:17.704Z" }, + { url = "https://files.pythonhosted.org/packages/45/e8/fe3376951e6118d8ec1d1f94066a169b791424fe4a26c7dfc069b153ee08/time_machine-2.19.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:7887e85275c4975fe54df03dcdd5f38bd36be973adc68a8c77e17441c3b443d6", size = 15423, upload-time = "2025-08-19T17:21:18.668Z" }, + { url = "https://files.pythonhosted.org/packages/9c/c7/f88d95cd1a87c650cf3749b4d64afdaf580297aa18ad7f4b44ec9d252dfc/time_machine-2.19.0-cp313-cp313t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:ce0be294c209928563fcce1c587963e60ec803436cf1e181acd5bc1e425d554b", size = 39630, upload-time = "2025-08-19T17:21:19.645Z" }, + { url = "https://files.pythonhosted.org/packages/cc/5d/65a5c48a65357e56ec6f032972e4abd1c02d4fca4b0717a3aaefd19014d4/time_machine-2.19.0-cp313-cp313t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:a62fd1ab380012c86f4c042010418ed45eb31604f4bf4453e17c9fa60bc56a29", size = 41242, upload-time = "2025-08-19T17:21:20.979Z" }, + { url = "https://files.pythonhosted.org/packages/f6/f9/fe5209e1615fde0a8cad6c4e857157b150333ed1fe31a7632b08cfe0ebdd/time_machine-2.19.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b25ec853a4530a5800731257f93206b12cbdee85ede964ebf8011b66086a7914", size = 44278, upload-time = "2025-08-19T17:21:21.984Z" }, + { url = "https://files.pythonhosted.org/packages/4a/3a/a5e5fe9c5d614cde0a9387ff35e8dfd12c5ef6384e4c1a21b04e6e0b905d/time_machine-2.19.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:a430e4d0e0556f021a9c78e9b9f68e5e8910bdace4aa34ed4d1a73e239ed9384", size = 42321, upload-time = "2025-08-19T17:21:23.755Z" }, + { url = "https://files.pythonhosted.org/packages/a1/c5/56eca774e9162bc1ce59111d2bd69140dc8908c9478c92ec7bd15d547600/time_machine-2.19.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:2415b7495ec4364c8067071e964fbadfe746dd4cdb43983f2f0bd6ebed13315c", size = 39270, upload-time = "2025-08-19T17:21:26.009Z" }, + { url = "https://files.pythonhosted.org/packages/9b/69/5dd0c420667578169a12acc8c8fd7452e8cfb181e41c9b4ac7e88fa36686/time_machine-2.19.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:dbfc6b90c10f288594e1bf89a728a98cc0030791fd73541bbdc6b090aff83143", size = 40193, upload-time = "2025-08-19T17:21:27.054Z" }, + { url = "https://files.pythonhosted.org/packages/75/a7/de974d421bd55c9355583427c2a38fb0237bb5fd6614af492ba89dacb2f9/time_machine-2.19.0-cp313-cp313t-win32.whl", hash = "sha256:16f5d81f650c0a4d117ab08036dc30b5f8b262e11a4a0becc458e7f1c011b228", size = 17542, upload-time = "2025-08-19T17:21:28.674Z" }, + { url = "https://files.pythonhosted.org/packages/76/0a/aa0d05becd5d06ae8d3f16d657dc8cc9400c8d79aef80299de196467ff12/time_machine-2.19.0-cp313-cp313t-win_amd64.whl", hash = "sha256:645699616ec14e147094f601e6ab9553ff6cea37fad9c42720a6d7ed04bcd5dc", size = 18703, upload-time = "2025-08-19T17:21:29.663Z" }, + { url = "https://files.pythonhosted.org/packages/1f/c0/f785a4c7c73aa176510f7c48b84b49c26be84af0d534deb222e0327f750e/time_machine-2.19.0-cp313-cp313t-win_arm64.whl", hash = "sha256:b32daa965d13237536ea3afaa5ad61ade2b2d9314bc3a20196a0d2e1d7b57c6a", size = 17020, upload-time = "2025-08-19T17:21:30.653Z" }, + { url = "https://files.pythonhosted.org/packages/ed/97/c5fb51def06c0b2b6735332ad118ab35b4d9b85368792e5b638e99b1b686/time_machine-2.19.0-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:31cb43c8fd2d961f31bed0ff4e0026964d2b35e5de9e0fabbfecf756906d3612", size = 19360, upload-time = "2025-08-19T17:21:31.94Z" }, + { url = "https://files.pythonhosted.org/packages/2d/4e/2d795f7d6b7f5205ffe737a05bb1cf19d8038233b797062b2ef412b8512b/time_machine-2.19.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:bdf481a75afc6bff3e520db594501975b652f7def21cd1de6aa971d35ba644e6", size = 15033, upload-time = "2025-08-19T17:21:32.934Z" }, + { url = "https://files.pythonhosted.org/packages/dd/32/9bad501e360b4e758c58fae616ca5f8c7ad974b343f2463a15b2bf77a366/time_machine-2.19.0-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:00bee4bb950ac6a08d62af78e4da0cf2b4fc2abf0de2320d0431bf610db06e7c", size = 33379, upload-time = "2025-08-19T17:21:33.925Z" }, + { url = "https://files.pythonhosted.org/packages/a3/45/eda0ca4d793dfd162478d6163759b1c6ce7f6e61daa7fd7d62b31f21f87f/time_machine-2.19.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:9f02199490906582302ce09edd32394fb393271674c75d7aa76c7a3245f16003", size = 35123, upload-time = "2025-08-19T17:21:34.945Z" }, + { url = "https://files.pythonhosted.org/packages/f0/5a/97e16325442ae5731fcaac794f0a1ef9980eff8a5491e58201d7eb814a34/time_machine-2.19.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e35726c7ba625f844c13b1fc0d4f81f394eefaee1d3a094a9093251521f2ef15", size = 36588, upload-time = "2025-08-19T17:21:35.975Z" }, + { url = "https://files.pythonhosted.org/packages/e8/9d/bf0b2ccc930cc4a316f26f1c78d3f313cd0fa13bb7480369b730a8f129db/time_machine-2.19.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:304315023999cd401ff02698870932b893369e1cfeb2248d09f6490507a92e97", size = 35013, upload-time = "2025-08-19T17:21:37.017Z" }, + { url = "https://files.pythonhosted.org/packages/f0/5a/39ac6a3078174f9715d88364871348b249631f12e76de1b862433b3f8862/time_machine-2.19.0-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:9765d4f003f263ea8bfd90d2d15447ca4b3dfa181922cf6cf808923b02ac180a", size = 33303, upload-time = "2025-08-19T17:21:38.352Z" }, + { url = "https://files.pythonhosted.org/packages/b3/ac/d8646baf9f95f2e792a6d7a7b35e92fca253c4a992afff801beafae0e5c2/time_machine-2.19.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:7837ef3fd5911eb9b480909bb93d922737b6bdecea99dfcedb0a03807de9b2d3", size = 34440, upload-time = "2025-08-19T17:21:39.382Z" }, + { url = "https://files.pythonhosted.org/packages/ce/8b/8b6568c5ae966d80ead03ab537be3c6acf2af06fb501c2d466a3162c6295/time_machine-2.19.0-cp314-cp314-win32.whl", hash = "sha256:4bb5bd43b1bdfac3007b920b51d8e761f024ed465cfeec63ac4296922a4ec428", size = 17162, upload-time = "2025-08-19T17:21:40.381Z" }, + { url = "https://files.pythonhosted.org/packages/46/a5/211c1ab4566eba5308b2dc001b6349e3a032e3f6afa67ca2f27ea6b27af5/time_machine-2.19.0-cp314-cp314-win_amd64.whl", hash = "sha256:f583bbd0aa8ab4a7c45a684bf636d9e042d466e30bcbae1d13e7541e2cbe7207", size = 18040, upload-time = "2025-08-19T17:21:41.363Z" }, + { url = "https://files.pythonhosted.org/packages/b8/fc/4c2fb705f6371cb83824da45a8b967514a922fc092a0ef53979334d97a70/time_machine-2.19.0-cp314-cp314-win_arm64.whl", hash = "sha256:f379c6f8a6575a8284592179cf528ce89373f060301323edcc44f1fa1d37be12", size = 16752, upload-time = "2025-08-19T17:21:42.336Z" }, + { url = "https://files.pythonhosted.org/packages/79/ab/6437d18f31c666b5116c97572a282ac2590a82a0a9867746a6647eaf4613/time_machine-2.19.0-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:a3b8981f9c663b0906b05ab4d0ca211fae4b63b47c6ec26de5374fe56c836162", size = 20057, upload-time = "2025-08-19T17:21:43.35Z" }, + { url = "https://files.pythonhosted.org/packages/6c/a2/e03639ec2ba7200328bbcad8a2b2b1d5fccca9cceb9481b164a1cabdcb33/time_machine-2.19.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:8e9c6363893e7f52c226afbebb23e825259222d100e67dfd24c8a6d35f1a1907", size = 15430, upload-time = "2025-08-19T17:21:44.725Z" }, + { url = "https://files.pythonhosted.org/packages/5d/ff/39e63a48e840f3e36ce24846ee51dd99c6dba635659b1750a2993771e88e/time_machine-2.19.0-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:206fcd6c9a6f00cac83db446ad1effc530a8cec244d2780af62db3a2d0a9871b", size = 39622, upload-time = "2025-08-19T17:21:45.821Z" }, + { url = "https://files.pythonhosted.org/packages/9a/2e/ee5ac79c4954768705801e54817c7d58e07e25a0bb227e775f501f3e2122/time_machine-2.19.0-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:bf33016a1403c123373ffaeff25e26e69d63bf2c63b6163932efed94160db7ef", size = 41235, upload-time = "2025-08-19T17:21:46.783Z" }, + { url = "https://files.pythonhosted.org/packages/3a/3e/9af5f39525e779185c77285b8bbae15340eeeaa0afb33d458bc8b47d459b/time_machine-2.19.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9247c4bb9bbd3ff584ef4efbdec8efd9f37aa08bcfc4728bde1e489c2cb445bd", size = 44276, upload-time = "2025-08-19T17:21:47.759Z" }, + { url = "https://files.pythonhosted.org/packages/59/fe/572c7443cc27140bbeae3947279bbd4a120f9e8622253a20637f260b7813/time_machine-2.19.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:77f9bb0b86758d1f2d9352642c874946ad5815df53ef4ca22eb9d532179fe50d", size = 42330, upload-time = "2025-08-19T17:21:48.881Z" }, + { url = "https://files.pythonhosted.org/packages/cf/24/1a81c2e08ee7dae13ec8ceed27a29afa980c3d63852e42f1e023bf0faa03/time_machine-2.19.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:0b529e262df3b9c449f427385f4d98250828c879168c2e00eec844439f40b370", size = 39281, upload-time = "2025-08-19T17:21:49.907Z" }, + { url = "https://files.pythonhosted.org/packages/d2/60/6f0d6e5108978ca1a2a4ffb4d1c7e176d9199bb109fd44efe2680c60b52a/time_machine-2.19.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:9199246e31cdc810e5d89cb71d09144c4d745960fdb0824da4994d152aca3303", size = 40201, upload-time = "2025-08-19T17:21:50.953Z" }, + { url = "https://files.pythonhosted.org/packages/73/b9/3ea4951e8293b0643feb98c0b9a176fa822154f1810835db3f282968ab10/time_machine-2.19.0-cp314-cp314t-win32.whl", hash = "sha256:0fe81bae55b7aefc2c2a34eb552aa82e6c61a86b3353a3c70df79b9698cb02ca", size = 17743, upload-time = "2025-08-19T17:21:51.948Z" }, + { url = "https://files.pythonhosted.org/packages/e4/8b/cd802884ca8a98e2b6cdc2397d57dd12ff8a7d1481e06fc3fad3d4e7e5ff/time_machine-2.19.0-cp314-cp314t-win_amd64.whl", hash = "sha256:7253791b8d7e7399fbeed7a8193cb01bc004242864306288797056badbdaf80b", size = 18956, upload-time = "2025-08-19T17:21:52.997Z" }, + { url = "https://files.pythonhosted.org/packages/c6/49/cabb1593896082fd55e34768029b8b0ca23c9be8b2dc127e0fc14796d33e/time_machine-2.19.0-cp314-cp314t-win_arm64.whl", hash = "sha256:536bd1ac31ab06a1522e7bf287602188f502dc19d122b1502c4f60b1e8efac79", size = 17068, upload-time = "2025-08-19T17:21:54.064Z" }, + { url = "https://files.pythonhosted.org/packages/d6/05/0608376c3167afe6cf7cdfd2b05c142ea4c42616eee9ba06d1799965806a/time_machine-2.19.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:d8bb00b30ec9fe56d01e9812df1ffe39f331437cef9bfaebcc81c83f7f8f8ee2", size = 19659, upload-time = "2025-08-19T17:21:55.426Z" }, + { url = "https://files.pythonhosted.org/packages/11/c4/72eb8c7b36830cf36c51d7bc2f1ac313d68881c3a58040fb6b42c4523d20/time_machine-2.19.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d821c60efc08a97cc11e5482798e6fd5eba5c0f22a02db246b50895dbdc0de41", size = 15153, upload-time = "2025-08-19T17:21:56.505Z" }, + { url = "https://files.pythonhosted.org/packages/89/1a/0782e1f5c8ab8809ebd992709e1bb69d67600191baa023af7a5d32023a3c/time_machine-2.19.0-cp39-cp39-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:fb051aec7b3b6e96a200d911c225901e6133ff3da11e470e24111a53bbc13637", size = 32555, upload-time = "2025-08-19T17:21:57.74Z" }, + { url = "https://files.pythonhosted.org/packages/94/b0/8ef58e2f6321851d5900ca3d18044938832c2ed42a2ac7570ca6aa29768a/time_machine-2.19.0-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:fe59909d95a2ef5e01ce3354fdea3908404c2932c2069f00f66dff6f27e9363e", size = 34185, upload-time = "2025-08-19T17:21:59.361Z" }, + { url = "https://files.pythonhosted.org/packages/82/74/ce0c9867f788c1fb22c417ec1aae47a24117e53d51f6ff97d7c6ca5392f6/time_machine-2.19.0-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:29e84b8682645b16eb6f9e8ec11c35324ad091841a11cf4fc3fc7f6119094c89", size = 35917, upload-time = "2025-08-19T17:22:00.421Z" }, + { url = "https://files.pythonhosted.org/packages/d2/70/6f97a8f552dbaa66feb10170b5726dab74bc531673d1ed9d6f271547e54c/time_machine-2.19.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:4a11f1c0e0d06023dc01614c964e256138913551d3ae6dca5148f79081156336", size = 34584, upload-time = "2025-08-19T17:22:01.447Z" }, + { url = "https://files.pythonhosted.org/packages/48/c8/cf139088ce537c15d7f03cf56ec317d3a5cfb520e30aa711ea0248d0ae8a/time_machine-2.19.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:57a235a6307c54df50e69f1906e2f199e47da91bde4b886ee05aff57fe4b6bf6", size = 32608, upload-time = "2025-08-19T17:22:02.548Z" }, + { url = "https://files.pythonhosted.org/packages/b1/17/0ec41ef7a30c6753fb226a28b74162b264b35724905ced4098f2f5076ded/time_machine-2.19.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:426aba552f7af9604adad9ef570c859af7c1081d878db78089fac159cd911b0a", size = 33686, upload-time = "2025-08-19T17:22:03.606Z" }, + { url = "https://files.pythonhosted.org/packages/b0/19/586f15159083ec84f178d494c60758c46603b00c9641b04deb63f1950128/time_machine-2.19.0-cp39-cp39-win32.whl", hash = "sha256:67772c7197a3a712d1b970ed545c6e98db73524bd90e245fd3c8fa7ad7630768", size = 17133, upload-time = "2025-08-19T17:22:04.989Z" }, + { url = "https://files.pythonhosted.org/packages/6a/c2/bfe4b906a9fe0bf2d011534314212ed752d6b8f392c9c82f6ac63dccc5ab/time_machine-2.19.0-cp39-cp39-win_amd64.whl", hash = "sha256:011d7859089263204dc5fdf83dce7388f986fe833c9381d6106b4edfda2ebd3e", size = 17972, upload-time = "2025-08-19T17:22:06.026Z" }, + { url = "https://files.pythonhosted.org/packages/5d/73/182343eba05aa5787732aaa68f3b3feb5e40ddf86b928ae941be45646393/time_machine-2.19.0-cp39-cp39-win_arm64.whl", hash = "sha256:e1af66550fa4685434f00002808a525f176f1f92746646c0019bb86fbff48b27", size = 16820, upload-time = "2025-08-19T17:22:07.227Z" }, +] + +[[package]] +name = "time-machine" +version = "3.1.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.14' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version >= '3.10' and python_full_version < '3.14' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version >= '3.10' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra != 'group-18-runloop-api-client-pydantic-v2'", + "python_full_version >= '3.10' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra != 'group-18-runloop-api-client-pydantic-v2'", ] -sdist = { url = "https://files.pythonhosted.org/packages/fb/dd/5022939b9cadefe3af04f4012186c29b8afbe858b1ec2cfa38baeec94dab/time_machine-2.16.0.tar.gz", hash = "sha256:4a99acc273d2f98add23a89b94d4dd9e14969c01214c8514bfa78e4e9364c7e2", size = 24626, upload-time = "2024-10-08T14:21:59.734Z" } +sdist = { url = "https://files.pythonhosted.org/packages/17/bd/a1bb03eb39ce35c966f0dde6559df7348ca0580f7cd3a956fdd7ed0b5080/time_machine-3.1.0.tar.gz", hash = "sha256:90831c2cf9e18e4199abb85fafa0c0ca0c6c15d0894a03ef68d5005a796c4f27", size = 14436, upload-time = "2025-11-21T13:56:33.802Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/79/47/32fdb8e70122edbc8be9db1f032d22b38e3d9ef0bf52c64470d0815cdb62/time_machine-2.16.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:09531af59fdfb39bfd24d28bd1e837eff5a5d98318509a31b6cfd57d27801e52", size = 20493, upload-time = "2024-10-08T14:20:51.241Z" }, - { url = "https://files.pythonhosted.org/packages/b1/e6/f3bc391d5642e69299f2d1f0a46e7f98d1669e82b1e16c8cf3c6e4615059/time_machine-2.16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:92d0b0f3c49f34dd76eb462f0afdc61ed1cb318c06c46d03e99b44ebb489bdad", size = 16757, upload-time = "2024-10-08T14:20:52.614Z" }, - { url = "https://files.pythonhosted.org/packages/d4/7f/3a78d50fec64edd9964bf42b66a2e659a9846669ac8f705acc363ee79d3a/time_machine-2.16.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7c29616e18e2349a8766d5b6817920fc74e39c00fa375d202231e9d525a1b882", size = 34527, upload-time = "2024-10-08T14:20:53.714Z" }, - { url = "https://files.pythonhosted.org/packages/61/00/7cf1324d8f8db8f5dab71c44ed1e9c11c4f1cecca9d4363abf44154aa13b/time_machine-2.16.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c1ceb6035a64cb00650e3ab203cf3faffac18576a3f3125c24df468b784077c7", size = 32537, upload-time = "2024-10-08T14:20:54.834Z" }, - { url = "https://files.pythonhosted.org/packages/8e/c2/edf5ccb2fa529251eb7f1cfb34098c0ef236dbb88f0a6564d06f6f8378f5/time_machine-2.16.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:64c205ea37b8c4ba232645335fc3b75bc2d03ce30f0a34649e36cae85652ee96", size = 34353, upload-time = "2024-10-08T14:20:56.414Z" }, - { url = "https://files.pythonhosted.org/packages/a9/1e/178b9e3d0054300a4dd0485747c89359e5f719f090ae5165c88618793700/time_machine-2.16.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:dfe92412bd11104c4f0fb2da68653e6c45b41f7217319a83a8b66ed4f20148b3", size = 34045, upload-time = "2024-10-08T14:20:58.117Z" }, - { url = "https://files.pythonhosted.org/packages/e5/4d/068ad9660f00f88a54f3ff7e9d423ed5c08a5f8147518f6c66fd0393dde7/time_machine-2.16.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:d5fe7a6284e3dce87ae13a25029c53542dd27a28d151f3ef362ec4dd9c3e45fd", size = 32356, upload-time = "2024-10-08T14:20:59.8Z" }, - { url = "https://files.pythonhosted.org/packages/a5/25/c0f26294808946ec5b665f17a0072049a3f9e2468abc18aa8fe22580b4cf/time_machine-2.16.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:c0fca3025266d88d1b48be162a43b7c2d91c81cc5b3bee9f01194678ffb9969a", size = 33737, upload-time = "2024-10-08T14:21:00.868Z" }, - { url = "https://files.pythonhosted.org/packages/8b/d4/ae909a269828eaa7672e1201403976e794ea679ae7ba04fe0c0c0c65c2b6/time_machine-2.16.0-cp310-cp310-win32.whl", hash = "sha256:4149e17018af07a5756a1df84aea71e6e178598c358c860c6bfec42170fa7970", size = 19133, upload-time = "2024-10-08T14:21:01.975Z" }, - { url = "https://files.pythonhosted.org/packages/7e/e7/5946d62d49e79b97c6772fe2918eccbd069d74effa8d50bdca4056502aeb/time_machine-2.16.0-cp310-cp310-win_amd64.whl", hash = "sha256:01bc257e9418980a4922de94775be42a966e1a082fb01a1635917f9afc7b84ca", size = 19995, upload-time = "2024-10-08T14:21:03.001Z" }, - { url = "https://files.pythonhosted.org/packages/54/cb/6507c6594f086bc955ff200cc4fd415d2ab229371ca3ba8fc3d27429a9cc/time_machine-2.16.0-cp310-cp310-win_arm64.whl", hash = "sha256:6895e3e84119594ab12847c928f619d40ae9cedd0755515dc154a5b5dc6edd9f", size = 18109, upload-time = "2024-10-08T14:21:04.712Z" }, - { url = "https://files.pythonhosted.org/packages/38/7b/34aad93f75f86503dd1fa53bc120d8129fe4de83aef58ffa78c62b044ef9/time_machine-2.16.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:8f936566ef9f09136a3d5db305961ef6d897b76b240c9ff4199144aed6dd4fe5", size = 20169, upload-time = "2024-10-08T14:21:06.288Z" }, - { url = "https://files.pythonhosted.org/packages/68/cb/7d020d5c05d0460a4a96232b0777882ef989c1e6144d11ba984c4b0b4d1a/time_machine-2.16.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5886e23ede3478ca2a3e0a641f5d09dd784dfa9e48c96e8e5e31fc4fe77b6dc0", size = 16614, upload-time = "2024-10-08T14:21:07.253Z" }, - { url = "https://files.pythonhosted.org/packages/0d/24/ce1ff76c9a4f3be88c2b947f2411a5a8019390734597d3106a151f8a9416/time_machine-2.16.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c76caf539fa4941e1817b7c482c87c65c52a1903fea761e84525955c6106fafb", size = 32507, upload-time = "2024-10-08T14:21:08.289Z" }, - { url = "https://files.pythonhosted.org/packages/08/d7/ba1135587bd2ed105e59ed7e05969c913277d110fecc0ed871006ea3f763/time_machine-2.16.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:298aa423e07c8b21b991782f01d7749c871c792319c2af3e9755f9ab49033212", size = 30627, upload-time = "2024-10-08T14:21:09.246Z" }, - { url = "https://files.pythonhosted.org/packages/da/c6/f490aaddc80c54238f4b8fe97870bbfe0d2c70fe4a57269badc94f5f38a6/time_machine-2.16.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e3391ae9c484736850bb44ef125cbad52fe2d1b69e42c95dc88c43af8ead2cc7", size = 32362, upload-time = "2024-10-08T14:21:10.178Z" }, - { url = "https://files.pythonhosted.org/packages/b1/f7/2522ae1c1995a39d6d8b7ee7efed47ec8bd7ff3240fdb2662a8b7e11b84a/time_machine-2.16.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:503e7ff507c2089699d91885fc5b9c8ff16774a7b6aff48b4dcee0c0a0685b61", size = 32188, upload-time = "2024-10-08T14:21:11.743Z" }, - { url = "https://files.pythonhosted.org/packages/e9/53/b1ccb55f39e7e62660f852d7aedef438d2872ea9c73f64be46d0d3b3f3d7/time_machine-2.16.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:eee7b0fc4fbab2c6585ea17606c6548be83919c70deea0865409fe9fc2d8cdce", size = 30600, upload-time = "2024-10-08T14:21:12.728Z" }, - { url = "https://files.pythonhosted.org/packages/19/1f/37a5a9333a2da35b0fc43e8ac693b82dd5492892131bc3cc0c8f5835af94/time_machine-2.16.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9db5e5b3ccdadaafa5730c2f9db44c38b013234c9ad01f87738907e19bdba268", size = 31896, upload-time = "2024-10-08T14:21:14.451Z" }, - { url = "https://files.pythonhosted.org/packages/fc/97/e1a8bd64e5432adf47859cb63847b4472efc644b508602141c60ccf52112/time_machine-2.16.0-cp311-cp311-win32.whl", hash = "sha256:2552f0767bc10c9d668f108fef9b487809cdeb772439ce932e74136365c69baf", size = 19030, upload-time = "2024-10-08T14:21:15.662Z" }, - { url = "https://files.pythonhosted.org/packages/34/c9/f4764e447aa9da4031c89da60fa69f4f73fd45571415788c298cbd4620e9/time_machine-2.16.0-cp311-cp311-win_amd64.whl", hash = "sha256:12474fcdbc475aa6fe5275fe7224e685c5b9777f5939647f35980e9614ae7558", size = 19924, upload-time = "2024-10-08T14:21:17.324Z" }, - { url = "https://files.pythonhosted.org/packages/8a/c0/788500d33656a044e3289b814106c2277209ac73316c00b9668012ce6027/time_machine-2.16.0-cp311-cp311-win_arm64.whl", hash = "sha256:ac2df0fa564356384515ed62cb6679f33f1f529435b16b0ec0f88414635dbe39", size = 17993, upload-time = "2024-10-08T14:21:18.346Z" }, - { url = "https://files.pythonhosted.org/packages/4a/f4/603a84e7ae6427a53953db9f61b689dc6adf233e03c5f5ca907a901452fd/time_machine-2.16.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:84788f4d62a8b1bf5e499bb9b0e23ceceea21c415ad6030be6267ce3d639842f", size = 20155, upload-time = "2024-10-08T14:21:20.055Z" }, - { url = "https://files.pythonhosted.org/packages/d8/94/dbe69aecb4b84be52d34814e63176c5ca61f38ee9e6ecda11104653405b5/time_machine-2.16.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:15ec236b6571730236a193d9d6c11d472432fc6ab54e85eac1c16d98ddcd71bf", size = 16640, upload-time = "2024-10-08T14:21:22.005Z" }, - { url = "https://files.pythonhosted.org/packages/da/13/27f11be25d7bd298e033b9da93217e5b68309bf724b6e494cdadb471d00d/time_machine-2.16.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cedc989717c8b44a3881ac3d68ab5a95820448796c550de6a2149ed1525157f0", size = 33721, upload-time = "2024-10-08T14:21:23.059Z" }, - { url = "https://files.pythonhosted.org/packages/e6/9d/70e4640fed1fd8122204ae825c688d0ef8c04f515ec6bf3c5f3086d6510e/time_machine-2.16.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9d26d79de1c63a8c6586c75967e09b0ff306aa7e944a1eaddb74595c9b1839ca", size = 31646, upload-time = "2024-10-08T14:21:24.037Z" }, - { url = "https://files.pythonhosted.org/packages/a1/cb/93bc0e51bea4e171a85151dbba3c3b3f612b50b953cd3076f5b4f0db9e14/time_machine-2.16.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:317b68b56a9c3731e0cf8886e0f94230727159e375988b36c60edce0ddbcb44a", size = 33403, upload-time = "2024-10-08T14:21:24.975Z" }, - { url = "https://files.pythonhosted.org/packages/89/71/2c6a63ad4fbce3d62d46bbd9ac4433f30bade7f25978ce00815b905bcfcf/time_machine-2.16.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:43e1e18279759897be3293a255d53e6b1cb0364b69d9591d0b80c51e461c94b0", size = 33327, upload-time = "2024-10-08T14:21:25.958Z" }, - { url = "https://files.pythonhosted.org/packages/68/4e/205c2b26763b8817cd6b8868242843800a1fbf275f2af35f5ba35ff2b01a/time_machine-2.16.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:e43adb22def972a29d2b147999b56897116085777a0fea182fd93ee45730611e", size = 31454, upload-time = "2024-10-08T14:21:27.367Z" }, - { url = "https://files.pythonhosted.org/packages/d7/95/44c1aa3994919f93534244c40cfd2fb9416d7686dc0c8b9b262c751b5118/time_machine-2.16.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:0c766bea27a0600e36806d628ebc4b47178b12fcdfb6c24dc0a566a9c06bfe7f", size = 32972, upload-time = "2024-10-08T14:21:28.351Z" }, - { url = "https://files.pythonhosted.org/packages/d4/ee/75243df9c7cf30f108758e887141a58e6544baaa46e2e647b9ccc56db819/time_machine-2.16.0-cp312-cp312-win32.whl", hash = "sha256:6dae82ab647d107817e013db82223e20a9853fa88543fec853ae326382d03c2e", size = 19078, upload-time = "2024-10-08T14:21:29.425Z" }, - { url = "https://files.pythonhosted.org/packages/d4/7c/d4e67cc031f9653c92167ccf87d241e3208653d191c96ac79281c273ab92/time_machine-2.16.0-cp312-cp312-win_amd64.whl", hash = "sha256:265462c77dc9576267c3c7f20707780a171a9fdbac93ac22e608c309efd68c33", size = 19923, upload-time = "2024-10-08T14:21:30.759Z" }, - { url = "https://files.pythonhosted.org/packages/aa/b6/7047226fcb9afefe47fc80f605530535bf71ad99b6797f057abbfa4cd9a5/time_machine-2.16.0-cp312-cp312-win_arm64.whl", hash = "sha256:ef768e14768eebe3bb1196c0dece8e14c1c6991605721214a0c3c68cf77eb216", size = 18003, upload-time = "2024-10-08T14:21:32.662Z" }, - { url = "https://files.pythonhosted.org/packages/a6/18/3087d0eb185cedbc82385f46bf16032ec7102a0e070205a2c88c4ecf9952/time_machine-2.16.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:7751bf745d54e9e8b358c0afa332815da9b8a6194b26d0fd62876ab6c4d5c9c0", size = 20209, upload-time = "2024-10-08T14:21:34.222Z" }, - { url = "https://files.pythonhosted.org/packages/03/a3/fcc3eaf69390402ecf491d718e533b6d0e06d944d77fc8d87be3a2839102/time_machine-2.16.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:1784edf173ca840ba154de6eed000b5727f65ab92972c2f88cec5c4d6349c5f2", size = 16681, upload-time = "2024-10-08T14:21:35.14Z" }, - { url = "https://files.pythonhosted.org/packages/a2/96/8b76d264014bf9dc21873218de50d67223c71736f87fe6c65e582f7c29ac/time_machine-2.16.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2f5876a5682ce1f517e55d7ace2383432627889f6f7e338b961f99d684fd9e8d", size = 33768, upload-time = "2024-10-08T14:21:36.942Z" }, - { url = "https://files.pythonhosted.org/packages/5c/13/59ae8259be02b6c657ef6e3b6952bf274b43849f6f35cc61a576c68ce301/time_machine-2.16.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:806672529a2e255cd901f244c9033767dc1fa53466d0d3e3e49565a1572a64fe", size = 31685, upload-time = "2024-10-08T14:21:37.881Z" }, - { url = "https://files.pythonhosted.org/packages/3e/c1/9f142beb4d373a2a01ebb58d5117289315baa5131d880ec804db49e94bf7/time_machine-2.16.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:667b150fedb54acdca2a4bea5bf6da837b43e6dd12857301b48191f8803ba93f", size = 33447, upload-time = "2024-10-08T14:21:38.809Z" }, - { url = "https://files.pythonhosted.org/packages/95/f7/ed9ecd93c2d38dca77d0a28e070020f3ce0fb23e0d4a6edb14bcfffa5526/time_machine-2.16.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:da3ae1028af240c0c46c79adf9c1acffecc6ed1701f2863b8132f5ceae6ae4b5", size = 33408, upload-time = "2024-10-08T14:21:39.785Z" }, - { url = "https://files.pythonhosted.org/packages/91/40/d0d274d70fa2c4cad531745deb8c81346365beb0a2736be05a3acde8b94a/time_machine-2.16.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:520a814ea1b2706c89ab260a54023033d3015abef25c77873b83e3d7c1fafbb2", size = 31526, upload-time = "2024-10-08T14:21:40.769Z" }, - { url = "https://files.pythonhosted.org/packages/1d/ba/a27cdbb324d9a6d779cde0d514d47b696b5a6a653705d4b511fd65ef1514/time_machine-2.16.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8243664438bb468408b29c6865958662d75e51f79c91842d2794fa22629eb697", size = 33042, upload-time = "2024-10-08T14:21:41.722Z" }, - { url = "https://files.pythonhosted.org/packages/72/63/64e9156c9e38c18720d0cc41378168635241de44013ffe3dd5b099447eb0/time_machine-2.16.0-cp313-cp313-win32.whl", hash = "sha256:32d445ce20d25c60ab92153c073942b0bac9815bfbfd152ce3dcc225d15ce988", size = 19108, upload-time = "2024-10-08T14:21:43.596Z" }, - { url = "https://files.pythonhosted.org/packages/3d/40/27f5738fbd50b78dcc0682c14417eac5a49ccf430525dd0c5a058be125a2/time_machine-2.16.0-cp313-cp313-win_amd64.whl", hash = "sha256:f6927dda86425f97ffda36131f297b1a601c64a6ee6838bfa0e6d3149c2f0d9f", size = 19935, upload-time = "2024-10-08T14:21:45.277Z" }, - { url = "https://files.pythonhosted.org/packages/35/75/c4d8b2f0fe7dac22854d88a9c509d428e78ac4bf284bc54cfe83f75cc13b/time_machine-2.16.0-cp313-cp313-win_arm64.whl", hash = "sha256:4d3843143c46dddca6491a954bbd0abfd435681512ac343169560e9bab504129", size = 18047, upload-time = "2024-10-08T14:21:46.261Z" }, - { url = "https://files.pythonhosted.org/packages/df/aa/6d4925b22f3f5f53e2bcb12923f2463cac8c7c2360ac55196d51546787a5/time_machine-2.16.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:23c5283c01b4f80b7dfbc88f3d8088c06c301b94b7c35366be498c2d7b308549", size = 20490, upload-time = "2024-10-08T14:21:47.248Z" }, - { url = "https://files.pythonhosted.org/packages/b9/58/2bd28329c3c47de58c9234d177e809bed29d9e54729da79b5d0d8bc47e5e/time_machine-2.16.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ac95ae4529d7d85b251f9cf0f961a8a408ba285875811268f469d824a3b0b15a", size = 16753, upload-time = "2024-10-08T14:21:48.197Z" }, - { url = "https://files.pythonhosted.org/packages/c3/47/c8d388d6e061be146cf357bce727221f1d1d60dff2a36b880cb26e1a3199/time_machine-2.16.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dfb76674db946a74f0ca6e3b81caa8265e35dafe9b7005c7d2b8dd5bbd3825cf", size = 34228, upload-time = "2024-10-08T14:21:49.171Z" }, - { url = "https://files.pythonhosted.org/packages/d2/be/b0fb8693f2e9dfb5b50c5a89bb1d6ff8d4705075722b7987c0f1e18c6694/time_machine-2.16.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d0b6ff3ccde9b16bbc694a2b5facf2d8890554f3135ff626ed1429e270e3cc4f", size = 32250, upload-time = "2024-10-08T14:21:50.842Z" }, - { url = "https://files.pythonhosted.org/packages/6a/bc/e827239b0020195f4e2fa4e7fdf248838bb49230be2bf374181fac892a92/time_machine-2.16.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c1906ec6e26e6b803cd6aab28d420c87285b9c209ff2a69f82d12f82278f78bb", size = 34066, upload-time = "2024-10-08T14:21:51.815Z" }, - { url = "https://files.pythonhosted.org/packages/39/a9/c962c702b94ca4c7fd8264bc9baed431bd92d4ee2aa698dd92ff6e864164/time_machine-2.16.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:e46bd09c944ec7a20868abd2b83d7d7abdaf427775e9df3089b9226a122b340f", size = 33799, upload-time = "2024-10-08T14:21:52.813Z" }, - { url = "https://files.pythonhosted.org/packages/34/5f/91df8e8465a2d5a168c25eebf5a62d813f30e01909c32749dbbd442b66db/time_machine-2.16.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:cac3e2b4101db296b150cb665e5461c03621e6ede6117fc9d5048c0ec96d6e7c", size = 32076, upload-time = "2024-10-08T14:21:53.79Z" }, - { url = "https://files.pythonhosted.org/packages/04/45/bcc3304b545a15f614ecb12b277ec8d93fe0f67fa74e9e4b856e4ecba4c6/time_machine-2.16.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:1e0dcc97cfec12ae306e3036746e7631cc7ef65c31889f7264c25217d4938367", size = 33460, upload-time = "2024-10-08T14:21:54.797Z" }, - { url = "https://files.pythonhosted.org/packages/96/2c/9f14cd6fb912995e9984e67b8160071e8950cd7b0a787796d58b45324269/time_machine-2.16.0-cp39-cp39-win32.whl", hash = "sha256:c761d32d0c5d1fe5b71ac502e1bd5edec4598a7fc6f607b9b906b98e911148ce", size = 19133, upload-time = "2024-10-08T14:21:55.816Z" }, - { url = "https://files.pythonhosted.org/packages/63/0b/95bfa4a2b3a893d91de8304d98edbeb4e29b864977ef36929aa6eda1357f/time_machine-2.16.0-cp39-cp39-win_amd64.whl", hash = "sha256:ddfab1c622342f2945942c5c2d6be327656980e8f2d2b2ce0c022d0aa3711361", size = 19989, upload-time = "2024-10-08T14:21:57.59Z" }, - { url = "https://files.pythonhosted.org/packages/30/36/470c7d77d3a5c7e6a5e29ac40495b8dd3b66f3058ab8bdc823706fec1353/time_machine-2.16.0-cp39-cp39-win_arm64.whl", hash = "sha256:2e08a4015d5d1aab2cb46c780e85b33efcd5cbe880bb363b282a6972e617b8bb", size = 18106, upload-time = "2024-10-08T14:21:58.6Z" }, + { url = "https://files.pythonhosted.org/packages/0a/c9/0aaa082d6b5c489c22d9db025cbf17016062e953f70a7678d76b520f274f/time_machine-3.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e867178cc87490c578534832c29f048cc954b32a01681237e52ccda704baece5", size = 19046, upload-time = "2025-11-21T13:54:53.273Z" }, + { url = "https://files.pythonhosted.org/packages/30/0d/e825251028c68822a63478c7e44a0dca640daedb15f685a9a3973edf8ae8/time_machine-3.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5d4d4b944e0197c7726844f452fcb3dc17991165e9b4fab779e505b095bb7363", size = 15027, upload-time = "2025-11-21T13:54:54.474Z" }, + { url = "https://files.pythonhosted.org/packages/01/ee/d1e041f85787b835ed70bc7c31000a03d197f831490304f2527e9b840507/time_machine-3.1.0-cp310-cp310-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:9fc81014e6fc989b833e8cae3684b78b1e1f7c0d867c2fbfea785385a806ea6b", size = 32548, upload-time = "2025-11-21T13:54:55.868Z" }, + { url = "https://files.pythonhosted.org/packages/50/c0/12fc339c054e0db1da79c476bb1c3cc0b8796789e90eb8687af96bbdde9b/time_machine-3.1.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:aebd2a55f860b1ef28a2c1efe81454a6fa110ec1a6517c011760132f3cbf35fa", size = 34150, upload-time = "2025-11-21T13:54:56.955Z" }, + { url = "https://files.pythonhosted.org/packages/84/ab/40a2d31d4f742e41fc7f3703da672bbc25b505df3e7ab5df6c11a39e435e/time_machine-3.1.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:02e8018629e12e8064fee4f8fbbb8ae353f5907051965b5721ef189aeb7f833c", size = 35694, upload-time = "2025-11-21T13:54:58.053Z" }, + { url = "https://files.pythonhosted.org/packages/6f/1f/f31b604cb72af2c89311e8152bfe4e64a890785daeb19939bb841ed4cb77/time_machine-3.1.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:2fbbcf9de9a1d3e94e8b6c41ac7e9da46948fbdf489dbc083ea6c28ed045a43a", size = 34500, upload-time = "2025-11-21T13:54:59.428Z" }, + { url = "https://files.pythonhosted.org/packages/4f/1d/dca59c5d54dd0777b342fa708ffb24e0c595b8c47106300bc154dbaa8d98/time_machine-3.1.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:358f0feead47ee74c7747cb5b7f73582cbde1c033c20f9350e58ab4389aa59ff", size = 32605, upload-time = "2025-11-21T13:55:00.877Z" }, + { url = "https://files.pythonhosted.org/packages/f0/af/033b7b29c9364f05e99b4f35152574edc21b2f038589dafd60a60945a017/time_machine-3.1.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:f6d3f9e531127306610433fe62368b9e14621e336da2042d062565d655d97a02", size = 33699, upload-time = "2025-11-21T13:55:02.287Z" }, + { url = "https://files.pythonhosted.org/packages/4e/92/782c75e9f958e2cb33ba30f9a7adeb819811626eb3193e5ade4343ef197d/time_machine-3.1.0-cp310-cp310-win32.whl", hash = "sha256:bd4b4279938472ea18e5580330c10f8d49b8aec34e0df71be46e3be3b0f03f1d", size = 17054, upload-time = "2025-11-21T13:55:04.036Z" }, + { url = "https://files.pythonhosted.org/packages/ce/e6/cbdb32a72d2e122646cd3c62aed47dcddb366196798caa39043985d4e11d/time_machine-3.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:10a0d18b65af008e1cb60e0cc57594e67d3bbfee07204879f0e5864223dfd899", size = 17898, upload-time = "2025-11-21T13:55:05.069Z" }, + { url = "https://files.pythonhosted.org/packages/1f/d2/3663703fc694b07241673391c267629f881d4c025c392d7df09161031ac7/time_machine-3.1.0-cp310-cp310-win_arm64.whl", hash = "sha256:53702d6e594fc395b66517bc75c3d2ad8bfbff1f693d09bb67f8178cdfd21cd5", size = 16630, upload-time = "2025-11-21T13:55:06.178Z" }, + { url = "https://files.pythonhosted.org/packages/67/2b/9f5cea745e6c704cbbd1b6c36e0c73ca3204160e9c79234d66f140b326f6/time_machine-3.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:3b205f91d3907f6bd1747fe5484a3ed931e121e51fec32e4d6a8ee6eb41c37c3", size = 18741, upload-time = "2025-11-21T13:55:07.288Z" }, + { url = "https://files.pythonhosted.org/packages/76/17/7b5d94a119883b56b446980387e8ab83f37037db01696cf236cbc85807dc/time_machine-3.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:7004f2fd396b6d40cbf7c21df82f838445d899a3ed2ecc5b1fb67eea7e3d2fa8", size = 14865, upload-time = "2025-11-21T13:55:08.304Z" }, + { url = "https://files.pythonhosted.org/packages/2c/1e/a6ff6587d520ac20bf7414faf8f53cf094dd9fe450acf3b0c85e0b332c8a/time_machine-3.1.0-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:68c35b3450c27cf0087c90ae872ab41ec8097b76b5fb6b07321fc5873e78f152", size = 30643, upload-time = "2025-11-21T13:55:09.8Z" }, + { url = "https://files.pythonhosted.org/packages/45/50/dcf4272d7f9a4690d9edd983b5690efa8df3cc7671ade9bcf3439adac278/time_machine-3.1.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:2e28aed9da0182c10cb0344aa06fac585f394768c7d088bee781ad2779ea6fe0", size = 32226, upload-time = "2025-11-21T13:55:10.927Z" }, + { url = "https://files.pythonhosted.org/packages/dc/7c/b719ae736568b3f2c9bf8d3bc65bada96b04c9241c628fcb5ab0724a6928/time_machine-3.1.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9d7faced22388578dbed3b4be0603eb00f709857cd57b7b9738cd81fbaf326a9", size = 33883, upload-time = "2025-11-21T13:55:12.32Z" }, + { url = "https://files.pythonhosted.org/packages/e5/5c/f433fe44eadecfe21e4f2bf128d240c15d295592c877490a475960644281/time_machine-3.1.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:2e8a78dd7afc3a081e208e0b8d1a8105cff95d96e4f79da746afdf05fb822e7a", size = 32769, upload-time = "2025-11-21T13:55:13.541Z" }, + { url = "https://files.pythonhosted.org/packages/09/0f/fbc0e1437801315d4bdd8c21f9ef0c51f005a327ab0289ca034658fe78a1/time_machine-3.1.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8b9dce925dae420d6b66dec4cae00785260dbededec5c89eaedbfba99a2be55b", size = 30765, upload-time = "2025-11-21T13:55:14.706Z" }, + { url = "https://files.pythonhosted.org/packages/3f/c0/87d23d5817d95ed07fe272bb7a5de91177bb18274718d318c73a4aa0a4c2/time_machine-3.1.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:17f0d30a05073cdee68162779870eadf5e7f091bc94ae96d90d8fddbb8020714", size = 31885, upload-time = "2025-11-21T13:55:16.56Z" }, + { url = "https://files.pythonhosted.org/packages/4f/d7/572e38dadab9efe6ec4fff6e063f488866121dc384873d5b04fc5855ca83/time_machine-3.1.0-cp311-cp311-win32.whl", hash = "sha256:9e836e4fa8cb58de80de863335f4566f896b4dcd69d8a400d705857ca8301872", size = 16935, upload-time = "2025-11-21T13:55:17.612Z" }, + { url = "https://files.pythonhosted.org/packages/00/a6/edc968e1429a14d28676adb596f42570aa42def63014ccd3ccaf8d279d43/time_machine-3.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:1d652f85cbd2fd41e4262c27515023cc216589ca0b4aebab458972cce8119cc1", size = 17779, upload-time = "2025-11-21T13:55:18.668Z" }, + { url = "https://files.pythonhosted.org/packages/a0/97/2025eea7792f1be50777d85a2e2974d4416698c0002c419a61fcc6222de8/time_machine-3.1.0-cp311-cp311-win_arm64.whl", hash = "sha256:4be520b8ed752e788f57f72617f12b5bf5103e3db2b062e69b82e7f7f2977c4f", size = 16496, upload-time = "2025-11-21T13:55:19.753Z" }, + { url = "https://files.pythonhosted.org/packages/39/3d/412015d3e2f682548b7222367aa8d7b91d323145234d216847bc56c2d720/time_machine-3.1.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:d3d6606ae81a29c925452f8b56115936aeda34c0a25d40af53cf1b29c66235ef", size = 18851, upload-time = "2025-11-21T13:55:21Z" }, + { url = "https://files.pythonhosted.org/packages/33/98/48f60552570d6d66773dcfbc1d7b8fb305d3e9ae0694dd249f1ae0bc3b77/time_machine-3.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:0265df307778104c44d9114b55246a5b99da03f1dcb791305f9af21b0389ef7b", size = 14955, upload-time = "2025-11-21T13:55:22.408Z" }, + { url = "https://files.pythonhosted.org/packages/4d/7a/6fd1c47d3a1d87919d38f85c12db8f838298acb4ca3d6908f3288bcea0fd/time_machine-3.1.0-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:098da08900bdf6c6bd44b36ec06afd5b92c7a7140cd48c8686a79b6c6fef9da7", size = 32622, upload-time = "2025-11-21T13:55:23.541Z" }, + { url = "https://files.pythonhosted.org/packages/64/74/01641bd3d5f8c4f22710b7070d1dbeaeb501e8549e37419fc8b995bead32/time_machine-3.1.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:092f2e7a2526a02fcbd9c0a4165e0790350a13da4b01b6306b82e9580d83ae69", size = 34172, upload-time = "2025-11-21T13:55:24.638Z" }, + { url = "https://files.pythonhosted.org/packages/35/df/91f39b8bfe42c67dd3e66d8d2baa2c1b10126cc6e217fb3c7b1e777804c5/time_machine-3.1.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b64b6cada6dd2433cdaeda53dd940bdd579e40a8c92c5379527694570bb58b97", size = 35554, upload-time = "2025-11-21T13:55:25.841Z" }, + { url = "https://files.pythonhosted.org/packages/b0/6c/236434de77561003429e90300327b5ac6a6eeaa6d6c967282d28d1983232/time_machine-3.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2776e3300ef499541f9081b4a03ff1b3e7681e51a594572e1bf191773504bd21", size = 34261, upload-time = "2025-11-21T13:55:27.715Z" }, + { url = "https://files.pythonhosted.org/packages/97/76/32eea75715aefbd7ccfeea70285bb5400ecebd8dc3524b9c3491115e2504/time_machine-3.1.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:86e10914592a95e35edeb081975b6527919300bd1b65c04ee7f765db7bf2c1ad", size = 32485, upload-time = "2025-11-21T13:55:29.55Z" }, + { url = "https://files.pythonhosted.org/packages/b0/1b/91c529de2d2c6d7097692b4ae620cbe30bf24a4609d737b5f41d91a77bb0/time_machine-3.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c1362a6672252fb0d79da492dcf75eb7369b37fe595946ee3c2848df2fcc22e7", size = 33674, upload-time = "2025-11-21T13:55:30.636Z" }, + { url = "https://files.pythonhosted.org/packages/d6/af/345dfab6543e79151867daabbc4f4788ee10e408b8bd1361d066d0fea932/time_machine-3.1.0-cp312-cp312-win32.whl", hash = "sha256:50773648c69960e6e8497077875427aeb484d6a57a06399502cc125e349fca19", size = 16962, upload-time = "2025-11-21T13:55:31.73Z" }, + { url = "https://files.pythonhosted.org/packages/7c/9d/79a4ebed58d78cad85a5fc5c4ed4558d4d018d8a2bb7858ea02704b49be7/time_machine-3.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:20e0974e58a40a626d353d6132b7595de3fcb8deb72da4a762071b315cc95f6f", size = 17723, upload-time = "2025-11-21T13:55:32.76Z" }, + { url = "https://files.pythonhosted.org/packages/9a/a2/dd405133427dc47afd95618c3519854147408ed05deb209ba1b6b704689b/time_machine-3.1.0-cp312-cp312-win_arm64.whl", hash = "sha256:da9bced71b5966312f13c423b5b124649f1b08a9400d95018eb6d23311b384b9", size = 16520, upload-time = "2025-11-21T13:55:33.972Z" }, + { url = "https://files.pythonhosted.org/packages/c7/27/8af0187b4f7c574d7c4d7e86dbaece47ac92666fda8717c787849bc48560/time_machine-3.1.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:99d91fc0d4d91be1e1ea92389e1e93b0f43bf60433409616cb43de69be6505a8", size = 18911, upload-time = "2025-11-21T13:55:35.056Z" }, + { url = "https://files.pythonhosted.org/packages/92/35/a948a07659d471be160c8500c2e82ca0576a067d52d86ebe7ef24ea8e141/time_machine-3.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:ff18d291b7e681af3dc2f069a182a367baee510ab9800120a487a01d2ec929a9", size = 14983, upload-time = "2025-11-21T13:55:36.414Z" }, + { url = "https://files.pythonhosted.org/packages/4a/8c/0cc16dd1d058580c00ffa685401756bd6170efe4434d418b724e96e3a0ac/time_machine-3.1.0-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:8fedc78cab733dfe1afeec09bd841aea314249b316eb02f17ad2e617c400fa4d", size = 32709, upload-time = "2025-11-21T13:55:37.628Z" }, + { url = "https://files.pythonhosted.org/packages/20/34/f2f162c67854be20c34ed9c49474b6abd6427108b98c3452533e60ba2526/time_machine-3.1.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:62bb78376c4a13a0463b71bc9ffd81d9e3e6ed9efdbe500716d9c51ae5a2a60c", size = 34299, upload-time = "2025-11-21T13:55:38.999Z" }, + { url = "https://files.pythonhosted.org/packages/8b/2c/314fe33e24bbc46837643d5add7a9843c7cbd4b66f355a94e98c700ddcac/time_machine-3.1.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bc750d300bd8794a0581360632e20dd5896d21b5c1c6b74c7c01c72bebd65df2", size = 35699, upload-time = "2025-11-21T13:55:40.493Z" }, + { url = "https://files.pythonhosted.org/packages/ac/28/c2f5d93024ef712897352e3fb801425325adfb3b2c33d3ba7838c8ea5941/time_machine-3.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:d23623c3223318cb4b43ad07e10b682821c59b6ab99cce3d9db0f80bc2206ead", size = 34359, upload-time = "2025-11-21T13:55:41.672Z" }, + { url = "https://files.pythonhosted.org/packages/25/c6/67a6abd6ab75a6c16275cd8b5bf13053f33fac1de83a5b8e569685d37005/time_machine-3.1.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:48a4ad44202dcafd302310739e086374c8e928d6604bb5812b1f5e755dbcd5e1", size = 32604, upload-time = "2025-11-21T13:55:42.878Z" }, + { url = "https://files.pythonhosted.org/packages/13/c7/1277ebfbcfaea02bbf01a69beac821a6543e1829a47bda52a020b3509ba2/time_machine-3.1.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8b6f8572c1e674d5ae43882ee9f39a03cea86c31cf9904ff3767905d41fc5e5a", size = 33779, upload-time = "2025-11-21T13:55:44.057Z" }, + { url = "https://files.pythonhosted.org/packages/6b/39/773a7456222b391e2f0bc6d049e00d99ea78b1e226b8b36c261e1235f36d/time_machine-3.1.0-cp313-cp313-win32.whl", hash = "sha256:8743edd11d3e2cb2d0244d4e83d96873fd96a375ba75364399f2f64fd95c7ec4", size = 16984, upload-time = "2025-11-21T13:55:45.144Z" }, + { url = "https://files.pythonhosted.org/packages/e9/95/94b9a839586eae1e3afcd575d1dabf81929e44e3886ad6d94deb5e2d5bda/time_machine-3.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:3a99c68a1cc962f76709c2b67efdcf4c97c9ad4a950f694cccb413ab378f9d94", size = 17727, upload-time = "2025-11-21T13:55:46.524Z" }, + { url = "https://files.pythonhosted.org/packages/1f/fd/f1fb569e8c7547c983b4e3259ee40684b0c4fdc882f36864d5eb05d71f72/time_machine-3.1.0-cp313-cp313-win_arm64.whl", hash = "sha256:7be2af8b69892615d897b2c6b546093e45dba7d9cde6af64c17f1e5da4f38dbc", size = 16558, upload-time = "2025-11-21T13:55:47.922Z" }, + { url = "https://files.pythonhosted.org/packages/e9/15/ccb1178e3a0988c320075285fe7b5ab26e51b71b2e5e14eee7158bd04dd6/time_machine-3.1.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:56938d4a24435014d3d9141415aee81699cf1a5419462a24357c7e3181c67f06", size = 19593, upload-time = "2025-11-21T13:55:50.114Z" }, + { url = "https://files.pythonhosted.org/packages/6a/9e/495e1ae27227cc3fc20f5d9e9011c14a3bda515f0c98630b0d0e2c444c4a/time_machine-3.1.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:ecdd9b98305cecfbff29ad9b663f38cbcf728ff023dc1db63cc94bd439890da5", size = 15252, upload-time = "2025-11-21T13:55:51.213Z" }, + { url = "https://files.pythonhosted.org/packages/d6/03/c905659d81c6b071cd8f2a6a6a23b1e25cd2a498167125b95e543fea7cec/time_machine-3.1.0-cp313-cp313t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:e5f0dc8ba33fcd624d11dc4029fa3fd1712f96660ddc629ce61097c71d8f6400", size = 38810, upload-time = "2025-11-21T13:55:52.379Z" }, + { url = "https://files.pythonhosted.org/packages/42/26/393277a6f07472cdb56ee2d8e34f0bdc203f64c8857180b73c4ba9cf0d91/time_machine-3.1.0-cp313-cp313t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:812aad79acf4b3471d997d29a5e7010f0a914740b1fe5b6cefb81b462cb28824", size = 40358, upload-time = "2025-11-21T13:55:54.077Z" }, + { url = "https://files.pythonhosted.org/packages/86/70/0cc738ba7fdaf8d29acd128a124be00c781b33e3ea84f34211f5a2cff4c2/time_machine-3.1.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5b0218aa05865a16c000320cfdac921d0e02992ef51e711325bc366bacdc4aeb", size = 43118, upload-time = "2025-11-21T13:55:55.616Z" }, + { url = "https://files.pythonhosted.org/packages/dc/5a/6c42a046abfcb8996ef3239bbc1cfd7c0051dea166a0f9f01923d1eb1848/time_machine-3.1.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:3544ab394f4149e8884996f1c5047d52dbb08bb2396109c530eee6ecffd6f4c4", size = 41321, upload-time = "2025-11-21T13:55:56.869Z" }, + { url = "https://files.pythonhosted.org/packages/36/3e/1123a93add930d4933ca4f1c3441f1832eba6b9e1b41b9ca3a5d3f9203c7/time_machine-3.1.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:acf41d44e526cae2f62c9c6ac95daef42bdbd7d95bdb3bb60e071b4b61110723", size = 38547, upload-time = "2025-11-21T13:55:58.065Z" }, + { url = "https://files.pythonhosted.org/packages/d1/c8/c98855aa75a6bc49c352e00396e545353db3e5d7c65a6eefca76366d9aac/time_machine-3.1.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:bb7031a367209c223c41ab625172b38362e0ce07f13f1f1e7d75d5194fcdd0d7", size = 39421, upload-time = "2025-11-21T13:55:59.224Z" }, + { url = "https://files.pythonhosted.org/packages/aa/94/f1520be4f125489a9d327848048688c2c13c5705770b98caac63e35cc204/time_machine-3.1.0-cp313-cp313t-win32.whl", hash = "sha256:ecf49c418f854f42171b4f0859906a26ff56d73303dee2e83beb307747e11db1", size = 17436, upload-time = "2025-11-21T13:56:00.395Z" }, + { url = "https://files.pythonhosted.org/packages/be/2f/79e13c341b20e8ceb1629fb2e1ae36063c9dee42f3886be44a54867ad0dc/time_machine-3.1.0-cp313-cp313t-win_amd64.whl", hash = "sha256:ee93cf4c11452bf8211bf12a926d6f5179c241558f6af30c2de2669bf26ba1c1", size = 18505, upload-time = "2025-11-21T13:56:01.54Z" }, + { url = "https://files.pythonhosted.org/packages/72/42/0cdb0b67d44ebfa47f4dbecb65d25522312ee772f59c4d63a0df0c895f34/time_machine-3.1.0-cp313-cp313t-win_arm64.whl", hash = "sha256:9c317eebaa0578a370a29f40152db0ac00bd34b387b54c95bf01fd123bca178d", size = 16852, upload-time = "2025-11-21T13:56:02.977Z" }, + { url = "https://files.pythonhosted.org/packages/f0/14/2f9b4c6ae63662827c48d81c445fedeba4733248a56640747c8e5be55870/time_machine-3.1.0-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:2b07055e5327e04d725557a07a69523d14d2d897877d90781b9c27c70bd8997c", size = 18899, upload-time = "2025-11-21T13:56:04.186Z" }, + { url = "https://files.pythonhosted.org/packages/6a/c2/09a91825ea60413316ece41e448d275a9a4b719bc92b35b6166013dc01bb/time_machine-3.1.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:b71948998e3f709bda9b600b0d250bb4ad677b28fac32475b6093aa5b9e8969f", size = 15027, upload-time = "2025-11-21T13:56:05.299Z" }, + { url = "https://files.pythonhosted.org/packages/f5/65/b737258b39b98406a3ed681cdc025fa788441221c5d24a59897a4752e413/time_machine-3.1.0-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:343dfb0663ccb1e5d5dc6dfb651b7b7233985c73b3a3f6af0fe58c9cf5b0f4ab", size = 32798, upload-time = "2025-11-21T13:56:06.521Z" }, + { url = "https://files.pythonhosted.org/packages/e6/e0/063edd2188a5c7e8f4b1a184dc9e87de955dcfd5cd8f706131739ff0685c/time_machine-3.1.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:3df9b834ec2ee8536a398c15c70f5d54dfe3bbb34344f6549ba29acf80916948", size = 34385, upload-time = "2025-11-21T13:56:07.719Z" }, + { url = "https://files.pythonhosted.org/packages/84/e8/ead05dc304f973b01443829367be3c504f3ff86c394a3fec932c4d720f3f/time_machine-3.1.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9e1ee0725a016f69fa8f0f37d793ba6d2d3870b32e164650a6922caf065f2ce2", size = 35781, upload-time = "2025-11-21T13:56:08.931Z" }, + { url = "https://files.pythonhosted.org/packages/1b/5e/23303d6b13482436d6c37015d17142821adf8e47c1104c0a4c5fc0bdb173/time_machine-3.1.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ed552f135efabca895e678044ce1dbb693e6a399003606e9d6a413b2eaf48a51", size = 34447, upload-time = "2025-11-21T13:56:10.468Z" }, + { url = "https://files.pythonhosted.org/packages/30/be/5ace5c8e2dc0b6899c3e18ebf4301211a50e1addfcbecbf61a100a76ac03/time_machine-3.1.0-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:c93451242de81fe2a96f699dad97aa463250688b10d2e8a72e98208df9bd62b1", size = 32814, upload-time = "2025-11-21T13:56:12.072Z" }, + { url = "https://files.pythonhosted.org/packages/40/cb/b0212b98e422fbb08f7328aabe0c6f59e853146eb61337df8f497dd4a2ad/time_machine-3.1.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:010c2dd1f084eae4687021f7b7fd798abc7a8472f2e783919aafe7b8fe624c8b", size = 33864, upload-time = "2025-11-21T13:56:13.28Z" }, + { url = "https://files.pythonhosted.org/packages/28/53/08ad68c1971257ee0c9b9ec38b1f2ef88ae7565e0c7eb272f9ca3ff40152/time_machine-3.1.0-cp314-cp314-win32.whl", hash = "sha256:9b8e24de4ba47401dcec53733d98db9678a708f6bafb77a64e46636304eca64c", size = 17127, upload-time = "2025-11-21T13:56:14.414Z" }, + { url = "https://files.pythonhosted.org/packages/0c/36/95d5b7fff7e1506f9f4a481df3b17ebae0f3ab4a36669e6a93890df1da5f/time_machine-3.1.0-cp314-cp314-win_amd64.whl", hash = "sha256:6873c903c8de85884655afc49c8465136ea5d6c7500ad2bea31601cf6a48939f", size = 18006, upload-time = "2025-11-21T13:56:15.575Z" }, + { url = "https://files.pythonhosted.org/packages/d2/c8/b30211e36117b4436368927e46dcf1f785626069b11a12cc3ea150337136/time_machine-3.1.0-cp314-cp314-win_arm64.whl", hash = "sha256:9a74b2da34e7e6aaa2db011556f40f8ea26e89a3a1683ffad43ceca1789b8af0", size = 16633, upload-time = "2025-11-21T13:56:16.706Z" }, + { url = "https://files.pythonhosted.org/packages/fe/3d/eeb00cd285102e39cc4eeeb4e78cc1fcff8a89691bdc6a708d4c40fe38cc/time_machine-3.1.0-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:0c688897189b50f0820e2916579c7e88aefef2a86cd17aa05b5b7a6676dbd97e", size = 19578, upload-time = "2025-11-21T13:56:17.853Z" }, + { url = "https://files.pythonhosted.org/packages/3e/91/30710e1883a4c39b1367ef469d6fd18c791bec4ee8783a19af9ac82bc632/time_machine-3.1.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:1715d221c4c49bd2a0bc73868d5543133ab15e02e0d9726d73d802ccf978e1c0", size = 15299, upload-time = "2025-11-21T13:56:18.955Z" }, + { url = "https://files.pythonhosted.org/packages/d4/7f/2311774df6d41dba3934494b6589195a726fec0753a4e8e8eba28e509327/time_machine-3.1.0-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:8cecc83df46ab1095f93ff42dceaddb313e12efd9135cd153d0021a98b570390", size = 38801, upload-time = "2025-11-21T13:56:20.357Z" }, + { url = "https://files.pythonhosted.org/packages/1b/74/5af7e7af3787333c927d860476b505ec8770412e2bb1ba4e2d00a3aa644a/time_machine-3.1.0-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:be63019454e0e30138bfe414f3dd5f626d32b8a265ea99bdc4b107867b68128a", size = 40357, upload-time = "2025-11-21T13:56:21.971Z" }, + { url = "https://files.pythonhosted.org/packages/10/1a/ebcecff1e57f52788989f0734a57eab5e045c9784cfd998040b8ba280f5b/time_machine-3.1.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ac1245d6a4a4ac40e308362e4236c1aad6ead836c97576c7e29167752a5283d0", size = 43101, upload-time = "2025-11-21T13:56:23.555Z" }, + { url = "https://files.pythonhosted.org/packages/99/b3/63883e2d8555358469da098dd1568ec8f6c9b6d7317796cfbf8bc5c59ab2/time_machine-3.1.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:9fde90d14b13396ecaa5ce2366f788f7c01b7bf4ac4246b798c622bc6369b861", size = 41305, upload-time = "2025-11-21T13:56:24.831Z" }, + { url = "https://files.pythonhosted.org/packages/04/a3/d7851676cf7a5d5451b73f271b6b7229688f403488a8dd111b5fe5fde7cf/time_machine-3.1.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:15d83cc338d02dc6e674e24ce40a8c311d75191c86014b0be455a4267f27f00e", size = 38534, upload-time = "2025-11-21T13:56:26.032Z" }, + { url = "https://files.pythonhosted.org/packages/13/dc/ced9245bc633f0c4790a57b3c6089a586f0a208b50f8ec7d001bf8254d49/time_machine-3.1.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:cbbd90494a9bc6626e3180594246cb9557418e32f2cb2c40edf8526a182f5e31", size = 39430, upload-time = "2025-11-21T13:56:28.83Z" }, + { url = "https://files.pythonhosted.org/packages/67/24/bb20ff76ed4e8e09ab65910bf21a315dc7562c8be92250363b25f3ab1dd1/time_machine-3.1.0-cp314-cp314t-win32.whl", hash = "sha256:6c00758d155601d710fa036c8d24d5ad3fb28531933cf70343006cf2be93092a", size = 17674, upload-time = "2025-11-21T13:56:29.969Z" }, + { url = "https://files.pythonhosted.org/packages/2e/64/42573a6da9298efd68a831d4e9eabc8c9c0cac9305bc19bb24a4066bbba0/time_machine-3.1.0-cp314-cp314t-win_amd64.whl", hash = "sha256:e00239b54b05255862e0965e6ae67728e467727ca7dc23d9a6c5a51c7b5b01c8", size = 18792, upload-time = "2025-11-21T13:56:31.123Z" }, + { url = "https://files.pythonhosted.org/packages/35/10/09ad4e5ccc27224ed8377a6f3d191034242c404d0c1ad5f119d79fb18363/time_machine-3.1.0-cp314-cp314t-win_arm64.whl", hash = "sha256:8b47da89595dc3c7f0b52f1e3f3f8da8325037f3746e66d74bebac9f42f2a989", size = 16944, upload-time = "2025-11-21T13:56:32.254Z" }, ] [[package]] name = "tomli" -version = "2.2.1" +version = "2.3.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/18/87/302344fed471e44a87289cf4967697d07e532f2421fdaf868a303cbae4ff/tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff", size = 17175, upload-time = "2024-11-27T22:38:36.873Z" } +sdist = { url = "https://files.pythonhosted.org/packages/52/ed/3f73f72945444548f33eba9a87fc7a6e969915e7b1acc8260b30e1f76a2f/tomli-2.3.0.tar.gz", hash = "sha256:64be704a875d2a59753d80ee8a533c3fe183e3f06807ff7dc2232938ccb01549", size = 17392, upload-time = "2025-10-08T22:01:47.119Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/43/ca/75707e6efa2b37c77dadb324ae7d9571cb424e61ea73fad7c56c2d14527f/tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249", size = 131077, upload-time = "2024-11-27T22:37:54.956Z" }, - { url = "https://files.pythonhosted.org/packages/c7/16/51ae563a8615d472fdbffc43a3f3d46588c264ac4f024f63f01283becfbb/tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6", size = 123429, upload-time = "2024-11-27T22:37:56.698Z" }, - { url = "https://files.pythonhosted.org/packages/f1/dd/4f6cd1e7b160041db83c694abc78e100473c15d54620083dbd5aae7b990e/tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a", size = 226067, upload-time = "2024-11-27T22:37:57.63Z" }, - { url = "https://files.pythonhosted.org/packages/a9/6b/c54ede5dc70d648cc6361eaf429304b02f2871a345bbdd51e993d6cdf550/tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee", size = 236030, upload-time = "2024-11-27T22:37:59.344Z" }, - { url = "https://files.pythonhosted.org/packages/1f/47/999514fa49cfaf7a92c805a86c3c43f4215621855d151b61c602abb38091/tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e", size = 240898, upload-time = "2024-11-27T22:38:00.429Z" }, - { url = "https://files.pythonhosted.org/packages/73/41/0a01279a7ae09ee1573b423318e7934674ce06eb33f50936655071d81a24/tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4", size = 229894, upload-time = "2024-11-27T22:38:02.094Z" }, - { url = "https://files.pythonhosted.org/packages/55/18/5d8bc5b0a0362311ce4d18830a5d28943667599a60d20118074ea1b01bb7/tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106", size = 245319, upload-time = "2024-11-27T22:38:03.206Z" }, - { url = "https://files.pythonhosted.org/packages/92/a3/7ade0576d17f3cdf5ff44d61390d4b3febb8a9fc2b480c75c47ea048c646/tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8", size = 238273, upload-time = "2024-11-27T22:38:04.217Z" }, - { url = "https://files.pythonhosted.org/packages/72/6f/fa64ef058ac1446a1e51110c375339b3ec6be245af9d14c87c4a6412dd32/tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff", size = 98310, upload-time = "2024-11-27T22:38:05.908Z" }, - { url = "https://files.pythonhosted.org/packages/6a/1c/4a2dcde4a51b81be3530565e92eda625d94dafb46dbeb15069df4caffc34/tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b", size = 108309, upload-time = "2024-11-27T22:38:06.812Z" }, - { url = "https://files.pythonhosted.org/packages/52/e1/f8af4c2fcde17500422858155aeb0d7e93477a0d59a98e56cbfe75070fd0/tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea", size = 132762, upload-time = "2024-11-27T22:38:07.731Z" }, - { url = "https://files.pythonhosted.org/packages/03/b8/152c68bb84fc00396b83e7bbddd5ec0bd3dd409db4195e2a9b3e398ad2e3/tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8", size = 123453, upload-time = "2024-11-27T22:38:09.384Z" }, - { url = "https://files.pythonhosted.org/packages/c8/d6/fc9267af9166f79ac528ff7e8c55c8181ded34eb4b0e93daa767b8841573/tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192", size = 233486, upload-time = "2024-11-27T22:38:10.329Z" }, - { url = "https://files.pythonhosted.org/packages/5c/51/51c3f2884d7bab89af25f678447ea7d297b53b5a3b5730a7cb2ef6069f07/tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222", size = 242349, upload-time = "2024-11-27T22:38:11.443Z" }, - { url = "https://files.pythonhosted.org/packages/ab/df/bfa89627d13a5cc22402e441e8a931ef2108403db390ff3345c05253935e/tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77", size = 252159, upload-time = "2024-11-27T22:38:13.099Z" }, - { url = "https://files.pythonhosted.org/packages/9e/6e/fa2b916dced65763a5168c6ccb91066f7639bdc88b48adda990db10c8c0b/tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6", size = 237243, upload-time = "2024-11-27T22:38:14.766Z" }, - { url = "https://files.pythonhosted.org/packages/b4/04/885d3b1f650e1153cbb93a6a9782c58a972b94ea4483ae4ac5cedd5e4a09/tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd", size = 259645, upload-time = "2024-11-27T22:38:15.843Z" }, - { url = "https://files.pythonhosted.org/packages/9c/de/6b432d66e986e501586da298e28ebeefd3edc2c780f3ad73d22566034239/tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e", size = 244584, upload-time = "2024-11-27T22:38:17.645Z" }, - { url = "https://files.pythonhosted.org/packages/1c/9a/47c0449b98e6e7d1be6cbac02f93dd79003234ddc4aaab6ba07a9a7482e2/tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98", size = 98875, upload-time = "2024-11-27T22:38:19.159Z" }, - { url = "https://files.pythonhosted.org/packages/ef/60/9b9638f081c6f1261e2688bd487625cd1e660d0a85bd469e91d8db969734/tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4", size = 109418, upload-time = "2024-11-27T22:38:20.064Z" }, - { url = "https://files.pythonhosted.org/packages/04/90/2ee5f2e0362cb8a0b6499dc44f4d7d48f8fff06d28ba46e6f1eaa61a1388/tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7", size = 132708, upload-time = "2024-11-27T22:38:21.659Z" }, - { url = "https://files.pythonhosted.org/packages/c0/ec/46b4108816de6b385141f082ba99e315501ccd0a2ea23db4a100dd3990ea/tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c", size = 123582, upload-time = "2024-11-27T22:38:22.693Z" }, - { url = "https://files.pythonhosted.org/packages/a0/bd/b470466d0137b37b68d24556c38a0cc819e8febe392d5b199dcd7f578365/tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13", size = 232543, upload-time = "2024-11-27T22:38:24.367Z" }, - { url = "https://files.pythonhosted.org/packages/d9/e5/82e80ff3b751373f7cead2815bcbe2d51c895b3c990686741a8e56ec42ab/tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281", size = 241691, upload-time = "2024-11-27T22:38:26.081Z" }, - { url = "https://files.pythonhosted.org/packages/05/7e/2a110bc2713557d6a1bfb06af23dd01e7dde52b6ee7dadc589868f9abfac/tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272", size = 251170, upload-time = "2024-11-27T22:38:27.921Z" }, - { url = "https://files.pythonhosted.org/packages/64/7b/22d713946efe00e0adbcdfd6d1aa119ae03fd0b60ebed51ebb3fa9f5a2e5/tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140", size = 236530, upload-time = "2024-11-27T22:38:29.591Z" }, - { url = "https://files.pythonhosted.org/packages/38/31/3a76f67da4b0cf37b742ca76beaf819dca0ebef26d78fc794a576e08accf/tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2", size = 258666, upload-time = "2024-11-27T22:38:30.639Z" }, - { url = "https://files.pythonhosted.org/packages/07/10/5af1293da642aded87e8a988753945d0cf7e00a9452d3911dd3bb354c9e2/tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744", size = 243954, upload-time = "2024-11-27T22:38:31.702Z" }, - { url = "https://files.pythonhosted.org/packages/5b/b9/1ed31d167be802da0fc95020d04cd27b7d7065cc6fbefdd2f9186f60d7bd/tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec", size = 98724, upload-time = "2024-11-27T22:38:32.837Z" }, - { url = "https://files.pythonhosted.org/packages/c7/32/b0963458706accd9afcfeb867c0f9175a741bf7b19cd424230714d722198/tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69", size = 109383, upload-time = "2024-11-27T22:38:34.455Z" }, - { url = "https://files.pythonhosted.org/packages/6e/c2/61d3e0f47e2b74ef40a68b9e6ad5984f6241a942f7cd3bbfbdbd03861ea9/tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc", size = 14257, upload-time = "2024-11-27T22:38:35.385Z" }, + { url = "https://files.pythonhosted.org/packages/b3/2e/299f62b401438d5fe1624119c723f5d877acc86a4c2492da405626665f12/tomli-2.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:88bd15eb972f3664f5ed4b57c1634a97153b4bac4479dcb6a495f41921eb7f45", size = 153236, upload-time = "2025-10-08T22:01:00.137Z" }, + { url = "https://files.pythonhosted.org/packages/86/7f/d8fffe6a7aefdb61bced88fcb5e280cfd71e08939da5894161bd71bea022/tomli-2.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:883b1c0d6398a6a9d29b508c331fa56adbcdff647f6ace4dfca0f50e90dfd0ba", size = 148084, upload-time = "2025-10-08T22:01:01.63Z" }, + { url = "https://files.pythonhosted.org/packages/47/5c/24935fb6a2ee63e86d80e4d3b58b222dafaf438c416752c8b58537c8b89a/tomli-2.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d1381caf13ab9f300e30dd8feadb3de072aeb86f1d34a8569453ff32a7dea4bf", size = 234832, upload-time = "2025-10-08T22:01:02.543Z" }, + { url = "https://files.pythonhosted.org/packages/89/da/75dfd804fc11e6612846758a23f13271b76d577e299592b4371a4ca4cd09/tomli-2.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a0e285d2649b78c0d9027570d4da3425bdb49830a6156121360b3f8511ea3441", size = 242052, upload-time = "2025-10-08T22:01:03.836Z" }, + { url = "https://files.pythonhosted.org/packages/70/8c/f48ac899f7b3ca7eb13af73bacbc93aec37f9c954df3c08ad96991c8c373/tomli-2.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0a154a9ae14bfcf5d8917a59b51ffd5a3ac1fd149b71b47a3a104ca4edcfa845", size = 239555, upload-time = "2025-10-08T22:01:04.834Z" }, + { url = "https://files.pythonhosted.org/packages/ba/28/72f8afd73f1d0e7829bfc093f4cb98ce0a40ffc0cc997009ee1ed94ba705/tomli-2.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:74bf8464ff93e413514fefd2be591c3b0b23231a77f901db1eb30d6f712fc42c", size = 245128, upload-time = "2025-10-08T22:01:05.84Z" }, + { url = "https://files.pythonhosted.org/packages/b6/eb/a7679c8ac85208706d27436e8d421dfa39d4c914dcf5fa8083a9305f58d9/tomli-2.3.0-cp311-cp311-win32.whl", hash = "sha256:00b5f5d95bbfc7d12f91ad8c593a1659b6387b43f054104cda404be6bda62456", size = 96445, upload-time = "2025-10-08T22:01:06.896Z" }, + { url = "https://files.pythonhosted.org/packages/0a/fe/3d3420c4cb1ad9cb462fb52967080575f15898da97e21cb6f1361d505383/tomli-2.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:4dc4ce8483a5d429ab602f111a93a6ab1ed425eae3122032db7e9acf449451be", size = 107165, upload-time = "2025-10-08T22:01:08.107Z" }, + { url = "https://files.pythonhosted.org/packages/ff/b7/40f36368fcabc518bb11c8f06379a0fd631985046c038aca08c6d6a43c6e/tomli-2.3.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d7d86942e56ded512a594786a5ba0a5e521d02529b3826e7761a05138341a2ac", size = 154891, upload-time = "2025-10-08T22:01:09.082Z" }, + { url = "https://files.pythonhosted.org/packages/f9/3f/d9dd692199e3b3aab2e4e4dd948abd0f790d9ded8cd10cbaae276a898434/tomli-2.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:73ee0b47d4dad1c5e996e3cd33b8a76a50167ae5f96a2607cbe8cc773506ab22", size = 148796, upload-time = "2025-10-08T22:01:10.266Z" }, + { url = "https://files.pythonhosted.org/packages/60/83/59bff4996c2cf9f9387a0f5a3394629c7efa5ef16142076a23a90f1955fa/tomli-2.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:792262b94d5d0a466afb5bc63c7daa9d75520110971ee269152083270998316f", size = 242121, upload-time = "2025-10-08T22:01:11.332Z" }, + { url = "https://files.pythonhosted.org/packages/45/e5/7c5119ff39de8693d6baab6c0b6dcb556d192c165596e9fc231ea1052041/tomli-2.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4f195fe57ecceac95a66a75ac24d9d5fbc98ef0962e09b2eddec5d39375aae52", size = 250070, upload-time = "2025-10-08T22:01:12.498Z" }, + { url = "https://files.pythonhosted.org/packages/45/12/ad5126d3a278f27e6701abde51d342aa78d06e27ce2bb596a01f7709a5a2/tomli-2.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e31d432427dcbf4d86958c184b9bfd1e96b5b71f8eb17e6d02531f434fd335b8", size = 245859, upload-time = "2025-10-08T22:01:13.551Z" }, + { url = "https://files.pythonhosted.org/packages/fb/a1/4d6865da6a71c603cfe6ad0e6556c73c76548557a8d658f9e3b142df245f/tomli-2.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b0882799624980785240ab732537fcfc372601015c00f7fc367c55308c186f6", size = 250296, upload-time = "2025-10-08T22:01:14.614Z" }, + { url = "https://files.pythonhosted.org/packages/a0/b7/a7a7042715d55c9ba6e8b196d65d2cb662578b4d8cd17d882d45322b0d78/tomli-2.3.0-cp312-cp312-win32.whl", hash = "sha256:ff72b71b5d10d22ecb084d345fc26f42b5143c5533db5e2eaba7d2d335358876", size = 97124, upload-time = "2025-10-08T22:01:15.629Z" }, + { url = "https://files.pythonhosted.org/packages/06/1e/f22f100db15a68b520664eb3328fb0ae4e90530887928558112c8d1f4515/tomli-2.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:1cb4ed918939151a03f33d4242ccd0aa5f11b3547d0cf30f7c74a408a5b99878", size = 107698, upload-time = "2025-10-08T22:01:16.51Z" }, + { url = "https://files.pythonhosted.org/packages/89/48/06ee6eabe4fdd9ecd48bf488f4ac783844fd777f547b8d1b61c11939974e/tomli-2.3.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5192f562738228945d7b13d4930baffda67b69425a7f0da96d360b0a3888136b", size = 154819, upload-time = "2025-10-08T22:01:17.964Z" }, + { url = "https://files.pythonhosted.org/packages/f1/01/88793757d54d8937015c75dcdfb673c65471945f6be98e6a0410fba167ed/tomli-2.3.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:be71c93a63d738597996be9528f4abe628d1adf5e6eb11607bc8fe1a510b5dae", size = 148766, upload-time = "2025-10-08T22:01:18.959Z" }, + { url = "https://files.pythonhosted.org/packages/42/17/5e2c956f0144b812e7e107f94f1cc54af734eb17b5191c0bbfb72de5e93e/tomli-2.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c4665508bcbac83a31ff8ab08f424b665200c0e1e645d2bd9ab3d3e557b6185b", size = 240771, upload-time = "2025-10-08T22:01:20.106Z" }, + { url = "https://files.pythonhosted.org/packages/d5/f4/0fbd014909748706c01d16824eadb0307115f9562a15cbb012cd9b3512c5/tomli-2.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4021923f97266babc6ccab9f5068642a0095faa0a51a246a6a02fccbb3514eaf", size = 248586, upload-time = "2025-10-08T22:01:21.164Z" }, + { url = "https://files.pythonhosted.org/packages/30/77/fed85e114bde5e81ecf9bc5da0cc69f2914b38f4708c80ae67d0c10180c5/tomli-2.3.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4ea38c40145a357d513bffad0ed869f13c1773716cf71ccaa83b0fa0cc4e42f", size = 244792, upload-time = "2025-10-08T22:01:22.417Z" }, + { url = "https://files.pythonhosted.org/packages/55/92/afed3d497f7c186dc71e6ee6d4fcb0acfa5f7d0a1a2878f8beae379ae0cc/tomli-2.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ad805ea85eda330dbad64c7ea7a4556259665bdf9d2672f5dccc740eb9d3ca05", size = 248909, upload-time = "2025-10-08T22:01:23.859Z" }, + { url = "https://files.pythonhosted.org/packages/f8/84/ef50c51b5a9472e7265ce1ffc7f24cd4023d289e109f669bdb1553f6a7c2/tomli-2.3.0-cp313-cp313-win32.whl", hash = "sha256:97d5eec30149fd3294270e889b4234023f2c69747e555a27bd708828353ab606", size = 96946, upload-time = "2025-10-08T22:01:24.893Z" }, + { url = "https://files.pythonhosted.org/packages/b2/b7/718cd1da0884f281f95ccfa3a6cc572d30053cba64603f79d431d3c9b61b/tomli-2.3.0-cp313-cp313-win_amd64.whl", hash = "sha256:0c95ca56fbe89e065c6ead5b593ee64b84a26fca063b5d71a1122bf26e533999", size = 107705, upload-time = "2025-10-08T22:01:26.153Z" }, + { url = "https://files.pythonhosted.org/packages/19/94/aeafa14a52e16163008060506fcb6aa1949d13548d13752171a755c65611/tomli-2.3.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:cebc6fe843e0733ee827a282aca4999b596241195f43b4cc371d64fc6639da9e", size = 154244, upload-time = "2025-10-08T22:01:27.06Z" }, + { url = "https://files.pythonhosted.org/packages/db/e4/1e58409aa78eefa47ccd19779fc6f36787edbe7d4cd330eeeedb33a4515b/tomli-2.3.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4c2ef0244c75aba9355561272009d934953817c49f47d768070c3c94355c2aa3", size = 148637, upload-time = "2025-10-08T22:01:28.059Z" }, + { url = "https://files.pythonhosted.org/packages/26/b6/d1eccb62f665e44359226811064596dd6a366ea1f985839c566cd61525ae/tomli-2.3.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c22a8bf253bacc0cf11f35ad9808b6cb75ada2631c2d97c971122583b129afbc", size = 241925, upload-time = "2025-10-08T22:01:29.066Z" }, + { url = "https://files.pythonhosted.org/packages/70/91/7cdab9a03e6d3d2bb11beae108da5bdc1c34bdeb06e21163482544ddcc90/tomli-2.3.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0eea8cc5c5e9f89c9b90c4896a8deefc74f518db5927d0e0e8d4a80953d774d0", size = 249045, upload-time = "2025-10-08T22:01:31.98Z" }, + { url = "https://files.pythonhosted.org/packages/15/1b/8c26874ed1f6e4f1fcfeb868db8a794cbe9f227299402db58cfcc858766c/tomli-2.3.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:b74a0e59ec5d15127acdabd75ea17726ac4c5178ae51b85bfe39c4f8a278e879", size = 245835, upload-time = "2025-10-08T22:01:32.989Z" }, + { url = "https://files.pythonhosted.org/packages/fd/42/8e3c6a9a4b1a1360c1a2a39f0b972cef2cc9ebd56025168c4137192a9321/tomli-2.3.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b5870b50c9db823c595983571d1296a6ff3e1b88f734a4c8f6fc6188397de005", size = 253109, upload-time = "2025-10-08T22:01:34.052Z" }, + { url = "https://files.pythonhosted.org/packages/22/0c/b4da635000a71b5f80130937eeac12e686eefb376b8dee113b4a582bba42/tomli-2.3.0-cp314-cp314-win32.whl", hash = "sha256:feb0dacc61170ed7ab602d3d972a58f14ee3ee60494292d384649a3dc38ef463", size = 97930, upload-time = "2025-10-08T22:01:35.082Z" }, + { url = "https://files.pythonhosted.org/packages/b9/74/cb1abc870a418ae99cd5c9547d6bce30701a954e0e721821df483ef7223c/tomli-2.3.0-cp314-cp314-win_amd64.whl", hash = "sha256:b273fcbd7fc64dc3600c098e39136522650c49bca95df2d11cf3b626422392c8", size = 107964, upload-time = "2025-10-08T22:01:36.057Z" }, + { url = "https://files.pythonhosted.org/packages/54/78/5c46fff6432a712af9f792944f4fcd7067d8823157949f4e40c56b8b3c83/tomli-2.3.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:940d56ee0410fa17ee1f12b817b37a4d4e4dc4d27340863cc67236c74f582e77", size = 163065, upload-time = "2025-10-08T22:01:37.27Z" }, + { url = "https://files.pythonhosted.org/packages/39/67/f85d9bd23182f45eca8939cd2bc7050e1f90c41f4a2ecbbd5963a1d1c486/tomli-2.3.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f85209946d1fe94416debbb88d00eb92ce9cd5266775424ff81bc959e001acaf", size = 159088, upload-time = "2025-10-08T22:01:38.235Z" }, + { url = "https://files.pythonhosted.org/packages/26/5a/4b546a0405b9cc0659b399f12b6adb750757baf04250b148d3c5059fc4eb/tomli-2.3.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a56212bdcce682e56b0aaf79e869ba5d15a6163f88d5451cbde388d48b13f530", size = 268193, upload-time = "2025-10-08T22:01:39.712Z" }, + { url = "https://files.pythonhosted.org/packages/42/4f/2c12a72ae22cf7b59a7fe75b3465b7aba40ea9145d026ba41cb382075b0e/tomli-2.3.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c5f3ffd1e098dfc032d4d3af5c0ac64f6d286d98bc148698356847b80fa4de1b", size = 275488, upload-time = "2025-10-08T22:01:40.773Z" }, + { url = "https://files.pythonhosted.org/packages/92/04/a038d65dbe160c3aa5a624e93ad98111090f6804027d474ba9c37c8ae186/tomli-2.3.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5e01decd096b1530d97d5d85cb4dff4af2d8347bd35686654a004f8dea20fc67", size = 272669, upload-time = "2025-10-08T22:01:41.824Z" }, + { url = "https://files.pythonhosted.org/packages/be/2f/8b7c60a9d1612a7cbc39ffcca4f21a73bf368a80fc25bccf8253e2563267/tomli-2.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:8a35dd0e643bb2610f156cca8db95d213a90015c11fee76c946aa62b7ae7e02f", size = 279709, upload-time = "2025-10-08T22:01:43.177Z" }, + { url = "https://files.pythonhosted.org/packages/7e/46/cc36c679f09f27ded940281c38607716c86cf8ba4a518d524e349c8b4874/tomli-2.3.0-cp314-cp314t-win32.whl", hash = "sha256:a1f7f282fe248311650081faafa5f4732bdbfef5d45fe3f2e702fbc6f2d496e0", size = 107563, upload-time = "2025-10-08T22:01:44.233Z" }, + { url = "https://files.pythonhosted.org/packages/84/ff/426ca8683cf7b753614480484f6437f568fd2fda2edbdf57a2d3d8b27a0b/tomli-2.3.0-cp314-cp314t-win_amd64.whl", hash = "sha256:70a251f8d4ba2d9ac2542eecf008b3c8a9fc5c3f9f02c56a9d7952612be2fdba", size = 119756, upload-time = "2025-10-08T22:01:45.234Z" }, + { url = "https://files.pythonhosted.org/packages/77/b8/0135fadc89e73be292b473cb820b4f5a08197779206b33191e801feeae40/tomli-2.3.0-py3-none-any.whl", hash = "sha256:e95b1af3c5b07d9e643909b5abbec77cd9f1217e6d0bca72b0234736b9fb1f1b", size = 14408, upload-time = "2025-10-08T22:01:46.04Z" }, ] [[package]] name = "typing-extensions" -version = "4.12.2" +version = "4.15.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" }, +] + +[[package]] +name = "typing-inspection" +version = "0.4.2" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/df/db/f35a00659bc03fec321ba8bce9420de607a1d37f8342eee1863174c69557/typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8", size = 85321, upload-time = "2024-06-07T18:52:15.995Z" } +dependencies = [ + { name = "typing-extensions", marker = "extra == 'group-18-runloop-api-client-pydantic-v2' or extra != 'group-18-runloop-api-client-pydantic-v1'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/55/e3/70399cb7dd41c10ac53367ae42139cf4b1ca5f36bb3dc6c9d33acdb43655/typing_inspection-0.4.2.tar.gz", hash = "sha256:ba561c48a67c5958007083d386c3295464928b01faa735ab8547c5692e87f464", size = 75949, upload-time = "2025-10-01T02:14:41.687Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/26/9f/ad63fc0248c5379346306f8668cda6e2e2e9c95e01216d2b8ffd9ff037d0/typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d", size = 37438, upload-time = "2024-06-07T18:52:13.582Z" }, + { url = "https://files.pythonhosted.org/packages/dc/9b/47798a6c91d8bdb567fe2698fe81e0c6b7cb7ef4d13da4114b41d239f65d/typing_inspection-0.4.2-py3-none-any.whl", hash = "sha256:4ed1cacbdc298c220f1bd249ed5287caa16f34d44ef4e9c3d0cbad5b521545e7", size = 14611, upload-time = "2025-10-01T02:14:40.154Z" }, ] [[package]] name = "yarl" -version = "1.20.1" +version = "1.22.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "idna" }, { name = "multidict" }, { name = "propcache" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/3c/fb/efaa23fa4e45537b827620f04cf8f3cd658b76642205162e072703a5b963/yarl-1.20.1.tar.gz", hash = "sha256:d017a4997ee50c91fd5466cef416231bb82177b93b029906cefc542ce14c35ac", size = 186428, upload-time = "2025-06-10T00:46:09.923Z" } +sdist = { url = "https://files.pythonhosted.org/packages/57/63/0c6ebca57330cd313f6102b16dd57ffaf3ec4c83403dcb45dbd15c6f3ea1/yarl-1.22.0.tar.gz", hash = "sha256:bebf8557577d4401ba8bd9ff33906f1376c877aa78d1fe216ad01b4d6745af71", size = 187169, upload-time = "2025-10-06T14:12:55.963Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/cb/65/7fed0d774abf47487c64be14e9223749468922817b5e8792b8a64792a1bb/yarl-1.20.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:6032e6da6abd41e4acda34d75a816012717000fa6839f37124a47fcefc49bec4", size = 132910, upload-time = "2025-06-10T00:42:31.108Z" }, - { url = "https://files.pythonhosted.org/packages/8a/7b/988f55a52da99df9e56dc733b8e4e5a6ae2090081dc2754fc8fd34e60aa0/yarl-1.20.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2c7b34d804b8cf9b214f05015c4fee2ebe7ed05cf581e7192c06555c71f4446a", size = 90644, upload-time = "2025-06-10T00:42:33.851Z" }, - { url = "https://files.pythonhosted.org/packages/f7/de/30d98f03e95d30c7e3cc093759982d038c8833ec2451001d45ef4854edc1/yarl-1.20.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0c869f2651cc77465f6cd01d938d91a11d9ea5d798738c1dc077f3de0b5e5fed", size = 89322, upload-time = "2025-06-10T00:42:35.688Z" }, - { url = "https://files.pythonhosted.org/packages/e0/7a/f2f314f5ebfe9200724b0b748de2186b927acb334cf964fd312eb86fc286/yarl-1.20.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:62915e6688eb4d180d93840cda4110995ad50c459bf931b8b3775b37c264af1e", size = 323786, upload-time = "2025-06-10T00:42:37.817Z" }, - { url = "https://files.pythonhosted.org/packages/15/3f/718d26f189db96d993d14b984ce91de52e76309d0fd1d4296f34039856aa/yarl-1.20.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:41ebd28167bc6af8abb97fec1a399f412eec5fd61a3ccbe2305a18b84fb4ca73", size = 319627, upload-time = "2025-06-10T00:42:39.937Z" }, - { url = "https://files.pythonhosted.org/packages/a5/76/8fcfbf5fa2369157b9898962a4a7d96764b287b085b5b3d9ffae69cdefd1/yarl-1.20.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:21242b4288a6d56f04ea193adde174b7e347ac46ce6bc84989ff7c1b1ecea84e", size = 339149, upload-time = "2025-06-10T00:42:42.627Z" }, - { url = "https://files.pythonhosted.org/packages/3c/95/d7fc301cc4661785967acc04f54a4a42d5124905e27db27bb578aac49b5c/yarl-1.20.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bea21cdae6c7eb02ba02a475f37463abfe0a01f5d7200121b03e605d6a0439f8", size = 333327, upload-time = "2025-06-10T00:42:44.842Z" }, - { url = "https://files.pythonhosted.org/packages/65/94/e21269718349582eee81efc5c1c08ee71c816bfc1585b77d0ec3f58089eb/yarl-1.20.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1f8a891e4a22a89f5dde7862994485e19db246b70bb288d3ce73a34422e55b23", size = 326054, upload-time = "2025-06-10T00:42:47.149Z" }, - { url = "https://files.pythonhosted.org/packages/32/ae/8616d1f07853704523519f6131d21f092e567c5af93de7e3e94b38d7f065/yarl-1.20.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dd803820d44c8853a109a34e3660e5a61beae12970da479cf44aa2954019bf70", size = 315035, upload-time = "2025-06-10T00:42:48.852Z" }, - { url = "https://files.pythonhosted.org/packages/48/aa/0ace06280861ef055855333707db5e49c6e3a08840a7ce62682259d0a6c0/yarl-1.20.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:b982fa7f74c80d5c0c7b5b38f908971e513380a10fecea528091405f519b9ebb", size = 338962, upload-time = "2025-06-10T00:42:51.024Z" }, - { url = "https://files.pythonhosted.org/packages/20/52/1e9d0e6916f45a8fb50e6844f01cb34692455f1acd548606cbda8134cd1e/yarl-1.20.1-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:33f29ecfe0330c570d997bcf1afd304377f2e48f61447f37e846a6058a4d33b2", size = 335399, upload-time = "2025-06-10T00:42:53.007Z" }, - { url = "https://files.pythonhosted.org/packages/f2/65/60452df742952c630e82f394cd409de10610481d9043aa14c61bf846b7b1/yarl-1.20.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:835ab2cfc74d5eb4a6a528c57f05688099da41cf4957cf08cad38647e4a83b30", size = 338649, upload-time = "2025-06-10T00:42:54.964Z" }, - { url = "https://files.pythonhosted.org/packages/7b/f5/6cd4ff38dcde57a70f23719a838665ee17079640c77087404c3d34da6727/yarl-1.20.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:46b5e0ccf1943a9a6e766b2c2b8c732c55b34e28be57d8daa2b3c1d1d4009309", size = 358563, upload-time = "2025-06-10T00:42:57.28Z" }, - { url = "https://files.pythonhosted.org/packages/d1/90/c42eefd79d0d8222cb3227bdd51b640c0c1d0aa33fe4cc86c36eccba77d3/yarl-1.20.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:df47c55f7d74127d1b11251fe6397d84afdde0d53b90bedb46a23c0e534f9d24", size = 357609, upload-time = "2025-06-10T00:42:59.055Z" }, - { url = "https://files.pythonhosted.org/packages/03/c8/cea6b232cb4617514232e0f8a718153a95b5d82b5290711b201545825532/yarl-1.20.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:76d12524d05841276b0e22573f28d5fbcb67589836772ae9244d90dd7d66aa13", size = 350224, upload-time = "2025-06-10T00:43:01.248Z" }, - { url = "https://files.pythonhosted.org/packages/ce/a3/eaa0ab9712f1f3d01faf43cf6f1f7210ce4ea4a7e9b28b489a2261ca8db9/yarl-1.20.1-cp310-cp310-win32.whl", hash = "sha256:6c4fbf6b02d70e512d7ade4b1f998f237137f1417ab07ec06358ea04f69134f8", size = 81753, upload-time = "2025-06-10T00:43:03.486Z" }, - { url = "https://files.pythonhosted.org/packages/8f/34/e4abde70a9256465fe31c88ed02c3f8502b7b5dead693a4f350a06413f28/yarl-1.20.1-cp310-cp310-win_amd64.whl", hash = "sha256:aef6c4d69554d44b7f9d923245f8ad9a707d971e6209d51279196d8e8fe1ae16", size = 86817, upload-time = "2025-06-10T00:43:05.231Z" }, - { url = "https://files.pythonhosted.org/packages/b1/18/893b50efc2350e47a874c5c2d67e55a0ea5df91186b2a6f5ac52eff887cd/yarl-1.20.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:47ee6188fea634bdfaeb2cc420f5b3b17332e6225ce88149a17c413c77ff269e", size = 133833, upload-time = "2025-06-10T00:43:07.393Z" }, - { url = "https://files.pythonhosted.org/packages/89/ed/b8773448030e6fc47fa797f099ab9eab151a43a25717f9ac043844ad5ea3/yarl-1.20.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d0f6500f69e8402d513e5eedb77a4e1818691e8f45e6b687147963514d84b44b", size = 91070, upload-time = "2025-06-10T00:43:09.538Z" }, - { url = "https://files.pythonhosted.org/packages/e3/e3/409bd17b1e42619bf69f60e4f031ce1ccb29bd7380117a55529e76933464/yarl-1.20.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7a8900a42fcdaad568de58887c7b2f602962356908eedb7628eaf6021a6e435b", size = 89818, upload-time = "2025-06-10T00:43:11.575Z" }, - { url = "https://files.pythonhosted.org/packages/f8/77/64d8431a4d77c856eb2d82aa3de2ad6741365245a29b3a9543cd598ed8c5/yarl-1.20.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bad6d131fda8ef508b36be3ece16d0902e80b88ea7200f030a0f6c11d9e508d4", size = 347003, upload-time = "2025-06-10T00:43:14.088Z" }, - { url = "https://files.pythonhosted.org/packages/8d/d2/0c7e4def093dcef0bd9fa22d4d24b023788b0a33b8d0088b51aa51e21e99/yarl-1.20.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:df018d92fe22aaebb679a7f89fe0c0f368ec497e3dda6cb81a567610f04501f1", size = 336537, upload-time = "2025-06-10T00:43:16.431Z" }, - { url = "https://files.pythonhosted.org/packages/f0/f3/fc514f4b2cf02cb59d10cbfe228691d25929ce8f72a38db07d3febc3f706/yarl-1.20.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8f969afbb0a9b63c18d0feecf0db09d164b7a44a053e78a7d05f5df163e43833", size = 362358, upload-time = "2025-06-10T00:43:18.704Z" }, - { url = "https://files.pythonhosted.org/packages/ea/6d/a313ac8d8391381ff9006ac05f1d4331cee3b1efaa833a53d12253733255/yarl-1.20.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:812303eb4aa98e302886ccda58d6b099e3576b1b9276161469c25803a8db277d", size = 357362, upload-time = "2025-06-10T00:43:20.888Z" }, - { url = "https://files.pythonhosted.org/packages/00/70/8f78a95d6935a70263d46caa3dd18e1f223cf2f2ff2037baa01a22bc5b22/yarl-1.20.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:98c4a7d166635147924aa0bf9bfe8d8abad6fffa6102de9c99ea04a1376f91e8", size = 348979, upload-time = "2025-06-10T00:43:23.169Z" }, - { url = "https://files.pythonhosted.org/packages/cb/05/42773027968968f4f15143553970ee36ead27038d627f457cc44bbbeecf3/yarl-1.20.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:12e768f966538e81e6e7550f9086a6236b16e26cd964cf4df35349970f3551cf", size = 337274, upload-time = "2025-06-10T00:43:27.111Z" }, - { url = "https://files.pythonhosted.org/packages/05/be/665634aa196954156741ea591d2f946f1b78ceee8bb8f28488bf28c0dd62/yarl-1.20.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:fe41919b9d899661c5c28a8b4b0acf704510b88f27f0934ac7a7bebdd8938d5e", size = 363294, upload-time = "2025-06-10T00:43:28.96Z" }, - { url = "https://files.pythonhosted.org/packages/eb/90/73448401d36fa4e210ece5579895731f190d5119c4b66b43b52182e88cd5/yarl-1.20.1-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:8601bc010d1d7780592f3fc1bdc6c72e2b6466ea34569778422943e1a1f3c389", size = 358169, upload-time = "2025-06-10T00:43:30.701Z" }, - { url = "https://files.pythonhosted.org/packages/c3/b0/fce922d46dc1eb43c811f1889f7daa6001b27a4005587e94878570300881/yarl-1.20.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:daadbdc1f2a9033a2399c42646fbd46da7992e868a5fe9513860122d7fe7a73f", size = 362776, upload-time = "2025-06-10T00:43:32.51Z" }, - { url = "https://files.pythonhosted.org/packages/f1/0d/b172628fce039dae8977fd22caeff3eeebffd52e86060413f5673767c427/yarl-1.20.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:03aa1e041727cb438ca762628109ef1333498b122e4c76dd858d186a37cec845", size = 381341, upload-time = "2025-06-10T00:43:34.543Z" }, - { url = "https://files.pythonhosted.org/packages/6b/9b/5b886d7671f4580209e855974fe1cecec409aa4a89ea58b8f0560dc529b1/yarl-1.20.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:642980ef5e0fa1de5fa96d905c7e00cb2c47cb468bfcac5a18c58e27dbf8d8d1", size = 379988, upload-time = "2025-06-10T00:43:36.489Z" }, - { url = "https://files.pythonhosted.org/packages/73/be/75ef5fd0fcd8f083a5d13f78fd3f009528132a1f2a1d7c925c39fa20aa79/yarl-1.20.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:86971e2795584fe8c002356d3b97ef6c61862720eeff03db2a7c86b678d85b3e", size = 371113, upload-time = "2025-06-10T00:43:38.592Z" }, - { url = "https://files.pythonhosted.org/packages/50/4f/62faab3b479dfdcb741fe9e3f0323e2a7d5cd1ab2edc73221d57ad4834b2/yarl-1.20.1-cp311-cp311-win32.whl", hash = "sha256:597f40615b8d25812f14562699e287f0dcc035d25eb74da72cae043bb884d773", size = 81485, upload-time = "2025-06-10T00:43:41.038Z" }, - { url = "https://files.pythonhosted.org/packages/f0/09/d9c7942f8f05c32ec72cd5c8e041c8b29b5807328b68b4801ff2511d4d5e/yarl-1.20.1-cp311-cp311-win_amd64.whl", hash = "sha256:26ef53a9e726e61e9cd1cda6b478f17e350fb5800b4bd1cd9fe81c4d91cfeb2e", size = 86686, upload-time = "2025-06-10T00:43:42.692Z" }, - { url = "https://files.pythonhosted.org/packages/5f/9a/cb7fad7d73c69f296eda6815e4a2c7ed53fc70c2f136479a91c8e5fbdb6d/yarl-1.20.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:bdcc4cd244e58593a4379fe60fdee5ac0331f8eb70320a24d591a3be197b94a9", size = 133667, upload-time = "2025-06-10T00:43:44.369Z" }, - { url = "https://files.pythonhosted.org/packages/67/38/688577a1cb1e656e3971fb66a3492501c5a5df56d99722e57c98249e5b8a/yarl-1.20.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:b29a2c385a5f5b9c7d9347e5812b6f7ab267193c62d282a540b4fc528c8a9d2a", size = 91025, upload-time = "2025-06-10T00:43:46.295Z" }, - { url = "https://files.pythonhosted.org/packages/50/ec/72991ae51febeb11a42813fc259f0d4c8e0507f2b74b5514618d8b640365/yarl-1.20.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1112ae8154186dfe2de4732197f59c05a83dc814849a5ced892b708033f40dc2", size = 89709, upload-time = "2025-06-10T00:43:48.22Z" }, - { url = "https://files.pythonhosted.org/packages/99/da/4d798025490e89426e9f976702e5f9482005c548c579bdae792a4c37769e/yarl-1.20.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:90bbd29c4fe234233f7fa2b9b121fb63c321830e5d05b45153a2ca68f7d310ee", size = 352287, upload-time = "2025-06-10T00:43:49.924Z" }, - { url = "https://files.pythonhosted.org/packages/1a/26/54a15c6a567aac1c61b18aa0f4b8aa2e285a52d547d1be8bf48abe2b3991/yarl-1.20.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:680e19c7ce3710ac4cd964e90dad99bf9b5029372ba0c7cbfcd55e54d90ea819", size = 345429, upload-time = "2025-06-10T00:43:51.7Z" }, - { url = "https://files.pythonhosted.org/packages/d6/95/9dcf2386cb875b234353b93ec43e40219e14900e046bf6ac118f94b1e353/yarl-1.20.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4a979218c1fdb4246a05efc2cc23859d47c89af463a90b99b7c56094daf25a16", size = 365429, upload-time = "2025-06-10T00:43:53.494Z" }, - { url = "https://files.pythonhosted.org/packages/91/b2/33a8750f6a4bc224242a635f5f2cff6d6ad5ba651f6edcccf721992c21a0/yarl-1.20.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:255b468adf57b4a7b65d8aad5b5138dce6a0752c139965711bdcb81bc370e1b6", size = 363862, upload-time = "2025-06-10T00:43:55.766Z" }, - { url = "https://files.pythonhosted.org/packages/98/28/3ab7acc5b51f4434b181b0cee8f1f4b77a65919700a355fb3617f9488874/yarl-1.20.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a97d67108e79cfe22e2b430d80d7571ae57d19f17cda8bb967057ca8a7bf5bfd", size = 355616, upload-time = "2025-06-10T00:43:58.056Z" }, - { url = "https://files.pythonhosted.org/packages/36/a3/f666894aa947a371724ec7cd2e5daa78ee8a777b21509b4252dd7bd15e29/yarl-1.20.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8570d998db4ddbfb9a590b185a0a33dbf8aafb831d07a5257b4ec9948df9cb0a", size = 339954, upload-time = "2025-06-10T00:43:59.773Z" }, - { url = "https://files.pythonhosted.org/packages/f1/81/5f466427e09773c04219d3450d7a1256138a010b6c9f0af2d48565e9ad13/yarl-1.20.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:97c75596019baae7c71ccf1d8cc4738bc08134060d0adfcbe5642f778d1dca38", size = 365575, upload-time = "2025-06-10T00:44:02.051Z" }, - { url = "https://files.pythonhosted.org/packages/2e/e3/e4b0ad8403e97e6c9972dd587388940a032f030ebec196ab81a3b8e94d31/yarl-1.20.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:1c48912653e63aef91ff988c5432832692ac5a1d8f0fb8a33091520b5bbe19ef", size = 365061, upload-time = "2025-06-10T00:44:04.196Z" }, - { url = "https://files.pythonhosted.org/packages/ac/99/b8a142e79eb86c926f9f06452eb13ecb1bb5713bd01dc0038faf5452e544/yarl-1.20.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:4c3ae28f3ae1563c50f3d37f064ddb1511ecc1d5584e88c6b7c63cf7702a6d5f", size = 364142, upload-time = "2025-06-10T00:44:06.527Z" }, - { url = "https://files.pythonhosted.org/packages/34/f2/08ed34a4a506d82a1a3e5bab99ccd930a040f9b6449e9fd050320e45845c/yarl-1.20.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:c5e9642f27036283550f5f57dc6156c51084b458570b9d0d96100c8bebb186a8", size = 381894, upload-time = "2025-06-10T00:44:08.379Z" }, - { url = "https://files.pythonhosted.org/packages/92/f8/9a3fbf0968eac704f681726eff595dce9b49c8a25cd92bf83df209668285/yarl-1.20.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:2c26b0c49220d5799f7b22c6838409ee9bc58ee5c95361a4d7831f03cc225b5a", size = 383378, upload-time = "2025-06-10T00:44:10.51Z" }, - { url = "https://files.pythonhosted.org/packages/af/85/9363f77bdfa1e4d690957cd39d192c4cacd1c58965df0470a4905253b54f/yarl-1.20.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:564ab3d517e3d01c408c67f2e5247aad4019dcf1969982aba3974b4093279004", size = 374069, upload-time = "2025-06-10T00:44:12.834Z" }, - { url = "https://files.pythonhosted.org/packages/35/99/9918c8739ba271dcd935400cff8b32e3cd319eaf02fcd023d5dcd487a7c8/yarl-1.20.1-cp312-cp312-win32.whl", hash = "sha256:daea0d313868da1cf2fac6b2d3a25c6e3a9e879483244be38c8e6a41f1d876a5", size = 81249, upload-time = "2025-06-10T00:44:14.731Z" }, - { url = "https://files.pythonhosted.org/packages/eb/83/5d9092950565481b413b31a23e75dd3418ff0a277d6e0abf3729d4d1ce25/yarl-1.20.1-cp312-cp312-win_amd64.whl", hash = "sha256:48ea7d7f9be0487339828a4de0360d7ce0efc06524a48e1810f945c45b813698", size = 86710, upload-time = "2025-06-10T00:44:16.716Z" }, - { url = "https://files.pythonhosted.org/packages/8a/e1/2411b6d7f769a07687acee88a062af5833cf1966b7266f3d8dfb3d3dc7d3/yarl-1.20.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:0b5ff0fbb7c9f1b1b5ab53330acbfc5247893069e7716840c8e7d5bb7355038a", size = 131811, upload-time = "2025-06-10T00:44:18.933Z" }, - { url = "https://files.pythonhosted.org/packages/b2/27/584394e1cb76fb771371770eccad35de400e7b434ce3142c2dd27392c968/yarl-1.20.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:14f326acd845c2b2e2eb38fb1346c94f7f3b01a4f5c788f8144f9b630bfff9a3", size = 90078, upload-time = "2025-06-10T00:44:20.635Z" }, - { url = "https://files.pythonhosted.org/packages/bf/9a/3246ae92d4049099f52d9b0fe3486e3b500e29b7ea872d0f152966fc209d/yarl-1.20.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f60e4ad5db23f0b96e49c018596707c3ae89f5d0bd97f0ad3684bcbad899f1e7", size = 88748, upload-time = "2025-06-10T00:44:22.34Z" }, - { url = "https://files.pythonhosted.org/packages/a3/25/35afe384e31115a1a801fbcf84012d7a066d89035befae7c5d4284df1e03/yarl-1.20.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:49bdd1b8e00ce57e68ba51916e4bb04461746e794e7c4d4bbc42ba2f18297691", size = 349595, upload-time = "2025-06-10T00:44:24.314Z" }, - { url = "https://files.pythonhosted.org/packages/28/2d/8aca6cb2cabc8f12efcb82749b9cefecbccfc7b0384e56cd71058ccee433/yarl-1.20.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:66252d780b45189975abfed839616e8fd2dbacbdc262105ad7742c6ae58f3e31", size = 342616, upload-time = "2025-06-10T00:44:26.167Z" }, - { url = "https://files.pythonhosted.org/packages/0b/e9/1312633d16b31acf0098d30440ca855e3492d66623dafb8e25b03d00c3da/yarl-1.20.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:59174e7332f5d153d8f7452a102b103e2e74035ad085f404df2e40e663a22b28", size = 361324, upload-time = "2025-06-10T00:44:27.915Z" }, - { url = "https://files.pythonhosted.org/packages/bc/a0/688cc99463f12f7669eec7c8acc71ef56a1521b99eab7cd3abb75af887b0/yarl-1.20.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e3968ec7d92a0c0f9ac34d5ecfd03869ec0cab0697c91a45db3fbbd95fe1b653", size = 359676, upload-time = "2025-06-10T00:44:30.041Z" }, - { url = "https://files.pythonhosted.org/packages/af/44/46407d7f7a56e9a85a4c207724c9f2c545c060380718eea9088f222ba697/yarl-1.20.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d1a4fbb50e14396ba3d375f68bfe02215d8e7bc3ec49da8341fe3157f59d2ff5", size = 352614, upload-time = "2025-06-10T00:44:32.171Z" }, - { url = "https://files.pythonhosted.org/packages/b1/91/31163295e82b8d5485d31d9cf7754d973d41915cadce070491778d9c9825/yarl-1.20.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:11a62c839c3a8eac2410e951301309426f368388ff2f33799052787035793b02", size = 336766, upload-time = "2025-06-10T00:44:34.494Z" }, - { url = "https://files.pythonhosted.org/packages/b4/8e/c41a5bc482121f51c083c4c2bcd16b9e01e1cf8729e380273a952513a21f/yarl-1.20.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:041eaa14f73ff5a8986b4388ac6bb43a77f2ea09bf1913df7a35d4646db69e53", size = 364615, upload-time = "2025-06-10T00:44:36.856Z" }, - { url = "https://files.pythonhosted.org/packages/e3/5b/61a3b054238d33d70ea06ebba7e58597891b71c699e247df35cc984ab393/yarl-1.20.1-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:377fae2fef158e8fd9d60b4c8751387b8d1fb121d3d0b8e9b0be07d1b41e83dc", size = 360982, upload-time = "2025-06-10T00:44:39.141Z" }, - { url = "https://files.pythonhosted.org/packages/df/a3/6a72fb83f8d478cb201d14927bc8040af901811a88e0ff2da7842dd0ed19/yarl-1.20.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:1c92f4390e407513f619d49319023664643d3339bd5e5a56a3bebe01bc67ec04", size = 369792, upload-time = "2025-06-10T00:44:40.934Z" }, - { url = "https://files.pythonhosted.org/packages/7c/af/4cc3c36dfc7c077f8dedb561eb21f69e1e9f2456b91b593882b0b18c19dc/yarl-1.20.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:d25ddcf954df1754ab0f86bb696af765c5bfaba39b74095f27eececa049ef9a4", size = 382049, upload-time = "2025-06-10T00:44:42.854Z" }, - { url = "https://files.pythonhosted.org/packages/19/3a/e54e2c4752160115183a66dc9ee75a153f81f3ab2ba4bf79c3c53b33de34/yarl-1.20.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:909313577e9619dcff8c31a0ea2aa0a2a828341d92673015456b3ae492e7317b", size = 384774, upload-time = "2025-06-10T00:44:45.275Z" }, - { url = "https://files.pythonhosted.org/packages/9c/20/200ae86dabfca89060ec6447649f219b4cbd94531e425e50d57e5f5ac330/yarl-1.20.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:793fd0580cb9664548c6b83c63b43c477212c0260891ddf86809e1c06c8b08f1", size = 374252, upload-time = "2025-06-10T00:44:47.31Z" }, - { url = "https://files.pythonhosted.org/packages/83/75/11ee332f2f516b3d094e89448da73d557687f7d137d5a0f48c40ff211487/yarl-1.20.1-cp313-cp313-win32.whl", hash = "sha256:468f6e40285de5a5b3c44981ca3a319a4b208ccc07d526b20b12aeedcfa654b7", size = 81198, upload-time = "2025-06-10T00:44:49.164Z" }, - { url = "https://files.pythonhosted.org/packages/ba/ba/39b1ecbf51620b40ab402b0fc817f0ff750f6d92712b44689c2c215be89d/yarl-1.20.1-cp313-cp313-win_amd64.whl", hash = "sha256:495b4ef2fea40596bfc0affe3837411d6aa3371abcf31aac0ccc4bdd64d4ef5c", size = 86346, upload-time = "2025-06-10T00:44:51.182Z" }, - { url = "https://files.pythonhosted.org/packages/43/c7/669c52519dca4c95153c8ad96dd123c79f354a376346b198f438e56ffeb4/yarl-1.20.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:f60233b98423aab21d249a30eb27c389c14929f47be8430efa7dbd91493a729d", size = 138826, upload-time = "2025-06-10T00:44:52.883Z" }, - { url = "https://files.pythonhosted.org/packages/6a/42/fc0053719b44f6ad04a75d7f05e0e9674d45ef62f2d9ad2c1163e5c05827/yarl-1.20.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:6f3eff4cc3f03d650d8755c6eefc844edde99d641d0dcf4da3ab27141a5f8ddf", size = 93217, upload-time = "2025-06-10T00:44:54.658Z" }, - { url = "https://files.pythonhosted.org/packages/4f/7f/fa59c4c27e2a076bba0d959386e26eba77eb52ea4a0aac48e3515c186b4c/yarl-1.20.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:69ff8439d8ba832d6bed88af2c2b3445977eba9a4588b787b32945871c2444e3", size = 92700, upload-time = "2025-06-10T00:44:56.784Z" }, - { url = "https://files.pythonhosted.org/packages/2f/d4/062b2f48e7c93481e88eff97a6312dca15ea200e959f23e96d8ab898c5b8/yarl-1.20.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3cf34efa60eb81dd2645a2e13e00bb98b76c35ab5061a3989c7a70f78c85006d", size = 347644, upload-time = "2025-06-10T00:44:59.071Z" }, - { url = "https://files.pythonhosted.org/packages/89/47/78b7f40d13c8f62b499cc702fdf69e090455518ae544c00a3bf4afc9fc77/yarl-1.20.1-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:8e0fe9364ad0fddab2688ce72cb7a8e61ea42eff3c7caeeb83874a5d479c896c", size = 323452, upload-time = "2025-06-10T00:45:01.605Z" }, - { url = "https://files.pythonhosted.org/packages/eb/2b/490d3b2dc66f52987d4ee0d3090a147ea67732ce6b4d61e362c1846d0d32/yarl-1.20.1-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8f64fbf81878ba914562c672024089e3401974a39767747691c65080a67b18c1", size = 346378, upload-time = "2025-06-10T00:45:03.946Z" }, - { url = "https://files.pythonhosted.org/packages/66/ad/775da9c8a94ce925d1537f939a4f17d782efef1f973039d821cbe4bcc211/yarl-1.20.1-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f6342d643bf9a1de97e512e45e4b9560a043347e779a173250824f8b254bd5ce", size = 353261, upload-time = "2025-06-10T00:45:05.992Z" }, - { url = "https://files.pythonhosted.org/packages/4b/23/0ed0922b47a4f5c6eb9065d5ff1e459747226ddce5c6a4c111e728c9f701/yarl-1.20.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:56dac5f452ed25eef0f6e3c6a066c6ab68971d96a9fb441791cad0efba6140d3", size = 335987, upload-time = "2025-06-10T00:45:08.227Z" }, - { url = "https://files.pythonhosted.org/packages/3e/49/bc728a7fe7d0e9336e2b78f0958a2d6b288ba89f25a1762407a222bf53c3/yarl-1.20.1-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c7d7f497126d65e2cad8dc5f97d34c27b19199b6414a40cb36b52f41b79014be", size = 329361, upload-time = "2025-06-10T00:45:10.11Z" }, - { url = "https://files.pythonhosted.org/packages/93/8f/b811b9d1f617c83c907e7082a76e2b92b655400e61730cd61a1f67178393/yarl-1.20.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:67e708dfb8e78d8a19169818eeb5c7a80717562de9051bf2413aca8e3696bf16", size = 346460, upload-time = "2025-06-10T00:45:12.055Z" }, - { url = "https://files.pythonhosted.org/packages/70/fd/af94f04f275f95da2c3b8b5e1d49e3e79f1ed8b6ceb0f1664cbd902773ff/yarl-1.20.1-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:595c07bc79af2494365cc96ddeb772f76272364ef7c80fb892ef9d0649586513", size = 334486, upload-time = "2025-06-10T00:45:13.995Z" }, - { url = "https://files.pythonhosted.org/packages/84/65/04c62e82704e7dd0a9b3f61dbaa8447f8507655fd16c51da0637b39b2910/yarl-1.20.1-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:7bdd2f80f4a7df852ab9ab49484a4dee8030023aa536df41f2d922fd57bf023f", size = 342219, upload-time = "2025-06-10T00:45:16.479Z" }, - { url = "https://files.pythonhosted.org/packages/91/95/459ca62eb958381b342d94ab9a4b6aec1ddec1f7057c487e926f03c06d30/yarl-1.20.1-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:c03bfebc4ae8d862f853a9757199677ab74ec25424d0ebd68a0027e9c639a390", size = 350693, upload-time = "2025-06-10T00:45:18.399Z" }, - { url = "https://files.pythonhosted.org/packages/a6/00/d393e82dd955ad20617abc546a8f1aee40534d599ff555ea053d0ec9bf03/yarl-1.20.1-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:344d1103e9c1523f32a5ed704d576172d2cabed3122ea90b1d4e11fe17c66458", size = 355803, upload-time = "2025-06-10T00:45:20.677Z" }, - { url = "https://files.pythonhosted.org/packages/9e/ed/c5fb04869b99b717985e244fd93029c7a8e8febdfcffa06093e32d7d44e7/yarl-1.20.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:88cab98aa4e13e1ade8c141daeedd300a4603b7132819c484841bb7af3edce9e", size = 341709, upload-time = "2025-06-10T00:45:23.221Z" }, - { url = "https://files.pythonhosted.org/packages/24/fd/725b8e73ac2a50e78a4534ac43c6addf5c1c2d65380dd48a9169cc6739a9/yarl-1.20.1-cp313-cp313t-win32.whl", hash = "sha256:b121ff6a7cbd4abc28985b6028235491941b9fe8fe226e6fdc539c977ea1739d", size = 86591, upload-time = "2025-06-10T00:45:25.793Z" }, - { url = "https://files.pythonhosted.org/packages/94/c3/b2e9f38bc3e11191981d57ea08cab2166e74ea770024a646617c9cddd9f6/yarl-1.20.1-cp313-cp313t-win_amd64.whl", hash = "sha256:541d050a355bbbc27e55d906bc91cb6fe42f96c01413dd0f4ed5a5240513874f", size = 93003, upload-time = "2025-06-10T00:45:27.752Z" }, - { url = "https://files.pythonhosted.org/packages/01/75/0d37402d208d025afa6b5b8eb80e466d267d3fd1927db8e317d29a94a4cb/yarl-1.20.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:e42ba79e2efb6845ebab49c7bf20306c4edf74a0b20fc6b2ccdd1a219d12fad3", size = 134259, upload-time = "2025-06-10T00:45:29.882Z" }, - { url = "https://files.pythonhosted.org/packages/73/84/1fb6c85ae0cf9901046f07d0ac9eb162f7ce6d95db541130aa542ed377e6/yarl-1.20.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:41493b9b7c312ac448b7f0a42a089dffe1d6e6e981a2d76205801a023ed26a2b", size = 91269, upload-time = "2025-06-10T00:45:32.917Z" }, - { url = "https://files.pythonhosted.org/packages/f3/9c/eae746b24c4ea29a5accba9a06c197a70fa38a49c7df244e0d3951108861/yarl-1.20.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f5a5928ff5eb13408c62a968ac90d43f8322fd56d87008b8f9dabf3c0f6ee983", size = 89995, upload-time = "2025-06-10T00:45:35.066Z" }, - { url = "https://files.pythonhosted.org/packages/fb/30/693e71003ec4bc1daf2e4cf7c478c417d0985e0a8e8f00b2230d517876fc/yarl-1.20.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:30c41ad5d717b3961b2dd785593b67d386b73feca30522048d37298fee981805", size = 325253, upload-time = "2025-06-10T00:45:37.052Z" }, - { url = "https://files.pythonhosted.org/packages/0f/a2/5264dbebf90763139aeb0b0b3154763239398400f754ae19a0518b654117/yarl-1.20.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:59febc3969b0781682b469d4aca1a5cab7505a4f7b85acf6db01fa500fa3f6ba", size = 320897, upload-time = "2025-06-10T00:45:39.962Z" }, - { url = "https://files.pythonhosted.org/packages/e7/17/77c7a89b3c05856489777e922f41db79ab4faf58621886df40d812c7facd/yarl-1.20.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d2b6fb3622b7e5bf7a6e5b679a69326b4279e805ed1699d749739a61d242449e", size = 340696, upload-time = "2025-06-10T00:45:41.915Z" }, - { url = "https://files.pythonhosted.org/packages/6d/55/28409330b8ef5f2f681f5b478150496ec9cf3309b149dab7ec8ab5cfa3f0/yarl-1.20.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:749d73611db8d26a6281086f859ea7ec08f9c4c56cec864e52028c8b328db723", size = 335064, upload-time = "2025-06-10T00:45:43.893Z" }, - { url = "https://files.pythonhosted.org/packages/85/58/cb0257cbd4002828ff735f44d3c5b6966c4fd1fc8cc1cd3cd8a143fbc513/yarl-1.20.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9427925776096e664c39e131447aa20ec738bdd77c049c48ea5200db2237e000", size = 327256, upload-time = "2025-06-10T00:45:46.393Z" }, - { url = "https://files.pythonhosted.org/packages/53/f6/c77960370cfa46f6fb3d6a5a79a49d3abfdb9ef92556badc2dcd2748bc2a/yarl-1.20.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ff70f32aa316393eaf8222d518ce9118148eddb8a53073c2403863b41033eed5", size = 316389, upload-time = "2025-06-10T00:45:48.358Z" }, - { url = "https://files.pythonhosted.org/packages/64/ab/be0b10b8e029553c10905b6b00c64ecad3ebc8ace44b02293a62579343f6/yarl-1.20.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:c7ddf7a09f38667aea38801da8b8d6bfe81df767d9dfc8c88eb45827b195cd1c", size = 340481, upload-time = "2025-06-10T00:45:50.663Z" }, - { url = "https://files.pythonhosted.org/packages/c5/c3/3f327bd3905a4916029bf5feb7f86dcf864c7704f099715f62155fb386b2/yarl-1.20.1-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:57edc88517d7fc62b174fcfb2e939fbc486a68315d648d7e74d07fac42cec240", size = 336941, upload-time = "2025-06-10T00:45:52.554Z" }, - { url = "https://files.pythonhosted.org/packages/d1/42/040bdd5d3b3bb02b4a6ace4ed4075e02f85df964d6e6cb321795d2a6496a/yarl-1.20.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:dab096ce479d5894d62c26ff4f699ec9072269d514b4edd630a393223f45a0ee", size = 339936, upload-time = "2025-06-10T00:45:54.919Z" }, - { url = "https://files.pythonhosted.org/packages/0d/1c/911867b8e8c7463b84dfdc275e0d99b04b66ad5132b503f184fe76be8ea4/yarl-1.20.1-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:14a85f3bd2d7bb255be7183e5d7d6e70add151a98edf56a770d6140f5d5f4010", size = 360163, upload-time = "2025-06-10T00:45:56.87Z" }, - { url = "https://files.pythonhosted.org/packages/e2/31/8c389f6c6ca0379b57b2da87f1f126c834777b4931c5ee8427dd65d0ff6b/yarl-1.20.1-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:2c89b5c792685dd9cd3fa9761c1b9f46fc240c2a3265483acc1565769996a3f8", size = 359108, upload-time = "2025-06-10T00:45:58.869Z" }, - { url = "https://files.pythonhosted.org/packages/7f/09/ae4a649fb3964324c70a3e2b61f45e566d9ffc0affd2b974cbf628957673/yarl-1.20.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:69e9b141de5511021942a6866990aea6d111c9042235de90e08f94cf972ca03d", size = 351875, upload-time = "2025-06-10T00:46:01.45Z" }, - { url = "https://files.pythonhosted.org/packages/8d/43/bbb4ed4c34d5bb62b48bf957f68cd43f736f79059d4f85225ab1ef80f4b9/yarl-1.20.1-cp39-cp39-win32.whl", hash = "sha256:b5f307337819cdfdbb40193cad84978a029f847b0a357fbe49f712063cfc4f06", size = 82293, upload-time = "2025-06-10T00:46:03.763Z" }, - { url = "https://files.pythonhosted.org/packages/d7/cd/ce185848a7dba68ea69e932674b5c1a42a1852123584bccc5443120f857c/yarl-1.20.1-cp39-cp39-win_amd64.whl", hash = "sha256:eae7bfe2069f9c1c5b05fc7fe5d612e5bbc089a39309904ee8b829e322dcad00", size = 87385, upload-time = "2025-06-10T00:46:05.655Z" }, - { url = "https://files.pythonhosted.org/packages/b4/2d/2345fce04cfd4bee161bf1e7d9cdc702e3e16109021035dbb24db654a622/yarl-1.20.1-py3-none-any.whl", hash = "sha256:83b8eb083fe4683c6115795d9fc1cfaf2cbbefb19b3a1cb68f6527460f483a77", size = 46542, upload-time = "2025-06-10T00:46:07.521Z" }, + { url = "https://files.pythonhosted.org/packages/d1/43/a2204825342f37c337f5edb6637040fa14e365b2fcc2346960201d457579/yarl-1.22.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:c7bd6683587567e5a49ee6e336e0612bec8329be1b7d4c8af5687dcdeb67ee1e", size = 140517, upload-time = "2025-10-06T14:08:42.494Z" }, + { url = "https://files.pythonhosted.org/packages/44/6f/674f3e6f02266428c56f704cd2501c22f78e8b2eeb23f153117cc86fb28a/yarl-1.22.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5cdac20da754f3a723cceea5b3448e1a2074866406adeb4ef35b469d089adb8f", size = 93495, upload-time = "2025-10-06T14:08:46.2Z" }, + { url = "https://files.pythonhosted.org/packages/b8/12/5b274d8a0f30c07b91b2f02cba69152600b47830fcfb465c108880fcee9c/yarl-1.22.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:07a524d84df0c10f41e3ee918846e1974aba4ec017f990dc735aad487a0bdfdf", size = 94400, upload-time = "2025-10-06T14:08:47.855Z" }, + { url = "https://files.pythonhosted.org/packages/e2/7f/df1b6949b1fa1aa9ff6de6e2631876ad4b73c4437822026e85d8acb56bb1/yarl-1.22.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e1b329cb8146d7b736677a2440e422eadd775d1806a81db2d4cded80a48efc1a", size = 347545, upload-time = "2025-10-06T14:08:49.683Z" }, + { url = "https://files.pythonhosted.org/packages/84/09/f92ed93bd6cd77872ab6c3462df45ca45cd058d8f1d0c9b4f54c1704429f/yarl-1.22.0-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:75976c6945d85dbb9ee6308cd7ff7b1fb9409380c82d6119bd778d8fcfe2931c", size = 319598, upload-time = "2025-10-06T14:08:51.215Z" }, + { url = "https://files.pythonhosted.org/packages/c3/97/ac3f3feae7d522cf7ccec3d340bb0b2b61c56cb9767923df62a135092c6b/yarl-1.22.0-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:80ddf7a5f8c86cb3eb4bc9028b07bbbf1f08a96c5c0bc1244be5e8fefcb94147", size = 363893, upload-time = "2025-10-06T14:08:53.144Z" }, + { url = "https://files.pythonhosted.org/packages/06/49/f3219097403b9c84a4d079b1d7bda62dd9b86d0d6e4428c02d46ab2c77fc/yarl-1.22.0-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d332fc2e3c94dad927f2112395772a4e4fedbcf8f80efc21ed7cdfae4d574fdb", size = 371240, upload-time = "2025-10-06T14:08:55.036Z" }, + { url = "https://files.pythonhosted.org/packages/35/9f/06b765d45c0e44e8ecf0fe15c9eacbbde342bb5b7561c46944f107bfb6c3/yarl-1.22.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0cf71bf877efeac18b38d3930594c0948c82b64547c1cf420ba48722fe5509f6", size = 346965, upload-time = "2025-10-06T14:08:56.722Z" }, + { url = "https://files.pythonhosted.org/packages/c5/69/599e7cea8d0fcb1694323b0db0dda317fa3162f7b90166faddecf532166f/yarl-1.22.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:663e1cadaddae26be034a6ab6072449a8426ddb03d500f43daf952b74553bba0", size = 342026, upload-time = "2025-10-06T14:08:58.563Z" }, + { url = "https://files.pythonhosted.org/packages/95/6f/9dfd12c8bc90fea9eab39832ee32ea48f8e53d1256252a77b710c065c89f/yarl-1.22.0-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:6dcbb0829c671f305be48a7227918cfcd11276c2d637a8033a99a02b67bf9eda", size = 335637, upload-time = "2025-10-06T14:09:00.506Z" }, + { url = "https://files.pythonhosted.org/packages/57/2e/34c5b4eb9b07e16e873db5b182c71e5f06f9b5af388cdaa97736d79dd9a6/yarl-1.22.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:f0d97c18dfd9a9af4490631905a3f131a8e4c9e80a39353919e2cfed8f00aedc", size = 359082, upload-time = "2025-10-06T14:09:01.936Z" }, + { url = "https://files.pythonhosted.org/packages/31/71/fa7e10fb772d273aa1f096ecb8ab8594117822f683bab7d2c5a89914c92a/yarl-1.22.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:437840083abe022c978470b942ff832c3940b2ad3734d424b7eaffcd07f76737", size = 357811, upload-time = "2025-10-06T14:09:03.445Z" }, + { url = "https://files.pythonhosted.org/packages/26/da/11374c04e8e1184a6a03cf9c8f5688d3e5cec83ed6f31ad3481b3207f709/yarl-1.22.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:a899cbd98dce6f5d8de1aad31cb712ec0a530abc0a86bd6edaa47c1090138467", size = 351223, upload-time = "2025-10-06T14:09:05.401Z" }, + { url = "https://files.pythonhosted.org/packages/82/8f/e2d01f161b0c034a30410e375e191a5d27608c1f8693bab1a08b089ca096/yarl-1.22.0-cp310-cp310-win32.whl", hash = "sha256:595697f68bd1f0c1c159fcb97b661fc9c3f5db46498043555d04805430e79bea", size = 82118, upload-time = "2025-10-06T14:09:11.148Z" }, + { url = "https://files.pythonhosted.org/packages/62/46/94c76196642dbeae634c7a61ba3da88cd77bed875bf6e4a8bed037505aa6/yarl-1.22.0-cp310-cp310-win_amd64.whl", hash = "sha256:cb95a9b1adaa48e41815a55ae740cfda005758104049a640a398120bf02515ca", size = 86852, upload-time = "2025-10-06T14:09:12.958Z" }, + { url = "https://files.pythonhosted.org/packages/af/af/7df4f179d3b1a6dcb9a4bd2ffbc67642746fcafdb62580e66876ce83fff4/yarl-1.22.0-cp310-cp310-win_arm64.whl", hash = "sha256:b85b982afde6df99ecc996990d4ad7ccbdbb70e2a4ba4de0aecde5922ba98a0b", size = 82012, upload-time = "2025-10-06T14:09:14.664Z" }, + { url = "https://files.pythonhosted.org/packages/4d/27/5ab13fc84c76a0250afd3d26d5936349a35be56ce5785447d6c423b26d92/yarl-1.22.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:1ab72135b1f2db3fed3997d7e7dc1b80573c67138023852b6efb336a5eae6511", size = 141607, upload-time = "2025-10-06T14:09:16.298Z" }, + { url = "https://files.pythonhosted.org/packages/6a/a1/d065d51d02dc02ce81501d476b9ed2229d9a990818332242a882d5d60340/yarl-1.22.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:669930400e375570189492dc8d8341301578e8493aec04aebc20d4717f899dd6", size = 94027, upload-time = "2025-10-06T14:09:17.786Z" }, + { url = "https://files.pythonhosted.org/packages/c1/da/8da9f6a53f67b5106ffe902c6fa0164e10398d4e150d85838b82f424072a/yarl-1.22.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:792a2af6d58177ef7c19cbf0097aba92ca1b9cb3ffdd9c7470e156c8f9b5e028", size = 94963, upload-time = "2025-10-06T14:09:19.662Z" }, + { url = "https://files.pythonhosted.org/packages/68/fe/2c1f674960c376e29cb0bec1249b117d11738db92a6ccc4a530b972648db/yarl-1.22.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3ea66b1c11c9150f1372f69afb6b8116f2dd7286f38e14ea71a44eee9ec51b9d", size = 368406, upload-time = "2025-10-06T14:09:21.402Z" }, + { url = "https://files.pythonhosted.org/packages/95/26/812a540e1c3c6418fec60e9bbd38e871eaba9545e94fa5eff8f4a8e28e1e/yarl-1.22.0-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3e2daa88dc91870215961e96a039ec73e4937da13cf77ce17f9cad0c18df3503", size = 336581, upload-time = "2025-10-06T14:09:22.98Z" }, + { url = "https://files.pythonhosted.org/packages/0b/f5/5777b19e26fdf98563985e481f8be3d8a39f8734147a6ebf459d0dab5a6b/yarl-1.22.0-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:ba440ae430c00eee41509353628600212112cd5018d5def7e9b05ea7ac34eb65", size = 388924, upload-time = "2025-10-06T14:09:24.655Z" }, + { url = "https://files.pythonhosted.org/packages/86/08/24bd2477bd59c0bbd994fe1d93b126e0472e4e3df5a96a277b0a55309e89/yarl-1.22.0-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:e6438cc8f23a9c1478633d216b16104a586b9761db62bfacb6425bac0a36679e", size = 392890, upload-time = "2025-10-06T14:09:26.617Z" }, + { url = "https://files.pythonhosted.org/packages/46/00/71b90ed48e895667ecfb1eaab27c1523ee2fa217433ed77a73b13205ca4b/yarl-1.22.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4c52a6e78aef5cf47a98ef8e934755abf53953379b7d53e68b15ff4420e6683d", size = 365819, upload-time = "2025-10-06T14:09:28.544Z" }, + { url = "https://files.pythonhosted.org/packages/30/2d/f715501cae832651d3282387c6a9236cd26bd00d0ff1e404b3dc52447884/yarl-1.22.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:3b06bcadaac49c70f4c88af4ffcfbe3dc155aab3163e75777818092478bcbbe7", size = 363601, upload-time = "2025-10-06T14:09:30.568Z" }, + { url = "https://files.pythonhosted.org/packages/f8/f9/a678c992d78e394e7126ee0b0e4e71bd2775e4334d00a9278c06a6cce96a/yarl-1.22.0-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:6944b2dc72c4d7f7052683487e3677456050ff77fcf5e6204e98caf785ad1967", size = 358072, upload-time = "2025-10-06T14:09:32.528Z" }, + { url = "https://files.pythonhosted.org/packages/2c/d1/b49454411a60edb6fefdcad4f8e6dbba7d8019e3a508a1c5836cba6d0781/yarl-1.22.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:d5372ca1df0f91a86b047d1277c2aaf1edb32d78bbcefffc81b40ffd18f027ed", size = 385311, upload-time = "2025-10-06T14:09:34.634Z" }, + { url = "https://files.pythonhosted.org/packages/87/e5/40d7a94debb8448c7771a916d1861d6609dddf7958dc381117e7ba36d9e8/yarl-1.22.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:51af598701f5299012b8416486b40fceef8c26fc87dc6d7d1f6fc30609ea0aa6", size = 381094, upload-time = "2025-10-06T14:09:36.268Z" }, + { url = "https://files.pythonhosted.org/packages/35/d8/611cc282502381ad855448643e1ad0538957fc82ae83dfe7762c14069e14/yarl-1.22.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:b266bd01fedeffeeac01a79ae181719ff848a5a13ce10075adbefc8f1daee70e", size = 370944, upload-time = "2025-10-06T14:09:37.872Z" }, + { url = "https://files.pythonhosted.org/packages/2d/df/fadd00fb1c90e1a5a8bd731fa3d3de2e165e5a3666a095b04e31b04d9cb6/yarl-1.22.0-cp311-cp311-win32.whl", hash = "sha256:a9b1ba5610a4e20f655258d5a1fdc7ebe3d837bb0e45b581398b99eb98b1f5ca", size = 81804, upload-time = "2025-10-06T14:09:39.359Z" }, + { url = "https://files.pythonhosted.org/packages/b5/f7/149bb6f45f267cb5c074ac40c01c6b3ea6d8a620d34b337f6321928a1b4d/yarl-1.22.0-cp311-cp311-win_amd64.whl", hash = "sha256:078278b9b0b11568937d9509b589ee83ef98ed6d561dfe2020e24a9fd08eaa2b", size = 86858, upload-time = "2025-10-06T14:09:41.068Z" }, + { url = "https://files.pythonhosted.org/packages/2b/13/88b78b93ad3f2f0b78e13bfaaa24d11cbc746e93fe76d8c06bf139615646/yarl-1.22.0-cp311-cp311-win_arm64.whl", hash = "sha256:b6a6f620cfe13ccec221fa312139135166e47ae169f8253f72a0abc0dae94376", size = 81637, upload-time = "2025-10-06T14:09:42.712Z" }, + { url = "https://files.pythonhosted.org/packages/75/ff/46736024fee3429b80a165a732e38e5d5a238721e634ab41b040d49f8738/yarl-1.22.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:e340382d1afa5d32b892b3ff062436d592ec3d692aeea3bef3a5cfe11bbf8c6f", size = 142000, upload-time = "2025-10-06T14:09:44.631Z" }, + { url = "https://files.pythonhosted.org/packages/5a/9a/b312ed670df903145598914770eb12de1bac44599549b3360acc96878df8/yarl-1.22.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:f1e09112a2c31ffe8d80be1b0988fa6a18c5d5cad92a9ffbb1c04c91bfe52ad2", size = 94338, upload-time = "2025-10-06T14:09:46.372Z" }, + { url = "https://files.pythonhosted.org/packages/ba/f5/0601483296f09c3c65e303d60c070a5c19fcdbc72daa061e96170785bc7d/yarl-1.22.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:939fe60db294c786f6b7c2d2e121576628468f65453d86b0fe36cb52f987bd74", size = 94909, upload-time = "2025-10-06T14:09:48.648Z" }, + { url = "https://files.pythonhosted.org/packages/60/41/9a1fe0b73dbcefce72e46cf149b0e0a67612d60bfc90fb59c2b2efdfbd86/yarl-1.22.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e1651bf8e0398574646744c1885a41198eba53dc8a9312b954073f845c90a8df", size = 372940, upload-time = "2025-10-06T14:09:50.089Z" }, + { url = "https://files.pythonhosted.org/packages/17/7a/795cb6dfee561961c30b800f0ed616b923a2ec6258b5def2a00bf8231334/yarl-1.22.0-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:b8a0588521a26bf92a57a1705b77b8b59044cdceccac7151bd8d229e66b8dedb", size = 345825, upload-time = "2025-10-06T14:09:52.142Z" }, + { url = "https://files.pythonhosted.org/packages/d7/93/a58f4d596d2be2ae7bab1a5846c4d270b894958845753b2c606d666744d3/yarl-1.22.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:42188e6a615c1a75bcaa6e150c3fe8f3e8680471a6b10150c5f7e83f47cc34d2", size = 386705, upload-time = "2025-10-06T14:09:54.128Z" }, + { url = "https://files.pythonhosted.org/packages/61/92/682279d0e099d0e14d7fd2e176bd04f48de1484f56546a3e1313cd6c8e7c/yarl-1.22.0-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f6d2cb59377d99718913ad9a151030d6f83ef420a2b8f521d94609ecc106ee82", size = 396518, upload-time = "2025-10-06T14:09:55.762Z" }, + { url = "https://files.pythonhosted.org/packages/db/0f/0d52c98b8a885aeda831224b78f3be7ec2e1aa4a62091f9f9188c3c65b56/yarl-1.22.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:50678a3b71c751d58d7908edc96d332af328839eea883bb554a43f539101277a", size = 377267, upload-time = "2025-10-06T14:09:57.958Z" }, + { url = "https://files.pythonhosted.org/packages/22/42/d2685e35908cbeaa6532c1fc73e89e7f2efb5d8a7df3959ea8e37177c5a3/yarl-1.22.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:1e8fbaa7cec507aa24ea27a01456e8dd4b6fab829059b69844bd348f2d467124", size = 365797, upload-time = "2025-10-06T14:09:59.527Z" }, + { url = "https://files.pythonhosted.org/packages/a2/83/cf8c7bcc6355631762f7d8bdab920ad09b82efa6b722999dfb05afa6cfac/yarl-1.22.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:433885ab5431bc3d3d4f2f9bd15bfa1614c522b0f1405d62c4f926ccd69d04fa", size = 365535, upload-time = "2025-10-06T14:10:01.139Z" }, + { url = "https://files.pythonhosted.org/packages/25/e1/5302ff9b28f0c59cac913b91fe3f16c59a033887e57ce9ca5d41a3a94737/yarl-1.22.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:b790b39c7e9a4192dc2e201a282109ed2985a1ddbd5ac08dc56d0e121400a8f7", size = 382324, upload-time = "2025-10-06T14:10:02.756Z" }, + { url = "https://files.pythonhosted.org/packages/bf/cd/4617eb60f032f19ae3a688dc990d8f0d89ee0ea378b61cac81ede3e52fae/yarl-1.22.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:31f0b53913220599446872d757257be5898019c85e7971599065bc55065dc99d", size = 383803, upload-time = "2025-10-06T14:10:04.552Z" }, + { url = "https://files.pythonhosted.org/packages/59/65/afc6e62bb506a319ea67b694551dab4a7e6fb7bf604e9bd9f3e11d575fec/yarl-1.22.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a49370e8f711daec68d09b821a34e1167792ee2d24d405cbc2387be4f158b520", size = 374220, upload-time = "2025-10-06T14:10:06.489Z" }, + { url = "https://files.pythonhosted.org/packages/e7/3d/68bf18d50dc674b942daec86a9ba922d3113d8399b0e52b9897530442da2/yarl-1.22.0-cp312-cp312-win32.whl", hash = "sha256:70dfd4f241c04bd9239d53b17f11e6ab672b9f1420364af63e8531198e3f5fe8", size = 81589, upload-time = "2025-10-06T14:10:09.254Z" }, + { url = "https://files.pythonhosted.org/packages/c8/9a/6ad1a9b37c2f72874f93e691b2e7ecb6137fb2b899983125db4204e47575/yarl-1.22.0-cp312-cp312-win_amd64.whl", hash = "sha256:8884d8b332a5e9b88e23f60bb166890009429391864c685e17bd73a9eda9105c", size = 87213, upload-time = "2025-10-06T14:10:11.369Z" }, + { url = "https://files.pythonhosted.org/packages/44/c5/c21b562d1680a77634d748e30c653c3ca918beb35555cff24986fff54598/yarl-1.22.0-cp312-cp312-win_arm64.whl", hash = "sha256:ea70f61a47f3cc93bdf8b2f368ed359ef02a01ca6393916bc8ff877427181e74", size = 81330, upload-time = "2025-10-06T14:10:13.112Z" }, + { url = "https://files.pythonhosted.org/packages/ea/f3/d67de7260456ee105dc1d162d43a019ecad6b91e2f51809d6cddaa56690e/yarl-1.22.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:8dee9c25c74997f6a750cd317b8ca63545169c098faee42c84aa5e506c819b53", size = 139980, upload-time = "2025-10-06T14:10:14.601Z" }, + { url = "https://files.pythonhosted.org/packages/01/88/04d98af0b47e0ef42597b9b28863b9060bb515524da0a65d5f4db160b2d5/yarl-1.22.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:01e73b85a5434f89fc4fe27dcda2aff08ddf35e4d47bbbea3bdcd25321af538a", size = 93424, upload-time = "2025-10-06T14:10:16.115Z" }, + { url = "https://files.pythonhosted.org/packages/18/91/3274b215fd8442a03975ce6bee5fe6aa57a8326b29b9d3d56234a1dca244/yarl-1.22.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:22965c2af250d20c873cdbee8ff958fb809940aeb2e74ba5f20aaf6b7ac8c70c", size = 93821, upload-time = "2025-10-06T14:10:17.993Z" }, + { url = "https://files.pythonhosted.org/packages/61/3a/caf4e25036db0f2da4ca22a353dfeb3c9d3c95d2761ebe9b14df8fc16eb0/yarl-1.22.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b4f15793aa49793ec8d1c708ab7f9eded1aa72edc5174cae703651555ed1b601", size = 373243, upload-time = "2025-10-06T14:10:19.44Z" }, + { url = "https://files.pythonhosted.org/packages/6e/9e/51a77ac7516e8e7803b06e01f74e78649c24ee1021eca3d6a739cb6ea49c/yarl-1.22.0-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e5542339dcf2747135c5c85f68680353d5cb9ffd741c0f2e8d832d054d41f35a", size = 342361, upload-time = "2025-10-06T14:10:21.124Z" }, + { url = "https://files.pythonhosted.org/packages/d4/f8/33b92454789dde8407f156c00303e9a891f1f51a0330b0fad7c909f87692/yarl-1.22.0-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5c401e05ad47a75869c3ab3e35137f8468b846770587e70d71e11de797d113df", size = 387036, upload-time = "2025-10-06T14:10:22.902Z" }, + { url = "https://files.pythonhosted.org/packages/d9/9a/c5db84ea024f76838220280f732970aa4ee154015d7f5c1bfb60a267af6f/yarl-1.22.0-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:243dda95d901c733f5b59214d28b0120893d91777cb8aa043e6ef059d3cddfe2", size = 397671, upload-time = "2025-10-06T14:10:24.523Z" }, + { url = "https://files.pythonhosted.org/packages/11/c9/cd8538dc2e7727095e0c1d867bad1e40c98f37763e6d995c1939f5fdc7b1/yarl-1.22.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bec03d0d388060058f5d291a813f21c011041938a441c593374da6077fe21b1b", size = 377059, upload-time = "2025-10-06T14:10:26.406Z" }, + { url = "https://files.pythonhosted.org/packages/a1/b9/ab437b261702ced75122ed78a876a6dec0a1b0f5e17a4ac7a9a2482d8abe/yarl-1.22.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:b0748275abb8c1e1e09301ee3cf90c8a99678a4e92e4373705f2a2570d581273", size = 365356, upload-time = "2025-10-06T14:10:28.461Z" }, + { url = "https://files.pythonhosted.org/packages/b2/9d/8e1ae6d1d008a9567877b08f0ce4077a29974c04c062dabdb923ed98e6fe/yarl-1.22.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:47fdb18187e2a4e18fda2c25c05d8251a9e4a521edaed757fef033e7d8498d9a", size = 361331, upload-time = "2025-10-06T14:10:30.541Z" }, + { url = "https://files.pythonhosted.org/packages/ca/5a/09b7be3905962f145b73beb468cdd53db8aa171cf18c80400a54c5b82846/yarl-1.22.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:c7044802eec4524fde550afc28edda0dd5784c4c45f0be151a2d3ba017daca7d", size = 382590, upload-time = "2025-10-06T14:10:33.352Z" }, + { url = "https://files.pythonhosted.org/packages/aa/7f/59ec509abf90eda5048b0bc3e2d7b5099dffdb3e6b127019895ab9d5ef44/yarl-1.22.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:139718f35149ff544caba20fce6e8a2f71f1e39b92c700d8438a0b1d2a631a02", size = 385316, upload-time = "2025-10-06T14:10:35.034Z" }, + { url = "https://files.pythonhosted.org/packages/e5/84/891158426bc8036bfdfd862fabd0e0fa25df4176ec793e447f4b85cf1be4/yarl-1.22.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e1b51bebd221006d3d2f95fbe124b22b247136647ae5dcc8c7acafba66e5ee67", size = 374431, upload-time = "2025-10-06T14:10:37.76Z" }, + { url = "https://files.pythonhosted.org/packages/bb/49/03da1580665baa8bef5e8ed34c6df2c2aca0a2f28bf397ed238cc1bbc6f2/yarl-1.22.0-cp313-cp313-win32.whl", hash = "sha256:d3e32536234a95f513bd374e93d717cf6b2231a791758de6c509e3653f234c95", size = 81555, upload-time = "2025-10-06T14:10:39.649Z" }, + { url = "https://files.pythonhosted.org/packages/9a/ee/450914ae11b419eadd067c6183ae08381cfdfcb9798b90b2b713bbebddda/yarl-1.22.0-cp313-cp313-win_amd64.whl", hash = "sha256:47743b82b76d89a1d20b83e60d5c20314cbd5ba2befc9cda8f28300c4a08ed4d", size = 86965, upload-time = "2025-10-06T14:10:41.313Z" }, + { url = "https://files.pythonhosted.org/packages/98/4d/264a01eae03b6cf629ad69bae94e3b0e5344741e929073678e84bf7a3e3b/yarl-1.22.0-cp313-cp313-win_arm64.whl", hash = "sha256:5d0fcda9608875f7d052eff120c7a5da474a6796fe4d83e152e0e4d42f6d1a9b", size = 81205, upload-time = "2025-10-06T14:10:43.167Z" }, + { url = "https://files.pythonhosted.org/packages/88/fc/6908f062a2f77b5f9f6d69cecb1747260831ff206adcbc5b510aff88df91/yarl-1.22.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:719ae08b6972befcba4310e49edb1161a88cdd331e3a694b84466bd938a6ab10", size = 146209, upload-time = "2025-10-06T14:10:44.643Z" }, + { url = "https://files.pythonhosted.org/packages/65/47/76594ae8eab26210b4867be6f49129861ad33da1f1ebdf7051e98492bf62/yarl-1.22.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:47d8a5c446df1c4db9d21b49619ffdba90e77c89ec6e283f453856c74b50b9e3", size = 95966, upload-time = "2025-10-06T14:10:46.554Z" }, + { url = "https://files.pythonhosted.org/packages/ab/ce/05e9828a49271ba6b5b038b15b3934e996980dd78abdfeb52a04cfb9467e/yarl-1.22.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:cfebc0ac8333520d2d0423cbbe43ae43c8838862ddb898f5ca68565e395516e9", size = 97312, upload-time = "2025-10-06T14:10:48.007Z" }, + { url = "https://files.pythonhosted.org/packages/d1/c5/7dffad5e4f2265b29c9d7ec869c369e4223166e4f9206fc2243ee9eea727/yarl-1.22.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4398557cbf484207df000309235979c79c4356518fd5c99158c7d38203c4da4f", size = 361967, upload-time = "2025-10-06T14:10:49.997Z" }, + { url = "https://files.pythonhosted.org/packages/50/b2/375b933c93a54bff7fc041e1a6ad2c0f6f733ffb0c6e642ce56ee3b39970/yarl-1.22.0-cp313-cp313t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:2ca6fd72a8cd803be290d42f2dec5cdcd5299eeb93c2d929bf060ad9efaf5de0", size = 323949, upload-time = "2025-10-06T14:10:52.004Z" }, + { url = "https://files.pythonhosted.org/packages/66/50/bfc2a29a1d78644c5a7220ce2f304f38248dc94124a326794e677634b6cf/yarl-1.22.0-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:ca1f59c4e1ab6e72f0a23c13fca5430f889634166be85dbf1013683e49e3278e", size = 361818, upload-time = "2025-10-06T14:10:54.078Z" }, + { url = "https://files.pythonhosted.org/packages/46/96/f3941a46af7d5d0f0498f86d71275696800ddcdd20426298e572b19b91ff/yarl-1.22.0-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:6c5010a52015e7c70f86eb967db0f37f3c8bd503a695a49f8d45700144667708", size = 372626, upload-time = "2025-10-06T14:10:55.767Z" }, + { url = "https://files.pythonhosted.org/packages/c1/42/8b27c83bb875cd89448e42cd627e0fb971fa1675c9ec546393d18826cb50/yarl-1.22.0-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9d7672ecf7557476642c88497c2f8d8542f8e36596e928e9bcba0e42e1e7d71f", size = 341129, upload-time = "2025-10-06T14:10:57.985Z" }, + { url = "https://files.pythonhosted.org/packages/49/36/99ca3122201b382a3cf7cc937b95235b0ac944f7e9f2d5331d50821ed352/yarl-1.22.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:3b7c88eeef021579d600e50363e0b6ee4f7f6f728cd3486b9d0f3ee7b946398d", size = 346776, upload-time = "2025-10-06T14:10:59.633Z" }, + { url = "https://files.pythonhosted.org/packages/85/b4/47328bf996acd01a4c16ef9dcd2f59c969f495073616586f78cd5f2efb99/yarl-1.22.0-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:f4afb5c34f2c6fecdcc182dfcfc6af6cccf1aa923eed4d6a12e9d96904e1a0d8", size = 334879, upload-time = "2025-10-06T14:11:01.454Z" }, + { url = "https://files.pythonhosted.org/packages/c2/ad/b77d7b3f14a4283bffb8e92c6026496f6de49751c2f97d4352242bba3990/yarl-1.22.0-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:59c189e3e99a59cf8d83cbb31d4db02d66cda5a1a4374e8a012b51255341abf5", size = 350996, upload-time = "2025-10-06T14:11:03.452Z" }, + { url = "https://files.pythonhosted.org/packages/81/c8/06e1d69295792ba54d556f06686cbd6a7ce39c22307100e3fb4a2c0b0a1d/yarl-1.22.0-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:5a3bf7f62a289fa90f1990422dc8dff5a458469ea71d1624585ec3a4c8d6960f", size = 356047, upload-time = "2025-10-06T14:11:05.115Z" }, + { url = "https://files.pythonhosted.org/packages/4b/b8/4c0e9e9f597074b208d18cef227d83aac36184bfbc6eab204ea55783dbc5/yarl-1.22.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:de6b9a04c606978fdfe72666fa216ffcf2d1a9f6a381058d4378f8d7b1e5de62", size = 342947, upload-time = "2025-10-06T14:11:08.137Z" }, + { url = "https://files.pythonhosted.org/packages/e0/e5/11f140a58bf4c6ad7aca69a892bff0ee638c31bea4206748fc0df4ebcb3a/yarl-1.22.0-cp313-cp313t-win32.whl", hash = "sha256:1834bb90991cc2999f10f97f5f01317f99b143284766d197e43cd5b45eb18d03", size = 86943, upload-time = "2025-10-06T14:11:10.284Z" }, + { url = "https://files.pythonhosted.org/packages/31/74/8b74bae38ed7fe6793d0c15a0c8207bbb819cf287788459e5ed230996cdd/yarl-1.22.0-cp313-cp313t-win_amd64.whl", hash = "sha256:ff86011bd159a9d2dfc89c34cfd8aff12875980e3bd6a39ff097887520e60249", size = 93715, upload-time = "2025-10-06T14:11:11.739Z" }, + { url = "https://files.pythonhosted.org/packages/69/66/991858aa4b5892d57aef7ee1ba6b4d01ec3b7eb3060795d34090a3ca3278/yarl-1.22.0-cp313-cp313t-win_arm64.whl", hash = "sha256:7861058d0582b847bc4e3a4a4c46828a410bca738673f35a29ba3ca5db0b473b", size = 83857, upload-time = "2025-10-06T14:11:13.586Z" }, + { url = "https://files.pythonhosted.org/packages/46/b3/e20ef504049f1a1c54a814b4b9bed96d1ac0e0610c3b4da178f87209db05/yarl-1.22.0-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:34b36c2c57124530884d89d50ed2c1478697ad7473efd59cfd479945c95650e4", size = 140520, upload-time = "2025-10-06T14:11:15.465Z" }, + { url = "https://files.pythonhosted.org/packages/e4/04/3532d990fdbab02e5ede063676b5c4260e7f3abea2151099c2aa745acc4c/yarl-1.22.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:0dd9a702591ca2e543631c2a017e4a547e38a5c0f29eece37d9097e04a7ac683", size = 93504, upload-time = "2025-10-06T14:11:17.106Z" }, + { url = "https://files.pythonhosted.org/packages/11/63/ff458113c5c2dac9a9719ac68ee7c947cb621432bcf28c9972b1c0e83938/yarl-1.22.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:594fcab1032e2d2cc3321bb2e51271e7cd2b516c7d9aee780ece81b07ff8244b", size = 94282, upload-time = "2025-10-06T14:11:19.064Z" }, + { url = "https://files.pythonhosted.org/packages/a7/bc/315a56aca762d44a6aaaf7ad253f04d996cb6b27bad34410f82d76ea8038/yarl-1.22.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f3d7a87a78d46a2e3d5b72587ac14b4c16952dd0887dbb051451eceac774411e", size = 372080, upload-time = "2025-10-06T14:11:20.996Z" }, + { url = "https://files.pythonhosted.org/packages/3f/3f/08e9b826ec2e099ea6e7c69a61272f4f6da62cb5b1b63590bb80ca2e4a40/yarl-1.22.0-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:852863707010316c973162e703bddabec35e8757e67fcb8ad58829de1ebc8590", size = 338696, upload-time = "2025-10-06T14:11:22.847Z" }, + { url = "https://files.pythonhosted.org/packages/e3/9f/90360108e3b32bd76789088e99538febfea24a102380ae73827f62073543/yarl-1.22.0-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:131a085a53bfe839a477c0845acf21efc77457ba2bcf5899618136d64f3303a2", size = 387121, upload-time = "2025-10-06T14:11:24.889Z" }, + { url = "https://files.pythonhosted.org/packages/98/92/ab8d4657bd5b46a38094cfaea498f18bb70ce6b63508fd7e909bd1f93066/yarl-1.22.0-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:078a8aefd263f4d4f923a9677b942b445a2be970ca24548a8102689a3a8ab8da", size = 394080, upload-time = "2025-10-06T14:11:27.307Z" }, + { url = "https://files.pythonhosted.org/packages/f5/e7/d8c5a7752fef68205296201f8ec2bf718f5c805a7a7e9880576c67600658/yarl-1.22.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bca03b91c323036913993ff5c738d0842fc9c60c4648e5c8d98331526df89784", size = 372661, upload-time = "2025-10-06T14:11:29.387Z" }, + { url = "https://files.pythonhosted.org/packages/b6/2e/f4d26183c8db0bb82d491b072f3127fb8c381a6206a3a56332714b79b751/yarl-1.22.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:68986a61557d37bb90d3051a45b91fa3d5c516d177dfc6dd6f2f436a07ff2b6b", size = 364645, upload-time = "2025-10-06T14:11:31.423Z" }, + { url = "https://files.pythonhosted.org/packages/80/7c/428e5812e6b87cd00ee8e898328a62c95825bf37c7fa87f0b6bb2ad31304/yarl-1.22.0-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:4792b262d585ff0dff6bcb787f8492e40698443ec982a3568c2096433660c694", size = 355361, upload-time = "2025-10-06T14:11:33.055Z" }, + { url = "https://files.pythonhosted.org/packages/ec/2a/249405fd26776f8b13c067378ef4d7dd49c9098d1b6457cdd152a99e96a9/yarl-1.22.0-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:ebd4549b108d732dba1d4ace67614b9545b21ece30937a63a65dd34efa19732d", size = 381451, upload-time = "2025-10-06T14:11:35.136Z" }, + { url = "https://files.pythonhosted.org/packages/67/a8/fb6b1adbe98cf1e2dd9fad71003d3a63a1bc22459c6e15f5714eb9323b93/yarl-1.22.0-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:f87ac53513d22240c7d59203f25cc3beac1e574c6cd681bbfd321987b69f95fd", size = 383814, upload-time = "2025-10-06T14:11:37.094Z" }, + { url = "https://files.pythonhosted.org/packages/d9/f9/3aa2c0e480fb73e872ae2814c43bc1e734740bb0d54e8cb2a95925f98131/yarl-1.22.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:22b029f2881599e2f1b06f8f1db2ee63bd309e2293ba2d566e008ba12778b8da", size = 370799, upload-time = "2025-10-06T14:11:38.83Z" }, + { url = "https://files.pythonhosted.org/packages/50/3c/af9dba3b8b5eeb302f36f16f92791f3ea62e3f47763406abf6d5a4a3333b/yarl-1.22.0-cp314-cp314-win32.whl", hash = "sha256:6a635ea45ba4ea8238463b4f7d0e721bad669f80878b7bfd1f89266e2ae63da2", size = 82990, upload-time = "2025-10-06T14:11:40.624Z" }, + { url = "https://files.pythonhosted.org/packages/ac/30/ac3a0c5bdc1d6efd1b41fa24d4897a4329b3b1e98de9449679dd327af4f0/yarl-1.22.0-cp314-cp314-win_amd64.whl", hash = "sha256:0d6e6885777af0f110b0e5d7e5dda8b704efed3894da26220b7f3d887b839a79", size = 88292, upload-time = "2025-10-06T14:11:42.578Z" }, + { url = "https://files.pythonhosted.org/packages/df/0a/227ab4ff5b998a1b7410abc7b46c9b7a26b0ca9e86c34ba4b8d8bc7c63d5/yarl-1.22.0-cp314-cp314-win_arm64.whl", hash = "sha256:8218f4e98d3c10d683584cb40f0424f4b9fd6e95610232dd75e13743b070ee33", size = 82888, upload-time = "2025-10-06T14:11:44.863Z" }, + { url = "https://files.pythonhosted.org/packages/06/5e/a15eb13db90abd87dfbefb9760c0f3f257ac42a5cac7e75dbc23bed97a9f/yarl-1.22.0-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:45c2842ff0e0d1b35a6bf1cd6c690939dacb617a70827f715232b2e0494d55d1", size = 146223, upload-time = "2025-10-06T14:11:46.796Z" }, + { url = "https://files.pythonhosted.org/packages/18/82/9665c61910d4d84f41a5bf6837597c89e665fa88aa4941080704645932a9/yarl-1.22.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:d947071e6ebcf2e2bee8fce76e10faca8f7a14808ca36a910263acaacef08eca", size = 95981, upload-time = "2025-10-06T14:11:48.845Z" }, + { url = "https://files.pythonhosted.org/packages/5d/9a/2f65743589809af4d0a6d3aa749343c4b5f4c380cc24a8e94a3c6625a808/yarl-1.22.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:334b8721303e61b00019474cc103bdac3d7b1f65e91f0bfedeec2d56dfe74b53", size = 97303, upload-time = "2025-10-06T14:11:50.897Z" }, + { url = "https://files.pythonhosted.org/packages/b0/ab/5b13d3e157505c43c3b43b5a776cbf7b24a02bc4cccc40314771197e3508/yarl-1.22.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1e7ce67c34138a058fd092f67d07a72b8e31ff0c9236e751957465a24b28910c", size = 361820, upload-time = "2025-10-06T14:11:52.549Z" }, + { url = "https://files.pythonhosted.org/packages/fb/76/242a5ef4677615cf95330cfc1b4610e78184400699bdda0acb897ef5e49a/yarl-1.22.0-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:d77e1b2c6d04711478cb1c4ab90db07f1609ccf06a287d5607fcd90dc9863acf", size = 323203, upload-time = "2025-10-06T14:11:54.225Z" }, + { url = "https://files.pythonhosted.org/packages/8c/96/475509110d3f0153b43d06164cf4195c64d16999e0c7e2d8a099adcd6907/yarl-1.22.0-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c4647674b6150d2cae088fc07de2738a84b8bcedebef29802cf0b0a82ab6face", size = 363173, upload-time = "2025-10-06T14:11:56.069Z" }, + { url = "https://files.pythonhosted.org/packages/c9/66/59db471aecfbd559a1fd48aedd954435558cd98c7d0da8b03cc6c140a32c/yarl-1.22.0-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:efb07073be061c8f79d03d04139a80ba33cbd390ca8f0297aae9cce6411e4c6b", size = 373562, upload-time = "2025-10-06T14:11:58.783Z" }, + { url = "https://files.pythonhosted.org/packages/03/1f/c5d94abc91557384719da10ff166b916107c1b45e4d0423a88457071dd88/yarl-1.22.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e51ac5435758ba97ad69617e13233da53908beccc6cfcd6c34bbed8dcbede486", size = 339828, upload-time = "2025-10-06T14:12:00.686Z" }, + { url = "https://files.pythonhosted.org/packages/5f/97/aa6a143d3afba17b6465733681c70cf175af89f76ec8d9286e08437a7454/yarl-1.22.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:33e32a0dd0c8205efa8e83d04fc9f19313772b78522d1bdc7d9aed706bfd6138", size = 347551, upload-time = "2025-10-06T14:12:02.628Z" }, + { url = "https://files.pythonhosted.org/packages/43/3c/45a2b6d80195959239a7b2a8810506d4eea5487dce61c2a3393e7fc3c52e/yarl-1.22.0-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:bf4a21e58b9cde0e401e683ebd00f6ed30a06d14e93f7c8fd059f8b6e8f87b6a", size = 334512, upload-time = "2025-10-06T14:12:04.871Z" }, + { url = "https://files.pythonhosted.org/packages/86/a0/c2ab48d74599c7c84cb104ebd799c5813de252bea0f360ffc29d270c2caa/yarl-1.22.0-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:e4b582bab49ac33c8deb97e058cd67c2c50dac0dd134874106d9c774fd272529", size = 352400, upload-time = "2025-10-06T14:12:06.624Z" }, + { url = "https://files.pythonhosted.org/packages/32/75/f8919b2eafc929567d3d8411f72bdb1a2109c01caaab4ebfa5f8ffadc15b/yarl-1.22.0-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:0b5bcc1a9c4839e7e30b7b30dd47fe5e7e44fb7054ec29b5bb8d526aa1041093", size = 357140, upload-time = "2025-10-06T14:12:08.362Z" }, + { url = "https://files.pythonhosted.org/packages/cf/72/6a85bba382f22cf78add705d8c3731748397d986e197e53ecc7835e76de7/yarl-1.22.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:c0232bce2170103ec23c454e54a57008a9a72b5d1c3105dc2496750da8cfa47c", size = 341473, upload-time = "2025-10-06T14:12:10.994Z" }, + { url = "https://files.pythonhosted.org/packages/35/18/55e6011f7c044dc80b98893060773cefcfdbf60dfefb8cb2f58b9bacbd83/yarl-1.22.0-cp314-cp314t-win32.whl", hash = "sha256:8009b3173bcd637be650922ac455946197d858b3630b6d8787aa9e5c4564533e", size = 89056, upload-time = "2025-10-06T14:12:13.317Z" }, + { url = "https://files.pythonhosted.org/packages/f9/86/0f0dccb6e59a9e7f122c5afd43568b1d31b8ab7dda5f1b01fb5c7025c9a9/yarl-1.22.0-cp314-cp314t-win_amd64.whl", hash = "sha256:9fb17ea16e972c63d25d4a97f016d235c78dd2344820eb35bc034bc32012ee27", size = 96292, upload-time = "2025-10-06T14:12:15.398Z" }, + { url = "https://files.pythonhosted.org/packages/48/b7/503c98092fb3b344a179579f55814b613c1fbb1c23b3ec14a7b008a66a6e/yarl-1.22.0-cp314-cp314t-win_arm64.whl", hash = "sha256:9f6d73c1436b934e3f01df1e1b21ff765cd1d28c77dfb9ace207f746d4610ee1", size = 85171, upload-time = "2025-10-06T14:12:16.935Z" }, + { url = "https://files.pythonhosted.org/packages/94/fd/6480106702a79bcceda5fd9c63cb19a04a6506bd5ce7fd8d9b63742f0021/yarl-1.22.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:3aa27acb6de7a23785d81557577491f6c38a5209a254d1191519d07d8fe51748", size = 141301, upload-time = "2025-10-06T14:12:19.01Z" }, + { url = "https://files.pythonhosted.org/packages/42/e1/6d95d21b17a93e793e4ec420a925fe1f6a9342338ca7a563ed21129c0990/yarl-1.22.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:af74f05666a5e531289cb1cc9c883d1de2088b8e5b4de48004e5ca8a830ac859", size = 93864, upload-time = "2025-10-06T14:12:21.05Z" }, + { url = "https://files.pythonhosted.org/packages/32/58/b8055273c203968e89808413ea4c984988b6649baabf10f4522e67c22d2f/yarl-1.22.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:62441e55958977b8167b2709c164c91a6363e25da322d87ae6dd9c6019ceecf9", size = 94706, upload-time = "2025-10-06T14:12:23.287Z" }, + { url = "https://files.pythonhosted.org/packages/18/91/d7bfbc28a88c2895ecd0da6a874def0c147de78afc52c773c28e1aa233a3/yarl-1.22.0-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b580e71cac3f8113d3135888770903eaf2f507e9421e5697d6ee6d8cd1c7f054", size = 347100, upload-time = "2025-10-06T14:12:28.527Z" }, + { url = "https://files.pythonhosted.org/packages/bd/e8/37a1e7b99721c0564b1fc7b0a4d1f595ef6fb8060d82ca61775b644185f7/yarl-1.22.0-cp39-cp39-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e81fda2fb4a07eda1a2252b216aa0df23ebcd4d584894e9612e80999a78fd95b", size = 318902, upload-time = "2025-10-06T14:12:30.528Z" }, + { url = "https://files.pythonhosted.org/packages/1c/ef/34724449d7ef2db4f22df644f2dac0b8a275d20f585e526937b3ae47b02d/yarl-1.22.0-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:99b6fc1d55782461b78221e95fc357b47ad98b041e8e20f47c1411d0aacddc60", size = 363302, upload-time = "2025-10-06T14:12:32.295Z" }, + { url = "https://files.pythonhosted.org/packages/8a/04/88a39a5dad39889f192cce8d66cc4c58dbeca983e83f9b6bf23822a7ed91/yarl-1.22.0-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:088e4e08f033db4be2ccd1f34cf29fe994772fb54cfe004bbf54db320af56890", size = 370816, upload-time = "2025-10-06T14:12:34.01Z" }, + { url = "https://files.pythonhosted.org/packages/6b/1f/5e895e547129413f56c76be2c3ce4b96c797d2d0ff3e16a817d9269b12e6/yarl-1.22.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2e4e1f6f0b4da23e61188676e3ed027ef0baa833a2e633c29ff8530800edccba", size = 346465, upload-time = "2025-10-06T14:12:35.977Z" }, + { url = "https://files.pythonhosted.org/packages/11/13/a750e9fd6f9cc9ed3a52a70fe58ffe505322f0efe0d48e1fd9ffe53281f5/yarl-1.22.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:84fc3ec96fce86ce5aa305eb4aa9358279d1aa644b71fab7b8ed33fe3ba1a7ca", size = 341506, upload-time = "2025-10-06T14:12:37.788Z" }, + { url = "https://files.pythonhosted.org/packages/3c/67/bb6024de76e7186611ebe626aec5b71a2d2ecf9453e795f2dbd80614784c/yarl-1.22.0-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:5dbeefd6ca588b33576a01b0ad58aa934bc1b41ef89dee505bf2932b22ddffba", size = 335030, upload-time = "2025-10-06T14:12:39.775Z" }, + { url = "https://files.pythonhosted.org/packages/a2/be/50b38447fd94a7992996a62b8b463d0579323fcfc08c61bdba949eef8a5d/yarl-1.22.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:14291620375b1060613f4aab9ebf21850058b6b1b438f386cc814813d901c60b", size = 358560, upload-time = "2025-10-06T14:12:41.547Z" }, + { url = "https://files.pythonhosted.org/packages/e2/89/c020b6f547578c4e3dbb6335bf918f26e2f34ad0d1e515d72fd33ac0c635/yarl-1.22.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:a4fcfc8eb2c34148c118dfa02e6427ca278bfd0f3df7c5f99e33d2c0e81eae3e", size = 357290, upload-time = "2025-10-06T14:12:43.861Z" }, + { url = "https://files.pythonhosted.org/packages/8c/52/c49a619ee35a402fa3a7019a4fa8d26878fec0d1243f6968bbf516789578/yarl-1.22.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:029866bde8d7b0878b9c160e72305bbf0a7342bcd20b9999381704ae03308dc8", size = 350700, upload-time = "2025-10-06T14:12:46.868Z" }, + { url = "https://files.pythonhosted.org/packages/ab/c9/f5042d87777bf6968435f04a2bbb15466b2f142e6e47fa4f34d1a3f32f0c/yarl-1.22.0-cp39-cp39-win32.whl", hash = "sha256:4dcc74149ccc8bba31ce1944acee24813e93cfdee2acda3c172df844948ddf7b", size = 82323, upload-time = "2025-10-06T14:12:48.633Z" }, + { url = "https://files.pythonhosted.org/packages/fd/58/d00f7cad9eba20c4eefac2682f34661d1d1b3a942fc0092eb60e78cfb733/yarl-1.22.0-cp39-cp39-win_amd64.whl", hash = "sha256:10619d9fdee46d20edc49d3479e2f8269d0779f1b031e6f7c2aa1c76be04b7ed", size = 87145, upload-time = "2025-10-06T14:12:50.241Z" }, + { url = "https://files.pythonhosted.org/packages/c2/a3/70904f365080780d38b919edd42d224b8c4ce224a86950d2eaa2a24366ad/yarl-1.22.0-cp39-cp39-win_arm64.whl", hash = "sha256:dd7afd3f8b0bfb4e0d9fc3c31bfe8a4ec7debe124cfd90619305def3c8ca8cd2", size = 82173, upload-time = "2025-10-06T14:12:51.869Z" }, + { url = "https://files.pythonhosted.org/packages/73/ae/b48f95715333080afb75a4504487cbe142cae1268afc482d06692d605ae6/yarl-1.22.0-py3-none-any.whl", hash = "sha256:1380560bdba02b6b6c90de54133c81c9f2a453dee9912fe58c1dcced1edb7cff", size = 46814, upload-time = "2025-10-06T14:12:53.872Z" }, ] [[package]] name = "zipp" -version = "3.21.0" +version = "3.23.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/3f/50/bad581df71744867e9468ebd0bcd6505de3b275e06f202c2cb016e3ff56f/zipp-3.21.0.tar.gz", hash = "sha256:2c9958f6430a2040341a52eb608ed6dd93ef4392e02ffe219417c1b28b5dd1f4", size = 24545, upload-time = "2024-11-10T15:05:20.202Z" } +sdist = { url = "https://files.pythonhosted.org/packages/e3/02/0f2892c661036d50ede074e376733dca2ae7c6eb617489437771209d4180/zipp-3.23.0.tar.gz", hash = "sha256:a07157588a12518c9d4034df3fbbee09c814741a33ff63c05fa29d26a2404166", size = 25547, upload-time = "2025-06-08T17:06:39.4Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/b7/1a/7e4798e9339adc931158c9d69ecc34f5e6791489d469f5e50ec15e35f458/zipp-3.21.0-py3-none-any.whl", hash = "sha256:ac1bbe05fd2991f160ebce24ffbac5f6d11d83dc90891255885223d42b3cd931", size = 9630, upload-time = "2024-11-10T15:05:19.275Z" }, + { url = "https://files.pythonhosted.org/packages/2e/54/647ade08bf0db230bfea292f893923872fd20be6ac6f53b2b936ba839d75/zipp-3.23.0-py3-none-any.whl", hash = "sha256:071652d6115ed432f5ce1d34c336c0adfd6a884660d1e9712a256d3d3bd4b14e", size = 10276, upload-time = "2025-06-08T17:06:38.034Z" }, ] From 85e9af57a9fa3af1a35aa2b6858ebe7a1c37c724 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 28 Nov 2025 03:09:15 +0000 Subject: [PATCH 914/993] fix: ensure streams are always closed --- src/runloop_api_client/_streaming.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/runloop_api_client/_streaming.py b/src/runloop_api_client/_streaming.py index ed46fe26f..4dcc62b7c 100644 --- a/src/runloop_api_client/_streaming.py +++ b/src/runloop_api_client/_streaming.py @@ -54,11 +54,12 @@ def __stream__(self) -> Iterator[_T]: process_data = self._client._process_response_data iterator = self._iter_events() - for sse in iterator: - yield process_data(data=sse.json(), cast_to=cast_to, response=response) - - # As we might not fully consume the response stream, we need to close it explicitly - response.close() + try: + for sse in iterator: + yield process_data(data=sse.json(), cast_to=cast_to, response=response) + finally: + # Ensure the response is closed even if the consumer doesn't read all data + response.close() def __enter__(self) -> Self: return self @@ -117,11 +118,12 @@ async def __stream__(self) -> AsyncIterator[_T]: process_data = self._client._process_response_data iterator = self._iter_events() - async for sse in iterator: - yield process_data(data=sse.json(), cast_to=cast_to, response=response) - - # As we might not fully consume the response stream, we need to close it explicitly - await response.aclose() + try: + async for sse in iterator: + yield process_data(data=sse.json(), cast_to=cast_to, response=response) + finally: + # Ensure the response is closed even if the consumer doesn't read all data + await response.aclose() async def __aenter__(self) -> Self: return self From bfd41919401f3544e4271106b4c56988ff099616 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 28 Nov 2025 03:10:09 +0000 Subject: [PATCH 915/993] chore(deps): mypy 1.18.1 has a regression, pin to 1.17 --- pyproject.toml | 2 +- requirements-dev.lock | 4 +-- uv.lock | 84 ++++++++++++++++++++----------------------- 3 files changed, 42 insertions(+), 48 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 749dd15f7..b560c10f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,7 +55,7 @@ conflicts = [ # version pins are in uv.lock dev = [ "pyright==1.1.399", - "mypy", + "mypy==1.17", "respx", "pytest", "pytest-asyncio", diff --git a/requirements-dev.lock b/requirements-dev.lock index bdd2eecdb..f0bf13c48 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -47,7 +47,7 @@ markdown-it-py==4.0.0 ; python_full_version >= '3.10' # via rich mdurl==0.1.2 # via markdown-it-py -mypy==1.18.2 +mypy==1.17.0 mypy-extensions==1.1.0 # via mypy nodeenv==1.9.1 @@ -58,7 +58,7 @@ pathspec==0.12.1 # via mypy pluggy==1.6.0 # via pytest -pydantic==2.12.4 +pydantic==2.12.5 # via runloop-api-client pydantic-core==2.41.5 # via pydantic diff --git a/uv.lock b/uv.lock index e89970ac1..0d8cdbf41 100644 --- a/uv.lock +++ b/uv.lock @@ -717,7 +717,7 @@ wheels = [ [[package]] name = "mypy" -version = "1.18.2" +version = "1.17.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "mypy-extensions" }, @@ -725,45 +725,39 @@ dependencies = [ { name = "tomli", marker = "python_full_version < '3.11' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/c0/77/8f0d0001ffad290cef2f7f216f96c814866248a0b92a722365ed54648e7e/mypy-1.18.2.tar.gz", hash = "sha256:06a398102a5f203d7477b2923dda3634c36727fa5c237d8f859ef90c42a9924b", size = 3448846, upload-time = "2025-09-19T00:11:10.519Z" } +sdist = { url = "https://files.pythonhosted.org/packages/1e/e3/034322d5a779685218ed69286c32faa505247f1f096251ef66c8fd203b08/mypy-1.17.0.tar.gz", hash = "sha256:e5d7ccc08ba089c06e2f5629c660388ef1fee708444f1dee0b9203fa031dee03", size = 3352114, upload-time = "2025-07-14T20:34:30.181Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/03/6f/657961a0743cff32e6c0611b63ff1c1970a0b482ace35b069203bf705187/mypy-1.18.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c1eab0cf6294dafe397c261a75f96dc2c31bffe3b944faa24db5def4e2b0f77c", size = 12807973, upload-time = "2025-09-19T00:10:35.282Z" }, - { url = "https://files.pythonhosted.org/packages/10/e9/420822d4f661f13ca8900f5fa239b40ee3be8b62b32f3357df9a3045a08b/mypy-1.18.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:7a780ca61fc239e4865968ebc5240bb3bf610ef59ac398de9a7421b54e4a207e", size = 11896527, upload-time = "2025-09-19T00:10:55.791Z" }, - { url = "https://files.pythonhosted.org/packages/aa/73/a05b2bbaa7005f4642fcfe40fb73f2b4fb6bb44229bd585b5878e9a87ef8/mypy-1.18.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:448acd386266989ef11662ce3c8011fd2a7b632e0ec7d61a98edd8e27472225b", size = 12507004, upload-time = "2025-09-19T00:11:05.411Z" }, - { url = "https://files.pythonhosted.org/packages/4f/01/f6e4b9f0d031c11ccbd6f17da26564f3a0f3c4155af344006434b0a05a9d/mypy-1.18.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f9e171c465ad3901dc652643ee4bffa8e9fef4d7d0eece23b428908c77a76a66", size = 13245947, upload-time = "2025-09-19T00:10:46.923Z" }, - { url = "https://files.pythonhosted.org/packages/d7/97/19727e7499bfa1ae0773d06afd30ac66a58ed7437d940c70548634b24185/mypy-1.18.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:592ec214750bc00741af1f80cbf96b5013d81486b7bb24cb052382c19e40b428", size = 13499217, upload-time = "2025-09-19T00:09:39.472Z" }, - { url = "https://files.pythonhosted.org/packages/9f/4f/90dc8c15c1441bf31cf0f9918bb077e452618708199e530f4cbd5cede6ff/mypy-1.18.2-cp310-cp310-win_amd64.whl", hash = "sha256:7fb95f97199ea11769ebe3638c29b550b5221e997c63b14ef93d2e971606ebed", size = 9766753, upload-time = "2025-09-19T00:10:49.161Z" }, - { url = "https://files.pythonhosted.org/packages/88/87/cafd3ae563f88f94eec33f35ff722d043e09832ea8530ef149ec1efbaf08/mypy-1.18.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:807d9315ab9d464125aa9fcf6d84fde6e1dc67da0b6f80e7405506b8ac72bc7f", size = 12731198, upload-time = "2025-09-19T00:09:44.857Z" }, - { url = "https://files.pythonhosted.org/packages/0f/e0/1e96c3d4266a06d4b0197ace5356d67d937d8358e2ee3ffac71faa843724/mypy-1.18.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:776bb00de1778caf4db739c6e83919c1d85a448f71979b6a0edd774ea8399341", size = 11817879, upload-time = "2025-09-19T00:09:47.131Z" }, - { url = "https://files.pythonhosted.org/packages/72/ef/0c9ba89eb03453e76bdac5a78b08260a848c7bfc5d6603634774d9cd9525/mypy-1.18.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1379451880512ffce14505493bd9fe469e0697543717298242574882cf8cdb8d", size = 12427292, upload-time = "2025-09-19T00:10:22.472Z" }, - { url = "https://files.pythonhosted.org/packages/1a/52/ec4a061dd599eb8179d5411d99775bec2a20542505988f40fc2fee781068/mypy-1.18.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1331eb7fd110d60c24999893320967594ff84c38ac6d19e0a76c5fd809a84c86", size = 13163750, upload-time = "2025-09-19T00:09:51.472Z" }, - { url = "https://files.pythonhosted.org/packages/c4/5f/2cf2ceb3b36372d51568f2208c021870fe7834cf3186b653ac6446511839/mypy-1.18.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:3ca30b50a51e7ba93b00422e486cbb124f1c56a535e20eff7b2d6ab72b3b2e37", size = 13351827, upload-time = "2025-09-19T00:09:58.311Z" }, - { url = "https://files.pythonhosted.org/packages/c8/7d/2697b930179e7277529eaaec1513f8de622818696857f689e4a5432e5e27/mypy-1.18.2-cp311-cp311-win_amd64.whl", hash = "sha256:664dc726e67fa54e14536f6e1224bcfce1d9e5ac02426d2326e2bb4e081d1ce8", size = 9757983, upload-time = "2025-09-19T00:10:09.071Z" }, - { url = "https://files.pythonhosted.org/packages/07/06/dfdd2bc60c66611dd8335f463818514733bc763e4760dee289dcc33df709/mypy-1.18.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:33eca32dd124b29400c31d7cf784e795b050ace0e1f91b8dc035672725617e34", size = 12908273, upload-time = "2025-09-19T00:10:58.321Z" }, - { url = "https://files.pythonhosted.org/packages/81/14/6a9de6d13a122d5608e1a04130724caf9170333ac5a924e10f670687d3eb/mypy-1.18.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a3c47adf30d65e89b2dcd2fa32f3aeb5e94ca970d2c15fcb25e297871c8e4764", size = 11920910, upload-time = "2025-09-19T00:10:20.043Z" }, - { url = "https://files.pythonhosted.org/packages/5f/a9/b29de53e42f18e8cc547e38daa9dfa132ffdc64f7250e353f5c8cdd44bee/mypy-1.18.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5d6c838e831a062f5f29d11c9057c6009f60cb294fea33a98422688181fe2893", size = 12465585, upload-time = "2025-09-19T00:10:33.005Z" }, - { url = "https://files.pythonhosted.org/packages/77/ae/6c3d2c7c61ff21f2bee938c917616c92ebf852f015fb55917fd6e2811db2/mypy-1.18.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:01199871b6110a2ce984bde85acd481232d17413868c9807e95c1b0739a58914", size = 13348562, upload-time = "2025-09-19T00:10:11.51Z" }, - { url = "https://files.pythonhosted.org/packages/4d/31/aec68ab3b4aebdf8f36d191b0685d99faa899ab990753ca0fee60fb99511/mypy-1.18.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a2afc0fa0b0e91b4599ddfe0f91e2c26c2b5a5ab263737e998d6817874c5f7c8", size = 13533296, upload-time = "2025-09-19T00:10:06.568Z" }, - { url = "https://files.pythonhosted.org/packages/9f/83/abcb3ad9478fca3ebeb6a5358bb0b22c95ea42b43b7789c7fb1297ca44f4/mypy-1.18.2-cp312-cp312-win_amd64.whl", hash = "sha256:d8068d0afe682c7c4897c0f7ce84ea77f6de953262b12d07038f4d296d547074", size = 9828828, upload-time = "2025-09-19T00:10:28.203Z" }, - { url = "https://files.pythonhosted.org/packages/5f/04/7f462e6fbba87a72bc8097b93f6842499c428a6ff0c81dd46948d175afe8/mypy-1.18.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:07b8b0f580ca6d289e69209ec9d3911b4a26e5abfde32228a288eb79df129fcc", size = 12898728, upload-time = "2025-09-19T00:10:01.33Z" }, - { url = "https://files.pythonhosted.org/packages/99/5b/61ed4efb64f1871b41fd0b82d29a64640f3516078f6c7905b68ab1ad8b13/mypy-1.18.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:ed4482847168439651d3feee5833ccedbf6657e964572706a2adb1f7fa4dfe2e", size = 11910758, upload-time = "2025-09-19T00:10:42.607Z" }, - { url = "https://files.pythonhosted.org/packages/3c/46/d297d4b683cc89a6e4108c4250a6a6b717f5fa96e1a30a7944a6da44da35/mypy-1.18.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c3ad2afadd1e9fea5cf99a45a822346971ede8685cc581ed9cd4d42eaf940986", size = 12475342, upload-time = "2025-09-19T00:11:00.371Z" }, - { url = "https://files.pythonhosted.org/packages/83/45/4798f4d00df13eae3bfdf726c9244bcb495ab5bd588c0eed93a2f2dd67f3/mypy-1.18.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a431a6f1ef14cf8c144c6b14793a23ec4eae3db28277c358136e79d7d062f62d", size = 13338709, upload-time = "2025-09-19T00:11:03.358Z" }, - { url = "https://files.pythonhosted.org/packages/d7/09/479f7358d9625172521a87a9271ddd2441e1dab16a09708f056e97007207/mypy-1.18.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:7ab28cc197f1dd77a67e1c6f35cd1f8e8b73ed2217e4fc005f9e6a504e46e7ba", size = 13529806, upload-time = "2025-09-19T00:10:26.073Z" }, - { url = "https://files.pythonhosted.org/packages/71/cf/ac0f2c7e9d0ea3c75cd99dff7aec1c9df4a1376537cb90e4c882267ee7e9/mypy-1.18.2-cp313-cp313-win_amd64.whl", hash = "sha256:0e2785a84b34a72ba55fb5daf079a1003a34c05b22238da94fcae2bbe46f3544", size = 9833262, upload-time = "2025-09-19T00:10:40.035Z" }, - { url = "https://files.pythonhosted.org/packages/5a/0c/7d5300883da16f0063ae53996358758b2a2df2a09c72a5061fa79a1f5006/mypy-1.18.2-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:62f0e1e988ad41c2a110edde6c398383a889d95b36b3e60bcf155f5164c4fdce", size = 12893775, upload-time = "2025-09-19T00:10:03.814Z" }, - { url = "https://files.pythonhosted.org/packages/50/df/2cffbf25737bdb236f60c973edf62e3e7b4ee1c25b6878629e88e2cde967/mypy-1.18.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:8795a039bab805ff0c1dfdb8cd3344642c2b99b8e439d057aba30850b8d3423d", size = 11936852, upload-time = "2025-09-19T00:10:51.631Z" }, - { url = "https://files.pythonhosted.org/packages/be/50/34059de13dd269227fb4a03be1faee6e2a4b04a2051c82ac0a0b5a773c9a/mypy-1.18.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6ca1e64b24a700ab5ce10133f7ccd956a04715463d30498e64ea8715236f9c9c", size = 12480242, upload-time = "2025-09-19T00:11:07.955Z" }, - { url = "https://files.pythonhosted.org/packages/5b/11/040983fad5132d85914c874a2836252bbc57832065548885b5bb5b0d4359/mypy-1.18.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d924eef3795cc89fecf6bedc6ed32b33ac13e8321344f6ddbf8ee89f706c05cb", size = 13326683, upload-time = "2025-09-19T00:09:55.572Z" }, - { url = "https://files.pythonhosted.org/packages/e9/ba/89b2901dd77414dd7a8c8729985832a5735053be15b744c18e4586e506ef/mypy-1.18.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:20c02215a080e3a2be3aa50506c67242df1c151eaba0dcbc1e4e557922a26075", size = 13514749, upload-time = "2025-09-19T00:10:44.827Z" }, - { url = "https://files.pythonhosted.org/packages/25/bc/cc98767cffd6b2928ba680f3e5bc969c4152bf7c2d83f92f5a504b92b0eb/mypy-1.18.2-cp314-cp314-win_amd64.whl", hash = "sha256:749b5f83198f1ca64345603118a6f01a4e99ad4bf9d103ddc5a3200cc4614adf", size = 9982959, upload-time = "2025-09-19T00:10:37.344Z" }, - { url = "https://files.pythonhosted.org/packages/3f/a6/490ff491d8ecddf8ab91762d4f67635040202f76a44171420bcbe38ceee5/mypy-1.18.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:25a9c8fb67b00599f839cf472713f54249a62efd53a54b565eb61956a7e3296b", size = 12807230, upload-time = "2025-09-19T00:09:49.471Z" }, - { url = "https://files.pythonhosted.org/packages/eb/2e/60076fc829645d167ece9e80db9e8375648d210dab44cc98beb5b322a826/mypy-1.18.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c2b9c7e284ee20e7598d6f42e13ca40b4928e6957ed6813d1ab6348aa3f47133", size = 11895666, upload-time = "2025-09-19T00:10:53.678Z" }, - { url = "https://files.pythonhosted.org/packages/97/4a/1e2880a2a5dda4dc8d9ecd1a7e7606bc0b0e14813637eeda40c38624e037/mypy-1.18.2-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d6985ed057513e344e43a26cc1cd815c7a94602fb6a3130a34798625bc2f07b6", size = 12499608, upload-time = "2025-09-19T00:09:36.204Z" }, - { url = "https://files.pythonhosted.org/packages/00/81/a117f1b73a3015b076b20246b1f341c34a578ebd9662848c6b80ad5c4138/mypy-1.18.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:22f27105f1525ec024b5c630c0b9f36d5c1cc4d447d61fe51ff4bd60633f47ac", size = 13244551, upload-time = "2025-09-19T00:10:17.531Z" }, - { url = "https://files.pythonhosted.org/packages/9b/61/b9f48e1714ce87c7bf0358eb93f60663740ebb08f9ea886ffc670cea7933/mypy-1.18.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:030c52d0ea8144e721e49b1f68391e39553d7451f0c3f8a7565b59e19fcb608b", size = 13491552, upload-time = "2025-09-19T00:10:13.753Z" }, - { url = "https://files.pythonhosted.org/packages/c9/66/b2c0af3b684fa80d1b27501a8bdd3d2daa467ea3992a8aa612f5ca17c2db/mypy-1.18.2-cp39-cp39-win_amd64.whl", hash = "sha256:aa5e07ac1a60a253445797e42b8b2963c9675563a94f11291ab40718b016a7a0", size = 9765635, upload-time = "2025-09-19T00:10:30.993Z" }, - { url = "https://files.pythonhosted.org/packages/87/e3/be76d87158ebafa0309946c4a73831974d4d6ab4f4ef40c3b53a385a66fd/mypy-1.18.2-py3-none-any.whl", hash = "sha256:22a1748707dd62b58d2ae53562ffc4d7f8bcc727e8ac7cbc69c053ddc874d47e", size = 2352367, upload-time = "2025-09-19T00:10:15.489Z" }, + { url = "https://files.pythonhosted.org/packages/6a/31/e762baa3b73905c856d45ab77b4af850e8159dffffd86a52879539a08c6b/mypy-1.17.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f8e08de6138043108b3b18f09d3f817a4783912e48828ab397ecf183135d84d6", size = 10998313, upload-time = "2025-07-14T20:33:24.519Z" }, + { url = "https://files.pythonhosted.org/packages/1c/c1/25b2f0d46fb7e0b5e2bee61ec3a47fe13eff9e3c2f2234f144858bbe6485/mypy-1.17.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ce4a17920ec144647d448fc43725b5873548b1aae6c603225626747ededf582d", size = 10128922, upload-time = "2025-07-14T20:34:06.414Z" }, + { url = "https://files.pythonhosted.org/packages/02/78/6d646603a57aa8a2886df1b8881fe777ea60f28098790c1089230cd9c61d/mypy-1.17.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6ff25d151cc057fdddb1cb1881ef36e9c41fa2a5e78d8dd71bee6e4dcd2bc05b", size = 11913524, upload-time = "2025-07-14T20:33:19.109Z" }, + { url = "https://files.pythonhosted.org/packages/4f/19/dae6c55e87ee426fb76980f7e78484450cad1c01c55a1dc4e91c930bea01/mypy-1.17.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:93468cf29aa9a132bceb103bd8475f78cacde2b1b9a94fd978d50d4bdf616c9a", size = 12650527, upload-time = "2025-07-14T20:32:44.095Z" }, + { url = "https://files.pythonhosted.org/packages/86/e1/f916845a235235a6c1e4d4d065a3930113767001d491b8b2e1b61ca56647/mypy-1.17.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:98189382b310f16343151f65dd7e6867386d3e35f7878c45cfa11383d175d91f", size = 12897284, upload-time = "2025-07-14T20:33:38.168Z" }, + { url = "https://files.pythonhosted.org/packages/ae/dc/414760708a4ea1b096bd214d26a24e30ac5e917ef293bc33cdb6fe22d2da/mypy-1.17.0-cp310-cp310-win_amd64.whl", hash = "sha256:c004135a300ab06a045c1c0d8e3f10215e71d7b4f5bb9a42ab80236364429937", size = 9506493, upload-time = "2025-07-14T20:34:01.093Z" }, + { url = "https://files.pythonhosted.org/packages/d4/24/82efb502b0b0f661c49aa21cfe3e1999ddf64bf5500fc03b5a1536a39d39/mypy-1.17.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:9d4fe5c72fd262d9c2c91c1117d16aac555e05f5beb2bae6a755274c6eec42be", size = 10914150, upload-time = "2025-07-14T20:31:51.985Z" }, + { url = "https://files.pythonhosted.org/packages/03/96/8ef9a6ff8cedadff4400e2254689ca1dc4b420b92c55255b44573de10c54/mypy-1.17.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d96b196e5c16f41b4f7736840e8455958e832871990c7ba26bf58175e357ed61", size = 10039845, upload-time = "2025-07-14T20:32:30.527Z" }, + { url = "https://files.pythonhosted.org/packages/df/32/7ce359a56be779d38021d07941cfbb099b41411d72d827230a36203dbb81/mypy-1.17.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:73a0ff2dd10337ceb521c080d4147755ee302dcde6e1a913babd59473904615f", size = 11837246, upload-time = "2025-07-14T20:32:01.28Z" }, + { url = "https://files.pythonhosted.org/packages/82/16/b775047054de4d8dbd668df9137707e54b07fe18c7923839cd1e524bf756/mypy-1.17.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:24cfcc1179c4447854e9e406d3af0f77736d631ec87d31c6281ecd5025df625d", size = 12571106, upload-time = "2025-07-14T20:34:26.942Z" }, + { url = "https://files.pythonhosted.org/packages/a1/cf/fa33eaf29a606102c8d9ffa45a386a04c2203d9ad18bf4eef3e20c43ebc8/mypy-1.17.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:3c56f180ff6430e6373db7a1d569317675b0a451caf5fef6ce4ab365f5f2f6c3", size = 12759960, upload-time = "2025-07-14T20:33:42.882Z" }, + { url = "https://files.pythonhosted.org/packages/94/75/3f5a29209f27e739ca57e6350bc6b783a38c7621bdf9cac3ab8a08665801/mypy-1.17.0-cp311-cp311-win_amd64.whl", hash = "sha256:eafaf8b9252734400f9b77df98b4eee3d2eecab16104680d51341c75702cad70", size = 9503888, upload-time = "2025-07-14T20:32:34.392Z" }, + { url = "https://files.pythonhosted.org/packages/12/e9/e6824ed620bbf51d3bf4d6cbbe4953e83eaf31a448d1b3cfb3620ccb641c/mypy-1.17.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:f986f1cab8dbec39ba6e0eaa42d4d3ac6686516a5d3dccd64be095db05ebc6bb", size = 11086395, upload-time = "2025-07-14T20:34:11.452Z" }, + { url = "https://files.pythonhosted.org/packages/ba/51/a4afd1ae279707953be175d303f04a5a7bd7e28dc62463ad29c1c857927e/mypy-1.17.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:51e455a54d199dd6e931cd7ea987d061c2afbaf0960f7f66deef47c90d1b304d", size = 10120052, upload-time = "2025-07-14T20:33:09.897Z" }, + { url = "https://files.pythonhosted.org/packages/8a/71/19adfeac926ba8205f1d1466d0d360d07b46486bf64360c54cb5a2bd86a8/mypy-1.17.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3204d773bab5ff4ebbd1f8efa11b498027cd57017c003ae970f310e5b96be8d8", size = 11861806, upload-time = "2025-07-14T20:32:16.028Z" }, + { url = "https://files.pythonhosted.org/packages/0b/64/d6120eca3835baf7179e6797a0b61d6c47e0bc2324b1f6819d8428d5b9ba/mypy-1.17.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1051df7ec0886fa246a530ae917c473491e9a0ba6938cfd0ec2abc1076495c3e", size = 12744371, upload-time = "2025-07-14T20:33:33.503Z" }, + { url = "https://files.pythonhosted.org/packages/1f/dc/56f53b5255a166f5bd0f137eed960e5065f2744509dfe69474ff0ba772a5/mypy-1.17.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:f773c6d14dcc108a5b141b4456b0871df638eb411a89cd1c0c001fc4a9d08fc8", size = 12914558, upload-time = "2025-07-14T20:33:56.961Z" }, + { url = "https://files.pythonhosted.org/packages/69/ac/070bad311171badc9add2910e7f89271695a25c136de24bbafc7eded56d5/mypy-1.17.0-cp312-cp312-win_amd64.whl", hash = "sha256:1619a485fd0e9c959b943c7b519ed26b712de3002d7de43154a489a2d0fd817d", size = 9585447, upload-time = "2025-07-14T20:32:20.594Z" }, + { url = "https://files.pythonhosted.org/packages/be/7b/5f8ab461369b9e62157072156935cec9d272196556bdc7c2ff5f4c7c0f9b/mypy-1.17.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:2c41aa59211e49d717d92b3bb1238c06d387c9325d3122085113c79118bebb06", size = 11070019, upload-time = "2025-07-14T20:32:07.99Z" }, + { url = "https://files.pythonhosted.org/packages/9c/f8/c49c9e5a2ac0badcc54beb24e774d2499748302c9568f7f09e8730e953fa/mypy-1.17.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0e69db1fb65b3114f98c753e3930a00514f5b68794ba80590eb02090d54a5d4a", size = 10114457, upload-time = "2025-07-14T20:33:47.285Z" }, + { url = "https://files.pythonhosted.org/packages/89/0c/fb3f9c939ad9beed3e328008b3fb90b20fda2cddc0f7e4c20dbefefc3b33/mypy-1.17.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:03ba330b76710f83d6ac500053f7727270b6b8553b0423348ffb3af6f2f7b889", size = 11857838, upload-time = "2025-07-14T20:33:14.462Z" }, + { url = "https://files.pythonhosted.org/packages/4c/66/85607ab5137d65e4f54d9797b77d5a038ef34f714929cf8ad30b03f628df/mypy-1.17.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:037bc0f0b124ce46bfde955c647f3e395c6174476a968c0f22c95a8d2f589bba", size = 12731358, upload-time = "2025-07-14T20:32:25.579Z" }, + { url = "https://files.pythonhosted.org/packages/73/d0/341dbbfb35ce53d01f8f2969facbb66486cee9804048bf6c01b048127501/mypy-1.17.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:c38876106cb6132259683632b287238858bd58de267d80defb6f418e9ee50658", size = 12917480, upload-time = "2025-07-14T20:34:21.868Z" }, + { url = "https://files.pythonhosted.org/packages/64/63/70c8b7dbfc520089ac48d01367a97e8acd734f65bd07813081f508a8c94c/mypy-1.17.0-cp313-cp313-win_amd64.whl", hash = "sha256:d30ba01c0f151998f367506fab31c2ac4527e6a7b2690107c7a7f9e3cb419a9c", size = 9589666, upload-time = "2025-07-14T20:34:16.841Z" }, + { url = "https://files.pythonhosted.org/packages/9f/a0/6263dd11941231f688f0a8f2faf90ceac1dc243d148d314a089d2fe25108/mypy-1.17.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:63e751f1b5ab51d6f3d219fe3a2fe4523eaa387d854ad06906c63883fde5b1ab", size = 10988185, upload-time = "2025-07-14T20:33:04.797Z" }, + { url = "https://files.pythonhosted.org/packages/02/13/b8f16d6b0dc80277129559c8e7dbc9011241a0da8f60d031edb0e6e9ac8f/mypy-1.17.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f7fb09d05e0f1c329a36dcd30e27564a3555717cde87301fae4fb542402ddfad", size = 10120169, upload-time = "2025-07-14T20:32:38.84Z" }, + { url = "https://files.pythonhosted.org/packages/14/ef/978ba79df0d65af680e20d43121363cf643eb79b04bf3880d01fc8afeb6f/mypy-1.17.0-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b72c34ce05ac3a1361ae2ebb50757fb6e3624032d91488d93544e9f82db0ed6c", size = 11918121, upload-time = "2025-07-14T20:33:52.328Z" }, + { url = "https://files.pythonhosted.org/packages/f4/10/55ef70b104151a0d8280474f05268ff0a2a79be8d788d5e647257d121309/mypy-1.17.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:434ad499ad8dde8b2f6391ddfa982f41cb07ccda8e3c67781b1bfd4e5f9450a8", size = 12648821, upload-time = "2025-07-14T20:32:59.631Z" }, + { url = "https://files.pythonhosted.org/packages/26/8c/7781fcd2e1eef48fbedd3a422c21fe300a8e03ed5be2eb4bd10246a77f4e/mypy-1.17.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:f105f61a5eff52e137fd73bee32958b2add9d9f0a856f17314018646af838e97", size = 12896955, upload-time = "2025-07-14T20:32:49.543Z" }, + { url = "https://files.pythonhosted.org/packages/78/13/03ac759dabe86e98ca7b6681f114f90ee03f3ff8365a57049d311bd4a4e3/mypy-1.17.0-cp39-cp39-win_amd64.whl", hash = "sha256:ba06254a5a22729853209550d80f94e28690d5530c661f9416a68ac097b13fc4", size = 9512957, upload-time = "2025-07-14T20:33:28.619Z" }, + { url = "https://files.pythonhosted.org/packages/e3/fc/ee058cc4316f219078464555873e99d170bde1d9569abd833300dbeb484a/mypy-1.17.0-py3-none-any.whl", hash = "sha256:15d9d0018237ab058e5de3d8fce61b6fa72cc59cc78fd91f1b474bce12abf496", size = 2283195, upload-time = "2025-07-14T20:31:54.753Z" }, ] [[package]] @@ -993,7 +987,7 @@ wheels = [ [[package]] name = "pydantic" -version = "2.12.4" +version = "2.12.5" source = { registry = "https://pypi.org/simple" } resolution-markers = [ "python_full_version >= '3.14' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2'", @@ -1008,9 +1002,9 @@ dependencies = [ { name = "typing-extensions", marker = "extra == 'group-18-runloop-api-client-pydantic-v2' or extra != 'group-18-runloop-api-client-pydantic-v1'" }, { name = "typing-inspection", marker = "extra == 'group-18-runloop-api-client-pydantic-v2' or extra != 'group-18-runloop-api-client-pydantic-v1'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/96/ad/a17bc283d7d81837c061c49e3eaa27a45991759a1b7eae1031921c6bd924/pydantic-2.12.4.tar.gz", hash = "sha256:0f8cb9555000a4b5b617f66bfd2566264c4984b27589d3b845685983e8ea85ac", size = 821038, upload-time = "2025-11-05T10:50:08.59Z" } +sdist = { url = "https://files.pythonhosted.org/packages/69/44/36f1a6e523abc58ae5f928898e4aca2e0ea509b5aa6f6f392a5d882be928/pydantic-2.12.5.tar.gz", hash = "sha256:4d351024c75c0f085a9febbb665ce8c0c6ec5d30e903bdb6394b7ede26aebb49", size = 821591, upload-time = "2025-11-26T15:11:46.471Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/82/2f/e68750da9b04856e2a7ec56fc6f034a5a79775e9b9a81882252789873798/pydantic-2.12.4-py3-none-any.whl", hash = "sha256:92d3d202a745d46f9be6df459ac5a064fdaa3c1c4cd8adcfa332ccf3c05f871e", size = 463400, upload-time = "2025-11-05T10:50:06.732Z" }, + { url = "https://files.pythonhosted.org/packages/5a/87/b70ad306ebb6f9b585f114d0ac2137d792b48be34d732d60e597c2f8465a/pydantic-2.12.5-py3-none-any.whl", hash = "sha256:e561593fccf61e8a20fc46dfc2dfe075b8be7d0188df33f221ad1f0139180f9d", size = 463580, upload-time = "2025-11-26T15:11:44.605Z" }, ] [[package]] @@ -1335,7 +1329,7 @@ dependencies = [ { name = "distro" }, { name = "httpx" }, { name = "pydantic", version = "1.10.24", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'group-18-runloop-api-client-pydantic-v1'" }, - { name = "pydantic", version = "2.12.4", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'group-18-runloop-api-client-pydantic-v2' or extra != 'group-18-runloop-api-client-pydantic-v1'" }, + { name = "pydantic", version = "2.12.5", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'group-18-runloop-api-client-pydantic-v2' or extra != 'group-18-runloop-api-client-pydantic-v1'" }, { name = "sniffio" }, { name = "typing-extensions" }, ] @@ -1367,7 +1361,7 @@ pydantic-v1 = [ { name = "pydantic", version = "1.10.24", source = { registry = "https://pypi.org/simple" } }, ] pydantic-v2 = [ - { name = "pydantic", version = "2.12.4", source = { registry = "https://pypi.org/simple" } }, + { name = "pydantic", version = "2.12.5", source = { registry = "https://pypi.org/simple" } }, ] [package.metadata] @@ -1387,7 +1381,7 @@ provides-extras = ["aiohttp"] dev = [ { name = "dirty-equals", specifier = ">=0.6.0" }, { name = "importlib-metadata", specifier = ">=6.7.0" }, - { name = "mypy" }, + { name = "mypy", specifier = "==1.17" }, { name = "pyright", specifier = "==1.1.399" }, { name = "pytest" }, { name = "pytest-asyncio" }, From 9afbf185a9ebd2165ae417de7a927c9ac127c60a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 00:27:02 +0000 Subject: [PATCH 916/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0b8a7c68d..fea345409 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.68.0" + ".": "1.0.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index b560c10f3..e47a3f310 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.68.0" +version = "1.0.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 03a1aaf1c..5378c8c64 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.68.0" # x-release-please-version +__version__ = "1.0.0" # x-release-please-version diff --git a/uv.lock b/uv.lock index 0d8cdbf41..2d90e8d22 100644 --- a/uv.lock +++ b/uv.lock @@ -1322,7 +1322,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "0.68.0" +version = "1.0.0" source = { editable = "." } dependencies = [ { name = "anyio" }, From 7e0e6e45f14b45f240d5bddfee1e55b8146f4432 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 04:06:29 +0000 Subject: [PATCH 917/993] chore: bump required `uv` version --- .github/workflows/ci.yml | 6 +++--- .github/workflows/publish-pypi.yml | 2 +- pyproject.toml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 72f3d7525..2fdbdbb52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 with: - version: '0.8.11' + version: '0.9.13' - name: Install dependencies run: uv sync --all-extras @@ -46,7 +46,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 with: - version: '0.8.11' + version: '0.9.13' - name: Install dependencies run: uv sync --all-extras @@ -80,7 +80,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 with: - version: '0.8.11' + version: '0.9.13' - name: Bootstrap run: ./scripts/bootstrap diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 12ad177a5..088d1b294 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -19,7 +19,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 with: - version: '0.8.11' + version: '0.9.13' - name: Publish to PyPI run: | diff --git a/pyproject.toml b/pyproject.toml index e47a3f310..678868eab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"] [tool.uv] managed = true -required-version = ">=0.5.0" +required-version = ">=0.9" conflicts = [ [ { group = "pydantic-v1" }, From 0e6d2d840e82bb919c8053fe5ab86b041ba1207b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 3 Dec 2025 03:53:31 +0000 Subject: [PATCH 918/993] chore: update lockfile --- pyproject.toml | 14 +++++++------ requirements-dev.lock | 8 +++----- uv.lock | 47 +++++++++++++++++++++---------------------- 3 files changed, 34 insertions(+), 35 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 678868eab..fa98eb066 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,14 +7,16 @@ license = "MIT" authors = [ { name = "Runloop", email = "support@runloop.ai" }, ] + dependencies = [ - "httpx>=0.23.0, <1", - "pydantic>=1.9.0, <3", - "typing-extensions>=4.10, <5", - "anyio>=3.5.0, <5", - "distro>=1.7.0, <2", - "sniffio", + "httpx>=0.23.0, <1", + "pydantic>=1.9.0, <3", + "typing-extensions>=4.10, <5", + "anyio>=3.5.0, <5", + "distro>=1.7.0, <2", + "sniffio", ] + requires-python = ">= 3.9" classifiers = [ "Typing :: Typed", diff --git a/requirements-dev.lock b/requirements-dev.lock index f0bf13c48..95b4c2f35 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -3,7 +3,7 @@ -e . annotated-types==0.7.0 # via pydantic -anyio==4.11.0 +anyio==4.12.0 # via # httpx # runloop-api-client @@ -82,13 +82,11 @@ python-dateutil==2.9.0.post0 ; python_full_version < '3.10' # via time-machine respx==0.22.0 rich==14.2.0 -ruff==0.14.6 +ruff==0.14.7 six==1.17.0 ; python_full_version < '3.10' # via python-dateutil sniffio==1.3.1 - # via - # anyio - # runloop-api-client + # via runloop-api-client time-machine==2.19.0 ; python_full_version < '3.10' time-machine==3.1.0 ; python_full_version >= '3.10' tomli==2.3.0 ; python_full_version < '3.11' diff --git a/uv.lock b/uv.lock index 2d90e8d22..3d87fed90 100644 --- a/uv.lock +++ b/uv.lock @@ -185,17 +185,16 @@ wheels = [ [[package]] name = "anyio" -version = "4.11.0" +version = "4.12.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "exceptiongroup", marker = "python_full_version < '3.11' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, { name = "idna" }, - { name = "sniffio" }, { name = "typing-extensions", marker = "python_full_version < '3.13' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/c6/78/7d432127c41b50bccba979505f272c16cbcadcc33645d5fa3a738110ae75/anyio-4.11.0.tar.gz", hash = "sha256:82a8d0b81e318cc5ce71a5f1f8b5c4e63619620b63141ef8c995fa0db95a57c4", size = 219094, upload-time = "2025-09-23T09:19:12.58Z" } +sdist = { url = "https://files.pythonhosted.org/packages/16/ce/8a777047513153587e5434fd752e89334ac33e379aa3497db860eeb60377/anyio-4.12.0.tar.gz", hash = "sha256:73c693b567b0c55130c104d0b43a9baf3aa6a31fc6110116509f27bf75e21ec0", size = 228266, upload-time = "2025-11-28T23:37:38.911Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/15/b3/9b1a8074496371342ec1e796a96f99c82c945a339cd81a8e73de28b4cf9e/anyio-4.11.0-py3-none-any.whl", hash = "sha256:0287e96f4d26d4149305414d4e3bc32f0dcd0862365a4bddea19d7a1ec38c4fc", size = 109097, upload-time = "2025-09-23T09:19:10.601Z" }, + { url = "https://files.pythonhosted.org/packages/7f/9c/36c5c37947ebfb8c7f22e0eb6e4d188ee2d53aa3880f3f2744fb894f0cb1/anyio-4.12.0-py3-none-any.whl", hash = "sha256:dad2376a628f98eeca4881fc56cd06affd18f659b17a747d3ff0307ced94b1bb", size = 113362, upload-time = "2025-11-28T23:36:57.897Z" }, ] [[package]] @@ -1296,28 +1295,28 @@ wheels = [ [[package]] name = "ruff" -version = "0.14.6" +version = "0.14.7" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/52/f0/62b5a1a723fe183650109407fa56abb433b00aa1c0b9ba555f9c4efec2c6/ruff-0.14.6.tar.gz", hash = "sha256:6f0c742ca6a7783a736b867a263b9a7a80a45ce9bee391eeda296895f1b4e1cc", size = 5669501, upload-time = "2025-11-21T14:26:17.903Z" } +sdist = { url = "https://files.pythonhosted.org/packages/b7/5b/dd7406afa6c95e3d8fa9d652b6d6dd17dd4a6bf63cb477014e8ccd3dcd46/ruff-0.14.7.tar.gz", hash = "sha256:3417deb75d23bd14a722b57b0a1435561db65f0ad97435b4cf9f85ffcef34ae5", size = 5727324, upload-time = "2025-11-28T20:55:10.525Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/67/d2/7dd544116d107fffb24a0064d41a5d2ed1c9d6372d142f9ba108c8e39207/ruff-0.14.6-py3-none-linux_armv6l.whl", hash = "sha256:d724ac2f1c240dbd01a2ae98db5d1d9a5e1d9e96eba999d1c48e30062df578a3", size = 13326119, upload-time = "2025-11-21T14:25:24.2Z" }, - { url = "https://files.pythonhosted.org/packages/36/6a/ad66d0a3315d6327ed6b01f759d83df3c4d5f86c30462121024361137b6a/ruff-0.14.6-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:9f7539ea257aa4d07b7ce87aed580e485c40143f2473ff2f2b75aee003186004", size = 13526007, upload-time = "2025-11-21T14:25:26.906Z" }, - { url = "https://files.pythonhosted.org/packages/a3/9d/dae6db96df28e0a15dea8e986ee393af70fc97fd57669808728080529c37/ruff-0.14.6-py3-none-macosx_11_0_arm64.whl", hash = "sha256:7f6007e55b90a2a7e93083ba48a9f23c3158c433591c33ee2e99a49b889c6332", size = 12676572, upload-time = "2025-11-21T14:25:29.826Z" }, - { url = "https://files.pythonhosted.org/packages/76/a4/f319e87759949062cfee1b26245048e92e2acce900ad3a909285f9db1859/ruff-0.14.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0a8e7b9d73d8728b68f632aa8e824ef041d068d231d8dbc7808532d3629a6bef", size = 13140745, upload-time = "2025-11-21T14:25:32.788Z" }, - { url = "https://files.pythonhosted.org/packages/95/d3/248c1efc71a0a8ed4e8e10b4b2266845d7dfc7a0ab64354afe049eaa1310/ruff-0.14.6-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d50d45d4553a3ebcbd33e7c5e0fe6ca4aafd9a9122492de357205c2c48f00775", size = 13076486, upload-time = "2025-11-21T14:25:35.601Z" }, - { url = "https://files.pythonhosted.org/packages/a5/19/b68d4563fe50eba4b8c92aa842149bb56dd24d198389c0ed12e7faff4f7d/ruff-0.14.6-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:118548dd121f8a21bfa8ab2c5b80e5b4aed67ead4b7567790962554f38e598ce", size = 13727563, upload-time = "2025-11-21T14:25:38.514Z" }, - { url = "https://files.pythonhosted.org/packages/47/ac/943169436832d4b0e867235abbdb57ce3a82367b47e0280fa7b4eabb7593/ruff-0.14.6-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:57256efafbfefcb8748df9d1d766062f62b20150691021f8ab79e2d919f7c11f", size = 15199755, upload-time = "2025-11-21T14:25:41.516Z" }, - { url = "https://files.pythonhosted.org/packages/c9/b9/288bb2399860a36d4bb0541cb66cce3c0f4156aaff009dc8499be0c24bf2/ruff-0.14.6-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ff18134841e5c68f8e5df1999a64429a02d5549036b394fafbe410f886e1989d", size = 14850608, upload-time = "2025-11-21T14:25:44.428Z" }, - { url = "https://files.pythonhosted.org/packages/ee/b1/a0d549dd4364e240f37e7d2907e97ee80587480d98c7799d2d8dc7a2f605/ruff-0.14.6-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:29c4b7ec1e66a105d5c27bd57fa93203637d66a26d10ca9809dc7fc18ec58440", size = 14118754, upload-time = "2025-11-21T14:25:47.214Z" }, - { url = "https://files.pythonhosted.org/packages/13/ac/9b9fe63716af8bdfddfacd0882bc1586f29985d3b988b3c62ddce2e202c3/ruff-0.14.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:167843a6f78680746d7e226f255d920aeed5e4ad9c03258094a2d49d3028b105", size = 13949214, upload-time = "2025-11-21T14:25:50.002Z" }, - { url = "https://files.pythonhosted.org/packages/12/27/4dad6c6a77fede9560b7df6802b1b697e97e49ceabe1f12baf3ea20862e9/ruff-0.14.6-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:16a33af621c9c523b1ae006b1b99b159bf5ac7e4b1f20b85b2572455018e0821", size = 14106112, upload-time = "2025-11-21T14:25:52.841Z" }, - { url = "https://files.pythonhosted.org/packages/6a/db/23e322d7177873eaedea59a7932ca5084ec5b7e20cb30f341ab594130a71/ruff-0.14.6-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:1432ab6e1ae2dc565a7eea707d3b03a0c234ef401482a6f1621bc1f427c2ff55", size = 13035010, upload-time = "2025-11-21T14:25:55.536Z" }, - { url = "https://files.pythonhosted.org/packages/a8/9c/20e21d4d69dbb35e6a1df7691e02f363423658a20a2afacf2a2c011800dc/ruff-0.14.6-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:4c55cfbbe7abb61eb914bfd20683d14cdfb38a6d56c6c66efa55ec6570ee4e71", size = 13054082, upload-time = "2025-11-21T14:25:58.625Z" }, - { url = "https://files.pythonhosted.org/packages/66/25/906ee6a0464c3125c8d673c589771a974965c2be1a1e28b5c3b96cb6ef88/ruff-0.14.6-py3-none-musllinux_1_2_i686.whl", hash = "sha256:efea3c0f21901a685fff4befda6d61a1bf4cb43de16da87e8226a281d614350b", size = 13303354, upload-time = "2025-11-21T14:26:01.816Z" }, - { url = "https://files.pythonhosted.org/packages/4c/58/60577569e198d56922b7ead07b465f559002b7b11d53f40937e95067ca1c/ruff-0.14.6-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:344d97172576d75dc6afc0e9243376dbe1668559c72de1864439c4fc95f78185", size = 14054487, upload-time = "2025-11-21T14:26:05.058Z" }, - { url = "https://files.pythonhosted.org/packages/67/0b/8e4e0639e4cc12547f41cb771b0b44ec8225b6b6a93393176d75fe6f7d40/ruff-0.14.6-py3-none-win32.whl", hash = "sha256:00169c0c8b85396516fdd9ce3446c7ca20c2a8f90a77aa945ba6b8f2bfe99e85", size = 13013361, upload-time = "2025-11-21T14:26:08.152Z" }, - { url = "https://files.pythonhosted.org/packages/fb/02/82240553b77fd1341f80ebb3eaae43ba011c7a91b4224a9f317d8e6591af/ruff-0.14.6-py3-none-win_amd64.whl", hash = "sha256:390e6480c5e3659f8a4c8d6a0373027820419ac14fa0d2713bd8e6c3e125b8b9", size = 14432087, upload-time = "2025-11-21T14:26:10.891Z" }, - { url = "https://files.pythonhosted.org/packages/a5/1f/93f9b0fad9470e4c829a5bb678da4012f0c710d09331b860ee555216f4ea/ruff-0.14.6-py3-none-win_arm64.whl", hash = "sha256:d43c81fbeae52cfa8728d8766bbf46ee4298c888072105815b392da70ca836b2", size = 13520930, upload-time = "2025-11-21T14:26:13.951Z" }, + { url = "https://files.pythonhosted.org/packages/8c/b1/7ea5647aaf90106f6d102230e5df874613da43d1089864da1553b899ba5e/ruff-0.14.7-py3-none-linux_armv6l.whl", hash = "sha256:b9d5cb5a176c7236892ad7224bc1e63902e4842c460a0b5210701b13e3de4fca", size = 13414475, upload-time = "2025-11-28T20:54:54.569Z" }, + { url = "https://files.pythonhosted.org/packages/af/19/fddb4cd532299db9cdaf0efdc20f5c573ce9952a11cb532d3b859d6d9871/ruff-0.14.7-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:3f64fe375aefaf36ca7d7250292141e39b4cea8250427482ae779a2aa5d90015", size = 13634613, upload-time = "2025-11-28T20:55:17.54Z" }, + { url = "https://files.pythonhosted.org/packages/40/2b/469a66e821d4f3de0440676ed3e04b8e2a1dc7575cf6fa3ba6d55e3c8557/ruff-0.14.7-py3-none-macosx_11_0_arm64.whl", hash = "sha256:93e83bd3a9e1a3bda64cb771c0d47cda0e0d148165013ae2d3554d718632d554", size = 12765458, upload-time = "2025-11-28T20:55:26.128Z" }, + { url = "https://files.pythonhosted.org/packages/f1/05/0b001f734fe550bcfde4ce845948ac620ff908ab7241a39a1b39bb3c5f49/ruff-0.14.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3838948e3facc59a6070795de2ae16e5786861850f78d5914a03f12659e88f94", size = 13236412, upload-time = "2025-11-28T20:55:28.602Z" }, + { url = "https://files.pythonhosted.org/packages/11/36/8ed15d243f011b4e5da75cd56d6131c6766f55334d14ba31cce5461f28aa/ruff-0.14.7-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:24c8487194d38b6d71cd0fd17a5b6715cda29f59baca1defe1e3a03240f851d1", size = 13182949, upload-time = "2025-11-28T20:55:33.265Z" }, + { url = "https://files.pythonhosted.org/packages/3b/cf/fcb0b5a195455729834f2a6eadfe2e4519d8ca08c74f6d2b564a4f18f553/ruff-0.14.7-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:79c73db6833f058a4be8ffe4a0913b6d4ad41f6324745179bd2aa09275b01d0b", size = 13816470, upload-time = "2025-11-28T20:55:08.203Z" }, + { url = "https://files.pythonhosted.org/packages/7f/5d/34a4748577ff7a5ed2f2471456740f02e86d1568a18c9faccfc73bd9ca3f/ruff-0.14.7-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:12eb7014fccff10fc62d15c79d8a6be4d0c2d60fe3f8e4d169a0d2def75f5dad", size = 15289621, upload-time = "2025-11-28T20:55:30.837Z" }, + { url = "https://files.pythonhosted.org/packages/53/53/0a9385f047a858ba133d96f3f8e3c9c66a31cc7c4b445368ef88ebeac209/ruff-0.14.7-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6c623bbdc902de7ff715a93fa3bb377a4e42dd696937bf95669118773dbf0c50", size = 14975817, upload-time = "2025-11-28T20:55:24.107Z" }, + { url = "https://files.pythonhosted.org/packages/a8/d7/2f1c32af54c3b46e7fadbf8006d8b9bcfbea535c316b0bd8813d6fb25e5d/ruff-0.14.7-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f53accc02ed2d200fa621593cdb3c1ae06aa9b2c3cae70bc96f72f0000ae97a9", size = 14284549, upload-time = "2025-11-28T20:55:06.08Z" }, + { url = "https://files.pythonhosted.org/packages/92/05/434ddd86becd64629c25fb6b4ce7637dd52a45cc4a4415a3008fe61c27b9/ruff-0.14.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:281f0e61a23fcdcffca210591f0f53aafaa15f9025b5b3f9706879aaa8683bc4", size = 14071389, upload-time = "2025-11-28T20:55:35.617Z" }, + { url = "https://files.pythonhosted.org/packages/ff/50/fdf89d4d80f7f9d4f420d26089a79b3bb1538fe44586b148451bc2ba8d9c/ruff-0.14.7-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:dbbaa5e14148965b91cb090236931182ee522a5fac9bc5575bafc5c07b9f9682", size = 14202679, upload-time = "2025-11-28T20:55:01.472Z" }, + { url = "https://files.pythonhosted.org/packages/77/54/87b34988984555425ce967f08a36df0ebd339bb5d9d0e92a47e41151eafc/ruff-0.14.7-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:1464b6e54880c0fe2f2d6eaefb6db15373331414eddf89d6b903767ae2458143", size = 13147677, upload-time = "2025-11-28T20:55:19.933Z" }, + { url = "https://files.pythonhosted.org/packages/67/29/f55e4d44edfe053918a16a3299e758e1c18eef216b7a7092550d7a9ec51c/ruff-0.14.7-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:f217ed871e4621ea6128460df57b19ce0580606c23aeab50f5de425d05226784", size = 13151392, upload-time = "2025-11-28T20:55:21.967Z" }, + { url = "https://files.pythonhosted.org/packages/36/69/47aae6dbd4f1d9b4f7085f4d9dcc84e04561ee7ad067bf52e0f9b02e3209/ruff-0.14.7-py3-none-musllinux_1_2_i686.whl", hash = "sha256:6be02e849440ed3602d2eb478ff7ff07d53e3758f7948a2a598829660988619e", size = 13412230, upload-time = "2025-11-28T20:55:12.749Z" }, + { url = "https://files.pythonhosted.org/packages/b7/4b/6e96cb6ba297f2ba502a231cd732ed7c3de98b1a896671b932a5eefa3804/ruff-0.14.7-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:19a0f116ee5e2b468dfe80c41c84e2bbd6b74f7b719bee86c2ecde0a34563bcc", size = 14195397, upload-time = "2025-11-28T20:54:56.896Z" }, + { url = "https://files.pythonhosted.org/packages/69/82/251d5f1aa4dcad30aed491b4657cecd9fb4274214da6960ffec144c260f7/ruff-0.14.7-py3-none-win32.whl", hash = "sha256:e33052c9199b347c8937937163b9b149ef6ab2e4bb37b042e593da2e6f6cccfa", size = 13126751, upload-time = "2025-11-28T20:55:03.47Z" }, + { url = "https://files.pythonhosted.org/packages/a8/b5/d0b7d145963136b564806f6584647af45ab98946660d399ec4da79cae036/ruff-0.14.7-py3-none-win_amd64.whl", hash = "sha256:e17a20ad0d3fad47a326d773a042b924d3ac31c6ca6deb6c72e9e6b5f661a7c6", size = 14531726, upload-time = "2025-11-28T20:54:59.121Z" }, + { url = "https://files.pythonhosted.org/packages/1d/d2/1637f4360ada6a368d3265bf39f2cf737a0aaab15ab520fc005903e883f8/ruff-0.14.7-py3-none-win_arm64.whl", hash = "sha256:be4d653d3bea1b19742fcc6502354e32f65cd61ff2fbdb365803ef2c2aec6228", size = 13609215, upload-time = "2025-11-28T20:55:15.375Z" }, ] [[package]] From c4f594779f397be78c950174fccb469caaad189a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 3 Dec 2025 04:00:48 +0000 Subject: [PATCH 919/993] chore(docs): use environment variables for authentication in code snippets --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3ddf4bbd7..a7b0db561 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ pip install runloop_api_client[aiohttp] Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: ```python +import os import asyncio from runloop_api_client import DefaultAioHttpClient from runloop_api_client import AsyncRunloop @@ -86,7 +87,7 @@ from runloop_api_client import AsyncRunloop async def main() -> None: async with AsyncRunloop( - bearer_token="My Bearer Token", + bearer_token=os.environ.get("RUNLOOP_API_KEY"), # This is the default and can be omitted http_client=DefaultAioHttpClient(), ) as client: devbox_view = await client.devboxes.create() From a5233be68cf914b093b0af5c2cb3529f1eb90992 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Dec 2025 03:36:18 +0000 Subject: [PATCH 920/993] chore(internal): avoid using unstable Python versions in tests --- scripts/test | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/scripts/test b/scripts/test index a93b8a259..b56970b78 100755 --- a/scripts/test +++ b/scripts/test @@ -54,12 +54,17 @@ fi export DEFER_PYDANTIC_BUILD=false +# Note that we need to specify the patch version here so that uv +# won't use unstable (alpha, beta, rc) releases for the tests +PY_VERSION_MIN=">=3.9.0" +PY_VERSION_MAX=">=3.14.0" + function run_tests() { echo "==> Running tests with Pydantic v2" uv run --isolated --all-extras pytest "$@" - # Pydantic v1 does not support Python 3.14, skip these tests - if [[ "$UV_PYTHON" != "3.14" ]]; then + # Skip Pydantic v1 tests on latest Python (not supported) + if [[ "$UV_PYTHON" != "$PY_VERSION_MAX" ]]; then echo "==> Running tests with Pydantic v1" uv run --isolated --all-extras --group=pydantic-v1 pytest "$@" fi @@ -71,9 +76,9 @@ if [[ -n "$UV_PYTHON" ]]; then else # If UV_PYTHON is not set, run the command for min and max versions - echo "==> Running tests for Python 3.9" - UV_PYTHON=3.9 run_tests "$@" + echo "==> Running tests for Python $PY_VERSION_MIN" + UV_PYTHON="$PY_VERSION_MIN" run_tests "$@" - echo "==> Running tests for Python 3.14" - UV_PYTHON=3.14 run_tests "$@" + echo "==> Running tests for Python $PY_VERSION_MAX" + UV_PYTHON="$PY_VERSION_MAX" run_tests "$@" fi From 92e1b99b21bbca9f08395ca2ee10dbeb8025ba15 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 6 Dec 2025 01:09:20 +0000 Subject: [PATCH 921/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index fea345409..2601677b9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.0.0" + ".": "1.1.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index fa98eb066..51e3930f8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "1.0.0" +version = "1.1.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 5378c8c64..f9df84b5e 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "1.0.0" # x-release-please-version +__version__ = "1.1.0" # x-release-please-version diff --git a/uv.lock b/uv.lock index 3d87fed90..0be9ae737 100644 --- a/uv.lock +++ b/uv.lock @@ -1321,7 +1321,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "1.0.0" +version = "1.1.0" source = { editable = "." } dependencies = [ { name = "anyio" }, From 31922ba35b35b294b78a31d337218b3d83c7dc3b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 8 Dec 2025 19:05:59 +0000 Subject: [PATCH 922/993] feat(devbox): return user for createSshKey --- .stats.yml | 4 +- api.md | 2 - src/runloop_api_client/types/__init__.py | 2 - .../types/devbox_create_ssh_key_response.py | 3 + .../types/shared/__init__.py | 2 - .../types/shared/agent_mount_parameters.py | 31 -------- .../types/shared/code_mount_parameters.py | 3 - src/runloop_api_client/types/shared/mount.py | 70 ++++++++++++++++--- .../types/shared/object_mount_parameters.py | 21 ------ .../types/shared_params/__init__.py | 2 - .../shared_params/agent_mount_parameters.py | 31 -------- .../shared_params/code_mount_parameters.py | 4 +- .../types/shared_params/mount.py | 66 +++++++++++++++-- .../shared_params/object_mount_parameters.py | 21 ------ tests/api_resources/test_blueprints.py | 4 -- tests/api_resources/test_devboxes.py | 2 - 16 files changed, 125 insertions(+), 143 deletions(-) delete mode 100644 src/runloop_api_client/types/shared/agent_mount_parameters.py delete mode 100644 src/runloop_api_client/types/shared/object_mount_parameters.py delete mode 100644 src/runloop_api_client/types/shared_params/agent_mount_parameters.py delete mode 100644 src/runloop_api_client/types/shared_params/object_mount_parameters.py diff --git a/.stats.yml b/.stats.yml index 0ab1f506b..0cb6f9948 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 97 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-cb2d725f71e87810cd872eacd70e867ca10f94980fdf9c78bb2844c02ee47bf3.yml -openapi_spec_hash: 16ce3e9184fc2afdee66db18a83a96e8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b92a4ee1d2c5382b0d77ec6a16e2e03b79bfd0a08cd75e28ee219350d5b6c5c6.yml +openapi_spec_hash: 20d89d072b105d18e5bb8f73adb75063 config_hash: 2363f563f42501d2b1587a4f64bdccaf diff --git a/api.md b/api.md index 49c26771e..bf5475656 100644 --- a/api.md +++ b/api.md @@ -3,12 +3,10 @@ ```python from runloop_api_client.types import ( AfterIdle, - AgentMountParameters, AgentSource, CodeMountParameters, LaunchParameters, Mount, - ObjectMountParameters, RunProfile, ) ``` diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 4d5168b44..6856d9670 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -9,8 +9,6 @@ AgentSource as AgentSource, LaunchParameters as LaunchParameters, CodeMountParameters as CodeMountParameters, - AgentMountParameters as AgentMountParameters, - ObjectMountParameters as ObjectMountParameters, ) from .agent_view import AgentView as AgentView from .devbox_view import DevboxView as DevboxView diff --git a/src/runloop_api_client/types/devbox_create_ssh_key_response.py b/src/runloop_api_client/types/devbox_create_ssh_key_response.py index 1b69373a3..90032165d 100755 --- a/src/runloop_api_client/types/devbox_create_ssh_key_response.py +++ b/src/runloop_api_client/types/devbox_create_ssh_key_response.py @@ -12,5 +12,8 @@ class DevboxCreateSSHKeyResponse(BaseModel): ssh_private_key: str """The ssh private key, in PEM format.""" + ssh_user: str + """The Linux user to use for SSH connections to this Devbox.""" + url: str """The host url of the Devbox that can be used for SSH.""" diff --git a/src/runloop_api_client/types/shared/__init__.py b/src/runloop_api_client/types/shared/__init__.py index 696abb529..b5e4e6f75 100644 --- a/src/runloop_api_client/types/shared/__init__.py +++ b/src/runloop_api_client/types/shared/__init__.py @@ -6,5 +6,3 @@ from .agent_source import AgentSource as AgentSource from .launch_parameters import LaunchParameters as LaunchParameters from .code_mount_parameters import CodeMountParameters as CodeMountParameters -from .agent_mount_parameters import AgentMountParameters as AgentMountParameters -from .object_mount_parameters import ObjectMountParameters as ObjectMountParameters diff --git a/src/runloop_api_client/types/shared/agent_mount_parameters.py b/src/runloop_api_client/types/shared/agent_mount_parameters.py deleted file mode 100644 index 6351a19f3..000000000 --- a/src/runloop_api_client/types/shared/agent_mount_parameters.py +++ /dev/null @@ -1,31 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["AgentMountParameters"] - - -class AgentMountParameters(BaseModel): - agent_id: Optional[str] = None - """The ID of the agent to mount. Either agent_id or name must be set.""" - - agent_name: Optional[str] = None - """The name of the agent to mount. - - Returns the most recent agent with a matching name if no agent id string - provided. Either agent id or name must be set - """ - - type: Literal["agent_mount"] - - agent_path: Optional[str] = None - """Path to mount the agent on the Devbox. - - Required for git and object agents. Use absolute path (e.g., /home/user/agent) - """ - - auth_token: Optional[str] = None - """Optional auth token for private repositories. Only used for git agents.""" diff --git a/src/runloop_api_client/types/shared/code_mount_parameters.py b/src/runloop_api_client/types/shared/code_mount_parameters.py index 5e509359b..b430f1513 100644 --- a/src/runloop_api_client/types/shared/code_mount_parameters.py +++ b/src/runloop_api_client/types/shared/code_mount_parameters.py @@ -1,7 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional -from typing_extensions import Literal from ..._models import BaseModel @@ -18,8 +17,6 @@ class CodeMountParameters(BaseModel): repo_owner: str """The owner of the repo.""" - type: Literal["code_mount"] - token: Optional[str] = None """The authentication token necessary to pull repo.""" diff --git a/src/runloop_api_client/types/shared/mount.py b/src/runloop_api_client/types/shared/mount.py index 9f8186386..5e256c8cf 100644 --- a/src/runloop_api_client/types/shared/mount.py +++ b/src/runloop_api_client/types/shared/mount.py @@ -1,18 +1,71 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union +from typing import Union, Optional from typing_extensions import Literal, Annotated, TypeAlias from ..._utils import PropertyInfo from ..._models import BaseModel -from .code_mount_parameters import CodeMountParameters -from .agent_mount_parameters import AgentMountParameters -from .object_mount_parameters import ObjectMountParameters -__all__ = ["Mount", "FileMountParameters"] +__all__ = ["Mount", "ObjectMount", "AgentMount", "CodeMount", "FileMount"] -class FileMountParameters(BaseModel): +class ObjectMount(BaseModel): + object_id: str + """The ID of the object to write.""" + + object_path: str + """The path to write the object on the Devbox. + + Use absolute path of object (ie /home/user/object.txt, or directory if archive + /home/user/archive_dir) + """ + + type: Literal["object_mount"] + + +class AgentMount(BaseModel): + agent_id: Optional[str] = None + """The ID of the agent to mount. Either agent_id or name must be set.""" + + agent_name: Optional[str] = None + """The name of the agent to mount. + + Returns the most recent agent with a matching name if no agent id string + provided. Either agent id or name must be set + """ + + type: Literal["agent_mount"] + + agent_path: Optional[str] = None + """Path to mount the agent on the Devbox. + + Required for git and object agents. Use absolute path (e.g., /home/user/agent) + """ + + auth_token: Optional[str] = None + """Optional auth token for private repositories. Only used for git agents.""" + + +class CodeMount(BaseModel): + repo_name: str + """The name of the repo to mount. + + By default, code will be mounted at /home/user/{repo_name}s. + """ + + repo_owner: str + """The owner of the repo.""" + + type: Literal["code_mount"] + + token: Optional[str] = None + """The authentication token necessary to pull repo.""" + + install_command: Optional[str] = None + """Installation command to install and setup repository.""" + + +class FileMount(BaseModel): content: str """Content of the file to mount.""" @@ -22,7 +75,4 @@ class FileMountParameters(BaseModel): type: Literal["file_mount"] -Mount: TypeAlias = Annotated[ - Union[ObjectMountParameters, AgentMountParameters, CodeMountParameters, FileMountParameters], - PropertyInfo(discriminator="type"), -] +Mount: TypeAlias = Annotated[Union[ObjectMount, AgentMount, CodeMount, FileMount], PropertyInfo(discriminator="type")] diff --git a/src/runloop_api_client/types/shared/object_mount_parameters.py b/src/runloop_api_client/types/shared/object_mount_parameters.py deleted file mode 100644 index 3413d0e1d..000000000 --- a/src/runloop_api_client/types/shared/object_mount_parameters.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -from ..._models import BaseModel - -__all__ = ["ObjectMountParameters"] - - -class ObjectMountParameters(BaseModel): - object_id: str - """The ID of the object to write.""" - - object_path: str - """The path to write the object on the Devbox. - - Use absolute path of object (ie /home/user/object.txt, or directory if archive - /home/user/archive_dir) - """ - - type: Literal["object_mount"] diff --git a/src/runloop_api_client/types/shared_params/__init__.py b/src/runloop_api_client/types/shared_params/__init__.py index 696abb529..b5e4e6f75 100644 --- a/src/runloop_api_client/types/shared_params/__init__.py +++ b/src/runloop_api_client/types/shared_params/__init__.py @@ -6,5 +6,3 @@ from .agent_source import AgentSource as AgentSource from .launch_parameters import LaunchParameters as LaunchParameters from .code_mount_parameters import CodeMountParameters as CodeMountParameters -from .agent_mount_parameters import AgentMountParameters as AgentMountParameters -from .object_mount_parameters import ObjectMountParameters as ObjectMountParameters diff --git a/src/runloop_api_client/types/shared_params/agent_mount_parameters.py b/src/runloop_api_client/types/shared_params/agent_mount_parameters.py deleted file mode 100644 index 17c18dc32..000000000 --- a/src/runloop_api_client/types/shared_params/agent_mount_parameters.py +++ /dev/null @@ -1,31 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Optional -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["AgentMountParameters"] - - -class AgentMountParameters(TypedDict, total=False): - agent_id: Required[Optional[str]] - """The ID of the agent to mount. Either agent_id or name must be set.""" - - agent_name: Required[Optional[str]] - """The name of the agent to mount. - - Returns the most recent agent with a matching name if no agent id string - provided. Either agent id or name must be set - """ - - type: Required[Literal["agent_mount"]] - - agent_path: Optional[str] - """Path to mount the agent on the Devbox. - - Required for git and object agents. Use absolute path (e.g., /home/user/agent) - """ - - auth_token: Optional[str] - """Optional auth token for private repositories. Only used for git agents.""" diff --git a/src/runloop_api_client/types/shared_params/code_mount_parameters.py b/src/runloop_api_client/types/shared_params/code_mount_parameters.py index 6b3a64511..5afa72523 100644 --- a/src/runloop_api_client/types/shared_params/code_mount_parameters.py +++ b/src/runloop_api_client/types/shared_params/code_mount_parameters.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Optional -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Required, TypedDict __all__ = ["CodeMountParameters"] @@ -18,8 +18,6 @@ class CodeMountParameters(TypedDict, total=False): repo_owner: Required[str] """The owner of the repo.""" - type: Required[Literal["code_mount"]] - token: Optional[str] """The authentication token necessary to pull repo.""" diff --git a/src/runloop_api_client/types/shared_params/mount.py b/src/runloop_api_client/types/shared_params/mount.py index 1b680e810..d0976e35f 100644 --- a/src/runloop_api_client/types/shared_params/mount.py +++ b/src/runloop_api_client/types/shared_params/mount.py @@ -2,17 +2,69 @@ from __future__ import annotations -from typing import Union +from typing import Union, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict -from .code_mount_parameters import CodeMountParameters -from .agent_mount_parameters import AgentMountParameters -from .object_mount_parameters import ObjectMountParameters +__all__ = ["Mount", "ObjectMount", "AgentMount", "CodeMount", "FileMount"] -__all__ = ["Mount", "FileMountParameters"] +class ObjectMount(TypedDict, total=False): + object_id: Required[str] + """The ID of the object to write.""" -class FileMountParameters(TypedDict, total=False): + object_path: Required[str] + """The path to write the object on the Devbox. + + Use absolute path of object (ie /home/user/object.txt, or directory if archive + /home/user/archive_dir) + """ + + type: Required[Literal["object_mount"]] + + +class AgentMount(TypedDict, total=False): + agent_id: Required[Optional[str]] + """The ID of the agent to mount. Either agent_id or name must be set.""" + + agent_name: Required[Optional[str]] + """The name of the agent to mount. + + Returns the most recent agent with a matching name if no agent id string + provided. Either agent id or name must be set + """ + + type: Required[Literal["agent_mount"]] + + agent_path: Optional[str] + """Path to mount the agent on the Devbox. + + Required for git and object agents. Use absolute path (e.g., /home/user/agent) + """ + + auth_token: Optional[str] + """Optional auth token for private repositories. Only used for git agents.""" + + +class CodeMount(TypedDict, total=False): + repo_name: Required[str] + """The name of the repo to mount. + + By default, code will be mounted at /home/user/{repo_name}s. + """ + + repo_owner: Required[str] + """The owner of the repo.""" + + type: Required[Literal["code_mount"]] + + token: Optional[str] + """The authentication token necessary to pull repo.""" + + install_command: Optional[str] + """Installation command to install and setup repository.""" + + +class FileMount(TypedDict, total=False): content: Required[str] """Content of the file to mount.""" @@ -22,4 +74,4 @@ class FileMountParameters(TypedDict, total=False): type: Required[Literal["file_mount"]] -Mount: TypeAlias = Union[ObjectMountParameters, AgentMountParameters, CodeMountParameters, FileMountParameters] +Mount: TypeAlias = Union[ObjectMount, AgentMount, CodeMount, FileMount] diff --git a/src/runloop_api_client/types/shared_params/object_mount_parameters.py b/src/runloop_api_client/types/shared_params/object_mount_parameters.py deleted file mode 100644 index 8b22ebf74..000000000 --- a/src/runloop_api_client/types/shared_params/object_mount_parameters.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, Required, TypedDict - -__all__ = ["ObjectMountParameters"] - - -class ObjectMountParameters(TypedDict, total=False): - object_id: Required[str] - """The ID of the object to write.""" - - object_path: Required[str] - """The path to write the object on the Devbox. - - Use absolute path of object (ie /home/user/object.txt, or directory if archive - /home/user/archive_dir) - """ - - type: Required[Literal["object_mount"]] diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 1c45cbfb6..66c1d3400 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -44,7 +44,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: { "repo_name": "repo_name", "repo_owner": "repo_owner", - "type": "code_mount", "token": "token", "install_command": "install_command", } @@ -385,7 +384,6 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: { "repo_name": "repo_name", "repo_owner": "repo_owner", - "type": "code_mount", "token": "token", "install_command": "install_command", } @@ -482,7 +480,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - { "repo_name": "repo_name", "repo_owner": "repo_owner", - "type": "code_mount", "token": "token", "install_command": "install_command", } @@ -823,7 +820,6 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) { "repo_name": "repo_name", "repo_owner": "repo_owner", - "type": "code_mount", "token": "token", "install_command": "install_command", } diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 7a17bb2e3..1ea6ee17d 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -54,7 +54,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: { "repo_name": "repo_name", "repo_owner": "repo_owner", - "type": "code_mount", "token": "token", "install_command": "install_command", } @@ -1130,7 +1129,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - { "repo_name": "repo_name", "repo_owner": "repo_owner", - "type": "code_mount", "token": "token", "install_command": "install_command", } From 375c5acd1dc3e32aa731335fc89d02234e30d0e0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 8 Dec 2025 20:23:32 +0000 Subject: [PATCH 923/993] feat(devbox): default to x86 arch --- .stats.yml | 4 ++-- src/runloop_api_client/types/shared/launch_parameters.py | 2 +- .../types/shared_params/launch_parameters.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0cb6f9948..ca5e82df9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 97 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b92a4ee1d2c5382b0d77ec6a16e2e03b79bfd0a08cd75e28ee219350d5b6c5c6.yml -openapi_spec_hash: 20d89d072b105d18e5bb8f73adb75063 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f2df3524e4b99c38b634c334d098aa2c7d543d5ea0f49c4dd8f4d92723b81b94.yml +openapi_spec_hash: c377abec5716d1d6c5b01a527a5bfdfb config_hash: 2363f563f42501d2b1587a4f64bdccaf diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index b45cced7c..f70023d66 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -25,7 +25,7 @@ class LaunchParameters(BaseModel): """ architecture: Optional[Literal["x86_64", "arm64"]] = None - """The target architecture for the Devbox. If unset, defaults to arm64.""" + """The target architecture for the Devbox. If unset, defaults to x86_64.""" available_ports: Optional[List[int]] = None """A list of ports to make available on the Devbox. diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index 5016d2acb..f0fe87636 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -27,7 +27,7 @@ class LaunchParameters(TypedDict, total=False): """ architecture: Optional[Literal["x86_64", "arm64"]] - """The target architecture for the Devbox. If unset, defaults to arm64.""" + """The target architecture for the Devbox. If unset, defaults to x86_64.""" available_ports: Optional[Iterable[int]] """A list of ports to make available on the Devbox. From 2a64357e09af967f6bb861b0cc733a881087a422 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 02:33:57 +0000 Subject: [PATCH 924/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2601677b9..d0ab6645f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.1.0" + ".": "1.2.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 51e3930f8..72bca17cd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "1.1.0" +version = "1.2.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index f9df84b5e..e13ec2fd5 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "1.1.0" # x-release-please-version +__version__ = "1.2.0" # x-release-please-version diff --git a/uv.lock b/uv.lock index 0be9ae737..acc8995ab 100644 --- a/uv.lock +++ b/uv.lock @@ -1321,7 +1321,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "1.1.0" +version = "1.2.0" source = { editable = "." } dependencies = [ { name = "anyio" }, From adc60c257445bace9e3ff2d2fdfd8e07bf0ebff6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 03:35:16 +0000 Subject: [PATCH 925/993] fix(types): allow pyright to infer TypedDict types within SequenceNotStr --- src/runloop_api_client/_types.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/runloop_api_client/_types.py b/src/runloop_api_client/_types.py index a2a12e84e..31df93064 100644 --- a/src/runloop_api_client/_types.py +++ b/src/runloop_api_client/_types.py @@ -243,6 +243,9 @@ class HttpxSendArgs(TypedDict, total=False): if TYPE_CHECKING: # This works because str.__contains__ does not accept object (either in typeshed or at runtime) # https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285 + # + # Note: index() and count() methods are intentionally omitted to allow pyright to properly + # infer TypedDict types when dict literals are used in lists assigned to SequenceNotStr. class SequenceNotStr(Protocol[_T_co]): @overload def __getitem__(self, index: SupportsIndex, /) -> _T_co: ... @@ -251,8 +254,6 @@ def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ... def __contains__(self, value: object, /) -> bool: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[_T_co]: ... - def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ... - def count(self, value: Any, /) -> int: ... def __reversed__(self) -> Iterator[_T_co]: ... else: # just point this to a normal `Sequence` at runtime to avoid having to special case From 988c7561c5f0291cef0018e7e26332bf43f19bd8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 03:36:48 +0000 Subject: [PATCH 926/993] chore: add missing docstrings --- .../types/agent_list_view.py | 2 ++ src/runloop_api_client/types/agent_view.py | 2 ++ .../types/benchmark_run_view.py | 4 ++++ .../types/benchmark_view.py | 4 ++++ .../types/blueprint_build_parameters.py | 4 ++++ .../types/blueprint_create_params.py | 4 ++++ .../types/blueprint_preview_params.py | 4 ++++ .../types/blueprint_view.py | 7 ++++++ src/runloop_api_client/types/devbox_view.py | 5 +++++ .../types/devboxes/browser_view.py | 4 ++++ .../types/devboxes/computer_create_params.py | 2 ++ .../computer_mouse_interaction_params.py | 5 +++++ .../types/devboxes/computer_view.py | 4 ++++ src/runloop_api_client/types/input_context.py | 4 ++++ .../types/input_context_param.py | 4 ++++ .../types/inspection_source_param.py | 2 ++ .../types/object_download_url_view.py | 2 ++ .../types/object_list_view.py | 2 ++ src/runloop_api_client/types/object_view.py | 2 ++ .../types/repository_connection_view.py | 2 ++ .../types/repository_inspection_details.py | 6 +++++ .../types/repository_manifest_view.py | 16 ++++++++++++++ .../types/scenario_environment.py | 4 ++++ .../types/scenario_environment_param.py | 4 ++++ .../types/scenario_run_view.py | 5 +++++ src/runloop_api_client/types/scenario_view.py | 4 ++++ .../types/scenarios/scorer_create_response.py | 2 ++ .../types/scenarios/scorer_list_response.py | 2 ++ .../scenarios/scorer_retrieve_response.py | 2 ++ .../types/scenarios/scorer_update_response.py | 2 ++ .../types/scoring_contract.py | 4 ++++ .../types/scoring_contract_param.py | 4 ++++ .../types/scoring_contract_result_view.py | 4 ++++ .../types/scoring_function.py | 22 +++++++++++++++++++ .../types/scoring_function_param.py | 22 +++++++++++++++++++ .../types/scoring_function_result_view.py | 4 ++++ .../types/secret_list_view.py | 2 ++ src/runloop_api_client/types/secret_view.py | 4 ++++ .../types/shared/agent_source.py | 10 +++++++++ .../types/shared/launch_parameters.py | 9 ++++++++ .../types/shared_params/agent_source.py | 10 +++++++++ .../types/shared_params/launch_parameters.py | 9 ++++++++ 42 files changed, 220 insertions(+) diff --git a/src/runloop_api_client/types/agent_list_view.py b/src/runloop_api_client/types/agent_list_view.py index c2a7be455..bfb1560e1 100644 --- a/src/runloop_api_client/types/agent_list_view.py +++ b/src/runloop_api_client/types/agent_list_view.py @@ -9,6 +9,8 @@ class AgentListView(BaseModel): + """A paginated list of Agents.""" + agents: List[AgentView] """The list of Agents.""" diff --git a/src/runloop_api_client/types/agent_view.py b/src/runloop_api_client/types/agent_view.py index 77e56d1b8..d02f425bf 100644 --- a/src/runloop_api_client/types/agent_view.py +++ b/src/runloop_api_client/types/agent_view.py @@ -9,6 +9,8 @@ class AgentView(BaseModel): + """An Agent represents a registered AI agent entity.""" + id: str """The unique identifier of the Agent.""" diff --git a/src/runloop_api_client/types/benchmark_run_view.py b/src/runloop_api_client/types/benchmark_run_view.py index 00dd98fc2..07fd4c022 100644 --- a/src/runloop_api_client/types/benchmark_run_view.py +++ b/src/runloop_api_client/types/benchmark_run_view.py @@ -9,6 +9,10 @@ class BenchmarkRunView(BaseModel): + """ + A BenchmarkRunView represents a run of a complete set of Scenarios, organized under a Benchmark. + """ + id: str """The ID of the BenchmarkRun.""" diff --git a/src/runloop_api_client/types/benchmark_view.py b/src/runloop_api_client/types/benchmark_view.py index 877c8fe26..4150847ac 100644 --- a/src/runloop_api_client/types/benchmark_view.py +++ b/src/runloop_api_client/types/benchmark_view.py @@ -10,6 +10,10 @@ class BenchmarkView(BaseModel): + """ + A BenchmarkDefinitionView represents a grouped set of Scenarios that together form a Benchmark. + """ + id: str """The ID of the Benchmark.""" diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index 129a8047a..52ddfda7c 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -11,6 +11,8 @@ class BuildContext(BaseModel): + """A build context backed by an Object.""" + object_id: str """The ID of an object, whose contents are to be used as a build context.""" @@ -18,6 +20,8 @@ class BuildContext(BaseModel): class ServiceCredentials(BaseModel): + """The credentials of the container service.""" + password: str """The password of the container service.""" diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index d82de7f35..94156d2e9 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -71,6 +71,8 @@ class BlueprintCreateParams(TypedDict, total=False): class BuildContext(TypedDict, total=False): + """A build context backed by an Object.""" + object_id: Required[str] """The ID of an object, whose contents are to be used as a build context.""" @@ -78,6 +80,8 @@ class BuildContext(TypedDict, total=False): class ServiceCredentials(TypedDict, total=False): + """The credentials of the container service.""" + password: Required[str] """The password of the container service.""" diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index 9f6c4d9bc..4269b734f 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -71,6 +71,8 @@ class BlueprintPreviewParams(TypedDict, total=False): class BuildContext(TypedDict, total=False): + """A build context backed by an Object.""" + object_id: Required[str] """The ID of an object, whose contents are to be used as a build context.""" @@ -78,6 +80,8 @@ class BuildContext(TypedDict, total=False): class ServiceCredentials(TypedDict, total=False): + """The credentials of the container service.""" + password: Required[str] """The password of the container service.""" diff --git a/src/runloop_api_client/types/blueprint_view.py b/src/runloop_api_client/types/blueprint_view.py index 7a10d1686..851b09426 100644 --- a/src/runloop_api_client/types/blueprint_view.py +++ b/src/runloop_api_client/types/blueprint_view.py @@ -10,6 +10,8 @@ class ContainerizedServiceCredentials(BaseModel): + """The credentials of the container service.""" + password: str """The password of the container service.""" @@ -41,6 +43,11 @@ class ContainerizedService(BaseModel): class BlueprintView(BaseModel): + """Blueprints are ways to create customized starting points for Devboxes. + + They allow you to define custom starting points for Devboxes such that environment set up can be cached to improve Devbox boot times. + """ + id: str """The id of the Blueprint.""" diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 007af6575..e2c9a28d8 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -31,6 +31,11 @@ class StateTransition(BaseModel): class DevboxView(BaseModel): + """A Devbox represents a virtual development environment. + + It is an isolated sandbox that can be given to agents and used to run arbitrary code such as AI generated code. + """ + id: str """The ID of the Devbox.""" diff --git a/src/runloop_api_client/types/devboxes/browser_view.py b/src/runloop_api_client/types/devboxes/browser_view.py index d6d377a28..4486d76ec 100644 --- a/src/runloop_api_client/types/devboxes/browser_view.py +++ b/src/runloop_api_client/types/devboxes/browser_view.py @@ -7,6 +7,10 @@ class BrowserView(BaseModel): + """ + A Browser represents a managed implementation of a browser like Chromiumon top of Devboxes. It includes the tunnel to the live screen and the underlying DevboxView. + """ + connection_url: str """ The url to enable remote connection from browser automation tools like diff --git a/src/runloop_api_client/types/devboxes/computer_create_params.py b/src/runloop_api_client/types/devboxes/computer_create_params.py index febd5aef5..c2e32e035 100644 --- a/src/runloop_api_client/types/devboxes/computer_create_params.py +++ b/src/runloop_api_client/types/devboxes/computer_create_params.py @@ -17,6 +17,8 @@ class ComputerCreateParams(TypedDict, total=False): class DisplayDimensions(TypedDict, total=False): + """Customize the dimensions of the computer display.""" + display_height_px: Required[int] """The height of the display being controlled by the model in pixels.""" diff --git a/src/runloop_api_client/types/devboxes/computer_mouse_interaction_params.py b/src/runloop_api_client/types/devboxes/computer_mouse_interaction_params.py index b28a0723f..a3a02279d 100644 --- a/src/runloop_api_client/types/devboxes/computer_mouse_interaction_params.py +++ b/src/runloop_api_client/types/devboxes/computer_mouse_interaction_params.py @@ -23,6 +23,11 @@ class ComputerMouseInteractionParams(TypedDict, total=False): class Coordinate(TypedDict, total=False): + """ + The x (pixels from the left) and y (pixels from the top) coordinates for the mouse to move or click-drag. Required only by + `action=mouse_move` or `action=left_click_drag` + """ + x: Required[int] """The x coordinate (pixels from the left) for the mouse to move or click-drag.""" diff --git a/src/runloop_api_client/types/devboxes/computer_view.py b/src/runloop_api_client/types/devboxes/computer_view.py index 907629d54..4706d44a0 100644 --- a/src/runloop_api_client/types/devboxes/computer_view.py +++ b/src/runloop_api_client/types/devboxes/computer_view.py @@ -7,6 +7,10 @@ class ComputerView(BaseModel): + """ + A Computer represents an implementation of Anthropic Computer usage on top of Devboxes. It includes the tunnel to the live screen and the underlying DevboxView. + """ + devbox: DevboxView """The underlying devbox the computer setup is running on.""" diff --git a/src/runloop_api_client/types/input_context.py b/src/runloop_api_client/types/input_context.py index 5cc697db9..2daae5d45 100644 --- a/src/runloop_api_client/types/input_context.py +++ b/src/runloop_api_client/types/input_context.py @@ -8,6 +8,10 @@ class InputContext(BaseModel): + """ + InputContextView specifies the problem statement along with all additional context for a Scenario. + """ + problem_statement: str """The problem statement for the Scenario.""" diff --git a/src/runloop_api_client/types/input_context_param.py b/src/runloop_api_client/types/input_context_param.py index 7f977ad65..b0b495c4d 100644 --- a/src/runloop_api_client/types/input_context_param.py +++ b/src/runloop_api_client/types/input_context_param.py @@ -9,6 +9,10 @@ class InputContextParam(TypedDict, total=False): + """ + InputContextView specifies the problem statement along with all additional context for a Scenario. + """ + problem_statement: Required[str] """The problem statement for the Scenario.""" diff --git a/src/runloop_api_client/types/inspection_source_param.py b/src/runloop_api_client/types/inspection_source_param.py index ba9e7f397..0d1308d8e 100644 --- a/src/runloop_api_client/types/inspection_source_param.py +++ b/src/runloop_api_client/types/inspection_source_param.py @@ -9,6 +9,8 @@ class InspectionSourceParam(TypedDict, total=False): + """Use a RepositoryInspection a source of a Blueprint build.""" + inspection_id: Required[str] """The ID of a repository inspection.""" diff --git a/src/runloop_api_client/types/object_download_url_view.py b/src/runloop_api_client/types/object_download_url_view.py index eb35ac3db..d1e726ca5 100644 --- a/src/runloop_api_client/types/object_download_url_view.py +++ b/src/runloop_api_client/types/object_download_url_view.py @@ -6,5 +6,7 @@ class ObjectDownloadURLView(BaseModel): + """A response containing a presigned download URL for an Object.""" + download_url: str """The presigned download URL for the Object.""" diff --git a/src/runloop_api_client/types/object_list_view.py b/src/runloop_api_client/types/object_list_view.py index 049b1be81..cfd546c0c 100644 --- a/src/runloop_api_client/types/object_list_view.py +++ b/src/runloop_api_client/types/object_list_view.py @@ -9,6 +9,8 @@ class ObjectListView(BaseModel): + """A paginated list of Objects.""" + has_more: bool """True if there are more results available beyond this page.""" diff --git a/src/runloop_api_client/types/object_view.py b/src/runloop_api_client/types/object_view.py index 80aea62ed..d4ced655f 100644 --- a/src/runloop_api_client/types/object_view.py +++ b/src/runloop_api_client/types/object_view.py @@ -9,6 +9,8 @@ class ObjectView(BaseModel): + """An Object represents a stored data entity with metadata.""" + id: str """The unique identifier of the Object.""" diff --git a/src/runloop_api_client/types/repository_connection_view.py b/src/runloop_api_client/types/repository_connection_view.py index 74718de27..e126071e8 100644 --- a/src/runloop_api_client/types/repository_connection_view.py +++ b/src/runloop_api_client/types/repository_connection_view.py @@ -6,6 +6,8 @@ class RepositoryConnectionView(BaseModel): + """The ID of the Repository.""" + id: str """The ID of the Repository.""" diff --git a/src/runloop_api_client/types/repository_inspection_details.py b/src/runloop_api_client/types/repository_inspection_details.py index f83932d29..0870ce693 100644 --- a/src/runloop_api_client/types/repository_inspection_details.py +++ b/src/runloop_api_client/types/repository_inspection_details.py @@ -10,6 +10,8 @@ class WorkflowContextsActionsContext(BaseModel): + """Details about actions processing for this workflow.""" + actions_skipped_unnecessary: List[str] """ Actions that were skipped because they were unnecessary (e.g., upload @@ -26,6 +28,10 @@ class WorkflowContextsActionsContext(BaseModel): class WorkflowContexts(BaseModel): + """ + Workflow context containing file name and details about actions processing during inspection. + """ + actions_context: WorkflowContextsActionsContext """Details about actions processing for this workflow.""" diff --git a/src/runloop_api_client/types/repository_manifest_view.py b/src/runloop_api_client/types/repository_manifest_view.py index 461722b59..acb862672 100644 --- a/src/runloop_api_client/types/repository_manifest_view.py +++ b/src/runloop_api_client/types/repository_manifest_view.py @@ -17,6 +17,8 @@ class ContainerConfig(BaseModel): + """Container configuration specifying the base image and setup commands.""" + base_image_name: str """The name of the base image. @@ -41,6 +43,10 @@ class Language(BaseModel): class WorkspaceDevCommands(BaseModel): + """ + Extracted common commands important to the developer life cycle like linting, testing, building, etc. + """ + build: Optional[List[str]] = None """Build command (e.g. npm run build).""" @@ -58,6 +64,10 @@ class WorkspaceDevCommands(BaseModel): class Workspace(BaseModel): + """ + A workspace is a buildable unit of code within a repository and often represents a deployable unit of code like a backend service or a frontend app. + """ + build_tool: List[str] """Name of the build tool used (e.g. pip, npm).""" @@ -96,6 +106,8 @@ class Workspace(BaseModel): class ContainerizedServiceCredentials(BaseModel): + """The credentials of the container service.""" + password: str """The password of the container service.""" @@ -127,6 +139,10 @@ class ContainerizedService(BaseModel): class RepositoryManifestView(BaseModel): + """ + The repository manifest contains container configuration and workspace definitions for a repository. + """ + container_config: ContainerConfig """Container configuration specifying the base image and setup commands.""" diff --git a/src/runloop_api_client/types/scenario_environment.py b/src/runloop_api_client/types/scenario_environment.py index 94e244df9..b6ac9b039 100644 --- a/src/runloop_api_client/types/scenario_environment.py +++ b/src/runloop_api_client/types/scenario_environment.py @@ -9,6 +9,10 @@ class ScenarioEnvironment(BaseModel): + """ + ScenarioEnvironmentParameters specify the environment in which a Scenario will be run. + """ + blueprint_id: Optional[str] = None """Use the blueprint with matching ID.""" diff --git a/src/runloop_api_client/types/scenario_environment_param.py b/src/runloop_api_client/types/scenario_environment_param.py index 5069e5943..6a219d250 100644 --- a/src/runloop_api_client/types/scenario_environment_param.py +++ b/src/runloop_api_client/types/scenario_environment_param.py @@ -11,6 +11,10 @@ class ScenarioEnvironmentParam(TypedDict, total=False): + """ + ScenarioEnvironmentParameters specify the environment in which a Scenario will be run. + """ + blueprint_id: Optional[str] """Use the blueprint with matching ID.""" diff --git a/src/runloop_api_client/types/scenario_run_view.py b/src/runloop_api_client/types/scenario_run_view.py index 225e90a89..68d4c3573 100644 --- a/src/runloop_api_client/types/scenario_run_view.py +++ b/src/runloop_api_client/types/scenario_run_view.py @@ -10,6 +10,11 @@ class ScenarioRunView(BaseModel): + """A ScenarioRunView represents a single run of a Scenario on a Devbox. + + When completed, the ScenarioRun will contain the final score and output of the run. + """ + id: str """ID of the ScenarioRun.""" diff --git a/src/runloop_api_client/types/scenario_view.py b/src/runloop_api_client/types/scenario_view.py index 58c0dbb26..5c5ba0164 100644 --- a/src/runloop_api_client/types/scenario_view.py +++ b/src/runloop_api_client/types/scenario_view.py @@ -12,6 +12,10 @@ class ScenarioView(BaseModel): + """ + A ScenarioDefinitionView represents a repeatable AI coding evaluation test, complete with initial environment and scoring contract. + """ + id: str """The ID of the Scenario.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_create_response.py b/src/runloop_api_client/types/scenarios/scorer_create_response.py index 376c50f70..2b6e665a1 100644 --- a/src/runloop_api_client/types/scenarios/scorer_create_response.py +++ b/src/runloop_api_client/types/scenarios/scorer_create_response.py @@ -6,6 +6,8 @@ class ScorerCreateResponse(BaseModel): + """A ScenarioScorerView represents a custom scoring function for a Scenario.""" + id: str """ID for the scenario scorer.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_list_response.py b/src/runloop_api_client/types/scenarios/scorer_list_response.py index bdbc9b9de..46eb8802e 100644 --- a/src/runloop_api_client/types/scenarios/scorer_list_response.py +++ b/src/runloop_api_client/types/scenarios/scorer_list_response.py @@ -6,6 +6,8 @@ class ScorerListResponse(BaseModel): + """A ScenarioScorerView represents a custom scoring function for a Scenario.""" + id: str """ID for the scenario scorer.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_retrieve_response.py b/src/runloop_api_client/types/scenarios/scorer_retrieve_response.py index ab0f85231..a67cd35c0 100644 --- a/src/runloop_api_client/types/scenarios/scorer_retrieve_response.py +++ b/src/runloop_api_client/types/scenarios/scorer_retrieve_response.py @@ -6,6 +6,8 @@ class ScorerRetrieveResponse(BaseModel): + """A ScenarioScorerView represents a custom scoring function for a Scenario.""" + id: str """ID for the scenario scorer.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_update_response.py b/src/runloop_api_client/types/scenarios/scorer_update_response.py index 60a1b5e4b..91e668d22 100644 --- a/src/runloop_api_client/types/scenarios/scorer_update_response.py +++ b/src/runloop_api_client/types/scenarios/scorer_update_response.py @@ -6,6 +6,8 @@ class ScorerUpdateResponse(BaseModel): + """A ScenarioScorerView represents a custom scoring function for a Scenario.""" + id: str """ID for the scenario scorer.""" diff --git a/src/runloop_api_client/types/scoring_contract.py b/src/runloop_api_client/types/scoring_contract.py index f19f5aa54..d3c646fda 100644 --- a/src/runloop_api_client/types/scoring_contract.py +++ b/src/runloop_api_client/types/scoring_contract.py @@ -9,5 +9,9 @@ class ScoringContract(BaseModel): + """ + InputContextView specifies the problem statement along with all additional context for a Scenario. + """ + scoring_function_parameters: List[ScoringFunction] """A list of scoring functions used to evaluate the Scenario.""" diff --git a/src/runloop_api_client/types/scoring_contract_param.py b/src/runloop_api_client/types/scoring_contract_param.py index 4a68abb93..46f1b7b6d 100644 --- a/src/runloop_api_client/types/scoring_contract_param.py +++ b/src/runloop_api_client/types/scoring_contract_param.py @@ -11,5 +11,9 @@ class ScoringContractParam(TypedDict, total=False): + """ + InputContextView specifies the problem statement along with all additional context for a Scenario. + """ + scoring_function_parameters: Required[Iterable[ScoringFunctionParam]] """A list of scoring functions used to evaluate the Scenario.""" diff --git a/src/runloop_api_client/types/scoring_contract_result_view.py b/src/runloop_api_client/types/scoring_contract_result_view.py index 823de83c4..85e1a42c4 100644 --- a/src/runloop_api_client/types/scoring_contract_result_view.py +++ b/src/runloop_api_client/types/scoring_contract_result_view.py @@ -9,6 +9,10 @@ class ScoringContractResultView(BaseModel): + """ + A ScoringContractResultView represents the result of running all scoring functions on a given input context. + """ + score: float """Total score for all scoring contracts. This will be a value between 0 and 1.""" diff --git a/src/runloop_api_client/types/scoring_function.py b/src/runloop_api_client/types/scoring_function.py index c49ff61e4..837a46024 100644 --- a/src/runloop_api_client/types/scoring_function.py +++ b/src/runloop_api_client/types/scoring_function.py @@ -20,6 +20,8 @@ class ScorerAstGrepScoringFunction(BaseModel): + """AstGrepScoringFunction utilizes structured coach search for scoring.""" + pattern: str """AST pattern to match. @@ -37,6 +39,10 @@ class ScorerAstGrepScoringFunction(BaseModel): class ScorerBashScriptScoringFunction(BaseModel): + """ + BashScriptScoringFunction is a scoring function specified by a bash script that will be run in the context of your environment. + """ + type: Literal["bash_script_scorer"] bash_script: Optional[str] = None @@ -48,6 +54,10 @@ class ScorerBashScriptScoringFunction(BaseModel): class ScorerCommandScoringFunction(BaseModel): + """ + CommandScoringFunction executes a single command and checks the result.The output of the command will be printed. Scoring will passed if the command returns status code 0, otherwise it will be failed. + """ + type: Literal["command_scorer"] command: Optional[str] = None @@ -55,6 +65,8 @@ class ScorerCommandScoringFunction(BaseModel): class ScorerCustomScoringFunction(BaseModel): + """CustomScoringFunction is a custom, user defined scoring function.""" + custom_scorer_type: str """Type of the scoring function, previously registered with Runloop.""" @@ -65,6 +77,10 @@ class ScorerCustomScoringFunction(BaseModel): class ScorerPythonScriptScoringFunction(BaseModel): + """ + PythonScriptScoringFunction will run a python script in the context of your environment as a ScoringFunction. + """ + python_script: str """Python script to be run. @@ -96,6 +112,10 @@ class ScorerTestBasedScoringFunctionTestFile(BaseModel): class ScorerTestBasedScoringFunction(BaseModel): + """ + TestBasedScoringFunction writes test files to disk and executes a test command to verify the solution. + """ + type: Literal["test_based_scorer"] test_command: Optional[str] = None @@ -119,6 +139,8 @@ class ScorerTestBasedScoringFunction(BaseModel): class ScoringFunction(BaseModel): + """ScoringFunction specifies a method of scoring a Scenario.""" + name: str """Name of scoring function. Names must only contain [a-zA-Z0-9_-].""" diff --git a/src/runloop_api_client/types/scoring_function_param.py b/src/runloop_api_client/types/scoring_function_param.py index e2c9bc253..c619c8d91 100644 --- a/src/runloop_api_client/types/scoring_function_param.py +++ b/src/runloop_api_client/types/scoring_function_param.py @@ -19,6 +19,8 @@ class ScorerAstGrepScoringFunction(TypedDict, total=False): + """AstGrepScoringFunction utilizes structured coach search for scoring.""" + pattern: Required[str] """AST pattern to match. @@ -36,6 +38,10 @@ class ScorerAstGrepScoringFunction(TypedDict, total=False): class ScorerBashScriptScoringFunction(TypedDict, total=False): + """ + BashScriptScoringFunction is a scoring function specified by a bash script that will be run in the context of your environment. + """ + type: Required[Literal["bash_script_scorer"]] bash_script: str @@ -47,6 +53,10 @@ class ScorerBashScriptScoringFunction(TypedDict, total=False): class ScorerCommandScoringFunction(TypedDict, total=False): + """ + CommandScoringFunction executes a single command and checks the result.The output of the command will be printed. Scoring will passed if the command returns status code 0, otherwise it will be failed. + """ + type: Required[Literal["command_scorer"]] command: str @@ -54,6 +64,8 @@ class ScorerCommandScoringFunction(TypedDict, total=False): class ScorerCustomScoringFunction(TypedDict, total=False): + """CustomScoringFunction is a custom, user defined scoring function.""" + custom_scorer_type: Required[str] """Type of the scoring function, previously registered with Runloop.""" @@ -64,6 +76,10 @@ class ScorerCustomScoringFunction(TypedDict, total=False): class ScorerPythonScriptScoringFunction(TypedDict, total=False): + """ + PythonScriptScoringFunction will run a python script in the context of your environment as a ScoringFunction. + """ + python_script: Required[str] """Python script to be run. @@ -95,6 +111,10 @@ class ScorerTestBasedScoringFunctionTestFile(TypedDict, total=False): class ScorerTestBasedScoringFunction(TypedDict, total=False): + """ + TestBasedScoringFunction writes test files to disk and executes a test command to verify the solution. + """ + type: Required[Literal["test_based_scorer"]] test_command: str @@ -115,6 +135,8 @@ class ScorerTestBasedScoringFunction(TypedDict, total=False): class ScoringFunctionParam(TypedDict, total=False): + """ScoringFunction specifies a method of scoring a Scenario.""" + name: Required[str] """Name of scoring function. Names must only contain [a-zA-Z0-9_-].""" diff --git a/src/runloop_api_client/types/scoring_function_result_view.py b/src/runloop_api_client/types/scoring_function_result_view.py index 8f782df11..4fe5b67cb 100644 --- a/src/runloop_api_client/types/scoring_function_result_view.py +++ b/src/runloop_api_client/types/scoring_function_result_view.py @@ -8,6 +8,10 @@ class ScoringFunctionResultView(BaseModel): + """ + A ScoringFunctionResultView represents the result of running a single scoring function on a given input context. + """ + output: str """Log output of the scoring function.""" diff --git a/src/runloop_api_client/types/secret_list_view.py b/src/runloop_api_client/types/secret_list_view.py index d7feec9c5..4d66fa2e4 100644 --- a/src/runloop_api_client/types/secret_list_view.py +++ b/src/runloop_api_client/types/secret_list_view.py @@ -9,6 +9,8 @@ class SecretListView(BaseModel): + """A paginated list of Secrets.""" + has_more: bool """True if there are more results available beyond this page.""" diff --git a/src/runloop_api_client/types/secret_view.py b/src/runloop_api_client/types/secret_view.py index 1303f7bfd..bd1c8811e 100644 --- a/src/runloop_api_client/types/secret_view.py +++ b/src/runloop_api_client/types/secret_view.py @@ -6,6 +6,10 @@ class SecretView(BaseModel): + """ + A Secret represents a key-value pair that can be securely stored and used in Devboxes as environment variables. + """ + id: str """The unique identifier of the Secret.""" diff --git a/src/runloop_api_client/types/shared/agent_source.py b/src/runloop_api_client/types/shared/agent_source.py index 25bcbbc1d..276a9300e 100644 --- a/src/runloop_api_client/types/shared/agent_source.py +++ b/src/runloop_api_client/types/shared/agent_source.py @@ -8,6 +8,8 @@ class Git(BaseModel): + """Git source configuration""" + repository: str """Git repository URL""" @@ -19,6 +21,8 @@ class Git(BaseModel): class Npm(BaseModel): + """NPM source configuration""" + package_name: str """NPM package name""" @@ -33,6 +37,8 @@ class Npm(BaseModel): class Object(BaseModel): + """Object store source configuration""" + object_id: str """Object ID""" @@ -41,6 +47,8 @@ class Object(BaseModel): class Pip(BaseModel): + """Pip source configuration""" + package_name: str """Pip package name""" @@ -55,6 +63,8 @@ class Pip(BaseModel): class AgentSource(BaseModel): + """Agent source configuration.""" + type: str """Source type: npm, pip, object, or git""" diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index f70023d66..dc0ccfccd 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -10,6 +10,11 @@ class UserParameters(BaseModel): + """Specify the user for execution on Devbox. + + If not set, default `user` will be used. + """ + uid: int """User ID (UID) for the Linux user. Must be a non-negative integer.""" @@ -18,6 +23,10 @@ class UserParameters(BaseModel): class LaunchParameters(BaseModel): + """ + LaunchParameters enable you to customize the resources available to your Devbox as well as the environment set up that should be completed before the Devbox is marked as 'running'. + """ + after_idle: Optional[AfterIdle] = None """Configure Devbox lifecycle based on idle activity. diff --git a/src/runloop_api_client/types/shared_params/agent_source.py b/src/runloop_api_client/types/shared_params/agent_source.py index 9f5a50845..90a32a217 100644 --- a/src/runloop_api_client/types/shared_params/agent_source.py +++ b/src/runloop_api_client/types/shared_params/agent_source.py @@ -11,6 +11,8 @@ class Git(TypedDict, total=False): + """Git source configuration""" + repository: Required[str] """Git repository URL""" @@ -22,6 +24,8 @@ class Git(TypedDict, total=False): class Npm(TypedDict, total=False): + """NPM source configuration""" + package_name: Required[str] """NPM package name""" @@ -36,6 +40,8 @@ class Npm(TypedDict, total=False): class Object(TypedDict, total=False): + """Object store source configuration""" + object_id: Required[str] """Object ID""" @@ -44,6 +50,8 @@ class Object(TypedDict, total=False): class Pip(TypedDict, total=False): + """Pip source configuration""" + package_name: Required[str] """Pip package name""" @@ -58,6 +66,8 @@ class Pip(TypedDict, total=False): class AgentSource(TypedDict, total=False): + """Agent source configuration.""" + type: Required[str] """Source type: npm, pip, object, or git""" diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index f0fe87636..cd2a97ee4 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -12,6 +12,11 @@ class UserParameters(TypedDict, total=False): + """Specify the user for execution on Devbox. + + If not set, default `user` will be used. + """ + uid: Required[int] """User ID (UID) for the Linux user. Must be a non-negative integer.""" @@ -20,6 +25,10 @@ class UserParameters(TypedDict, total=False): class LaunchParameters(TypedDict, total=False): + """ + LaunchParameters enable you to customize the resources available to your Devbox as well as the environment set up that should be completed before the Devbox is marked as 'running'. + """ + after_idle: Optional[AfterIdle] """Configure Devbox lifecycle based on idle activity. From 9749dc13a3734bfb4e6efc58b8eb69778d3a1a82 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 13 Dec 2025 00:58:01 +0000 Subject: [PATCH 927/993] feat(devbox): added stdin streaming endpoint --- .stats.yml | 4 +-- src/runloop_api_client/resources/agents.py | 20 +++++++++++-- .../resources/benchmarks/benchmarks.py | 20 +++++++++---- .../resources/benchmarks/runs.py | 16 ++++++++--- .../resources/blueprints.py | 24 +++++++++++++--- .../resources/devboxes/devboxes.py | 8 +++--- .../resources/devboxes/disk_snapshots.py | 4 +-- src/runloop_api_client/resources/objects.py | 8 +++--- .../resources/repositories.py | 4 +-- .../resources/scenarios/runs.py | 28 +++++++++++++++++-- .../resources/scenarios/scenarios.py | 16 ++++++++--- .../resources/scenarios/scorers.py | 4 +-- src/runloop_api_client/resources/secrets.py | 4 +-- .../types/agent_create_params.py | 3 ++ .../types/agent_list_params.py | 5 +++- src/runloop_api_client/types/agent_view.py | 3 ++ .../types/benchmark_definitions_params.py | 2 +- .../types/benchmark_list_params.py | 5 +++- .../types/benchmark_list_public_params.py | 2 +- .../types/benchmarks/run_list_params.py | 5 +++- .../run_list_scenario_runs_params.py | 2 +- .../types/blueprint_list_params.py | 5 +++- .../types/blueprint_list_public_params.py | 5 +++- .../devbox_list_disk_snapshots_params.py | 2 +- .../types/devbox_list_params.py | 2 +- .../devboxes/disk_snapshot_list_params.py | 2 +- .../types/object_list_params.py | 2 +- .../types/object_list_public_params.py | 2 +- .../types/repository_list_params.py | 2 +- .../types/scenario_list_params.py | 5 +++- .../types/scenario_list_public_params.py | 2 +- .../types/scenarios/run_list_params.py | 11 +++++++- .../types/scenarios/scorer_list_params.py | 2 +- .../types/secret_list_params.py | 2 +- .../types/shared/agent_source.py | 6 ---- .../types/shared_params/agent_source.py | 6 ---- tests/api_resources/benchmarks/test_runs.py | 2 ++ tests/api_resources/scenarios/test_runs.py | 6 ++++ tests/api_resources/test_agents.py | 14 +++++++--- tests/api_resources/test_benchmarks.py | 2 ++ tests/api_resources/test_blueprints.py | 4 +++ tests/api_resources/test_scenarios.py | 2 ++ 42 files changed, 198 insertions(+), 75 deletions(-) diff --git a/.stats.yml b/.stats.yml index ca5e82df9..4cce660dc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 97 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f2df3524e4b99c38b634c334d098aa2c7d543d5ea0f49c4dd8f4d92723b81b94.yml -openapi_spec_hash: c377abec5716d1d6c5b01a527a5bfdfb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-370a5d676ff0ef41f3ca6ed669d29b6e3e6b7f0a914ac3dbed6bd45e75533c74.yml +openapi_spec_hash: 7bb5ea1117d754b7985aff0da5bca3a7 config_hash: 2363f563f42501d2b1587a4f64bdccaf diff --git a/src/runloop_api_client/resources/agents.py b/src/runloop_api_client/resources/agents.py index 6ff202d74..9ac9f8c02 100644 --- a/src/runloop_api_client/resources/agents.py +++ b/src/runloop_api_client/resources/agents.py @@ -49,6 +49,7 @@ def create( self, *, name: str, + version: str, source: Optional[AgentSource] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -66,6 +67,8 @@ def create( Args: name: The name of the Agent. + version: The version of the Agent. Must be a semver string (e.g., '2.0.65') or a SHA. + source: The source configuration for the Agent. extra_headers: Send extra headers @@ -83,6 +86,7 @@ def create( body=maybe_transform( { "name": name, + "version": version, "source": source, }, agent_create_params.AgentCreateParams, @@ -138,6 +142,7 @@ def list( name: str | Omit = omit, search: str | Omit = omit, starting_after: str | Omit = omit, + version: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -151,7 +156,7 @@ def list( Args: is_public: Filter agents by public visibility. - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. name: Filter agents by name (partial match supported). @@ -159,6 +164,8 @@ def list( starting_after: Load the next page of data starting after the item with the given ID. + version: Filter by version. Use 'latest' to get the most recently created agent. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -182,6 +189,7 @@ def list( "name": name, "search": search, "starting_after": starting_after, + "version": version, }, agent_list_params.AgentListParams, ), @@ -214,6 +222,7 @@ async def create( self, *, name: str, + version: str, source: Optional[AgentSource] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -231,6 +240,8 @@ async def create( Args: name: The name of the Agent. + version: The version of the Agent. Must be a semver string (e.g., '2.0.65') or a SHA. + source: The source configuration for the Agent. extra_headers: Send extra headers @@ -248,6 +259,7 @@ async def create( body=await async_maybe_transform( { "name": name, + "version": version, "source": source, }, agent_create_params.AgentCreateParams, @@ -303,6 +315,7 @@ def list( name: str | Omit = omit, search: str | Omit = omit, starting_after: str | Omit = omit, + version: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -316,7 +329,7 @@ def list( Args: is_public: Filter agents by public visibility. - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. name: Filter agents by name (partial match supported). @@ -324,6 +337,8 @@ def list( starting_after: Load the next page of data starting after the item with the given ID. + version: Filter by version. Use 'latest' to get the most recently created agent. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -347,6 +362,7 @@ def list( "name": name, "search": search, "starting_after": starting_after, + "version": version, }, agent_list_params.AgentListParams, ), diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py index c30885e9e..419a0913a 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -252,6 +252,7 @@ def list( self, *, limit: int | Omit = omit, + name: str | Omit = omit, starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -264,7 +265,9 @@ def list( List all Benchmarks matching filter. Args: - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. + + name: Filter by name starting_after: Load the next page of data starting after the item with the given ID. @@ -287,6 +290,7 @@ def list( query=maybe_transform( { "limit": limit, + "name": name, "starting_after": starting_after, }, benchmark_list_params.BenchmarkListParams, @@ -312,7 +316,7 @@ def definitions( Get scenario definitions for a previously created Benchmark. Args: - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. starting_after: Load the next page of data starting after the item with the given ID. @@ -360,7 +364,7 @@ def list_public( List all public benchmarks matching filter. Args: - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. starting_after: Load the next page of data starting after the item with the given ID. @@ -660,6 +664,7 @@ def list( self, *, limit: int | Omit = omit, + name: str | Omit = omit, starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -672,7 +677,9 @@ def list( List all Benchmarks matching filter. Args: - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. + + name: Filter by name starting_after: Load the next page of data starting after the item with the given ID. @@ -695,6 +702,7 @@ def list( query=maybe_transform( { "limit": limit, + "name": name, "starting_after": starting_after, }, benchmark_list_params.BenchmarkListParams, @@ -720,7 +728,7 @@ async def definitions( Get scenario definitions for a previously created Benchmark. Args: - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. starting_after: Load the next page of data starting after the item with the given ID. @@ -768,7 +776,7 @@ def list_public( List all public benchmarks matching filter. Args: - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. starting_after: Load the next page of data starting after the item with the given ID. diff --git a/src/runloop_api_client/resources/benchmarks/runs.py b/src/runloop_api_client/resources/benchmarks/runs.py index 6d69d160b..cdab6fd30 100644 --- a/src/runloop_api_client/resources/benchmarks/runs.py +++ b/src/runloop_api_client/resources/benchmarks/runs.py @@ -83,6 +83,7 @@ def list( *, benchmark_id: str | Omit = omit, limit: int | Omit = omit, + name: str | Omit = omit, starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -97,7 +98,9 @@ def list( Args: benchmark_id: The Benchmark ID to filter by. - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. + + name: Filter by name starting_after: Load the next page of data starting after the item with the given ID. @@ -121,6 +124,7 @@ def list( { "benchmark_id": benchmark_id, "limit": limit, + "name": name, "starting_after": starting_after, }, run_list_params.RunListParams, @@ -227,7 +231,7 @@ def list_scenario_runs( List started scenario runs for a benchmark run. Args: - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. starting_after: Load the next page of data starting after the item with the given ID. @@ -322,6 +326,7 @@ def list( *, benchmark_id: str | Omit = omit, limit: int | Omit = omit, + name: str | Omit = omit, starting_after: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -336,7 +341,9 @@ def list( Args: benchmark_id: The Benchmark ID to filter by. - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. + + name: Filter by name starting_after: Load the next page of data starting after the item with the given ID. @@ -360,6 +367,7 @@ def list( { "benchmark_id": benchmark_id, "limit": limit, + "name": name, "starting_after": starting_after, }, run_list_params.RunListParams, @@ -466,7 +474,7 @@ def list_scenario_runs( List started scenario runs for a benchmark run. Args: - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. starting_after: Load the next page of data starting after the item with the given ID. diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index 96f9963c8..bfb781f2d 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -201,6 +201,7 @@ def list( limit: int | Omit = omit, name: str | Omit = omit, starting_after: str | Omit = omit, + status: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -212,12 +213,14 @@ def list( List all Blueprints or filter by name. Args: - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. name: Filter by name starting_after: Load the next page of data starting after the item with the given ID. + status: Filter by build status (queued, provisioning, building, failed, build_complete) + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -239,6 +242,7 @@ def list( "limit": limit, "name": name, "starting_after": starting_after, + "status": status, }, blueprint_list_params.BlueprintListParams, ), @@ -370,6 +374,7 @@ def list_public( limit: int | Omit = omit, name: str | Omit = omit, starting_after: str | Omit = omit, + status: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -381,12 +386,14 @@ def list_public( List all public Blueprints that are available to all users. Args: - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. name: Filter by name starting_after: Load the next page of data starting after the item with the given ID. + status: Filter by build status (queued, provisioning, building, failed, build_complete) + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -408,6 +415,7 @@ def list_public( "limit": limit, "name": name, "starting_after": starting_after, + "status": status, }, blueprint_list_public_params.BlueprintListPublicParams, ), @@ -720,6 +728,7 @@ def list( limit: int | Omit = omit, name: str | Omit = omit, starting_after: str | Omit = omit, + status: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -731,12 +740,14 @@ def list( List all Blueprints or filter by name. Args: - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. name: Filter by name starting_after: Load the next page of data starting after the item with the given ID. + status: Filter by build status (queued, provisioning, building, failed, build_complete) + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -758,6 +769,7 @@ def list( "limit": limit, "name": name, "starting_after": starting_after, + "status": status, }, blueprint_list_params.BlueprintListParams, ), @@ -889,6 +901,7 @@ def list_public( limit: int | Omit = omit, name: str | Omit = omit, starting_after: str | Omit = omit, + status: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -900,12 +913,14 @@ def list_public( List all public Blueprints that are available to all users. Args: - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. name: Filter by name starting_after: Load the next page of data starting after the item with the given ID. + status: Filter by build status (queued, provisioning, building, failed, build_complete) + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -927,6 +942,7 @@ def list_public( "limit": limit, "name": name, "starting_after": starting_after, + "status": status, }, blueprint_list_public_params.BlueprintListPublicParams, ), diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 03100a64c..ebbd34c80 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -361,7 +361,7 @@ def list( List all Devboxes while optionally filtering by status. Args: - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. starting_after: Load the next page of data starting after the item with the given ID. @@ -841,7 +841,7 @@ def list_disk_snapshots( Args: devbox_id: Devbox ID to filter by. - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. metadata_key: Filter snapshots by metadata key-value pair. Can be used multiple times for different keys. @@ -1669,7 +1669,7 @@ def list( List all Devboxes while optionally filtering by status. Args: - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. starting_after: Load the next page of data starting after the item with the given ID. @@ -2149,7 +2149,7 @@ def list_disk_snapshots( Args: devbox_id: Devbox ID to filter by. - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. metadata_key: Filter snapshots by metadata key-value pair. Can be used multiple times for different keys. diff --git a/src/runloop_api_client/resources/devboxes/disk_snapshots.py b/src/runloop_api_client/resources/devboxes/disk_snapshots.py index 8b20baa8a..b66186680 100644 --- a/src/runloop_api_client/resources/devboxes/disk_snapshots.py +++ b/src/runloop_api_client/resources/devboxes/disk_snapshots.py @@ -127,7 +127,7 @@ def list( Args: devbox_id: Devbox ID to filter by. - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. metadata_key: Filter snapshots by metadata key-value pair. Can be used multiple times for different keys. @@ -346,7 +346,7 @@ def list( Args: devbox_id: Devbox ID to filter by. - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. metadata_key: Filter snapshots by metadata key-value pair. Can be used multiple times for different keys. diff --git a/src/runloop_api_client/resources/objects.py b/src/runloop_api_client/resources/objects.py index 4d7d2e0a3..409d5f6f3 100644 --- a/src/runloop_api_client/resources/objects.py +++ b/src/runloop_api_client/resources/objects.py @@ -162,7 +162,7 @@ def list( Args: content_type: Filter storage objects by content type. - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. name: Filter storage objects by name (partial match supported). @@ -352,7 +352,7 @@ def list_public( Args: content_type: Filter storage objects by content type. - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. name: Filter storage objects by name (partial match supported). @@ -530,7 +530,7 @@ def list( Args: content_type: Filter storage objects by content type. - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. name: Filter storage objects by name (partial match supported). @@ -720,7 +720,7 @@ def list_public( Args: content_type: Filter storage objects by content type. - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. name: Filter storage objects by name (partial match supported). diff --git a/src/runloop_api_client/resources/repositories.py b/src/runloop_api_client/resources/repositories.py index e2b238750..a22075540 100644 --- a/src/runloop_api_client/resources/repositories.py +++ b/src/runloop_api_client/resources/repositories.py @@ -163,7 +163,7 @@ def list( List all available repository connections. Args: - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. name: Filter by repository name @@ -542,7 +542,7 @@ def list( List all available repository connections. Args: - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. name: Filter by repository name diff --git a/src/runloop_api_client/resources/scenarios/runs.py b/src/runloop_api_client/resources/scenarios/runs.py index 8af1a46a4..faa042747 100644 --- a/src/runloop_api_client/resources/scenarios/runs.py +++ b/src/runloop_api_client/resources/scenarios/runs.py @@ -86,9 +86,12 @@ def retrieve( def list( self, *, + benchmark_run_id: str | Omit = omit, limit: int | Omit = omit, + name: str | Omit = omit, scenario_id: str | Omit = omit, starting_after: str | Omit = omit, + state: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -100,12 +103,18 @@ def list( List all ScenarioRuns matching filter. Args: - limit: The limit of items to return. Default is 20. + benchmark_run_id: Filter by benchmark run ID + + limit: The limit of items to return. Default is 20. Max is 5000. + + name: Filter by name scenario_id: Filter runs associated to Scenario given ID starting_after: Load the next page of data starting after the item with the given ID. + state: Filter by state + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -124,9 +133,12 @@ def list( timeout=timeout, query=maybe_transform( { + "benchmark_run_id": benchmark_run_id, "limit": limit, + "name": name, "scenario_id": scenario_id, "starting_after": starting_after, + "state": state, }, run_list_params.RunListParams, ), @@ -357,9 +369,12 @@ async def retrieve( def list( self, *, + benchmark_run_id: str | Omit = omit, limit: int | Omit = omit, + name: str | Omit = omit, scenario_id: str | Omit = omit, starting_after: str | Omit = omit, + state: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -371,12 +386,18 @@ def list( List all ScenarioRuns matching filter. Args: - limit: The limit of items to return. Default is 20. + benchmark_run_id: Filter by benchmark run ID + + limit: The limit of items to return. Default is 20. Max is 5000. + + name: Filter by name scenario_id: Filter runs associated to Scenario given ID starting_after: Load the next page of data starting after the item with the given ID. + state: Filter by state + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -395,9 +416,12 @@ def list( timeout=timeout, query=maybe_transform( { + "benchmark_run_id": benchmark_run_id, "limit": limit, + "name": name, "scenario_id": scenario_id, "starting_after": starting_after, + "state": state, }, run_list_params.RunListParams, ), diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index d56441030..3d206de05 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -291,6 +291,7 @@ def list( limit: int | Omit = omit, name: str | Omit = omit, starting_after: str | Omit = omit, + validation_type: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -304,12 +305,14 @@ def list( Args: benchmark_id: Filter scenarios by benchmark ID. - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. name: Query for Scenarios with a given name. starting_after: Load the next page of data starting after the item with the given ID. + validation_type: Filter by validation type + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -332,6 +335,7 @@ def list( "limit": limit, "name": name, "starting_after": starting_after, + "validation_type": validation_type, }, scenario_list_params.ScenarioListParams, ), @@ -356,7 +360,7 @@ def list_public( List all public scenarios matching filter. Args: - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. name: Query for Scenarios with a given name. @@ -690,6 +694,7 @@ def list( limit: int | Omit = omit, name: str | Omit = omit, starting_after: str | Omit = omit, + validation_type: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -703,12 +708,14 @@ def list( Args: benchmark_id: Filter scenarios by benchmark ID. - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. name: Query for Scenarios with a given name. starting_after: Load the next page of data starting after the item with the given ID. + validation_type: Filter by validation type + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -731,6 +738,7 @@ def list( "limit": limit, "name": name, "starting_after": starting_after, + "validation_type": validation_type, }, scenario_list_params.ScenarioListParams, ), @@ -755,7 +763,7 @@ def list_public( List all public scenarios matching filter. Args: - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. name: Query for Scenarios with a given name. diff --git a/src/runloop_api_client/resources/scenarios/scorers.py b/src/runloop_api_client/resources/scenarios/scorers.py index 5b083f8e4..9e5d5e198 100644 --- a/src/runloop_api_client/resources/scenarios/scorers.py +++ b/src/runloop_api_client/resources/scenarios/scorers.py @@ -201,7 +201,7 @@ def list( List all Scenario Scorers matching filter. Args: - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. starting_after: Load the next page of data starting after the item with the given ID. @@ -460,7 +460,7 @@ def list( List all Scenario Scorers matching filter. Args: - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. starting_after: Load the next page of data starting after the item with the given ID. diff --git a/src/runloop_api_client/resources/secrets.py b/src/runloop_api_client/resources/secrets.py index 8e170fca2..892557497 100644 --- a/src/runloop_api_client/resources/secrets.py +++ b/src/runloop_api_client/resources/secrets.py @@ -160,7 +160,7 @@ def list( for security reasons. Args: - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. extra_headers: Send extra headers @@ -363,7 +363,7 @@ async def list( for security reasons. Args: - limit: The limit of items to return. Default is 20. + limit: The limit of items to return. Default is 20. Max is 5000. extra_headers: Send extra headers diff --git a/src/runloop_api_client/types/agent_create_params.py b/src/runloop_api_client/types/agent_create_params.py index 1a3372e7e..3c2deff2a 100644 --- a/src/runloop_api_client/types/agent_create_params.py +++ b/src/runloop_api_client/types/agent_create_params.py @@ -14,5 +14,8 @@ class AgentCreateParams(TypedDict, total=False): name: Required[str] """The name of the Agent.""" + version: Required[str] + """The version of the Agent. Must be a semver string (e.g., '2.0.65') or a SHA.""" + source: Optional[AgentSource] """The source configuration for the Agent.""" diff --git a/src/runloop_api_client/types/agent_list_params.py b/src/runloop_api_client/types/agent_list_params.py index a3199190b..3df89fc25 100644 --- a/src/runloop_api_client/types/agent_list_params.py +++ b/src/runloop_api_client/types/agent_list_params.py @@ -12,7 +12,7 @@ class AgentListParams(TypedDict, total=False): """Filter agents by public visibility.""" limit: int - """The limit of items to return. Default is 20.""" + """The limit of items to return. Default is 20. Max is 5000.""" name: str """Filter agents by name (partial match supported).""" @@ -22,3 +22,6 @@ class AgentListParams(TypedDict, total=False): starting_after: str """Load the next page of data starting after the item with the given ID.""" + + version: str + """Filter by version. Use 'latest' to get the most recently created agent.""" diff --git a/src/runloop_api_client/types/agent_view.py b/src/runloop_api_client/types/agent_view.py index d02f425bf..23b1f68ff 100644 --- a/src/runloop_api_client/types/agent_view.py +++ b/src/runloop_api_client/types/agent_view.py @@ -23,5 +23,8 @@ class AgentView(BaseModel): name: str """The name of the Agent.""" + version: str + """The version of the Agent. A semver string (e.g., '2.0.65') or a SHA.""" + source: Optional[AgentSource] = None """The source configuration for the Agent.""" diff --git a/src/runloop_api_client/types/benchmark_definitions_params.py b/src/runloop_api_client/types/benchmark_definitions_params.py index f92d57d76..97caff125 100644 --- a/src/runloop_api_client/types/benchmark_definitions_params.py +++ b/src/runloop_api_client/types/benchmark_definitions_params.py @@ -9,7 +9,7 @@ class BenchmarkDefinitionsParams(TypedDict, total=False): limit: int - """The limit of items to return. Default is 20.""" + """The limit of items to return. Default is 20. Max is 5000.""" starting_after: str """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/benchmark_list_params.py b/src/runloop_api_client/types/benchmark_list_params.py index 51b2b1320..4e8b0c78b 100644 --- a/src/runloop_api_client/types/benchmark_list_params.py +++ b/src/runloop_api_client/types/benchmark_list_params.py @@ -9,7 +9,10 @@ class BenchmarkListParams(TypedDict, total=False): limit: int - """The limit of items to return. Default is 20.""" + """The limit of items to return. Default is 20. Max is 5000.""" + + name: str + """Filter by name""" starting_after: str """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/benchmark_list_public_params.py b/src/runloop_api_client/types/benchmark_list_public_params.py index c5081922d..6dec4283b 100644 --- a/src/runloop_api_client/types/benchmark_list_public_params.py +++ b/src/runloop_api_client/types/benchmark_list_public_params.py @@ -9,7 +9,7 @@ class BenchmarkListPublicParams(TypedDict, total=False): limit: int - """The limit of items to return. Default is 20.""" + """The limit of items to return. Default is 20. Max is 5000.""" starting_after: str """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/benchmarks/run_list_params.py b/src/runloop_api_client/types/benchmarks/run_list_params.py index f93695b2a..072a0dbe1 100644 --- a/src/runloop_api_client/types/benchmarks/run_list_params.py +++ b/src/runloop_api_client/types/benchmarks/run_list_params.py @@ -12,7 +12,10 @@ class RunListParams(TypedDict, total=False): """The Benchmark ID to filter by.""" limit: int - """The limit of items to return. Default is 20.""" + """The limit of items to return. Default is 20. Max is 5000.""" + + name: str + """Filter by name""" starting_after: str """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/benchmarks/run_list_scenario_runs_params.py b/src/runloop_api_client/types/benchmarks/run_list_scenario_runs_params.py index 241df1a1f..ddce6aa4a 100644 --- a/src/runloop_api_client/types/benchmarks/run_list_scenario_runs_params.py +++ b/src/runloop_api_client/types/benchmarks/run_list_scenario_runs_params.py @@ -9,7 +9,7 @@ class RunListScenarioRunsParams(TypedDict, total=False): limit: int - """The limit of items to return. Default is 20.""" + """The limit of items to return. Default is 20. Max is 5000.""" starting_after: str """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/blueprint_list_params.py b/src/runloop_api_client/types/blueprint_list_params.py index b0a3ade62..f72de7d2f 100644 --- a/src/runloop_api_client/types/blueprint_list_params.py +++ b/src/runloop_api_client/types/blueprint_list_params.py @@ -9,10 +9,13 @@ class BlueprintListParams(TypedDict, total=False): limit: int - """The limit of items to return. Default is 20.""" + """The limit of items to return. Default is 20. Max is 5000.""" name: str """Filter by name""" starting_after: str """Load the next page of data starting after the item with the given ID.""" + + status: str + """Filter by build status (queued, provisioning, building, failed, build_complete)""" diff --git a/src/runloop_api_client/types/blueprint_list_public_params.py b/src/runloop_api_client/types/blueprint_list_public_params.py index d6b11e78e..e0f224f32 100644 --- a/src/runloop_api_client/types/blueprint_list_public_params.py +++ b/src/runloop_api_client/types/blueprint_list_public_params.py @@ -9,10 +9,13 @@ class BlueprintListPublicParams(TypedDict, total=False): limit: int - """The limit of items to return. Default is 20.""" + """The limit of items to return. Default is 20. Max is 5000.""" name: str """Filter by name""" starting_after: str """Load the next page of data starting after the item with the given ID.""" + + status: str + """Filter by build status (queued, provisioning, building, failed, build_complete)""" diff --git a/src/runloop_api_client/types/devbox_list_disk_snapshots_params.py b/src/runloop_api_client/types/devbox_list_disk_snapshots_params.py index 7ffcf5386..d26c3fbd8 100644 --- a/src/runloop_api_client/types/devbox_list_disk_snapshots_params.py +++ b/src/runloop_api_client/types/devbox_list_disk_snapshots_params.py @@ -14,7 +14,7 @@ class DevboxListDiskSnapshotsParams(TypedDict, total=False): """Devbox ID to filter by.""" limit: int - """The limit of items to return. Default is 20.""" + """The limit of items to return. Default is 20. Max is 5000.""" metadata_key: Annotated[str, PropertyInfo(alias="metadata[key]")] """Filter snapshots by metadata key-value pair. diff --git a/src/runloop_api_client/types/devbox_list_params.py b/src/runloop_api_client/types/devbox_list_params.py index 066b2ed85..c508762da 100644 --- a/src/runloop_api_client/types/devbox_list_params.py +++ b/src/runloop_api_client/types/devbox_list_params.py @@ -9,7 +9,7 @@ class DevboxListParams(TypedDict, total=False): limit: int - """The limit of items to return. Default is 20.""" + """The limit of items to return. Default is 20. Max is 5000.""" starting_after: str """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/devboxes/disk_snapshot_list_params.py b/src/runloop_api_client/types/devboxes/disk_snapshot_list_params.py index 7b0f3454f..73e60f457 100644 --- a/src/runloop_api_client/types/devboxes/disk_snapshot_list_params.py +++ b/src/runloop_api_client/types/devboxes/disk_snapshot_list_params.py @@ -14,7 +14,7 @@ class DiskSnapshotListParams(TypedDict, total=False): """Devbox ID to filter by.""" limit: int - """The limit of items to return. Default is 20.""" + """The limit of items to return. Default is 20. Max is 5000.""" metadata_key: Annotated[str, PropertyInfo(alias="metadata[key]")] """Filter snapshots by metadata key-value pair. diff --git a/src/runloop_api_client/types/object_list_params.py b/src/runloop_api_client/types/object_list_params.py index 084fac54d..eca1c7cdd 100644 --- a/src/runloop_api_client/types/object_list_params.py +++ b/src/runloop_api_client/types/object_list_params.py @@ -12,7 +12,7 @@ class ObjectListParams(TypedDict, total=False): """Filter storage objects by content type.""" limit: int - """The limit of items to return. Default is 20.""" + """The limit of items to return. Default is 20. Max is 5000.""" name: str """Filter storage objects by name (partial match supported).""" diff --git a/src/runloop_api_client/types/object_list_public_params.py b/src/runloop_api_client/types/object_list_public_params.py index 19b18ba49..67475b263 100644 --- a/src/runloop_api_client/types/object_list_public_params.py +++ b/src/runloop_api_client/types/object_list_public_params.py @@ -12,7 +12,7 @@ class ObjectListPublicParams(TypedDict, total=False): """Filter storage objects by content type.""" limit: int - """The limit of items to return. Default is 20.""" + """The limit of items to return. Default is 20. Max is 5000.""" name: str """Filter storage objects by name (partial match supported).""" diff --git a/src/runloop_api_client/types/repository_list_params.py b/src/runloop_api_client/types/repository_list_params.py index 91fd7f352..d5f7b248a 100644 --- a/src/runloop_api_client/types/repository_list_params.py +++ b/src/runloop_api_client/types/repository_list_params.py @@ -9,7 +9,7 @@ class RepositoryListParams(TypedDict, total=False): limit: int - """The limit of items to return. Default is 20.""" + """The limit of items to return. Default is 20. Max is 5000.""" name: str """Filter by repository name""" diff --git a/src/runloop_api_client/types/scenario_list_params.py b/src/runloop_api_client/types/scenario_list_params.py index 917da6c94..45ff3a87b 100644 --- a/src/runloop_api_client/types/scenario_list_params.py +++ b/src/runloop_api_client/types/scenario_list_params.py @@ -12,10 +12,13 @@ class ScenarioListParams(TypedDict, total=False): """Filter scenarios by benchmark ID.""" limit: int - """The limit of items to return. Default is 20.""" + """The limit of items to return. Default is 20. Max is 5000.""" name: str """Query for Scenarios with a given name.""" starting_after: str """Load the next page of data starting after the item with the given ID.""" + + validation_type: str + """Filter by validation type""" diff --git a/src/runloop_api_client/types/scenario_list_public_params.py b/src/runloop_api_client/types/scenario_list_public_params.py index 7f413a517..be7e40b8d 100644 --- a/src/runloop_api_client/types/scenario_list_public_params.py +++ b/src/runloop_api_client/types/scenario_list_public_params.py @@ -9,7 +9,7 @@ class ScenarioListPublicParams(TypedDict, total=False): limit: int - """The limit of items to return. Default is 20.""" + """The limit of items to return. Default is 20. Max is 5000.""" name: str """Query for Scenarios with a given name.""" diff --git a/src/runloop_api_client/types/scenarios/run_list_params.py b/src/runloop_api_client/types/scenarios/run_list_params.py index 17a2715c4..97eeb425a 100644 --- a/src/runloop_api_client/types/scenarios/run_list_params.py +++ b/src/runloop_api_client/types/scenarios/run_list_params.py @@ -8,11 +8,20 @@ class RunListParams(TypedDict, total=False): + benchmark_run_id: str + """Filter by benchmark run ID""" + limit: int - """The limit of items to return. Default is 20.""" + """The limit of items to return. Default is 20. Max is 5000.""" + + name: str + """Filter by name""" scenario_id: str """Filter runs associated to Scenario given ID""" starting_after: str """Load the next page of data starting after the item with the given ID.""" + + state: str + """Filter by state""" diff --git a/src/runloop_api_client/types/scenarios/scorer_list_params.py b/src/runloop_api_client/types/scenarios/scorer_list_params.py index 0577a327e..f80e7f6ac 100644 --- a/src/runloop_api_client/types/scenarios/scorer_list_params.py +++ b/src/runloop_api_client/types/scenarios/scorer_list_params.py @@ -9,7 +9,7 @@ class ScorerListParams(TypedDict, total=False): limit: int - """The limit of items to return. Default is 20.""" + """The limit of items to return. Default is 20. Max is 5000.""" starting_after: str """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/secret_list_params.py b/src/runloop_api_client/types/secret_list_params.py index 296a66b62..13d25bd7e 100644 --- a/src/runloop_api_client/types/secret_list_params.py +++ b/src/runloop_api_client/types/secret_list_params.py @@ -9,4 +9,4 @@ class SecretListParams(TypedDict, total=False): limit: int - """The limit of items to return. Default is 20.""" + """The limit of items to return. Default is 20. Max is 5000.""" diff --git a/src/runloop_api_client/types/shared/agent_source.py b/src/runloop_api_client/types/shared/agent_source.py index 276a9300e..9282d6181 100644 --- a/src/runloop_api_client/types/shared/agent_source.py +++ b/src/runloop_api_client/types/shared/agent_source.py @@ -29,9 +29,6 @@ class Npm(BaseModel): agent_setup: Optional[List[str]] = None """Setup commands to run after installation""" - npm_version: Optional[str] = None - """NPM version constraint""" - registry_url: Optional[str] = None """NPM registry URL""" @@ -55,9 +52,6 @@ class Pip(BaseModel): agent_setup: Optional[List[str]] = None """Setup commands to run after installation""" - pip_version: Optional[str] = None - """Pip version constraint""" - registry_url: Optional[str] = None """Pip registry URL""" diff --git a/src/runloop_api_client/types/shared_params/agent_source.py b/src/runloop_api_client/types/shared_params/agent_source.py index 90a32a217..7132414c8 100644 --- a/src/runloop_api_client/types/shared_params/agent_source.py +++ b/src/runloop_api_client/types/shared_params/agent_source.py @@ -32,9 +32,6 @@ class Npm(TypedDict, total=False): agent_setup: Optional[SequenceNotStr[str]] """Setup commands to run after installation""" - npm_version: Optional[str] - """NPM version constraint""" - registry_url: Optional[str] """NPM registry URL""" @@ -58,9 +55,6 @@ class Pip(TypedDict, total=False): agent_setup: Optional[SequenceNotStr[str]] """Setup commands to run after installation""" - pip_version: Optional[str] - """Pip version constraint""" - registry_url: Optional[str] """Pip registry URL""" diff --git a/tests/api_resources/benchmarks/test_runs.py b/tests/api_resources/benchmarks/test_runs.py index a95855518..9ab74fc9a 100644 --- a/tests/api_resources/benchmarks/test_runs.py +++ b/tests/api_resources/benchmarks/test_runs.py @@ -66,6 +66,7 @@ def test_method_list_with_all_params(self, client: Runloop) -> None: run = client.benchmarks.runs.list( benchmark_id="benchmark_id", limit=0, + name="name", starting_after="starting_after", ) assert_matches_type(SyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) @@ -268,6 +269,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> run = await async_client.benchmarks.runs.list( benchmark_id="benchmark_id", limit=0, + name="name", starting_after="starting_after", ) assert_matches_type(AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) diff --git a/tests/api_resources/scenarios/test_runs.py b/tests/api_resources/scenarios/test_runs.py index 7b981e9bb..f3ac8eb88 100644 --- a/tests/api_resources/scenarios/test_runs.py +++ b/tests/api_resources/scenarios/test_runs.py @@ -72,9 +72,12 @@ def test_method_list(self, client: Runloop) -> None: @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: run = client.scenarios.runs.list( + benchmark_run_id="benchmark_run_id", limit=0, + name="name", scenario_id="scenario_id", starting_after="starting_after", + state="state", ) assert_matches_type(SyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) @@ -320,9 +323,12 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: run = await async_client.scenarios.runs.list( + benchmark_run_id="benchmark_run_id", limit=0, + name="name", scenario_id="scenario_id", starting_after="starting_after", + state="state", ) assert_matches_type(AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) diff --git a/tests/api_resources/test_agents.py b/tests/api_resources/test_agents.py index 6f8096491..693eec250 100644 --- a/tests/api_resources/test_agents.py +++ b/tests/api_resources/test_agents.py @@ -22,6 +22,7 @@ class TestAgents: def test_method_create(self, client: Runloop) -> None: agent = client.agents.create( name="name", + version="version", ) assert_matches_type(AgentView, agent, path=["response"]) @@ -29,6 +30,7 @@ def test_method_create(self, client: Runloop) -> None: def test_method_create_with_all_params(self, client: Runloop) -> None: agent = client.agents.create( name="name", + version="version", source={ "type": "type", "git": { @@ -39,7 +41,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "npm": { "package_name": "package_name", "agent_setup": ["string"], - "npm_version": "npm_version", "registry_url": "registry_url", }, "object": { @@ -49,7 +50,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "pip": { "package_name": "package_name", "agent_setup": ["string"], - "pip_version": "pip_version", "registry_url": "registry_url", }, }, @@ -60,6 +60,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: def test_raw_response_create(self, client: Runloop) -> None: response = client.agents.with_raw_response.create( name="name", + version="version", ) assert response.is_closed is True @@ -71,6 +72,7 @@ def test_raw_response_create(self, client: Runloop) -> None: def test_streaming_response_create(self, client: Runloop) -> None: with client.agents.with_streaming_response.create( name="name", + version="version", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -131,6 +133,7 @@ def test_method_list_with_all_params(self, client: Runloop) -> None: name="name", search="search", starting_after="starting_after", + version="version", ) assert_matches_type(SyncAgentsCursorIDPage[AgentView], agent, path=["response"]) @@ -164,6 +167,7 @@ class TestAsyncAgents: async def test_method_create(self, async_client: AsyncRunloop) -> None: agent = await async_client.agents.create( name="name", + version="version", ) assert_matches_type(AgentView, agent, path=["response"]) @@ -171,6 +175,7 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: agent = await async_client.agents.create( name="name", + version="version", source={ "type": "type", "git": { @@ -181,7 +186,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "npm": { "package_name": "package_name", "agent_setup": ["string"], - "npm_version": "npm_version", "registry_url": "registry_url", }, "object": { @@ -191,7 +195,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "pip": { "package_name": "package_name", "agent_setup": ["string"], - "pip_version": "pip_version", "registry_url": "registry_url", }, }, @@ -202,6 +205,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: response = await async_client.agents.with_raw_response.create( name="name", + version="version", ) assert response.is_closed is True @@ -213,6 +217,7 @@ async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: async with async_client.agents.with_streaming_response.create( name="name", + version="version", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -273,6 +278,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> name="name", search="search", starting_after="starting_after", + version="version", ) assert_matches_type(AsyncAgentsCursorIDPage[AgentView], agent, path=["response"]) diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py index 891756def..8bb26c558 100644 --- a/tests/api_resources/test_benchmarks.py +++ b/tests/api_resources/test_benchmarks.py @@ -169,6 +169,7 @@ def test_method_list(self, client: Runloop) -> None: def test_method_list_with_all_params(self, client: Runloop) -> None: benchmark = client.benchmarks.list( limit=0, + name="name", starting_after="starting_after", ) assert_matches_type(SyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) @@ -497,6 +498,7 @@ async def test_method_list(self, async_client: AsyncRunloop) -> None: async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.list( limit=0, + name="name", starting_after="starting_after", ) assert_matches_type(AsyncBenchmarksCursorIDPage[BenchmarkView], benchmark, path=["response"]) diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 66c1d3400..2ce323d9c 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -161,6 +161,7 @@ def test_method_list_with_all_params(self, client: Runloop) -> None: limit=0, name="name", starting_after="starting_after", + status="status", ) assert_matches_type(SyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"]) @@ -301,6 +302,7 @@ def test_method_list_public_with_all_params(self, client: Runloop) -> None: limit=0, name="name", starting_after="starting_after", + status="status", ) assert_matches_type(SyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"]) @@ -597,6 +599,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> limit=0, name="name", starting_after="starting_after", + status="status", ) assert_matches_type(AsyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"]) @@ -737,6 +740,7 @@ async def test_method_list_public_with_all_params(self, async_client: AsyncRunlo limit=0, name="name", starting_after="starting_after", + status="status", ) assert_matches_type(AsyncBlueprintsCursorIDPage[BlueprintView], blueprint, path=["response"]) diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index b9dadb8b9..3345828c1 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -291,6 +291,7 @@ def test_method_list_with_all_params(self, client: Runloop) -> None: limit=0, name="name", starting_after="starting_after", + validation_type="validation_type", ) assert_matches_type(SyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) @@ -696,6 +697,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> limit=0, name="name", starting_after="starting_after", + validation_type="validation_type", ) assert_matches_type(AsyncScenariosCursorIDPage[ScenarioView], scenario, path=["response"]) From 63e2033ab041133180c357d38b013980e0f38b5b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 03:26:26 +0000 Subject: [PATCH 928/993] chore(internal): add missing files argument to base client --- src/runloop_api_client/_base_client.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index f639d4201..d9f300fe3 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -1247,9 +1247,12 @@ def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + opts = FinalRequestOptions.construct( + method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + ) return self.request(cast_to, opts) def put( @@ -1767,9 +1770,12 @@ async def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options) + opts = FinalRequestOptions.construct( + method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + ) return await self.request(cast_to, opts) async def put( From 3592302bc96084ff4b3e1b52800fc7f2ad13222e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 20:01:42 +0000 Subject: [PATCH 929/993] feat(benchmarks): add `update_scenarios` method to benchmarks resource --- .stats.yml | 4 +- api.md | 2 + .../resources/benchmarks/benchmarks.py | 119 ++++++++++++++++++ src/runloop_api_client/types/__init__.py | 1 + .../benchmark_update_scenarios_params.py | 18 +++ tests/api_resources/test_benchmarks.py | 94 ++++++++++++++ 6 files changed, 236 insertions(+), 2 deletions(-) create mode 100644 src/runloop_api_client/types/benchmark_update_scenarios_params.py diff --git a/.stats.yml b/.stats.yml index 4cce660dc..195fd166a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 97 +configured_endpoints: 98 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-370a5d676ff0ef41f3ca6ed669d29b6e3e6b7f0a914ac3dbed6bd45e75533c74.yml openapi_spec_hash: 7bb5ea1117d754b7985aff0da5bca3a7 -config_hash: 2363f563f42501d2b1587a4f64bdccaf +config_hash: 7b7fc2ccd6bf3551718a79332772e713 diff --git a/api.md b/api.md index bf5475656..8239ea95b 100644 --- a/api.md +++ b/api.md @@ -20,6 +20,7 @@ from runloop_api_client.types import ( BenchmarkCreateParameters, BenchmarkRunListView, BenchmarkRunView, + BenchmarkScenarioUpdateParameters, BenchmarkView, ScenarioDefinitionListView, StartBenchmarkRunParameters, @@ -35,6 +36,7 @@ Methods: - client.benchmarks.definitions(id, \*\*params) -> ScenarioDefinitionListView - client.benchmarks.list_public(\*\*params) -> SyncBenchmarksCursorIDPage[BenchmarkView] - client.benchmarks.start_run(\*\*params) -> BenchmarkRunView +- client.benchmarks.update_scenarios(id, \*\*params) -> BenchmarkView ## Runs diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py index 419a0913a..41a1279a4 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -21,6 +21,7 @@ benchmark_start_run_params, benchmark_definitions_params, benchmark_list_public_params, + benchmark_update_scenarios_params, ) from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import maybe_transform, async_maybe_transform @@ -453,6 +454,59 @@ def start_run( cast_to=BenchmarkRunView, ) + def update_scenarios( + self, + id: str, + *, + scenarios_to_add: Optional[SequenceNotStr[str]] | Omit = omit, + scenarios_to_remove: Optional[SequenceNotStr[str]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> BenchmarkView: + """ + Add and/or remove Scenario IDs from an existing Benchmark. + + Args: + scenarios_to_add: Scenario IDs to add to the Benchmark. + + scenarios_to_remove: Scenario IDs to remove from the Benchmark. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/benchmarks/{id}/scenarios", + body=maybe_transform( + { + "scenarios_to_add": scenarios_to_add, + "scenarios_to_remove": scenarios_to_remove, + }, + benchmark_update_scenarios_params.BenchmarkUpdateScenariosParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BenchmarkView, + ) + class AsyncBenchmarksResource(AsyncAPIResource): @cached_property @@ -865,6 +919,59 @@ async def start_run( cast_to=BenchmarkRunView, ) + async def update_scenarios( + self, + id: str, + *, + scenarios_to_add: Optional[SequenceNotStr[str]] | Omit = omit, + scenarios_to_remove: Optional[SequenceNotStr[str]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> BenchmarkView: + """ + Add and/or remove Scenario IDs from an existing Benchmark. + + Args: + scenarios_to_add: Scenario IDs to add to the Benchmark. + + scenarios_to_remove: Scenario IDs to remove from the Benchmark. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/benchmarks/{id}/scenarios", + body=await async_maybe_transform( + { + "scenarios_to_add": scenarios_to_add, + "scenarios_to_remove": scenarios_to_remove, + }, + benchmark_update_scenarios_params.BenchmarkUpdateScenariosParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BenchmarkView, + ) + class BenchmarksResourceWithRawResponse: def __init__(self, benchmarks: BenchmarksResource) -> None: @@ -891,6 +998,9 @@ def __init__(self, benchmarks: BenchmarksResource) -> None: self.start_run = to_raw_response_wrapper( benchmarks.start_run, ) + self.update_scenarios = to_raw_response_wrapper( + benchmarks.update_scenarios, + ) @cached_property def runs(self) -> RunsResourceWithRawResponse: @@ -922,6 +1032,9 @@ def __init__(self, benchmarks: AsyncBenchmarksResource) -> None: self.start_run = async_to_raw_response_wrapper( benchmarks.start_run, ) + self.update_scenarios = async_to_raw_response_wrapper( + benchmarks.update_scenarios, + ) @cached_property def runs(self) -> AsyncRunsResourceWithRawResponse: @@ -953,6 +1066,9 @@ def __init__(self, benchmarks: BenchmarksResource) -> None: self.start_run = to_streamed_response_wrapper( benchmarks.start_run, ) + self.update_scenarios = to_streamed_response_wrapper( + benchmarks.update_scenarios, + ) @cached_property def runs(self) -> RunsResourceWithStreamingResponse: @@ -984,6 +1100,9 @@ def __init__(self, benchmarks: AsyncBenchmarksResource) -> None: self.start_run = async_to_streamed_response_wrapper( benchmarks.start_run, ) + self.update_scenarios = async_to_streamed_response_wrapper( + benchmarks.update_scenarios, + ) @cached_property def runs(self) -> AsyncRunsResourceWithStreamingResponse: diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 6856d9670..6afd070a3 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -97,6 +97,7 @@ from .repository_connection_list_view import RepositoryConnectionListView as RepositoryConnectionListView from .repository_inspection_list_view import RepositoryInspectionListView as RepositoryInspectionListView from .devbox_read_file_contents_params import DevboxReadFileContentsParams as DevboxReadFileContentsParams +from .benchmark_update_scenarios_params import BenchmarkUpdateScenariosParams as BenchmarkUpdateScenariosParams from .devbox_list_disk_snapshots_params import DevboxListDiskSnapshotsParams as DevboxListDiskSnapshotsParams from .devbox_snapshot_disk_async_params import DevboxSnapshotDiskAsyncParams as DevboxSnapshotDiskAsyncParams from .devbox_write_file_contents_params import DevboxWriteFileContentsParams as DevboxWriteFileContentsParams diff --git a/src/runloop_api_client/types/benchmark_update_scenarios_params.py b/src/runloop_api_client/types/benchmark_update_scenarios_params.py new file mode 100644 index 000000000..2aca2b0d4 --- /dev/null +++ b/src/runloop_api_client/types/benchmark_update_scenarios_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import TypedDict + +from .._types import SequenceNotStr + +__all__ = ["BenchmarkUpdateScenariosParams"] + + +class BenchmarkUpdateScenariosParams(TypedDict, total=False): + scenarios_to_add: Optional[SequenceNotStr[str]] + """Scenario IDs to add to the Benchmark.""" + + scenarios_to_remove: Optional[SequenceNotStr[str]] + """Scenario IDs to remove from the Benchmark.""" diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py index 8bb26c558..eedce80f8 100644 --- a/tests/api_resources/test_benchmarks.py +++ b/tests/api_resources/test_benchmarks.py @@ -345,6 +345,53 @@ def test_streaming_response_start_run(self, client: Runloop) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_update_scenarios(self, client: Runloop) -> None: + benchmark = client.benchmarks.update_scenarios( + id="id", + ) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + @parametrize + def test_method_update_scenarios_with_all_params(self, client: Runloop) -> None: + benchmark = client.benchmarks.update_scenarios( + id="id", + scenarios_to_add=["string"], + scenarios_to_remove=["string"], + ) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + @parametrize + def test_raw_response_update_scenarios(self, client: Runloop) -> None: + response = client.benchmarks.with_raw_response.update_scenarios( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark = response.parse() + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + @parametrize + def test_streaming_response_update_scenarios(self, client: Runloop) -> None: + with client.benchmarks.with_streaming_response.update_scenarios( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark = response.parse() + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update_scenarios(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.benchmarks.with_raw_response.update_scenarios( + id="", + ) + class TestAsyncBenchmarks: parametrize = pytest.mark.parametrize( @@ -673,3 +720,50 @@ async def test_streaming_response_start_run(self, async_client: AsyncRunloop) -> assert_matches_type(BenchmarkRunView, benchmark, path=["response"]) assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_update_scenarios(self, async_client: AsyncRunloop) -> None: + benchmark = await async_client.benchmarks.update_scenarios( + id="id", + ) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + @parametrize + async def test_method_update_scenarios_with_all_params(self, async_client: AsyncRunloop) -> None: + benchmark = await async_client.benchmarks.update_scenarios( + id="id", + scenarios_to_add=["string"], + scenarios_to_remove=["string"], + ) + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + @parametrize + async def test_raw_response_update_scenarios(self, async_client: AsyncRunloop) -> None: + response = await async_client.benchmarks.with_raw_response.update_scenarios( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark = await response.parse() + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + @parametrize + async def test_streaming_response_update_scenarios(self, async_client: AsyncRunloop) -> None: + async with async_client.benchmarks.with_streaming_response.update_scenarios( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark = await response.parse() + assert_matches_type(BenchmarkView, benchmark, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update_scenarios(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.benchmarks.with_raw_response.update_scenarios( + id="", + ) From 8471a6328541e784a5d4f97788eb85df7394bd3b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 18:08:19 +0000 Subject: [PATCH 930/993] fix(benchmarks): `update()` for benchmarks and scenarios replaces all provided fields and does not modify unspecified fields (#6702) --- .stats.yml | 6 +- api.md | 1 + .../resources/benchmarks/benchmarks.py | 68 +++++++++++-------- .../resources/scenarios/scenarios.py | 42 ++++++------ .../types/benchmark_create_params.py | 6 +- .../types/benchmark_update_params.py | 24 ++++--- .../types/scenario_update_params.py | 15 ++-- tests/api_resources/test_benchmarks.py | 12 +--- 8 files changed, 91 insertions(+), 83 deletions(-) diff --git a/.stats.yml b/.stats.yml index 195fd166a..1fe7778b5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 98 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-370a5d676ff0ef41f3ca6ed669d29b6e3e6b7f0a914ac3dbed6bd45e75533c74.yml -openapi_spec_hash: 7bb5ea1117d754b7985aff0da5bca3a7 -config_hash: 7b7fc2ccd6bf3551718a79332772e713 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-939601ae2016f4611626f9b52a14a4b4a2076879f49804942ac1788b3302b97a.yml +openapi_spec_hash: 162edc35b9e7b1f45fe38484361aa880 +config_hash: cb8534d20a68a49b92726bedd50f8bb1 diff --git a/api.md b/api.md index 8239ea95b..78b2db8f6 100644 --- a/api.md +++ b/api.md @@ -21,6 +21,7 @@ from runloop_api_client.types import ( BenchmarkRunListView, BenchmarkRunView, BenchmarkScenarioUpdateParameters, + BenchmarkUpdateParameters, BenchmarkView, ScenarioDefinitionListView, StartBenchmarkRunParameters, diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks/benchmarks.py index 41a1279a4..9d9a30b5d 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks/benchmarks.py @@ -89,16 +89,16 @@ def create( Create a Benchmark with a set of Scenarios. Args: - name: The name of the Benchmark. This must be unique. + name: The unique name of the Benchmark. attribution: Attribution information for the benchmark. description: Detailed description of the benchmark. - metadata: User defined metadata to attach to the benchmark for organization. + metadata: User defined metadata to attach to the benchmark. required_environment_variables: Environment variables required to run the benchmark. If any required variables - are not supplied, the benchmark will fail to start + are not supplied, the benchmark will fail to start. required_secret_names: Secrets required to run the benchmark with (environment variable name will be mapped to the your user secret by name). If any of these secrets are not @@ -177,12 +177,12 @@ def update( self, id: str, *, - name: str, attribution: Optional[str] | Omit = omit, description: Optional[str] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, + name: Optional[str] | Omit = omit, required_environment_variables: Optional[SequenceNotStr[str]] | Omit = omit, - required_secret_names: SequenceNotStr[str] | Omit = omit, + required_secret_names: Optional[SequenceNotStr[str]] | Omit = omit, scenario_ids: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -192,26 +192,30 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BenchmarkView: - """ - Update a Benchmark with a set of Scenarios. + """Update a Benchmark. + + Fields that are null will preserve the existing value. + Fields that are provided (including empty values) will replace the existing + value entirely. Args: - name: The name of the Benchmark. This must be unique. + attribution: Attribution information for the benchmark. Pass in empty string to clear. - attribution: Attribution information for the benchmark. + description: Detailed description of the benchmark. Pass in empty string to clear. - description: Detailed description of the benchmark. + metadata: User defined metadata to attach to the benchmark. Pass in empty map to clear. - metadata: User defined metadata to attach to the benchmark for organization. + name: The unique name of the Benchmark. Cannot be blank. required_environment_variables: Environment variables required to run the benchmark. If any required variables - are not supplied, the benchmark will fail to start + are not supplied, the benchmark will fail to start. Pass in empty list to clear. required_secret_names: Secrets required to run the benchmark with (environment variable name will be mapped to the your user secret by name). If any of these secrets are not - provided or the mapping is incorrect, the benchmark will fail to start. + provided or the mapping is incorrect, the benchmark will fail to start. Pass in + empty list to clear. - scenario_ids: The Scenario IDs that make up the Benchmark. + scenario_ids: The Scenario IDs that make up the Benchmark. Pass in empty list to clear. extra_headers: Send extra headers @@ -229,10 +233,10 @@ def update( f"/v1/benchmarks/{id}", body=maybe_transform( { - "name": name, "attribution": attribution, "description": description, "metadata": metadata, + "name": name, "required_environment_variables": required_environment_variables, "required_secret_names": required_secret_names, "scenario_ids": scenario_ids, @@ -554,16 +558,16 @@ async def create( Create a Benchmark with a set of Scenarios. Args: - name: The name of the Benchmark. This must be unique. + name: The unique name of the Benchmark. attribution: Attribution information for the benchmark. description: Detailed description of the benchmark. - metadata: User defined metadata to attach to the benchmark for organization. + metadata: User defined metadata to attach to the benchmark. required_environment_variables: Environment variables required to run the benchmark. If any required variables - are not supplied, the benchmark will fail to start + are not supplied, the benchmark will fail to start. required_secret_names: Secrets required to run the benchmark with (environment variable name will be mapped to the your user secret by name). If any of these secrets are not @@ -642,12 +646,12 @@ async def update( self, id: str, *, - name: str, attribution: Optional[str] | Omit = omit, description: Optional[str] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, + name: Optional[str] | Omit = omit, required_environment_variables: Optional[SequenceNotStr[str]] | Omit = omit, - required_secret_names: SequenceNotStr[str] | Omit = omit, + required_secret_names: Optional[SequenceNotStr[str]] | Omit = omit, scenario_ids: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -657,26 +661,30 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> BenchmarkView: - """ - Update a Benchmark with a set of Scenarios. + """Update a Benchmark. + + Fields that are null will preserve the existing value. + Fields that are provided (including empty values) will replace the existing + value entirely. Args: - name: The name of the Benchmark. This must be unique. + attribution: Attribution information for the benchmark. Pass in empty string to clear. - attribution: Attribution information for the benchmark. + description: Detailed description of the benchmark. Pass in empty string to clear. - description: Detailed description of the benchmark. + metadata: User defined metadata to attach to the benchmark. Pass in empty map to clear. - metadata: User defined metadata to attach to the benchmark for organization. + name: The unique name of the Benchmark. Cannot be blank. required_environment_variables: Environment variables required to run the benchmark. If any required variables - are not supplied, the benchmark will fail to start + are not supplied, the benchmark will fail to start. Pass in empty list to clear. required_secret_names: Secrets required to run the benchmark with (environment variable name will be mapped to the your user secret by name). If any of these secrets are not - provided or the mapping is incorrect, the benchmark will fail to start. + provided or the mapping is incorrect, the benchmark will fail to start. Pass in + empty list to clear. - scenario_ids: The Scenario IDs that make up the Benchmark. + scenario_ids: The Scenario IDs that make up the Benchmark. Pass in empty list to clear. extra_headers: Send extra headers @@ -694,10 +702,10 @@ async def update( f"/v1/benchmarks/{id}", body=await async_maybe_transform( { - "name": name, "attribution": attribution, "description": description, "metadata": metadata, + "name": name, "required_environment_variables": required_environment_variables, "required_secret_names": required_secret_names, "scenario_ids": scenario_ids, diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index 3d206de05..41777339b 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -220,31 +220,32 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ScenarioView: - """ - Update a Scenario, a repeatable AI coding evaluation test that defines the - starting environment as well as evaluation success criteria. Only provided - fields will be updated. + """Update a Scenario. + + Fields that are null will preserve the existing value. Fields + that are provided (including empty values) will replace the existing value + entirely. Args: environment_parameters: The Environment in which the Scenario will run. input_context: The input context for the Scenario. - metadata: User defined metadata to attach to the scenario for organization. + metadata: User defined metadata to attach to the scenario. Pass in empty map to clear. - name: Name of the scenario. + name: Name of the scenario. Cannot be blank. reference_output: A string representation of the reference output to solve the scenario. Commonly can be the result of a git diff or a sequence of command actions to apply to the - environment. + environment. Pass in empty string to clear. - required_environment_variables: Environment variables required to run the scenario. + required_environment_variables: Environment variables required to run the scenario. Pass in empty list to clear. - required_secret_names: Secrets required to run the scenario. + required_secret_names: Secrets required to run the scenario. Pass in empty list to clear. scoring_contract: The scoring contract for the Scenario. - validation_type: Validation strategy. + validation_type: Validation strategy. Pass in empty string to clear. extra_headers: Send extra headers @@ -623,31 +624,32 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> ScenarioView: - """ - Update a Scenario, a repeatable AI coding evaluation test that defines the - starting environment as well as evaluation success criteria. Only provided - fields will be updated. + """Update a Scenario. + + Fields that are null will preserve the existing value. Fields + that are provided (including empty values) will replace the existing value + entirely. Args: environment_parameters: The Environment in which the Scenario will run. input_context: The input context for the Scenario. - metadata: User defined metadata to attach to the scenario for organization. + metadata: User defined metadata to attach to the scenario. Pass in empty map to clear. - name: Name of the scenario. + name: Name of the scenario. Cannot be blank. reference_output: A string representation of the reference output to solve the scenario. Commonly can be the result of a git diff or a sequence of command actions to apply to the - environment. + environment. Pass in empty string to clear. - required_environment_variables: Environment variables required to run the scenario. + required_environment_variables: Environment variables required to run the scenario. Pass in empty list to clear. - required_secret_names: Secrets required to run the scenario. + required_secret_names: Secrets required to run the scenario. Pass in empty list to clear. scoring_contract: The scoring contract for the Scenario. - validation_type: Validation strategy. + validation_type: Validation strategy. Pass in empty string to clear. extra_headers: Send extra headers diff --git a/src/runloop_api_client/types/benchmark_create_params.py b/src/runloop_api_client/types/benchmark_create_params.py index 1aec35f5f..36f7b95a9 100644 --- a/src/runloop_api_client/types/benchmark_create_params.py +++ b/src/runloop_api_client/types/benchmark_create_params.py @@ -12,7 +12,7 @@ class BenchmarkCreateParams(TypedDict, total=False): name: Required[str] - """The name of the Benchmark. This must be unique.""" + """The unique name of the Benchmark.""" attribution: Optional[str] """Attribution information for the benchmark.""" @@ -21,12 +21,12 @@ class BenchmarkCreateParams(TypedDict, total=False): """Detailed description of the benchmark.""" metadata: Optional[Dict[str, str]] - """User defined metadata to attach to the benchmark for organization.""" + """User defined metadata to attach to the benchmark.""" required_environment_variables: Optional[SequenceNotStr[str]] """Environment variables required to run the benchmark. - If any required variables are not supplied, the benchmark will fail to start + If any required variables are not supplied, the benchmark will fail to start. """ required_secret_names: SequenceNotStr[str] diff --git a/src/runloop_api_client/types/benchmark_update_params.py b/src/runloop_api_client/types/benchmark_update_params.py index 1291e3e38..ce9e8fb0c 100644 --- a/src/runloop_api_client/types/benchmark_update_params.py +++ b/src/runloop_api_client/types/benchmark_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Dict, Optional -from typing_extensions import Required, TypedDict +from typing_extensions import TypedDict from .._types import SequenceNotStr @@ -11,30 +11,32 @@ class BenchmarkUpdateParams(TypedDict, total=False): - name: Required[str] - """The name of the Benchmark. This must be unique.""" - attribution: Optional[str] - """Attribution information for the benchmark.""" + """Attribution information for the benchmark. Pass in empty string to clear.""" description: Optional[str] - """Detailed description of the benchmark.""" + """Detailed description of the benchmark. Pass in empty string to clear.""" metadata: Optional[Dict[str, str]] - """User defined metadata to attach to the benchmark for organization.""" + """User defined metadata to attach to the benchmark. Pass in empty map to clear.""" + + name: Optional[str] + """The unique name of the Benchmark. Cannot be blank.""" required_environment_variables: Optional[SequenceNotStr[str]] """Environment variables required to run the benchmark. - If any required variables are not supplied, the benchmark will fail to start + If any required variables are not supplied, the benchmark will fail to start. + Pass in empty list to clear. """ - required_secret_names: SequenceNotStr[str] + required_secret_names: Optional[SequenceNotStr[str]] """ Secrets required to run the benchmark with (environment variable name will be mapped to the your user secret by name). If any of these secrets are not - provided or the mapping is incorrect, the benchmark will fail to start. + provided or the mapping is incorrect, the benchmark will fail to start. Pass in + empty list to clear. """ scenario_ids: Optional[SequenceNotStr[str]] - """The Scenario IDs that make up the Benchmark.""" + """The Scenario IDs that make up the Benchmark. Pass in empty list to clear.""" diff --git a/src/runloop_api_client/types/scenario_update_params.py b/src/runloop_api_client/types/scenario_update_params.py index 908988961..9d0fc65e5 100644 --- a/src/runloop_api_client/types/scenario_update_params.py +++ b/src/runloop_api_client/types/scenario_update_params.py @@ -21,26 +21,29 @@ class ScenarioUpdateParams(TypedDict, total=False): """The input context for the Scenario.""" metadata: Optional[Dict[str, str]] - """User defined metadata to attach to the scenario for organization.""" + """User defined metadata to attach to the scenario. Pass in empty map to clear.""" name: Optional[str] - """Name of the scenario.""" + """Name of the scenario. Cannot be blank.""" reference_output: Optional[str] """A string representation of the reference output to solve the scenario. Commonly can be the result of a git diff or a sequence of command actions to - apply to the environment. + apply to the environment. Pass in empty string to clear. """ required_environment_variables: Optional[SequenceNotStr[str]] - """Environment variables required to run the scenario.""" + """Environment variables required to run the scenario. + + Pass in empty list to clear. + """ required_secret_names: Optional[SequenceNotStr[str]] - """Secrets required to run the scenario.""" + """Secrets required to run the scenario. Pass in empty list to clear.""" scoring_contract: Optional[ScoringContractUpdateParam] """The scoring contract for the Scenario.""" validation_type: Optional[Literal["UNSPECIFIED", "FORWARD", "REVERSE", "EVALUATION"]] - """Validation strategy.""" + """Validation strategy. Pass in empty string to clear.""" diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py index eedce80f8..bb001a532 100644 --- a/tests/api_resources/test_benchmarks.py +++ b/tests/api_resources/test_benchmarks.py @@ -108,7 +108,6 @@ def test_path_params_retrieve(self, client: Runloop) -> None: def test_method_update(self, client: Runloop) -> None: benchmark = client.benchmarks.update( id="id", - name="name", ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -116,10 +115,10 @@ def test_method_update(self, client: Runloop) -> None: def test_method_update_with_all_params(self, client: Runloop) -> None: benchmark = client.benchmarks.update( id="id", - name="name", attribution="attribution", description="description", metadata={"foo": "string"}, + name="name", required_environment_variables=["string"], required_secret_names=["string"], scenario_ids=["string"], @@ -130,7 +129,6 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: def test_raw_response_update(self, client: Runloop) -> None: response = client.benchmarks.with_raw_response.update( id="id", - name="name", ) assert response.is_closed is True @@ -142,7 +140,6 @@ def test_raw_response_update(self, client: Runloop) -> None: def test_streaming_response_update(self, client: Runloop) -> None: with client.benchmarks.with_streaming_response.update( id="id", - name="name", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -157,7 +154,6 @@ def test_path_params_update(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.benchmarks.with_raw_response.update( id="", - name="name", ) @parametrize @@ -484,7 +480,6 @@ async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: async def test_method_update(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.update( id="id", - name="name", ) assert_matches_type(BenchmarkView, benchmark, path=["response"]) @@ -492,10 +487,10 @@ async def test_method_update(self, async_client: AsyncRunloop) -> None: async def test_method_update_with_all_params(self, async_client: AsyncRunloop) -> None: benchmark = await async_client.benchmarks.update( id="id", - name="name", attribution="attribution", description="description", metadata={"foo": "string"}, + name="name", required_environment_variables=["string"], required_secret_names=["string"], scenario_ids=["string"], @@ -506,7 +501,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: response = await async_client.benchmarks.with_raw_response.update( id="id", - name="name", ) assert response.is_closed is True @@ -518,7 +512,6 @@ async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: async def test_streaming_response_update(self, async_client: AsyncRunloop) -> None: async with async_client.benchmarks.with_streaming_response.update( id="id", - name="name", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -533,7 +526,6 @@ async def test_path_params_update(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.benchmarks.with_raw_response.update( id="", - name="name", ) @parametrize From 310f02b2fd7fd17cdfbcdca898bc888f0dbe5e3c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 18 Dec 2025 04:11:11 +0000 Subject: [PATCH 931/993] fix: use async_to_httpx_files in patch method --- src/runloop_api_client/_base_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index d9f300fe3..5c05c86c5 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -1774,7 +1774,7 @@ async def patch( options: RequestOptions = {}, ) -> ResponseT: opts = FinalRequestOptions.construct( - method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + method="patch", url=path, json_data=body, files=await async_to_httpx_files(files), **options ) return await self.request(cast_to, opts) From 43800d06497e8fa27164d310ab946cfe9e5cad83 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Dec 2025 01:07:03 +0000 Subject: [PATCH 932/993] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1fe7778b5..aa9206944 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 98 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-939601ae2016f4611626f9b52a14a4b4a2076879f49804942ac1788b3302b97a.yml -openapi_spec_hash: 162edc35b9e7b1f45fe38484361aa880 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-5271153bd2f82579803953bd2fa1b9ea6466c979118804f64379fb14e9a9c436.yml +openapi_spec_hash: 95ac224a4b0f10e9ba6129a86746c9d4 config_hash: cb8534d20a68a49b92726bedd50f8bb1 From 73f17e97f6722cc4583a5cd62a65579b67207733 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Dec 2025 03:52:35 +0000 Subject: [PATCH 933/993] chore(internal): add `--fix` argument to lint script --- scripts/lint | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/lint b/scripts/lint index 54325086b..715dbe325 100755 --- a/scripts/lint +++ b/scripts/lint @@ -4,8 +4,13 @@ set -e cd "$(dirname "$0")/.." -echo "==> Running ruff" -uv run ruff check . +if [ "$1" = "--fix" ]; then + echo "==> Running ruff with --fix" + uv run ruff check . --fix +else + echo "==> Running ruff" + uv run ruff check . +fi echo "==> Running pyright" uv run pyright From e3a6d10004258c721fbe139b3526f61c8c4b411d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 6 Jan 2026 03:35:40 +0000 Subject: [PATCH 934/993] chore(internal): codegen related update --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index ca7f3a6d3..59199f55e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2025 runloop +Copyright 2026 runloop Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: From 5261f59604a87d5c8c920b98557ea259492dde7e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 14 Jan 2026 04:52:23 +0000 Subject: [PATCH 935/993] feat(client): add support for binary request streaming --- src/runloop_api_client/_base_client.py | 145 +++++++++++++++++-- src/runloop_api_client/_models.py | 17 ++- src/runloop_api_client/_types.py | 9 ++ tests/test_client.py | 187 ++++++++++++++++++++++++- 4 files changed, 344 insertions(+), 14 deletions(-) diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index 5c05c86c5..581204db6 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -9,6 +9,7 @@ import inspect import logging import platform +import warnings import email.utils from types import TracebackType from random import random @@ -51,9 +52,11 @@ ResponseT, AnyMapping, PostParser, + BinaryTypes, RequestFiles, HttpxSendArgs, RequestOptions, + AsyncBinaryTypes, HttpxRequestFiles, ModelBuilderProtocol, not_given, @@ -477,8 +480,19 @@ def _build_request( retries_taken: int = 0, ) -> httpx.Request: if log.isEnabledFor(logging.DEBUG): - log.debug("Request options: %s", model_dump(options, exclude_unset=True)) - + log.debug( + "Request options: %s", + model_dump( + options, + exclude_unset=True, + # Pydantic v1 can't dump every type we support in content, so we exclude it for now. + exclude={ + "content", + } + if PYDANTIC_V1 + else {}, + ), + ) kwargs: dict[str, Any] = {} json_data = options.json_data @@ -532,7 +546,13 @@ def _build_request( is_body_allowed = options.method.lower() != "get" if is_body_allowed: - if isinstance(json_data, bytes): + if options.content is not None and json_data is not None: + raise TypeError("Passing both `content` and `json_data` is not supported") + if options.content is not None and files is not None: + raise TypeError("Passing both `content` and `files` is not supported") + if options.content is not None: + kwargs["content"] = options.content + elif isinstance(json_data, bytes): kwargs["content"] = json_data else: kwargs["json"] = json_data if is_given(json_data) else None @@ -1194,6 +1214,7 @@ def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, files: RequestFiles | None = None, stream: Literal[False] = False, @@ -1206,6 +1227,7 @@ def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, files: RequestFiles | None = None, stream: Literal[True], @@ -1219,6 +1241,7 @@ def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, files: RequestFiles | None = None, stream: bool, @@ -1231,13 +1254,25 @@ def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, files: RequestFiles | None = None, stream: bool = False, stream_cls: type[_StreamT] | None = None, ) -> ResponseT | _StreamT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="post", url=path, json_data=body, files=to_httpx_files(files), **options + method="post", url=path, json_data=body, content=content, files=to_httpx_files(files), **options ) return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) @@ -1247,11 +1282,23 @@ def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="patch", url=path, json_data=body, files=to_httpx_files(files), **options + method="patch", url=path, json_data=body, content=content, files=to_httpx_files(files), **options ) return self.request(cast_to, opts) @@ -1261,11 +1308,23 @@ def put( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="put", url=path, json_data=body, files=to_httpx_files(files), **options + method="put", url=path, json_data=body, content=content, files=to_httpx_files(files), **options ) return self.request(cast_to, opts) @@ -1275,9 +1334,19 @@ def delete( *, cast_to: Type[ResponseT], body: Body | None = None, + content: BinaryTypes | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options) + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) + opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, content=content, **options) return self.request(cast_to, opts) def get_api_list( @@ -1717,6 +1786,7 @@ async def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, stream: Literal[False] = False, @@ -1729,6 +1799,7 @@ async def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, stream: Literal[True], @@ -1742,6 +1813,7 @@ async def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, stream: bool, @@ -1754,13 +1826,25 @@ async def post( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, stream: bool = False, stream_cls: type[_AsyncStreamT] | None = None, ) -> ResponseT | _AsyncStreamT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="post", url=path, json_data=body, files=await async_to_httpx_files(files), **options + method="post", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options ) return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) @@ -1770,11 +1854,28 @@ async def patch( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="patch", url=path, json_data=body, files=await async_to_httpx_files(files), **options + method="patch", + url=path, + json_data=body, + content=content, + files=await async_to_httpx_files(files), + **options, ) return await self.request(cast_to, opts) @@ -1784,11 +1885,23 @@ async def put( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, files: RequestFiles | None = None, options: RequestOptions = {}, ) -> ResponseT: + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if files is not None and content is not None: + raise TypeError("Passing both `files` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) opts = FinalRequestOptions.construct( - method="put", url=path, json_data=body, files=await async_to_httpx_files(files), **options + method="put", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options ) return await self.request(cast_to, opts) @@ -1798,9 +1911,19 @@ async def delete( *, cast_to: Type[ResponseT], body: Body | None = None, + content: AsyncBinaryTypes | None = None, options: RequestOptions = {}, ) -> ResponseT: - opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options) + if body is not None and content is not None: + raise TypeError("Passing both `body` and `content` is not supported") + if isinstance(body, bytes): + warnings.warn( + "Passing raw bytes as `body` is deprecated and will be removed in a future version. " + "Please pass raw bytes via the `content` parameter instead.", + DeprecationWarning, + stacklevel=2, + ) + opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, content=content, **options) return await self.request(cast_to, opts) def get_api_list( diff --git a/src/runloop_api_client/_models.py b/src/runloop_api_client/_models.py index ca9500b2a..29070e055 100644 --- a/src/runloop_api_client/_models.py +++ b/src/runloop_api_client/_models.py @@ -3,7 +3,20 @@ import os import inspect import weakref -from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast +from typing import ( + IO, + TYPE_CHECKING, + Any, + Type, + Union, + Generic, + TypeVar, + Callable, + Iterable, + Optional, + AsyncIterable, + cast, +) from datetime import date, datetime from typing_extensions import ( List, @@ -787,6 +800,7 @@ class FinalRequestOptionsInput(TypedDict, total=False): timeout: float | Timeout | None files: HttpxRequestFiles | None idempotency_key: str + content: Union[bytes, bytearray, IO[bytes], Iterable[bytes], AsyncIterable[bytes], None] json_data: Body extra_json: AnyMapping follow_redirects: bool @@ -805,6 +819,7 @@ class FinalRequestOptions(pydantic.BaseModel): post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven() follow_redirects: Union[bool, None] = None + content: Union[bytes, bytearray, IO[bytes], Iterable[bytes], AsyncIterable[bytes], None] = None # It should be noted that we cannot use `json` here as that would override # a BaseModel method in an incompatible fashion. json_data: Union[Body, None] = None diff --git a/src/runloop_api_client/_types.py b/src/runloop_api_client/_types.py index 31df93064..9f7d6eb21 100644 --- a/src/runloop_api_client/_types.py +++ b/src/runloop_api_client/_types.py @@ -13,9 +13,11 @@ Mapping, TypeVar, Callable, + Iterable, Iterator, Optional, Sequence, + AsyncIterable, ) from typing_extensions import ( Set, @@ -56,6 +58,13 @@ else: Base64FileInput = Union[IO[bytes], PathLike] FileContent = Union[IO[bytes], bytes, PathLike] # PathLike is not subscriptable in Python 3.8. + + +# Used for sending raw binary data / streaming data in request bodies +# e.g. for file uploads without multipart encoding +BinaryTypes = Union[bytes, bytearray, IO[bytes], Iterable[bytes]] +AsyncBinaryTypes = Union[bytes, bytearray, IO[bytes], AsyncIterable[bytes]] + FileTypes = Union[ # file (or bytes) FileContent, diff --git a/tests/test_client.py b/tests/test_client.py index 8333b35ef..3f5426415 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -8,10 +8,11 @@ import json import asyncio import inspect +import dataclasses import tracemalloc -from typing import Any, Union, cast +from typing import Any, Union, TypeVar, Callable, Iterable, Iterator, Optional, Coroutine, cast from unittest import mock -from typing_extensions import Literal +from typing_extensions import Literal, AsyncIterator, override import httpx import pytest @@ -36,6 +37,7 @@ from .utils import update_env +T = TypeVar("T") base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") bearer_token = "My Bearer Token" @@ -50,6 +52,57 @@ def _low_retry_timeout(*_args: Any, **_kwargs: Any) -> float: return 0.1 +def mirror_request_content(request: httpx.Request) -> httpx.Response: + return httpx.Response(200, content=request.content) + + +# note: we can't use the httpx.MockTransport class as it consumes the request +# body itself, which means we can't test that the body is read lazily +class MockTransport(httpx.BaseTransport, httpx.AsyncBaseTransport): + def __init__( + self, + handler: Callable[[httpx.Request], httpx.Response] + | Callable[[httpx.Request], Coroutine[Any, Any, httpx.Response]], + ) -> None: + self.handler = handler + + @override + def handle_request( + self, + request: httpx.Request, + ) -> httpx.Response: + assert not inspect.iscoroutinefunction(self.handler), "handler must not be a coroutine function" + assert inspect.isfunction(self.handler), "handler must be a function" + return self.handler(request) + + @override + async def handle_async_request( + self, + request: httpx.Request, + ) -> httpx.Response: + assert inspect.iscoroutinefunction(self.handler), "handler must be a coroutine function" + return await self.handler(request) + + +@dataclasses.dataclass +class Counter: + value: int = 0 + + +def _make_sync_iterator(iterable: Iterable[T], counter: Optional[Counter] = None) -> Iterator[T]: + for item in iterable: + if counter: + counter.value += 1 + yield item + + +async def _make_async_iterator(iterable: Iterable[T], counter: Optional[Counter] = None) -> AsyncIterator[T]: + for item in iterable: + if counter: + counter.value += 1 + yield item + + def _get_open_connections(client: Runloop | AsyncRunloop) -> int: transport = client._client._transport assert isinstance(transport, httpx.HTTPTransport) or isinstance(transport, httpx.AsyncHTTPTransport) @@ -511,6 +564,70 @@ def test_multipart_repeating_array(self, client: Runloop) -> None: b"", ] + @pytest.mark.respx(base_url=base_url) + def test_binary_content_upload(self, respx_mock: MockRouter, client: Runloop) -> None: + respx_mock.post("/upload").mock(side_effect=mirror_request_content) + + file_content = b"Hello, this is a test file." + + response = client.post( + "/upload", + content=file_content, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + + def test_binary_content_upload_with_iterator(self) -> None: + file_content = b"Hello, this is a test file." + counter = Counter() + iterator = _make_sync_iterator([file_content], counter=counter) + + def mock_handler(request: httpx.Request) -> httpx.Response: + assert counter.value == 0, "the request body should not have been read" + return httpx.Response(200, content=request.read()) + + with Runloop( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + http_client=httpx.Client(transport=MockTransport(handler=mock_handler)), + ) as client: + response = client.post( + "/upload", + content=iterator, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + assert counter.value == 1 + + @pytest.mark.respx(base_url=base_url) + def test_binary_content_upload_with_body_is_deprecated(self, respx_mock: MockRouter, client: Runloop) -> None: + respx_mock.post("/upload").mock(side_effect=mirror_request_content) + + file_content = b"Hello, this is a test file." + + with pytest.deprecated_call( + match="Passing raw bytes as `body` is deprecated and will be removed in a future version. Please pass raw bytes via the `content` parameter instead." + ): + response = client.post( + "/upload", + body=file_content, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + @pytest.mark.respx(base_url=base_url) def test_basic_union_response(self, respx_mock: MockRouter, client: Runloop) -> None: class Model1(BaseModel): @@ -1385,6 +1502,72 @@ def test_multipart_repeating_array(self, async_client: AsyncRunloop) -> None: b"", ] + @pytest.mark.respx(base_url=base_url) + async def test_binary_content_upload(self, respx_mock: MockRouter, async_client: AsyncRunloop) -> None: + respx_mock.post("/upload").mock(side_effect=mirror_request_content) + + file_content = b"Hello, this is a test file." + + response = await async_client.post( + "/upload", + content=file_content, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + + async def test_binary_content_upload_with_asynciterator(self) -> None: + file_content = b"Hello, this is a test file." + counter = Counter() + iterator = _make_async_iterator([file_content], counter=counter) + + async def mock_handler(request: httpx.Request) -> httpx.Response: + assert counter.value == 0, "the request body should not have been read" + return httpx.Response(200, content=await request.aread()) + + async with AsyncRunloop( + base_url=base_url, + bearer_token=bearer_token, + _strict_response_validation=True, + http_client=httpx.AsyncClient(transport=MockTransport(handler=mock_handler)), + ) as client: + response = await client.post( + "/upload", + content=iterator, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + assert counter.value == 1 + + @pytest.mark.respx(base_url=base_url) + async def test_binary_content_upload_with_body_is_deprecated( + self, respx_mock: MockRouter, async_client: AsyncRunloop + ) -> None: + respx_mock.post("/upload").mock(side_effect=mirror_request_content) + + file_content = b"Hello, this is a test file." + + with pytest.deprecated_call( + match="Passing raw bytes as `body` is deprecated and will be removed in a future version. Please pass raw bytes via the `content` parameter instead." + ): + response = await async_client.post( + "/upload", + body=file_content, + cast_to=httpx.Response, + options={"headers": {"Content-Type": "application/octet-stream"}}, + ) + + assert response.status_code == 200 + assert response.request.headers["Content-Type"] == "application/octet-stream" + assert response.content == file_content + @pytest.mark.respx(base_url=base_url) async def test_basic_union_response(self, respx_mock: MockRouter, async_client: AsyncRunloop) -> None: class Model1(BaseModel): From 2a7b7793a589ab8abc898a98857ae1a85ae37c5c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 21:58:26 +0000 Subject: [PATCH 936/993] feat(devbox): remove this one --- .stats.yml | 4 +-- .../resources/devboxes/devboxes.py | 30 ++++++++++++------- .../types/benchmark_run_view.py | 11 ++++--- .../types/devbox_create_params.py | 6 ++++ .../types/devbox_execute_params.py | 4 +-- src/runloop_api_client/types/devbox_view.py | 2 +- .../types/devbox_wait_for_command_params.py | 4 +-- .../types/shared/launch_parameters.py | 7 +++++ .../types/shared_params/launch_parameters.py | 7 +++++ tests/api_resources/scenarios/test_scorers.py | 2 ++ tests/api_resources/test_benchmarks.py | 2 ++ tests/api_resources/test_blueprints.py | 6 ++++ tests/api_resources/test_devboxes.py | 4 +++ tests/api_resources/test_scenarios.py | 6 ++++ 14 files changed, 74 insertions(+), 21 deletions(-) diff --git a/.stats.yml b/.stats.yml index aa9206944..ee7a7f260 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 98 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-5271153bd2f82579803953bd2fa1b9ea6466c979118804f64379fb14e9a9c436.yml -openapi_spec_hash: 95ac224a4b0f10e9ba6129a86746c9d4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8ebd9dbfacb180ec9c980f5e46a814b0c8a3cb6063136db18780271d33a8dfa6.yml +openapi_spec_hash: 12d4edec72b722945bade9419636d63e config_hash: cb8534d20a68a49b92726bedd50f8bb1 diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index ebbd34c80..860345c8d 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -158,6 +158,7 @@ def create( metadata: Optional[Dict[str, str]] | Omit = omit, mounts: Optional[Iterable[Mount]] | Omit = omit, name: Optional[str] | Omit = omit, + network_policy_id: Optional[str] | Omit = omit, repo_connection_id: Optional[str] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, snapshot_id: Optional[str] | Omit = omit, @@ -204,6 +205,9 @@ def create( name: (Optional) A user specified name to give the Devbox. + network_policy_id: (Optional) ID of the network policy to apply to this Devbox. If not specified, + the default network policy will be used. + repo_connection_id: Repository connection id the devbox should source its base image from. secrets: (Optional) Map of environment variable names to secret names. The secret values @@ -238,6 +242,7 @@ def create( "metadata": metadata, "mounts": mounts, "name": name, + "network_policy_id": network_policy_id, "repo_connection_id": repo_connection_id, "secrets": secrets, "snapshot_id": snapshot_id, @@ -602,8 +607,8 @@ def execute( last_n: Last n lines of standard error / standard out to return (default: 100) - optimistic_timeout: Timeout in seconds to wait for command completion. Operation is not killed. Max - is 600 seconds. + optimistic_timeout: Timeout in seconds to wait for command completion, up to 25 seconds. Defaults to + 25 seconds. Operation is not killed. shell_name: The name of the persistent shell to create or use if already created. When using a persistent shell, the command will run from the directory at the end of the @@ -1308,7 +1313,7 @@ def wait_for_command( ) -> DevboxAsyncExecutionDetailView: """ Polls the asynchronous execution's status until it reaches one of the desired - statuses or times out. Defaults to 60 seconds. + statuses or times out. Max is 25 seconds. Args: statuses: The command execution statuses to wait for. At least one status must be @@ -1317,8 +1322,8 @@ def wait_for_command( last_n: Last n lines of standard error / standard out to return (default: 100) - timeout_seconds: (Optional) Timeout in seconds to wait for the status, up to 60 seconds. Defaults - to 60 seconds. + timeout_seconds: (Optional) Timeout in seconds to wait for the status, up to 25 seconds. Defaults + to 25 seconds. extra_headers: Send extra headers @@ -1466,6 +1471,7 @@ async def create( metadata: Optional[Dict[str, str]] | Omit = omit, mounts: Optional[Iterable[Mount]] | Omit = omit, name: Optional[str] | Omit = omit, + network_policy_id: Optional[str] | Omit = omit, repo_connection_id: Optional[str] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, snapshot_id: Optional[str] | Omit = omit, @@ -1512,6 +1518,9 @@ async def create( name: (Optional) A user specified name to give the Devbox. + network_policy_id: (Optional) ID of the network policy to apply to this Devbox. If not specified, + the default network policy will be used. + repo_connection_id: Repository connection id the devbox should source its base image from. secrets: (Optional) Map of environment variable names to secret names. The secret values @@ -1546,6 +1555,7 @@ async def create( "metadata": metadata, "mounts": mounts, "name": name, + "network_policy_id": network_policy_id, "repo_connection_id": repo_connection_id, "secrets": secrets, "snapshot_id": snapshot_id, @@ -1910,8 +1920,8 @@ async def execute( last_n: Last n lines of standard error / standard out to return (default: 100) - optimistic_timeout: Timeout in seconds to wait for command completion. Operation is not killed. Max - is 600 seconds. + optimistic_timeout: Timeout in seconds to wait for command completion, up to 25 seconds. Defaults to + 25 seconds. Operation is not killed. shell_name: The name of the persistent shell to create or use if already created. When using a persistent shell, the command will run from the directory at the end of the @@ -2616,7 +2626,7 @@ async def wait_for_command( ) -> DevboxAsyncExecutionDetailView: """ Polls the asynchronous execution's status until it reaches one of the desired - statuses or times out. Defaults to 60 seconds. + statuses or times out. Max is 25 seconds. Args: statuses: The command execution statuses to wait for. At least one status must be @@ -2625,8 +2635,8 @@ async def wait_for_command( last_n: Last n lines of standard error / standard out to return (default: 100) - timeout_seconds: (Optional) Timeout in seconds to wait for the status, up to 60 seconds. Defaults - to 60 seconds. + timeout_seconds: (Optional) Timeout in seconds to wait for the status, up to 25 seconds. Defaults + to 25 seconds. extra_headers: Send extra headers diff --git a/src/runloop_api_client/types/benchmark_run_view.py b/src/runloop_api_client/types/benchmark_run_view.py index 07fd4c022..8eaaf4ad5 100644 --- a/src/runloop_api_client/types/benchmark_run_view.py +++ b/src/runloop_api_client/types/benchmark_run_view.py @@ -10,15 +10,12 @@ class BenchmarkRunView(BaseModel): """ - A BenchmarkRunView represents a run of a complete set of Scenarios, organized under a Benchmark. + A BenchmarkRunView represents a run of a complete set of Scenarios, organized under a Benchmark or created by a BenchmarkJob. """ id: str """The ID of the BenchmarkRun.""" - benchmark_id: str - """The ID of the Benchmark.""" - metadata: Dict[str, str] """User defined metadata to attach to the benchmark run for organization.""" @@ -28,6 +25,12 @@ class BenchmarkRunView(BaseModel): state: Literal["running", "canceled", "completed"] """The state of the BenchmarkRun.""" + benchmark_id: Optional[str] = None + """The ID of the Benchmark definition. + + Present if run was created from a benchmark definition. + """ + duration_ms: Optional[int] = None """The duration for the BenchmarkRun to complete.""" diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 4cecd0e72..1cfd84f01 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -56,6 +56,12 @@ class DevboxCreateParams(TypedDict, total=False): name: Optional[str] """(Optional) A user specified name to give the Devbox.""" + network_policy_id: Optional[str] + """(Optional) ID of the network policy to apply to this Devbox. + + If not specified, the default network policy will be used. + """ + repo_connection_id: Optional[str] """Repository connection id the devbox should source its base image from.""" diff --git a/src/runloop_api_client/types/devbox_execute_params.py b/src/runloop_api_client/types/devbox_execute_params.py index 24ca9e7fe..69e373e5c 100644 --- a/src/runloop_api_client/types/devbox_execute_params.py +++ b/src/runloop_api_client/types/devbox_execute_params.py @@ -24,9 +24,9 @@ class DevboxExecuteParams(TypedDict, total=False): """Last n lines of standard error / standard out to return (default: 100)""" optimistic_timeout: Optional[int] - """Timeout in seconds to wait for command completion. + """Timeout in seconds to wait for command completion, up to 25 seconds. - Operation is not killed. Max is 600 seconds. + Defaults to 25 seconds. Operation is not killed. """ shell_name: Optional[str] diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index e2c9a28d8..cf9dc2383 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -81,7 +81,7 @@ class DevboxView(BaseModel): initiator_id: Optional[str] = None """The ID of the initiator that created the Devbox.""" - initiator_type: Optional[Literal["unknown", "api", "scenario"]] = None + initiator_type: Optional[Literal["unknown", "api", "scenario", "scoring_validation"]] = None """The type of initiator that created the Devbox.""" name: Optional[str] = None diff --git a/src/runloop_api_client/types/devbox_wait_for_command_params.py b/src/runloop_api_client/types/devbox_wait_for_command_params.py index 367d6ed2f..2452de0c4 100644 --- a/src/runloop_api_client/types/devbox_wait_for_command_params.py +++ b/src/runloop_api_client/types/devbox_wait_for_command_params.py @@ -22,7 +22,7 @@ class DevboxWaitForCommandParams(TypedDict, total=False): """Last n lines of standard error / standard out to return (default: 100)""" timeout_seconds: Optional[int] - """(Optional) Timeout in seconds to wait for the status, up to 60 seconds. + """(Optional) Timeout in seconds to wait for the status, up to 25 seconds. - Defaults to 60 seconds. + Defaults to 25 seconds. """ diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index dc0ccfccd..04d7f27a0 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -70,6 +70,13 @@ class LaunchParameters(BaseModel): launch_commands: Optional[List[str]] = None """Set of commands to be run at launch time, before the entrypoint process is run.""" + network_policy_id: Optional[str] = None + """ + (Optional) ID of the network policy to apply to Devboxes launched with these + parameters. When set on a Blueprint launch parameters, Devboxes created from it + will inherit this policy unless explicitly overridden. + """ + required_services: Optional[List[str]] = None """A list of ContainerizedService names to be started when a Devbox is created. diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index cd2a97ee4..e3f00d1d3 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -72,6 +72,13 @@ class LaunchParameters(TypedDict, total=False): launch_commands: Optional[SequenceNotStr[str]] """Set of commands to be run at launch time, before the entrypoint process is run.""" + network_policy_id: Optional[str] + """ + (Optional) ID of the network policy to apply to Devboxes launched with these + parameters. When set on a Blueprint launch parameters, Devboxes created from it + will inherit this policy unless explicitly overridden. + """ + required_services: Optional[SequenceNotStr[str]] """A list of ContainerizedService names to be started when a Devbox is created. diff --git a/tests/api_resources/scenarios/test_scorers.py b/tests/api_resources/scenarios/test_scorers.py index f104a0924..73be902fd 100644 --- a/tests/api_resources/scenarios/test_scorers.py +++ b/tests/api_resources/scenarios/test_scorers.py @@ -202,6 +202,7 @@ def test_method_validate_with_all_params(self, client: Runloop) -> None: "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "network_policy_id": "network_policy_id", "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { @@ -433,6 +434,7 @@ async def test_method_validate_with_all_params(self, async_client: AsyncRunloop) "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "network_policy_id": "network_policy_id", "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { diff --git a/tests/api_resources/test_benchmarks.py b/tests/api_resources/test_benchmarks.py index bb001a532..803c75c60 100644 --- a/tests/api_resources/test_benchmarks.py +++ b/tests/api_resources/test_benchmarks.py @@ -297,6 +297,7 @@ def test_method_start_run_with_all_params(self, client: Runloop) -> None: "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "network_policy_id": "network_policy_id", "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { @@ -669,6 +670,7 @@ async def test_method_start_run_with_all_params(self, async_client: AsyncRunloop "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "network_policy_id": "network_policy_id", "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 2ce323d9c..41de07003 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -62,6 +62,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "network_policy_id": "network_policy_id", "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { @@ -252,6 +253,7 @@ def test_method_create_from_inspection_with_all_params(self, client: Runloop) -> "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "network_policy_id": "network_policy_id", "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { @@ -404,6 +406,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "network_policy_id": "network_policy_id", "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { @@ -500,6 +503,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "network_policy_id": "network_policy_id", "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { @@ -690,6 +694,7 @@ async def test_method_create_from_inspection_with_all_params(self, async_client: "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "network_policy_id": "network_policy_id", "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { @@ -842,6 +847,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "network_policy_id": "network_policy_id", "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 1ea6ee17d..2316a7021 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -73,6 +73,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "network_policy_id": "network_policy_id", "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { @@ -89,6 +90,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: } ], name="name", + network_policy_id="network_policy_id", repo_connection_id="repo_connection_id", secrets={"foo": "string"}, snapshot_id="snapshot_id", @@ -1148,6 +1150,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "network_policy_id": "network_policy_id", "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { @@ -1164,6 +1167,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - } ], name="name", + network_policy_id="network_policy_id", repo_connection_id="repo_connection_id", secrets={"foo": "string"}, snapshot_id="snapshot_id", diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index 3345828c1..42cbb67b5 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -78,6 +78,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "network_policy_id": "network_policy_id", "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { @@ -211,6 +212,7 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "network_policy_id": "network_policy_id", "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { @@ -377,6 +379,7 @@ def test_method_start_run_with_all_params(self, client: Runloop) -> None: "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "network_policy_id": "network_policy_id", "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { @@ -484,6 +487,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "network_policy_id": "network_policy_id", "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { @@ -617,6 +621,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "network_policy_id": "network_policy_id", "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { @@ -783,6 +788,7 @@ async def test_method_start_run_with_all_params(self, async_client: AsyncRunloop "custom_gb_memory": 0, "keep_alive_time_seconds": 0, "launch_commands": ["string"], + "network_policy_id": "network_policy_id", "required_services": ["string"], "resource_size_request": "X_SMALL", "user_parameters": { From 8a013256b132ae56dc3dd8dfd38545b7d7504793 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 17 Jan 2026 00:26:36 +0000 Subject: [PATCH 937/993] feat(network-policy): add network policies to api --- .stats.yml | 4 +- api.md | 23 + src/runloop_api_client/_client.py | 49 +- src/runloop_api_client/pagination.py | 75 ++ src/runloop_api_client/resources/__init__.py | 14 + .../resources/network_policies.py | 676 ++++++++++++++++++ src/runloop_api_client/types/__init__.py | 7 + .../types/network_policy_create_params.py | 36 + .../types/network_policy_list_params.py | 21 + .../types/network_policy_list_view.py | 21 + .../types/network_policy_update_params.py | 30 + .../types/network_policy_view.py | 52 ++ .../types/shared/__init__.py | 2 + .../types/shared/agent_mount.py | 31 + src/runloop_api_client/types/shared/mount.py | 41 +- .../types/shared/object_mount.py | 21 + .../types/shared_params/__init__.py | 2 + .../types/shared_params/agent_mount.py | 31 + .../types/shared_params/mount.py | 40 +- .../types/shared_params/object_mount.py | 21 + tests/api_resources/test_network_policies.py | 433 +++++++++++ 21 files changed, 1552 insertions(+), 78 deletions(-) create mode 100644 src/runloop_api_client/resources/network_policies.py create mode 100644 src/runloop_api_client/types/network_policy_create_params.py create mode 100644 src/runloop_api_client/types/network_policy_list_params.py create mode 100644 src/runloop_api_client/types/network_policy_list_view.py create mode 100644 src/runloop_api_client/types/network_policy_update_params.py create mode 100644 src/runloop_api_client/types/network_policy_view.py create mode 100644 src/runloop_api_client/types/shared/agent_mount.py create mode 100644 src/runloop_api_client/types/shared/object_mount.py create mode 100644 src/runloop_api_client/types/shared_params/agent_mount.py create mode 100644 src/runloop_api_client/types/shared_params/object_mount.py create mode 100644 tests/api_resources/test_network_policies.py diff --git a/.stats.yml b/.stats.yml index ee7a7f260..de2b8be94 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 98 +configured_endpoints: 103 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8ebd9dbfacb180ec9c980f5e46a814b0c8a3cb6063136db18780271d33a8dfa6.yml openapi_spec_hash: 12d4edec72b722945bade9419636d63e -config_hash: cb8534d20a68a49b92726bedd50f8bb1 +config_hash: ec63e62d4660c9c924b39a8671c2fdb1 diff --git a/api.md b/api.md index 78b2db8f6..efb052238 100644 --- a/api.md +++ b/api.md @@ -3,10 +3,12 @@ ```python from runloop_api_client.types import ( AfterIdle, + AgentMount, AgentSource, CodeMountParameters, LaunchParameters, Mount, + ObjectMount, RunProfile, ) ``` @@ -349,3 +351,24 @@ Methods: - client.secrets.update(name, \*\*params) -> SecretView - client.secrets.list(\*\*params) -> SecretListView - client.secrets.delete(name) -> SecretView + +# NetworkPolicies + +Types: + +```python +from runloop_api_client.types import ( + NetworkPolicyCreateParameters, + NetworkPolicyListView, + NetworkPolicyUpdateParameters, + NetworkPolicyView, +) +``` + +Methods: + +- client.network_policies.create(\*\*params) -> NetworkPolicyView +- client.network_policies.retrieve(id) -> NetworkPolicyView +- client.network_policies.update(id, \*\*params) -> NetworkPolicyView +- client.network_policies.list(\*\*params) -> SyncNetworkPoliciesCursorIDPage[NetworkPolicyView] +- client.network_policies.delete(id) -> NetworkPolicyView diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index f4f6d1535..eb17eb1ad 100644 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -31,12 +31,23 @@ ) if TYPE_CHECKING: - from .resources import agents, objects, secrets, devboxes, scenarios, benchmarks, blueprints, repositories + from .resources import ( + agents, + objects, + secrets, + devboxes, + scenarios, + benchmarks, + blueprints, + repositories, + network_policies, + ) from .resources.agents import AgentsResource, AsyncAgentsResource from .resources.objects import ObjectsResource, AsyncObjectsResource from .resources.secrets import SecretsResource, AsyncSecretsResource from .resources.blueprints import BlueprintsResource, AsyncBlueprintsResource from .resources.repositories import RepositoriesResource, AsyncRepositoriesResource + from .resources.network_policies import NetworkPoliciesResource, AsyncNetworkPoliciesResource from .resources.devboxes.devboxes import DevboxesResource, AsyncDevboxesResource from .resources.scenarios.scenarios import ScenariosResource, AsyncScenariosResource from .resources.benchmarks.benchmarks import BenchmarksResource, AsyncBenchmarksResource @@ -149,6 +160,12 @@ def secrets(self) -> SecretsResource: return SecretsResource(self) + @cached_property + def network_policies(self) -> NetworkPoliciesResource: + from .resources.network_policies import NetworkPoliciesResource + + return NetworkPoliciesResource(self) + @cached_property def with_raw_response(self) -> RunloopWithRawResponse: return RunloopWithRawResponse(self) @@ -367,6 +384,12 @@ def secrets(self) -> AsyncSecretsResource: return AsyncSecretsResource(self) + @cached_property + def network_policies(self) -> AsyncNetworkPoliciesResource: + from .resources.network_policies import AsyncNetworkPoliciesResource + + return AsyncNetworkPoliciesResource(self) + @cached_property def with_raw_response(self) -> AsyncRunloopWithRawResponse: return AsyncRunloopWithRawResponse(self) @@ -534,6 +557,12 @@ def secrets(self) -> secrets.SecretsResourceWithRawResponse: return SecretsResourceWithRawResponse(self._client.secrets) + @cached_property + def network_policies(self) -> network_policies.NetworkPoliciesResourceWithRawResponse: + from .resources.network_policies import NetworkPoliciesResourceWithRawResponse + + return NetworkPoliciesResourceWithRawResponse(self._client.network_policies) + class AsyncRunloopWithRawResponse: _client: AsyncRunloop @@ -589,6 +618,12 @@ def secrets(self) -> secrets.AsyncSecretsResourceWithRawResponse: return AsyncSecretsResourceWithRawResponse(self._client.secrets) + @cached_property + def network_policies(self) -> network_policies.AsyncNetworkPoliciesResourceWithRawResponse: + from .resources.network_policies import AsyncNetworkPoliciesResourceWithRawResponse + + return AsyncNetworkPoliciesResourceWithRawResponse(self._client.network_policies) + class RunloopWithStreamedResponse: _client: Runloop @@ -644,6 +679,12 @@ def secrets(self) -> secrets.SecretsResourceWithStreamingResponse: return SecretsResourceWithStreamingResponse(self._client.secrets) + @cached_property + def network_policies(self) -> network_policies.NetworkPoliciesResourceWithStreamingResponse: + from .resources.network_policies import NetworkPoliciesResourceWithStreamingResponse + + return NetworkPoliciesResourceWithStreamingResponse(self._client.network_policies) + class AsyncRunloopWithStreamedResponse: _client: AsyncRunloop @@ -699,6 +740,12 @@ def secrets(self) -> secrets.AsyncSecretsResourceWithStreamingResponse: return AsyncSecretsResourceWithStreamingResponse(self._client.secrets) + @cached_property + def network_policies(self) -> network_policies.AsyncNetworkPoliciesResourceWithStreamingResponse: + from .resources.network_policies import AsyncNetworkPoliciesResourceWithStreamingResponse + + return AsyncNetworkPoliciesResourceWithStreamingResponse(self._client.network_policies) + Client = Runloop diff --git a/src/runloop_api_client/pagination.py b/src/runloop_api_client/pagination.py index a52e69c24..c6e696214 100644 --- a/src/runloop_api_client/pagination.py +++ b/src/runloop_api_client/pagination.py @@ -28,6 +28,8 @@ "AsyncScenarioScorersCursorIDPage", "SyncObjectsCursorIDPage", "AsyncObjectsCursorIDPage", + "SyncNetworkPoliciesCursorIDPage", + "AsyncNetworkPoliciesCursorIDPage", ] _T = TypeVar("_T") @@ -88,6 +90,11 @@ class ObjectsCursorIDPageItem(Protocol): id: str +@runtime_checkable +class NetworkPoliciesCursorIDPageItem(Protocol): + id: str + + class SyncBlueprintsCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): blueprints: List[_T] has_more: Optional[bool] = None @@ -834,3 +841,71 @@ def next_page_info(self) -> Optional[PageInfo]: return None return PageInfo(params={"starting_after": item.id}) + + +class SyncNetworkPoliciesCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + network_policies: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + network_policies = self.network_policies + if not network_policies: + return [] + return network_policies + + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + + @override + def next_page_info(self) -> Optional[PageInfo]: + network_policies = self.network_policies + if not network_policies: + return None + + item = cast(Any, network_policies[-1]) + if not isinstance(item, NetworkPoliciesCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) + + +class AsyncNetworkPoliciesCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + network_policies: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + network_policies = self.network_policies + if not network_policies: + return [] + return network_policies + + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + + @override + def next_page_info(self) -> Optional[PageInfo]: + network_policies = self.network_policies + if not network_policies: + return None + + item = cast(Any, network_policies[-1]) + if not isinstance(item, NetworkPoliciesCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) diff --git a/src/runloop_api_client/resources/__init__.py b/src/runloop_api_client/resources/__init__.py index adafc4644..761613989 100644 --- a/src/runloop_api_client/resources/__init__.py +++ b/src/runloop_api_client/resources/__init__.py @@ -64,6 +64,14 @@ RepositoriesResourceWithStreamingResponse, AsyncRepositoriesResourceWithStreamingResponse, ) +from .network_policies import ( + NetworkPoliciesResource, + AsyncNetworkPoliciesResource, + NetworkPoliciesResourceWithRawResponse, + AsyncNetworkPoliciesResourceWithRawResponse, + NetworkPoliciesResourceWithStreamingResponse, + AsyncNetworkPoliciesResourceWithStreamingResponse, +) __all__ = [ "BenchmarksResource", @@ -114,4 +122,10 @@ "AsyncSecretsResourceWithRawResponse", "SecretsResourceWithStreamingResponse", "AsyncSecretsResourceWithStreamingResponse", + "NetworkPoliciesResource", + "AsyncNetworkPoliciesResource", + "NetworkPoliciesResourceWithRawResponse", + "AsyncNetworkPoliciesResourceWithRawResponse", + "NetworkPoliciesResourceWithStreamingResponse", + "AsyncNetworkPoliciesResourceWithStreamingResponse", ] diff --git a/src/runloop_api_client/resources/network_policies.py b/src/runloop_api_client/resources/network_policies.py new file mode 100644 index 000000000..5b96bf4b2 --- /dev/null +++ b/src/runloop_api_client/resources/network_policies.py @@ -0,0 +1,676 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +import httpx + +from ..types import network_policy_list_params, network_policy_create_params, network_policy_update_params +from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given +from .._utils import maybe_transform, async_maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..pagination import SyncNetworkPoliciesCursorIDPage, AsyncNetworkPoliciesCursorIDPage +from .._base_client import AsyncPaginator, make_request_options +from ..types.network_policy_view import NetworkPolicyView + +__all__ = ["NetworkPoliciesResource", "AsyncNetworkPoliciesResource"] + + +class NetworkPoliciesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> NetworkPoliciesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return NetworkPoliciesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> NetworkPoliciesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return NetworkPoliciesResourceWithStreamingResponse(self) + + def create( + self, + *, + name: str, + allow_all: Optional[bool] | Omit = omit, + allow_devbox_to_devbox: Optional[bool] | Omit = omit, + allowed_hostnames: Optional[SequenceNotStr[str]] | Omit = omit, + description: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> NetworkPolicyView: + """Create a new NetworkPolicy with the specified egress rules. + + The policy can then + be applied to blueprints, devboxes, or snapshot resumes. + + Args: + name: The human-readable name for the NetworkPolicy. Must be unique within the + account. + + allow_all: If true, all egress traffic is allowed (ALLOW_ALL policy). Defaults to false. + + allow_devbox_to_devbox: If true, allows traffic between the account's own devboxes via tunnels. Defaults + to false. + + allowed_hostnames: DNS-based allow list with wildcard support. Examples: ['github.com', + '*.npmjs.org']. + + description: Optional description for the NetworkPolicy. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/v1/network-policies", + body=maybe_transform( + { + "name": name, + "allow_all": allow_all, + "allow_devbox_to_devbox": allow_devbox_to_devbox, + "allowed_hostnames": allowed_hostnames, + "description": description, + }, + network_policy_create_params.NetworkPolicyCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=NetworkPolicyView, + ) + + def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NetworkPolicyView: + """ + Get a specific NetworkPolicy by its unique identifier. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/network-policies/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NetworkPolicyView, + ) + + def update( + self, + id: str, + *, + allow_all: Optional[bool] | Omit = omit, + allow_devbox_to_devbox: Optional[bool] | Omit = omit, + allowed_hostnames: Optional[SequenceNotStr[str]] | Omit = omit, + description: Optional[str] | Omit = omit, + name: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> NetworkPolicyView: + """Update an existing NetworkPolicy. + + All fields are optional. + + Args: + allow_all: If true, all egress traffic is allowed (ALLOW_ALL policy). + + allow_devbox_to_devbox: If true, allows traffic between the account's own devboxes via tunnels. + + allowed_hostnames: Updated DNS-based allow list with wildcard support. Examples: ['github.com', + '*.npmjs.org']. + + description: Updated description for the NetworkPolicy. + + name: Updated human-readable name for the NetworkPolicy. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/network-policies/{id}", + body=maybe_transform( + { + "allow_all": allow_all, + "allow_devbox_to_devbox": allow_devbox_to_devbox, + "allowed_hostnames": allowed_hostnames, + "description": description, + "name": name, + }, + network_policy_update_params.NetworkPolicyUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=NetworkPolicyView, + ) + + def list( + self, + *, + id: str | Omit = omit, + limit: int | Omit = omit, + name: str | Omit = omit, + starting_after: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncNetworkPoliciesCursorIDPage[NetworkPolicyView]: + """ + List all NetworkPolicies for the authenticated account. + + Args: + id: Filter by ID. + + limit: The limit of items to return. Default is 20. Max is 5000. + + name: Filter by name (partial match supported). + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/network-policies", + page=SyncNetworkPoliciesCursorIDPage[NetworkPolicyView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "id": id, + "limit": limit, + "name": name, + "starting_after": starting_after, + }, + network_policy_list_params.NetworkPolicyListParams, + ), + ), + model=NetworkPolicyView, + ) + + def delete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> NetworkPolicyView: + """Delete an existing NetworkPolicy. + + This action is irreversible. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/network-policies/{id}/delete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=NetworkPolicyView, + ) + + +class AsyncNetworkPoliciesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncNetworkPoliciesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncNetworkPoliciesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncNetworkPoliciesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncNetworkPoliciesResourceWithStreamingResponse(self) + + async def create( + self, + *, + name: str, + allow_all: Optional[bool] | Omit = omit, + allow_devbox_to_devbox: Optional[bool] | Omit = omit, + allowed_hostnames: Optional[SequenceNotStr[str]] | Omit = omit, + description: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> NetworkPolicyView: + """Create a new NetworkPolicy with the specified egress rules. + + The policy can then + be applied to blueprints, devboxes, or snapshot resumes. + + Args: + name: The human-readable name for the NetworkPolicy. Must be unique within the + account. + + allow_all: If true, all egress traffic is allowed (ALLOW_ALL policy). Defaults to false. + + allow_devbox_to_devbox: If true, allows traffic between the account's own devboxes via tunnels. Defaults + to false. + + allowed_hostnames: DNS-based allow list with wildcard support. Examples: ['github.com', + '*.npmjs.org']. + + description: Optional description for the NetworkPolicy. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/v1/network-policies", + body=await async_maybe_transform( + { + "name": name, + "allow_all": allow_all, + "allow_devbox_to_devbox": allow_devbox_to_devbox, + "allowed_hostnames": allowed_hostnames, + "description": description, + }, + network_policy_create_params.NetworkPolicyCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=NetworkPolicyView, + ) + + async def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NetworkPolicyView: + """ + Get a specific NetworkPolicy by its unique identifier. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/network-policies/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NetworkPolicyView, + ) + + async def update( + self, + id: str, + *, + allow_all: Optional[bool] | Omit = omit, + allow_devbox_to_devbox: Optional[bool] | Omit = omit, + allowed_hostnames: Optional[SequenceNotStr[str]] | Omit = omit, + description: Optional[str] | Omit = omit, + name: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> NetworkPolicyView: + """Update an existing NetworkPolicy. + + All fields are optional. + + Args: + allow_all: If true, all egress traffic is allowed (ALLOW_ALL policy). + + allow_devbox_to_devbox: If true, allows traffic between the account's own devboxes via tunnels. + + allowed_hostnames: Updated DNS-based allow list with wildcard support. Examples: ['github.com', + '*.npmjs.org']. + + description: Updated description for the NetworkPolicy. + + name: Updated human-readable name for the NetworkPolicy. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/network-policies/{id}", + body=await async_maybe_transform( + { + "allow_all": allow_all, + "allow_devbox_to_devbox": allow_devbox_to_devbox, + "allowed_hostnames": allowed_hostnames, + "description": description, + "name": name, + }, + network_policy_update_params.NetworkPolicyUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=NetworkPolicyView, + ) + + def list( + self, + *, + id: str | Omit = omit, + limit: int | Omit = omit, + name: str | Omit = omit, + starting_after: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[NetworkPolicyView, AsyncNetworkPoliciesCursorIDPage[NetworkPolicyView]]: + """ + List all NetworkPolicies for the authenticated account. + + Args: + id: Filter by ID. + + limit: The limit of items to return. Default is 20. Max is 5000. + + name: Filter by name (partial match supported). + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/network-policies", + page=AsyncNetworkPoliciesCursorIDPage[NetworkPolicyView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "id": id, + "limit": limit, + "name": name, + "starting_after": starting_after, + }, + network_policy_list_params.NetworkPolicyListParams, + ), + ), + model=NetworkPolicyView, + ) + + async def delete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> NetworkPolicyView: + """Delete an existing NetworkPolicy. + + This action is irreversible. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/network-policies/{id}/delete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=NetworkPolicyView, + ) + + +class NetworkPoliciesResourceWithRawResponse: + def __init__(self, network_policies: NetworkPoliciesResource) -> None: + self._network_policies = network_policies + + self.create = to_raw_response_wrapper( + network_policies.create, + ) + self.retrieve = to_raw_response_wrapper( + network_policies.retrieve, + ) + self.update = to_raw_response_wrapper( + network_policies.update, + ) + self.list = to_raw_response_wrapper( + network_policies.list, + ) + self.delete = to_raw_response_wrapper( + network_policies.delete, + ) + + +class AsyncNetworkPoliciesResourceWithRawResponse: + def __init__(self, network_policies: AsyncNetworkPoliciesResource) -> None: + self._network_policies = network_policies + + self.create = async_to_raw_response_wrapper( + network_policies.create, + ) + self.retrieve = async_to_raw_response_wrapper( + network_policies.retrieve, + ) + self.update = async_to_raw_response_wrapper( + network_policies.update, + ) + self.list = async_to_raw_response_wrapper( + network_policies.list, + ) + self.delete = async_to_raw_response_wrapper( + network_policies.delete, + ) + + +class NetworkPoliciesResourceWithStreamingResponse: + def __init__(self, network_policies: NetworkPoliciesResource) -> None: + self._network_policies = network_policies + + self.create = to_streamed_response_wrapper( + network_policies.create, + ) + self.retrieve = to_streamed_response_wrapper( + network_policies.retrieve, + ) + self.update = to_streamed_response_wrapper( + network_policies.update, + ) + self.list = to_streamed_response_wrapper( + network_policies.list, + ) + self.delete = to_streamed_response_wrapper( + network_policies.delete, + ) + + +class AsyncNetworkPoliciesResourceWithStreamingResponse: + def __init__(self, network_policies: AsyncNetworkPoliciesResource) -> None: + self._network_policies = network_policies + + self.create = async_to_streamed_response_wrapper( + network_policies.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + network_policies.retrieve, + ) + self.update = async_to_streamed_response_wrapper( + network_policies.update, + ) + self.list = async_to_streamed_response_wrapper( + network_policies.list, + ) + self.delete = async_to_streamed_response_wrapper( + network_policies.delete, + ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 6afd070a3..d1af9bc1d 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -5,8 +5,10 @@ from .shared import ( Mount as Mount, AfterIdle as AfterIdle, + AgentMount as AgentMount, RunProfile as RunProfile, AgentSource as AgentSource, + ObjectMount as ObjectMount, LaunchParameters as LaunchParameters, CodeMountParameters as CodeMountParameters, ) @@ -35,6 +37,7 @@ from .blueprint_build_log import BlueprintBuildLog as BlueprintBuildLog from .blueprint_list_view import BlueprintListView as BlueprintListView from .input_context_param import InputContextParam as InputContextParam +from .network_policy_view import NetworkPolicyView as NetworkPolicyView from .devbox_create_params import DevboxCreateParams as DevboxCreateParams from .devbox_snapshot_view import DevboxSnapshotView as DevboxSnapshotView from .devbox_update_params import DevboxUpdateParams as DevboxUpdateParams @@ -60,6 +63,7 @@ from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams from .inspection_source_param import InspectionSourceParam as InspectionSourceParam from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams +from .network_policy_list_view import NetworkPolicyListView as NetworkPolicyListView from .object_download_url_view import ObjectDownloadURLView as ObjectDownloadURLView from .repository_create_params import RepositoryCreateParams as RepositoryCreateParams from .repository_manifest_view import RepositoryManifestView as RepositoryManifestView @@ -74,6 +78,7 @@ from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams from .input_context_update_param import InputContextUpdateParam as InputContextUpdateParam +from .network_policy_list_params import NetworkPolicyListParams as NetworkPolicyListParams from .repository_connection_view import RepositoryConnectionView as RepositoryConnectionView from .scenario_environment_param import ScenarioEnvironmentParam as ScenarioEnvironmentParam from .devbox_create_tunnel_params import DevboxCreateTunnelParams as DevboxCreateTunnelParams @@ -86,6 +91,8 @@ from .benchmark_list_public_params import BenchmarkListPublicParams as BenchmarkListPublicParams from .blueprint_list_public_params import BlueprintListPublicParams as BlueprintListPublicParams from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView +from .network_policy_create_params import NetworkPolicyCreateParams as NetworkPolicyCreateParams +from .network_policy_update_params import NetworkPolicyUpdateParams as NetworkPolicyUpdateParams from .scoring_contract_result_view import ScoringContractResultView as ScoringContractResultView from .scoring_function_result_view import ScoringFunctionResultView as ScoringFunctionResultView from .repository_inspection_details import RepositoryInspectionDetails as RepositoryInspectionDetails diff --git a/src/runloop_api_client/types/network_policy_create_params.py b/src/runloop_api_client/types/network_policy_create_params.py new file mode 100644 index 000000000..b70c6c8f9 --- /dev/null +++ b/src/runloop_api_client/types/network_policy_create_params.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +from .._types import SequenceNotStr + +__all__ = ["NetworkPolicyCreateParams"] + + +class NetworkPolicyCreateParams(TypedDict, total=False): + name: Required[str] + """The human-readable name for the NetworkPolicy. + + Must be unique within the account. + """ + + allow_all: Optional[bool] + """If true, all egress traffic is allowed (ALLOW_ALL policy). Defaults to false.""" + + allow_devbox_to_devbox: Optional[bool] + """If true, allows traffic between the account's own devboxes via tunnels. + + Defaults to false. + """ + + allowed_hostnames: Optional[SequenceNotStr[str]] + """DNS-based allow list with wildcard support. + + Examples: ['github.com', '*.npmjs.org']. + """ + + description: Optional[str] + """Optional description for the NetworkPolicy.""" diff --git a/src/runloop_api_client/types/network_policy_list_params.py b/src/runloop_api_client/types/network_policy_list_params.py new file mode 100644 index 000000000..160da795f --- /dev/null +++ b/src/runloop_api_client/types/network_policy_list_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["NetworkPolicyListParams"] + + +class NetworkPolicyListParams(TypedDict, total=False): + id: str + """Filter by ID.""" + + limit: int + """The limit of items to return. Default is 20. Max is 5000.""" + + name: str + """Filter by name (partial match supported).""" + + starting_after: str + """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/network_policy_list_view.py b/src/runloop_api_client/types/network_policy_list_view.py new file mode 100644 index 000000000..17bc7868f --- /dev/null +++ b/src/runloop_api_client/types/network_policy_list_view.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .network_policy_view import NetworkPolicyView + +__all__ = ["NetworkPolicyListView"] + + +class NetworkPolicyListView(BaseModel): + """A list of NetworkPolicies with pagination information.""" + + has_more: bool + """Whether there are more results available.""" + + network_policies: List[NetworkPolicyView] + """The list of NetworkPolicies.""" + + total_count: int + """Total count of items in this response.""" diff --git a/src/runloop_api_client/types/network_policy_update_params.py b/src/runloop_api_client/types/network_policy_update_params.py new file mode 100644 index 000000000..22e9550ff --- /dev/null +++ b/src/runloop_api_client/types/network_policy_update_params.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import TypedDict + +from .._types import SequenceNotStr + +__all__ = ["NetworkPolicyUpdateParams"] + + +class NetworkPolicyUpdateParams(TypedDict, total=False): + allow_all: Optional[bool] + """If true, all egress traffic is allowed (ALLOW_ALL policy).""" + + allow_devbox_to_devbox: Optional[bool] + """If true, allows traffic between the account's own devboxes via tunnels.""" + + allowed_hostnames: Optional[SequenceNotStr[str]] + """Updated DNS-based allow list with wildcard support. + + Examples: ['github.com', '*.npmjs.org']. + """ + + description: Optional[str] + """Updated description for the NetworkPolicy.""" + + name: Optional[str] + """Updated human-readable name for the NetworkPolicy.""" diff --git a/src/runloop_api_client/types/network_policy_view.py b/src/runloop_api_client/types/network_policy_view.py new file mode 100644 index 000000000..4d743cc8a --- /dev/null +++ b/src/runloop_api_client/types/network_policy_view.py @@ -0,0 +1,52 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from .._models import BaseModel + +__all__ = ["NetworkPolicyView", "Egress"] + + +class Egress(BaseModel): + """The egress rules for this policy.""" + + allow_all: bool + """If true, all egress traffic is allowed and other fields are ignored. + + Used for ALLOW_ALL policies. + """ + + allow_devbox_to_devbox: bool + """If true, allows traffic between the account's own devboxes via tunnels.""" + + allowed_hostnames: List[str] + """DNS-based allow list with wildcard support. + + Examples: ['github.com', '*.npmjs.org', 'api.openai.com']. Empty list with + allow_all=false means no network access (DENY_ALL behavior). + """ + + +class NetworkPolicyView(BaseModel): + """A NetworkPolicy defines egress network access rules for devboxes. + + Policies can be applied to blueprints, devboxes, and snapshot resumes. + """ + + id: str + """The unique identifier of the NetworkPolicy.""" + + create_time_ms: int + """The creation time of the NetworkPolicy (Unix timestamp in milliseconds).""" + + egress: Egress + """The egress rules for this policy.""" + + name: str + """The human-readable name of the NetworkPolicy. Unique per account.""" + + update_time_ms: int + """Last update time of the NetworkPolicy (Unix timestamp in milliseconds).""" + + description: Optional[str] = None + """Optional description of the NetworkPolicy.""" diff --git a/src/runloop_api_client/types/shared/__init__.py b/src/runloop_api_client/types/shared/__init__.py index b5e4e6f75..ab07ef757 100644 --- a/src/runloop_api_client/types/shared/__init__.py +++ b/src/runloop_api_client/types/shared/__init__.py @@ -2,7 +2,9 @@ from .mount import Mount as Mount from .after_idle import AfterIdle as AfterIdle +from .agent_mount import AgentMount as AgentMount from .run_profile import RunProfile as RunProfile from .agent_source import AgentSource as AgentSource +from .object_mount import ObjectMount as ObjectMount from .launch_parameters import LaunchParameters as LaunchParameters from .code_mount_parameters import CodeMountParameters as CodeMountParameters diff --git a/src/runloop_api_client/types/shared/agent_mount.py b/src/runloop_api_client/types/shared/agent_mount.py new file mode 100644 index 000000000..cdb196dd5 --- /dev/null +++ b/src/runloop_api_client/types/shared/agent_mount.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["AgentMount"] + + +class AgentMount(BaseModel): + agent_id: Optional[str] = None + """The ID of the agent to mount. Either agent_id or name must be set.""" + + agent_name: Optional[str] = None + """The name of the agent to mount. + + Returns the most recent agent with a matching name if no agent id string + provided. Either agent id or name must be set + """ + + type: Literal["agent_mount"] + + agent_path: Optional[str] = None + """Path to mount the agent on the Devbox. + + Required for git and object agents. Use absolute path (e.g., /home/user/agent) + """ + + auth_token: Optional[str] = None + """Optional auth token for private repositories. Only used for git agents.""" diff --git a/src/runloop_api_client/types/shared/mount.py b/src/runloop_api_client/types/shared/mount.py index 5e256c8cf..855748fc4 100644 --- a/src/runloop_api_client/types/shared/mount.py +++ b/src/runloop_api_client/types/shared/mount.py @@ -5,45 +5,10 @@ from ..._utils import PropertyInfo from ..._models import BaseModel +from .agent_mount import AgentMount +from .object_mount import ObjectMount -__all__ = ["Mount", "ObjectMount", "AgentMount", "CodeMount", "FileMount"] - - -class ObjectMount(BaseModel): - object_id: str - """The ID of the object to write.""" - - object_path: str - """The path to write the object on the Devbox. - - Use absolute path of object (ie /home/user/object.txt, or directory if archive - /home/user/archive_dir) - """ - - type: Literal["object_mount"] - - -class AgentMount(BaseModel): - agent_id: Optional[str] = None - """The ID of the agent to mount. Either agent_id or name must be set.""" - - agent_name: Optional[str] = None - """The name of the agent to mount. - - Returns the most recent agent with a matching name if no agent id string - provided. Either agent id or name must be set - """ - - type: Literal["agent_mount"] - - agent_path: Optional[str] = None - """Path to mount the agent on the Devbox. - - Required for git and object agents. Use absolute path (e.g., /home/user/agent) - """ - - auth_token: Optional[str] = None - """Optional auth token for private repositories. Only used for git agents.""" +__all__ = ["Mount", "CodeMount", "FileMount"] class CodeMount(BaseModel): diff --git a/src/runloop_api_client/types/shared/object_mount.py b/src/runloop_api_client/types/shared/object_mount.py new file mode 100644 index 000000000..22f1b839b --- /dev/null +++ b/src/runloop_api_client/types/shared/object_mount.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["ObjectMount"] + + +class ObjectMount(BaseModel): + object_id: str + """The ID of the object to write.""" + + object_path: str + """The path to write the object on the Devbox. + + Use absolute path of object (ie /home/user/object.txt, or directory if archive + /home/user/archive_dir) + """ + + type: Literal["object_mount"] diff --git a/src/runloop_api_client/types/shared_params/__init__.py b/src/runloop_api_client/types/shared_params/__init__.py index b5e4e6f75..ab07ef757 100644 --- a/src/runloop_api_client/types/shared_params/__init__.py +++ b/src/runloop_api_client/types/shared_params/__init__.py @@ -2,7 +2,9 @@ from .mount import Mount as Mount from .after_idle import AfterIdle as AfterIdle +from .agent_mount import AgentMount as AgentMount from .run_profile import RunProfile as RunProfile from .agent_source import AgentSource as AgentSource +from .object_mount import ObjectMount as ObjectMount from .launch_parameters import LaunchParameters as LaunchParameters from .code_mount_parameters import CodeMountParameters as CodeMountParameters diff --git a/src/runloop_api_client/types/shared_params/agent_mount.py b/src/runloop_api_client/types/shared_params/agent_mount.py new file mode 100644 index 000000000..0c83a5fd7 --- /dev/null +++ b/src/runloop_api_client/types/shared_params/agent_mount.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["AgentMount"] + + +class AgentMount(TypedDict, total=False): + agent_id: Required[Optional[str]] + """The ID of the agent to mount. Either agent_id or name must be set.""" + + agent_name: Required[Optional[str]] + """The name of the agent to mount. + + Returns the most recent agent with a matching name if no agent id string + provided. Either agent id or name must be set + """ + + type: Required[Literal["agent_mount"]] + + agent_path: Optional[str] + """Path to mount the agent on the Devbox. + + Required for git and object agents. Use absolute path (e.g., /home/user/agent) + """ + + auth_token: Optional[str] + """Optional auth token for private repositories. Only used for git agents.""" diff --git a/src/runloop_api_client/types/shared_params/mount.py b/src/runloop_api_client/types/shared_params/mount.py index d0976e35f..8c053506c 100644 --- a/src/runloop_api_client/types/shared_params/mount.py +++ b/src/runloop_api_client/types/shared_params/mount.py @@ -5,44 +5,10 @@ from typing import Union, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict -__all__ = ["Mount", "ObjectMount", "AgentMount", "CodeMount", "FileMount"] +from .agent_mount import AgentMount +from .object_mount import ObjectMount - -class ObjectMount(TypedDict, total=False): - object_id: Required[str] - """The ID of the object to write.""" - - object_path: Required[str] - """The path to write the object on the Devbox. - - Use absolute path of object (ie /home/user/object.txt, or directory if archive - /home/user/archive_dir) - """ - - type: Required[Literal["object_mount"]] - - -class AgentMount(TypedDict, total=False): - agent_id: Required[Optional[str]] - """The ID of the agent to mount. Either agent_id or name must be set.""" - - agent_name: Required[Optional[str]] - """The name of the agent to mount. - - Returns the most recent agent with a matching name if no agent id string - provided. Either agent id or name must be set - """ - - type: Required[Literal["agent_mount"]] - - agent_path: Optional[str] - """Path to mount the agent on the Devbox. - - Required for git and object agents. Use absolute path (e.g., /home/user/agent) - """ - - auth_token: Optional[str] - """Optional auth token for private repositories. Only used for git agents.""" +__all__ = ["Mount", "CodeMount", "FileMount"] class CodeMount(TypedDict, total=False): diff --git a/src/runloop_api_client/types/shared_params/object_mount.py b/src/runloop_api_client/types/shared_params/object_mount.py new file mode 100644 index 000000000..1469897bf --- /dev/null +++ b/src/runloop_api_client/types/shared_params/object_mount.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["ObjectMount"] + + +class ObjectMount(TypedDict, total=False): + object_id: Required[str] + """The ID of the object to write.""" + + object_path: Required[str] + """The path to write the object on the Devbox. + + Use absolute path of object (ie /home/user/object.txt, or directory if archive + /home/user/archive_dir) + """ + + type: Required[Literal["object_mount"]] diff --git a/tests/api_resources/test_network_policies.py b/tests/api_resources/test_network_policies.py new file mode 100644 index 000000000..a528b4256 --- /dev/null +++ b/tests/api_resources/test_network_policies.py @@ -0,0 +1,433 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types import ( + NetworkPolicyView, +) +from runloop_api_client.pagination import SyncNetworkPoliciesCursorIDPage, AsyncNetworkPoliciesCursorIDPage + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestNetworkPolicies: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Runloop) -> None: + network_policy = client.network_policies.create( + name="name", + ) + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Runloop) -> None: + network_policy = client.network_policies.create( + name="name", + allow_all=True, + allow_devbox_to_devbox=True, + allowed_hostnames=["string"], + description="description", + ) + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Runloop) -> None: + response = client.network_policies.with_raw_response.create( + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + network_policy = response.parse() + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Runloop) -> None: + with client.network_policies.with_streaming_response.create( + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + network_policy = response.parse() + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + network_policy = client.network_policies.retrieve( + "id", + ) + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.network_policies.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + network_policy = response.parse() + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.network_policies.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + network_policy = response.parse() + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.network_policies.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_update(self, client: Runloop) -> None: + network_policy = client.network_policies.update( + id="id", + ) + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Runloop) -> None: + network_policy = client.network_policies.update( + id="id", + allow_all=True, + allow_devbox_to_devbox=True, + allowed_hostnames=["string"], + description="description", + name="name", + ) + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Runloop) -> None: + response = client.network_policies.with_raw_response.update( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + network_policy = response.parse() + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Runloop) -> None: + with client.network_policies.with_streaming_response.update( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + network_policy = response.parse() + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.network_policies.with_raw_response.update( + id="", + ) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + network_policy = client.network_policies.list() + assert_matches_type(SyncNetworkPoliciesCursorIDPage[NetworkPolicyView], network_policy, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + network_policy = client.network_policies.list( + id="id", + limit=0, + name="name", + starting_after="starting_after", + ) + assert_matches_type(SyncNetworkPoliciesCursorIDPage[NetworkPolicyView], network_policy, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.network_policies.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + network_policy = response.parse() + assert_matches_type(SyncNetworkPoliciesCursorIDPage[NetworkPolicyView], network_policy, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.network_policies.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + network_policy = response.parse() + assert_matches_type(SyncNetworkPoliciesCursorIDPage[NetworkPolicyView], network_policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_delete(self, client: Runloop) -> None: + network_policy = client.network_policies.delete( + "id", + ) + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Runloop) -> None: + response = client.network_policies.with_raw_response.delete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + network_policy = response.parse() + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Runloop) -> None: + with client.network_policies.with_streaming_response.delete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + network_policy = response.parse() + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.network_policies.with_raw_response.delete( + "", + ) + + +class TestAsyncNetworkPolicies: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_create(self, async_client: AsyncRunloop) -> None: + network_policy = await async_client.network_policies.create( + name="name", + ) + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: + network_policy = await async_client.network_policies.create( + name="name", + allow_all=True, + allow_devbox_to_devbox=True, + allowed_hostnames=["string"], + description="description", + ) + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: + response = await async_client.network_policies.with_raw_response.create( + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + network_policy = await response.parse() + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: + async with async_client.network_policies.with_streaming_response.create( + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + network_policy = await response.parse() + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + network_policy = await async_client.network_policies.retrieve( + "id", + ) + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.network_policies.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + network_policy = await response.parse() + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.network_policies.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + network_policy = await response.parse() + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.network_policies.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_update(self, async_client: AsyncRunloop) -> None: + network_policy = await async_client.network_policies.update( + id="id", + ) + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncRunloop) -> None: + network_policy = await async_client.network_policies.update( + id="id", + allow_all=True, + allow_devbox_to_devbox=True, + allowed_hostnames=["string"], + description="description", + name="name", + ) + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: + response = await async_client.network_policies.with_raw_response.update( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + network_policy = await response.parse() + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncRunloop) -> None: + async with async_client.network_policies.with_streaming_response.update( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + network_policy = await response.parse() + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.network_policies.with_raw_response.update( + id="", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + network_policy = await async_client.network_policies.list() + assert_matches_type(AsyncNetworkPoliciesCursorIDPage[NetworkPolicyView], network_policy, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + network_policy = await async_client.network_policies.list( + id="id", + limit=0, + name="name", + starting_after="starting_after", + ) + assert_matches_type(AsyncNetworkPoliciesCursorIDPage[NetworkPolicyView], network_policy, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.network_policies.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + network_policy = await response.parse() + assert_matches_type(AsyncNetworkPoliciesCursorIDPage[NetworkPolicyView], network_policy, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.network_policies.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + network_policy = await response.parse() + assert_matches_type(AsyncNetworkPoliciesCursorIDPage[NetworkPolicyView], network_policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete(self, async_client: AsyncRunloop) -> None: + network_policy = await async_client.network_policies.delete( + "id", + ) + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncRunloop) -> None: + response = await async_client.network_policies.with_raw_response.delete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + network_policy = await response.parse() + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncRunloop) -> None: + async with async_client.network_policies.with_streaming_response.delete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + network_policy = await response.parse() + assert_matches_type(NetworkPolicyView, network_policy, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.network_policies.with_raw_response.delete( + "", + ) From 9ecd7eb4e8f6325a4db398cef2d99ca9cc259383 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 17 Jan 2026 04:16:14 +0000 Subject: [PATCH 938/993] chore(internal): update `actions/checkout` version --- .github/workflows/ci.yml | 6 +++--- .github/workflows/publish-pypi.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2fdbdbb52..77924adbb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/runloop-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install uv uses: astral-sh/setup-uv@v5 @@ -41,7 +41,7 @@ jobs: id-token: write runs-on: ${{ github.repository == 'stainless-sdks/runloop-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install uv uses: astral-sh/setup-uv@v5 @@ -75,7 +75,7 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/runloop-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install uv uses: astral-sh/setup-uv@v5 diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 088d1b294..bce59933f 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install uv uses: astral-sh/setup-uv@v5 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index d80447e1d..051116384 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -12,7 +12,7 @@ jobs: if: github.repository == 'runloopai/api-client-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Check release environment run: | From 091f7005ecc69a202c6c8e951e65cbd1fc48c904 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 19 Jan 2026 23:40:04 +0000 Subject: [PATCH 939/993] feat(blueprint): Set cilium network policy on blueprint build (#7006) --- .stats.yml | 4 +- .../resources/blueprints.py | 42 +++++++++++++++++++ .../resources/devboxes/devboxes.py | 10 ----- .../types/blueprint_build_parameters.py | 9 ++++ ...blueprint_create_from_inspection_params.py | 6 +++ .../types/blueprint_create_params.py | 9 ++++ .../types/blueprint_preview_params.py | 9 ++++ .../types/devbox_create_params.py | 6 --- src/runloop_api_client/types/devbox_view.py | 3 ++ tests/api_resources/test_blueprints.py | 6 +++ tests/api_resources/test_devboxes.py | 2 - 11 files changed, 86 insertions(+), 20 deletions(-) diff --git a/.stats.yml b/.stats.yml index de2b8be94..a3fb034e6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 103 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8ebd9dbfacb180ec9c980f5e46a814b0c8a3cb6063136db18780271d33a8dfa6.yml -openapi_spec_hash: 12d4edec72b722945bade9419636d63e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eac4defbf39825fa88e0be11955be80cd004bcea46398be52f79800570539be0.yml +openapi_spec_hash: d18585a489895642807922dfa558226d config_hash: ec63e62d4660c9c924b39a8671c2fdb1 diff --git a/src/runloop_api_client/resources/blueprints.py b/src/runloop_api_client/resources/blueprints.py index bfb781f2d..da747d6c4 100644 --- a/src/runloop_api_client/resources/blueprints.py +++ b/src/runloop_api_client/resources/blueprints.py @@ -68,6 +68,7 @@ def create( file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, + network_policy_id: Optional[str] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, @@ -111,6 +112,12 @@ def create( metadata: (Optional) User defined metadata for the Blueprint. + network_policy_id: (Optional) ID of the network policy to apply during blueprint build. This + restricts network access during the build process. This does not affect devboxes + created from this blueprint; if you want devboxes created from this blueprint to + inherit the network policy, set the network_policy_id on the blueprint launch + parameters. + secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets will be available to commands during the build. Secrets are NOT stored in the blueprint image. Example: {"DB_PASS": "DATABASE_PASSWORD"} makes the secret @@ -146,6 +153,7 @@ def create( "file_mounts": file_mounts, "launch_parameters": launch_parameters, "metadata": metadata, + "network_policy_id": network_policy_id, "secrets": secrets, "services": services, "system_setup_commands": system_setup_commands, @@ -301,6 +309,7 @@ def create_from_inspection( file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, + network_policy_id: Optional[str] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -328,6 +337,9 @@ def create_from_inspection( metadata: (Optional) User defined metadata for the Blueprint. + network_policy_id: (Optional) ID of the network policy to apply during blueprint build. This + restricts network access during the build process. + secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets can be used as environment variables in system_setup_commands. Example: {"GITHUB_TOKEN": "gh_secret"} makes 'gh_secret' available as GITHUB_TOKEN. @@ -353,6 +365,7 @@ def create_from_inspection( "file_mounts": file_mounts, "launch_parameters": launch_parameters, "metadata": metadata, + "network_policy_id": network_policy_id, "secrets": secrets, "system_setup_commands": system_setup_commands, }, @@ -469,6 +482,7 @@ def preview( file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, + network_policy_id: Optional[str] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, services: Optional[Iterable[blueprint_preview_params.Service]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, @@ -510,6 +524,12 @@ def preview( metadata: (Optional) User defined metadata for the Blueprint. + network_policy_id: (Optional) ID of the network policy to apply during blueprint build. This + restricts network access during the build process. This does not affect devboxes + created from this blueprint; if you want devboxes created from this blueprint to + inherit the network policy, set the network_policy_id on the blueprint launch + parameters. + secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets will be available to commands during the build. Secrets are NOT stored in the blueprint image. Example: {"DB_PASS": "DATABASE_PASSWORD"} makes the secret @@ -545,6 +565,7 @@ def preview( "file_mounts": file_mounts, "launch_parameters": launch_parameters, "metadata": metadata, + "network_policy_id": network_policy_id, "secrets": secrets, "services": services, "system_setup_commands": system_setup_commands, @@ -595,6 +616,7 @@ async def create( file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, + network_policy_id: Optional[str] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, @@ -638,6 +660,12 @@ async def create( metadata: (Optional) User defined metadata for the Blueprint. + network_policy_id: (Optional) ID of the network policy to apply during blueprint build. This + restricts network access during the build process. This does not affect devboxes + created from this blueprint; if you want devboxes created from this blueprint to + inherit the network policy, set the network_policy_id on the blueprint launch + parameters. + secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets will be available to commands during the build. Secrets are NOT stored in the blueprint image. Example: {"DB_PASS": "DATABASE_PASSWORD"} makes the secret @@ -673,6 +701,7 @@ async def create( "file_mounts": file_mounts, "launch_parameters": launch_parameters, "metadata": metadata, + "network_policy_id": network_policy_id, "secrets": secrets, "services": services, "system_setup_commands": system_setup_commands, @@ -828,6 +857,7 @@ async def create_from_inspection( file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, + network_policy_id: Optional[str] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -855,6 +885,9 @@ async def create_from_inspection( metadata: (Optional) User defined metadata for the Blueprint. + network_policy_id: (Optional) ID of the network policy to apply during blueprint build. This + restricts network access during the build process. + secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets can be used as environment variables in system_setup_commands. Example: {"GITHUB_TOKEN": "gh_secret"} makes 'gh_secret' available as GITHUB_TOKEN. @@ -880,6 +913,7 @@ async def create_from_inspection( "file_mounts": file_mounts, "launch_parameters": launch_parameters, "metadata": metadata, + "network_policy_id": network_policy_id, "secrets": secrets, "system_setup_commands": system_setup_commands, }, @@ -996,6 +1030,7 @@ async def preview( file_mounts: Optional[Dict[str, str]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, + network_policy_id: Optional[str] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, services: Optional[Iterable[blueprint_preview_params.Service]] | Omit = omit, system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit, @@ -1037,6 +1072,12 @@ async def preview( metadata: (Optional) User defined metadata for the Blueprint. + network_policy_id: (Optional) ID of the network policy to apply during blueprint build. This + restricts network access during the build process. This does not affect devboxes + created from this blueprint; if you want devboxes created from this blueprint to + inherit the network policy, set the network_policy_id on the blueprint launch + parameters. + secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets will be available to commands during the build. Secrets are NOT stored in the blueprint image. Example: {"DB_PASS": "DATABASE_PASSWORD"} makes the secret @@ -1072,6 +1113,7 @@ async def preview( "file_mounts": file_mounts, "launch_parameters": launch_parameters, "metadata": metadata, + "network_policy_id": network_policy_id, "secrets": secrets, "services": services, "system_setup_commands": system_setup_commands, diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 860345c8d..c9e375d08 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -158,7 +158,6 @@ def create( metadata: Optional[Dict[str, str]] | Omit = omit, mounts: Optional[Iterable[Mount]] | Omit = omit, name: Optional[str] | Omit = omit, - network_policy_id: Optional[str] | Omit = omit, repo_connection_id: Optional[str] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, snapshot_id: Optional[str] | Omit = omit, @@ -205,9 +204,6 @@ def create( name: (Optional) A user specified name to give the Devbox. - network_policy_id: (Optional) ID of the network policy to apply to this Devbox. If not specified, - the default network policy will be used. - repo_connection_id: Repository connection id the devbox should source its base image from. secrets: (Optional) Map of environment variable names to secret names. The secret values @@ -242,7 +238,6 @@ def create( "metadata": metadata, "mounts": mounts, "name": name, - "network_policy_id": network_policy_id, "repo_connection_id": repo_connection_id, "secrets": secrets, "snapshot_id": snapshot_id, @@ -1471,7 +1466,6 @@ async def create( metadata: Optional[Dict[str, str]] | Omit = omit, mounts: Optional[Iterable[Mount]] | Omit = omit, name: Optional[str] | Omit = omit, - network_policy_id: Optional[str] | Omit = omit, repo_connection_id: Optional[str] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, snapshot_id: Optional[str] | Omit = omit, @@ -1518,9 +1512,6 @@ async def create( name: (Optional) A user specified name to give the Devbox. - network_policy_id: (Optional) ID of the network policy to apply to this Devbox. If not specified, - the default network policy will be used. - repo_connection_id: Repository connection id the devbox should source its base image from. secrets: (Optional) Map of environment variable names to secret names. The secret values @@ -1555,7 +1546,6 @@ async def create( "metadata": metadata, "mounts": mounts, "name": name, - "network_policy_id": network_policy_id, "repo_connection_id": repo_connection_id, "secrets": secrets, "snapshot_id": snapshot_id, diff --git a/src/runloop_api_client/types/blueprint_build_parameters.py b/src/runloop_api_client/types/blueprint_build_parameters.py index 52ddfda7c..b8fafb82f 100644 --- a/src/runloop_api_client/types/blueprint_build_parameters.py +++ b/src/runloop_api_client/types/blueprint_build_parameters.py @@ -91,6 +91,15 @@ class BlueprintBuildParameters(BaseModel): metadata: Optional[Dict[str, str]] = None """(Optional) User defined metadata for the Blueprint.""" + network_policy_id: Optional[str] = None + """(Optional) ID of the network policy to apply during blueprint build. + + This restricts network access during the build process. This does not affect + devboxes created from this blueprint; if you want devboxes created from this + blueprint to inherit the network policy, set the network_policy_id on the + blueprint launch parameters. + """ + secrets: Optional[Dict[str, str]] = None """(Optional) Map of mount IDs/environment variable names to secret names. diff --git a/src/runloop_api_client/types/blueprint_create_from_inspection_params.py b/src/runloop_api_client/types/blueprint_create_from_inspection_params.py index 740c0a292..278fa676a 100644 --- a/src/runloop_api_client/types/blueprint_create_from_inspection_params.py +++ b/src/runloop_api_client/types/blueprint_create_from_inspection_params.py @@ -32,6 +32,12 @@ class BlueprintCreateFromInspectionParams(TypedDict, total=False): metadata: Optional[Dict[str, str]] """(Optional) User defined metadata for the Blueprint.""" + network_policy_id: Optional[str] + """(Optional) ID of the network policy to apply during blueprint build. + + This restricts network access during the build process. + """ + secrets: Optional[Dict[str, str]] """(Optional) Map of mount IDs/environment variable names to secret names. diff --git a/src/runloop_api_client/types/blueprint_create_params.py b/src/runloop_api_client/types/blueprint_create_params.py index 94156d2e9..95c33e7dc 100644 --- a/src/runloop_api_client/types/blueprint_create_params.py +++ b/src/runloop_api_client/types/blueprint_create_params.py @@ -51,6 +51,15 @@ class BlueprintCreateParams(TypedDict, total=False): metadata: Optional[Dict[str, str]] """(Optional) User defined metadata for the Blueprint.""" + network_policy_id: Optional[str] + """(Optional) ID of the network policy to apply during blueprint build. + + This restricts network access during the build process. This does not affect + devboxes created from this blueprint; if you want devboxes created from this + blueprint to inherit the network policy, set the network_policy_id on the + blueprint launch parameters. + """ + secrets: Optional[Dict[str, str]] """(Optional) Map of mount IDs/environment variable names to secret names. diff --git a/src/runloop_api_client/types/blueprint_preview_params.py b/src/runloop_api_client/types/blueprint_preview_params.py index 4269b734f..b2dc1713d 100644 --- a/src/runloop_api_client/types/blueprint_preview_params.py +++ b/src/runloop_api_client/types/blueprint_preview_params.py @@ -51,6 +51,15 @@ class BlueprintPreviewParams(TypedDict, total=False): metadata: Optional[Dict[str, str]] """(Optional) User defined metadata for the Blueprint.""" + network_policy_id: Optional[str] + """(Optional) ID of the network policy to apply during blueprint build. + + This restricts network access during the build process. This does not affect + devboxes created from this blueprint; if you want devboxes created from this + blueprint to inherit the network policy, set the network_policy_id on the + blueprint launch parameters. + """ + secrets: Optional[Dict[str, str]] """(Optional) Map of mount IDs/environment variable names to secret names. diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 1cfd84f01..4cecd0e72 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -56,12 +56,6 @@ class DevboxCreateParams(TypedDict, total=False): name: Optional[str] """(Optional) A user specified name to give the Devbox.""" - network_policy_id: Optional[str] - """(Optional) ID of the network policy to apply to this Devbox. - - If not specified, the default network policy will be used. - """ - repo_connection_id: Optional[str] """Repository connection id the devbox should source its base image from.""" diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index cf9dc2383..f2679ab60 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -87,6 +87,9 @@ class DevboxView(BaseModel): name: Optional[str] = None """The name of the Devbox.""" + network_policy_id: Optional[str] = None + """The network policy ID used to create the Devbox.""" + shutdown_reason: Optional[Literal["api_shutdown", "keep_alive_timeout", "entrypoint_exit", "idle"]] = None """ The shutdown reason if the Devbox shutdown, if the Devbox has a 'shutdown' diff --git a/tests/api_resources/test_blueprints.py b/tests/api_resources/test_blueprints.py index 41de07003..383e70380 100644 --- a/tests/api_resources/test_blueprints.py +++ b/tests/api_resources/test_blueprints.py @@ -71,6 +71,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: }, }, metadata={"foo": "string"}, + network_policy_id="network_policy_id", secrets={"foo": "string"}, services=[ { @@ -262,6 +263,7 @@ def test_method_create_from_inspection_with_all_params(self, client: Runloop) -> }, }, metadata={"foo": "string"}, + network_policy_id="network_policy_id", secrets={"foo": "string"}, system_setup_commands=["string"], ) @@ -415,6 +417,7 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None: }, }, metadata={"foo": "string"}, + network_policy_id="network_policy_id", secrets={"foo": "string"}, services=[ { @@ -512,6 +515,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - }, }, metadata={"foo": "string"}, + network_policy_id="network_policy_id", secrets={"foo": "string"}, services=[ { @@ -703,6 +707,7 @@ async def test_method_create_from_inspection_with_all_params(self, async_client: }, }, metadata={"foo": "string"}, + network_policy_id="network_policy_id", secrets={"foo": "string"}, system_setup_commands=["string"], ) @@ -856,6 +861,7 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop) }, }, metadata={"foo": "string"}, + network_policy_id="network_policy_id", secrets={"foo": "string"}, services=[ { diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 2316a7021..878a09e9c 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -90,7 +90,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: } ], name="name", - network_policy_id="network_policy_id", repo_connection_id="repo_connection_id", secrets={"foo": "string"}, snapshot_id="snapshot_id", @@ -1167,7 +1166,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - } ], name="name", - network_policy_id="network_policy_id", repo_connection_id="repo_connection_id", secrets={"foo": "string"}, snapshot_id="snapshot_id", From 9c5715a49358aac89f21e75e5d9b4f5966f89706 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 20 Jan 2026 00:05:47 +0000 Subject: [PATCH 940/993] chore(devbox): Remove network policy from devbox view; use launch params instead (#7025) --- .stats.yml | 4 ++-- src/runloop_api_client/types/devbox_view.py | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index a3fb034e6..6f6409f94 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 103 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eac4defbf39825fa88e0be11955be80cd004bcea46398be52f79800570539be0.yml -openapi_spec_hash: d18585a489895642807922dfa558226d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-5bbc26893c51a60089ff83a9d067c72252989fbfc5fa941cabf801f62b314c77.yml +openapi_spec_hash: b5d826e352ca1ac815b7530278f4a5ab config_hash: ec63e62d4660c9c924b39a8671c2fdb1 diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index f2679ab60..cf9dc2383 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -87,9 +87,6 @@ class DevboxView(BaseModel): name: Optional[str] = None """The name of the Devbox.""" - network_policy_id: Optional[str] = None - """The network policy ID used to create the Devbox.""" - shutdown_reason: Optional[Literal["api_shutdown", "keep_alive_timeout", "entrypoint_exit", "idle"]] = None """ The shutdown reason if the Devbox shutdown, if the Devbox has a 'shutdown' From eb82c7dfd94e9f8482fc6b69078a2fc053180682 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 20 Jan 2026 14:30:53 +0000 Subject: [PATCH 941/993] refactor(benchmark): Deprecate /benchmark/{id}/runs in favor of /benchmark_runs (#7019) --- .stats.yml | 8 +- api.md | 16 + src/runloop_api_client/_client.py | 38 ++ src/runloop_api_client/resources/__init__.py | 14 + .../resources/benchmark_runs.py | 595 ++++++++++++++++++ .../resources/benchmarks/runs.py | 131 ++-- src/runloop_api_client/types/__init__.py | 4 + .../types/benchmark_run_list_params.py | 21 + ...benchmark_run_list_scenario_runs_params.py | 18 + tests/api_resources/benchmarks/test_runs.py | 406 +++++++----- tests/api_resources/test_benchmark_runs.py | 422 +++++++++++++ 11 files changed, 1455 insertions(+), 218 deletions(-) create mode 100644 src/runloop_api_client/resources/benchmark_runs.py create mode 100644 src/runloop_api_client/types/benchmark_run_list_params.py create mode 100644 src/runloop_api_client/types/benchmark_run_list_scenario_runs_params.py create mode 100644 tests/api_resources/test_benchmark_runs.py diff --git a/.stats.yml b/.stats.yml index 6f6409f94..553c2ca6f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 103 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-5bbc26893c51a60089ff83a9d067c72252989fbfc5fa941cabf801f62b314c77.yml -openapi_spec_hash: b5d826e352ca1ac815b7530278f4a5ab -config_hash: ec63e62d4660c9c924b39a8671c2fdb1 +configured_endpoints: 108 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e583f34fdcdc18499c8692e8eb8021f6163201f0f77206934c712c319a674d43.yml +openapi_spec_hash: f2fb3f7f5c1f62d3dc397cd02cd1007a +config_hash: 42959fa2708796cc2f83937278dde733 diff --git a/api.md b/api.md index efb052238..2ab0075eb 100644 --- a/api.md +++ b/api.md @@ -51,6 +51,22 @@ Methods: - client.benchmarks.runs.complete(id) -> BenchmarkRunView - client.benchmarks.runs.list_scenario_runs(id, \*\*params) -> SyncBenchmarkRunsCursorIDPage[ScenarioRunView] +# BenchmarkRuns + +Types: + +```python +from runloop_api_client.types import BenchmarkRunListView, BenchmarkRunView, ScenarioRunListView +``` + +Methods: + +- client.benchmark_runs.retrieve(id) -> BenchmarkRunView +- client.benchmark_runs.list(\*\*params) -> SyncBenchmarkRunsCursorIDPage[BenchmarkRunView] +- client.benchmark_runs.cancel(id) -> BenchmarkRunView +- client.benchmark_runs.complete(id) -> BenchmarkRunView +- client.benchmark_runs.list_scenario_runs(id, \*\*params) -> SyncBenchmarkRunsCursorIDPage[ScenarioRunView] + # Agents Types: diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index eb17eb1ad..603a43dc2 100644 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -40,6 +40,7 @@ benchmarks, blueprints, repositories, + benchmark_runs, network_policies, ) from .resources.agents import AgentsResource, AsyncAgentsResource @@ -47,6 +48,7 @@ from .resources.secrets import SecretsResource, AsyncSecretsResource from .resources.blueprints import BlueprintsResource, AsyncBlueprintsResource from .resources.repositories import RepositoriesResource, AsyncRepositoriesResource + from .resources.benchmark_runs import BenchmarkRunsResource, AsyncBenchmarkRunsResource from .resources.network_policies import NetworkPoliciesResource, AsyncNetworkPoliciesResource from .resources.devboxes.devboxes import DevboxesResource, AsyncDevboxesResource from .resources.scenarios.scenarios import ScenariosResource, AsyncScenariosResource @@ -118,6 +120,12 @@ def benchmarks(self) -> BenchmarksResource: return BenchmarksResource(self) + @cached_property + def benchmark_runs(self) -> BenchmarkRunsResource: + from .resources.benchmark_runs import BenchmarkRunsResource + + return BenchmarkRunsResource(self) + @cached_property def agents(self) -> AgentsResource: from .resources.agents import AgentsResource @@ -342,6 +350,12 @@ def benchmarks(self) -> AsyncBenchmarksResource: return AsyncBenchmarksResource(self) + @cached_property + def benchmark_runs(self) -> AsyncBenchmarkRunsResource: + from .resources.benchmark_runs import AsyncBenchmarkRunsResource + + return AsyncBenchmarkRunsResource(self) + @cached_property def agents(self) -> AsyncAgentsResource: from .resources.agents import AsyncAgentsResource @@ -515,6 +529,12 @@ def benchmarks(self) -> benchmarks.BenchmarksResourceWithRawResponse: return BenchmarksResourceWithRawResponse(self._client.benchmarks) + @cached_property + def benchmark_runs(self) -> benchmark_runs.BenchmarkRunsResourceWithRawResponse: + from .resources.benchmark_runs import BenchmarkRunsResourceWithRawResponse + + return BenchmarkRunsResourceWithRawResponse(self._client.benchmark_runs) + @cached_property def agents(self) -> agents.AgentsResourceWithRawResponse: from .resources.agents import AgentsResourceWithRawResponse @@ -576,6 +596,12 @@ def benchmarks(self) -> benchmarks.AsyncBenchmarksResourceWithRawResponse: return AsyncBenchmarksResourceWithRawResponse(self._client.benchmarks) + @cached_property + def benchmark_runs(self) -> benchmark_runs.AsyncBenchmarkRunsResourceWithRawResponse: + from .resources.benchmark_runs import AsyncBenchmarkRunsResourceWithRawResponse + + return AsyncBenchmarkRunsResourceWithRawResponse(self._client.benchmark_runs) + @cached_property def agents(self) -> agents.AsyncAgentsResourceWithRawResponse: from .resources.agents import AsyncAgentsResourceWithRawResponse @@ -637,6 +663,12 @@ def benchmarks(self) -> benchmarks.BenchmarksResourceWithStreamingResponse: return BenchmarksResourceWithStreamingResponse(self._client.benchmarks) + @cached_property + def benchmark_runs(self) -> benchmark_runs.BenchmarkRunsResourceWithStreamingResponse: + from .resources.benchmark_runs import BenchmarkRunsResourceWithStreamingResponse + + return BenchmarkRunsResourceWithStreamingResponse(self._client.benchmark_runs) + @cached_property def agents(self) -> agents.AgentsResourceWithStreamingResponse: from .resources.agents import AgentsResourceWithStreamingResponse @@ -698,6 +730,12 @@ def benchmarks(self) -> benchmarks.AsyncBenchmarksResourceWithStreamingResponse: return AsyncBenchmarksResourceWithStreamingResponse(self._client.benchmarks) + @cached_property + def benchmark_runs(self) -> benchmark_runs.AsyncBenchmarkRunsResourceWithStreamingResponse: + from .resources.benchmark_runs import AsyncBenchmarkRunsResourceWithStreamingResponse + + return AsyncBenchmarkRunsResourceWithStreamingResponse(self._client.benchmark_runs) + @cached_property def agents(self) -> agents.AsyncAgentsResourceWithStreamingResponse: from .resources.agents import AsyncAgentsResourceWithStreamingResponse diff --git a/src/runloop_api_client/resources/__init__.py b/src/runloop_api_client/resources/__init__.py index 761613989..90a4a2971 100644 --- a/src/runloop_api_client/resources/__init__.py +++ b/src/runloop_api_client/resources/__init__.py @@ -64,6 +64,14 @@ RepositoriesResourceWithStreamingResponse, AsyncRepositoriesResourceWithStreamingResponse, ) +from .benchmark_runs import ( + BenchmarkRunsResource, + AsyncBenchmarkRunsResource, + BenchmarkRunsResourceWithRawResponse, + AsyncBenchmarkRunsResourceWithRawResponse, + BenchmarkRunsResourceWithStreamingResponse, + AsyncBenchmarkRunsResourceWithStreamingResponse, +) from .network_policies import ( NetworkPoliciesResource, AsyncNetworkPoliciesResource, @@ -80,6 +88,12 @@ "AsyncBenchmarksResourceWithRawResponse", "BenchmarksResourceWithStreamingResponse", "AsyncBenchmarksResourceWithStreamingResponse", + "BenchmarkRunsResource", + "AsyncBenchmarkRunsResource", + "BenchmarkRunsResourceWithRawResponse", + "AsyncBenchmarkRunsResourceWithRawResponse", + "BenchmarkRunsResourceWithStreamingResponse", + "AsyncBenchmarkRunsResourceWithStreamingResponse", "AgentsResource", "AsyncAgentsResource", "AgentsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/benchmark_runs.py b/src/runloop_api_client/resources/benchmark_runs.py new file mode 100644 index 000000000..3e957de2d --- /dev/null +++ b/src/runloop_api_client/resources/benchmark_runs.py @@ -0,0 +1,595 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from ..types import benchmark_run_list_params, benchmark_run_list_scenario_runs_params +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from .._utils import maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..pagination import SyncBenchmarkRunsCursorIDPage, AsyncBenchmarkRunsCursorIDPage +from .._base_client import AsyncPaginator, make_request_options +from ..types.scenario_run_view import ScenarioRunView +from ..types.benchmark_run_view import BenchmarkRunView + +__all__ = ["BenchmarkRunsResource", "AsyncBenchmarkRunsResource"] + + +class BenchmarkRunsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> BenchmarkRunsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return BenchmarkRunsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> BenchmarkRunsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return BenchmarkRunsResourceWithStreamingResponse(self) + + def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> BenchmarkRunView: + """ + Get a BenchmarkRun given ID. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/benchmark_runs/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BenchmarkRunView, + ) + + def list( + self, + *, + benchmark_id: str | Omit = omit, + limit: int | Omit = omit, + name: str | Omit = omit, + starting_after: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncBenchmarkRunsCursorIDPage[BenchmarkRunView]: + """ + List all BenchmarkRuns matching filter. + + Args: + benchmark_id: The Benchmark ID to filter by. + + limit: The limit of items to return. Default is 20. Max is 5000. + + name: Filter by name + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/benchmark_runs", + page=SyncBenchmarkRunsCursorIDPage[BenchmarkRunView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "benchmark_id": benchmark_id, + "limit": limit, + "name": name, + "starting_after": starting_after, + }, + benchmark_run_list_params.BenchmarkRunListParams, + ), + ), + model=BenchmarkRunView, + ) + + def cancel( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> BenchmarkRunView: + """ + Cancel a currently running Benchmark run. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/benchmark_runs/{id}/cancel", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BenchmarkRunView, + ) + + def complete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> BenchmarkRunView: + """ + Complete a currently running BenchmarkRun. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/benchmark_runs/{id}/complete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BenchmarkRunView, + ) + + def list_scenario_runs( + self, + id: str, + *, + limit: int | Omit = omit, + starting_after: str | Omit = omit, + state: Literal["running", "scoring", "scored", "completed", "canceled", "timeout", "failed"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncBenchmarkRunsCursorIDPage[ScenarioRunView]: + """ + List started scenario runs for a benchmark run. + + Args: + limit: The limit of items to return. Default is 20. Max is 5000. + + starting_after: Load the next page of data starting after the item with the given ID. + + state: Filter by Scenario Run state + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get_api_list( + f"/v1/benchmark_runs/{id}/scenario_runs", + page=SyncBenchmarkRunsCursorIDPage[ScenarioRunView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + "state": state, + }, + benchmark_run_list_scenario_runs_params.BenchmarkRunListScenarioRunsParams, + ), + ), + model=ScenarioRunView, + ) + + +class AsyncBenchmarkRunsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncBenchmarkRunsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncBenchmarkRunsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncBenchmarkRunsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncBenchmarkRunsResourceWithStreamingResponse(self) + + async def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> BenchmarkRunView: + """ + Get a BenchmarkRun given ID. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/benchmark_runs/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BenchmarkRunView, + ) + + def list( + self, + *, + benchmark_id: str | Omit = omit, + limit: int | Omit = omit, + name: str | Omit = omit, + starting_after: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[BenchmarkRunView, AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView]]: + """ + List all BenchmarkRuns matching filter. + + Args: + benchmark_id: The Benchmark ID to filter by. + + limit: The limit of items to return. Default is 20. Max is 5000. + + name: Filter by name + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/benchmark_runs", + page=AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "benchmark_id": benchmark_id, + "limit": limit, + "name": name, + "starting_after": starting_after, + }, + benchmark_run_list_params.BenchmarkRunListParams, + ), + ), + model=BenchmarkRunView, + ) + + async def cancel( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> BenchmarkRunView: + """ + Cancel a currently running Benchmark run. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/benchmark_runs/{id}/cancel", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BenchmarkRunView, + ) + + async def complete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> BenchmarkRunView: + """ + Complete a currently running BenchmarkRun. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/benchmark_runs/{id}/complete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BenchmarkRunView, + ) + + def list_scenario_runs( + self, + id: str, + *, + limit: int | Omit = omit, + starting_after: str | Omit = omit, + state: Literal["running", "scoring", "scored", "completed", "canceled", "timeout", "failed"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[ScenarioRunView, AsyncBenchmarkRunsCursorIDPage[ScenarioRunView]]: + """ + List started scenario runs for a benchmark run. + + Args: + limit: The limit of items to return. Default is 20. Max is 5000. + + starting_after: Load the next page of data starting after the item with the given ID. + + state: Filter by Scenario Run state + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get_api_list( + f"/v1/benchmark_runs/{id}/scenario_runs", + page=AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "starting_after": starting_after, + "state": state, + }, + benchmark_run_list_scenario_runs_params.BenchmarkRunListScenarioRunsParams, + ), + ), + model=ScenarioRunView, + ) + + +class BenchmarkRunsResourceWithRawResponse: + def __init__(self, benchmark_runs: BenchmarkRunsResource) -> None: + self._benchmark_runs = benchmark_runs + + self.retrieve = to_raw_response_wrapper( + benchmark_runs.retrieve, + ) + self.list = to_raw_response_wrapper( + benchmark_runs.list, + ) + self.cancel = to_raw_response_wrapper( + benchmark_runs.cancel, + ) + self.complete = to_raw_response_wrapper( + benchmark_runs.complete, + ) + self.list_scenario_runs = to_raw_response_wrapper( + benchmark_runs.list_scenario_runs, + ) + + +class AsyncBenchmarkRunsResourceWithRawResponse: + def __init__(self, benchmark_runs: AsyncBenchmarkRunsResource) -> None: + self._benchmark_runs = benchmark_runs + + self.retrieve = async_to_raw_response_wrapper( + benchmark_runs.retrieve, + ) + self.list = async_to_raw_response_wrapper( + benchmark_runs.list, + ) + self.cancel = async_to_raw_response_wrapper( + benchmark_runs.cancel, + ) + self.complete = async_to_raw_response_wrapper( + benchmark_runs.complete, + ) + self.list_scenario_runs = async_to_raw_response_wrapper( + benchmark_runs.list_scenario_runs, + ) + + +class BenchmarkRunsResourceWithStreamingResponse: + def __init__(self, benchmark_runs: BenchmarkRunsResource) -> None: + self._benchmark_runs = benchmark_runs + + self.retrieve = to_streamed_response_wrapper( + benchmark_runs.retrieve, + ) + self.list = to_streamed_response_wrapper( + benchmark_runs.list, + ) + self.cancel = to_streamed_response_wrapper( + benchmark_runs.cancel, + ) + self.complete = to_streamed_response_wrapper( + benchmark_runs.complete, + ) + self.list_scenario_runs = to_streamed_response_wrapper( + benchmark_runs.list_scenario_runs, + ) + + +class AsyncBenchmarkRunsResourceWithStreamingResponse: + def __init__(self, benchmark_runs: AsyncBenchmarkRunsResource) -> None: + self._benchmark_runs = benchmark_runs + + self.retrieve = async_to_streamed_response_wrapper( + benchmark_runs.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + benchmark_runs.list, + ) + self.cancel = async_to_streamed_response_wrapper( + benchmark_runs.cancel, + ) + self.complete = async_to_streamed_response_wrapper( + benchmark_runs.complete, + ) + self.list_scenario_runs = async_to_streamed_response_wrapper( + benchmark_runs.list_scenario_runs, + ) diff --git a/src/runloop_api_client/resources/benchmarks/runs.py b/src/runloop_api_client/resources/benchmarks/runs.py index cdab6fd30..fe085ede7 100644 --- a/src/runloop_api_client/resources/benchmarks/runs.py +++ b/src/runloop_api_client/resources/benchmarks/runs.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing_extensions import Literal import httpx @@ -45,6 +46,7 @@ def with_streaming_response(self) -> RunsResourceWithStreamingResponse: """ return RunsResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") def retrieve( self, id: str, @@ -78,6 +80,7 @@ def retrieve( cast_to=BenchmarkRunView, ) + @typing_extensions.deprecated("deprecated") def list( self, *, @@ -133,6 +136,7 @@ def list( model=BenchmarkRunView, ) + @typing_extensions.deprecated("deprecated") def cancel( self, id: str, @@ -173,6 +177,7 @@ def cancel( cast_to=BenchmarkRunView, ) + @typing_extensions.deprecated("deprecated") def complete( self, id: str, @@ -213,6 +218,7 @@ def complete( cast_to=BenchmarkRunView, ) + @typing_extensions.deprecated("deprecated") def list_scenario_runs( self, id: str, @@ -288,6 +294,7 @@ def with_streaming_response(self) -> AsyncRunsResourceWithStreamingResponse: """ return AsyncRunsResourceWithStreamingResponse(self) + @typing_extensions.deprecated("deprecated") async def retrieve( self, id: str, @@ -321,6 +328,7 @@ async def retrieve( cast_to=BenchmarkRunView, ) + @typing_extensions.deprecated("deprecated") def list( self, *, @@ -376,6 +384,7 @@ def list( model=BenchmarkRunView, ) + @typing_extensions.deprecated("deprecated") async def cancel( self, id: str, @@ -416,6 +425,7 @@ async def cancel( cast_to=BenchmarkRunView, ) + @typing_extensions.deprecated("deprecated") async def complete( self, id: str, @@ -456,6 +466,7 @@ async def complete( cast_to=BenchmarkRunView, ) + @typing_extensions.deprecated("deprecated") def list_scenario_runs( self, id: str, @@ -515,20 +526,30 @@ class RunsResourceWithRawResponse: def __init__(self, runs: RunsResource) -> None: self._runs = runs - self.retrieve = to_raw_response_wrapper( - runs.retrieve, + self.retrieve = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + runs.retrieve, # pyright: ignore[reportDeprecated], + ) ) - self.list = to_raw_response_wrapper( - runs.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + runs.list, # pyright: ignore[reportDeprecated], + ) ) - self.cancel = to_raw_response_wrapper( - runs.cancel, + self.cancel = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + runs.cancel, # pyright: ignore[reportDeprecated], + ) ) - self.complete = to_raw_response_wrapper( - runs.complete, + self.complete = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + runs.complete, # pyright: ignore[reportDeprecated], + ) ) - self.list_scenario_runs = to_raw_response_wrapper( - runs.list_scenario_runs, + self.list_scenario_runs = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + runs.list_scenario_runs, # pyright: ignore[reportDeprecated], + ) ) @@ -536,20 +557,30 @@ class AsyncRunsResourceWithRawResponse: def __init__(self, runs: AsyncRunsResource) -> None: self._runs = runs - self.retrieve = async_to_raw_response_wrapper( - runs.retrieve, + self.retrieve = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + runs.retrieve, # pyright: ignore[reportDeprecated], + ) ) - self.list = async_to_raw_response_wrapper( - runs.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + runs.list, # pyright: ignore[reportDeprecated], + ) ) - self.cancel = async_to_raw_response_wrapper( - runs.cancel, + self.cancel = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + runs.cancel, # pyright: ignore[reportDeprecated], + ) ) - self.complete = async_to_raw_response_wrapper( - runs.complete, + self.complete = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + runs.complete, # pyright: ignore[reportDeprecated], + ) ) - self.list_scenario_runs = async_to_raw_response_wrapper( - runs.list_scenario_runs, + self.list_scenario_runs = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + runs.list_scenario_runs, # pyright: ignore[reportDeprecated], + ) ) @@ -557,20 +588,30 @@ class RunsResourceWithStreamingResponse: def __init__(self, runs: RunsResource) -> None: self._runs = runs - self.retrieve = to_streamed_response_wrapper( - runs.retrieve, + self.retrieve = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + runs.retrieve, # pyright: ignore[reportDeprecated], + ) ) - self.list = to_streamed_response_wrapper( - runs.list, + self.list = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + runs.list, # pyright: ignore[reportDeprecated], + ) ) - self.cancel = to_streamed_response_wrapper( - runs.cancel, + self.cancel = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + runs.cancel, # pyright: ignore[reportDeprecated], + ) ) - self.complete = to_streamed_response_wrapper( - runs.complete, + self.complete = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + runs.complete, # pyright: ignore[reportDeprecated], + ) ) - self.list_scenario_runs = to_streamed_response_wrapper( - runs.list_scenario_runs, + self.list_scenario_runs = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + runs.list_scenario_runs, # pyright: ignore[reportDeprecated], + ) ) @@ -578,18 +619,28 @@ class AsyncRunsResourceWithStreamingResponse: def __init__(self, runs: AsyncRunsResource) -> None: self._runs = runs - self.retrieve = async_to_streamed_response_wrapper( - runs.retrieve, + self.retrieve = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + runs.retrieve, # pyright: ignore[reportDeprecated], + ) ) - self.list = async_to_streamed_response_wrapper( - runs.list, + self.list = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + runs.list, # pyright: ignore[reportDeprecated], + ) ) - self.cancel = async_to_streamed_response_wrapper( - runs.cancel, + self.cancel = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + runs.cancel, # pyright: ignore[reportDeprecated], + ) ) - self.complete = async_to_streamed_response_wrapper( - runs.complete, + self.complete = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + runs.complete, # pyright: ignore[reportDeprecated], + ) ) - self.list_scenario_runs = async_to_streamed_response_wrapper( - runs.list_scenario_runs, + self.list_scenario_runs = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + runs.list_scenario_runs, # pyright: ignore[reportDeprecated], + ) ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index d1af9bc1d..f9057658a 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -67,6 +67,7 @@ from .object_download_url_view import ObjectDownloadURLView as ObjectDownloadURLView from .repository_create_params import RepositoryCreateParams as RepositoryCreateParams from .repository_manifest_view import RepositoryManifestView as RepositoryManifestView +from .benchmark_run_list_params import BenchmarkRunListParams as BenchmarkRunListParams from .devbox_send_std_in_result import DevboxSendStdInResult as DevboxSendStdInResult from .devbox_snapshot_list_view import DevboxSnapshotListView as DevboxSnapshotListView from .devbox_upload_file_params import DevboxUploadFileParams as DevboxUploadFileParams @@ -110,6 +111,9 @@ from .devbox_write_file_contents_params import DevboxWriteFileContentsParams as DevboxWriteFileContentsParams from .devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView as DevboxAsyncExecutionDetailView from .devbox_read_file_contents_response import DevboxReadFileContentsResponse as DevboxReadFileContentsResponse +from .benchmark_run_list_scenario_runs_params import ( + BenchmarkRunListScenarioRunsParams as BenchmarkRunListScenarioRunsParams, +) from .blueprint_create_from_inspection_params import ( BlueprintCreateFromInspectionParams as BlueprintCreateFromInspectionParams, ) diff --git a/src/runloop_api_client/types/benchmark_run_list_params.py b/src/runloop_api_client/types/benchmark_run_list_params.py new file mode 100644 index 000000000..28d4e2e87 --- /dev/null +++ b/src/runloop_api_client/types/benchmark_run_list_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["BenchmarkRunListParams"] + + +class BenchmarkRunListParams(TypedDict, total=False): + benchmark_id: str + """The Benchmark ID to filter by.""" + + limit: int + """The limit of items to return. Default is 20. Max is 5000.""" + + name: str + """Filter by name""" + + starting_after: str + """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/benchmark_run_list_scenario_runs_params.py b/src/runloop_api_client/types/benchmark_run_list_scenario_runs_params.py new file mode 100644 index 000000000..c88c09167 --- /dev/null +++ b/src/runloop_api_client/types/benchmark_run_list_scenario_runs_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["BenchmarkRunListScenarioRunsParams"] + + +class BenchmarkRunListScenarioRunsParams(TypedDict, total=False): + limit: int + """The limit of items to return. Default is 20. Max is 5000.""" + + starting_after: str + """Load the next page of data starting after the item with the given ID.""" + + state: Literal["running", "scoring", "scored", "completed", "canceled", "timeout", "failed"] + """Filter by Scenario Run state""" diff --git a/tests/api_resources/benchmarks/test_runs.py b/tests/api_resources/benchmarks/test_runs.py index 9ab74fc9a..a610f1fc4 100644 --- a/tests/api_resources/benchmarks/test_runs.py +++ b/tests/api_resources/benchmarks/test_runs.py @@ -12,6 +12,8 @@ from runloop_api_client.types import ScenarioRunView, BenchmarkRunView from runloop_api_client.pagination import SyncBenchmarkRunsCursorIDPage, AsyncBenchmarkRunsCursorIDPage +# pyright: reportDeprecated=false + base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -20,16 +22,19 @@ class TestRuns: @parametrize def test_method_retrieve(self, client: Runloop) -> None: - run = client.benchmarks.runs.retrieve( - "id", - ) + with pytest.warns(DeprecationWarning): + run = client.benchmarks.runs.retrieve( + "id", + ) + assert_matches_type(BenchmarkRunView, run, path=["response"]) @parametrize def test_raw_response_retrieve(self, client: Runloop) -> None: - response = client.benchmarks.runs.with_raw_response.retrieve( - "id", - ) + with pytest.warns(DeprecationWarning): + response = client.benchmarks.runs.with_raw_response.retrieve( + "id", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -38,42 +43,49 @@ def test_raw_response_retrieve(self, client: Runloop) -> None: @parametrize def test_streaming_response_retrieve(self, client: Runloop) -> None: - with client.benchmarks.runs.with_streaming_response.retrieve( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.benchmarks.runs.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - run = response.parse() - assert_matches_type(BenchmarkRunView, run, path=["response"]) + run = response.parse() + assert_matches_type(BenchmarkRunView, run, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_retrieve(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.benchmarks.runs.with_raw_response.retrieve( - "", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.benchmarks.runs.with_raw_response.retrieve( + "", + ) @parametrize def test_method_list(self, client: Runloop) -> None: - run = client.benchmarks.runs.list() + with pytest.warns(DeprecationWarning): + run = client.benchmarks.runs.list() + assert_matches_type(SyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Runloop) -> None: - run = client.benchmarks.runs.list( - benchmark_id="benchmark_id", - limit=0, - name="name", - starting_after="starting_after", - ) + with pytest.warns(DeprecationWarning): + run = client.benchmarks.runs.list( + benchmark_id="benchmark_id", + limit=0, + name="name", + starting_after="starting_after", + ) + assert_matches_type(SyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) @parametrize def test_raw_response_list(self, client: Runloop) -> None: - response = client.benchmarks.runs.with_raw_response.list() + with pytest.warns(DeprecationWarning): + response = client.benchmarks.runs.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -82,27 +94,31 @@ def test_raw_response_list(self, client: Runloop) -> None: @parametrize def test_streaming_response_list(self, client: Runloop) -> None: - with client.benchmarks.runs.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.benchmarks.runs.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - run = response.parse() - assert_matches_type(SyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) + run = response.parse() + assert_matches_type(SyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_method_cancel(self, client: Runloop) -> None: - run = client.benchmarks.runs.cancel( - "id", - ) + with pytest.warns(DeprecationWarning): + run = client.benchmarks.runs.cancel( + "id", + ) + assert_matches_type(BenchmarkRunView, run, path=["response"]) @parametrize def test_raw_response_cancel(self, client: Runloop) -> None: - response = client.benchmarks.runs.with_raw_response.cancel( - "id", - ) + with pytest.warns(DeprecationWarning): + response = client.benchmarks.runs.with_raw_response.cancel( + "id", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -111,36 +127,41 @@ def test_raw_response_cancel(self, client: Runloop) -> None: @parametrize def test_streaming_response_cancel(self, client: Runloop) -> None: - with client.benchmarks.runs.with_streaming_response.cancel( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.benchmarks.runs.with_streaming_response.cancel( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - run = response.parse() - assert_matches_type(BenchmarkRunView, run, path=["response"]) + run = response.parse() + assert_matches_type(BenchmarkRunView, run, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_cancel(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.benchmarks.runs.with_raw_response.cancel( - "", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.benchmarks.runs.with_raw_response.cancel( + "", + ) @parametrize def test_method_complete(self, client: Runloop) -> None: - run = client.benchmarks.runs.complete( - "id", - ) + with pytest.warns(DeprecationWarning): + run = client.benchmarks.runs.complete( + "id", + ) + assert_matches_type(BenchmarkRunView, run, path=["response"]) @parametrize def test_raw_response_complete(self, client: Runloop) -> None: - response = client.benchmarks.runs.with_raw_response.complete( - "id", - ) + with pytest.warns(DeprecationWarning): + response = client.benchmarks.runs.with_raw_response.complete( + "id", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -149,46 +170,53 @@ def test_raw_response_complete(self, client: Runloop) -> None: @parametrize def test_streaming_response_complete(self, client: Runloop) -> None: - with client.benchmarks.runs.with_streaming_response.complete( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.benchmarks.runs.with_streaming_response.complete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - run = response.parse() - assert_matches_type(BenchmarkRunView, run, path=["response"]) + run = response.parse() + assert_matches_type(BenchmarkRunView, run, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_complete(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.benchmarks.runs.with_raw_response.complete( - "", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.benchmarks.runs.with_raw_response.complete( + "", + ) @parametrize def test_method_list_scenario_runs(self, client: Runloop) -> None: - run = client.benchmarks.runs.list_scenario_runs( - id="id", - ) + with pytest.warns(DeprecationWarning): + run = client.benchmarks.runs.list_scenario_runs( + id="id", + ) + assert_matches_type(SyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) @parametrize def test_method_list_scenario_runs_with_all_params(self, client: Runloop) -> None: - run = client.benchmarks.runs.list_scenario_runs( - id="id", - limit=0, - starting_after="starting_after", - state="running", - ) + with pytest.warns(DeprecationWarning): + run = client.benchmarks.runs.list_scenario_runs( + id="id", + limit=0, + starting_after="starting_after", + state="running", + ) + assert_matches_type(SyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) @parametrize def test_raw_response_list_scenario_runs(self, client: Runloop) -> None: - response = client.benchmarks.runs.with_raw_response.list_scenario_runs( - id="id", - ) + with pytest.warns(DeprecationWarning): + response = client.benchmarks.runs.with_raw_response.list_scenario_runs( + id="id", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -197,23 +225,25 @@ def test_raw_response_list_scenario_runs(self, client: Runloop) -> None: @parametrize def test_streaming_response_list_scenario_runs(self, client: Runloop) -> None: - with client.benchmarks.runs.with_streaming_response.list_scenario_runs( - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.benchmarks.runs.with_streaming_response.list_scenario_runs( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - run = response.parse() - assert_matches_type(SyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) + run = response.parse() + assert_matches_type(SyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_list_scenario_runs(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.benchmarks.runs.with_raw_response.list_scenario_runs( - id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.benchmarks.runs.with_raw_response.list_scenario_runs( + id="", + ) class TestAsyncRuns: @@ -223,16 +253,19 @@ class TestAsyncRuns: @parametrize async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: - run = await async_client.benchmarks.runs.retrieve( - "id", - ) + with pytest.warns(DeprecationWarning): + run = await async_client.benchmarks.runs.retrieve( + "id", + ) + assert_matches_type(BenchmarkRunView, run, path=["response"]) @parametrize async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: - response = await async_client.benchmarks.runs.with_raw_response.retrieve( - "id", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.benchmarks.runs.with_raw_response.retrieve( + "id", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -241,42 +274,49 @@ async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: - async with async_client.benchmarks.runs.with_streaming_response.retrieve( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.benchmarks.runs.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - run = await response.parse() - assert_matches_type(BenchmarkRunView, run, path=["response"]) + run = await response.parse() + assert_matches_type(BenchmarkRunView, run, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.benchmarks.runs.with_raw_response.retrieve( - "", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.benchmarks.runs.with_raw_response.retrieve( + "", + ) @parametrize async def test_method_list(self, async_client: AsyncRunloop) -> None: - run = await async_client.benchmarks.runs.list() + with pytest.warns(DeprecationWarning): + run = await async_client.benchmarks.runs.list() + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: - run = await async_client.benchmarks.runs.list( - benchmark_id="benchmark_id", - limit=0, - name="name", - starting_after="starting_after", - ) + with pytest.warns(DeprecationWarning): + run = await async_client.benchmarks.runs.list( + benchmark_id="benchmark_id", + limit=0, + name="name", + starting_after="starting_after", + ) + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: - response = await async_client.benchmarks.runs.with_raw_response.list() + with pytest.warns(DeprecationWarning): + response = await async_client.benchmarks.runs.with_raw_response.list() assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -285,27 +325,31 @@ async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: - async with async_client.benchmarks.runs.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.benchmarks.runs.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - run = await response.parse() - assert_matches_type(AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) + run = await response.parse() + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_method_cancel(self, async_client: AsyncRunloop) -> None: - run = await async_client.benchmarks.runs.cancel( - "id", - ) + with pytest.warns(DeprecationWarning): + run = await async_client.benchmarks.runs.cancel( + "id", + ) + assert_matches_type(BenchmarkRunView, run, path=["response"]) @parametrize async def test_raw_response_cancel(self, async_client: AsyncRunloop) -> None: - response = await async_client.benchmarks.runs.with_raw_response.cancel( - "id", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.benchmarks.runs.with_raw_response.cancel( + "id", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -314,36 +358,41 @@ async def test_raw_response_cancel(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_cancel(self, async_client: AsyncRunloop) -> None: - async with async_client.benchmarks.runs.with_streaming_response.cancel( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.benchmarks.runs.with_streaming_response.cancel( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - run = await response.parse() - assert_matches_type(BenchmarkRunView, run, path=["response"]) + run = await response.parse() + assert_matches_type(BenchmarkRunView, run, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_cancel(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.benchmarks.runs.with_raw_response.cancel( - "", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.benchmarks.runs.with_raw_response.cancel( + "", + ) @parametrize async def test_method_complete(self, async_client: AsyncRunloop) -> None: - run = await async_client.benchmarks.runs.complete( - "id", - ) + with pytest.warns(DeprecationWarning): + run = await async_client.benchmarks.runs.complete( + "id", + ) + assert_matches_type(BenchmarkRunView, run, path=["response"]) @parametrize async def test_raw_response_complete(self, async_client: AsyncRunloop) -> None: - response = await async_client.benchmarks.runs.with_raw_response.complete( - "id", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.benchmarks.runs.with_raw_response.complete( + "id", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -352,46 +401,53 @@ async def test_raw_response_complete(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_complete(self, async_client: AsyncRunloop) -> None: - async with async_client.benchmarks.runs.with_streaming_response.complete( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.benchmarks.runs.with_streaming_response.complete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - run = await response.parse() - assert_matches_type(BenchmarkRunView, run, path=["response"]) + run = await response.parse() + assert_matches_type(BenchmarkRunView, run, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_complete(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.benchmarks.runs.with_raw_response.complete( - "", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.benchmarks.runs.with_raw_response.complete( + "", + ) @parametrize async def test_method_list_scenario_runs(self, async_client: AsyncRunloop) -> None: - run = await async_client.benchmarks.runs.list_scenario_runs( - id="id", - ) + with pytest.warns(DeprecationWarning): + run = await async_client.benchmarks.runs.list_scenario_runs( + id="id", + ) + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) @parametrize async def test_method_list_scenario_runs_with_all_params(self, async_client: AsyncRunloop) -> None: - run = await async_client.benchmarks.runs.list_scenario_runs( - id="id", - limit=0, - starting_after="starting_after", - state="running", - ) + with pytest.warns(DeprecationWarning): + run = await async_client.benchmarks.runs.list_scenario_runs( + id="id", + limit=0, + starting_after="starting_after", + state="running", + ) + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) @parametrize async def test_raw_response_list_scenario_runs(self, async_client: AsyncRunloop) -> None: - response = await async_client.benchmarks.runs.with_raw_response.list_scenario_runs( - id="id", - ) + with pytest.warns(DeprecationWarning): + response = await async_client.benchmarks.runs.with_raw_response.list_scenario_runs( + id="id", + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -400,20 +456,22 @@ async def test_raw_response_list_scenario_runs(self, async_client: AsyncRunloop) @parametrize async def test_streaming_response_list_scenario_runs(self, async_client: AsyncRunloop) -> None: - async with async_client.benchmarks.runs.with_streaming_response.list_scenario_runs( - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.benchmarks.runs.with_streaming_response.list_scenario_runs( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - run = await response.parse() - assert_matches_type(AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) + run = await response.parse() + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_list_scenario_runs(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.benchmarks.runs.with_raw_response.list_scenario_runs( - id="", - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.benchmarks.runs.with_raw_response.list_scenario_runs( + id="", + ) diff --git a/tests/api_resources/test_benchmark_runs.py b/tests/api_resources/test_benchmark_runs.py new file mode 100644 index 000000000..854a44574 --- /dev/null +++ b/tests/api_resources/test_benchmark_runs.py @@ -0,0 +1,422 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types import ( + ScenarioRunView, + BenchmarkRunView, +) +from runloop_api_client.pagination import SyncBenchmarkRunsCursorIDPage, AsyncBenchmarkRunsCursorIDPage + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestBenchmarkRuns: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + benchmark_run = client.benchmark_runs.retrieve( + "id", + ) + assert_matches_type(BenchmarkRunView, benchmark_run, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.benchmark_runs.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark_run = response.parse() + assert_matches_type(BenchmarkRunView, benchmark_run, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.benchmark_runs.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark_run = response.parse() + assert_matches_type(BenchmarkRunView, benchmark_run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.benchmark_runs.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + benchmark_run = client.benchmark_runs.list() + assert_matches_type(SyncBenchmarkRunsCursorIDPage[BenchmarkRunView], benchmark_run, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + benchmark_run = client.benchmark_runs.list( + benchmark_id="benchmark_id", + limit=0, + name="name", + starting_after="starting_after", + ) + assert_matches_type(SyncBenchmarkRunsCursorIDPage[BenchmarkRunView], benchmark_run, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.benchmark_runs.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark_run = response.parse() + assert_matches_type(SyncBenchmarkRunsCursorIDPage[BenchmarkRunView], benchmark_run, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.benchmark_runs.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark_run = response.parse() + assert_matches_type(SyncBenchmarkRunsCursorIDPage[BenchmarkRunView], benchmark_run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_cancel(self, client: Runloop) -> None: + benchmark_run = client.benchmark_runs.cancel( + "id", + ) + assert_matches_type(BenchmarkRunView, benchmark_run, path=["response"]) + + @parametrize + def test_raw_response_cancel(self, client: Runloop) -> None: + response = client.benchmark_runs.with_raw_response.cancel( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark_run = response.parse() + assert_matches_type(BenchmarkRunView, benchmark_run, path=["response"]) + + @parametrize + def test_streaming_response_cancel(self, client: Runloop) -> None: + with client.benchmark_runs.with_streaming_response.cancel( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark_run = response.parse() + assert_matches_type(BenchmarkRunView, benchmark_run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_cancel(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.benchmark_runs.with_raw_response.cancel( + "", + ) + + @parametrize + def test_method_complete(self, client: Runloop) -> None: + benchmark_run = client.benchmark_runs.complete( + "id", + ) + assert_matches_type(BenchmarkRunView, benchmark_run, path=["response"]) + + @parametrize + def test_raw_response_complete(self, client: Runloop) -> None: + response = client.benchmark_runs.with_raw_response.complete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark_run = response.parse() + assert_matches_type(BenchmarkRunView, benchmark_run, path=["response"]) + + @parametrize + def test_streaming_response_complete(self, client: Runloop) -> None: + with client.benchmark_runs.with_streaming_response.complete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark_run = response.parse() + assert_matches_type(BenchmarkRunView, benchmark_run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_complete(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.benchmark_runs.with_raw_response.complete( + "", + ) + + @parametrize + def test_method_list_scenario_runs(self, client: Runloop) -> None: + benchmark_run = client.benchmark_runs.list_scenario_runs( + id="id", + ) + assert_matches_type(SyncBenchmarkRunsCursorIDPage[ScenarioRunView], benchmark_run, path=["response"]) + + @parametrize + def test_method_list_scenario_runs_with_all_params(self, client: Runloop) -> None: + benchmark_run = client.benchmark_runs.list_scenario_runs( + id="id", + limit=0, + starting_after="starting_after", + state="running", + ) + assert_matches_type(SyncBenchmarkRunsCursorIDPage[ScenarioRunView], benchmark_run, path=["response"]) + + @parametrize + def test_raw_response_list_scenario_runs(self, client: Runloop) -> None: + response = client.benchmark_runs.with_raw_response.list_scenario_runs( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark_run = response.parse() + assert_matches_type(SyncBenchmarkRunsCursorIDPage[ScenarioRunView], benchmark_run, path=["response"]) + + @parametrize + def test_streaming_response_list_scenario_runs(self, client: Runloop) -> None: + with client.benchmark_runs.with_streaming_response.list_scenario_runs( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark_run = response.parse() + assert_matches_type(SyncBenchmarkRunsCursorIDPage[ScenarioRunView], benchmark_run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list_scenario_runs(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.benchmark_runs.with_raw_response.list_scenario_runs( + id="", + ) + + +class TestAsyncBenchmarkRuns: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + benchmark_run = await async_client.benchmark_runs.retrieve( + "id", + ) + assert_matches_type(BenchmarkRunView, benchmark_run, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.benchmark_runs.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark_run = await response.parse() + assert_matches_type(BenchmarkRunView, benchmark_run, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.benchmark_runs.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark_run = await response.parse() + assert_matches_type(BenchmarkRunView, benchmark_run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.benchmark_runs.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + benchmark_run = await async_client.benchmark_runs.list() + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView], benchmark_run, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + benchmark_run = await async_client.benchmark_runs.list( + benchmark_id="benchmark_id", + limit=0, + name="name", + starting_after="starting_after", + ) + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView], benchmark_run, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.benchmark_runs.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark_run = await response.parse() + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView], benchmark_run, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.benchmark_runs.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark_run = await response.parse() + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView], benchmark_run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_cancel(self, async_client: AsyncRunloop) -> None: + benchmark_run = await async_client.benchmark_runs.cancel( + "id", + ) + assert_matches_type(BenchmarkRunView, benchmark_run, path=["response"]) + + @parametrize + async def test_raw_response_cancel(self, async_client: AsyncRunloop) -> None: + response = await async_client.benchmark_runs.with_raw_response.cancel( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark_run = await response.parse() + assert_matches_type(BenchmarkRunView, benchmark_run, path=["response"]) + + @parametrize + async def test_streaming_response_cancel(self, async_client: AsyncRunloop) -> None: + async with async_client.benchmark_runs.with_streaming_response.cancel( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark_run = await response.parse() + assert_matches_type(BenchmarkRunView, benchmark_run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_cancel(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.benchmark_runs.with_raw_response.cancel( + "", + ) + + @parametrize + async def test_method_complete(self, async_client: AsyncRunloop) -> None: + benchmark_run = await async_client.benchmark_runs.complete( + "id", + ) + assert_matches_type(BenchmarkRunView, benchmark_run, path=["response"]) + + @parametrize + async def test_raw_response_complete(self, async_client: AsyncRunloop) -> None: + response = await async_client.benchmark_runs.with_raw_response.complete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark_run = await response.parse() + assert_matches_type(BenchmarkRunView, benchmark_run, path=["response"]) + + @parametrize + async def test_streaming_response_complete(self, async_client: AsyncRunloop) -> None: + async with async_client.benchmark_runs.with_streaming_response.complete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark_run = await response.parse() + assert_matches_type(BenchmarkRunView, benchmark_run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_complete(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.benchmark_runs.with_raw_response.complete( + "", + ) + + @parametrize + async def test_method_list_scenario_runs(self, async_client: AsyncRunloop) -> None: + benchmark_run = await async_client.benchmark_runs.list_scenario_runs( + id="id", + ) + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], benchmark_run, path=["response"]) + + @parametrize + async def test_method_list_scenario_runs_with_all_params(self, async_client: AsyncRunloop) -> None: + benchmark_run = await async_client.benchmark_runs.list_scenario_runs( + id="id", + limit=0, + starting_after="starting_after", + state="running", + ) + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], benchmark_run, path=["response"]) + + @parametrize + async def test_raw_response_list_scenario_runs(self, async_client: AsyncRunloop) -> None: + response = await async_client.benchmark_runs.with_raw_response.list_scenario_runs( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark_run = await response.parse() + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], benchmark_run, path=["response"]) + + @parametrize + async def test_streaming_response_list_scenario_runs(self, async_client: AsyncRunloop) -> None: + async with async_client.benchmark_runs.with_streaming_response.list_scenario_runs( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark_run = await response.parse() + assert_matches_type(AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], benchmark_run, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list_scenario_runs(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.benchmark_runs.with_raw_response.list_scenario_runs( + id="", + ) From 3387eb73994c0b185669c128408e5975bcd8c520 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 20 Jan 2026 20:10:05 +0000 Subject: [PATCH 942/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- README.md | 4 ++-- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d0ab6645f..4e205789d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.2.0" + ".": "1.3.0-alpha" } \ No newline at end of file diff --git a/README.md b/README.md index a7b0db561..09e9dfe5f 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ The REST API documentation can be found on [runloop.ai](https://runloop.ai). The ```sh # install from PyPI -pip install runloop_api_client +pip install '--pre runloop_api_client' ``` ## Usage @@ -73,7 +73,7 @@ You can enable this by installing `aiohttp`: ```sh # install from PyPI -pip install runloop_api_client[aiohttp] +pip install '--pre runloop_api_client[aiohttp]' ``` Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: diff --git a/pyproject.toml b/pyproject.toml index 72bca17cd..7292c3fd4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "1.2.0" +version = "1.3.0-alpha" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index e13ec2fd5..ad6d43f7c 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "1.2.0" # x-release-please-version +__version__ = "1.3.0-alpha" # x-release-please-version diff --git a/uv.lock b/uv.lock index acc8995ab..006d5702e 100644 --- a/uv.lock +++ b/uv.lock @@ -1321,7 +1321,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "1.2.0" +version = "1.3.0a0" source = { editable = "." } dependencies = [ { name = "anyio" }, From b7bcc7d1af480e48c849041a507af2c2e081a574 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 21 Jan 2026 21:50:24 +0000 Subject: [PATCH 943/993] chore: update network policy create params descriptions (#7069) --- .stats.yml | 4 ++-- .../resources/network_policies.py | 20 +++++++++++-------- .../types/network_policy_create_params.py | 14 ++++++++----- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/.stats.yml b/.stats.yml index 553c2ca6f..6464e357e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 108 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e583f34fdcdc18499c8692e8eb8021f6163201f0f77206934c712c319a674d43.yml -openapi_spec_hash: f2fb3f7f5c1f62d3dc397cd02cd1007a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-5359067a857aa94f69bae0d3311856be3e637da067fdc9dbf8bd26fe476efbd8.yml +openapi_spec_hash: 5227ef7c306d5226c3aee8932b2e8c6a config_hash: 42959fa2708796cc2f83937278dde733 diff --git a/src/runloop_api_client/resources/network_policies.py b/src/runloop_api_client/resources/network_policies.py index 5b96bf4b2..1cda5b42d 100644 --- a/src/runloop_api_client/resources/network_policies.py +++ b/src/runloop_api_client/resources/network_policies.py @@ -69,12 +69,14 @@ def create( name: The human-readable name for the NetworkPolicy. Must be unique within the account. - allow_all: If true, all egress traffic is allowed (ALLOW_ALL policy). Defaults to false. - - allow_devbox_to_devbox: If true, allows traffic between the account's own devboxes via tunnels. Defaults + allow_all: (Optional) If true, all egress traffic is allowed (ALLOW_ALL policy). Defaults to false. - allowed_hostnames: DNS-based allow list with wildcard support. Examples: ['github.com', + allow_devbox_to_devbox: (Optional) If true, allows traffic between the account's own devboxes via + tunnels. Defaults to false. If allow_all is true, this is automatically set to + true. + + allowed_hostnames: (Optional) DNS-based allow list with wildcard support. Examples: ['github.com', '*.npmjs.org']. description: Optional description for the NetworkPolicy. @@ -353,12 +355,14 @@ async def create( name: The human-readable name for the NetworkPolicy. Must be unique within the account. - allow_all: If true, all egress traffic is allowed (ALLOW_ALL policy). Defaults to false. - - allow_devbox_to_devbox: If true, allows traffic between the account's own devboxes via tunnels. Defaults + allow_all: (Optional) If true, all egress traffic is allowed (ALLOW_ALL policy). Defaults to false. - allowed_hostnames: DNS-based allow list with wildcard support. Examples: ['github.com', + allow_devbox_to_devbox: (Optional) If true, allows traffic between the account's own devboxes via + tunnels. Defaults to false. If allow_all is true, this is automatically set to + true. + + allowed_hostnames: (Optional) DNS-based allow list with wildcard support. Examples: ['github.com', '*.npmjs.org']. description: Optional description for the NetworkPolicy. diff --git a/src/runloop_api_client/types/network_policy_create_params.py b/src/runloop_api_client/types/network_policy_create_params.py index b70c6c8f9..e1a718a48 100644 --- a/src/runloop_api_client/types/network_policy_create_params.py +++ b/src/runloop_api_client/types/network_policy_create_params.py @@ -18,16 +18,20 @@ class NetworkPolicyCreateParams(TypedDict, total=False): """ allow_all: Optional[bool] - """If true, all egress traffic is allowed (ALLOW_ALL policy). Defaults to false.""" - - allow_devbox_to_devbox: Optional[bool] - """If true, allows traffic between the account's own devboxes via tunnels. + """(Optional) If true, all egress traffic is allowed (ALLOW_ALL policy). Defaults to false. """ + allow_devbox_to_devbox: Optional[bool] + """ + (Optional) If true, allows traffic between the account's own devboxes via + tunnels. Defaults to false. If allow_all is true, this is automatically set to + true. + """ + allowed_hostnames: Optional[SequenceNotStr[str]] - """DNS-based allow list with wildcard support. + """(Optional) DNS-based allow list with wildcard support. Examples: ['github.com', '*.npmjs.org']. """ From 6b49c71c164cf9c28a2a9cfef58b433b1d7bdb75 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 22 Jan 2026 00:06:02 +0000 Subject: [PATCH 944/993] chore: fix stainless spec / remove deprecated benchmark/runs (#7074) --- .stats.yml | 4 +- api.md | 30 +- src/runloop_api_client/_client.py | 2 +- .../resources/{benchmarks => }/benchmarks.py | 56 +- .../resources/benchmarks/__init__.py | 33 - .../resources/benchmarks/runs.py | 646 ------------------ .../types/benchmarks/__init__.py | 6 - .../types/benchmarks/run_list_params.py | 21 - .../run_list_scenario_runs_params.py | 18 - tests/api_resources/benchmarks/__init__.py | 1 - tests/api_resources/benchmarks/test_runs.py | 477 ------------- 11 files changed, 24 insertions(+), 1270 deletions(-) rename src/runloop_api_client/resources/{benchmarks => }/benchmarks.py (96%) delete mode 100644 src/runloop_api_client/resources/benchmarks/__init__.py delete mode 100644 src/runloop_api_client/resources/benchmarks/runs.py delete mode 100644 src/runloop_api_client/types/benchmarks/__init__.py delete mode 100644 src/runloop_api_client/types/benchmarks/run_list_params.py delete mode 100644 src/runloop_api_client/types/benchmarks/run_list_scenario_runs_params.py delete mode 100644 tests/api_resources/benchmarks/__init__.py delete mode 100644 tests/api_resources/benchmarks/test_runs.py diff --git a/.stats.yml b/.stats.yml index 6464e357e..5eb10a624 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 108 +configured_endpoints: 103 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-5359067a857aa94f69bae0d3311856be3e637da067fdc9dbf8bd26fe476efbd8.yml openapi_spec_hash: 5227ef7c306d5226c3aee8932b2e8c6a -config_hash: 42959fa2708796cc2f83937278dde733 +config_hash: cb43d4ca9e64d5a099199d6818d70539 diff --git a/api.md b/api.md index 2ab0075eb..3c4a48d0f 100644 --- a/api.md +++ b/api.md @@ -20,8 +20,6 @@ Types: ```python from runloop_api_client.types import ( BenchmarkCreateParameters, - BenchmarkRunListView, - BenchmarkRunView, BenchmarkScenarioUpdateParameters, BenchmarkUpdateParameters, BenchmarkView, @@ -32,31 +30,21 @@ from runloop_api_client.types import ( Methods: -- client.benchmarks.create(\*\*params) -> BenchmarkView -- client.benchmarks.retrieve(id) -> BenchmarkView -- client.benchmarks.update(id, \*\*params) -> BenchmarkView -- client.benchmarks.list(\*\*params) -> SyncBenchmarksCursorIDPage[BenchmarkView] -- client.benchmarks.definitions(id, \*\*params) -> ScenarioDefinitionListView -- client.benchmarks.list_public(\*\*params) -> SyncBenchmarksCursorIDPage[BenchmarkView] -- client.benchmarks.start_run(\*\*params) -> BenchmarkRunView -- client.benchmarks.update_scenarios(id, \*\*params) -> BenchmarkView - -## Runs - -Methods: - -- client.benchmarks.runs.retrieve(id) -> BenchmarkRunView -- client.benchmarks.runs.list(\*\*params) -> SyncBenchmarkRunsCursorIDPage[BenchmarkRunView] -- client.benchmarks.runs.cancel(id) -> BenchmarkRunView -- client.benchmarks.runs.complete(id) -> BenchmarkRunView -- client.benchmarks.runs.list_scenario_runs(id, \*\*params) -> SyncBenchmarkRunsCursorIDPage[ScenarioRunView] +- client.benchmarks.create(\*\*params) -> BenchmarkView +- client.benchmarks.retrieve(id) -> BenchmarkView +- client.benchmarks.update(id, \*\*params) -> BenchmarkView +- client.benchmarks.list(\*\*params) -> SyncBenchmarksCursorIDPage[BenchmarkView] +- client.benchmarks.definitions(id, \*\*params) -> ScenarioDefinitionListView +- client.benchmarks.list_public(\*\*params) -> SyncBenchmarksCursorIDPage[BenchmarkView] +- client.benchmarks.start_run(\*\*params) -> BenchmarkRunView +- client.benchmarks.update_scenarios(id, \*\*params) -> BenchmarkView # BenchmarkRuns Types: ```python -from runloop_api_client.types import BenchmarkRunListView, BenchmarkRunView, ScenarioRunListView +from runloop_api_client.types import BenchmarkRunListView, BenchmarkRunView ``` Methods: diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index 603a43dc2..557170af6 100644 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -46,13 +46,13 @@ from .resources.agents import AgentsResource, AsyncAgentsResource from .resources.objects import ObjectsResource, AsyncObjectsResource from .resources.secrets import SecretsResource, AsyncSecretsResource + from .resources.benchmarks import BenchmarksResource, AsyncBenchmarksResource from .resources.blueprints import BlueprintsResource, AsyncBlueprintsResource from .resources.repositories import RepositoriesResource, AsyncRepositoriesResource from .resources.benchmark_runs import BenchmarkRunsResource, AsyncBenchmarkRunsResource from .resources.network_policies import NetworkPoliciesResource, AsyncNetworkPoliciesResource from .resources.devboxes.devboxes import DevboxesResource, AsyncDevboxesResource from .resources.scenarios.scenarios import ScenariosResource, AsyncScenariosResource - from .resources.benchmarks.benchmarks import BenchmarksResource, AsyncBenchmarksResource __all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Runloop", "AsyncRunloop", "Client", "AsyncClient"] diff --git a/src/runloop_api_client/resources/benchmarks/benchmarks.py b/src/runloop_api_client/resources/benchmarks.py similarity index 96% rename from src/runloop_api_client/resources/benchmarks/benchmarks.py rename to src/runloop_api_client/resources/benchmarks.py index 9d9a30b5d..d23992bd2 100644 --- a/src/runloop_api_client/resources/benchmarks/benchmarks.py +++ b/src/runloop_api_client/resources/benchmarks.py @@ -6,15 +6,7 @@ import httpx -from .runs import ( - RunsResource, - AsyncRunsResource, - RunsResourceWithRawResponse, - AsyncRunsResourceWithRawResponse, - RunsResourceWithStreamingResponse, - AsyncRunsResourceWithStreamingResponse, -) -from ...types import ( +from ..types import ( benchmark_list_params, benchmark_create_params, benchmark_update_params, @@ -23,31 +15,27 @@ benchmark_list_public_params, benchmark_update_scenarios_params, ) -from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( +from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given +from .._utils import maybe_transform, async_maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...pagination import SyncBenchmarksCursorIDPage, AsyncBenchmarksCursorIDPage -from ..._base_client import AsyncPaginator, make_request_options -from ...types.benchmark_view import BenchmarkView -from ...types.benchmark_run_view import BenchmarkRunView -from ...types.shared_params.run_profile import RunProfile -from ...types.scenario_definition_list_view import ScenarioDefinitionListView +from ..pagination import SyncBenchmarksCursorIDPage, AsyncBenchmarksCursorIDPage +from .._base_client import AsyncPaginator, make_request_options +from ..types.benchmark_view import BenchmarkView +from ..types.benchmark_run_view import BenchmarkRunView +from ..types.shared_params.run_profile import RunProfile +from ..types.scenario_definition_list_view import ScenarioDefinitionListView __all__ = ["BenchmarksResource", "AsyncBenchmarksResource"] class BenchmarksResource(SyncAPIResource): - @cached_property - def runs(self) -> RunsResource: - return RunsResource(self._client) - @cached_property def with_raw_response(self) -> BenchmarksResourceWithRawResponse: """ @@ -513,10 +501,6 @@ def update_scenarios( class AsyncBenchmarksResource(AsyncAPIResource): - @cached_property - def runs(self) -> AsyncRunsResource: - return AsyncRunsResource(self._client) - @cached_property def with_raw_response(self) -> AsyncBenchmarksResourceWithRawResponse: """ @@ -1010,10 +994,6 @@ def __init__(self, benchmarks: BenchmarksResource) -> None: benchmarks.update_scenarios, ) - @cached_property - def runs(self) -> RunsResourceWithRawResponse: - return RunsResourceWithRawResponse(self._benchmarks.runs) - class AsyncBenchmarksResourceWithRawResponse: def __init__(self, benchmarks: AsyncBenchmarksResource) -> None: @@ -1044,10 +1024,6 @@ def __init__(self, benchmarks: AsyncBenchmarksResource) -> None: benchmarks.update_scenarios, ) - @cached_property - def runs(self) -> AsyncRunsResourceWithRawResponse: - return AsyncRunsResourceWithRawResponse(self._benchmarks.runs) - class BenchmarksResourceWithStreamingResponse: def __init__(self, benchmarks: BenchmarksResource) -> None: @@ -1078,10 +1054,6 @@ def __init__(self, benchmarks: BenchmarksResource) -> None: benchmarks.update_scenarios, ) - @cached_property - def runs(self) -> RunsResourceWithStreamingResponse: - return RunsResourceWithStreamingResponse(self._benchmarks.runs) - class AsyncBenchmarksResourceWithStreamingResponse: def __init__(self, benchmarks: AsyncBenchmarksResource) -> None: @@ -1111,7 +1083,3 @@ def __init__(self, benchmarks: AsyncBenchmarksResource) -> None: self.update_scenarios = async_to_streamed_response_wrapper( benchmarks.update_scenarios, ) - - @cached_property - def runs(self) -> AsyncRunsResourceWithStreamingResponse: - return AsyncRunsResourceWithStreamingResponse(self._benchmarks.runs) diff --git a/src/runloop_api_client/resources/benchmarks/__init__.py b/src/runloop_api_client/resources/benchmarks/__init__.py deleted file mode 100644 index f34bcd900..000000000 --- a/src/runloop_api_client/resources/benchmarks/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .runs import ( - RunsResource, - AsyncRunsResource, - RunsResourceWithRawResponse, - AsyncRunsResourceWithRawResponse, - RunsResourceWithStreamingResponse, - AsyncRunsResourceWithStreamingResponse, -) -from .benchmarks import ( - BenchmarksResource, - AsyncBenchmarksResource, - BenchmarksResourceWithRawResponse, - AsyncBenchmarksResourceWithRawResponse, - BenchmarksResourceWithStreamingResponse, - AsyncBenchmarksResourceWithStreamingResponse, -) - -__all__ = [ - "RunsResource", - "AsyncRunsResource", - "RunsResourceWithRawResponse", - "AsyncRunsResourceWithRawResponse", - "RunsResourceWithStreamingResponse", - "AsyncRunsResourceWithStreamingResponse", - "BenchmarksResource", - "AsyncBenchmarksResource", - "BenchmarksResourceWithRawResponse", - "AsyncBenchmarksResourceWithRawResponse", - "BenchmarksResourceWithStreamingResponse", - "AsyncBenchmarksResourceWithStreamingResponse", -] diff --git a/src/runloop_api_client/resources/benchmarks/runs.py b/src/runloop_api_client/resources/benchmarks/runs.py deleted file mode 100644 index fe085ede7..000000000 --- a/src/runloop_api_client/resources/benchmarks/runs.py +++ /dev/null @@ -1,646 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import typing_extensions -from typing_extensions import Literal - -import httpx - -from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import maybe_transform -from ..._compat import cached_property -from ..._resource import SyncAPIResource, AsyncAPIResource -from ..._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ...pagination import SyncBenchmarkRunsCursorIDPage, AsyncBenchmarkRunsCursorIDPage -from ..._base_client import AsyncPaginator, make_request_options -from ...types.benchmarks import run_list_params, run_list_scenario_runs_params -from ...types.scenario_run_view import ScenarioRunView -from ...types.benchmark_run_view import BenchmarkRunView - -__all__ = ["RunsResource", "AsyncRunsResource"] - - -class RunsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> RunsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return RunsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> RunsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return RunsResourceWithStreamingResponse(self) - - @typing_extensions.deprecated("deprecated") - def retrieve( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> BenchmarkRunView: - """ - Get a BenchmarkRun given ID. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get( - f"/v1/benchmarks/runs/{id}", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=BenchmarkRunView, - ) - - @typing_extensions.deprecated("deprecated") - def list( - self, - *, - benchmark_id: str | Omit = omit, - limit: int | Omit = omit, - name: str | Omit = omit, - starting_after: str | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> SyncBenchmarkRunsCursorIDPage[BenchmarkRunView]: - """ - List all BenchmarkRuns matching filter. - - Args: - benchmark_id: The Benchmark ID to filter by. - - limit: The limit of items to return. Default is 20. Max is 5000. - - name: Filter by name - - starting_after: Load the next page of data starting after the item with the given ID. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get_api_list( - "/v1/benchmarks/runs", - page=SyncBenchmarkRunsCursorIDPage[BenchmarkRunView], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "benchmark_id": benchmark_id, - "limit": limit, - "name": name, - "starting_after": starting_after, - }, - run_list_params.RunListParams, - ), - ), - model=BenchmarkRunView, - ) - - @typing_extensions.deprecated("deprecated") - def cancel( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> BenchmarkRunView: - """ - Cancel a currently running Benchmark run. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/benchmarks/runs/{id}/cancel", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=BenchmarkRunView, - ) - - @typing_extensions.deprecated("deprecated") - def complete( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> BenchmarkRunView: - """ - Complete a currently running BenchmarkRun. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/benchmarks/runs/{id}/complete", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=BenchmarkRunView, - ) - - @typing_extensions.deprecated("deprecated") - def list_scenario_runs( - self, - id: str, - *, - limit: int | Omit = omit, - starting_after: str | Omit = omit, - state: Literal["running", "scoring", "scored", "completed", "canceled", "timeout", "failed"] | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> SyncBenchmarkRunsCursorIDPage[ScenarioRunView]: - """ - List started scenario runs for a benchmark run. - - Args: - limit: The limit of items to return. Default is 20. Max is 5000. - - starting_after: Load the next page of data starting after the item with the given ID. - - state: Filter by Scenario Run state - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get_api_list( - f"/v1/benchmarks/runs/{id}/scenario_runs", - page=SyncBenchmarkRunsCursorIDPage[ScenarioRunView], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "limit": limit, - "starting_after": starting_after, - "state": state, - }, - run_list_scenario_runs_params.RunListScenarioRunsParams, - ), - ), - model=ScenarioRunView, - ) - - -class AsyncRunsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncRunsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers - """ - return AsyncRunsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncRunsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response - """ - return AsyncRunsResourceWithStreamingResponse(self) - - @typing_extensions.deprecated("deprecated") - async def retrieve( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> BenchmarkRunView: - """ - Get a BenchmarkRun given ID. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._get( - f"/v1/benchmarks/runs/{id}", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=BenchmarkRunView, - ) - - @typing_extensions.deprecated("deprecated") - def list( - self, - *, - benchmark_id: str | Omit = omit, - limit: int | Omit = omit, - name: str | Omit = omit, - starting_after: str | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AsyncPaginator[BenchmarkRunView, AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView]]: - """ - List all BenchmarkRuns matching filter. - - Args: - benchmark_id: The Benchmark ID to filter by. - - limit: The limit of items to return. Default is 20. Max is 5000. - - name: Filter by name - - starting_after: Load the next page of data starting after the item with the given ID. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - return self._get_api_list( - "/v1/benchmarks/runs", - page=AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "benchmark_id": benchmark_id, - "limit": limit, - "name": name, - "starting_after": starting_after, - }, - run_list_params.RunListParams, - ), - ), - model=BenchmarkRunView, - ) - - @typing_extensions.deprecated("deprecated") - async def cancel( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> BenchmarkRunView: - """ - Cancel a currently running Benchmark run. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/benchmarks/runs/{id}/cancel", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=BenchmarkRunView, - ) - - @typing_extensions.deprecated("deprecated") - async def complete( - self, - id: str, - *, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> BenchmarkRunView: - """ - Complete a currently running BenchmarkRun. - - Args: - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/benchmarks/runs/{id}/complete", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=BenchmarkRunView, - ) - - @typing_extensions.deprecated("deprecated") - def list_scenario_runs( - self, - id: str, - *, - limit: int | Omit = omit, - starting_after: str | Omit = omit, - state: Literal["running", "scoring", "scored", "completed", "canceled", "timeout", "failed"] | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AsyncPaginator[ScenarioRunView, AsyncBenchmarkRunsCursorIDPage[ScenarioRunView]]: - """ - List started scenario runs for a benchmark run. - - Args: - limit: The limit of items to return. Default is 20. Max is 5000. - - starting_after: Load the next page of data starting after the item with the given ID. - - state: Filter by Scenario Run state - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get_api_list( - f"/v1/benchmarks/runs/{id}/scenario_runs", - page=AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "limit": limit, - "starting_after": starting_after, - "state": state, - }, - run_list_scenario_runs_params.RunListScenarioRunsParams, - ), - ), - model=ScenarioRunView, - ) - - -class RunsResourceWithRawResponse: - def __init__(self, runs: RunsResource) -> None: - self._runs = runs - - self.retrieve = ( # pyright: ignore[reportDeprecated] - to_raw_response_wrapper( - runs.retrieve, # pyright: ignore[reportDeprecated], - ) - ) - self.list = ( # pyright: ignore[reportDeprecated] - to_raw_response_wrapper( - runs.list, # pyright: ignore[reportDeprecated], - ) - ) - self.cancel = ( # pyright: ignore[reportDeprecated] - to_raw_response_wrapper( - runs.cancel, # pyright: ignore[reportDeprecated], - ) - ) - self.complete = ( # pyright: ignore[reportDeprecated] - to_raw_response_wrapper( - runs.complete, # pyright: ignore[reportDeprecated], - ) - ) - self.list_scenario_runs = ( # pyright: ignore[reportDeprecated] - to_raw_response_wrapper( - runs.list_scenario_runs, # pyright: ignore[reportDeprecated], - ) - ) - - -class AsyncRunsResourceWithRawResponse: - def __init__(self, runs: AsyncRunsResource) -> None: - self._runs = runs - - self.retrieve = ( # pyright: ignore[reportDeprecated] - async_to_raw_response_wrapper( - runs.retrieve, # pyright: ignore[reportDeprecated], - ) - ) - self.list = ( # pyright: ignore[reportDeprecated] - async_to_raw_response_wrapper( - runs.list, # pyright: ignore[reportDeprecated], - ) - ) - self.cancel = ( # pyright: ignore[reportDeprecated] - async_to_raw_response_wrapper( - runs.cancel, # pyright: ignore[reportDeprecated], - ) - ) - self.complete = ( # pyright: ignore[reportDeprecated] - async_to_raw_response_wrapper( - runs.complete, # pyright: ignore[reportDeprecated], - ) - ) - self.list_scenario_runs = ( # pyright: ignore[reportDeprecated] - async_to_raw_response_wrapper( - runs.list_scenario_runs, # pyright: ignore[reportDeprecated], - ) - ) - - -class RunsResourceWithStreamingResponse: - def __init__(self, runs: RunsResource) -> None: - self._runs = runs - - self.retrieve = ( # pyright: ignore[reportDeprecated] - to_streamed_response_wrapper( - runs.retrieve, # pyright: ignore[reportDeprecated], - ) - ) - self.list = ( # pyright: ignore[reportDeprecated] - to_streamed_response_wrapper( - runs.list, # pyright: ignore[reportDeprecated], - ) - ) - self.cancel = ( # pyright: ignore[reportDeprecated] - to_streamed_response_wrapper( - runs.cancel, # pyright: ignore[reportDeprecated], - ) - ) - self.complete = ( # pyright: ignore[reportDeprecated] - to_streamed_response_wrapper( - runs.complete, # pyright: ignore[reportDeprecated], - ) - ) - self.list_scenario_runs = ( # pyright: ignore[reportDeprecated] - to_streamed_response_wrapper( - runs.list_scenario_runs, # pyright: ignore[reportDeprecated], - ) - ) - - -class AsyncRunsResourceWithStreamingResponse: - def __init__(self, runs: AsyncRunsResource) -> None: - self._runs = runs - - self.retrieve = ( # pyright: ignore[reportDeprecated] - async_to_streamed_response_wrapper( - runs.retrieve, # pyright: ignore[reportDeprecated], - ) - ) - self.list = ( # pyright: ignore[reportDeprecated] - async_to_streamed_response_wrapper( - runs.list, # pyright: ignore[reportDeprecated], - ) - ) - self.cancel = ( # pyright: ignore[reportDeprecated] - async_to_streamed_response_wrapper( - runs.cancel, # pyright: ignore[reportDeprecated], - ) - ) - self.complete = ( # pyright: ignore[reportDeprecated] - async_to_streamed_response_wrapper( - runs.complete, # pyright: ignore[reportDeprecated], - ) - ) - self.list_scenario_runs = ( # pyright: ignore[reportDeprecated] - async_to_streamed_response_wrapper( - runs.list_scenario_runs, # pyright: ignore[reportDeprecated], - ) - ) diff --git a/src/runloop_api_client/types/benchmarks/__init__.py b/src/runloop_api_client/types/benchmarks/__init__.py deleted file mode 100644 index 2fb29daa0..000000000 --- a/src/runloop_api_client/types/benchmarks/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .run_list_params import RunListParams as RunListParams -from .run_list_scenario_runs_params import RunListScenarioRunsParams as RunListScenarioRunsParams diff --git a/src/runloop_api_client/types/benchmarks/run_list_params.py b/src/runloop_api_client/types/benchmarks/run_list_params.py deleted file mode 100644 index 072a0dbe1..000000000 --- a/src/runloop_api_client/types/benchmarks/run_list_params.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import TypedDict - -__all__ = ["RunListParams"] - - -class RunListParams(TypedDict, total=False): - benchmark_id: str - """The Benchmark ID to filter by.""" - - limit: int - """The limit of items to return. Default is 20. Max is 5000.""" - - name: str - """Filter by name""" - - starting_after: str - """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/benchmarks/run_list_scenario_runs_params.py b/src/runloop_api_client/types/benchmarks/run_list_scenario_runs_params.py deleted file mode 100644 index ddce6aa4a..000000000 --- a/src/runloop_api_client/types/benchmarks/run_list_scenario_runs_params.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal, TypedDict - -__all__ = ["RunListScenarioRunsParams"] - - -class RunListScenarioRunsParams(TypedDict, total=False): - limit: int - """The limit of items to return. Default is 20. Max is 5000.""" - - starting_after: str - """Load the next page of data starting after the item with the given ID.""" - - state: Literal["running", "scoring", "scored", "completed", "canceled", "timeout", "failed"] - """Filter by Scenario Run state""" diff --git a/tests/api_resources/benchmarks/__init__.py b/tests/api_resources/benchmarks/__init__.py deleted file mode 100644 index fd8019a9a..000000000 --- a/tests/api_resources/benchmarks/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/benchmarks/test_runs.py b/tests/api_resources/benchmarks/test_runs.py deleted file mode 100644 index a610f1fc4..000000000 --- a/tests/api_resources/benchmarks/test_runs.py +++ /dev/null @@ -1,477 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from tests.utils import assert_matches_type -from runloop_api_client import Runloop, AsyncRunloop -from runloop_api_client.types import ScenarioRunView, BenchmarkRunView -from runloop_api_client.pagination import SyncBenchmarkRunsCursorIDPage, AsyncBenchmarkRunsCursorIDPage - -# pyright: reportDeprecated=false - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestRuns: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_retrieve(self, client: Runloop) -> None: - with pytest.warns(DeprecationWarning): - run = client.benchmarks.runs.retrieve( - "id", - ) - - assert_matches_type(BenchmarkRunView, run, path=["response"]) - - @parametrize - def test_raw_response_retrieve(self, client: Runloop) -> None: - with pytest.warns(DeprecationWarning): - response = client.benchmarks.runs.with_raw_response.retrieve( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - run = response.parse() - assert_matches_type(BenchmarkRunView, run, path=["response"]) - - @parametrize - def test_streaming_response_retrieve(self, client: Runloop) -> None: - with pytest.warns(DeprecationWarning): - with client.benchmarks.runs.with_streaming_response.retrieve( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - run = response.parse() - assert_matches_type(BenchmarkRunView, run, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_retrieve(self, client: Runloop) -> None: - with pytest.warns(DeprecationWarning): - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.benchmarks.runs.with_raw_response.retrieve( - "", - ) - - @parametrize - def test_method_list(self, client: Runloop) -> None: - with pytest.warns(DeprecationWarning): - run = client.benchmarks.runs.list() - - assert_matches_type(SyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Runloop) -> None: - with pytest.warns(DeprecationWarning): - run = client.benchmarks.runs.list( - benchmark_id="benchmark_id", - limit=0, - name="name", - starting_after="starting_after", - ) - - assert_matches_type(SyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Runloop) -> None: - with pytest.warns(DeprecationWarning): - response = client.benchmarks.runs.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - run = response.parse() - assert_matches_type(SyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Runloop) -> None: - with pytest.warns(DeprecationWarning): - with client.benchmarks.runs.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - run = response.parse() - assert_matches_type(SyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_method_cancel(self, client: Runloop) -> None: - with pytest.warns(DeprecationWarning): - run = client.benchmarks.runs.cancel( - "id", - ) - - assert_matches_type(BenchmarkRunView, run, path=["response"]) - - @parametrize - def test_raw_response_cancel(self, client: Runloop) -> None: - with pytest.warns(DeprecationWarning): - response = client.benchmarks.runs.with_raw_response.cancel( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - run = response.parse() - assert_matches_type(BenchmarkRunView, run, path=["response"]) - - @parametrize - def test_streaming_response_cancel(self, client: Runloop) -> None: - with pytest.warns(DeprecationWarning): - with client.benchmarks.runs.with_streaming_response.cancel( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - run = response.parse() - assert_matches_type(BenchmarkRunView, run, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_cancel(self, client: Runloop) -> None: - with pytest.warns(DeprecationWarning): - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.benchmarks.runs.with_raw_response.cancel( - "", - ) - - @parametrize - def test_method_complete(self, client: Runloop) -> None: - with pytest.warns(DeprecationWarning): - run = client.benchmarks.runs.complete( - "id", - ) - - assert_matches_type(BenchmarkRunView, run, path=["response"]) - - @parametrize - def test_raw_response_complete(self, client: Runloop) -> None: - with pytest.warns(DeprecationWarning): - response = client.benchmarks.runs.with_raw_response.complete( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - run = response.parse() - assert_matches_type(BenchmarkRunView, run, path=["response"]) - - @parametrize - def test_streaming_response_complete(self, client: Runloop) -> None: - with pytest.warns(DeprecationWarning): - with client.benchmarks.runs.with_streaming_response.complete( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - run = response.parse() - assert_matches_type(BenchmarkRunView, run, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_complete(self, client: Runloop) -> None: - with pytest.warns(DeprecationWarning): - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.benchmarks.runs.with_raw_response.complete( - "", - ) - - @parametrize - def test_method_list_scenario_runs(self, client: Runloop) -> None: - with pytest.warns(DeprecationWarning): - run = client.benchmarks.runs.list_scenario_runs( - id="id", - ) - - assert_matches_type(SyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) - - @parametrize - def test_method_list_scenario_runs_with_all_params(self, client: Runloop) -> None: - with pytest.warns(DeprecationWarning): - run = client.benchmarks.runs.list_scenario_runs( - id="id", - limit=0, - starting_after="starting_after", - state="running", - ) - - assert_matches_type(SyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) - - @parametrize - def test_raw_response_list_scenario_runs(self, client: Runloop) -> None: - with pytest.warns(DeprecationWarning): - response = client.benchmarks.runs.with_raw_response.list_scenario_runs( - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - run = response.parse() - assert_matches_type(SyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) - - @parametrize - def test_streaming_response_list_scenario_runs(self, client: Runloop) -> None: - with pytest.warns(DeprecationWarning): - with client.benchmarks.runs.with_streaming_response.list_scenario_runs( - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - run = response.parse() - assert_matches_type(SyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list_scenario_runs(self, client: Runloop) -> None: - with pytest.warns(DeprecationWarning): - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.benchmarks.runs.with_raw_response.list_scenario_runs( - id="", - ) - - -class TestAsyncRuns: - parametrize = pytest.mark.parametrize( - "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] - ) - - @parametrize - async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: - with pytest.warns(DeprecationWarning): - run = await async_client.benchmarks.runs.retrieve( - "id", - ) - - assert_matches_type(BenchmarkRunView, run, path=["response"]) - - @parametrize - async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: - with pytest.warns(DeprecationWarning): - response = await async_client.benchmarks.runs.with_raw_response.retrieve( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - run = await response.parse() - assert_matches_type(BenchmarkRunView, run, path=["response"]) - - @parametrize - async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: - with pytest.warns(DeprecationWarning): - async with async_client.benchmarks.runs.with_streaming_response.retrieve( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - run = await response.parse() - assert_matches_type(BenchmarkRunView, run, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: - with pytest.warns(DeprecationWarning): - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.benchmarks.runs.with_raw_response.retrieve( - "", - ) - - @parametrize - async def test_method_list(self, async_client: AsyncRunloop) -> None: - with pytest.warns(DeprecationWarning): - run = await async_client.benchmarks.runs.list() - - assert_matches_type(AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: - with pytest.warns(DeprecationWarning): - run = await async_client.benchmarks.runs.list( - benchmark_id="benchmark_id", - limit=0, - name="name", - starting_after="starting_after", - ) - - assert_matches_type(AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: - with pytest.warns(DeprecationWarning): - response = await async_client.benchmarks.runs.with_raw_response.list() - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - run = await response.parse() - assert_matches_type(AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: - with pytest.warns(DeprecationWarning): - async with async_client.benchmarks.runs.with_streaming_response.list() as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - run = await response.parse() - assert_matches_type(AsyncBenchmarkRunsCursorIDPage[BenchmarkRunView], run, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_cancel(self, async_client: AsyncRunloop) -> None: - with pytest.warns(DeprecationWarning): - run = await async_client.benchmarks.runs.cancel( - "id", - ) - - assert_matches_type(BenchmarkRunView, run, path=["response"]) - - @parametrize - async def test_raw_response_cancel(self, async_client: AsyncRunloop) -> None: - with pytest.warns(DeprecationWarning): - response = await async_client.benchmarks.runs.with_raw_response.cancel( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - run = await response.parse() - assert_matches_type(BenchmarkRunView, run, path=["response"]) - - @parametrize - async def test_streaming_response_cancel(self, async_client: AsyncRunloop) -> None: - with pytest.warns(DeprecationWarning): - async with async_client.benchmarks.runs.with_streaming_response.cancel( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - run = await response.parse() - assert_matches_type(BenchmarkRunView, run, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_cancel(self, async_client: AsyncRunloop) -> None: - with pytest.warns(DeprecationWarning): - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.benchmarks.runs.with_raw_response.cancel( - "", - ) - - @parametrize - async def test_method_complete(self, async_client: AsyncRunloop) -> None: - with pytest.warns(DeprecationWarning): - run = await async_client.benchmarks.runs.complete( - "id", - ) - - assert_matches_type(BenchmarkRunView, run, path=["response"]) - - @parametrize - async def test_raw_response_complete(self, async_client: AsyncRunloop) -> None: - with pytest.warns(DeprecationWarning): - response = await async_client.benchmarks.runs.with_raw_response.complete( - "id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - run = await response.parse() - assert_matches_type(BenchmarkRunView, run, path=["response"]) - - @parametrize - async def test_streaming_response_complete(self, async_client: AsyncRunloop) -> None: - with pytest.warns(DeprecationWarning): - async with async_client.benchmarks.runs.with_streaming_response.complete( - "id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - run = await response.parse() - assert_matches_type(BenchmarkRunView, run, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_complete(self, async_client: AsyncRunloop) -> None: - with pytest.warns(DeprecationWarning): - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.benchmarks.runs.with_raw_response.complete( - "", - ) - - @parametrize - async def test_method_list_scenario_runs(self, async_client: AsyncRunloop) -> None: - with pytest.warns(DeprecationWarning): - run = await async_client.benchmarks.runs.list_scenario_runs( - id="id", - ) - - assert_matches_type(AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) - - @parametrize - async def test_method_list_scenario_runs_with_all_params(self, async_client: AsyncRunloop) -> None: - with pytest.warns(DeprecationWarning): - run = await async_client.benchmarks.runs.list_scenario_runs( - id="id", - limit=0, - starting_after="starting_after", - state="running", - ) - - assert_matches_type(AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) - - @parametrize - async def test_raw_response_list_scenario_runs(self, async_client: AsyncRunloop) -> None: - with pytest.warns(DeprecationWarning): - response = await async_client.benchmarks.runs.with_raw_response.list_scenario_runs( - id="id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - run = await response.parse() - assert_matches_type(AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) - - @parametrize - async def test_streaming_response_list_scenario_runs(self, async_client: AsyncRunloop) -> None: - with pytest.warns(DeprecationWarning): - async with async_client.benchmarks.runs.with_streaming_response.list_scenario_runs( - id="id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - run = await response.parse() - assert_matches_type(AsyncBenchmarkRunsCursorIDPage[ScenarioRunView], run, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list_scenario_runs(self, async_client: AsyncRunloop) -> None: - with pytest.warns(DeprecationWarning): - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.benchmarks.runs.with_raw_response.list_scenario_runs( - id="", - ) From 0fa9bee118dc35966c6b2b5213dfd40729ffc780 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 24 Jan 2026 04:02:03 +0000 Subject: [PATCH 945/993] chore(ci): upgrade `actions/github-script` --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77924adbb..dd82d3f97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,7 +57,7 @@ jobs: - name: Get GitHub OIDC Token if: github.repository == 'stainless-sdks/runloop-python' id: github-oidc - uses: actions/github-script@v6 + uses: actions/github-script@v8 with: script: core.setOutput('github_token', await core.getIDToken()); From 233888e3095839e4105b2f8fd4cf803fdcfb700a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 27 Jan 2026 20:36:47 +0000 Subject: [PATCH 946/993] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5eb10a624..31c8a83a8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 103 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-5359067a857aa94f69bae0d3311856be3e637da067fdc9dbf8bd26fe476efbd8.yml -openapi_spec_hash: 5227ef7c306d5226c3aee8932b2e8c6a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e7d58ccdc25196753498032f7fe135fe0c29b9728eb24d84abe19de06305d7a3.yml +openapi_spec_hash: c361ddb1965611121fc2c7e84066a553 config_hash: cb43d4ca9e64d5a099199d6818d70539 From aff806294e7cb87885f2d5420fbc15e5662be006 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 21:27:39 +0000 Subject: [PATCH 947/993] feat(benchmark): adding in progress benchmark runs for benchmark jobs (#7183) --- .stats.yml | 8 +- api.md | 18 + src/runloop_api_client/_client.py | 38 ++ src/runloop_api_client/resources/__init__.py | 14 + .../resources/benchmark_jobs.py | 394 ++++++++++++++++++ src/runloop_api_client/types/__init__.py | 4 + .../types/benchmark_job_create_params.py | 220 ++++++++++ .../types/benchmark_job_list_params.py | 18 + .../types/benchmark_job_list_view.py | 19 + .../types/benchmark_job_view.py | 344 +++++++++++++++ tests/api_resources/test_benchmark_jobs.py | 243 +++++++++++ 11 files changed, 1316 insertions(+), 4 deletions(-) create mode 100644 src/runloop_api_client/resources/benchmark_jobs.py create mode 100644 src/runloop_api_client/types/benchmark_job_create_params.py create mode 100644 src/runloop_api_client/types/benchmark_job_list_params.py create mode 100644 src/runloop_api_client/types/benchmark_job_list_view.py create mode 100644 src/runloop_api_client/types/benchmark_job_view.py create mode 100644 tests/api_resources/test_benchmark_jobs.py diff --git a/.stats.yml b/.stats.yml index 31c8a83a8..f28b394ab 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 103 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e7d58ccdc25196753498032f7fe135fe0c29b9728eb24d84abe19de06305d7a3.yml -openapi_spec_hash: c361ddb1965611121fc2c7e84066a553 -config_hash: cb43d4ca9e64d5a099199d6818d70539 +configured_endpoints: 106 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-63dab7833d6670810c4f4882df560ebbfe2de8e8e1a98d51422368607b5335ae.yml +openapi_spec_hash: ebb5068064f7469f9239b18a51a6fe44 +config_hash: fd168de77f219e46a1427bbec2eecfb9 diff --git a/api.md b/api.md index 3c4a48d0f..178bd2add 100644 --- a/api.md +++ b/api.md @@ -55,6 +55,24 @@ Methods: - client.benchmark_runs.complete(id) -> BenchmarkRunView - client.benchmark_runs.list_scenario_runs(id, \*\*params) -> SyncBenchmarkRunsCursorIDPage[ScenarioRunView] +# BenchmarkJobs + +Types: + +```python +from runloop_api_client.types import ( + BenchmarkJobCreateParameters, + BenchmarkJobListView, + BenchmarkJobView, +) +``` + +Methods: + +- client.benchmark_jobs.create(\*\*params) -> BenchmarkJobView +- client.benchmark_jobs.retrieve(id) -> BenchmarkJobView +- client.benchmark_jobs.list(\*\*params) -> BenchmarkJobListView + # Agents Types: diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index 557170af6..3b469e7ec 100644 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -40,6 +40,7 @@ benchmarks, blueprints, repositories, + benchmark_jobs, benchmark_runs, network_policies, ) @@ -49,6 +50,7 @@ from .resources.benchmarks import BenchmarksResource, AsyncBenchmarksResource from .resources.blueprints import BlueprintsResource, AsyncBlueprintsResource from .resources.repositories import RepositoriesResource, AsyncRepositoriesResource + from .resources.benchmark_jobs import BenchmarkJobsResource, AsyncBenchmarkJobsResource from .resources.benchmark_runs import BenchmarkRunsResource, AsyncBenchmarkRunsResource from .resources.network_policies import NetworkPoliciesResource, AsyncNetworkPoliciesResource from .resources.devboxes.devboxes import DevboxesResource, AsyncDevboxesResource @@ -126,6 +128,12 @@ def benchmark_runs(self) -> BenchmarkRunsResource: return BenchmarkRunsResource(self) + @cached_property + def benchmark_jobs(self) -> BenchmarkJobsResource: + from .resources.benchmark_jobs import BenchmarkJobsResource + + return BenchmarkJobsResource(self) + @cached_property def agents(self) -> AgentsResource: from .resources.agents import AgentsResource @@ -356,6 +364,12 @@ def benchmark_runs(self) -> AsyncBenchmarkRunsResource: return AsyncBenchmarkRunsResource(self) + @cached_property + def benchmark_jobs(self) -> AsyncBenchmarkJobsResource: + from .resources.benchmark_jobs import AsyncBenchmarkJobsResource + + return AsyncBenchmarkJobsResource(self) + @cached_property def agents(self) -> AsyncAgentsResource: from .resources.agents import AsyncAgentsResource @@ -535,6 +549,12 @@ def benchmark_runs(self) -> benchmark_runs.BenchmarkRunsResourceWithRawResponse: return BenchmarkRunsResourceWithRawResponse(self._client.benchmark_runs) + @cached_property + def benchmark_jobs(self) -> benchmark_jobs.BenchmarkJobsResourceWithRawResponse: + from .resources.benchmark_jobs import BenchmarkJobsResourceWithRawResponse + + return BenchmarkJobsResourceWithRawResponse(self._client.benchmark_jobs) + @cached_property def agents(self) -> agents.AgentsResourceWithRawResponse: from .resources.agents import AgentsResourceWithRawResponse @@ -602,6 +622,12 @@ def benchmark_runs(self) -> benchmark_runs.AsyncBenchmarkRunsResourceWithRawResp return AsyncBenchmarkRunsResourceWithRawResponse(self._client.benchmark_runs) + @cached_property + def benchmark_jobs(self) -> benchmark_jobs.AsyncBenchmarkJobsResourceWithRawResponse: + from .resources.benchmark_jobs import AsyncBenchmarkJobsResourceWithRawResponse + + return AsyncBenchmarkJobsResourceWithRawResponse(self._client.benchmark_jobs) + @cached_property def agents(self) -> agents.AsyncAgentsResourceWithRawResponse: from .resources.agents import AsyncAgentsResourceWithRawResponse @@ -669,6 +695,12 @@ def benchmark_runs(self) -> benchmark_runs.BenchmarkRunsResourceWithStreamingRes return BenchmarkRunsResourceWithStreamingResponse(self._client.benchmark_runs) + @cached_property + def benchmark_jobs(self) -> benchmark_jobs.BenchmarkJobsResourceWithStreamingResponse: + from .resources.benchmark_jobs import BenchmarkJobsResourceWithStreamingResponse + + return BenchmarkJobsResourceWithStreamingResponse(self._client.benchmark_jobs) + @cached_property def agents(self) -> agents.AgentsResourceWithStreamingResponse: from .resources.agents import AgentsResourceWithStreamingResponse @@ -736,6 +768,12 @@ def benchmark_runs(self) -> benchmark_runs.AsyncBenchmarkRunsResourceWithStreami return AsyncBenchmarkRunsResourceWithStreamingResponse(self._client.benchmark_runs) + @cached_property + def benchmark_jobs(self) -> benchmark_jobs.AsyncBenchmarkJobsResourceWithStreamingResponse: + from .resources.benchmark_jobs import AsyncBenchmarkJobsResourceWithStreamingResponse + + return AsyncBenchmarkJobsResourceWithStreamingResponse(self._client.benchmark_jobs) + @cached_property def agents(self) -> agents.AsyncAgentsResourceWithStreamingResponse: from .resources.agents import AsyncAgentsResourceWithStreamingResponse diff --git a/src/runloop_api_client/resources/__init__.py b/src/runloop_api_client/resources/__init__.py index 90a4a2971..325158535 100644 --- a/src/runloop_api_client/resources/__init__.py +++ b/src/runloop_api_client/resources/__init__.py @@ -64,6 +64,14 @@ RepositoriesResourceWithStreamingResponse, AsyncRepositoriesResourceWithStreamingResponse, ) +from .benchmark_jobs import ( + BenchmarkJobsResource, + AsyncBenchmarkJobsResource, + BenchmarkJobsResourceWithRawResponse, + AsyncBenchmarkJobsResourceWithRawResponse, + BenchmarkJobsResourceWithStreamingResponse, + AsyncBenchmarkJobsResourceWithStreamingResponse, +) from .benchmark_runs import ( BenchmarkRunsResource, AsyncBenchmarkRunsResource, @@ -94,6 +102,12 @@ "AsyncBenchmarkRunsResourceWithRawResponse", "BenchmarkRunsResourceWithStreamingResponse", "AsyncBenchmarkRunsResourceWithStreamingResponse", + "BenchmarkJobsResource", + "AsyncBenchmarkJobsResource", + "BenchmarkJobsResourceWithRawResponse", + "AsyncBenchmarkJobsResourceWithRawResponse", + "BenchmarkJobsResourceWithStreamingResponse", + "AsyncBenchmarkJobsResourceWithStreamingResponse", "AgentsResource", "AsyncAgentsResource", "AgentsResourceWithRawResponse", diff --git a/src/runloop_api_client/resources/benchmark_jobs.py b/src/runloop_api_client/resources/benchmark_jobs.py new file mode 100644 index 000000000..f6172d118 --- /dev/null +++ b/src/runloop_api_client/resources/benchmark_jobs.py @@ -0,0 +1,394 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +import httpx + +from ..types import benchmark_job_list_params, benchmark_job_create_params +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from .._utils import maybe_transform, async_maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from .._base_client import make_request_options +from ..types.benchmark_job_view import BenchmarkJobView +from ..types.benchmark_job_list_view import BenchmarkJobListView + +__all__ = ["BenchmarkJobsResource", "AsyncBenchmarkJobsResource"] + + +class BenchmarkJobsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> BenchmarkJobsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return BenchmarkJobsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> BenchmarkJobsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return BenchmarkJobsResourceWithStreamingResponse(self) + + def create( + self, + *, + name: Optional[str] | Omit = omit, + spec: Optional[benchmark_job_create_params.Spec] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> BenchmarkJobView: + """ + [Beta] Create a BenchmarkJob that runs a set of scenarios entirely on runloop. + + Args: + name: The name of the BenchmarkJob. If not provided, name will be generated based on + target dataset. + + spec: The job specification. Exactly one spec type must be set. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/v1/benchmark_jobs", + body=maybe_transform( + { + "name": name, + "spec": spec, + }, + benchmark_job_create_params.BenchmarkJobCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BenchmarkJobView, + ) + + def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> BenchmarkJobView: + """ + [Beta] Get a BenchmarkJob given ID. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/benchmark_jobs/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BenchmarkJobView, + ) + + def list( + self, + *, + limit: int | Omit = omit, + name: str | Omit = omit, + starting_after: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> BenchmarkJobListView: + """ + [Beta] List all BenchmarkJobs matching filter. + + Args: + limit: The limit of items to return. Default is 20. Max is 5000. + + name: Filter by name + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + "/v1/benchmark_jobs", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "name": name, + "starting_after": starting_after, + }, + benchmark_job_list_params.BenchmarkJobListParams, + ), + ), + cast_to=BenchmarkJobListView, + ) + + +class AsyncBenchmarkJobsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncBenchmarkJobsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncBenchmarkJobsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncBenchmarkJobsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncBenchmarkJobsResourceWithStreamingResponse(self) + + async def create( + self, + *, + name: Optional[str] | Omit = omit, + spec: Optional[benchmark_job_create_params.Spec] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> BenchmarkJobView: + """ + [Beta] Create a BenchmarkJob that runs a set of scenarios entirely on runloop. + + Args: + name: The name of the BenchmarkJob. If not provided, name will be generated based on + target dataset. + + spec: The job specification. Exactly one spec type must be set. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/v1/benchmark_jobs", + body=await async_maybe_transform( + { + "name": name, + "spec": spec, + }, + benchmark_job_create_params.BenchmarkJobCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=BenchmarkJobView, + ) + + async def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> BenchmarkJobView: + """ + [Beta] Get a BenchmarkJob given ID. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/benchmark_jobs/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=BenchmarkJobView, + ) + + async def list( + self, + *, + limit: int | Omit = omit, + name: str | Omit = omit, + starting_after: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> BenchmarkJobListView: + """ + [Beta] List all BenchmarkJobs matching filter. + + Args: + limit: The limit of items to return. Default is 20. Max is 5000. + + name: Filter by name + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + "/v1/benchmark_jobs", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "limit": limit, + "name": name, + "starting_after": starting_after, + }, + benchmark_job_list_params.BenchmarkJobListParams, + ), + ), + cast_to=BenchmarkJobListView, + ) + + +class BenchmarkJobsResourceWithRawResponse: + def __init__(self, benchmark_jobs: BenchmarkJobsResource) -> None: + self._benchmark_jobs = benchmark_jobs + + self.create = to_raw_response_wrapper( + benchmark_jobs.create, + ) + self.retrieve = to_raw_response_wrapper( + benchmark_jobs.retrieve, + ) + self.list = to_raw_response_wrapper( + benchmark_jobs.list, + ) + + +class AsyncBenchmarkJobsResourceWithRawResponse: + def __init__(self, benchmark_jobs: AsyncBenchmarkJobsResource) -> None: + self._benchmark_jobs = benchmark_jobs + + self.create = async_to_raw_response_wrapper( + benchmark_jobs.create, + ) + self.retrieve = async_to_raw_response_wrapper( + benchmark_jobs.retrieve, + ) + self.list = async_to_raw_response_wrapper( + benchmark_jobs.list, + ) + + +class BenchmarkJobsResourceWithStreamingResponse: + def __init__(self, benchmark_jobs: BenchmarkJobsResource) -> None: + self._benchmark_jobs = benchmark_jobs + + self.create = to_streamed_response_wrapper( + benchmark_jobs.create, + ) + self.retrieve = to_streamed_response_wrapper( + benchmark_jobs.retrieve, + ) + self.list = to_streamed_response_wrapper( + benchmark_jobs.list, + ) + + +class AsyncBenchmarkJobsResourceWithStreamingResponse: + def __init__(self, benchmark_jobs: AsyncBenchmarkJobsResource) -> None: + self._benchmark_jobs = benchmark_jobs + + self.create = async_to_streamed_response_wrapper( + benchmark_jobs.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + benchmark_jobs.retrieve, + ) + self.list = async_to_streamed_response_wrapper( + benchmark_jobs.list, + ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index f9057658a..59130e662 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -28,6 +28,7 @@ from .secret_list_view import SecretListView as SecretListView from .agent_list_params import AgentListParams as AgentListParams from .scenario_run_view import ScenarioRunView as ScenarioRunView +from .benchmark_job_view import BenchmarkJobView as BenchmarkJobView from .benchmark_run_view import BenchmarkRunView as BenchmarkRunView from .devbox_list_params import DevboxListParams as DevboxListParams from .devbox_tunnel_view import DevboxTunnelView as DevboxTunnelView @@ -58,6 +59,7 @@ from .scoring_contract_param import ScoringContractParam as ScoringContractParam from .scoring_function_param import ScoringFunctionParam as ScoringFunctionParam from .benchmark_create_params import BenchmarkCreateParams as BenchmarkCreateParams +from .benchmark_job_list_view import BenchmarkJobListView as BenchmarkJobListView from .benchmark_run_list_view import BenchmarkRunListView as BenchmarkRunListView from .benchmark_update_params import BenchmarkUpdateParams as BenchmarkUpdateParams from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams @@ -67,6 +69,7 @@ from .object_download_url_view import ObjectDownloadURLView as ObjectDownloadURLView from .repository_create_params import RepositoryCreateParams as RepositoryCreateParams from .repository_manifest_view import RepositoryManifestView as RepositoryManifestView +from .benchmark_job_list_params import BenchmarkJobListParams as BenchmarkJobListParams from .benchmark_run_list_params import BenchmarkRunListParams as BenchmarkRunListParams from .devbox_send_std_in_result import DevboxSendStdInResult as DevboxSendStdInResult from .devbox_snapshot_list_view import DevboxSnapshotListView as DevboxSnapshotListView @@ -82,6 +85,7 @@ from .network_policy_list_params import NetworkPolicyListParams as NetworkPolicyListParams from .repository_connection_view import RepositoryConnectionView as RepositoryConnectionView from .scenario_environment_param import ScenarioEnvironmentParam as ScenarioEnvironmentParam +from .benchmark_job_create_params import BenchmarkJobCreateParams as BenchmarkJobCreateParams from .devbox_create_tunnel_params import DevboxCreateTunnelParams as DevboxCreateTunnelParams from .devbox_download_file_params import DevboxDownloadFileParams as DevboxDownloadFileParams from .devbox_execute_async_params import DevboxExecuteAsyncParams as DevboxExecuteAsyncParams diff --git a/src/runloop_api_client/types/benchmark_job_create_params.py b/src/runloop_api_client/types/benchmark_job_create_params.py new file mode 100644 index 000000000..8ac3a5475 --- /dev/null +++ b/src/runloop_api_client/types/benchmark_job_create_params.py @@ -0,0 +1,220 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from .._types import SequenceNotStr + +__all__ = [ + "BenchmarkJobCreateParams", + "Spec", + "SpecHarborJobSpec", + "SpecBenchmarkDefinitionJobSpec", + "SpecBenchmarkDefinitionJobSpecAgentConfig", + "SpecBenchmarkDefinitionJobSpecAgentConfigAgentEnvironment", + "SpecBenchmarkDefinitionJobSpecOrchestratorConfig", + "SpecScenarioDefinitionJobSpec", + "SpecScenarioDefinitionJobSpecAgentConfig", + "SpecScenarioDefinitionJobSpecAgentConfigAgentEnvironment", + "SpecScenarioDefinitionJobSpecOrchestratorConfig", +] + + +class BenchmarkJobCreateParams(TypedDict, total=False): + name: Optional[str] + """The name of the BenchmarkJob. + + If not provided, name will be generated based on target dataset. + """ + + spec: Optional[Spec] + """The job specification. Exactly one spec type must be set.""" + + +class SpecHarborJobSpec(TypedDict, total=False): + """Harbor-based job specification with inline YAML configuration.""" + + inline_yaml: Required[str] + """The Harbor job configuration as inline YAML content.""" + + type: Required[Literal["harbor"]] + + +class SpecBenchmarkDefinitionJobSpecAgentConfigAgentEnvironment(TypedDict, total=False): + """Environment configuration to use for this agent""" + + environment_variables: Optional[Dict[str, str]] + """Environment variables to set when launching the agent.""" + + secrets: Optional[Dict[str, str]] + """Secrets to inject as environment variables when launching the agent. + + Map of environment variable names to secret IDs. + """ + + +class SpecBenchmarkDefinitionJobSpecAgentConfig(TypedDict, total=False): + """Configuration for an agent in a benchmark job""" + + name: Required[str] + """Name of the agent""" + + type: Required[Literal["job_agent"]] + + agent_environment: Optional[SpecBenchmarkDefinitionJobSpecAgentConfigAgentEnvironment] + """Environment configuration to use for this agent""" + + agent_id: Optional[str] + """ID of the agent to use (optional if agent exists by name)""" + + kwargs: Optional[Dict[str, str]] + """Additional kwargs for agent configuration""" + + model_name: Optional[str] + """Model name override for this agent""" + + timeout_seconds: Optional[float] + """Timeout in seconds for this agent""" + + +class SpecBenchmarkDefinitionJobSpecOrchestratorConfig(TypedDict, total=False): + """Orchestrator configuration (optional overrides). + + If not provided, default values will be used. + """ + + n_attempts: Optional[int] + """Number of retry attempts on failure (default: 0). + + This is the retry policy for failed scenarios. Default is 0. + """ + + n_concurrent_trials: Optional[int] + """Number of concurrent trials to run (default: 1). + + Controls parallelism for scenario execution. Default is 1. + """ + + quiet: Optional[bool] + """Suppress verbose output (default: false)""" + + timeout_multiplier: Optional[float] + """Timeout multiplier for retries (default: 1.0). + + Each retry will multiply the timeout by this factor. + """ + + +class SpecBenchmarkDefinitionJobSpec(TypedDict, total=False): + """Specifies a benchmark definition with runtime configuration. + + The benchmark definition's scenarios will be executed using the provided agent and orchestrator configurations. + """ + + agent_configs: Required[Iterable[SpecBenchmarkDefinitionJobSpecAgentConfig]] + """Agent configurations to use for this run. Must specify at least one agent.""" + + benchmark_id: Required[str] + """ID of the benchmark definition to run. + + The scenarios from this benchmark will be executed. + """ + + type: Required[Literal["benchmark"]] + + orchestrator_config: Optional[SpecBenchmarkDefinitionJobSpecOrchestratorConfig] + """Orchestrator configuration (optional overrides). + + If not provided, default values will be used. + """ + + +class SpecScenarioDefinitionJobSpecAgentConfigAgentEnvironment(TypedDict, total=False): + """Environment configuration to use for this agent""" + + environment_variables: Optional[Dict[str, str]] + """Environment variables to set when launching the agent.""" + + secrets: Optional[Dict[str, str]] + """Secrets to inject as environment variables when launching the agent. + + Map of environment variable names to secret IDs. + """ + + +class SpecScenarioDefinitionJobSpecAgentConfig(TypedDict, total=False): + """Configuration for an agent in a benchmark job""" + + name: Required[str] + """Name of the agent""" + + type: Required[Literal["job_agent"]] + + agent_environment: Optional[SpecScenarioDefinitionJobSpecAgentConfigAgentEnvironment] + """Environment configuration to use for this agent""" + + agent_id: Optional[str] + """ID of the agent to use (optional if agent exists by name)""" + + kwargs: Optional[Dict[str, str]] + """Additional kwargs for agent configuration""" + + model_name: Optional[str] + """Model name override for this agent""" + + timeout_seconds: Optional[float] + """Timeout in seconds for this agent""" + + +class SpecScenarioDefinitionJobSpecOrchestratorConfig(TypedDict, total=False): + """Orchestrator configuration (optional overrides). + + If not provided, default values will be used. + """ + + n_attempts: Optional[int] + """Number of retry attempts on failure (default: 0). + + This is the retry policy for failed scenarios. Default is 0. + """ + + n_concurrent_trials: Optional[int] + """Number of concurrent trials to run (default: 1). + + Controls parallelism for scenario execution. Default is 1. + """ + + quiet: Optional[bool] + """Suppress verbose output (default: false)""" + + timeout_multiplier: Optional[float] + """Timeout multiplier for retries (default: 1.0). + + Each retry will multiply the timeout by this factor. + """ + + +class SpecScenarioDefinitionJobSpec(TypedDict, total=False): + """Specifies a set of scenarios with runtime configuration. + + The scenarios will be executed using the provided agent and orchestrator configurations. + """ + + agent_configs: Required[Iterable[SpecScenarioDefinitionJobSpecAgentConfig]] + """Agent configurations to use for this run. Must specify at least one agent.""" + + scenario_ids: Required[SequenceNotStr[str]] + """List of scenario IDs to execute""" + + type: Required[Literal["scenarios"]] + + orchestrator_config: Optional[SpecScenarioDefinitionJobSpecOrchestratorConfig] + """Orchestrator configuration (optional overrides). + + If not provided, default values will be used. + """ + + +Spec: TypeAlias = Union[SpecHarborJobSpec, SpecBenchmarkDefinitionJobSpec, SpecScenarioDefinitionJobSpec] diff --git a/src/runloop_api_client/types/benchmark_job_list_params.py b/src/runloop_api_client/types/benchmark_job_list_params.py new file mode 100644 index 000000000..c0db8843c --- /dev/null +++ b/src/runloop_api_client/types/benchmark_job_list_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["BenchmarkJobListParams"] + + +class BenchmarkJobListParams(TypedDict, total=False): + limit: int + """The limit of items to return. Default is 20. Max is 5000.""" + + name: str + """Filter by name""" + + starting_after: str + """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/benchmark_job_list_view.py b/src/runloop_api_client/types/benchmark_job_list_view.py new file mode 100644 index 000000000..5090fe8e8 --- /dev/null +++ b/src/runloop_api_client/types/benchmark_job_list_view.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .benchmark_job_view import BenchmarkJobView + +__all__ = ["BenchmarkJobListView"] + + +class BenchmarkJobListView(BaseModel): + has_more: bool + + jobs: List[BenchmarkJobView] + """List of BenchmarkJobs matching filter.""" + + remaining_count: int + + total_count: int diff --git a/src/runloop_api_client/types/benchmark_job_view.py b/src/runloop_api_client/types/benchmark_job_view.py new file mode 100644 index 000000000..f245f33ac --- /dev/null +++ b/src/runloop_api_client/types/benchmark_job_view.py @@ -0,0 +1,344 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from pydantic import Field as FieldInfo + +from .._utils import PropertyInfo +from .._models import BaseModel + +__all__ = [ + "BenchmarkJobView", + "BenchmarkOutcome", + "BenchmarkOutcomeScenarioOutcome", + "BenchmarkOutcomeScenarioOutcomeFailureReason", + "InProgressRun", + "InProgressRunAgentConfig", + "InProgressRunAgentConfigExternalAPIAgentConfig", + "InProgressRunAgentConfigJobAgentConfig", + "InProgressRunAgentConfigJobAgentConfigAgentEnvironment", + "JobSource", + "JobSourceHarborJobSource", + "JobSourceBenchmarkDefJobSource", + "JobSourceScenariosJobSource", + "JobSpec", + "JobSpecAgentConfig", + "JobSpecAgentConfigAgentEnvironment", + "JobSpecOrchestratorConfig", +] + + +class BenchmarkOutcomeScenarioOutcomeFailureReason(BaseModel): + """Failure information if the scenario failed or timed out. + + Contains exception type and message. + """ + + exception_message: str + """The exception message providing context""" + + exception_type: str + """The exception class name (e.g., 'TimeoutException', 'AgentTimeoutError')""" + + +class BenchmarkOutcomeScenarioOutcome(BaseModel): + """ + Outcome data for a single scenario execution, including its final state and scoring results. + """ + + scenario_definition_id: str + """The ID of the scenario definition that was executed.""" + + scenario_name: str + """The name of the scenario.""" + + scenario_run_id: str + """The ID of the scenario run.""" + + state: Literal["COMPLETED", "FAILED", "TIMEOUT", "CANCELED"] + """The final state of the scenario execution.""" + + duration_ms: Optional[int] = None + """Duration of the scenario execution in milliseconds.""" + + failure_reason: Optional[BenchmarkOutcomeScenarioOutcomeFailureReason] = None + """Failure information if the scenario failed or timed out. + + Contains exception type and message. + """ + + score: Optional[float] = None + """The score achieved for this scenario (0.0 to 1.0). + + Only present if state is COMPLETED. + """ + + +class BenchmarkOutcome(BaseModel): + """ + Outcome data for a single benchmark run within a benchmark job, representing results for one agent configuration. + """ + + agent_name: str + """The name of the agent configuration used.""" + + benchmark_run_id: str + """The ID of the benchmark run.""" + + n_completed: int + """Number of scenarios that completed successfully.""" + + n_failed: int + """Number of scenarios that failed.""" + + n_timeout: int + """Number of scenarios that timed out.""" + + scenario_outcomes: List[BenchmarkOutcomeScenarioOutcome] + """Detailed outcomes for each scenario in this benchmark run.""" + + average_score: Optional[float] = None + """Average score across all completed scenarios (0.0 to 1.0).""" + + duration_ms: Optional[int] = None + """Total duration of the benchmark run in milliseconds.""" + + api_model_name: Optional[str] = FieldInfo(alias="model_name", default=None) + """The model name used by the agent.""" + + +class InProgressRunAgentConfigExternalAPIAgentConfig(BaseModel): + """Configuration for externally-driven benchmark runs via API""" + + type: Literal["external_api"] + + info: Optional[str] = None + """Placeholder for future external agent metadata""" + + +class InProgressRunAgentConfigJobAgentConfigAgentEnvironment(BaseModel): + """Environment configuration to use for this agent""" + + environment_variables: Optional[Dict[str, str]] = None + """Environment variables to set when launching the agent.""" + + secrets: Optional[Dict[str, str]] = None + """Secrets to inject as environment variables when launching the agent. + + Map of environment variable names to secret IDs. + """ + + +class InProgressRunAgentConfigJobAgentConfig(BaseModel): + """Configuration for an agent in a benchmark job""" + + name: str + """Name of the agent""" + + type: Literal["job_agent"] + + agent_environment: Optional[InProgressRunAgentConfigJobAgentConfigAgentEnvironment] = None + """Environment configuration to use for this agent""" + + agent_id: Optional[str] = None + """ID of the agent to use (optional if agent exists by name)""" + + kwargs: Optional[Dict[str, str]] = None + """Additional kwargs for agent configuration""" + + api_model_name: Optional[str] = FieldInfo(alias="model_name", default=None) + """Model name override for this agent""" + + timeout_seconds: Optional[float] = None + """Timeout in seconds for this agent""" + + +InProgressRunAgentConfig: TypeAlias = Annotated[ + Union[InProgressRunAgentConfigExternalAPIAgentConfig, InProgressRunAgentConfigJobAgentConfig, None], + PropertyInfo(discriminator="type"), +] + + +class InProgressRun(BaseModel): + """ + A lightweight view of a benchmark run currently in progress, showing basic execution details without full outcome data. + """ + + benchmark_run_id: str + """The ID of the benchmark run.""" + + start_time_ms: int + """Start time (Unix milliseconds).""" + + state: Literal["running", "canceled", "completed"] + """The current state of the run.""" + + agent_config: Optional[InProgressRunAgentConfig] = None + """Agent configuration used for this run. + + Specifies whether the run was driven by an external API agent or a job-defined + agent. + """ + + duration_ms: Optional[int] = None + """Duration so far in milliseconds.""" + + +class JobSourceHarborJobSource(BaseModel): + """Harbor job source with inline YAML configuration""" + + inline_yaml: str + """The Harbor job configuration as inline YAML content""" + + type: Literal["harbor"] + + +class JobSourceBenchmarkDefJobSource(BaseModel): + """Benchmark definition job source""" + + benchmark_id: str + """The ID of the benchmark definition""" + + type: Literal["benchmark"] + + benchmark_name: Optional[str] = None + """Optional user-provided name for the benchmark definition""" + + +class JobSourceScenariosJobSource(BaseModel): + """Scenarios job source with a list of scenario definition IDs""" + + scenario_ids: List[str] + """List of scenario definition IDs to execute""" + + type: Literal["scenarios"] + + +JobSource: TypeAlias = Annotated[ + Union[JobSourceHarborJobSource, JobSourceBenchmarkDefJobSource, JobSourceScenariosJobSource, None], + PropertyInfo(discriminator="type"), +] + + +class JobSpecAgentConfigAgentEnvironment(BaseModel): + """Environment configuration to use for this agent""" + + environment_variables: Optional[Dict[str, str]] = None + """Environment variables to set when launching the agent.""" + + secrets: Optional[Dict[str, str]] = None + """Secrets to inject as environment variables when launching the agent. + + Map of environment variable names to secret IDs. + """ + + +class JobSpecAgentConfig(BaseModel): + """Configuration for an agent in a benchmark job""" + + name: str + """Name of the agent""" + + type: Literal["job_agent"] + + agent_environment: Optional[JobSpecAgentConfigAgentEnvironment] = None + """Environment configuration to use for this agent""" + + agent_id: Optional[str] = None + """ID of the agent to use (optional if agent exists by name)""" + + kwargs: Optional[Dict[str, str]] = None + """Additional kwargs for agent configuration""" + + api_model_name: Optional[str] = FieldInfo(alias="model_name", default=None) + """Model name override for this agent""" + + timeout_seconds: Optional[float] = None + """Timeout in seconds for this agent""" + + +class JobSpecOrchestratorConfig(BaseModel): + """Orchestrator configuration""" + + n_attempts: Optional[int] = None + """Number of retry attempts on failure (default: 0). + + This is the retry policy for failed scenarios. Default is 0. + """ + + n_concurrent_trials: Optional[int] = None + """Number of concurrent trials to run (default: 1). + + Controls parallelism for scenario execution. Default is 1. + """ + + quiet: Optional[bool] = None + """Suppress verbose output (default: false)""" + + timeout_multiplier: Optional[float] = None + """Timeout multiplier for retries (default: 1.0). + + Each retry will multiply the timeout by this factor. + """ + + +class JobSpec(BaseModel): + """The resolved job specification. + + Contains scenarios, agents, and orchestrator config. + """ + + agent_configs: List[JobSpecAgentConfig] + """Agent configurations for this job""" + + scenario_ids: List[str] + """List of scenario IDs to execute""" + + orchestrator_config: Optional[JobSpecOrchestratorConfig] = None + """Orchestrator configuration""" + + +class BenchmarkJobView(BaseModel): + """ + A BenchmarkJobView represents a benchmark job that runs a set of scenarios entirely on runloop. + """ + + id: str + """The ID of the BenchmarkJob.""" + + create_time_ms: int + """Timestamp when job was created (Unix milliseconds).""" + + name: str + """The unique name of the BenchmarkJob.""" + + state: Literal["initializing", "queued", "running", "completed", "failed", "cancelled", "timeout"] + """The current state of the benchmark job.""" + + benchmark_outcomes: Optional[List[BenchmarkOutcome]] = None + """Detailed outcome data for each benchmark run created by this job. + + Includes per-agent results and scenario-level details. + """ + + failure_reason: Optional[str] = None + """Failure reason if job failed.""" + + in_progress_runs: Optional[List[InProgressRun]] = None + """Benchmark runs currently in progress for this job. + + Shows runs that have not yet completed. + """ + + job_source: Optional[JobSource] = None + """The source configuration that was used to create this job. + + Either Harbor YAML or benchmark definition reference. + """ + + job_spec: Optional[JobSpec] = None + """The resolved job specification. + + Contains scenarios, agents, and orchestrator config. + """ diff --git a/tests/api_resources/test_benchmark_jobs.py b/tests/api_resources/test_benchmark_jobs.py new file mode 100644 index 000000000..461943458 --- /dev/null +++ b/tests/api_resources/test_benchmark_jobs.py @@ -0,0 +1,243 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types import ( + BenchmarkJobView, + BenchmarkJobListView, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestBenchmarkJobs: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Runloop) -> None: + benchmark_job = client.benchmark_jobs.create() + assert_matches_type(BenchmarkJobView, benchmark_job, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Runloop) -> None: + benchmark_job = client.benchmark_jobs.create( + name="name", + spec={ + "inline_yaml": "inline_yaml", + "type": "harbor", + }, + ) + assert_matches_type(BenchmarkJobView, benchmark_job, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Runloop) -> None: + response = client.benchmark_jobs.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark_job = response.parse() + assert_matches_type(BenchmarkJobView, benchmark_job, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Runloop) -> None: + with client.benchmark_jobs.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark_job = response.parse() + assert_matches_type(BenchmarkJobView, benchmark_job, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + benchmark_job = client.benchmark_jobs.retrieve( + "id", + ) + assert_matches_type(BenchmarkJobView, benchmark_job, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.benchmark_jobs.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark_job = response.parse() + assert_matches_type(BenchmarkJobView, benchmark_job, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.benchmark_jobs.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark_job = response.parse() + assert_matches_type(BenchmarkJobView, benchmark_job, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.benchmark_jobs.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + benchmark_job = client.benchmark_jobs.list() + assert_matches_type(BenchmarkJobListView, benchmark_job, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + benchmark_job = client.benchmark_jobs.list( + limit=0, + name="name", + starting_after="starting_after", + ) + assert_matches_type(BenchmarkJobListView, benchmark_job, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.benchmark_jobs.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark_job = response.parse() + assert_matches_type(BenchmarkJobListView, benchmark_job, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.benchmark_jobs.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark_job = response.parse() + assert_matches_type(BenchmarkJobListView, benchmark_job, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncBenchmarkJobs: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_create(self, async_client: AsyncRunloop) -> None: + benchmark_job = await async_client.benchmark_jobs.create() + assert_matches_type(BenchmarkJobView, benchmark_job, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: + benchmark_job = await async_client.benchmark_jobs.create( + name="name", + spec={ + "inline_yaml": "inline_yaml", + "type": "harbor", + }, + ) + assert_matches_type(BenchmarkJobView, benchmark_job, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: + response = await async_client.benchmark_jobs.with_raw_response.create() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark_job = await response.parse() + assert_matches_type(BenchmarkJobView, benchmark_job, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: + async with async_client.benchmark_jobs.with_streaming_response.create() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark_job = await response.parse() + assert_matches_type(BenchmarkJobView, benchmark_job, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + benchmark_job = await async_client.benchmark_jobs.retrieve( + "id", + ) + assert_matches_type(BenchmarkJobView, benchmark_job, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.benchmark_jobs.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark_job = await response.parse() + assert_matches_type(BenchmarkJobView, benchmark_job, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.benchmark_jobs.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark_job = await response.parse() + assert_matches_type(BenchmarkJobView, benchmark_job, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.benchmark_jobs.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + benchmark_job = await async_client.benchmark_jobs.list() + assert_matches_type(BenchmarkJobListView, benchmark_job, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + benchmark_job = await async_client.benchmark_jobs.list( + limit=0, + name="name", + starting_after="starting_after", + ) + assert_matches_type(BenchmarkJobListView, benchmark_job, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.benchmark_jobs.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + benchmark_job = await response.parse() + assert_matches_type(BenchmarkJobListView, benchmark_job, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.benchmark_jobs.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + benchmark_job = await response.parse() + assert_matches_type(BenchmarkJobListView, benchmark_job, path=["response"]) + + assert cast(Any, response.is_closed) is True From 8d8ab732d4c58fbf68531a584704cbcade372f86 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 22:05:46 +0000 Subject: [PATCH 948/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- README.md | 4 ++-- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4e205789d..0e5b256d2 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.3.0-alpha" + ".": "1.3.1" } \ No newline at end of file diff --git a/README.md b/README.md index 09e9dfe5f..a7b0db561 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ The REST API documentation can be found on [runloop.ai](https://runloop.ai). The ```sh # install from PyPI -pip install '--pre runloop_api_client' +pip install runloop_api_client ``` ## Usage @@ -73,7 +73,7 @@ You can enable this by installing `aiohttp`: ```sh # install from PyPI -pip install '--pre runloop_api_client[aiohttp]' +pip install runloop_api_client[aiohttp] ``` Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`: diff --git a/pyproject.toml b/pyproject.toml index 7292c3fd4..b9b9b4e9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "1.3.0-alpha" +version = "1.3.1" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index ad6d43f7c..590b9e003 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "1.3.0-alpha" # x-release-please-version +__version__ = "1.3.1" # x-release-please-version diff --git a/uv.lock b/uv.lock index 006d5702e..898d3e17f 100644 --- a/uv.lock +++ b/uv.lock @@ -1321,7 +1321,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "1.3.0a0" +version = "1.3.1" source = { editable = "." } dependencies = [ { name = "anyio" }, From 241a0e9d4a036e12aa62e732829052183518442a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 03:54:01 +0000 Subject: [PATCH 949/993] feat(client): add custom JSON encoder for extended type support --- src/runloop_api_client/_base_client.py | 7 +- src/runloop_api_client/_compat.py | 6 +- src/runloop_api_client/_utils/_json.py | 35 +++++++ tests/test_utils/test_json.py | 126 +++++++++++++++++++++++++ 4 files changed, 169 insertions(+), 5 deletions(-) create mode 100644 src/runloop_api_client/_utils/_json.py create mode 100644 tests/test_utils/test_json.py diff --git a/src/runloop_api_client/_base_client.py b/src/runloop_api_client/_base_client.py index 581204db6..8428705b5 100644 --- a/src/runloop_api_client/_base_client.py +++ b/src/runloop_api_client/_base_client.py @@ -86,6 +86,7 @@ APIConnectionError, APIResponseValidationError, ) +from ._utils._json import openapi_dumps log: logging.Logger = logging.getLogger(__name__) @@ -554,8 +555,10 @@ def _build_request( kwargs["content"] = options.content elif isinstance(json_data, bytes): kwargs["content"] = json_data - else: - kwargs["json"] = json_data if is_given(json_data) else None + elif not files: + # Don't set content when JSON is sent as multipart/form-data, + # since httpx's content param overrides other body arguments + kwargs["content"] = openapi_dumps(json_data) if is_given(json_data) and json_data is not None else None kwargs["files"] = files else: headers.pop("Content-Type", None) diff --git a/src/runloop_api_client/_compat.py b/src/runloop_api_client/_compat.py index bdef67f04..786ff42ad 100644 --- a/src/runloop_api_client/_compat.py +++ b/src/runloop_api_client/_compat.py @@ -139,6 +139,7 @@ def model_dump( exclude_defaults: bool = False, warnings: bool = True, mode: Literal["json", "python"] = "python", + by_alias: bool | None = None, ) -> dict[str, Any]: if (not PYDANTIC_V1) or hasattr(model, "model_dump"): return model.model_dump( @@ -148,13 +149,12 @@ def model_dump( exclude_defaults=exclude_defaults, # warnings are not supported in Pydantic v1 warnings=True if PYDANTIC_V1 else warnings, + by_alias=by_alias, ) return cast( "dict[str, Any]", model.dict( # pyright: ignore[reportDeprecated, reportUnnecessaryCast] - exclude=exclude, - exclude_unset=exclude_unset, - exclude_defaults=exclude_defaults, + exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, by_alias=bool(by_alias) ), ) diff --git a/src/runloop_api_client/_utils/_json.py b/src/runloop_api_client/_utils/_json.py new file mode 100644 index 000000000..60584214a --- /dev/null +++ b/src/runloop_api_client/_utils/_json.py @@ -0,0 +1,35 @@ +import json +from typing import Any +from datetime import datetime +from typing_extensions import override + +import pydantic + +from .._compat import model_dump + + +def openapi_dumps(obj: Any) -> bytes: + """ + Serialize an object to UTF-8 encoded JSON bytes. + + Extends the standard json.dumps with support for additional types + commonly used in the SDK, such as `datetime`, `pydantic.BaseModel`, etc. + """ + return json.dumps( + obj, + cls=_CustomEncoder, + # Uses the same defaults as httpx's JSON serialization + ensure_ascii=False, + separators=(",", ":"), + allow_nan=False, + ).encode() + + +class _CustomEncoder(json.JSONEncoder): + @override + def default(self, o: Any) -> Any: + if isinstance(o, datetime): + return o.isoformat() + if isinstance(o, pydantic.BaseModel): + return model_dump(o, exclude_unset=True, mode="json", by_alias=True) + return super().default(o) diff --git a/tests/test_utils/test_json.py b/tests/test_utils/test_json.py new file mode 100644 index 000000000..7e9390783 --- /dev/null +++ b/tests/test_utils/test_json.py @@ -0,0 +1,126 @@ +from __future__ import annotations + +import datetime +from typing import Union + +import pydantic + +from runloop_api_client import _compat +from runloop_api_client._utils._json import openapi_dumps + + +class TestOpenapiDumps: + def test_basic(self) -> None: + data = {"key": "value", "number": 42} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"key":"value","number":42}' + + def test_datetime_serialization(self) -> None: + dt = datetime.datetime(2023, 1, 1, 12, 0, 0) + data = {"datetime": dt} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"datetime":"2023-01-01T12:00:00"}' + + def test_pydantic_model_serialization(self) -> None: + class User(pydantic.BaseModel): + first_name: str + last_name: str + age: int + + model_instance = User(first_name="John", last_name="Kramer", age=83) + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"first_name":"John","last_name":"Kramer","age":83}}' + + def test_pydantic_model_with_default_values(self) -> None: + class User(pydantic.BaseModel): + name: str + role: str = "user" + active: bool = True + score: int = 0 + + model_instance = User(name="Alice") + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Alice"}}' + + def test_pydantic_model_with_default_values_overridden(self) -> None: + class User(pydantic.BaseModel): + name: str + role: str = "user" + active: bool = True + + model_instance = User(name="Bob", role="admin", active=False) + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Bob","role":"admin","active":false}}' + + def test_pydantic_model_with_alias(self) -> None: + class User(pydantic.BaseModel): + first_name: str = pydantic.Field(alias="firstName") + last_name: str = pydantic.Field(alias="lastName") + + model_instance = User(firstName="John", lastName="Doe") + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"firstName":"John","lastName":"Doe"}}' + + def test_pydantic_model_with_alias_and_default(self) -> None: + class User(pydantic.BaseModel): + user_name: str = pydantic.Field(alias="userName") + user_role: str = pydantic.Field(default="member", alias="userRole") + is_active: bool = pydantic.Field(default=True, alias="isActive") + + model_instance = User(userName="charlie") + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"userName":"charlie"}}' + + model_with_overrides = User(userName="diana", userRole="admin", isActive=False) + data = {"model": model_with_overrides} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"userName":"diana","userRole":"admin","isActive":false}}' + + def test_pydantic_model_with_nested_models_and_defaults(self) -> None: + class Address(pydantic.BaseModel): + street: str + city: str = "Unknown" + + class User(pydantic.BaseModel): + name: str + address: Address + verified: bool = False + + if _compat.PYDANTIC_V1: + # to handle forward references in Pydantic v1 + User.update_forward_refs(**locals()) # type: ignore[reportDeprecated] + + address = Address(street="123 Main St") + user = User(name="Diana", address=address) + data = {"user": user} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"user":{"name":"Diana","address":{"street":"123 Main St"}}}' + + address_with_city = Address(street="456 Oak Ave", city="Boston") + user_verified = User(name="Eve", address=address_with_city, verified=True) + data = {"user": user_verified} + json_bytes = openapi_dumps(data) + assert ( + json_bytes == b'{"user":{"name":"Eve","address":{"street":"456 Oak Ave","city":"Boston"},"verified":true}}' + ) + + def test_pydantic_model_with_optional_fields(self) -> None: + class User(pydantic.BaseModel): + name: str + email: Union[str, None] + phone: Union[str, None] + + model_with_none = User(name="Eve", email=None, phone=None) + data = {"model": model_with_none} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Eve","email":null,"phone":null}}' + + model_with_values = User(name="Frank", email="frank@example.com", phone=None) + data = {"model": model_with_values} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Frank","email":"frank@example.com","phone":null}}' From 82f90213b9baeb824caf5b3d178b71311abd9bda Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 03:54:23 +0000 Subject: [PATCH 950/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0e5b256d2..c658eefef 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.3.1" + ".": "1.3.2" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index b9b9b4e9b..6ab350a78 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "1.3.1" +version = "1.3.2" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 590b9e003..521e1d656 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "1.3.1" # x-release-please-version +__version__ = "1.3.2" # x-release-please-version diff --git a/uv.lock b/uv.lock index 898d3e17f..abe65c249 100644 --- a/uv.lock +++ b/uv.lock @@ -1321,7 +1321,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "1.3.1" +version = "1.3.2" source = { editable = "." } dependencies = [ { name = "anyio" }, From 37cdf899d0230c41d53069cdf95e84f3599f4821 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 04:27:13 +0000 Subject: [PATCH 951/993] feat(devbox): add gateway routes (#7212) --- .stats.yml | 8 +- api.md | 21 + src/runloop_api_client/_client.py | 38 + src/runloop_api_client/pagination.py | 75 ++ src/runloop_api_client/resources/__init__.py | 14 + .../resources/devboxes/devboxes.py | 16 + .../resources/gateway_configs.py | 658 ++++++++++++++++++ src/runloop_api_client/types/__init__.py | 5 + .../types/devbox_create_params.py | 25 +- src/runloop_api_client/types/devbox_view.py | 16 +- .../types/gateway_config_create_params.py | 41 ++ .../types/gateway_config_list_params.py | 21 + .../types/gateway_config_list_view.py | 21 + .../types/gateway_config_update_params.py | 32 + .../types/gateway_config_view.py | 47 ++ tests/api_resources/test_devboxes.py | 12 + tests/api_resources/test_gateway_configs.py | 453 ++++++++++++ 17 files changed, 1496 insertions(+), 7 deletions(-) create mode 100644 src/runloop_api_client/resources/gateway_configs.py create mode 100644 src/runloop_api_client/types/gateway_config_create_params.py create mode 100644 src/runloop_api_client/types/gateway_config_list_params.py create mode 100644 src/runloop_api_client/types/gateway_config_list_view.py create mode 100644 src/runloop_api_client/types/gateway_config_update_params.py create mode 100644 src/runloop_api_client/types/gateway_config_view.py create mode 100644 tests/api_resources/test_gateway_configs.py diff --git a/.stats.yml b/.stats.yml index f28b394ab..cc6ae0f60 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 106 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-63dab7833d6670810c4f4882df560ebbfe2de8e8e1a98d51422368607b5335ae.yml -openapi_spec_hash: ebb5068064f7469f9239b18a51a6fe44 -config_hash: fd168de77f219e46a1427bbec2eecfb9 +configured_endpoints: 111 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-294ebcf6886a5ddbebeaa70923b7674757459e73ef08cd2fbc63fb70e1932eac.yml +openapi_spec_hash: 3a2a14e7ddd646f53d9f21bef2e84ec5 +config_hash: 22f65246be4646c23dde9f69f51252e7 diff --git a/api.md b/api.md index 178bd2add..254deec44 100644 --- a/api.md +++ b/api.md @@ -394,3 +394,24 @@ Methods: - client.network_policies.update(id, \*\*params) -> NetworkPolicyView - client.network_policies.list(\*\*params) -> SyncNetworkPoliciesCursorIDPage[NetworkPolicyView] - client.network_policies.delete(id) -> NetworkPolicyView + +# GatewayConfigs + +Types: + +```python +from runloop_api_client.types import ( + GatewayConfigCreateParameters, + GatewayConfigListView, + GatewayConfigUpdateParameters, + GatewayConfigView, +) +``` + +Methods: + +- client.gateway_configs.create(\*\*params) -> GatewayConfigView +- client.gateway_configs.retrieve(id) -> GatewayConfigView +- client.gateway_configs.update(id, \*\*params) -> GatewayConfigView +- client.gateway_configs.list(\*\*params) -> SyncGatewayConfigsCursorIDPage[GatewayConfigView] +- client.gateway_configs.delete(id) -> GatewayConfigView diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index 3b469e7ec..32561bc0f 100644 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -42,6 +42,7 @@ repositories, benchmark_jobs, benchmark_runs, + gateway_configs, network_policies, ) from .resources.agents import AgentsResource, AsyncAgentsResource @@ -52,6 +53,7 @@ from .resources.repositories import RepositoriesResource, AsyncRepositoriesResource from .resources.benchmark_jobs import BenchmarkJobsResource, AsyncBenchmarkJobsResource from .resources.benchmark_runs import BenchmarkRunsResource, AsyncBenchmarkRunsResource + from .resources.gateway_configs import GatewayConfigsResource, AsyncGatewayConfigsResource from .resources.network_policies import NetworkPoliciesResource, AsyncNetworkPoliciesResource from .resources.devboxes.devboxes import DevboxesResource, AsyncDevboxesResource from .resources.scenarios.scenarios import ScenariosResource, AsyncScenariosResource @@ -182,6 +184,12 @@ def network_policies(self) -> NetworkPoliciesResource: return NetworkPoliciesResource(self) + @cached_property + def gateway_configs(self) -> GatewayConfigsResource: + from .resources.gateway_configs import GatewayConfigsResource + + return GatewayConfigsResource(self) + @cached_property def with_raw_response(self) -> RunloopWithRawResponse: return RunloopWithRawResponse(self) @@ -418,6 +426,12 @@ def network_policies(self) -> AsyncNetworkPoliciesResource: return AsyncNetworkPoliciesResource(self) + @cached_property + def gateway_configs(self) -> AsyncGatewayConfigsResource: + from .resources.gateway_configs import AsyncGatewayConfigsResource + + return AsyncGatewayConfigsResource(self) + @cached_property def with_raw_response(self) -> AsyncRunloopWithRawResponse: return AsyncRunloopWithRawResponse(self) @@ -603,6 +617,12 @@ def network_policies(self) -> network_policies.NetworkPoliciesResourceWithRawRes return NetworkPoliciesResourceWithRawResponse(self._client.network_policies) + @cached_property + def gateway_configs(self) -> gateway_configs.GatewayConfigsResourceWithRawResponse: + from .resources.gateway_configs import GatewayConfigsResourceWithRawResponse + + return GatewayConfigsResourceWithRawResponse(self._client.gateway_configs) + class AsyncRunloopWithRawResponse: _client: AsyncRunloop @@ -676,6 +696,12 @@ def network_policies(self) -> network_policies.AsyncNetworkPoliciesResourceWithR return AsyncNetworkPoliciesResourceWithRawResponse(self._client.network_policies) + @cached_property + def gateway_configs(self) -> gateway_configs.AsyncGatewayConfigsResourceWithRawResponse: + from .resources.gateway_configs import AsyncGatewayConfigsResourceWithRawResponse + + return AsyncGatewayConfigsResourceWithRawResponse(self._client.gateway_configs) + class RunloopWithStreamedResponse: _client: Runloop @@ -749,6 +775,12 @@ def network_policies(self) -> network_policies.NetworkPoliciesResourceWithStream return NetworkPoliciesResourceWithStreamingResponse(self._client.network_policies) + @cached_property + def gateway_configs(self) -> gateway_configs.GatewayConfigsResourceWithStreamingResponse: + from .resources.gateway_configs import GatewayConfigsResourceWithStreamingResponse + + return GatewayConfigsResourceWithStreamingResponse(self._client.gateway_configs) + class AsyncRunloopWithStreamedResponse: _client: AsyncRunloop @@ -822,6 +854,12 @@ def network_policies(self) -> network_policies.AsyncNetworkPoliciesResourceWithS return AsyncNetworkPoliciesResourceWithStreamingResponse(self._client.network_policies) + @cached_property + def gateway_configs(self) -> gateway_configs.AsyncGatewayConfigsResourceWithStreamingResponse: + from .resources.gateway_configs import AsyncGatewayConfigsResourceWithStreamingResponse + + return AsyncGatewayConfigsResourceWithStreamingResponse(self._client.gateway_configs) + Client = Runloop diff --git a/src/runloop_api_client/pagination.py b/src/runloop_api_client/pagination.py index c6e696214..e937259d7 100644 --- a/src/runloop_api_client/pagination.py +++ b/src/runloop_api_client/pagination.py @@ -30,6 +30,8 @@ "AsyncObjectsCursorIDPage", "SyncNetworkPoliciesCursorIDPage", "AsyncNetworkPoliciesCursorIDPage", + "SyncGatewayConfigsCursorIDPage", + "AsyncGatewayConfigsCursorIDPage", ] _T = TypeVar("_T") @@ -95,6 +97,11 @@ class NetworkPoliciesCursorIDPageItem(Protocol): id: str +@runtime_checkable +class GatewayConfigsCursorIDPageItem(Protocol): + id: str + + class SyncBlueprintsCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): blueprints: List[_T] has_more: Optional[bool] = None @@ -909,3 +916,71 @@ def next_page_info(self) -> Optional[PageInfo]: return None return PageInfo(params={"starting_after": item.id}) + + +class SyncGatewayConfigsCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + gateway_configs: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + gateway_configs = self.gateway_configs + if not gateway_configs: + return [] + return gateway_configs + + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + + @override + def next_page_info(self) -> Optional[PageInfo]: + gateway_configs = self.gateway_configs + if not gateway_configs: + return None + + item = cast(Any, gateway_configs[-1]) + if not isinstance(item, GatewayConfigsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) + + +class AsyncGatewayConfigsCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + gateway_configs: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + gateway_configs = self.gateway_configs + if not gateway_configs: + return [] + return gateway_configs + + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + + @override + def next_page_info(self) -> Optional[PageInfo]: + gateway_configs = self.gateway_configs + if not gateway_configs: + return None + + item = cast(Any, gateway_configs[-1]) + if not isinstance(item, GatewayConfigsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) diff --git a/src/runloop_api_client/resources/__init__.py b/src/runloop_api_client/resources/__init__.py index 325158535..877822444 100644 --- a/src/runloop_api_client/resources/__init__.py +++ b/src/runloop_api_client/resources/__init__.py @@ -80,6 +80,14 @@ BenchmarkRunsResourceWithStreamingResponse, AsyncBenchmarkRunsResourceWithStreamingResponse, ) +from .gateway_configs import ( + GatewayConfigsResource, + AsyncGatewayConfigsResource, + GatewayConfigsResourceWithRawResponse, + AsyncGatewayConfigsResourceWithRawResponse, + GatewayConfigsResourceWithStreamingResponse, + AsyncGatewayConfigsResourceWithStreamingResponse, +) from .network_policies import ( NetworkPoliciesResource, AsyncNetworkPoliciesResource, @@ -156,4 +164,10 @@ "AsyncNetworkPoliciesResourceWithRawResponse", "NetworkPoliciesResourceWithStreamingResponse", "AsyncNetworkPoliciesResourceWithStreamingResponse", + "GatewayConfigsResource", + "AsyncGatewayConfigsResource", + "GatewayConfigsResourceWithRawResponse", + "AsyncGatewayConfigsResourceWithRawResponse", + "GatewayConfigsResourceWithStreamingResponse", + "AsyncGatewayConfigsResourceWithStreamingResponse", ] diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index c9e375d08..7e699c5c7 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -154,6 +154,7 @@ def create( entrypoint: Optional[str] | Omit = omit, environment_variables: Optional[Dict[str, str]] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, + gateways: Optional[Dict[str, devbox_create_params.Gateways]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, mounts: Optional[Iterable[Mount]] | Omit = omit, @@ -196,6 +197,12 @@ def create( file_mounts: Map of paths and file contents to write before setup. Use mounts instead. + gateways: [Beta] (Optional) Gateway specifications for credential proxying. Map key is the + environment variable prefix (e.g., 'GWS_ANTHROPIC'). The gateway will proxy + requests to external APIs using the specified credential without exposing the + real API key. Example: {'GWS_ANTHROPIC': {'gateway': 'anthropic', 'secret': + 'my_claude_key'}} + launch_parameters: Parameters to configure the resources and launch time behavior of the Devbox. metadata: User defined metadata to attach to the devbox for organization. @@ -234,6 +241,7 @@ def create( "entrypoint": entrypoint, "environment_variables": environment_variables, "file_mounts": file_mounts, + "gateways": gateways, "launch_parameters": launch_parameters, "metadata": metadata, "mounts": mounts, @@ -1462,6 +1470,7 @@ async def create( entrypoint: Optional[str] | Omit = omit, environment_variables: Optional[Dict[str, str]] | Omit = omit, file_mounts: Optional[Dict[str, str]] | Omit = omit, + gateways: Optional[Dict[str, devbox_create_params.Gateways]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, mounts: Optional[Iterable[Mount]] | Omit = omit, @@ -1504,6 +1513,12 @@ async def create( file_mounts: Map of paths and file contents to write before setup. Use mounts instead. + gateways: [Beta] (Optional) Gateway specifications for credential proxying. Map key is the + environment variable prefix (e.g., 'GWS_ANTHROPIC'). The gateway will proxy + requests to external APIs using the specified credential without exposing the + real API key. Example: {'GWS_ANTHROPIC': {'gateway': 'anthropic', 'secret': + 'my_claude_key'}} + launch_parameters: Parameters to configure the resources and launch time behavior of the Devbox. metadata: User defined metadata to attach to the devbox for organization. @@ -1542,6 +1557,7 @@ async def create( "entrypoint": entrypoint, "environment_variables": environment_variables, "file_mounts": file_mounts, + "gateways": gateways, "launch_parameters": launch_parameters, "metadata": metadata, "mounts": mounts, diff --git a/src/runloop_api_client/resources/gateway_configs.py b/src/runloop_api_client/resources/gateway_configs.py new file mode 100644 index 000000000..38c921fcd --- /dev/null +++ b/src/runloop_api_client/resources/gateway_configs.py @@ -0,0 +1,658 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +import httpx + +from ..types import gateway_config_list_params, gateway_config_create_params, gateway_config_update_params +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from .._utils import maybe_transform, async_maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..pagination import SyncGatewayConfigsCursorIDPage, AsyncGatewayConfigsCursorIDPage +from .._base_client import AsyncPaginator, make_request_options +from ..types.gateway_config_view import GatewayConfigView + +__all__ = ["GatewayConfigsResource", "AsyncGatewayConfigsResource"] + + +class GatewayConfigsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> GatewayConfigsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return GatewayConfigsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> GatewayConfigsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return GatewayConfigsResourceWithStreamingResponse(self) + + def create( + self, + *, + auth_mechanism: gateway_config_create_params.AuthMechanism, + endpoint: str, + name: str, + description: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> GatewayConfigView: + """ + [Beta] Create a new GatewayConfig to proxy API requests through the credential + gateway. The config specifies the target endpoint and how credentials should be + applied. + + Args: + auth_mechanism: How credentials should be applied to proxied requests. Specify the type + ('header', 'bearer') and optional key field. + + endpoint: The target endpoint URL (e.g., 'https://api.anthropic.com'). + + name: The human-readable name for the GatewayConfig. Must be unique within your + account. + + description: Optional description for this gateway configuration. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/v1/gateway-configs", + body=maybe_transform( + { + "auth_mechanism": auth_mechanism, + "endpoint": endpoint, + "name": name, + "description": description, + }, + gateway_config_create_params.GatewayConfigCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=GatewayConfigView, + ) + + def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> GatewayConfigView: + """ + [Beta] Get a specific GatewayConfig by its unique identifier. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/gateway-configs/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=GatewayConfigView, + ) + + def update( + self, + id: str, + *, + auth_mechanism: Optional[gateway_config_update_params.AuthMechanism] | Omit = omit, + description: Optional[str] | Omit = omit, + endpoint: Optional[str] | Omit = omit, + name: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> GatewayConfigView: + """[Beta] Update an existing GatewayConfig. + + All fields are optional. + + Args: + auth_mechanism: New authentication mechanism for applying credentials to proxied requests. + + description: New description for this gateway configuration. + + endpoint: New target endpoint URL (e.g., 'https://api.anthropic.com'). + + name: New name for the GatewayConfig. Must be unique within your account. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/gateway-configs/{id}", + body=maybe_transform( + { + "auth_mechanism": auth_mechanism, + "description": description, + "endpoint": endpoint, + "name": name, + }, + gateway_config_update_params.GatewayConfigUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=GatewayConfigView, + ) + + def list( + self, + *, + id: str | Omit = omit, + limit: int | Omit = omit, + name: str | Omit = omit, + starting_after: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncGatewayConfigsCursorIDPage[GatewayConfigView]: + """ + [Beta] List all GatewayConfigs for the authenticated account, including + system-provided configs like 'anthropic' and 'openai'. + + Args: + id: Filter by ID. + + limit: The limit of items to return. Default is 20. Max is 5000. + + name: Filter by name (partial match supported). + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/gateway-configs", + page=SyncGatewayConfigsCursorIDPage[GatewayConfigView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "id": id, + "limit": limit, + "name": name, + "starting_after": starting_after, + }, + gateway_config_list_params.GatewayConfigListParams, + ), + ), + model=GatewayConfigView, + ) + + def delete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> GatewayConfigView: + """[Beta] Delete an existing GatewayConfig. + + This action is irreversible. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/gateway-configs/{id}/delete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=GatewayConfigView, + ) + + +class AsyncGatewayConfigsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncGatewayConfigsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncGatewayConfigsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncGatewayConfigsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncGatewayConfigsResourceWithStreamingResponse(self) + + async def create( + self, + *, + auth_mechanism: gateway_config_create_params.AuthMechanism, + endpoint: str, + name: str, + description: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> GatewayConfigView: + """ + [Beta] Create a new GatewayConfig to proxy API requests through the credential + gateway. The config specifies the target endpoint and how credentials should be + applied. + + Args: + auth_mechanism: How credentials should be applied to proxied requests. Specify the type + ('header', 'bearer') and optional key field. + + endpoint: The target endpoint URL (e.g., 'https://api.anthropic.com'). + + name: The human-readable name for the GatewayConfig. Must be unique within your + account. + + description: Optional description for this gateway configuration. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/v1/gateway-configs", + body=await async_maybe_transform( + { + "auth_mechanism": auth_mechanism, + "endpoint": endpoint, + "name": name, + "description": description, + }, + gateway_config_create_params.GatewayConfigCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=GatewayConfigView, + ) + + async def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> GatewayConfigView: + """ + [Beta] Get a specific GatewayConfig by its unique identifier. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/gateway-configs/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=GatewayConfigView, + ) + + async def update( + self, + id: str, + *, + auth_mechanism: Optional[gateway_config_update_params.AuthMechanism] | Omit = omit, + description: Optional[str] | Omit = omit, + endpoint: Optional[str] | Omit = omit, + name: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> GatewayConfigView: + """[Beta] Update an existing GatewayConfig. + + All fields are optional. + + Args: + auth_mechanism: New authentication mechanism for applying credentials to proxied requests. + + description: New description for this gateway configuration. + + endpoint: New target endpoint URL (e.g., 'https://api.anthropic.com'). + + name: New name for the GatewayConfig. Must be unique within your account. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/gateway-configs/{id}", + body=await async_maybe_transform( + { + "auth_mechanism": auth_mechanism, + "description": description, + "endpoint": endpoint, + "name": name, + }, + gateway_config_update_params.GatewayConfigUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=GatewayConfigView, + ) + + def list( + self, + *, + id: str | Omit = omit, + limit: int | Omit = omit, + name: str | Omit = omit, + starting_after: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[GatewayConfigView, AsyncGatewayConfigsCursorIDPage[GatewayConfigView]]: + """ + [Beta] List all GatewayConfigs for the authenticated account, including + system-provided configs like 'anthropic' and 'openai'. + + Args: + id: Filter by ID. + + limit: The limit of items to return. Default is 20. Max is 5000. + + name: Filter by name (partial match supported). + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/gateway-configs", + page=AsyncGatewayConfigsCursorIDPage[GatewayConfigView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "id": id, + "limit": limit, + "name": name, + "starting_after": starting_after, + }, + gateway_config_list_params.GatewayConfigListParams, + ), + ), + model=GatewayConfigView, + ) + + async def delete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> GatewayConfigView: + """[Beta] Delete an existing GatewayConfig. + + This action is irreversible. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/gateway-configs/{id}/delete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=GatewayConfigView, + ) + + +class GatewayConfigsResourceWithRawResponse: + def __init__(self, gateway_configs: GatewayConfigsResource) -> None: + self._gateway_configs = gateway_configs + + self.create = to_raw_response_wrapper( + gateway_configs.create, + ) + self.retrieve = to_raw_response_wrapper( + gateway_configs.retrieve, + ) + self.update = to_raw_response_wrapper( + gateway_configs.update, + ) + self.list = to_raw_response_wrapper( + gateway_configs.list, + ) + self.delete = to_raw_response_wrapper( + gateway_configs.delete, + ) + + +class AsyncGatewayConfigsResourceWithRawResponse: + def __init__(self, gateway_configs: AsyncGatewayConfigsResource) -> None: + self._gateway_configs = gateway_configs + + self.create = async_to_raw_response_wrapper( + gateway_configs.create, + ) + self.retrieve = async_to_raw_response_wrapper( + gateway_configs.retrieve, + ) + self.update = async_to_raw_response_wrapper( + gateway_configs.update, + ) + self.list = async_to_raw_response_wrapper( + gateway_configs.list, + ) + self.delete = async_to_raw_response_wrapper( + gateway_configs.delete, + ) + + +class GatewayConfigsResourceWithStreamingResponse: + def __init__(self, gateway_configs: GatewayConfigsResource) -> None: + self._gateway_configs = gateway_configs + + self.create = to_streamed_response_wrapper( + gateway_configs.create, + ) + self.retrieve = to_streamed_response_wrapper( + gateway_configs.retrieve, + ) + self.update = to_streamed_response_wrapper( + gateway_configs.update, + ) + self.list = to_streamed_response_wrapper( + gateway_configs.list, + ) + self.delete = to_streamed_response_wrapper( + gateway_configs.delete, + ) + + +class AsyncGatewayConfigsResourceWithStreamingResponse: + def __init__(self, gateway_configs: AsyncGatewayConfigsResource) -> None: + self._gateway_configs = gateway_configs + + self.create = async_to_streamed_response_wrapper( + gateway_configs.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + gateway_configs.retrieve, + ) + self.update = async_to_streamed_response_wrapper( + gateway_configs.update, + ) + self.list = async_to_streamed_response_wrapper( + gateway_configs.list, + ) + self.delete = async_to_streamed_response_wrapper( + gateway_configs.delete, + ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 59130e662..be02c8312 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -37,6 +37,7 @@ from .agent_create_params import AgentCreateParams as AgentCreateParams from .blueprint_build_log import BlueprintBuildLog as BlueprintBuildLog from .blueprint_list_view import BlueprintListView as BlueprintListView +from .gateway_config_view import GatewayConfigView as GatewayConfigView from .input_context_param import InputContextParam as InputContextParam from .network_policy_view import NetworkPolicyView as NetworkPolicyView from .devbox_create_params import DevboxCreateParams as DevboxCreateParams @@ -65,6 +66,7 @@ from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams from .inspection_source_param import InspectionSourceParam as InspectionSourceParam from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams +from .gateway_config_list_view import GatewayConfigListView as GatewayConfigListView from .network_policy_list_view import NetworkPolicyListView as NetworkPolicyListView from .object_download_url_view import ObjectDownloadURLView as ObjectDownloadURLView from .repository_create_params import RepositoryCreateParams as RepositoryCreateParams @@ -81,6 +83,7 @@ from .benchmark_start_run_params import BenchmarkStartRunParams as BenchmarkStartRunParams from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams +from .gateway_config_list_params import GatewayConfigListParams as GatewayConfigListParams from .input_context_update_param import InputContextUpdateParam as InputContextUpdateParam from .network_policy_list_params import NetworkPolicyListParams as NetworkPolicyListParams from .repository_connection_view import RepositoryConnectionView as RepositoryConnectionView @@ -96,6 +99,8 @@ from .benchmark_list_public_params import BenchmarkListPublicParams as BenchmarkListPublicParams from .blueprint_list_public_params import BlueprintListPublicParams as BlueprintListPublicParams from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView +from .gateway_config_create_params import GatewayConfigCreateParams as GatewayConfigCreateParams +from .gateway_config_update_params import GatewayConfigUpdateParams as GatewayConfigUpdateParams from .network_policy_create_params import NetworkPolicyCreateParams as NetworkPolicyCreateParams from .network_policy_update_params import NetworkPolicyUpdateParams as NetworkPolicyUpdateParams from .scoring_contract_result_view import ScoringContractResultView as ScoringContractResultView diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 4cecd0e72..9e04cef4d 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Dict, Iterable, Optional -from typing_extensions import TypedDict +from typing_extensions import Required, TypedDict from .shared_params.mount import Mount from .shared_params.launch_parameters import LaunchParameters from .shared_params.code_mount_parameters import CodeMountParameters -__all__ = ["DevboxCreateParams"] +__all__ = ["DevboxCreateParams", "Gateways"] class DevboxCreateParams(TypedDict, total=False): @@ -44,6 +44,15 @@ class DevboxCreateParams(TypedDict, total=False): file_mounts: Optional[Dict[str, str]] """Map of paths and file contents to write before setup. Use mounts instead.""" + gateways: Optional[Dict[str, Gateways]] + """[Beta] (Optional) Gateway specifications for credential proxying. + + Map key is the environment variable prefix (e.g., 'GWS_ANTHROPIC'). The gateway + will proxy requests to external APIs using the specified credential without + exposing the real API key. Example: {'GWS_ANTHROPIC': {'gateway': 'anthropic', + 'secret': 'my_claude_key'}} + """ + launch_parameters: Optional[LaunchParameters] """Parameters to configure the resources and launch time behavior of the Devbox.""" @@ -72,3 +81,15 @@ class DevboxCreateParams(TypedDict, total=False): Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified. """ + + +class Gateways(TypedDict, total=False): + """ + [Beta] GatewaySpec links a gateway configuration to a secret for credential proxying in a devbox. The gateway will proxy requests to external APIs using the specified credential without exposing the real API key. + """ + + gateway: Required[str] + """The gateway config to use. Can be a gateway config ID (gwc_xxx) or name.""" + + secret: Required[str] + """The secret containing the credential. Can be a secret ID or name.""" diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index cf9dc2383..8db65da9b 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -6,7 +6,7 @@ from .._models import BaseModel from .shared.launch_parameters import LaunchParameters -__all__ = ["DevboxView", "StateTransition"] +__all__ = ["DevboxView", "StateTransition", "GatewaySpecs"] class StateTransition(BaseModel): @@ -30,6 +30,14 @@ class StateTransition(BaseModel): """The time the status change occurred""" +class GatewaySpecs(BaseModel): + gateway_config_id: str + """The ID of the gateway config (e.g., gwc_123abc).""" + + secret_id: str + """The ID of the secret containing the credential.""" + + class DevboxView(BaseModel): """A Devbox represents a virtual development environment. @@ -78,6 +86,12 @@ class DevboxView(BaseModel): failure_reason: Optional[Literal["out_of_memory", "out_of_disk", "execution_failed"]] = None """The failure reason if the Devbox failed, if the Devbox has a 'failure' status.""" + gateway_specs: Optional[Dict[str, GatewaySpecs]] = None + """[Beta] Gateway specifications configured for this devbox. + + Map key is the environment variable prefix (e.g., 'GWS_ANTHROPIC'). + """ + initiator_id: Optional[str] = None """The ID of the initiator that created the Devbox.""" diff --git a/src/runloop_api_client/types/gateway_config_create_params.py b/src/runloop_api_client/types/gateway_config_create_params.py new file mode 100644 index 000000000..6a39055e4 --- /dev/null +++ b/src/runloop_api_client/types/gateway_config_create_params.py @@ -0,0 +1,41 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +__all__ = ["GatewayConfigCreateParams", "AuthMechanism"] + + +class GatewayConfigCreateParams(TypedDict, total=False): + auth_mechanism: Required[AuthMechanism] + """How credentials should be applied to proxied requests. + + Specify the type ('header', 'bearer') and optional key field. + """ + + endpoint: Required[str] + """The target endpoint URL (e.g., 'https://api.anthropic.com').""" + + name: Required[str] + """The human-readable name for the GatewayConfig. + + Must be unique within your account. + """ + + description: Optional[str] + """Optional description for this gateway configuration.""" + + +class AuthMechanism(TypedDict, total=False): + """How credentials should be applied to proxied requests. + + Specify the type ('header', 'bearer') and optional key field. + """ + + type: Required[str] + """The type of authentication mechanism: 'header', 'bearer'.""" + + key: Optional[str] + """For 'header' type: the header name (e.g., 'x-api-key').""" diff --git a/src/runloop_api_client/types/gateway_config_list_params.py b/src/runloop_api_client/types/gateway_config_list_params.py new file mode 100644 index 000000000..cc8706b95 --- /dev/null +++ b/src/runloop_api_client/types/gateway_config_list_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["GatewayConfigListParams"] + + +class GatewayConfigListParams(TypedDict, total=False): + id: str + """Filter by ID.""" + + limit: int + """The limit of items to return. Default is 20. Max is 5000.""" + + name: str + """Filter by name (partial match supported).""" + + starting_after: str + """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/gateway_config_list_view.py b/src/runloop_api_client/types/gateway_config_list_view.py new file mode 100644 index 000000000..77fce4455 --- /dev/null +++ b/src/runloop_api_client/types/gateway_config_list_view.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .gateway_config_view import GatewayConfigView + +__all__ = ["GatewayConfigListView"] + + +class GatewayConfigListView(BaseModel): + """A paginated list of GatewayConfigs.""" + + gateway_configs: List[GatewayConfigView] + """The list of GatewayConfigs.""" + + has_more: bool + """Whether there are more results available beyond this page.""" + + total_count: int + """Total count of GatewayConfigs that match the query.""" diff --git a/src/runloop_api_client/types/gateway_config_update_params.py b/src/runloop_api_client/types/gateway_config_update_params.py new file mode 100644 index 000000000..cdf385702 --- /dev/null +++ b/src/runloop_api_client/types/gateway_config_update_params.py @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +__all__ = ["GatewayConfigUpdateParams", "AuthMechanism"] + + +class GatewayConfigUpdateParams(TypedDict, total=False): + auth_mechanism: Optional[AuthMechanism] + """New authentication mechanism for applying credentials to proxied requests.""" + + description: Optional[str] + """New description for this gateway configuration.""" + + endpoint: Optional[str] + """New target endpoint URL (e.g., 'https://api.anthropic.com').""" + + name: Optional[str] + """New name for the GatewayConfig. Must be unique within your account.""" + + +class AuthMechanism(TypedDict, total=False): + """New authentication mechanism for applying credentials to proxied requests.""" + + type: Required[str] + """The type of authentication mechanism: 'header', 'bearer'.""" + + key: Optional[str] + """For 'header' type: the header name (e.g., 'x-api-key').""" diff --git a/src/runloop_api_client/types/gateway_config_view.py b/src/runloop_api_client/types/gateway_config_view.py new file mode 100644 index 000000000..a6e3b3ac4 --- /dev/null +++ b/src/runloop_api_client/types/gateway_config_view.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["GatewayConfigView", "AuthMechanism"] + + +class AuthMechanism(BaseModel): + """How credentials should be applied to proxied requests.""" + + type: str + """The type of authentication mechanism: 'header', 'bearer'.""" + + key: Optional[str] = None + """For 'header' type: the header name (e.g., 'x-api-key').""" + + +class GatewayConfigView(BaseModel): + """ + A GatewayConfig defines a configuration for proxying API requests through the credential gateway. It specifies the target endpoint and how credentials should be applied. + """ + + id: str + """The unique identifier of the GatewayConfig.""" + + auth_mechanism: AuthMechanism + """How credentials should be applied to proxied requests.""" + + create_time_ms: int + """Creation time of the GatewayConfig (Unix timestamp in milliseconds).""" + + endpoint: str + """The target endpoint URL (e.g., 'https://api.anthropic.com').""" + + name: str + """The human-readable name of the GatewayConfig. + + Unique per account (or globally for system configs). + """ + + account_id: Optional[str] = None + """The account ID that owns this config.""" + + description: Optional[str] = None + """Optional description for this gateway configuration.""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 878a09e9c..07ebf7aa1 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -61,6 +61,12 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: entrypoint="entrypoint", environment_variables={"foo": "string"}, file_mounts={"foo": "string"}, + gateways={ + "foo": { + "gateway": "gateway", + "secret": "secret", + } + }, launch_parameters={ "after_idle": { "idle_time_seconds": 0, @@ -1137,6 +1143,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - entrypoint="entrypoint", environment_variables={"foo": "string"}, file_mounts={"foo": "string"}, + gateways={ + "foo": { + "gateway": "gateway", + "secret": "secret", + } + }, launch_parameters={ "after_idle": { "idle_time_seconds": 0, diff --git a/tests/api_resources/test_gateway_configs.py b/tests/api_resources/test_gateway_configs.py new file mode 100644 index 000000000..6265b9875 --- /dev/null +++ b/tests/api_resources/test_gateway_configs.py @@ -0,0 +1,453 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types import ( + GatewayConfigView, +) +from runloop_api_client.pagination import SyncGatewayConfigsCursorIDPage, AsyncGatewayConfigsCursorIDPage + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestGatewayConfigs: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Runloop) -> None: + gateway_config = client.gateway_configs.create( + auth_mechanism={"type": "type"}, + endpoint="endpoint", + name="name", + ) + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Runloop) -> None: + gateway_config = client.gateway_configs.create( + auth_mechanism={ + "type": "type", + "key": "key", + }, + endpoint="endpoint", + name="name", + description="description", + ) + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Runloop) -> None: + response = client.gateway_configs.with_raw_response.create( + auth_mechanism={"type": "type"}, + endpoint="endpoint", + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + gateway_config = response.parse() + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Runloop) -> None: + with client.gateway_configs.with_streaming_response.create( + auth_mechanism={"type": "type"}, + endpoint="endpoint", + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + gateway_config = response.parse() + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + gateway_config = client.gateway_configs.retrieve( + "id", + ) + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.gateway_configs.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + gateway_config = response.parse() + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.gateway_configs.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + gateway_config = response.parse() + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.gateway_configs.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_update(self, client: Runloop) -> None: + gateway_config = client.gateway_configs.update( + id="id", + ) + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Runloop) -> None: + gateway_config = client.gateway_configs.update( + id="id", + auth_mechanism={ + "type": "type", + "key": "key", + }, + description="description", + endpoint="endpoint", + name="name", + ) + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Runloop) -> None: + response = client.gateway_configs.with_raw_response.update( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + gateway_config = response.parse() + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Runloop) -> None: + with client.gateway_configs.with_streaming_response.update( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + gateway_config = response.parse() + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.gateway_configs.with_raw_response.update( + id="", + ) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + gateway_config = client.gateway_configs.list() + assert_matches_type(SyncGatewayConfigsCursorIDPage[GatewayConfigView], gateway_config, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + gateway_config = client.gateway_configs.list( + id="id", + limit=0, + name="name", + starting_after="starting_after", + ) + assert_matches_type(SyncGatewayConfigsCursorIDPage[GatewayConfigView], gateway_config, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.gateway_configs.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + gateway_config = response.parse() + assert_matches_type(SyncGatewayConfigsCursorIDPage[GatewayConfigView], gateway_config, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.gateway_configs.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + gateway_config = response.parse() + assert_matches_type(SyncGatewayConfigsCursorIDPage[GatewayConfigView], gateway_config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_delete(self, client: Runloop) -> None: + gateway_config = client.gateway_configs.delete( + "id", + ) + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Runloop) -> None: + response = client.gateway_configs.with_raw_response.delete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + gateway_config = response.parse() + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Runloop) -> None: + with client.gateway_configs.with_streaming_response.delete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + gateway_config = response.parse() + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.gateway_configs.with_raw_response.delete( + "", + ) + + +class TestAsyncGatewayConfigs: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_create(self, async_client: AsyncRunloop) -> None: + gateway_config = await async_client.gateway_configs.create( + auth_mechanism={"type": "type"}, + endpoint="endpoint", + name="name", + ) + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: + gateway_config = await async_client.gateway_configs.create( + auth_mechanism={ + "type": "type", + "key": "key", + }, + endpoint="endpoint", + name="name", + description="description", + ) + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: + response = await async_client.gateway_configs.with_raw_response.create( + auth_mechanism={"type": "type"}, + endpoint="endpoint", + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + gateway_config = await response.parse() + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: + async with async_client.gateway_configs.with_streaming_response.create( + auth_mechanism={"type": "type"}, + endpoint="endpoint", + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + gateway_config = await response.parse() + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + gateway_config = await async_client.gateway_configs.retrieve( + "id", + ) + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.gateway_configs.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + gateway_config = await response.parse() + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.gateway_configs.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + gateway_config = await response.parse() + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.gateway_configs.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_update(self, async_client: AsyncRunloop) -> None: + gateway_config = await async_client.gateway_configs.update( + id="id", + ) + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncRunloop) -> None: + gateway_config = await async_client.gateway_configs.update( + id="id", + auth_mechanism={ + "type": "type", + "key": "key", + }, + description="description", + endpoint="endpoint", + name="name", + ) + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: + response = await async_client.gateway_configs.with_raw_response.update( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + gateway_config = await response.parse() + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncRunloop) -> None: + async with async_client.gateway_configs.with_streaming_response.update( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + gateway_config = await response.parse() + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.gateway_configs.with_raw_response.update( + id="", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + gateway_config = await async_client.gateway_configs.list() + assert_matches_type(AsyncGatewayConfigsCursorIDPage[GatewayConfigView], gateway_config, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + gateway_config = await async_client.gateway_configs.list( + id="id", + limit=0, + name="name", + starting_after="starting_after", + ) + assert_matches_type(AsyncGatewayConfigsCursorIDPage[GatewayConfigView], gateway_config, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.gateway_configs.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + gateway_config = await response.parse() + assert_matches_type(AsyncGatewayConfigsCursorIDPage[GatewayConfigView], gateway_config, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.gateway_configs.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + gateway_config = await response.parse() + assert_matches_type(AsyncGatewayConfigsCursorIDPage[GatewayConfigView], gateway_config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete(self, async_client: AsyncRunloop) -> None: + gateway_config = await async_client.gateway_configs.delete( + "id", + ) + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncRunloop) -> None: + response = await async_client.gateway_configs.with_raw_response.delete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + gateway_config = await response.parse() + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncRunloop) -> None: + async with async_client.gateway_configs.with_streaming_response.delete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + gateway_config = await response.parse() + assert_matches_type(GatewayConfigView, gateway_config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.gateway_configs.with_raw_response.delete( + "", + ) From 7ca68845a58a930896adaff1f0821c736851fd17 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 17:56:17 +0000 Subject: [PATCH 952/993] chore(documentation): made warning message language more accurate (#7215) --- .stats.yml | 4 ++-- .../types/shared/launch_parameters.py | 15 +++------------ .../types/shared_params/launch_parameters.py | 15 +++------------ 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/.stats.yml b/.stats.yml index cc6ae0f60..410475b64 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-294ebcf6886a5ddbebeaa70923b7674757459e73ef08cd2fbc63fb70e1932eac.yml -openapi_spec_hash: 3a2a14e7ddd646f53d9f21bef2e84ec5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c89b52af46573ea81341b7115e59ee3f995ff9fe5b48a04318176d9b30e7eb79.yml +openapi_spec_hash: a8b42cc79a4fc993c8cc5cc13fc443a2 config_hash: 22f65246be4646c23dde9f69f51252e7 diff --git a/src/runloop_api_client/types/shared/launch_parameters.py b/src/runloop_api_client/types/shared/launch_parameters.py index 04d7f27a0..0264fa5c8 100644 --- a/src/runloop_api_client/types/shared/launch_parameters.py +++ b/src/runloop_api_client/types/shared/launch_parameters.py @@ -44,22 +44,13 @@ class LaunchParameters(BaseModel): """ custom_cpu_cores: Optional[int] = None - """custom resource size, number of cpu cores, must be multiple of 2. - - Min is 1, max is 16. - """ + """Custom CPU cores. Must be 0.5, 1, or a multiple of 2. Max is 16.""" custom_disk_size: Optional[int] = None - """custom disk size, number in GiB, must be a multiple of 2. - - Min is 2GiB, max is 64GiB. - """ + """Custom disk size in GiB. Must be a multiple of 2. Min is 2GiB, max is 64GiB.""" custom_gb_memory: Optional[int] = None - """custom memory size, number in GiB, must be a multiple of 2. - - Min is 2GiB, max is 64GiB. - """ + """Custom memory size in GiB. Must be 1 or a multiple of 2. Max is 64GiB.""" keep_alive_time_seconds: Optional[int] = None """Time in seconds after which Devbox will automatically shutdown. diff --git a/src/runloop_api_client/types/shared_params/launch_parameters.py b/src/runloop_api_client/types/shared_params/launch_parameters.py index e3f00d1d3..5c785b9f9 100644 --- a/src/runloop_api_client/types/shared_params/launch_parameters.py +++ b/src/runloop_api_client/types/shared_params/launch_parameters.py @@ -46,22 +46,13 @@ class LaunchParameters(TypedDict, total=False): """ custom_cpu_cores: Optional[int] - """custom resource size, number of cpu cores, must be multiple of 2. - - Min is 1, max is 16. - """ + """Custom CPU cores. Must be 0.5, 1, or a multiple of 2. Max is 16.""" custom_disk_size: Optional[int] - """custom disk size, number in GiB, must be a multiple of 2. - - Min is 2GiB, max is 64GiB. - """ + """Custom disk size in GiB. Must be a multiple of 2. Min is 2GiB, max is 64GiB.""" custom_gb_memory: Optional[int] - """custom memory size, number in GiB, must be a multiple of 2. - - Min is 2GiB, max is 64GiB. - """ + """Custom memory size in GiB. Must be 1 or a multiple of 2. Max is 64GiB.""" keep_alive_time_seconds: Optional[int] """Time in seconds after which Devbox will automatically shutdown. From 9465cfe94703cf1aeea3db680ef7d536652fff2c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 19:38:53 +0000 Subject: [PATCH 953/993] feat(devbox): add new tunnel APIs and deprecate old tunnel API (#7227) --- .stats.yml | 4 +- .../resources/devboxes/devboxes.py | 52 +++++++--- .../types/devbox_create_params.py | 21 +++- src/runloop_api_client/types/devbox_view.py | 32 ++++++- tests/api_resources/test_devboxes.py | 96 +++++++++++-------- 5 files changed, 146 insertions(+), 59 deletions(-) diff --git a/.stats.yml b/.stats.yml index 410475b64..94d83f0c1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c89b52af46573ea81341b7115e59ee3f995ff9fe5b48a04318176d9b30e7eb79.yml -openapi_spec_hash: a8b42cc79a4fc993c8cc5cc13fc443a2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-debd1f9a9d599b009905cbaaea3095c025fe290493c8a836f54ece22265579c1.yml +openapi_spec_hash: ee42d2c73aaad86888360147d9ed0766 config_hash: 22f65246be4646c23dde9f69f51252e7 diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 7e699c5c7..b19869917 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -162,6 +162,7 @@ def create( repo_connection_id: Optional[str] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, snapshot_id: Optional[str] | Omit = omit, + tunnel: Optional[devbox_create_params.Tunnel] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -221,6 +222,10 @@ def create( snapshot_id: Snapshot ID to use for the Devbox. Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified. + tunnel: (Optional) Configuration for creating a V2 tunnel at Devbox launch time. When + specified, a tunnel will be automatically provisioned and the tunnel details + will be included in the Devbox response. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -249,6 +254,7 @@ def create( "repo_connection_id": repo_connection_id, "secrets": secrets, "snapshot_id": snapshot_id, + "tunnel": tunnel, }, devbox_create_params.DevboxCreateParams, ), @@ -443,6 +449,7 @@ def create_ssh_key( cast_to=DevboxCreateSSHKeyResponse, ) + @typing_extensions.deprecated("deprecated") def create_tunnel( self, id: str, @@ -456,8 +463,11 @@ def create_tunnel( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxTunnelView: - """ - Create a live tunnel to an available port on the Devbox. + """[Deprecated] Use POST /v1/devboxes/{id}/enable_tunnel instead. + + This endpoint + creates a legacy tunnel. The new enable_tunnel endpoint provides improved tunnel + functionality with authentication options. Args: port: Devbox port that tunnel will expose. @@ -1478,6 +1488,7 @@ async def create( repo_connection_id: Optional[str] | Omit = omit, secrets: Optional[Dict[str, str]] | Omit = omit, snapshot_id: Optional[str] | Omit = omit, + tunnel: Optional[devbox_create_params.Tunnel] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1537,6 +1548,10 @@ async def create( snapshot_id: Snapshot ID to use for the Devbox. Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified. + tunnel: (Optional) Configuration for creating a V2 tunnel at Devbox launch time. When + specified, a tunnel will be automatically provisioned and the tunnel details + will be included in the Devbox response. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1565,6 +1580,7 @@ async def create( "repo_connection_id": repo_connection_id, "secrets": secrets, "snapshot_id": snapshot_id, + "tunnel": tunnel, }, devbox_create_params.DevboxCreateParams, ), @@ -1759,6 +1775,7 @@ async def create_ssh_key( cast_to=DevboxCreateSSHKeyResponse, ) + @typing_extensions.deprecated("deprecated") async def create_tunnel( self, id: str, @@ -1772,8 +1789,11 @@ async def create_tunnel( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> DevboxTunnelView: - """ - Create a live tunnel to an available port on the Devbox. + """[Deprecated] Use POST /v1/devboxes/{id}/enable_tunnel instead. + + This endpoint + creates a legacy tunnel. The new enable_tunnel endpoint provides improved tunnel + functionality with authentication options. Args: port: Devbox port that tunnel will expose. @@ -2758,8 +2778,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.create_ssh_key = to_raw_response_wrapper( devboxes.create_ssh_key, ) - self.create_tunnel = to_raw_response_wrapper( - devboxes.create_tunnel, + self.create_tunnel = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + devboxes.create_tunnel, # pyright: ignore[reportDeprecated], + ) ) self.delete_disk_snapshot = to_raw_response_wrapper( devboxes.delete_disk_snapshot, @@ -2856,8 +2878,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.create_ssh_key = async_to_raw_response_wrapper( devboxes.create_ssh_key, ) - self.create_tunnel = async_to_raw_response_wrapper( - devboxes.create_tunnel, + self.create_tunnel = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + devboxes.create_tunnel, # pyright: ignore[reportDeprecated], + ) ) self.delete_disk_snapshot = async_to_raw_response_wrapper( devboxes.delete_disk_snapshot, @@ -2954,8 +2978,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.create_ssh_key = to_streamed_response_wrapper( devboxes.create_ssh_key, ) - self.create_tunnel = to_streamed_response_wrapper( - devboxes.create_tunnel, + self.create_tunnel = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + devboxes.create_tunnel, # pyright: ignore[reportDeprecated], + ) ) self.delete_disk_snapshot = to_streamed_response_wrapper( devboxes.delete_disk_snapshot, @@ -3052,8 +3078,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.create_ssh_key = async_to_streamed_response_wrapper( devboxes.create_ssh_key, ) - self.create_tunnel = async_to_streamed_response_wrapper( - devboxes.create_tunnel, + self.create_tunnel = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + devboxes.create_tunnel, # pyright: ignore[reportDeprecated], + ) ) self.delete_disk_snapshot = async_to_streamed_response_wrapper( devboxes.delete_disk_snapshot, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 9e04cef4d..9d1324a8c 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -3,13 +3,13 @@ from __future__ import annotations from typing import Dict, Iterable, Optional -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict from .shared_params.mount import Mount from .shared_params.launch_parameters import LaunchParameters from .shared_params.code_mount_parameters import CodeMountParameters -__all__ = ["DevboxCreateParams", "Gateways"] +__all__ = ["DevboxCreateParams", "Gateways", "Tunnel"] class DevboxCreateParams(TypedDict, total=False): @@ -82,6 +82,13 @@ class DevboxCreateParams(TypedDict, total=False): Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified. """ + tunnel: Optional[Tunnel] + """(Optional) Configuration for creating a V2 tunnel at Devbox launch time. + + When specified, a tunnel will be automatically provisioned and the tunnel + details will be included in the Devbox response. + """ + class Gateways(TypedDict, total=False): """ @@ -93,3 +100,13 @@ class Gateways(TypedDict, total=False): secret: Required[str] """The secret containing the credential. Can be a secret ID or name.""" + + +class Tunnel(TypedDict, total=False): + """(Optional) Configuration for creating a V2 tunnel at Devbox launch time. + + When specified, a tunnel will be automatically provisioned and the tunnel details will be included in the Devbox response. + """ + + auth_mode: Optional[Literal["open", "authenticated"]] + """Authentication mode for the tunnel. Defaults to 'public' if not specified.""" diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 8db65da9b..50422db1f 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -6,7 +6,7 @@ from .._models import BaseModel from .shared.launch_parameters import LaunchParameters -__all__ = ["DevboxView", "StateTransition", "GatewaySpecs"] +__all__ = ["DevboxView", "StateTransition", "GatewaySpecs", "Tunnel"] class StateTransition(BaseModel): @@ -38,6 +38,30 @@ class GatewaySpecs(BaseModel): """The ID of the secret containing the credential.""" +class Tunnel(BaseModel): + """ + V2 tunnel information if a tunnel was created at launch time or via the createTunnel API. + """ + + auth_mode: Literal["public_", "authenticated"] + """The authentication mode for the tunnel.""" + + create_time_ms: int + """Creation time of the tunnel (Unix timestamp milliseconds).""" + + tunnel_key: str + """The encrypted tunnel key used to construct the tunnel URL. + + URL format: https://{port}-{tunnel_key}.tunnel.runloop.{domain} + """ + + auth_token: Optional[str] = None + """Bearer token for tunnel authentication. + + Only present when auth_mode is 'authenticated'. + """ + + class DevboxView(BaseModel): """A Devbox represents a virtual development environment. @@ -112,3 +136,9 @@ class DevboxView(BaseModel): The Snapshot ID used in creation of the Devbox, if the devbox was created from a Snapshot. """ + + tunnel: Optional[Tunnel] = None + """ + V2 tunnel information if a tunnel was created at launch time or via the + createTunnel API. + """ diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 07ebf7aa1..8834075f7 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -99,6 +99,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: repo_connection_id="repo_connection_id", secrets={"foo": "string"}, snapshot_id="snapshot_id", + tunnel={"auth_mode": "open"}, ) assert_matches_type(DevboxView, devbox, path=["response"]) @@ -281,18 +282,21 @@ def test_path_params_create_ssh_key(self, client: Runloop) -> None: @parametrize def test_method_create_tunnel(self, client: Runloop) -> None: - devbox = client.devboxes.create_tunnel( - id="id", - port=0, - ) + with pytest.warns(DeprecationWarning): + devbox = client.devboxes.create_tunnel( + id="id", + port=0, + ) + assert_matches_type(DevboxTunnelView, devbox, path=["response"]) @parametrize def test_raw_response_create_tunnel(self, client: Runloop) -> None: - response = client.devboxes.with_raw_response.create_tunnel( - id="id", - port=0, - ) + with pytest.warns(DeprecationWarning): + response = client.devboxes.with_raw_response.create_tunnel( + id="id", + port=0, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -301,25 +305,27 @@ def test_raw_response_create_tunnel(self, client: Runloop) -> None: @parametrize def test_streaming_response_create_tunnel(self, client: Runloop) -> None: - with client.devboxes.with_streaming_response.create_tunnel( - id="id", - port=0, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.devboxes.with_streaming_response.create_tunnel( + id="id", + port=0, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - devbox = response.parse() - assert_matches_type(DevboxTunnelView, devbox, path=["response"]) + devbox = response.parse() + assert_matches_type(DevboxTunnelView, devbox, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_create_tunnel(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.with_raw_response.create_tunnel( - id="", - port=0, - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.create_tunnel( + id="", + port=0, + ) @parametrize def test_method_delete_disk_snapshot(self, client: Runloop) -> None: @@ -1181,6 +1187,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - repo_connection_id="repo_connection_id", secrets={"foo": "string"}, snapshot_id="snapshot_id", + tunnel={"auth_mode": "open"}, ) assert_matches_type(DevboxView, devbox, path=["response"]) @@ -1363,18 +1370,21 @@ async def test_path_params_create_ssh_key(self, async_client: AsyncRunloop) -> N @parametrize async def test_method_create_tunnel(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.create_tunnel( - id="id", - port=0, - ) + with pytest.warns(DeprecationWarning): + devbox = await async_client.devboxes.create_tunnel( + id="id", + port=0, + ) + assert_matches_type(DevboxTunnelView, devbox, path=["response"]) @parametrize async def test_raw_response_create_tunnel(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.with_raw_response.create_tunnel( - id="id", - port=0, - ) + with pytest.warns(DeprecationWarning): + response = await async_client.devboxes.with_raw_response.create_tunnel( + id="id", + port=0, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1383,25 +1393,27 @@ async def test_raw_response_create_tunnel(self, async_client: AsyncRunloop) -> N @parametrize async def test_streaming_response_create_tunnel(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.with_streaming_response.create_tunnel( - id="id", - port=0, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.devboxes.with_streaming_response.create_tunnel( + id="id", + port=0, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - devbox = await response.parse() - assert_matches_type(DevboxTunnelView, devbox, path=["response"]) + devbox = await response.parse() + assert_matches_type(DevboxTunnelView, devbox, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_create_tunnel(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.with_raw_response.create_tunnel( - id="", - port=0, - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.create_tunnel( + id="", + port=0, + ) @parametrize async def test_method_delete_disk_snapshot(self, async_client: AsyncRunloop) -> None: From 5ec99a799f1bdea75e0becd2d65e70d4cac90aa4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 20:26:45 +0000 Subject: [PATCH 954/993] chore(devbox): deprecate remove tunnel API (#7230) --- .stats.yml | 4 +- .../resources/devboxes/devboxes.py | 38 +++++--- tests/api_resources/test_devboxes.py | 94 ++++++++++--------- 3 files changed, 80 insertions(+), 56 deletions(-) diff --git a/.stats.yml b/.stats.yml index 94d83f0c1..e2f90d495 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 111 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-debd1f9a9d599b009905cbaaea3095c025fe290493c8a836f54ece22265579c1.yml -openapi_spec_hash: ee42d2c73aaad86888360147d9ed0766 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-84e997ca5716b9378a58a1bdf3d6616cf3be80156a6aaed1bed469fe93ba2c95.yml +openapi_spec_hash: b44a4ba1c2c3cb775c14545f2bab05a8 config_hash: 22f65246be4646c23dde9f69f51252e7 diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index b19869917..2d01928ce 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -954,6 +954,7 @@ def read_file_contents( cast_to=str, ) + @typing_extensions.deprecated("deprecated") def remove_tunnel( self, id: str, @@ -967,8 +968,10 @@ def remove_tunnel( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> object: - """ - Remove a previously opened tunnel on the Devbox. + """[Deprecated] Tunnels remain active until devbox is shutdown. + + This endpoint + removes a legacy tunnel. Args: port: Devbox port that tunnel will expose. @@ -2280,6 +2283,7 @@ async def read_file_contents( cast_to=str, ) + @typing_extensions.deprecated("deprecated") async def remove_tunnel( self, id: str, @@ -2293,8 +2297,10 @@ async def remove_tunnel( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> object: - """ - Remove a previously opened tunnel on the Devbox. + """[Deprecated] Tunnels remain active until devbox is shutdown. + + This endpoint + removes a legacy tunnel. Args: port: Devbox port that tunnel will expose. @@ -2810,8 +2816,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.read_file_contents = to_raw_response_wrapper( devboxes.read_file_contents, ) - self.remove_tunnel = to_raw_response_wrapper( - devboxes.remove_tunnel, + self.remove_tunnel = ( # pyright: ignore[reportDeprecated] + to_raw_response_wrapper( + devboxes.remove_tunnel, # pyright: ignore[reportDeprecated], + ) ) self.resume = to_raw_response_wrapper( devboxes.resume, @@ -2910,8 +2918,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.read_file_contents = async_to_raw_response_wrapper( devboxes.read_file_contents, ) - self.remove_tunnel = async_to_raw_response_wrapper( - devboxes.remove_tunnel, + self.remove_tunnel = ( # pyright: ignore[reportDeprecated] + async_to_raw_response_wrapper( + devboxes.remove_tunnel, # pyright: ignore[reportDeprecated], + ) ) self.resume = async_to_raw_response_wrapper( devboxes.resume, @@ -3010,8 +3020,10 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.read_file_contents = to_streamed_response_wrapper( devboxes.read_file_contents, ) - self.remove_tunnel = to_streamed_response_wrapper( - devboxes.remove_tunnel, + self.remove_tunnel = ( # pyright: ignore[reportDeprecated] + to_streamed_response_wrapper( + devboxes.remove_tunnel, # pyright: ignore[reportDeprecated], + ) ) self.resume = to_streamed_response_wrapper( devboxes.resume, @@ -3110,8 +3122,10 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.read_file_contents = async_to_streamed_response_wrapper( devboxes.read_file_contents, ) - self.remove_tunnel = async_to_streamed_response_wrapper( - devboxes.remove_tunnel, + self.remove_tunnel = ( # pyright: ignore[reportDeprecated] + async_to_streamed_response_wrapper( + devboxes.remove_tunnel, # pyright: ignore[reportDeprecated], + ) ) self.resume = async_to_streamed_response_wrapper( devboxes.resume, diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 8834075f7..468c6dc06 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -711,18 +711,21 @@ def test_path_params_read_file_contents(self, client: Runloop) -> None: @parametrize def test_method_remove_tunnel(self, client: Runloop) -> None: - devbox = client.devboxes.remove_tunnel( - id="id", - port=0, - ) + with pytest.warns(DeprecationWarning): + devbox = client.devboxes.remove_tunnel( + id="id", + port=0, + ) + assert_matches_type(object, devbox, path=["response"]) @parametrize def test_raw_response_remove_tunnel(self, client: Runloop) -> None: - response = client.devboxes.with_raw_response.remove_tunnel( - id="id", - port=0, - ) + with pytest.warns(DeprecationWarning): + response = client.devboxes.with_raw_response.remove_tunnel( + id="id", + port=0, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -731,25 +734,27 @@ def test_raw_response_remove_tunnel(self, client: Runloop) -> None: @parametrize def test_streaming_response_remove_tunnel(self, client: Runloop) -> None: - with client.devboxes.with_streaming_response.remove_tunnel( - id="id", - port=0, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + with client.devboxes.with_streaming_response.remove_tunnel( + id="id", + port=0, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - devbox = response.parse() - assert_matches_type(object, devbox, path=["response"]) + devbox = response.parse() + assert_matches_type(object, devbox, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize def test_path_params_remove_tunnel(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.devboxes.with_raw_response.remove_tunnel( - id="", - port=0, - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.remove_tunnel( + id="", + port=0, + ) @parametrize def test_method_resume(self, client: Runloop) -> None: @@ -1799,18 +1804,21 @@ async def test_path_params_read_file_contents(self, async_client: AsyncRunloop) @parametrize async def test_method_remove_tunnel(self, async_client: AsyncRunloop) -> None: - devbox = await async_client.devboxes.remove_tunnel( - id="id", - port=0, - ) + with pytest.warns(DeprecationWarning): + devbox = await async_client.devboxes.remove_tunnel( + id="id", + port=0, + ) + assert_matches_type(object, devbox, path=["response"]) @parametrize async def test_raw_response_remove_tunnel(self, async_client: AsyncRunloop) -> None: - response = await async_client.devboxes.with_raw_response.remove_tunnel( - id="id", - port=0, - ) + with pytest.warns(DeprecationWarning): + response = await async_client.devboxes.with_raw_response.remove_tunnel( + id="id", + port=0, + ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -1819,25 +1827,27 @@ async def test_raw_response_remove_tunnel(self, async_client: AsyncRunloop) -> N @parametrize async def test_streaming_response_remove_tunnel(self, async_client: AsyncRunloop) -> None: - async with async_client.devboxes.with_streaming_response.remove_tunnel( - id="id", - port=0, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + with pytest.warns(DeprecationWarning): + async with async_client.devboxes.with_streaming_response.remove_tunnel( + id="id", + port=0, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" - devbox = await response.parse() - assert_matches_type(object, devbox, path=["response"]) + devbox = await response.parse() + assert_matches_type(object, devbox, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize async def test_path_params_remove_tunnel(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.devboxes.with_raw_response.remove_tunnel( - id="", - port=0, - ) + with pytest.warns(DeprecationWarning): + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.remove_tunnel( + id="", + port=0, + ) @parametrize async def test_method_resume(self, async_client: AsyncRunloop) -> None: From b3369c048c0de3cb8d9015f1f9a5114621bba1c3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 21:55:22 +0000 Subject: [PATCH 955/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c658eefef..3e9af1b3a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.3.2" + ".": "1.4.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 6ab350a78..4ace99a73 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "1.3.2" +version = "1.4.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 521e1d656..0d6b7e275 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "1.3.2" # x-release-please-version +__version__ = "1.4.0" # x-release-please-version diff --git a/uv.lock b/uv.lock index abe65c249..2142ae36f 100644 --- a/uv.lock +++ b/uv.lock @@ -1321,7 +1321,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "1.3.2" +version = "1.4.0" source = { editable = "." } dependencies = [ { name = "anyio" }, From 78328a4fa042eef9384ac67530a56c11c745030c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 22:17:17 +0000 Subject: [PATCH 956/993] feat(devbox): add enable_tunnel API (#7236) --- .stats.yml | 4 +- api.md | 2 + .../resources/devboxes/devboxes.py | 114 ++++++++++++++++++ src/runloop_api_client/types/__init__.py | 2 + .../types/devbox_enable_tunnel_params.py | 13 ++ src/runloop_api_client/types/devbox_view.py | 29 +---- src/runloop_api_client/types/tunnel_view.py | 34 ++++++ tests/api_resources/test_devboxes.py | 93 ++++++++++++++ 8 files changed, 263 insertions(+), 28 deletions(-) create mode 100644 src/runloop_api_client/types/devbox_enable_tunnel_params.py create mode 100644 src/runloop_api_client/types/tunnel_view.py diff --git a/.stats.yml b/.stats.yml index e2f90d495..26ecaabc0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 111 +configured_endpoints: 112 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-84e997ca5716b9378a58a1bdf3d6616cf3be80156a6aaed1bed469fe93ba2c95.yml openapi_spec_hash: b44a4ba1c2c3cb775c14545f2bab05a8 -config_hash: 22f65246be4646c23dde9f69f51252e7 +config_hash: 6c26299fd9ef01fb4713612a9a2ad17c diff --git a/api.md b/api.md index 254deec44..e5229c620 100644 --- a/api.md +++ b/api.md @@ -131,6 +131,7 @@ from runloop_api_client.types import ( DevboxSnapshotView, DevboxTunnelView, DevboxView, + TunnelView, DevboxCreateSSHKeyResponse, DevboxReadFileContentsResponse, ) @@ -146,6 +147,7 @@ Methods: - client.devboxes.create_tunnel(id, \*\*params) -> DevboxTunnelView - client.devboxes.delete_disk_snapshot(id) -> object - client.devboxes.download_file(id, \*\*params) -> BinaryAPIResponse +- client.devboxes.enable_tunnel(id, \*\*params) -> TunnelView - client.devboxes.execute(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.execute_async(id, \*\*params) -> DevboxAsyncExecutionDetailView - client.devboxes.execute_sync(id, \*\*params) -> DevboxExecutionDetailView diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2d01928ce..9a3bbd0a1 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -25,6 +25,7 @@ devbox_execute_sync_params, devbox_create_tunnel_params, devbox_download_file_params, + devbox_enable_tunnel_params, devbox_execute_async_params, devbox_remove_tunnel_params, devbox_snapshot_disk_params, @@ -93,6 +94,7 @@ AsyncDiskSnapshotsResourceWithStreamingResponse, ) from ...types.devbox_view import DevboxView +from ...types.tunnel_view import TunnelView from ...types.devbox_tunnel_view import DevboxTunnelView from ...types.shared_params.mount import Mount from ...types.devbox_snapshot_view import DevboxSnapshotView @@ -586,6 +588,55 @@ def download_file( cast_to=BinaryAPIResponse, ) + def enable_tunnel( + self, + id: str, + *, + auth_mode: Optional[Literal["open", "authenticated"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> TunnelView: + """Create a V2 tunnel for an existing running Devbox. + + Tunnels provide encrypted + URL-based access to the Devbox without exposing internal IDs. The tunnel URL + format is: https://{port}-{tunnel_key}.tunnel.runloop.ai + + Each Devbox can have one tunnel. + + Args: + auth_mode: Authentication mode for the tunnel. Defaults to 'public' if not specified. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/devboxes/{id}/enable_tunnel", + body=maybe_transform({"auth_mode": auth_mode}, devbox_enable_tunnel_params.DevboxEnableTunnelParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=TunnelView, + ) + def execute( self, id: str, @@ -1915,6 +1966,57 @@ async def download_file( cast_to=AsyncBinaryAPIResponse, ) + async def enable_tunnel( + self, + id: str, + *, + auth_mode: Optional[Literal["open", "authenticated"]] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> TunnelView: + """Create a V2 tunnel for an existing running Devbox. + + Tunnels provide encrypted + URL-based access to the Devbox without exposing internal IDs. The tunnel URL + format is: https://{port}-{tunnel_key}.tunnel.runloop.ai + + Each Devbox can have one tunnel. + + Args: + auth_mode: Authentication mode for the tunnel. Defaults to 'public' if not specified. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/devboxes/{id}/enable_tunnel", + body=await async_maybe_transform( + {"auth_mode": auth_mode}, devbox_enable_tunnel_params.DevboxEnableTunnelParams + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=TunnelView, + ) + async def execute( self, id: str, @@ -2796,6 +2898,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.download_file, BinaryAPIResponse, ) + self.enable_tunnel = to_raw_response_wrapper( + devboxes.enable_tunnel, + ) self.execute = to_raw_response_wrapper( devboxes.execute, ) @@ -2898,6 +3003,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.download_file, AsyncBinaryAPIResponse, ) + self.enable_tunnel = async_to_raw_response_wrapper( + devboxes.enable_tunnel, + ) self.execute = async_to_raw_response_wrapper( devboxes.execute, ) @@ -3000,6 +3108,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: devboxes.download_file, StreamedBinaryAPIResponse, ) + self.enable_tunnel = to_streamed_response_wrapper( + devboxes.enable_tunnel, + ) self.execute = to_streamed_response_wrapper( devboxes.execute, ) @@ -3102,6 +3213,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: devboxes.download_file, AsyncStreamedBinaryAPIResponse, ) + self.enable_tunnel = async_to_streamed_response_wrapper( + devboxes.enable_tunnel, + ) self.execute = async_to_streamed_response_wrapper( devboxes.execute, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index be02c8312..8fb72317f 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -16,6 +16,7 @@ from .devbox_view import DevboxView as DevboxView from .object_view import ObjectView as ObjectView from .secret_view import SecretView as SecretView +from .tunnel_view import TunnelView as TunnelView from .input_context import InputContext as InputContext from .scenario_view import ScenarioView as ScenarioView from .benchmark_view import BenchmarkView as BenchmarkView @@ -91,6 +92,7 @@ from .benchmark_job_create_params import BenchmarkJobCreateParams as BenchmarkJobCreateParams from .devbox_create_tunnel_params import DevboxCreateTunnelParams as DevboxCreateTunnelParams from .devbox_download_file_params import DevboxDownloadFileParams as DevboxDownloadFileParams +from .devbox_enable_tunnel_params import DevboxEnableTunnelParams as DevboxEnableTunnelParams from .devbox_execute_async_params import DevboxExecuteAsyncParams as DevboxExecuteAsyncParams from .devbox_remove_tunnel_params import DevboxRemoveTunnelParams as DevboxRemoveTunnelParams from .devbox_snapshot_disk_params import DevboxSnapshotDiskParams as DevboxSnapshotDiskParams diff --git a/src/runloop_api_client/types/devbox_enable_tunnel_params.py b/src/runloop_api_client/types/devbox_enable_tunnel_params.py new file mode 100644 index 000000000..9ccc53e75 --- /dev/null +++ b/src/runloop_api_client/types/devbox_enable_tunnel_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Literal, TypedDict + +__all__ = ["DevboxEnableTunnelParams"] + + +class DevboxEnableTunnelParams(TypedDict, total=False): + auth_mode: Optional[Literal["open", "authenticated"]] + """Authentication mode for the tunnel. Defaults to 'public' if not specified.""" diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 50422db1f..68a96dbd7 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -4,9 +4,10 @@ from typing_extensions import Literal from .._models import BaseModel +from .tunnel_view import TunnelView from .shared.launch_parameters import LaunchParameters -__all__ = ["DevboxView", "StateTransition", "GatewaySpecs", "Tunnel"] +__all__ = ["DevboxView", "StateTransition", "GatewaySpecs"] class StateTransition(BaseModel): @@ -38,30 +39,6 @@ class GatewaySpecs(BaseModel): """The ID of the secret containing the credential.""" -class Tunnel(BaseModel): - """ - V2 tunnel information if a tunnel was created at launch time or via the createTunnel API. - """ - - auth_mode: Literal["public_", "authenticated"] - """The authentication mode for the tunnel.""" - - create_time_ms: int - """Creation time of the tunnel (Unix timestamp milliseconds).""" - - tunnel_key: str - """The encrypted tunnel key used to construct the tunnel URL. - - URL format: https://{port}-{tunnel_key}.tunnel.runloop.{domain} - """ - - auth_token: Optional[str] = None - """Bearer token for tunnel authentication. - - Only present when auth_mode is 'authenticated'. - """ - - class DevboxView(BaseModel): """A Devbox represents a virtual development environment. @@ -137,7 +114,7 @@ class DevboxView(BaseModel): Snapshot. """ - tunnel: Optional[Tunnel] = None + tunnel: Optional[TunnelView] = None """ V2 tunnel information if a tunnel was created at launch time or via the createTunnel API. diff --git a/src/runloop_api_client/types/tunnel_view.py b/src/runloop_api_client/types/tunnel_view.py new file mode 100644 index 000000000..beb43daf9 --- /dev/null +++ b/src/runloop_api_client/types/tunnel_view.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["TunnelView"] + + +class TunnelView(BaseModel): + """A V2 tunnel provides secure HTTP access to services running on a Devbox. + + Tunnels allow external clients to reach web servers, APIs, or other HTTP services running inside a Devbox without requiring direct network access. Each tunnel is uniquely identified by an encrypted tunnel_key and can be configured for either open (public) or authenticated access. + Usage: https://{port}-{tunnel_key}.tunnel.runloop.ai + """ + + auth_mode: Literal["public_", "authenticated"] + """The authentication mode for the tunnel.""" + + create_time_ms: int + """Creation time of the tunnel (Unix timestamp milliseconds).""" + + tunnel_key: str + """The encrypted tunnel key used to construct the tunnel URL. + + URL format: https://{port}-{tunnel_key}.tunnel.runloop.{domain} + """ + + auth_token: Optional[str] = None + """Bearer token for tunnel authentication. + + Only present when auth_mode is 'authenticated'. + """ diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 468c6dc06..eb3b6a841 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -13,6 +13,7 @@ from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types import ( DevboxView, + TunnelView, DevboxTunnelView, DevboxSnapshotView, DevboxExecutionDetailView, @@ -423,6 +424,52 @@ def test_path_params_download_file(self, client: Runloop) -> None: path="path", ) + @parametrize + def test_method_enable_tunnel(self, client: Runloop) -> None: + devbox = client.devboxes.enable_tunnel( + id="id", + ) + assert_matches_type(TunnelView, devbox, path=["response"]) + + @parametrize + def test_method_enable_tunnel_with_all_params(self, client: Runloop) -> None: + devbox = client.devboxes.enable_tunnel( + id="id", + auth_mode="open", + ) + assert_matches_type(TunnelView, devbox, path=["response"]) + + @parametrize + def test_raw_response_enable_tunnel(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.enable_tunnel( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(TunnelView, devbox, path=["response"]) + + @parametrize + def test_streaming_response_enable_tunnel(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.enable_tunnel( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(TunnelView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_enable_tunnel(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.enable_tunnel( + id="", + ) + @parametrize def test_method_execute(self, client: Runloop) -> None: devbox = client.devboxes.execute( @@ -1516,6 +1563,52 @@ async def test_path_params_download_file(self, async_client: AsyncRunloop) -> No path="path", ) + @parametrize + async def test_method_enable_tunnel(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.enable_tunnel( + id="id", + ) + assert_matches_type(TunnelView, devbox, path=["response"]) + + @parametrize + async def test_method_enable_tunnel_with_all_params(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.enable_tunnel( + id="id", + auth_mode="open", + ) + assert_matches_type(TunnelView, devbox, path=["response"]) + + @parametrize + async def test_raw_response_enable_tunnel(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.enable_tunnel( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(TunnelView, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_enable_tunnel(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.enable_tunnel( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(TunnelView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_enable_tunnel(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.enable_tunnel( + id="", + ) + @parametrize async def test_method_execute(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.execute( From b9032281ef77e3bf0dc17c636db9d0cc95404cbf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 22:23:21 +0000 Subject: [PATCH 957/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3e9af1b3a..fbd9082d7 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.4.0" + ".": "1.5.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 4ace99a73..291b44beb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "1.4.0" +version = "1.5.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 0d6b7e275..cfd147a9e 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "1.4.0" # x-release-please-version +__version__ = "1.5.0" # x-release-please-version diff --git a/uv.lock b/uv.lock index 2142ae36f..f8b51084a 100644 --- a/uv.lock +++ b/uv.lock @@ -1321,7 +1321,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "1.4.0" +version = "1.5.0" source = { editable = "." } dependencies = [ { name = "anyio" }, From 82077443b0276e991683300673801f0eac229197 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 23:06:02 +0000 Subject: [PATCH 958/993] chore(devbox): rename tunnel auth enum (#7239) --- .stats.yml | 4 ++-- src/runloop_api_client/types/tunnel_view.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 26ecaabc0..81d520c67 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 112 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-84e997ca5716b9378a58a1bdf3d6616cf3be80156a6aaed1bed469fe93ba2c95.yml -openapi_spec_hash: b44a4ba1c2c3cb775c14545f2bab05a8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b493cadf2e3b9658163a6bcf8f51e088dda169f12d68469c4441d17e889f5556.yml +openapi_spec_hash: b27ec3822d88d10efa268f1681fddff3 config_hash: 6c26299fd9ef01fb4713612a9a2ad17c diff --git a/src/runloop_api_client/types/tunnel_view.py b/src/runloop_api_client/types/tunnel_view.py index beb43daf9..540a44e7c 100644 --- a/src/runloop_api_client/types/tunnel_view.py +++ b/src/runloop_api_client/types/tunnel_view.py @@ -15,7 +15,7 @@ class TunnelView(BaseModel): Usage: https://{port}-{tunnel_key}.tunnel.runloop.ai """ - auth_mode: Literal["public_", "authenticated"] + auth_mode: Literal["open", "authenticated"] """The authentication mode for the tunnel.""" create_time_ms: int From c560cfa3a0414dbc5af9f134211ff7c84fc55e7c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 23:28:30 +0000 Subject: [PATCH 959/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index fbd9082d7..4a2f7e609 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.5.0" + ".": "1.5.1" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 291b44beb..e9c9cf712 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "1.5.0" +version = "1.5.1" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index cfd147a9e..962984a45 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "1.5.0" # x-release-please-version +__version__ = "1.5.1" # x-release-please-version diff --git a/uv.lock b/uv.lock index f8b51084a..e465fa64b 100644 --- a/uv.lock +++ b/uv.lock @@ -1321,7 +1321,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "1.5.0" +version = "1.5.1" source = { editable = "." } dependencies = [ { name = "anyio" }, From 9f2cd499ca9e31c50214ae28d7654d2fe889f54d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Feb 2026 22:26:03 +0000 Subject: [PATCH 960/993] feat: add api to query devbox usage (#7296) --- .stats.yml | 8 +- api.md | 2 + .../resources/devboxes/devboxes.py | 87 +++++++++++++++++++ src/runloop_api_client/types/__init__.py | 1 + .../types/devbox_resource_usage_view.py | 48 ++++++++++ tests/api_resources/test_devboxes.py | 77 ++++++++++++++++ 6 files changed, 219 insertions(+), 4 deletions(-) create mode 100644 src/runloop_api_client/types/devbox_resource_usage_view.py diff --git a/.stats.yml b/.stats.yml index 81d520c67..4df441fe0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 112 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b493cadf2e3b9658163a6bcf8f51e088dda169f12d68469c4441d17e889f5556.yml -openapi_spec_hash: b27ec3822d88d10efa268f1681fddff3 -config_hash: 6c26299fd9ef01fb4713612a9a2ad17c +configured_endpoints: 113 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-37187e72e61b850045924e6cb40207159ab794114add75a2bf36c87915326306.yml +openapi_spec_hash: 33510c114bef0847855cdaf8f55c0774 +config_hash: 9f86425631c30497276e58b744dd3654 diff --git a/api.md b/api.md index e5229c620..69b87948a 100644 --- a/api.md +++ b/api.md @@ -125,6 +125,7 @@ from runloop_api_client.types import ( DevboxExecutionDetailView, DevboxKillExecutionRequest, DevboxListView, + DevboxResourceUsageView, DevboxSendStdInRequest, DevboxSendStdInResult, DevboxSnapshotListView, @@ -156,6 +157,7 @@ Methods: - client.devboxes.read_file_contents(id, \*\*params) -> str - client.devboxes.remove_tunnel(id, \*\*params) -> object - client.devboxes.resume(id) -> DevboxView +- client.devboxes.retrieve_resource_usage(id) -> DevboxResourceUsageView - client.devboxes.shutdown(id) -> DevboxView - client.devboxes.snapshot_disk(id, \*\*params) -> DevboxSnapshotView - client.devboxes.snapshot_disk_async(id, \*\*params) -> DevboxSnapshotView diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 9a3bbd0a1..2811e9efb 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -98,6 +98,7 @@ from ...types.devbox_tunnel_view import DevboxTunnelView from ...types.shared_params.mount import Mount from ...types.devbox_snapshot_view import DevboxSnapshotView +from ...types.devbox_resource_usage_view import DevboxResourceUsageView from ...types.devbox_execution_detail_view import DevboxExecutionDetailView from ...types.devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse from ...types.shared_params.launch_parameters import LaunchParameters @@ -1095,6 +1096,43 @@ def resume( cast_to=DevboxView, ) + def retrieve_resource_usage( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> DevboxResourceUsageView: + """Get resource usage metrics for a specific Devbox. + + Returns CPU, memory, and disk + consumption calculated from the Devbox's lifecycle, excluding any suspended + periods for CPU and memory. Disk usage includes the full elapsed time since + storage is consumed even when suspended. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/devboxes/{id}/usage", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxResourceUsageView, + ) + def shutdown( self, id: str, @@ -2475,6 +2513,43 @@ async def resume( cast_to=DevboxView, ) + async def retrieve_resource_usage( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> DevboxResourceUsageView: + """Get resource usage metrics for a specific Devbox. + + Returns CPU, memory, and disk + consumption calculated from the Devbox's lifecycle, excluding any suspended + periods for CPU and memory. Disk usage includes the full elapsed time since + storage is consumed even when suspended. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/devboxes/{id}/usage", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=DevboxResourceUsageView, + ) + async def shutdown( self, id: str, @@ -2929,6 +3004,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.resume = to_raw_response_wrapper( devboxes.resume, ) + self.retrieve_resource_usage = to_raw_response_wrapper( + devboxes.retrieve_resource_usage, + ) self.shutdown = to_raw_response_wrapper( devboxes.shutdown, ) @@ -3034,6 +3112,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.resume = async_to_raw_response_wrapper( devboxes.resume, ) + self.retrieve_resource_usage = async_to_raw_response_wrapper( + devboxes.retrieve_resource_usage, + ) self.shutdown = async_to_raw_response_wrapper( devboxes.shutdown, ) @@ -3139,6 +3220,9 @@ def __init__(self, devboxes: DevboxesResource) -> None: self.resume = to_streamed_response_wrapper( devboxes.resume, ) + self.retrieve_resource_usage = to_streamed_response_wrapper( + devboxes.retrieve_resource_usage, + ) self.shutdown = to_streamed_response_wrapper( devboxes.shutdown, ) @@ -3244,6 +3328,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None: self.resume = async_to_streamed_response_wrapper( devboxes.resume, ) + self.retrieve_resource_usage = async_to_streamed_response_wrapper( + devboxes.retrieve_resource_usage, + ) self.shutdown = async_to_streamed_response_wrapper( devboxes.shutdown, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 8fb72317f..d7a3fe229 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -84,6 +84,7 @@ from .benchmark_start_run_params import BenchmarkStartRunParams as BenchmarkStartRunParams from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams +from .devbox_resource_usage_view import DevboxResourceUsageView as DevboxResourceUsageView from .gateway_config_list_params import GatewayConfigListParams as GatewayConfigListParams from .input_context_update_param import InputContextUpdateParam as InputContextUpdateParam from .network_policy_list_params import NetworkPolicyListParams as NetworkPolicyListParams diff --git a/src/runloop_api_client/types/devbox_resource_usage_view.py b/src/runloop_api_client/types/devbox_resource_usage_view.py new file mode 100644 index 000000000..fe5c83a57 --- /dev/null +++ b/src/runloop_api_client/types/devbox_resource_usage_view.py @@ -0,0 +1,48 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from .._models import BaseModel + +__all__ = ["DevboxResourceUsageView"] + + +class DevboxResourceUsageView(BaseModel): + id: str + """The devbox ID.""" + + disk_gb_seconds: int + """Disk usage in GB-seconds (total_elapsed_seconds multiplied by disk size in GB). + + Disk is billed for elapsed time since storage is consumed even when suspended. + """ + + memory_gb_seconds: int + """Memory usage in GB-seconds (total_active_seconds multiplied by memory in GB).""" + + start_time_ms: int + """The devbox creation time in milliseconds since epoch.""" + + status: str + """The current status of the devbox.""" + + total_active_seconds: int + """ + Total time in seconds the devbox was actively running (excludes time spent + suspended). + """ + + total_elapsed_seconds: int + """ + Total elapsed time in seconds from devbox creation to now (or end time if + terminated). Includes all time regardless of devbox state. + """ + + vcpu_seconds: int + """ + vCPU usage in vCPU-seconds (total_active_seconds multiplied by the number of + vCPUs). + """ + + end_time_ms: Optional[int] = None + """The devbox end time in milliseconds since epoch, or null if still running.""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index eb3b6a841..fd9641ace 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -16,6 +16,7 @@ TunnelView, DevboxTunnelView, DevboxSnapshotView, + DevboxResourceUsageView, DevboxExecutionDetailView, DevboxCreateSSHKeyResponse, DevboxAsyncExecutionDetailView, @@ -841,6 +842,44 @@ def test_path_params_resume(self, client: Runloop) -> None: "", ) + @parametrize + def test_method_retrieve_resource_usage(self, client: Runloop) -> None: + devbox = client.devboxes.retrieve_resource_usage( + "id", + ) + assert_matches_type(DevboxResourceUsageView, devbox, path=["response"]) + + @parametrize + def test_raw_response_retrieve_resource_usage(self, client: Runloop) -> None: + response = client.devboxes.with_raw_response.retrieve_resource_usage( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = response.parse() + assert_matches_type(DevboxResourceUsageView, devbox, path=["response"]) + + @parametrize + def test_streaming_response_retrieve_resource_usage(self, client: Runloop) -> None: + with client.devboxes.with_streaming_response.retrieve_resource_usage( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = response.parse() + assert_matches_type(DevboxResourceUsageView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve_resource_usage(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.devboxes.with_raw_response.retrieve_resource_usage( + "", + ) + @parametrize def test_method_shutdown(self, client: Runloop) -> None: devbox = client.devboxes.shutdown( @@ -1980,6 +2019,44 @@ async def test_path_params_resume(self, async_client: AsyncRunloop) -> None: "", ) + @parametrize + async def test_method_retrieve_resource_usage(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.retrieve_resource_usage( + "id", + ) + assert_matches_type(DevboxResourceUsageView, devbox, path=["response"]) + + @parametrize + async def test_raw_response_retrieve_resource_usage(self, async_client: AsyncRunloop) -> None: + response = await async_client.devboxes.with_raw_response.retrieve_resource_usage( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + devbox = await response.parse() + assert_matches_type(DevboxResourceUsageView, devbox, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve_resource_usage(self, async_client: AsyncRunloop) -> None: + async with async_client.devboxes.with_streaming_response.retrieve_resource_usage( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + devbox = await response.parse() + assert_matches_type(DevboxResourceUsageView, devbox, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve_resource_usage(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.devboxes.with_raw_response.retrieve_resource_usage( + "", + ) + @parametrize async def test_method_shutdown(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.shutdown( From 345e5cba2d6e7cd49ba1498e0e8928e921ab5903 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Feb 2026 01:00:21 +0000 Subject: [PATCH 961/993] feat: adding MCP Config routes (#7331) --- .stats.yml | 8 +- api.md | 25 +- src/runloop_api_client/_client.py | 38 + src/runloop_api_client/pagination.py | 75 ++ src/runloop_api_client/resources/__init__.py | 14 + .../resources/mcp_configs.py | 662 ++++++++++++++++++ .../resources/scenarios/scorers.py | 237 +------ src/runloop_api_client/types/__init__.py | 5 + .../types/mcp_config_create_params.py | 33 + .../types/mcp_config_list_params.py | 21 + .../types/mcp_config_list_view.py | 21 + .../types/mcp_config_update_params.py | 27 + .../types/mcp_config_view.py | 37 + .../types/scenarios/__init__.py | 4 - .../types/scenarios/scorer_create_params.py | 18 - .../types/scenarios/scorer_create_response.py | 18 - .../types/scenarios/scorer_validate_params.py | 17 - .../scenarios/scorer_validate_response.py | 23 - tests/api_resources/scenarios/test_scorers.py | 220 ------ tests/api_resources/test_mcp_configs.py | 441 ++++++++++++ 20 files changed, 1400 insertions(+), 544 deletions(-) create mode 100644 src/runloop_api_client/resources/mcp_configs.py create mode 100644 src/runloop_api_client/types/mcp_config_create_params.py create mode 100644 src/runloop_api_client/types/mcp_config_list_params.py create mode 100644 src/runloop_api_client/types/mcp_config_list_view.py create mode 100644 src/runloop_api_client/types/mcp_config_update_params.py create mode 100644 src/runloop_api_client/types/mcp_config_view.py delete mode 100644 src/runloop_api_client/types/scenarios/scorer_create_params.py delete mode 100644 src/runloop_api_client/types/scenarios/scorer_create_response.py delete mode 100644 src/runloop_api_client/types/scenarios/scorer_validate_params.py delete mode 100644 src/runloop_api_client/types/scenarios/scorer_validate_response.py create mode 100644 tests/api_resources/test_mcp_configs.py diff --git a/.stats.yml b/.stats.yml index 4df441fe0..abe925b09 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 113 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-37187e72e61b850045924e6cb40207159ab794114add75a2bf36c87915326306.yml -openapi_spec_hash: 33510c114bef0847855cdaf8f55c0774 -config_hash: 9f86425631c30497276e58b744dd3654 +configured_endpoints: 116 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb90951855ef91c431a7b07ea6a42c1c470c1a0c905e19e4926b48e8039bf4cb.yml +openapi_spec_hash: e98232f95d6fd27f1200e354cee0059a +config_hash: eb28692edd68a6ae95cf92af931c9976 diff --git a/api.md b/api.md index 69b87948a..06e121a97 100644 --- a/api.md +++ b/api.md @@ -294,21 +294,17 @@ Types: ```python from runloop_api_client.types.scenarios import ( - ScorerCreateResponse, ScorerRetrieveResponse, ScorerUpdateResponse, ScorerListResponse, - ScorerValidateResponse, ) ``` Methods: -- client.scenarios.scorers.create(\*\*params) -> ScorerCreateResponse - client.scenarios.scorers.retrieve(id) -> ScorerRetrieveResponse - client.scenarios.scorers.update(id, \*\*params) -> ScorerUpdateResponse - client.scenarios.scorers.list(\*\*params) -> SyncScenarioScorersCursorIDPage[ScorerListResponse] -- client.scenarios.scorers.validate(id, \*\*params) -> ScorerValidateResponse # Objects @@ -419,3 +415,24 @@ Methods: - client.gateway_configs.update(id, \*\*params) -> GatewayConfigView - client.gateway_configs.list(\*\*params) -> SyncGatewayConfigsCursorIDPage[GatewayConfigView] - client.gateway_configs.delete(id) -> GatewayConfigView + +# McpConfigs + +Types: + +```python +from runloop_api_client.types import ( + McpConfigCreateParameters, + McpConfigListView, + McpConfigUpdateParameters, + McpConfigView, +) +``` + +Methods: + +- client.mcp_configs.create(\*\*params) -> McpConfigView +- client.mcp_configs.retrieve(id) -> McpConfigView +- client.mcp_configs.update(id, \*\*params) -> McpConfigView +- client.mcp_configs.list(\*\*params) -> SyncMcpConfigsCursorIDPage[McpConfigView] +- client.mcp_configs.delete(id) -> McpConfigView diff --git a/src/runloop_api_client/_client.py b/src/runloop_api_client/_client.py index 32561bc0f..0f626950b 100644 --- a/src/runloop_api_client/_client.py +++ b/src/runloop_api_client/_client.py @@ -39,6 +39,7 @@ scenarios, benchmarks, blueprints, + mcp_configs, repositories, benchmark_jobs, benchmark_runs, @@ -50,6 +51,7 @@ from .resources.secrets import SecretsResource, AsyncSecretsResource from .resources.benchmarks import BenchmarksResource, AsyncBenchmarksResource from .resources.blueprints import BlueprintsResource, AsyncBlueprintsResource + from .resources.mcp_configs import McpConfigsResource, AsyncMcpConfigsResource from .resources.repositories import RepositoriesResource, AsyncRepositoriesResource from .resources.benchmark_jobs import BenchmarkJobsResource, AsyncBenchmarkJobsResource from .resources.benchmark_runs import BenchmarkRunsResource, AsyncBenchmarkRunsResource @@ -190,6 +192,12 @@ def gateway_configs(self) -> GatewayConfigsResource: return GatewayConfigsResource(self) + @cached_property + def mcp_configs(self) -> McpConfigsResource: + from .resources.mcp_configs import McpConfigsResource + + return McpConfigsResource(self) + @cached_property def with_raw_response(self) -> RunloopWithRawResponse: return RunloopWithRawResponse(self) @@ -432,6 +440,12 @@ def gateway_configs(self) -> AsyncGatewayConfigsResource: return AsyncGatewayConfigsResource(self) + @cached_property + def mcp_configs(self) -> AsyncMcpConfigsResource: + from .resources.mcp_configs import AsyncMcpConfigsResource + + return AsyncMcpConfigsResource(self) + @cached_property def with_raw_response(self) -> AsyncRunloopWithRawResponse: return AsyncRunloopWithRawResponse(self) @@ -623,6 +637,12 @@ def gateway_configs(self) -> gateway_configs.GatewayConfigsResourceWithRawRespon return GatewayConfigsResourceWithRawResponse(self._client.gateway_configs) + @cached_property + def mcp_configs(self) -> mcp_configs.McpConfigsResourceWithRawResponse: + from .resources.mcp_configs import McpConfigsResourceWithRawResponse + + return McpConfigsResourceWithRawResponse(self._client.mcp_configs) + class AsyncRunloopWithRawResponse: _client: AsyncRunloop @@ -702,6 +722,12 @@ def gateway_configs(self) -> gateway_configs.AsyncGatewayConfigsResourceWithRawR return AsyncGatewayConfigsResourceWithRawResponse(self._client.gateway_configs) + @cached_property + def mcp_configs(self) -> mcp_configs.AsyncMcpConfigsResourceWithRawResponse: + from .resources.mcp_configs import AsyncMcpConfigsResourceWithRawResponse + + return AsyncMcpConfigsResourceWithRawResponse(self._client.mcp_configs) + class RunloopWithStreamedResponse: _client: Runloop @@ -781,6 +807,12 @@ def gateway_configs(self) -> gateway_configs.GatewayConfigsResourceWithStreaming return GatewayConfigsResourceWithStreamingResponse(self._client.gateway_configs) + @cached_property + def mcp_configs(self) -> mcp_configs.McpConfigsResourceWithStreamingResponse: + from .resources.mcp_configs import McpConfigsResourceWithStreamingResponse + + return McpConfigsResourceWithStreamingResponse(self._client.mcp_configs) + class AsyncRunloopWithStreamedResponse: _client: AsyncRunloop @@ -860,6 +892,12 @@ def gateway_configs(self) -> gateway_configs.AsyncGatewayConfigsResourceWithStre return AsyncGatewayConfigsResourceWithStreamingResponse(self._client.gateway_configs) + @cached_property + def mcp_configs(self) -> mcp_configs.AsyncMcpConfigsResourceWithStreamingResponse: + from .resources.mcp_configs import AsyncMcpConfigsResourceWithStreamingResponse + + return AsyncMcpConfigsResourceWithStreamingResponse(self._client.mcp_configs) + Client = Runloop diff --git a/src/runloop_api_client/pagination.py b/src/runloop_api_client/pagination.py index e937259d7..e084ef68e 100644 --- a/src/runloop_api_client/pagination.py +++ b/src/runloop_api_client/pagination.py @@ -32,6 +32,8 @@ "AsyncNetworkPoliciesCursorIDPage", "SyncGatewayConfigsCursorIDPage", "AsyncGatewayConfigsCursorIDPage", + "SyncMcpConfigsCursorIDPage", + "AsyncMcpConfigsCursorIDPage", ] _T = TypeVar("_T") @@ -102,6 +104,11 @@ class GatewayConfigsCursorIDPageItem(Protocol): id: str +@runtime_checkable +class McpConfigsCursorIDPageItem(Protocol): + id: str + + class SyncBlueprintsCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): blueprints: List[_T] has_more: Optional[bool] = None @@ -984,3 +991,71 @@ def next_page_info(self) -> Optional[PageInfo]: return None return PageInfo(params={"starting_after": item.id}) + + +class SyncMcpConfigsCursorIDPage(BaseSyncPage[_T], BasePage[_T], Generic[_T]): + mcp_configs: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + mcp_configs = self.mcp_configs + if not mcp_configs: + return [] + return mcp_configs + + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + + @override + def next_page_info(self) -> Optional[PageInfo]: + mcp_configs = self.mcp_configs + if not mcp_configs: + return None + + item = cast(Any, mcp_configs[-1]) + if not isinstance(item, McpConfigsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) + + +class AsyncMcpConfigsCursorIDPage(BaseAsyncPage[_T], BasePage[_T], Generic[_T]): + mcp_configs: List[_T] + has_more: Optional[bool] = None + total_count: Optional[int] = None + + @override + def _get_page_items(self) -> List[_T]: + mcp_configs = self.mcp_configs + if not mcp_configs: + return [] + return mcp_configs + + @override + def has_next_page(self) -> bool: + has_more = self.has_more + if has_more is not None and has_more is False: + return False + + return super().has_next_page() + + @override + def next_page_info(self) -> Optional[PageInfo]: + mcp_configs = self.mcp_configs + if not mcp_configs: + return None + + item = cast(Any, mcp_configs[-1]) + if not isinstance(item, McpConfigsCursorIDPageItem) or item.id is None: # pyright: ignore[reportUnnecessaryComparison] + # TODO emit warning log + return None + + return PageInfo(params={"starting_after": item.id}) diff --git a/src/runloop_api_client/resources/__init__.py b/src/runloop_api_client/resources/__init__.py index 877822444..2e0584f25 100644 --- a/src/runloop_api_client/resources/__init__.py +++ b/src/runloop_api_client/resources/__init__.py @@ -56,6 +56,14 @@ BlueprintsResourceWithStreamingResponse, AsyncBlueprintsResourceWithStreamingResponse, ) +from .mcp_configs import ( + McpConfigsResource, + AsyncMcpConfigsResource, + McpConfigsResourceWithRawResponse, + AsyncMcpConfigsResourceWithRawResponse, + McpConfigsResourceWithStreamingResponse, + AsyncMcpConfigsResourceWithStreamingResponse, +) from .repositories import ( RepositoriesResource, AsyncRepositoriesResource, @@ -170,4 +178,10 @@ "AsyncGatewayConfigsResourceWithRawResponse", "GatewayConfigsResourceWithStreamingResponse", "AsyncGatewayConfigsResourceWithStreamingResponse", + "McpConfigsResource", + "AsyncMcpConfigsResource", + "McpConfigsResourceWithRawResponse", + "AsyncMcpConfigsResourceWithRawResponse", + "McpConfigsResourceWithStreamingResponse", + "AsyncMcpConfigsResourceWithStreamingResponse", ] diff --git a/src/runloop_api_client/resources/mcp_configs.py b/src/runloop_api_client/resources/mcp_configs.py new file mode 100644 index 000000000..24b05cc2d --- /dev/null +++ b/src/runloop_api_client/resources/mcp_configs.py @@ -0,0 +1,662 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +import httpx + +from ..types import mcp_config_list_params, mcp_config_create_params, mcp_config_update_params +from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given +from .._utils import maybe_transform, async_maybe_transform +from .._compat import cached_property +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..pagination import SyncMcpConfigsCursorIDPage, AsyncMcpConfigsCursorIDPage +from .._base_client import AsyncPaginator, make_request_options +from ..types.mcp_config_view import McpConfigView + +__all__ = ["McpConfigsResource", "AsyncMcpConfigsResource"] + + +class McpConfigsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> McpConfigsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return McpConfigsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> McpConfigsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return McpConfigsResourceWithStreamingResponse(self) + + def create( + self, + *, + allowed_tools: SequenceNotStr[str], + endpoint: str, + name: str, + description: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> McpConfigView: + """ + [Beta] Create a new McpConfig to connect to an upstream MCP (Model Context + Protocol) server. The config specifies the target endpoint and which tools are + allowed. + + Args: + allowed_tools: + Glob patterns specifying which tools are allowed from this MCP server. Examples: + ['*'] for all tools, ['github.search_*', 'github.get_*'] for specific patterns. + + endpoint: The target MCP server endpoint URL (e.g., 'https://mcp.example.com'). + + name: The human-readable name for the McpConfig. Must be unique within your account. + The first segment before '-' is used as the service name for tool routing (e.g., + 'github-readonly' uses 'github' as the service name). + + description: Optional description for this MCP configuration. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/v1/mcp-configs", + body=maybe_transform( + { + "allowed_tools": allowed_tools, + "endpoint": endpoint, + "name": name, + "description": description, + }, + mcp_config_create_params.McpConfigCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=McpConfigView, + ) + + def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> McpConfigView: + """ + [Beta] Get a specific McpConfig by its unique identifier. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._get( + f"/v1/mcp-configs/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=McpConfigView, + ) + + def update( + self, + id: str, + *, + allowed_tools: Optional[SequenceNotStr[str]] | Omit = omit, + description: Optional[str] | Omit = omit, + endpoint: Optional[str] | Omit = omit, + name: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> McpConfigView: + """[Beta] Update an existing McpConfig. + + All fields are optional. + + Args: + allowed_tools: New glob patterns specifying which tools are allowed. Examples: ['*'] for all + tools, ['github.search_*'] for specific patterns. + + description: New description for this MCP configuration. + + endpoint: New target MCP server endpoint URL. + + name: New name for the McpConfig. Must be unique within your account. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/mcp-configs/{id}", + body=maybe_transform( + { + "allowed_tools": allowed_tools, + "description": description, + "endpoint": endpoint, + "name": name, + }, + mcp_config_update_params.McpConfigUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=McpConfigView, + ) + + def list( + self, + *, + id: str | Omit = omit, + limit: int | Omit = omit, + name: str | Omit = omit, + starting_after: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncMcpConfigsCursorIDPage[McpConfigView]: + """ + [Beta] List all McpConfigs for the authenticated account. + + Args: + id: Filter by ID. + + limit: The limit of items to return. Default is 20. Max is 5000. + + name: Filter by name (prefix match supported). + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/mcp-configs", + page=SyncMcpConfigsCursorIDPage[McpConfigView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "id": id, + "limit": limit, + "name": name, + "starting_after": starting_after, + }, + mcp_config_list_params.McpConfigListParams, + ), + ), + model=McpConfigView, + ) + + def delete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> McpConfigView: + """[Beta] Delete an existing McpConfig. + + This action is irreversible. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/mcp-configs/{id}/delete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=McpConfigView, + ) + + +class AsyncMcpConfigsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncMcpConfigsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/runloopai/api-client-python#accessing-raw-response-data-eg-headers + """ + return AsyncMcpConfigsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncMcpConfigsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/runloopai/api-client-python#with_streaming_response + """ + return AsyncMcpConfigsResourceWithStreamingResponse(self) + + async def create( + self, + *, + allowed_tools: SequenceNotStr[str], + endpoint: str, + name: str, + description: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> McpConfigView: + """ + [Beta] Create a new McpConfig to connect to an upstream MCP (Model Context + Protocol) server. The config specifies the target endpoint and which tools are + allowed. + + Args: + allowed_tools: + Glob patterns specifying which tools are allowed from this MCP server. Examples: + ['*'] for all tools, ['github.search_*', 'github.get_*'] for specific patterns. + + endpoint: The target MCP server endpoint URL (e.g., 'https://mcp.example.com'). + + name: The human-readable name for the McpConfig. Must be unique within your account. + The first segment before '-' is used as the service name for tool routing (e.g., + 'github-readonly' uses 'github' as the service name). + + description: Optional description for this MCP configuration. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/v1/mcp-configs", + body=await async_maybe_transform( + { + "allowed_tools": allowed_tools, + "endpoint": endpoint, + "name": name, + "description": description, + }, + mcp_config_create_params.McpConfigCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=McpConfigView, + ) + + async def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> McpConfigView: + """ + [Beta] Get a specific McpConfig by its unique identifier. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._get( + f"/v1/mcp-configs/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=McpConfigView, + ) + + async def update( + self, + id: str, + *, + allowed_tools: Optional[SequenceNotStr[str]] | Omit = omit, + description: Optional[str] | Omit = omit, + endpoint: Optional[str] | Omit = omit, + name: Optional[str] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> McpConfigView: + """[Beta] Update an existing McpConfig. + + All fields are optional. + + Args: + allowed_tools: New glob patterns specifying which tools are allowed. Examples: ['*'] for all + tools, ['github.search_*'] for specific patterns. + + description: New description for this MCP configuration. + + endpoint: New target MCP server endpoint URL. + + name: New name for the McpConfig. Must be unique within your account. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/mcp-configs/{id}", + body=await async_maybe_transform( + { + "allowed_tools": allowed_tools, + "description": description, + "endpoint": endpoint, + "name": name, + }, + mcp_config_update_params.McpConfigUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=McpConfigView, + ) + + def list( + self, + *, + id: str | Omit = omit, + limit: int | Omit = omit, + name: str | Omit = omit, + starting_after: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[McpConfigView, AsyncMcpConfigsCursorIDPage[McpConfigView]]: + """ + [Beta] List all McpConfigs for the authenticated account. + + Args: + id: Filter by ID. + + limit: The limit of items to return. Default is 20. Max is 5000. + + name: Filter by name (prefix match supported). + + starting_after: Load the next page of data starting after the item with the given ID. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/v1/mcp-configs", + page=AsyncMcpConfigsCursorIDPage[McpConfigView], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "id": id, + "limit": limit, + "name": name, + "starting_after": starting_after, + }, + mcp_config_list_params.McpConfigListParams, + ), + ), + model=McpConfigView, + ) + + async def delete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> McpConfigView: + """[Beta] Delete an existing McpConfig. + + This action is irreversible. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/mcp-configs/{id}/delete", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=McpConfigView, + ) + + +class McpConfigsResourceWithRawResponse: + def __init__(self, mcp_configs: McpConfigsResource) -> None: + self._mcp_configs = mcp_configs + + self.create = to_raw_response_wrapper( + mcp_configs.create, + ) + self.retrieve = to_raw_response_wrapper( + mcp_configs.retrieve, + ) + self.update = to_raw_response_wrapper( + mcp_configs.update, + ) + self.list = to_raw_response_wrapper( + mcp_configs.list, + ) + self.delete = to_raw_response_wrapper( + mcp_configs.delete, + ) + + +class AsyncMcpConfigsResourceWithRawResponse: + def __init__(self, mcp_configs: AsyncMcpConfigsResource) -> None: + self._mcp_configs = mcp_configs + + self.create = async_to_raw_response_wrapper( + mcp_configs.create, + ) + self.retrieve = async_to_raw_response_wrapper( + mcp_configs.retrieve, + ) + self.update = async_to_raw_response_wrapper( + mcp_configs.update, + ) + self.list = async_to_raw_response_wrapper( + mcp_configs.list, + ) + self.delete = async_to_raw_response_wrapper( + mcp_configs.delete, + ) + + +class McpConfigsResourceWithStreamingResponse: + def __init__(self, mcp_configs: McpConfigsResource) -> None: + self._mcp_configs = mcp_configs + + self.create = to_streamed_response_wrapper( + mcp_configs.create, + ) + self.retrieve = to_streamed_response_wrapper( + mcp_configs.retrieve, + ) + self.update = to_streamed_response_wrapper( + mcp_configs.update, + ) + self.list = to_streamed_response_wrapper( + mcp_configs.list, + ) + self.delete = to_streamed_response_wrapper( + mcp_configs.delete, + ) + + +class AsyncMcpConfigsResourceWithStreamingResponse: + def __init__(self, mcp_configs: AsyncMcpConfigsResource) -> None: + self._mcp_configs = mcp_configs + + self.create = async_to_streamed_response_wrapper( + mcp_configs.create, + ) + self.retrieve = async_to_streamed_response_wrapper( + mcp_configs.retrieve, + ) + self.update = async_to_streamed_response_wrapper( + mcp_configs.update, + ) + self.list = async_to_streamed_response_wrapper( + mcp_configs.list, + ) + self.delete = async_to_streamed_response_wrapper( + mcp_configs.delete, + ) diff --git a/src/runloop_api_client/resources/scenarios/scorers.py b/src/runloop_api_client/resources/scenarios/scorers.py index 9e5d5e198..78185389c 100644 --- a/src/runloop_api_client/resources/scenarios/scorers.py +++ b/src/runloop_api_client/resources/scenarios/scorers.py @@ -16,13 +16,10 @@ ) from ...pagination import SyncScenarioScorersCursorIDPage, AsyncScenarioScorersCursorIDPage from ..._base_client import AsyncPaginator, make_request_options -from ...types.scenarios import scorer_list_params, scorer_create_params, scorer_update_params, scorer_validate_params -from ...types.scenario_environment_param import ScenarioEnvironmentParam +from ...types.scenarios import scorer_list_params, scorer_update_params from ...types.scenarios.scorer_list_response import ScorerListResponse -from ...types.scenarios.scorer_create_response import ScorerCreateResponse from ...types.scenarios.scorer_update_response import ScorerUpdateResponse from ...types.scenarios.scorer_retrieve_response import ScorerRetrieveResponse -from ...types.scenarios.scorer_validate_response import ScorerValidateResponse __all__ = ["ScorersResource", "AsyncScorersResource"] @@ -47,57 +44,6 @@ def with_streaming_response(self) -> ScorersResourceWithStreamingResponse: """ return ScorersResourceWithStreamingResponse(self) - def create( - self, - *, - bash_script: str, - type: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> ScorerCreateResponse: - """ - Create a custom scenario scorer. - - Args: - bash_script: Bash script for the custom scorer taking context as a json object - $RL_SCORER_CONTEXT. - - type: Name of the type of custom scorer. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - return self._post( - "/v1/scenarios/scorers", - body=maybe_transform( - { - "bash_script": bash_script, - "type": type, - }, - scorer_create_params.ScorerCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=ScorerCreateResponse, - ) - def retrieve( self, id: str, @@ -232,59 +178,6 @@ def list( model=ScorerListResponse, ) - def validate( - self, - id: str, - *, - scoring_context: object, - environment_parameters: ScenarioEnvironmentParam | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> ScorerValidateResponse: - """ - Validate a scenario scorer. - - Args: - scoring_context: Json context that gets passed to the custom scorer - - environment_parameters: The Environment in which the Scenario will run. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._post( - f"/v1/scenarios/scorers/{id}/validate", - body=maybe_transform( - { - "scoring_context": scoring_context, - "environment_parameters": environment_parameters, - }, - scorer_validate_params.ScorerValidateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=ScorerValidateResponse, - ) - class AsyncScorersResource(AsyncAPIResource): @cached_property @@ -306,57 +199,6 @@ def with_streaming_response(self) -> AsyncScorersResourceWithStreamingResponse: """ return AsyncScorersResourceWithStreamingResponse(self) - async def create( - self, - *, - bash_script: str, - type: str, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> ScorerCreateResponse: - """ - Create a custom scenario scorer. - - Args: - bash_script: Bash script for the custom scorer taking context as a json object - $RL_SCORER_CONTEXT. - - type: Name of the type of custom scorer. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - return await self._post( - "/v1/scenarios/scorers", - body=await async_maybe_transform( - { - "bash_script": bash_script, - "type": type, - }, - scorer_create_params.ScorerCreateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=ScorerCreateResponse, - ) - async def retrieve( self, id: str, @@ -491,67 +333,11 @@ def list( model=ScorerListResponse, ) - async def validate( - self, - id: str, - *, - scoring_context: object, - environment_parameters: ScenarioEnvironmentParam | Omit = omit, - # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. - # The extra values given here take precedence over values defined on the client or passed to this method. - extra_headers: Headers | None = None, - extra_query: Query | None = None, - extra_body: Body | None = None, - timeout: float | httpx.Timeout | None | NotGiven = not_given, - idempotency_key: str | None = None, - ) -> ScorerValidateResponse: - """ - Validate a scenario scorer. - - Args: - scoring_context: Json context that gets passed to the custom scorer - - environment_parameters: The Environment in which the Scenario will run. - - extra_headers: Send extra headers - - extra_query: Add additional query parameters to the request - - extra_body: Add additional JSON properties to the request - - timeout: Override the client-level default timeout for this request, in seconds - - idempotency_key: Specify a custom idempotency key for this request - """ - if not id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return await self._post( - f"/v1/scenarios/scorers/{id}/validate", - body=await async_maybe_transform( - { - "scoring_context": scoring_context, - "environment_parameters": environment_parameters, - }, - scorer_validate_params.ScorerValidateParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - idempotency_key=idempotency_key, - ), - cast_to=ScorerValidateResponse, - ) - class ScorersResourceWithRawResponse: def __init__(self, scorers: ScorersResource) -> None: self._scorers = scorers - self.create = to_raw_response_wrapper( - scorers.create, - ) self.retrieve = to_raw_response_wrapper( scorers.retrieve, ) @@ -561,18 +347,12 @@ def __init__(self, scorers: ScorersResource) -> None: self.list = to_raw_response_wrapper( scorers.list, ) - self.validate = to_raw_response_wrapper( - scorers.validate, - ) class AsyncScorersResourceWithRawResponse: def __init__(self, scorers: AsyncScorersResource) -> None: self._scorers = scorers - self.create = async_to_raw_response_wrapper( - scorers.create, - ) self.retrieve = async_to_raw_response_wrapper( scorers.retrieve, ) @@ -582,18 +362,12 @@ def __init__(self, scorers: AsyncScorersResource) -> None: self.list = async_to_raw_response_wrapper( scorers.list, ) - self.validate = async_to_raw_response_wrapper( - scorers.validate, - ) class ScorersResourceWithStreamingResponse: def __init__(self, scorers: ScorersResource) -> None: self._scorers = scorers - self.create = to_streamed_response_wrapper( - scorers.create, - ) self.retrieve = to_streamed_response_wrapper( scorers.retrieve, ) @@ -603,18 +377,12 @@ def __init__(self, scorers: ScorersResource) -> None: self.list = to_streamed_response_wrapper( scorers.list, ) - self.validate = to_streamed_response_wrapper( - scorers.validate, - ) class AsyncScorersResourceWithStreamingResponse: def __init__(self, scorers: AsyncScorersResource) -> None: self._scorers = scorers - self.create = async_to_streamed_response_wrapper( - scorers.create, - ) self.retrieve = async_to_streamed_response_wrapper( scorers.retrieve, ) @@ -624,6 +392,3 @@ def __init__(self, scorers: AsyncScorersResource) -> None: self.list = async_to_streamed_response_wrapper( scorers.list, ) - self.validate = async_to_streamed_response_wrapper( - scorers.validate, - ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index d7a3fe229..e6543484f 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -22,6 +22,7 @@ from .benchmark_view import BenchmarkView as BenchmarkView from .blueprint_view import BlueprintView as BlueprintView from .agent_list_view import AgentListView as AgentListView +from .mcp_config_view import McpConfigView as McpConfigView from .devbox_list_view import DevboxListView as DevboxListView from .object_list_view import ObjectListView as ObjectListView from .scoring_contract import ScoringContract as ScoringContract @@ -44,6 +45,7 @@ from .devbox_create_params import DevboxCreateParams as DevboxCreateParams from .devbox_snapshot_view import DevboxSnapshotView as DevboxSnapshotView from .devbox_update_params import DevboxUpdateParams as DevboxUpdateParams +from .mcp_config_list_view import McpConfigListView as McpConfigListView from .object_create_params import ObjectCreateParams as ObjectCreateParams from .scenario_environment import ScenarioEnvironment as ScenarioEnvironment from .scenario_list_params import ScenarioListParams as ScenarioListParams @@ -53,6 +55,7 @@ from .blueprint_list_params import BlueprintListParams as BlueprintListParams from .devbox_execute_params import DevboxExecuteParams as DevboxExecuteParams from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView +from .mcp_config_list_params import McpConfigListParams as McpConfigListParams from .object_download_params import ObjectDownloadParams as ObjectDownloadParams from .repository_list_params import RepositoryListParams as RepositoryListParams from .scenario_create_params import ScenarioCreateParams as ScenarioCreateParams @@ -68,6 +71,8 @@ from .inspection_source_param import InspectionSourceParam as InspectionSourceParam from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams from .gateway_config_list_view import GatewayConfigListView as GatewayConfigListView +from .mcp_config_create_params import McpConfigCreateParams as McpConfigCreateParams +from .mcp_config_update_params import McpConfigUpdateParams as McpConfigUpdateParams from .network_policy_list_view import NetworkPolicyListView as NetworkPolicyListView from .object_download_url_view import ObjectDownloadURLView as ObjectDownloadURLView from .repository_create_params import RepositoryCreateParams as RepositoryCreateParams diff --git a/src/runloop_api_client/types/mcp_config_create_params.py b/src/runloop_api_client/types/mcp_config_create_params.py new file mode 100644 index 000000000..4a2dcd9e2 --- /dev/null +++ b/src/runloop_api_client/types/mcp_config_create_params.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +from .._types import SequenceNotStr + +__all__ = ["McpConfigCreateParams"] + + +class McpConfigCreateParams(TypedDict, total=False): + allowed_tools: Required[SequenceNotStr[str]] + """Glob patterns specifying which tools are allowed from this MCP server. + + Examples: ['*'] for all tools, ['github.search_*', 'github.get_*'] for specific + patterns. + """ + + endpoint: Required[str] + """The target MCP server endpoint URL (e.g., 'https://mcp.example.com').""" + + name: Required[str] + """The human-readable name for the McpConfig. + + Must be unique within your account. The first segment before '-' is used as the + service name for tool routing (e.g., 'github-readonly' uses 'github' as the + service name). + """ + + description: Optional[str] + """Optional description for this MCP configuration.""" diff --git a/src/runloop_api_client/types/mcp_config_list_params.py b/src/runloop_api_client/types/mcp_config_list_params.py new file mode 100644 index 000000000..8b786ba13 --- /dev/null +++ b/src/runloop_api_client/types/mcp_config_list_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["McpConfigListParams"] + + +class McpConfigListParams(TypedDict, total=False): + id: str + """Filter by ID.""" + + limit: int + """The limit of items to return. Default is 20. Max is 5000.""" + + name: str + """Filter by name (prefix match supported).""" + + starting_after: str + """Load the next page of data starting after the item with the given ID.""" diff --git a/src/runloop_api_client/types/mcp_config_list_view.py b/src/runloop_api_client/types/mcp_config_list_view.py new file mode 100644 index 000000000..72075a255 --- /dev/null +++ b/src/runloop_api_client/types/mcp_config_list_view.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .mcp_config_view import McpConfigView + +__all__ = ["McpConfigListView"] + + +class McpConfigListView(BaseModel): + """A paginated list of McpConfigs.""" + + has_more: bool + """Whether there are more results available beyond this page.""" + + mcp_configs: List[McpConfigView] + """The list of McpConfigs.""" + + total_count: int + """Total count of McpConfigs that match the query.""" diff --git a/src/runloop_api_client/types/mcp_config_update_params.py b/src/runloop_api_client/types/mcp_config_update_params.py new file mode 100644 index 000000000..234ca939f --- /dev/null +++ b/src/runloop_api_client/types/mcp_config_update_params.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import TypedDict + +from .._types import SequenceNotStr + +__all__ = ["McpConfigUpdateParams"] + + +class McpConfigUpdateParams(TypedDict, total=False): + allowed_tools: Optional[SequenceNotStr[str]] + """New glob patterns specifying which tools are allowed. + + Examples: ['*'] for all tools, ['github.search_*'] for specific patterns. + """ + + description: Optional[str] + """New description for this MCP configuration.""" + + endpoint: Optional[str] + """New target MCP server endpoint URL.""" + + name: Optional[str] + """New name for the McpConfig. Must be unique within your account.""" diff --git a/src/runloop_api_client/types/mcp_config_view.py b/src/runloop_api_client/types/mcp_config_view.py new file mode 100644 index 000000000..c1e495cd1 --- /dev/null +++ b/src/runloop_api_client/types/mcp_config_view.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from .._models import BaseModel + +__all__ = ["McpConfigView"] + + +class McpConfigView(BaseModel): + """ + An McpConfig defines a configuration for connecting to an upstream MCP (Model Context Protocol) server. It specifies the target endpoint and which tools are allowed. + """ + + id: str + """The unique identifier of the McpConfig.""" + + allowed_tools: List[str] + """ + Glob patterns specifying which tools are allowed from this MCP server (e.g., + ['github.search_*', 'github.get_*'] or ['*'] for all tools). + """ + + create_time_ms: int + """Creation time of the McpConfig (Unix timestamp in milliseconds).""" + + endpoint: str + """The target MCP server endpoint URL (e.g., 'https://mcp.example.com').""" + + name: str + """The human-readable name of the McpConfig. Unique per account.""" + + account_id: Optional[str] = None + """The account ID that owns this config.""" + + description: Optional[str] = None + """Optional description for this MCP configuration.""" diff --git a/src/runloop_api_client/types/scenarios/__init__.py b/src/runloop_api_client/types/scenarios/__init__.py index d25c85c4e..fbb840e3b 100644 --- a/src/runloop_api_client/types/scenarios/__init__.py +++ b/src/runloop_api_client/types/scenarios/__init__.py @@ -4,11 +4,7 @@ from .run_list_params import RunListParams as RunListParams from .scorer_list_params import ScorerListParams as ScorerListParams -from .scorer_create_params import ScorerCreateParams as ScorerCreateParams from .scorer_list_response import ScorerListResponse as ScorerListResponse from .scorer_update_params import ScorerUpdateParams as ScorerUpdateParams -from .scorer_create_response import ScorerCreateResponse as ScorerCreateResponse from .scorer_update_response import ScorerUpdateResponse as ScorerUpdateResponse -from .scorer_validate_params import ScorerValidateParams as ScorerValidateParams from .scorer_retrieve_response import ScorerRetrieveResponse as ScorerRetrieveResponse -from .scorer_validate_response import ScorerValidateResponse as ScorerValidateResponse diff --git a/src/runloop_api_client/types/scenarios/scorer_create_params.py b/src/runloop_api_client/types/scenarios/scorer_create_params.py deleted file mode 100644 index 62a4e33f9..000000000 --- a/src/runloop_api_client/types/scenarios/scorer_create_params.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -__all__ = ["ScorerCreateParams"] - - -class ScorerCreateParams(TypedDict, total=False): - bash_script: Required[str] - """ - Bash script for the custom scorer taking context as a json object - $RL_SCORER_CONTEXT. - """ - - type: Required[str] - """Name of the type of custom scorer.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_create_response.py b/src/runloop_api_client/types/scenarios/scorer_create_response.py deleted file mode 100644 index 2b6e665a1..000000000 --- a/src/runloop_api_client/types/scenarios/scorer_create_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from ..._models import BaseModel - -__all__ = ["ScorerCreateResponse"] - - -class ScorerCreateResponse(BaseModel): - """A ScenarioScorerView represents a custom scoring function for a Scenario.""" - - id: str - """ID for the scenario scorer.""" - - bash_script: str - """Bash script that takes in $RL_SCORER_CONTEXT as env variable and runs scoring.""" - - type: str - """Name of the type of scenario scorer.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_validate_params.py b/src/runloop_api_client/types/scenarios/scorer_validate_params.py deleted file mode 100644 index 41215ea2d..000000000 --- a/src/runloop_api_client/types/scenarios/scorer_validate_params.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Required, TypedDict - -from ..scenario_environment_param import ScenarioEnvironmentParam - -__all__ = ["ScorerValidateParams"] - - -class ScorerValidateParams(TypedDict, total=False): - scoring_context: Required[object] - """Json context that gets passed to the custom scorer""" - - environment_parameters: ScenarioEnvironmentParam - """The Environment in which the Scenario will run.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_validate_response.py b/src/runloop_api_client/types/scenarios/scorer_validate_response.py deleted file mode 100644 index 6c2755e6c..000000000 --- a/src/runloop_api_client/types/scenarios/scorer_validate_response.py +++ /dev/null @@ -1,23 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional - -from ..._models import BaseModel -from ..scenario_environment import ScenarioEnvironment -from ..scoring_function_result_view import ScoringFunctionResultView - -__all__ = ["ScorerValidateResponse"] - - -class ScorerValidateResponse(BaseModel): - name: str - """Name of the custom scorer.""" - - scoring_context: object - """Json context that gets passed to the custom scorer""" - - scoring_result: ScoringFunctionResultView - """Result of the scoring function.""" - - environment_parameters: Optional[ScenarioEnvironment] = None - """The Environment in which the Scenario will run.""" diff --git a/tests/api_resources/scenarios/test_scorers.py b/tests/api_resources/scenarios/test_scorers.py index 73be902fd..7c0c17514 100644 --- a/tests/api_resources/scenarios/test_scorers.py +++ b/tests/api_resources/scenarios/test_scorers.py @@ -12,10 +12,8 @@ from runloop_api_client.pagination import SyncScenarioScorersCursorIDPage, AsyncScenarioScorersCursorIDPage from runloop_api_client.types.scenarios import ( ScorerListResponse, - ScorerCreateResponse, ScorerUpdateResponse, ScorerRetrieveResponse, - ScorerValidateResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,40 +22,6 @@ class TestScorers: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @parametrize - def test_method_create(self, client: Runloop) -> None: - scorer = client.scenarios.scorers.create( - bash_script="bash_script", - type="type", - ) - assert_matches_type(ScorerCreateResponse, scorer, path=["response"]) - - @parametrize - def test_raw_response_create(self, client: Runloop) -> None: - response = client.scenarios.scorers.with_raw_response.create( - bash_script="bash_script", - type="type", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - scorer = response.parse() - assert_matches_type(ScorerCreateResponse, scorer, path=["response"]) - - @parametrize - def test_streaming_response_create(self, client: Runloop) -> None: - with client.scenarios.scorers.with_streaming_response.create( - bash_script="bash_script", - type="type", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - scorer = response.parse() - assert_matches_type(ScorerCreateResponse, scorer, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize def test_method_retrieve(self, client: Runloop) -> None: scorer = client.scenarios.scorers.retrieve( @@ -175,121 +139,12 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert cast(Any, response.is_closed) is True - @parametrize - def test_method_validate(self, client: Runloop) -> None: - scorer = client.scenarios.scorers.validate( - id="id", - scoring_context={}, - ) - assert_matches_type(ScorerValidateResponse, scorer, path=["response"]) - - @parametrize - def test_method_validate_with_all_params(self, client: Runloop) -> None: - scorer = client.scenarios.scorers.validate( - id="id", - scoring_context={}, - environment_parameters={ - "blueprint_id": "blueprint_id", - "launch_parameters": { - "after_idle": { - "idle_time_seconds": 0, - "on_idle": "shutdown", - }, - "architecture": "x86_64", - "available_ports": [0], - "custom_cpu_cores": 0, - "custom_disk_size": 0, - "custom_gb_memory": 0, - "keep_alive_time_seconds": 0, - "launch_commands": ["string"], - "network_policy_id": "network_policy_id", - "required_services": ["string"], - "resource_size_request": "X_SMALL", - "user_parameters": { - "uid": 0, - "username": "username", - }, - }, - "snapshot_id": "snapshot_id", - "working_directory": "working_directory", - }, - ) - assert_matches_type(ScorerValidateResponse, scorer, path=["response"]) - - @parametrize - def test_raw_response_validate(self, client: Runloop) -> None: - response = client.scenarios.scorers.with_raw_response.validate( - id="id", - scoring_context={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - scorer = response.parse() - assert_matches_type(ScorerValidateResponse, scorer, path=["response"]) - - @parametrize - def test_streaming_response_validate(self, client: Runloop) -> None: - with client.scenarios.scorers.with_streaming_response.validate( - id="id", - scoring_context={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - scorer = response.parse() - assert_matches_type(ScorerValidateResponse, scorer, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_validate(self, client: Runloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.scenarios.scorers.with_raw_response.validate( - id="", - scoring_context={}, - ) - class TestAsyncScorers: parametrize = pytest.mark.parametrize( "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @parametrize - async def test_method_create(self, async_client: AsyncRunloop) -> None: - scorer = await async_client.scenarios.scorers.create( - bash_script="bash_script", - type="type", - ) - assert_matches_type(ScorerCreateResponse, scorer, path=["response"]) - - @parametrize - async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: - response = await async_client.scenarios.scorers.with_raw_response.create( - bash_script="bash_script", - type="type", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - scorer = await response.parse() - assert_matches_type(ScorerCreateResponse, scorer, path=["response"]) - - @parametrize - async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: - async with async_client.scenarios.scorers.with_streaming_response.create( - bash_script="bash_script", - type="type", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - scorer = await response.parse() - assert_matches_type(ScorerCreateResponse, scorer, path=["response"]) - - assert cast(Any, response.is_closed) is True - @parametrize async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: scorer = await async_client.scenarios.scorers.retrieve( @@ -406,78 +261,3 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert_matches_type(AsyncScenarioScorersCursorIDPage[ScorerListResponse], scorer, path=["response"]) assert cast(Any, response.is_closed) is True - - @parametrize - async def test_method_validate(self, async_client: AsyncRunloop) -> None: - scorer = await async_client.scenarios.scorers.validate( - id="id", - scoring_context={}, - ) - assert_matches_type(ScorerValidateResponse, scorer, path=["response"]) - - @parametrize - async def test_method_validate_with_all_params(self, async_client: AsyncRunloop) -> None: - scorer = await async_client.scenarios.scorers.validate( - id="id", - scoring_context={}, - environment_parameters={ - "blueprint_id": "blueprint_id", - "launch_parameters": { - "after_idle": { - "idle_time_seconds": 0, - "on_idle": "shutdown", - }, - "architecture": "x86_64", - "available_ports": [0], - "custom_cpu_cores": 0, - "custom_disk_size": 0, - "custom_gb_memory": 0, - "keep_alive_time_seconds": 0, - "launch_commands": ["string"], - "network_policy_id": "network_policy_id", - "required_services": ["string"], - "resource_size_request": "X_SMALL", - "user_parameters": { - "uid": 0, - "username": "username", - }, - }, - "snapshot_id": "snapshot_id", - "working_directory": "working_directory", - }, - ) - assert_matches_type(ScorerValidateResponse, scorer, path=["response"]) - - @parametrize - async def test_raw_response_validate(self, async_client: AsyncRunloop) -> None: - response = await async_client.scenarios.scorers.with_raw_response.validate( - id="id", - scoring_context={}, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - scorer = await response.parse() - assert_matches_type(ScorerValidateResponse, scorer, path=["response"]) - - @parametrize - async def test_streaming_response_validate(self, async_client: AsyncRunloop) -> None: - async with async_client.scenarios.scorers.with_streaming_response.validate( - id="id", - scoring_context={}, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - scorer = await response.parse() - assert_matches_type(ScorerValidateResponse, scorer, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_validate(self, async_client: AsyncRunloop) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.scenarios.scorers.with_raw_response.validate( - id="", - scoring_context={}, - ) diff --git a/tests/api_resources/test_mcp_configs.py b/tests/api_resources/test_mcp_configs.py new file mode 100644 index 000000000..0d3135668 --- /dev/null +++ b/tests/api_resources/test_mcp_configs.py @@ -0,0 +1,441 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from runloop_api_client import Runloop, AsyncRunloop +from runloop_api_client.types import ( + McpConfigView, +) +from runloop_api_client.pagination import SyncMcpConfigsCursorIDPage, AsyncMcpConfigsCursorIDPage + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestMcpConfigs: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Runloop) -> None: + mcp_config = client.mcp_configs.create( + allowed_tools=["string"], + endpoint="endpoint", + name="name", + ) + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Runloop) -> None: + mcp_config = client.mcp_configs.create( + allowed_tools=["string"], + endpoint="endpoint", + name="name", + description="description", + ) + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Runloop) -> None: + response = client.mcp_configs.with_raw_response.create( + allowed_tools=["string"], + endpoint="endpoint", + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + mcp_config = response.parse() + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Runloop) -> None: + with client.mcp_configs.with_streaming_response.create( + allowed_tools=["string"], + endpoint="endpoint", + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + mcp_config = response.parse() + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_retrieve(self, client: Runloop) -> None: + mcp_config = client.mcp_configs.retrieve( + "id", + ) + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: Runloop) -> None: + response = client.mcp_configs.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + mcp_config = response.parse() + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + @parametrize + def test_streaming_response_retrieve(self, client: Runloop) -> None: + with client.mcp_configs.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + mcp_config = response.parse() + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_retrieve(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.mcp_configs.with_raw_response.retrieve( + "", + ) + + @parametrize + def test_method_update(self, client: Runloop) -> None: + mcp_config = client.mcp_configs.update( + id="id", + ) + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Runloop) -> None: + mcp_config = client.mcp_configs.update( + id="id", + allowed_tools=["string"], + description="description", + endpoint="endpoint", + name="name", + ) + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Runloop) -> None: + response = client.mcp_configs.with_raw_response.update( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + mcp_config = response.parse() + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Runloop) -> None: + with client.mcp_configs.with_streaming_response.update( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + mcp_config = response.parse() + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.mcp_configs.with_raw_response.update( + id="", + ) + + @parametrize + def test_method_list(self, client: Runloop) -> None: + mcp_config = client.mcp_configs.list() + assert_matches_type(SyncMcpConfigsCursorIDPage[McpConfigView], mcp_config, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Runloop) -> None: + mcp_config = client.mcp_configs.list( + id="id", + limit=0, + name="name", + starting_after="starting_after", + ) + assert_matches_type(SyncMcpConfigsCursorIDPage[McpConfigView], mcp_config, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Runloop) -> None: + response = client.mcp_configs.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + mcp_config = response.parse() + assert_matches_type(SyncMcpConfigsCursorIDPage[McpConfigView], mcp_config, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Runloop) -> None: + with client.mcp_configs.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + mcp_config = response.parse() + assert_matches_type(SyncMcpConfigsCursorIDPage[McpConfigView], mcp_config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_delete(self, client: Runloop) -> None: + mcp_config = client.mcp_configs.delete( + "id", + ) + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Runloop) -> None: + response = client.mcp_configs.with_raw_response.delete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + mcp_config = response.parse() + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Runloop) -> None: + with client.mcp_configs.with_streaming_response.delete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + mcp_config = response.parse() + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.mcp_configs.with_raw_response.delete( + "", + ) + + +class TestAsyncMcpConfigs: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_create(self, async_client: AsyncRunloop) -> None: + mcp_config = await async_client.mcp_configs.create( + allowed_tools=["string"], + endpoint="endpoint", + name="name", + ) + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: + mcp_config = await async_client.mcp_configs.create( + allowed_tools=["string"], + endpoint="endpoint", + name="name", + description="description", + ) + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: + response = await async_client.mcp_configs.with_raw_response.create( + allowed_tools=["string"], + endpoint="endpoint", + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + mcp_config = await response.parse() + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: + async with async_client.mcp_configs.with_streaming_response.create( + allowed_tools=["string"], + endpoint="endpoint", + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + mcp_config = await response.parse() + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: + mcp_config = await async_client.mcp_configs.retrieve( + "id", + ) + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, async_client: AsyncRunloop) -> None: + response = await async_client.mcp_configs.with_raw_response.retrieve( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + mcp_config = await response.parse() + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + @parametrize + async def test_streaming_response_retrieve(self, async_client: AsyncRunloop) -> None: + async with async_client.mcp_configs.with_streaming_response.retrieve( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + mcp_config = await response.parse() + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_retrieve(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.mcp_configs.with_raw_response.retrieve( + "", + ) + + @parametrize + async def test_method_update(self, async_client: AsyncRunloop) -> None: + mcp_config = await async_client.mcp_configs.update( + id="id", + ) + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncRunloop) -> None: + mcp_config = await async_client.mcp_configs.update( + id="id", + allowed_tools=["string"], + description="description", + endpoint="endpoint", + name="name", + ) + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncRunloop) -> None: + response = await async_client.mcp_configs.with_raw_response.update( + id="id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + mcp_config = await response.parse() + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncRunloop) -> None: + async with async_client.mcp_configs.with_streaming_response.update( + id="id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + mcp_config = await response.parse() + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.mcp_configs.with_raw_response.update( + id="", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncRunloop) -> None: + mcp_config = await async_client.mcp_configs.list() + assert_matches_type(AsyncMcpConfigsCursorIDPage[McpConfigView], mcp_config, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncRunloop) -> None: + mcp_config = await async_client.mcp_configs.list( + id="id", + limit=0, + name="name", + starting_after="starting_after", + ) + assert_matches_type(AsyncMcpConfigsCursorIDPage[McpConfigView], mcp_config, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncRunloop) -> None: + response = await async_client.mcp_configs.with_raw_response.list() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + mcp_config = await response.parse() + assert_matches_type(AsyncMcpConfigsCursorIDPage[McpConfigView], mcp_config, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None: + async with async_client.mcp_configs.with_streaming_response.list() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + mcp_config = await response.parse() + assert_matches_type(AsyncMcpConfigsCursorIDPage[McpConfigView], mcp_config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_delete(self, async_client: AsyncRunloop) -> None: + mcp_config = await async_client.mcp_configs.delete( + "id", + ) + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncRunloop) -> None: + response = await async_client.mcp_configs.with_raw_response.delete( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + mcp_config = await response.parse() + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncRunloop) -> None: + async with async_client.mcp_configs.with_streaming_response.delete( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + mcp_config = await response.parse() + assert_matches_type(McpConfigView, mcp_config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.mcp_configs.with_raw_response.delete( + "", + ) From 99e552247e815ce5590e9afb285da77396e6273f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Feb 2026 18:22:59 +0000 Subject: [PATCH 962/993] feat(devbox): add mcp configuration to devbox create (#7341) --- .stats.yml | 6 +- api.md | 2 + .../resources/devboxes/devboxes.py | 14 +++ .../resources/scenarios/scorers.py | 117 +++++++++++++++++- .../types/devbox_create_params.py | 22 +++- .../types/mcp_config_view.py | 3 - .../types/scenarios/__init__.py | 2 + .../types/scenarios/scorer_create_params.py | 18 +++ .../types/scenarios/scorer_create_response.py | 18 +++ tests/api_resources/scenarios/test_scorers.py | 69 +++++++++++ tests/api_resources/test_devboxes.py | 12 ++ 11 files changed, 275 insertions(+), 8 deletions(-) create mode 100644 src/runloop_api_client/types/scenarios/scorer_create_params.py create mode 100644 src/runloop_api_client/types/scenarios/scorer_create_response.py diff --git a/.stats.yml b/.stats.yml index abe925b09..73c283357 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 116 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-eb90951855ef91c431a7b07ea6a42c1c470c1a0c905e19e4926b48e8039bf4cb.yml -openapi_spec_hash: e98232f95d6fd27f1200e354cee0059a +configured_endpoints: 117 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-15b7fd06098d8cb3639efb3b401a03d7d97a8ab4960b08077aa871f0cacb33d3.yml +openapi_spec_hash: 93ab2fe88f9e57d8f262ad6d1179190e config_hash: eb28692edd68a6ae95cf92af931c9976 diff --git a/api.md b/api.md index 06e121a97..8da768ee1 100644 --- a/api.md +++ b/api.md @@ -294,6 +294,7 @@ Types: ```python from runloop_api_client.types.scenarios import ( + ScorerCreateResponse, ScorerRetrieveResponse, ScorerUpdateResponse, ScorerListResponse, @@ -302,6 +303,7 @@ from runloop_api_client.types.scenarios import ( Methods: +- client.scenarios.scorers.create(\*\*params) -> ScorerCreateResponse - client.scenarios.scorers.retrieve(id) -> ScorerRetrieveResponse - client.scenarios.scorers.update(id, \*\*params) -> ScorerUpdateResponse - client.scenarios.scorers.list(\*\*params) -> SyncScenarioScorersCursorIDPage[ScorerListResponse] diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 2811e9efb..05929c2c7 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -159,6 +159,7 @@ def create( file_mounts: Optional[Dict[str, str]] | Omit = omit, gateways: Optional[Dict[str, devbox_create_params.Gateways]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, + mcp: Optional[Iterable[devbox_create_params.Mcp]] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, mounts: Optional[Iterable[Mount]] | Omit = omit, name: Optional[str] | Omit = omit, @@ -209,6 +210,11 @@ def create( launch_parameters: Parameters to configure the resources and launch time behavior of the Devbox. + mcp: [Beta] (Optional) MCP specifications for MCP server access. Each spec links an + MCP config to a secret. The devbox will receive environment variables + (RL_MCP_URL, RL_MCP_TOKEN) for accessing MCP servers through the MCP hub. + Example: [{'mcp_config': 'github-readonly', 'secret': 'MY_GITHUB_TOKEN'}] + metadata: User defined metadata to attach to the devbox for organization. mounts: A list of mounts to be included in the Devbox. @@ -251,6 +257,7 @@ def create( "file_mounts": file_mounts, "gateways": gateways, "launch_parameters": launch_parameters, + "mcp": mcp, "metadata": metadata, "mounts": mounts, "name": name, @@ -1574,6 +1581,7 @@ async def create( file_mounts: Optional[Dict[str, str]] | Omit = omit, gateways: Optional[Dict[str, devbox_create_params.Gateways]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, + mcp: Optional[Iterable[devbox_create_params.Mcp]] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, mounts: Optional[Iterable[Mount]] | Omit = omit, name: Optional[str] | Omit = omit, @@ -1624,6 +1632,11 @@ async def create( launch_parameters: Parameters to configure the resources and launch time behavior of the Devbox. + mcp: [Beta] (Optional) MCP specifications for MCP server access. Each spec links an + MCP config to a secret. The devbox will receive environment variables + (RL_MCP_URL, RL_MCP_TOKEN) for accessing MCP servers through the MCP hub. + Example: [{'mcp_config': 'github-readonly', 'secret': 'MY_GITHUB_TOKEN'}] + metadata: User defined metadata to attach to the devbox for organization. mounts: A list of mounts to be included in the Devbox. @@ -1666,6 +1679,7 @@ async def create( "file_mounts": file_mounts, "gateways": gateways, "launch_parameters": launch_parameters, + "mcp": mcp, "metadata": metadata, "mounts": mounts, "name": name, diff --git a/src/runloop_api_client/resources/scenarios/scorers.py b/src/runloop_api_client/resources/scenarios/scorers.py index 78185389c..cdb011dc7 100644 --- a/src/runloop_api_client/resources/scenarios/scorers.py +++ b/src/runloop_api_client/resources/scenarios/scorers.py @@ -16,8 +16,9 @@ ) from ...pagination import SyncScenarioScorersCursorIDPage, AsyncScenarioScorersCursorIDPage from ..._base_client import AsyncPaginator, make_request_options -from ...types.scenarios import scorer_list_params, scorer_update_params +from ...types.scenarios import scorer_list_params, scorer_create_params, scorer_update_params from ...types.scenarios.scorer_list_response import ScorerListResponse +from ...types.scenarios.scorer_create_response import ScorerCreateResponse from ...types.scenarios.scorer_update_response import ScorerUpdateResponse from ...types.scenarios.scorer_retrieve_response import ScorerRetrieveResponse @@ -44,6 +45,57 @@ def with_streaming_response(self) -> ScorersResourceWithStreamingResponse: """ return ScorersResourceWithStreamingResponse(self) + def create( + self, + *, + bash_script: str, + type: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> ScorerCreateResponse: + """ + Create a custom scenario scorer. + + Args: + bash_script: Bash script for the custom scorer taking context as a json object + $RL_SCORER_CONTEXT. + + type: Name of the type of custom scorer. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/v1/scenarios/scorers", + body=maybe_transform( + { + "bash_script": bash_script, + "type": type, + }, + scorer_create_params.ScorerCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ScorerCreateResponse, + ) + def retrieve( self, id: str, @@ -199,6 +251,57 @@ def with_streaming_response(self) -> AsyncScorersResourceWithStreamingResponse: """ return AsyncScorersResourceWithStreamingResponse(self) + async def create( + self, + *, + bash_script: str, + type: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> ScorerCreateResponse: + """ + Create a custom scenario scorer. + + Args: + bash_script: Bash script for the custom scorer taking context as a json object + $RL_SCORER_CONTEXT. + + type: Name of the type of custom scorer. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/v1/scenarios/scorers", + body=await async_maybe_transform( + { + "bash_script": bash_script, + "type": type, + }, + scorer_create_params.ScorerCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ScorerCreateResponse, + ) + async def retrieve( self, id: str, @@ -338,6 +441,9 @@ class ScorersResourceWithRawResponse: def __init__(self, scorers: ScorersResource) -> None: self._scorers = scorers + self.create = to_raw_response_wrapper( + scorers.create, + ) self.retrieve = to_raw_response_wrapper( scorers.retrieve, ) @@ -353,6 +459,9 @@ class AsyncScorersResourceWithRawResponse: def __init__(self, scorers: AsyncScorersResource) -> None: self._scorers = scorers + self.create = async_to_raw_response_wrapper( + scorers.create, + ) self.retrieve = async_to_raw_response_wrapper( scorers.retrieve, ) @@ -368,6 +477,9 @@ class ScorersResourceWithStreamingResponse: def __init__(self, scorers: ScorersResource) -> None: self._scorers = scorers + self.create = to_streamed_response_wrapper( + scorers.create, + ) self.retrieve = to_streamed_response_wrapper( scorers.retrieve, ) @@ -383,6 +495,9 @@ class AsyncScorersResourceWithStreamingResponse: def __init__(self, scorers: AsyncScorersResource) -> None: self._scorers = scorers + self.create = async_to_streamed_response_wrapper( + scorers.create, + ) self.retrieve = async_to_streamed_response_wrapper( scorers.retrieve, ) diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 9d1324a8c..e6d27eb5d 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -9,7 +9,7 @@ from .shared_params.launch_parameters import LaunchParameters from .shared_params.code_mount_parameters import CodeMountParameters -__all__ = ["DevboxCreateParams", "Gateways", "Tunnel"] +__all__ = ["DevboxCreateParams", "Gateways", "Mcp", "Tunnel"] class DevboxCreateParams(TypedDict, total=False): @@ -56,6 +56,14 @@ class DevboxCreateParams(TypedDict, total=False): launch_parameters: Optional[LaunchParameters] """Parameters to configure the resources and launch time behavior of the Devbox.""" + mcp: Optional[Iterable[Mcp]] + """[Beta] (Optional) MCP specifications for MCP server access. + + Each spec links an MCP config to a secret. The devbox will receive environment + variables (RL_MCP_URL, RL_MCP_TOKEN) for accessing MCP servers through the MCP + hub. Example: [{'mcp_config': 'github-readonly', 'secret': 'MY_GITHUB_TOKEN'}] + """ + metadata: Optional[Dict[str, str]] """User defined metadata to attach to the devbox for organization.""" @@ -102,6 +110,18 @@ class Gateways(TypedDict, total=False): """The secret containing the credential. Can be a secret ID or name.""" +class Mcp(TypedDict, total=False): + """ + [Beta] McpSpec links an MCP configuration to a secret for MCP server access in a devbox. The MCP hub will proxy requests to upstream MCP servers using the specified credential, with tool-level access control based on the MCP config's allowed_tools. + """ + + mcp_config: Required[str] + """The MCP config to use. Can be an MCP config ID (mcp_xxx) or name.""" + + secret: Required[str] + """The secret containing the MCP server credential. Can be a secret ID or name.""" + + class Tunnel(TypedDict, total=False): """(Optional) Configuration for creating a V2 tunnel at Devbox launch time. diff --git a/src/runloop_api_client/types/mcp_config_view.py b/src/runloop_api_client/types/mcp_config_view.py index c1e495cd1..988537a59 100644 --- a/src/runloop_api_client/types/mcp_config_view.py +++ b/src/runloop_api_client/types/mcp_config_view.py @@ -30,8 +30,5 @@ class McpConfigView(BaseModel): name: str """The human-readable name of the McpConfig. Unique per account.""" - account_id: Optional[str] = None - """The account ID that owns this config.""" - description: Optional[str] = None """Optional description for this MCP configuration.""" diff --git a/src/runloop_api_client/types/scenarios/__init__.py b/src/runloop_api_client/types/scenarios/__init__.py index fbb840e3b..97efebd9d 100644 --- a/src/runloop_api_client/types/scenarios/__init__.py +++ b/src/runloop_api_client/types/scenarios/__init__.py @@ -4,7 +4,9 @@ from .run_list_params import RunListParams as RunListParams from .scorer_list_params import ScorerListParams as ScorerListParams +from .scorer_create_params import ScorerCreateParams as ScorerCreateParams from .scorer_list_response import ScorerListResponse as ScorerListResponse from .scorer_update_params import ScorerUpdateParams as ScorerUpdateParams +from .scorer_create_response import ScorerCreateResponse as ScorerCreateResponse from .scorer_update_response import ScorerUpdateResponse as ScorerUpdateResponse from .scorer_retrieve_response import ScorerRetrieveResponse as ScorerRetrieveResponse diff --git a/src/runloop_api_client/types/scenarios/scorer_create_params.py b/src/runloop_api_client/types/scenarios/scorer_create_params.py new file mode 100644 index 000000000..62a4e33f9 --- /dev/null +++ b/src/runloop_api_client/types/scenarios/scorer_create_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["ScorerCreateParams"] + + +class ScorerCreateParams(TypedDict, total=False): + bash_script: Required[str] + """ + Bash script for the custom scorer taking context as a json object + $RL_SCORER_CONTEXT. + """ + + type: Required[str] + """Name of the type of custom scorer.""" diff --git a/src/runloop_api_client/types/scenarios/scorer_create_response.py b/src/runloop_api_client/types/scenarios/scorer_create_response.py new file mode 100644 index 000000000..2b6e665a1 --- /dev/null +++ b/src/runloop_api_client/types/scenarios/scorer_create_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from ..._models import BaseModel + +__all__ = ["ScorerCreateResponse"] + + +class ScorerCreateResponse(BaseModel): + """A ScenarioScorerView represents a custom scoring function for a Scenario.""" + + id: str + """ID for the scenario scorer.""" + + bash_script: str + """Bash script that takes in $RL_SCORER_CONTEXT as env variable and runs scoring.""" + + type: str + """Name of the type of scenario scorer.""" diff --git a/tests/api_resources/scenarios/test_scorers.py b/tests/api_resources/scenarios/test_scorers.py index 7c0c17514..359e0dcc7 100644 --- a/tests/api_resources/scenarios/test_scorers.py +++ b/tests/api_resources/scenarios/test_scorers.py @@ -12,6 +12,7 @@ from runloop_api_client.pagination import SyncScenarioScorersCursorIDPage, AsyncScenarioScorersCursorIDPage from runloop_api_client.types.scenarios import ( ScorerListResponse, + ScorerCreateResponse, ScorerUpdateResponse, ScorerRetrieveResponse, ) @@ -22,6 +23,40 @@ class TestScorers: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + def test_method_create(self, client: Runloop) -> None: + scorer = client.scenarios.scorers.create( + bash_script="bash_script", + type="type", + ) + assert_matches_type(ScorerCreateResponse, scorer, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Runloop) -> None: + response = client.scenarios.scorers.with_raw_response.create( + bash_script="bash_script", + type="type", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scorer = response.parse() + assert_matches_type(ScorerCreateResponse, scorer, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Runloop) -> None: + with client.scenarios.scorers.with_streaming_response.create( + bash_script="bash_script", + type="type", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scorer = response.parse() + assert_matches_type(ScorerCreateResponse, scorer, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_retrieve(self, client: Runloop) -> None: scorer = client.scenarios.scorers.retrieve( @@ -145,6 +180,40 @@ class TestAsyncScorers: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) + @parametrize + async def test_method_create(self, async_client: AsyncRunloop) -> None: + scorer = await async_client.scenarios.scorers.create( + bash_script="bash_script", + type="type", + ) + assert_matches_type(ScorerCreateResponse, scorer, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncRunloop) -> None: + response = await async_client.scenarios.scorers.with_raw_response.create( + bash_script="bash_script", + type="type", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scorer = await response.parse() + assert_matches_type(ScorerCreateResponse, scorer, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncRunloop) -> None: + async with async_client.scenarios.scorers.with_streaming_response.create( + bash_script="bash_script", + type="type", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scorer = await response.parse() + assert_matches_type(ScorerCreateResponse, scorer, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_retrieve(self, async_client: AsyncRunloop) -> None: scorer = await async_client.scenarios.scorers.retrieve( diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index fd9641ace..205795c17 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -89,6 +89,12 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "username": "username", }, }, + mcp=[ + { + "mcp_config": "mcp_config", + "secret": "secret", + } + ], metadata={"foo": "string"}, mounts=[ { @@ -1266,6 +1272,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "username": "username", }, }, + mcp=[ + { + "mcp_config": "mcp_config", + "secret": "secret", + } + ], metadata={"foo": "string"}, mounts=[ { From 84ac5b82790b8911d0aa5a74c5613e5785101e0f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Feb 2026 20:42:20 +0000 Subject: [PATCH 963/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4a2f7e609..cce9d1c6d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.5.1" + ".": "1.7.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index e9c9cf712..0f3a700eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "1.5.1" +version = "1.7.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 962984a45..da0fd9d41 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "1.5.1" # x-release-please-version +__version__ = "1.7.0" # x-release-please-version diff --git a/uv.lock b/uv.lock index e465fa64b..6f386393b 100644 --- a/uv.lock +++ b/uv.lock @@ -1321,7 +1321,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "1.5.1" +version = "1.7.0" source = { editable = "." } dependencies = [ { name = "anyio" }, From 255c418cd30c7312b663474ccce875464a03ee95 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Feb 2026 03:41:21 +0000 Subject: [PATCH 964/993] chore(internal): bump dependencies --- requirements-dev.lock | 18 +- uv.lock | 656 +++++++++++++++++++++--------------------- 2 files changed, 337 insertions(+), 337 deletions(-) diff --git a/requirements-dev.lock b/requirements-dev.lock index 95b4c2f35..4def5ae9c 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -3,13 +3,13 @@ -e . annotated-types==0.7.0 # via pydantic -anyio==4.12.0 +anyio==4.12.1 # via # httpx # runloop-api-client backports-asyncio-runner==1.2.0 ; python_full_version < '3.11' # via pytest-asyncio -certifi==2025.11.12 +certifi==2026.1.4 # via # httpcore # httpx @@ -36,7 +36,7 @@ idna==3.11 # via # anyio # httpx -importlib-metadata==8.7.0 +importlib-metadata==8.7.1 iniconfig==2.1.0 ; python_full_version < '3.10' # via pytest iniconfig==2.3.0 ; python_full_version >= '3.10' @@ -50,11 +50,11 @@ mdurl==0.1.2 mypy==1.17.0 mypy-extensions==1.1.0 # via mypy -nodeenv==1.9.1 +nodeenv==1.10.0 # via pyright packaging==25.0 # via pytest -pathspec==0.12.1 +pathspec==1.0.3 # via mypy pluggy==1.6.0 # via pytest @@ -71,7 +71,7 @@ pytest==8.4.2 ; python_full_version < '3.10' # via # pytest-asyncio # pytest-xdist -pytest==9.0.1 ; python_full_version >= '3.10' +pytest==9.0.2 ; python_full_version >= '3.10' # via # pytest-asyncio # pytest-xdist @@ -82,14 +82,14 @@ python-dateutil==2.9.0.post0 ; python_full_version < '3.10' # via time-machine respx==0.22.0 rich==14.2.0 -ruff==0.14.7 +ruff==0.14.13 six==1.17.0 ; python_full_version < '3.10' # via python-dateutil sniffio==1.3.1 # via runloop-api-client time-machine==2.19.0 ; python_full_version < '3.10' -time-machine==3.1.0 ; python_full_version >= '3.10' -tomli==2.3.0 ; python_full_version < '3.11' +time-machine==3.2.0 ; python_full_version >= '3.10' +tomli==2.4.0 ; python_full_version < '3.11' # via # mypy # pytest diff --git a/uv.lock b/uv.lock index 6f386393b..84e4265df 100644 --- a/uv.lock +++ b/uv.lock @@ -26,7 +26,7 @@ wheels = [ [[package]] name = "aiohttp" -version = "3.13.2" +version = "3.13.3" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "aiohappyeyeballs" }, @@ -38,127 +38,127 @@ dependencies = [ { name = "propcache" }, { name = "yarl" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/1c/ce/3b83ebba6b3207a7135e5fcaba49706f8a4b6008153b4e30540c982fae26/aiohttp-3.13.2.tar.gz", hash = "sha256:40176a52c186aefef6eb3cad2cdd30cd06e3afbe88fe8ab2af9c0b90f228daca", size = 7837994, upload-time = "2025-10-28T20:59:39.937Z" } +sdist = { url = "https://files.pythonhosted.org/packages/50/42/32cf8e7704ceb4481406eb87161349abb46a57fee3f008ba9cb610968646/aiohttp-3.13.3.tar.gz", hash = "sha256:a949eee43d3782f2daae4f4a2819b2cb9b0c5d3b7f7a927067cc84dafdbb9f88", size = 7844556, upload-time = "2026-01-03T17:33:05.204Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/6d/34/939730e66b716b76046dedfe0842995842fa906ccc4964bba414ff69e429/aiohttp-3.13.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:2372b15a5f62ed37789a6b383ff7344fc5b9f243999b0cd9b629d8bc5f5b4155", size = 736471, upload-time = "2025-10-28T20:55:27.924Z" }, - { url = "https://files.pythonhosted.org/packages/fd/cf/dcbdf2df7f6ca72b0bb4c0b4509701f2d8942cf54e29ca197389c214c07f/aiohttp-3.13.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e7f8659a48995edee7229522984bd1009c1213929c769c2daa80b40fe49a180c", size = 493985, upload-time = "2025-10-28T20:55:29.456Z" }, - { url = "https://files.pythonhosted.org/packages/9d/87/71c8867e0a1d0882dcbc94af767784c3cb381c1c4db0943ab4aae4fed65e/aiohttp-3.13.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:939ced4a7add92296b0ad38892ce62b98c619288a081170695c6babe4f50e636", size = 489274, upload-time = "2025-10-28T20:55:31.134Z" }, - { url = "https://files.pythonhosted.org/packages/38/0f/46c24e8dae237295eaadd113edd56dee96ef6462adf19b88592d44891dc5/aiohttp-3.13.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6315fb6977f1d0dd41a107c527fee2ed5ab0550b7d885bc15fee20ccb17891da", size = 1668171, upload-time = "2025-10-28T20:55:36.065Z" }, - { url = "https://files.pythonhosted.org/packages/eb/c6/4cdfb4440d0e28483681a48f69841fa5e39366347d66ef808cbdadddb20e/aiohttp-3.13.2-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:6e7352512f763f760baaed2637055c49134fd1d35b37c2dedfac35bfe5cf8725", size = 1636036, upload-time = "2025-10-28T20:55:37.576Z" }, - { url = "https://files.pythonhosted.org/packages/84/37/8708cf678628216fb678ab327a4e1711c576d6673998f4f43e86e9ae90dd/aiohttp-3.13.2-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e09a0a06348a2dd73e7213353c90d709502d9786219f69b731f6caa0efeb46f5", size = 1727975, upload-time = "2025-10-28T20:55:39.457Z" }, - { url = "https://files.pythonhosted.org/packages/e6/2e/3ebfe12fdcb9b5f66e8a0a42dffcd7636844c8a018f261efb2419f68220b/aiohttp-3.13.2-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a09a6d073fb5789456545bdee2474d14395792faa0527887f2f4ec1a486a59d3", size = 1815823, upload-time = "2025-10-28T20:55:40.958Z" }, - { url = "https://files.pythonhosted.org/packages/a1/4f/ca2ef819488cbb41844c6cf92ca6dd15b9441e6207c58e5ae0e0fc8d70ad/aiohttp-3.13.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b59d13c443f8e049d9e94099c7e412e34610f1f49be0f230ec656a10692a5802", size = 1669374, upload-time = "2025-10-28T20:55:42.745Z" }, - { url = "https://files.pythonhosted.org/packages/f8/fe/1fe2e1179a0d91ce09c99069684aab619bf2ccde9b20bd6ca44f8837203e/aiohttp-3.13.2-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:20db2d67985d71ca033443a1ba2001c4b5693fe09b0e29f6d9358a99d4d62a8a", size = 1555315, upload-time = "2025-10-28T20:55:44.264Z" }, - { url = "https://files.pythonhosted.org/packages/5a/2b/f3781899b81c45d7cbc7140cddb8a3481c195e7cbff8e36374759d2ab5a5/aiohttp-3.13.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:960c2fc686ba27b535f9fd2b52d87ecd7e4fd1cf877f6a5cba8afb5b4a8bd204", size = 1639140, upload-time = "2025-10-28T20:55:46.626Z" }, - { url = "https://files.pythonhosted.org/packages/72/27/c37e85cd3ece6f6c772e549bd5a253d0c122557b25855fb274224811e4f2/aiohttp-3.13.2-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:6c00dbcf5f0d88796151e264a8eab23de2997c9303dd7c0bf622e23b24d3ce22", size = 1645496, upload-time = "2025-10-28T20:55:48.933Z" }, - { url = "https://files.pythonhosted.org/packages/66/20/3af1ab663151bd3780b123e907761cdb86ec2c4e44b2d9b195ebc91fbe37/aiohttp-3.13.2-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:fed38a5edb7945f4d1bcabe2fcd05db4f6ec7e0e82560088b754f7e08d93772d", size = 1697625, upload-time = "2025-10-28T20:55:50.377Z" }, - { url = "https://files.pythonhosted.org/packages/95/eb/ae5cab15efa365e13d56b31b0d085a62600298bf398a7986f8388f73b598/aiohttp-3.13.2-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:b395bbca716c38bef3c764f187860e88c724b342c26275bc03e906142fc5964f", size = 1542025, upload-time = "2025-10-28T20:55:51.861Z" }, - { url = "https://files.pythonhosted.org/packages/e9/2d/1683e8d67ec72d911397fe4e575688d2a9b8f6a6e03c8fdc9f3fd3d4c03f/aiohttp-3.13.2-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:204ffff2426c25dfda401ba08da85f9c59525cdc42bda26660463dd1cbcfec6f", size = 1714918, upload-time = "2025-10-28T20:55:53.515Z" }, - { url = "https://files.pythonhosted.org/packages/99/a2/ffe8e0e1c57c5e542d47ffa1fcf95ef2b3ea573bf7c4d2ee877252431efc/aiohttp-3.13.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:05c4dd3c48fb5f15db31f57eb35374cb0c09afdde532e7fb70a75aede0ed30f6", size = 1656113, upload-time = "2025-10-28T20:55:55.438Z" }, - { url = "https://files.pythonhosted.org/packages/0d/42/d511aff5c3a2b06c09d7d214f508a4ad8ac7799817f7c3d23e7336b5e896/aiohttp-3.13.2-cp310-cp310-win32.whl", hash = "sha256:e574a7d61cf10351d734bcddabbe15ede0eaa8a02070d85446875dc11189a251", size = 432290, upload-time = "2025-10-28T20:55:56.96Z" }, - { url = "https://files.pythonhosted.org/packages/8b/ea/1c2eb7098b5bad4532994f2b7a8228d27674035c9b3234fe02c37469ef14/aiohttp-3.13.2-cp310-cp310-win_amd64.whl", hash = "sha256:364f55663085d658b8462a1c3f17b2b84a5c2e1ba858e1b79bff7b2e24ad1514", size = 455075, upload-time = "2025-10-28T20:55:58.373Z" }, - { url = "https://files.pythonhosted.org/packages/35/74/b321e7d7ca762638cdf8cdeceb39755d9c745aff7a64c8789be96ddf6e96/aiohttp-3.13.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:4647d02df098f6434bafd7f32ad14942f05a9caa06c7016fdcc816f343997dd0", size = 743409, upload-time = "2025-10-28T20:56:00.354Z" }, - { url = "https://files.pythonhosted.org/packages/99/3d/91524b905ec473beaf35158d17f82ef5a38033e5809fe8742e3657cdbb97/aiohttp-3.13.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e3403f24bcb9c3b29113611c3c16a2a447c3953ecf86b79775e7be06f7ae7ccb", size = 497006, upload-time = "2025-10-28T20:56:01.85Z" }, - { url = "https://files.pythonhosted.org/packages/eb/d3/7f68bc02a67716fe80f063e19adbd80a642e30682ce74071269e17d2dba1/aiohttp-3.13.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:43dff14e35aba17e3d6d5ba628858fb8cb51e30f44724a2d2f0c75be492c55e9", size = 493195, upload-time = "2025-10-28T20:56:03.314Z" }, - { url = "https://files.pythonhosted.org/packages/98/31/913f774a4708775433b7375c4f867d58ba58ead833af96c8af3621a0d243/aiohttp-3.13.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e2a9ea08e8c58bb17655630198833109227dea914cd20be660f52215f6de5613", size = 1747759, upload-time = "2025-10-28T20:56:04.904Z" }, - { url = "https://files.pythonhosted.org/packages/e8/63/04efe156f4326f31c7c4a97144f82132c3bb21859b7bb84748d452ccc17c/aiohttp-3.13.2-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:53b07472f235eb80e826ad038c9d106c2f653584753f3ddab907c83f49eedead", size = 1704456, upload-time = "2025-10-28T20:56:06.986Z" }, - { url = "https://files.pythonhosted.org/packages/8e/02/4e16154d8e0a9cf4ae76f692941fd52543bbb148f02f098ca73cab9b1c1b/aiohttp-3.13.2-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e736c93e9c274fce6419af4aac199984d866e55f8a4cec9114671d0ea9688780", size = 1807572, upload-time = "2025-10-28T20:56:08.558Z" }, - { url = "https://files.pythonhosted.org/packages/34/58/b0583defb38689e7f06798f0285b1ffb3a6fb371f38363ce5fd772112724/aiohttp-3.13.2-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:ff5e771f5dcbc81c64898c597a434f7682f2259e0cd666932a913d53d1341d1a", size = 1895954, upload-time = "2025-10-28T20:56:10.545Z" }, - { url = "https://files.pythonhosted.org/packages/6b/f3/083907ee3437425b4e376aa58b2c915eb1a33703ec0dc30040f7ae3368c6/aiohttp-3.13.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a3b6fb0c207cc661fa0bf8c66d8d9b657331ccc814f4719468af61034b478592", size = 1747092, upload-time = "2025-10-28T20:56:12.118Z" }, - { url = "https://files.pythonhosted.org/packages/ac/61/98a47319b4e425cc134e05e5f3fc512bf9a04bf65aafd9fdcda5d57ec693/aiohttp-3.13.2-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:97a0895a8e840ab3520e2288db7cace3a1981300d48babeb50e7425609e2e0ab", size = 1606815, upload-time = "2025-10-28T20:56:14.191Z" }, - { url = "https://files.pythonhosted.org/packages/97/4b/e78b854d82f66bb974189135d31fce265dee0f5344f64dd0d345158a5973/aiohttp-3.13.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:9e8f8afb552297aca127c90cb840e9a1d4bfd6a10d7d8f2d9176e1acc69bad30", size = 1723789, upload-time = "2025-10-28T20:56:16.101Z" }, - { url = "https://files.pythonhosted.org/packages/ed/fc/9d2ccc794fc9b9acd1379d625c3a8c64a45508b5091c546dea273a41929e/aiohttp-3.13.2-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:ed2f9c7216e53c3df02264f25d824b079cc5914f9e2deba94155190ef648ee40", size = 1718104, upload-time = "2025-10-28T20:56:17.655Z" }, - { url = "https://files.pythonhosted.org/packages/66/65/34564b8765ea5c7d79d23c9113135d1dd3609173da13084830f1507d56cf/aiohttp-3.13.2-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:99c5280a329d5fa18ef30fd10c793a190d996567667908bef8a7f81f8202b948", size = 1785584, upload-time = "2025-10-28T20:56:19.238Z" }, - { url = "https://files.pythonhosted.org/packages/30/be/f6a7a426e02fc82781afd62016417b3948e2207426d90a0e478790d1c8a4/aiohttp-3.13.2-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:2ca6ffef405fc9c09a746cb5d019c1672cd7f402542e379afc66b370833170cf", size = 1595126, upload-time = "2025-10-28T20:56:20.836Z" }, - { url = "https://files.pythonhosted.org/packages/e5/c7/8e22d5d28f94f67d2af496f14a83b3c155d915d1fe53d94b66d425ec5b42/aiohttp-3.13.2-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:47f438b1a28e926c37632bff3c44df7d27c9b57aaf4e34b1def3c07111fdb782", size = 1800665, upload-time = "2025-10-28T20:56:22.922Z" }, - { url = "https://files.pythonhosted.org/packages/d1/11/91133c8b68b1da9fc16555706aa7276fdf781ae2bb0876c838dd86b8116e/aiohttp-3.13.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9acda8604a57bb60544e4646a4615c1866ee6c04a8edef9b8ee6fd1d8fa2ddc8", size = 1739532, upload-time = "2025-10-28T20:56:25.924Z" }, - { url = "https://files.pythonhosted.org/packages/17/6b/3747644d26a998774b21a616016620293ddefa4d63af6286f389aedac844/aiohttp-3.13.2-cp311-cp311-win32.whl", hash = "sha256:868e195e39b24aaa930b063c08bb0c17924899c16c672a28a65afded9c46c6ec", size = 431876, upload-time = "2025-10-28T20:56:27.524Z" }, - { url = "https://files.pythonhosted.org/packages/c3/63/688462108c1a00eb9f05765331c107f95ae86f6b197b865d29e930b7e462/aiohttp-3.13.2-cp311-cp311-win_amd64.whl", hash = "sha256:7fd19df530c292542636c2a9a85854fab93474396a52f1695e799186bbd7f24c", size = 456205, upload-time = "2025-10-28T20:56:29.062Z" }, - { url = "https://files.pythonhosted.org/packages/29/9b/01f00e9856d0a73260e86dd8ed0c2234a466c5c1712ce1c281548df39777/aiohttp-3.13.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:b1e56bab2e12b2b9ed300218c351ee2a3d8c8fdab5b1ec6193e11a817767e47b", size = 737623, upload-time = "2025-10-28T20:56:30.797Z" }, - { url = "https://files.pythonhosted.org/packages/5a/1b/4be39c445e2b2bd0aab4ba736deb649fabf14f6757f405f0c9685019b9e9/aiohttp-3.13.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:364e25edaabd3d37b1db1f0cbcee8c73c9a3727bfa262b83e5e4cf3489a2a9dc", size = 492664, upload-time = "2025-10-28T20:56:32.708Z" }, - { url = "https://files.pythonhosted.org/packages/28/66/d35dcfea8050e131cdd731dff36434390479b4045a8d0b9d7111b0a968f1/aiohttp-3.13.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c5c94825f744694c4b8db20b71dba9a257cd2ba8e010a803042123f3a25d50d7", size = 491808, upload-time = "2025-10-28T20:56:34.57Z" }, - { url = "https://files.pythonhosted.org/packages/00/29/8e4609b93e10a853b65f8291e64985de66d4f5848c5637cddc70e98f01f8/aiohttp-3.13.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ba2715d842ffa787be87cbfce150d5e88c87a98e0b62e0f5aa489169a393dbbb", size = 1738863, upload-time = "2025-10-28T20:56:36.377Z" }, - { url = "https://files.pythonhosted.org/packages/9d/fa/4ebdf4adcc0def75ced1a0d2d227577cd7b1b85beb7edad85fcc87693c75/aiohttp-3.13.2-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:585542825c4bc662221fb257889e011a5aa00f1ae4d75d1d246a5225289183e3", size = 1700586, upload-time = "2025-10-28T20:56:38.034Z" }, - { url = "https://files.pythonhosted.org/packages/da/04/73f5f02ff348a3558763ff6abe99c223381b0bace05cd4530a0258e52597/aiohttp-3.13.2-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:39d02cb6025fe1aabca329c5632f48c9532a3dabccd859e7e2f110668972331f", size = 1768625, upload-time = "2025-10-28T20:56:39.75Z" }, - { url = "https://files.pythonhosted.org/packages/f8/49/a825b79ffec124317265ca7d2344a86bcffeb960743487cb11988ffb3494/aiohttp-3.13.2-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:e67446b19e014d37342f7195f592a2a948141d15a312fe0e700c2fd2f03124f6", size = 1867281, upload-time = "2025-10-28T20:56:41.471Z" }, - { url = "https://files.pythonhosted.org/packages/b9/48/adf56e05f81eac31edcfae45c90928f4ad50ef2e3ea72cb8376162a368f8/aiohttp-3.13.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4356474ad6333e41ccefd39eae869ba15a6c5299c9c01dfdcfdd5c107be4363e", size = 1752431, upload-time = "2025-10-28T20:56:43.162Z" }, - { url = "https://files.pythonhosted.org/packages/30/ab/593855356eead019a74e862f21523db09c27f12fd24af72dbc3555b9bfd9/aiohttp-3.13.2-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:eeacf451c99b4525f700f078becff32c32ec327b10dcf31306a8a52d78166de7", size = 1562846, upload-time = "2025-10-28T20:56:44.85Z" }, - { url = "https://files.pythonhosted.org/packages/39/0f/9f3d32271aa8dc35036e9668e31870a9d3b9542dd6b3e2c8a30931cb27ae/aiohttp-3.13.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:d8a9b889aeabd7a4e9af0b7f4ab5ad94d42e7ff679aaec6d0db21e3b639ad58d", size = 1699606, upload-time = "2025-10-28T20:56:46.519Z" }, - { url = "https://files.pythonhosted.org/packages/2c/3c/52d2658c5699b6ef7692a3f7128b2d2d4d9775f2a68093f74bca06cf01e1/aiohttp-3.13.2-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:fa89cb11bc71a63b69568d5b8a25c3ca25b6d54c15f907ca1c130d72f320b76b", size = 1720663, upload-time = "2025-10-28T20:56:48.528Z" }, - { url = "https://files.pythonhosted.org/packages/9b/d4/8f8f3ff1fb7fb9e3f04fcad4e89d8a1cd8fc7d05de67e3de5b15b33008ff/aiohttp-3.13.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:8aa7c807df234f693fed0ecd507192fc97692e61fee5702cdc11155d2e5cadc8", size = 1737939, upload-time = "2025-10-28T20:56:50.77Z" }, - { url = "https://files.pythonhosted.org/packages/03/d3/ddd348f8a27a634daae39a1b8e291ff19c77867af438af844bf8b7e3231b/aiohttp-3.13.2-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:9eb3e33fdbe43f88c3c75fa608c25e7c47bbd80f48d012763cb67c47f39a7e16", size = 1555132, upload-time = "2025-10-28T20:56:52.568Z" }, - { url = "https://files.pythonhosted.org/packages/39/b8/46790692dc46218406f94374903ba47552f2f9f90dad554eed61bfb7b64c/aiohttp-3.13.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:9434bc0d80076138ea986833156c5a48c9c7a8abb0c96039ddbb4afc93184169", size = 1764802, upload-time = "2025-10-28T20:56:54.292Z" }, - { url = "https://files.pythonhosted.org/packages/ba/e4/19ce547b58ab2a385e5f0b8aa3db38674785085abcf79b6e0edd1632b12f/aiohttp-3.13.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:ff15c147b2ad66da1f2cbb0622313f2242d8e6e8f9b79b5206c84523a4473248", size = 1719512, upload-time = "2025-10-28T20:56:56.428Z" }, - { url = "https://files.pythonhosted.org/packages/70/30/6355a737fed29dcb6dfdd48682d5790cb5eab050f7b4e01f49b121d3acad/aiohttp-3.13.2-cp312-cp312-win32.whl", hash = "sha256:27e569eb9d9e95dbd55c0fc3ec3a9335defbf1d8bc1d20171a49f3c4c607b93e", size = 426690, upload-time = "2025-10-28T20:56:58.736Z" }, - { url = "https://files.pythonhosted.org/packages/0a/0d/b10ac09069973d112de6ef980c1f6bb31cb7dcd0bc363acbdad58f927873/aiohttp-3.13.2-cp312-cp312-win_amd64.whl", hash = "sha256:8709a0f05d59a71f33fd05c17fc11fcb8c30140506e13c2f5e8ee1b8964e1b45", size = 453465, upload-time = "2025-10-28T20:57:00.795Z" }, - { url = "https://files.pythonhosted.org/packages/bf/78/7e90ca79e5aa39f9694dcfd74f4720782d3c6828113bb1f3197f7e7c4a56/aiohttp-3.13.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:7519bdc7dfc1940d201651b52bf5e03f5503bda45ad6eacf64dda98be5b2b6be", size = 732139, upload-time = "2025-10-28T20:57:02.455Z" }, - { url = "https://files.pythonhosted.org/packages/db/ed/1f59215ab6853fbaa5c8495fa6cbc39edfc93553426152b75d82a5f32b76/aiohttp-3.13.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:088912a78b4d4f547a1f19c099d5a506df17eacec3c6f4375e2831ec1d995742", size = 490082, upload-time = "2025-10-28T20:57:04.784Z" }, - { url = "https://files.pythonhosted.org/packages/68/7b/fe0fe0f5e05e13629d893c760465173a15ad0039c0a5b0d0040995c8075e/aiohttp-3.13.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5276807b9de9092af38ed23ce120539ab0ac955547b38563a9ba4f5b07b95293", size = 489035, upload-time = "2025-10-28T20:57:06.894Z" }, - { url = "https://files.pythonhosted.org/packages/d2/04/db5279e38471b7ac801d7d36a57d1230feeee130bbe2a74f72731b23c2b1/aiohttp-3.13.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1237c1375eaef0db4dcd7c2559f42e8af7b87ea7d295b118c60c36a6e61cb811", size = 1720387, upload-time = "2025-10-28T20:57:08.685Z" }, - { url = "https://files.pythonhosted.org/packages/31/07/8ea4326bd7dae2bd59828f69d7fdc6e04523caa55e4a70f4a8725a7e4ed2/aiohttp-3.13.2-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:96581619c57419c3d7d78703d5b78c1e5e5fc0172d60f555bdebaced82ded19a", size = 1688314, upload-time = "2025-10-28T20:57:10.693Z" }, - { url = "https://files.pythonhosted.org/packages/48/ab/3d98007b5b87ffd519d065225438cc3b668b2f245572a8cb53da5dd2b1bc/aiohttp-3.13.2-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a2713a95b47374169409d18103366de1050fe0ea73db358fc7a7acb2880422d4", size = 1756317, upload-time = "2025-10-28T20:57:12.563Z" }, - { url = "https://files.pythonhosted.org/packages/97/3d/801ca172b3d857fafb7b50c7c03f91b72b867a13abca982ed6b3081774ef/aiohttp-3.13.2-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:228a1cd556b3caca590e9511a89444925da87d35219a49ab5da0c36d2d943a6a", size = 1858539, upload-time = "2025-10-28T20:57:14.623Z" }, - { url = "https://files.pythonhosted.org/packages/f7/0d/4764669bdf47bd472899b3d3db91fffbe925c8e3038ec591a2fd2ad6a14d/aiohttp-3.13.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ac6cde5fba8d7d8c6ac963dbb0256a9854e9fafff52fbcc58fdf819357892c3e", size = 1739597, upload-time = "2025-10-28T20:57:16.399Z" }, - { url = "https://files.pythonhosted.org/packages/c4/52/7bd3c6693da58ba16e657eb904a5b6decfc48ecd06e9ac098591653b1566/aiohttp-3.13.2-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f2bef8237544f4e42878c61cef4e2839fee6346dc60f5739f876a9c50be7fcdb", size = 1555006, upload-time = "2025-10-28T20:57:18.288Z" }, - { url = "https://files.pythonhosted.org/packages/48/30/9586667acec5993b6f41d2ebcf96e97a1255a85f62f3c653110a5de4d346/aiohttp-3.13.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:16f15a4eac3bc2d76c45f7ebdd48a65d41b242eb6c31c2245463b40b34584ded", size = 1683220, upload-time = "2025-10-28T20:57:20.241Z" }, - { url = "https://files.pythonhosted.org/packages/71/01/3afe4c96854cfd7b30d78333852e8e851dceaec1c40fd00fec90c6402dd2/aiohttp-3.13.2-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:bb7fb776645af5cc58ab804c58d7eba545a97e047254a52ce89c157b5af6cd0b", size = 1712570, upload-time = "2025-10-28T20:57:22.253Z" }, - { url = "https://files.pythonhosted.org/packages/11/2c/22799d8e720f4697a9e66fd9c02479e40a49de3de2f0bbe7f9f78a987808/aiohttp-3.13.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:e1b4951125ec10c70802f2cb09736c895861cd39fd9dcb35107b4dc8ae6220b8", size = 1733407, upload-time = "2025-10-28T20:57:24.37Z" }, - { url = "https://files.pythonhosted.org/packages/34/cb/90f15dd029f07cebbd91f8238a8b363978b530cd128488085b5703683594/aiohttp-3.13.2-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:550bf765101ae721ee1d37d8095f47b1f220650f85fe1af37a90ce75bab89d04", size = 1550093, upload-time = "2025-10-28T20:57:26.257Z" }, - { url = "https://files.pythonhosted.org/packages/69/46/12dce9be9d3303ecbf4d30ad45a7683dc63d90733c2d9fe512be6716cd40/aiohttp-3.13.2-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:fe91b87fc295973096251e2d25a811388e7d8adf3bd2b97ef6ae78bc4ac6c476", size = 1758084, upload-time = "2025-10-28T20:57:28.349Z" }, - { url = "https://files.pythonhosted.org/packages/f9/c8/0932b558da0c302ffd639fc6362a313b98fdf235dc417bc2493da8394df7/aiohttp-3.13.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e0c8e31cfcc4592cb200160344b2fb6ae0f9e4effe06c644b5a125d4ae5ebe23", size = 1716987, upload-time = "2025-10-28T20:57:30.233Z" }, - { url = "https://files.pythonhosted.org/packages/5d/8b/f5bd1a75003daed099baec373aed678f2e9b34f2ad40d85baa1368556396/aiohttp-3.13.2-cp313-cp313-win32.whl", hash = "sha256:0740f31a60848d6edb296a0df827473eede90c689b8f9f2a4cdde74889eb2254", size = 425859, upload-time = "2025-10-28T20:57:32.105Z" }, - { url = "https://files.pythonhosted.org/packages/5d/28/a8a9fc6957b2cee8902414e41816b5ab5536ecf43c3b1843c10e82c559b2/aiohttp-3.13.2-cp313-cp313-win_amd64.whl", hash = "sha256:a88d13e7ca367394908f8a276b89d04a3652044612b9a408a0bb22a5ed976a1a", size = 452192, upload-time = "2025-10-28T20:57:34.166Z" }, - { url = "https://files.pythonhosted.org/packages/9b/36/e2abae1bd815f01c957cbf7be817b3043304e1c87bad526292a0410fdcf9/aiohttp-3.13.2-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:2475391c29230e063ef53a66669b7b691c9bfc3f1426a0f7bcdf1216bdbac38b", size = 735234, upload-time = "2025-10-28T20:57:36.415Z" }, - { url = "https://files.pythonhosted.org/packages/ca/e3/1ee62dde9b335e4ed41db6bba02613295a0d5b41f74a783c142745a12763/aiohttp-3.13.2-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:f33c8748abef4d8717bb20e8fb1b3e07c6adacb7fd6beaae971a764cf5f30d61", size = 490733, upload-time = "2025-10-28T20:57:38.205Z" }, - { url = "https://files.pythonhosted.org/packages/1a/aa/7a451b1d6a04e8d15a362af3e9b897de71d86feac3babf8894545d08d537/aiohttp-3.13.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:ae32f24bbfb7dbb485a24b30b1149e2f200be94777232aeadba3eecece4d0aa4", size = 491303, upload-time = "2025-10-28T20:57:40.122Z" }, - { url = "https://files.pythonhosted.org/packages/57/1e/209958dbb9b01174870f6a7538cd1f3f28274fdbc88a750c238e2c456295/aiohttp-3.13.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5d7f02042c1f009ffb70067326ef183a047425bb2ff3bc434ead4dd4a4a66a2b", size = 1717965, upload-time = "2025-10-28T20:57:42.28Z" }, - { url = "https://files.pythonhosted.org/packages/08/aa/6a01848d6432f241416bc4866cae8dc03f05a5a884d2311280f6a09c73d6/aiohttp-3.13.2-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:93655083005d71cd6c072cdab54c886e6570ad2c4592139c3fb967bfc19e4694", size = 1667221, upload-time = "2025-10-28T20:57:44.869Z" }, - { url = "https://files.pythonhosted.org/packages/87/4f/36c1992432d31bbc789fa0b93c768d2e9047ec8c7177e5cd84ea85155f36/aiohttp-3.13.2-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:0db1e24b852f5f664cd728db140cf11ea0e82450471232a394b3d1a540b0f906", size = 1757178, upload-time = "2025-10-28T20:57:47.216Z" }, - { url = "https://files.pythonhosted.org/packages/ac/b4/8e940dfb03b7e0f68a82b88fd182b9be0a65cb3f35612fe38c038c3112cf/aiohttp-3.13.2-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b009194665bcd128e23eaddef362e745601afa4641930848af4c8559e88f18f9", size = 1838001, upload-time = "2025-10-28T20:57:49.337Z" }, - { url = "https://files.pythonhosted.org/packages/d7/ef/39f3448795499c440ab66084a9db7d20ca7662e94305f175a80f5b7e0072/aiohttp-3.13.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c038a8fdc8103cd51dbd986ecdce141473ffd9775a7a8057a6ed9c3653478011", size = 1716325, upload-time = "2025-10-28T20:57:51.327Z" }, - { url = "https://files.pythonhosted.org/packages/d7/51/b311500ffc860b181c05d91c59a1313bdd05c82960fdd4035a15740d431e/aiohttp-3.13.2-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:66bac29b95a00db411cd758fea0e4b9bdba6d549dfe333f9a945430f5f2cc5a6", size = 1547978, upload-time = "2025-10-28T20:57:53.554Z" }, - { url = "https://files.pythonhosted.org/packages/31/64/b9d733296ef79815226dab8c586ff9e3df41c6aff2e16c06697b2d2e6775/aiohttp-3.13.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:4ebf9cfc9ba24a74cf0718f04aac2a3bbe745902cc7c5ebc55c0f3b5777ef213", size = 1682042, upload-time = "2025-10-28T20:57:55.617Z" }, - { url = "https://files.pythonhosted.org/packages/3f/30/43d3e0f9d6473a6db7d472104c4eff4417b1e9df01774cb930338806d36b/aiohttp-3.13.2-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:a4b88ebe35ce54205c7074f7302bd08a4cb83256a3e0870c72d6f68a3aaf8e49", size = 1680085, upload-time = "2025-10-28T20:57:57.59Z" }, - { url = "https://files.pythonhosted.org/packages/16/51/c709f352c911b1864cfd1087577760ced64b3e5bee2aa88b8c0c8e2e4972/aiohttp-3.13.2-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:98c4fb90bb82b70a4ed79ca35f656f4281885be076f3f970ce315402b53099ae", size = 1728238, upload-time = "2025-10-28T20:57:59.525Z" }, - { url = "https://files.pythonhosted.org/packages/19/e2/19bd4c547092b773caeb48ff5ae4b1ae86756a0ee76c16727fcfd281404b/aiohttp-3.13.2-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:ec7534e63ae0f3759df3a1ed4fa6bc8f75082a924b590619c0dd2f76d7043caa", size = 1544395, upload-time = "2025-10-28T20:58:01.914Z" }, - { url = "https://files.pythonhosted.org/packages/cf/87/860f2803b27dfc5ed7be532832a3498e4919da61299b4a1f8eb89b8ff44d/aiohttp-3.13.2-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:5b927cf9b935a13e33644cbed6c8c4b2d0f25b713d838743f8fe7191b33829c4", size = 1742965, upload-time = "2025-10-28T20:58:03.972Z" }, - { url = "https://files.pythonhosted.org/packages/67/7f/db2fc7618925e8c7a601094d5cbe539f732df4fb570740be88ed9e40e99a/aiohttp-3.13.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:88d6c017966a78c5265d996c19cdb79235be5e6412268d7e2ce7dee339471b7a", size = 1697585, upload-time = "2025-10-28T20:58:06.189Z" }, - { url = "https://files.pythonhosted.org/packages/0c/07/9127916cb09bb38284db5036036042b7b2c514c8ebaeee79da550c43a6d6/aiohttp-3.13.2-cp314-cp314-win32.whl", hash = "sha256:f7c183e786e299b5d6c49fb43a769f8eb8e04a2726a2bd5887b98b5cc2d67940", size = 431621, upload-time = "2025-10-28T20:58:08.636Z" }, - { url = "https://files.pythonhosted.org/packages/fb/41/554a8a380df6d3a2bba8a7726429a23f4ac62aaf38de43bb6d6cde7b4d4d/aiohttp-3.13.2-cp314-cp314-win_amd64.whl", hash = "sha256:fe242cd381e0fb65758faf5ad96c2e460df6ee5b2de1072fe97e4127927e00b4", size = 457627, upload-time = "2025-10-28T20:58:11Z" }, - { url = "https://files.pythonhosted.org/packages/c7/8e/3824ef98c039d3951cb65b9205a96dd2b20f22241ee17d89c5701557c826/aiohttp-3.13.2-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:f10d9c0b0188fe85398c61147bbd2a657d616c876863bfeff43376e0e3134673", size = 767360, upload-time = "2025-10-28T20:58:13.358Z" }, - { url = "https://files.pythonhosted.org/packages/a4/0f/6a03e3fc7595421274fa34122c973bde2d89344f8a881b728fa8c774e4f1/aiohttp-3.13.2-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:e7c952aefdf2460f4ae55c5e9c3e80aa72f706a6317e06020f80e96253b1accd", size = 504616, upload-time = "2025-10-28T20:58:15.339Z" }, - { url = "https://files.pythonhosted.org/packages/c6/aa/ed341b670f1bc8a6f2c6a718353d13b9546e2cef3544f573c6a1ff0da711/aiohttp-3.13.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c20423ce14771d98353d2e25e83591fa75dfa90a3c1848f3d7c68243b4fbded3", size = 509131, upload-time = "2025-10-28T20:58:17.693Z" }, - { url = "https://files.pythonhosted.org/packages/7f/f0/c68dac234189dae5c4bbccc0f96ce0cc16b76632cfc3a08fff180045cfa4/aiohttp-3.13.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e96eb1a34396e9430c19d8338d2ec33015e4a87ef2b4449db94c22412e25ccdf", size = 1864168, upload-time = "2025-10-28T20:58:20.113Z" }, - { url = "https://files.pythonhosted.org/packages/8f/65/75a9a76db8364b5d0e52a0c20eabc5d52297385d9af9c35335b924fafdee/aiohttp-3.13.2-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:23fb0783bc1a33640036465019d3bba069942616a6a2353c6907d7fe1ccdaf4e", size = 1719200, upload-time = "2025-10-28T20:58:22.583Z" }, - { url = "https://files.pythonhosted.org/packages/f5/55/8df2ed78d7f41d232f6bd3ff866b6f617026551aa1d07e2f03458f964575/aiohttp-3.13.2-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:2e1a9bea6244a1d05a4e57c295d69e159a5c50d8ef16aa390948ee873478d9a5", size = 1843497, upload-time = "2025-10-28T20:58:24.672Z" }, - { url = "https://files.pythonhosted.org/packages/e9/e0/94d7215e405c5a02ccb6a35c7a3a6cfff242f457a00196496935f700cde5/aiohttp-3.13.2-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:0a3d54e822688b56e9f6b5816fb3de3a3a64660efac64e4c2dc435230ad23bad", size = 1935703, upload-time = "2025-10-28T20:58:26.758Z" }, - { url = "https://files.pythonhosted.org/packages/0b/78/1eeb63c3f9b2d1015a4c02788fb543141aad0a03ae3f7a7b669b2483f8d4/aiohttp-3.13.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7a653d872afe9f33497215745da7a943d1dc15b728a9c8da1c3ac423af35178e", size = 1792738, upload-time = "2025-10-28T20:58:29.787Z" }, - { url = "https://files.pythonhosted.org/packages/41/75/aaf1eea4c188e51538c04cc568040e3082db263a57086ea74a7d38c39e42/aiohttp-3.13.2-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:56d36e80d2003fa3fc0207fac644216d8532e9504a785ef9a8fd013f84a42c61", size = 1624061, upload-time = "2025-10-28T20:58:32.529Z" }, - { url = "https://files.pythonhosted.org/packages/9b/c2/3b6034de81fbcc43de8aeb209073a2286dfb50b86e927b4efd81cf848197/aiohttp-3.13.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:78cd586d8331fb8e241c2dd6b2f4061778cc69e150514b39a9e28dd050475661", size = 1789201, upload-time = "2025-10-28T20:58:34.618Z" }, - { url = "https://files.pythonhosted.org/packages/c9/38/c15dcf6d4d890217dae79d7213988f4e5fe6183d43893a9cf2fe9e84ca8d/aiohttp-3.13.2-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:20b10bbfbff766294fe99987f7bb3b74fdd2f1a2905f2562132641ad434dcf98", size = 1776868, upload-time = "2025-10-28T20:58:38.835Z" }, - { url = "https://files.pythonhosted.org/packages/04/75/f74fd178ac81adf4f283a74847807ade5150e48feda6aef024403716c30c/aiohttp-3.13.2-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:9ec49dff7e2b3c85cdeaa412e9d438f0ecd71676fde61ec57027dd392f00c693", size = 1790660, upload-time = "2025-10-28T20:58:41.507Z" }, - { url = "https://files.pythonhosted.org/packages/e7/80/7368bd0d06b16b3aba358c16b919e9c46cf11587dc572091031b0e9e3ef0/aiohttp-3.13.2-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:94f05348c4406450f9d73d38efb41d669ad6cd90c7ee194810d0eefbfa875a7a", size = 1617548, upload-time = "2025-10-28T20:58:43.674Z" }, - { url = "https://files.pythonhosted.org/packages/7d/4b/a6212790c50483cb3212e507378fbe26b5086d73941e1ec4b56a30439688/aiohttp-3.13.2-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:fa4dcb605c6f82a80c7f95713c2b11c3b8e9893b3ebd2bc9bde93165ed6107be", size = 1817240, upload-time = "2025-10-28T20:58:45.787Z" }, - { url = "https://files.pythonhosted.org/packages/ff/f7/ba5f0ba4ea8d8f3c32850912944532b933acbf0f3a75546b89269b9b7dde/aiohttp-3.13.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:cf00e5db968c3f67eccd2778574cf64d8b27d95b237770aa32400bd7a1ca4f6c", size = 1762334, upload-time = "2025-10-28T20:58:47.936Z" }, - { url = "https://files.pythonhosted.org/packages/7e/83/1a5a1856574588b1cad63609ea9ad75b32a8353ac995d830bf5da9357364/aiohttp-3.13.2-cp314-cp314t-win32.whl", hash = "sha256:d23b5fe492b0805a50d3371e8a728a9134d8de5447dce4c885f5587294750734", size = 464685, upload-time = "2025-10-28T20:58:50.642Z" }, - { url = "https://files.pythonhosted.org/packages/9f/4d/d22668674122c08f4d56972297c51a624e64b3ed1efaa40187607a7cb66e/aiohttp-3.13.2-cp314-cp314t-win_amd64.whl", hash = "sha256:ff0a7b0a82a7ab905cbda74006318d1b12e37c797eb1b0d4eb3e316cf47f658f", size = 498093, upload-time = "2025-10-28T20:58:52.782Z" }, - { url = "https://files.pythonhosted.org/packages/04/4a/3da532fdf51b5e58fffa1a86d6569184cb1bf4bf81cd4434b6541a8d14fd/aiohttp-3.13.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:7fbdf5ad6084f1940ce88933de34b62358d0f4a0b6ec097362dcd3e5a65a4989", size = 739009, upload-time = "2025-10-28T20:58:55.682Z" }, - { url = "https://files.pythonhosted.org/packages/89/74/fefa6f7939cdc1d77e5cad712004e675a8847dccc589dcc3abca7feaed73/aiohttp-3.13.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7c3a50345635a02db61792c85bb86daffac05330f6473d524f1a4e3ef9d0046d", size = 495308, upload-time = "2025-10-28T20:58:58.408Z" }, - { url = "https://files.pythonhosted.org/packages/4e/b4/a0638ae1f12d09a0dc558870968a2f19a1eba1b10ad0a85ef142ddb40b50/aiohttp-3.13.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0e87dff73f46e969af38ab3f7cb75316a7c944e2e574ff7c933bc01b10def7f5", size = 490624, upload-time = "2025-10-28T20:59:00.479Z" }, - { url = "https://files.pythonhosted.org/packages/02/73/361cd4cac9d98a5a4183d1f26faf7b777330f8dba838c5aae2412862bdd0/aiohttp-3.13.2-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2adebd4577724dcae085665f294cc57c8701ddd4d26140504db622b8d566d7aa", size = 1662968, upload-time = "2025-10-28T20:59:03.105Z" }, - { url = "https://files.pythonhosted.org/packages/9e/93/ce2ca7584555a6c7dd78f2e6b539a96c5172d88815e13a05a576e14a5a22/aiohttp-3.13.2-cp39-cp39-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e036a3a645fe92309ec34b918394bb377950cbb43039a97edae6c08db64b23e2", size = 1627117, upload-time = "2025-10-28T20:59:05.274Z" }, - { url = "https://files.pythonhosted.org/packages/a6/42/7ee0e699111f5fc20a69b3203e8f5d5da0b681f270b90bc088d15e339980/aiohttp-3.13.2-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:23ad365e30108c422d0b4428cf271156dd56790f6dd50d770b8e360e6c5ab2e6", size = 1724037, upload-time = "2025-10-28T20:59:07.522Z" }, - { url = "https://files.pythonhosted.org/packages/66/88/67ad5ff11dd61dd1d7882cda39f085d5fca31cf7e2143f5173429d8a591e/aiohttp-3.13.2-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:1f9b2c2d4b9d958b1f9ae0c984ec1dd6b6689e15c75045be8ccb4011426268ca", size = 1812899, upload-time = "2025-10-28T20:59:11.698Z" }, - { url = "https://files.pythonhosted.org/packages/60/1b/a46f6e1c2a347b9c7a789292279c159b327fadecbf8340f3b05fffff1151/aiohttp-3.13.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3a92cf4b9bea33e15ecbaa5c59921be0f23222608143d025c989924f7e3e0c07", size = 1660961, upload-time = "2025-10-28T20:59:14.425Z" }, - { url = "https://files.pythonhosted.org/packages/44/cc/1af9e466eafd9b5d8922238c69aaf95b656137add4c5db65f63ee129bf3c/aiohttp-3.13.2-cp39-cp39-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:070599407f4954021509193404c4ac53153525a19531051661440644728ba9a7", size = 1553851, upload-time = "2025-10-28T20:59:17.044Z" }, - { url = "https://files.pythonhosted.org/packages/e5/d1/9e5f4f40f9d0ee5668e9b5e7ebfb0eaf371cc09da03785decdc5da56f4b3/aiohttp-3.13.2-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:29562998ec66f988d49fb83c9b01694fa927186b781463f376c5845c121e4e0b", size = 1634260, upload-time = "2025-10-28T20:59:19.378Z" }, - { url = "https://files.pythonhosted.org/packages/83/2e/5d065091c4ae8b55a153f458f19308191bad3b62a89496aa081385486338/aiohttp-3.13.2-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:4dd3db9d0f4ebca1d887d76f7cdbcd1116ac0d05a9221b9dad82c64a62578c4d", size = 1639499, upload-time = "2025-10-28T20:59:22.013Z" }, - { url = "https://files.pythonhosted.org/packages/a3/de/58ae6dc73691a51ff16f69a94d13657bf417456fa0fdfed2b59dd6b4c293/aiohttp-3.13.2-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:d7bc4b7f9c4921eba72677cd9fedd2308f4a4ca3e12fab58935295ad9ea98700", size = 1694087, upload-time = "2025-10-28T20:59:24.773Z" }, - { url = "https://files.pythonhosted.org/packages/45/fe/4d9df516268867d83041b6c073ee15cd532dbea58b82d675a7e1cf2ec24c/aiohttp-3.13.2-cp39-cp39-musllinux_1_2_riscv64.whl", hash = "sha256:dacd50501cd017f8cccb328da0c90823511d70d24a323196826d923aad865901", size = 1540532, upload-time = "2025-10-28T20:59:27.982Z" }, - { url = "https://files.pythonhosted.org/packages/24/e7/a802619308232499482bf30b3530efb5d141481cfd61850368350fb1acb5/aiohttp-3.13.2-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:8b2f1414f6a1e0683f212ec80e813f4abef94c739fd090b66c9adf9d2a05feac", size = 1710369, upload-time = "2025-10-28T20:59:30.363Z" }, - { url = "https://files.pythonhosted.org/packages/62/08/e8593f39f025efe96ef59550d17cf097222d84f6f84798bedac5bf037fce/aiohttp-3.13.2-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:04c3971421576ed24c191f610052bcb2f059e395bc2489dd99e397f9bc466329", size = 1649296, upload-time = "2025-10-28T20:59:33.285Z" }, - { url = "https://files.pythonhosted.org/packages/e5/fd/ffbc1b6aa46fc6c284af4a438b2c7eab79af1c8ac4b6d2ced185c17f403e/aiohttp-3.13.2-cp39-cp39-win32.whl", hash = "sha256:9f377d0a924e5cc94dc620bc6366fc3e889586a7f18b748901cf016c916e2084", size = 432980, upload-time = "2025-10-28T20:59:35.515Z" }, - { url = "https://files.pythonhosted.org/packages/ad/a9/d47e7873175a4d8aed425f2cdea2df700b2dd44fac024ffbd83455a69a50/aiohttp-3.13.2-cp39-cp39-win_amd64.whl", hash = "sha256:9c705601e16c03466cb72011bd1af55d68fa65b045356d8f96c216e5f6db0fa5", size = 456021, upload-time = "2025-10-28T20:59:37.659Z" }, + { url = "https://files.pythonhosted.org/packages/36/d6/5aec9313ee6ea9c7cde8b891b69f4ff4001416867104580670a31daeba5b/aiohttp-3.13.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d5a372fd5afd301b3a89582817fdcdb6c34124787c70dbcc616f259013e7eef7", size = 738950, upload-time = "2026-01-03T17:29:13.002Z" }, + { url = "https://files.pythonhosted.org/packages/68/03/8fa90a7e6d11ff20a18837a8e2b5dd23db01aabc475aa9271c8ad33299f5/aiohttp-3.13.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:147e422fd1223005c22b4fe080f5d93ced44460f5f9c105406b753612b587821", size = 496099, upload-time = "2026-01-03T17:29:15.268Z" }, + { url = "https://files.pythonhosted.org/packages/d2/23/b81f744d402510a8366b74eb420fc0cc1170d0c43daca12d10814df85f10/aiohttp-3.13.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:859bd3f2156e81dd01432f5849fc73e2243d4a487c4fd26609b1299534ee1845", size = 491072, upload-time = "2026-01-03T17:29:16.922Z" }, + { url = "https://files.pythonhosted.org/packages/d5/e1/56d1d1c0dd334cd203dd97706ce004c1aa24b34a813b0b8daf3383039706/aiohttp-3.13.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:dca68018bf48c251ba17c72ed479f4dafe9dbd5a73707ad8d28a38d11f3d42af", size = 1671588, upload-time = "2026-01-03T17:29:18.539Z" }, + { url = "https://files.pythonhosted.org/packages/5f/34/8d7f962604f4bc2b4e39eb1220dac7d4e4cba91fb9ba0474b4ecd67db165/aiohttp-3.13.3-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:fee0c6bc7db1de362252affec009707a17478a00ec69f797d23ca256e36d5940", size = 1640334, upload-time = "2026-01-03T17:29:21.028Z" }, + { url = "https://files.pythonhosted.org/packages/94/1d/fcccf2c668d87337ddeef9881537baee13c58d8f01f12ba8a24215f2b804/aiohttp-3.13.3-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c048058117fd649334d81b4b526e94bde3ccaddb20463a815ced6ecbb7d11160", size = 1722656, upload-time = "2026-01-03T17:29:22.531Z" }, + { url = "https://files.pythonhosted.org/packages/aa/98/c6f3b081c4c606bc1e5f2ec102e87d6411c73a9ef3616fea6f2d5c98c062/aiohttp-3.13.3-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:215a685b6fbbfcf71dfe96e3eba7a6f58f10da1dfdf4889c7dd856abe430dca7", size = 1817625, upload-time = "2026-01-03T17:29:24.276Z" }, + { url = "https://files.pythonhosted.org/packages/2c/c0/cfcc3d2e11b477f86e1af2863f3858c8850d751ce8dc39c4058a072c9e54/aiohttp-3.13.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de2c184bb1fe2cbd2cefba613e9db29a5ab559323f994b6737e370d3da0ac455", size = 1672604, upload-time = "2026-01-03T17:29:26.099Z" }, + { url = "https://files.pythonhosted.org/packages/1e/77/6b4ffcbcac4c6a5d041343a756f34a6dd26174ae07f977a64fe028dda5b0/aiohttp-3.13.3-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:75ca857eba4e20ce9f546cd59c7007b33906a4cd48f2ff6ccf1ccfc3b646f279", size = 1554370, upload-time = "2026-01-03T17:29:28.121Z" }, + { url = "https://files.pythonhosted.org/packages/f2/f0/e3ddfa93f17d689dbe014ba048f18e0c9f9b456033b70e94349a2e9048be/aiohttp-3.13.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:81e97251d9298386c2b7dbeb490d3d1badbdc69107fb8c9299dd04eb39bddc0e", size = 1642023, upload-time = "2026-01-03T17:29:30.002Z" }, + { url = "https://files.pythonhosted.org/packages/eb/45/c14019c9ec60a8e243d06d601b33dcc4fd92379424bde3021725859d7f99/aiohttp-3.13.3-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:c0e2d366af265797506f0283487223146af57815b388623f0357ef7eac9b209d", size = 1649680, upload-time = "2026-01-03T17:29:31.782Z" }, + { url = "https://files.pythonhosted.org/packages/9c/fd/09c9451dae5aa5c5ed756df95ff9ef549d45d4be663bafd1e4954fd836f0/aiohttp-3.13.3-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:4e239d501f73d6db1522599e14b9b321a7e3b1de66ce33d53a765d975e9f4808", size = 1692407, upload-time = "2026-01-03T17:29:33.392Z" }, + { url = "https://files.pythonhosted.org/packages/a6/81/938bc2ec33c10efd6637ccb3d22f9f3160d08e8f3aa2587a2c2d5ab578eb/aiohttp-3.13.3-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:0db318f7a6f065d84cb1e02662c526294450b314a02bd9e2a8e67f0d8564ce40", size = 1543047, upload-time = "2026-01-03T17:29:34.855Z" }, + { url = "https://files.pythonhosted.org/packages/f7/23/80488ee21c8d567c83045e412e1d9b7077d27171591a4eb7822586e8c06a/aiohttp-3.13.3-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:bfc1cc2fe31a6026a8a88e4ecfb98d7f6b1fec150cfd708adbfd1d2f42257c29", size = 1715264, upload-time = "2026-01-03T17:29:36.389Z" }, + { url = "https://files.pythonhosted.org/packages/e2/83/259a8da6683182768200b368120ab3deff5370bed93880fb9a3a86299f34/aiohttp-3.13.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:af71fff7bac6bb7508956696dce8f6eec2bbb045eceb40343944b1ae62b5ef11", size = 1657275, upload-time = "2026-01-03T17:29:38.162Z" }, + { url = "https://files.pythonhosted.org/packages/3f/4f/2c41f800a0b560785c10fb316216ac058c105f9be50bdc6a285de88db625/aiohttp-3.13.3-cp310-cp310-win32.whl", hash = "sha256:37da61e244d1749798c151421602884db5270faf479cf0ef03af0ff68954c9dd", size = 434053, upload-time = "2026-01-03T17:29:40.074Z" }, + { url = "https://files.pythonhosted.org/packages/80/df/29cd63c7ecfdb65ccc12f7d808cac4fa2a19544660c06c61a4a48462de0c/aiohttp-3.13.3-cp310-cp310-win_amd64.whl", hash = "sha256:7e63f210bc1b57ef699035f2b4b6d9ce096b5914414a49b0997c839b2bd2223c", size = 456687, upload-time = "2026-01-03T17:29:41.819Z" }, + { url = "https://files.pythonhosted.org/packages/f1/4c/a164164834f03924d9a29dc3acd9e7ee58f95857e0b467f6d04298594ebb/aiohttp-3.13.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:5b6073099fb654e0a068ae678b10feff95c5cae95bbfcbfa7af669d361a8aa6b", size = 746051, upload-time = "2026-01-03T17:29:43.287Z" }, + { url = "https://files.pythonhosted.org/packages/82/71/d5c31390d18d4f58115037c432b7e0348c60f6f53b727cad33172144a112/aiohttp-3.13.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1cb93e166e6c28716c8c6aeb5f99dfb6d5ccf482d29fe9bf9a794110e6d0ab64", size = 499234, upload-time = "2026-01-03T17:29:44.822Z" }, + { url = "https://files.pythonhosted.org/packages/0e/c9/741f8ac91e14b1d2e7100690425a5b2b919a87a5075406582991fb7de920/aiohttp-3.13.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:28e027cf2f6b641693a09f631759b4d9ce9165099d2b5d92af9bd4e197690eea", size = 494979, upload-time = "2026-01-03T17:29:46.405Z" }, + { url = "https://files.pythonhosted.org/packages/75/b5/31d4d2e802dfd59f74ed47eba48869c1c21552c586d5e81a9d0d5c2ad640/aiohttp-3.13.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3b61b7169ababd7802f9568ed96142616a9118dd2be0d1866e920e77ec8fa92a", size = 1748297, upload-time = "2026-01-03T17:29:48.083Z" }, + { url = "https://files.pythonhosted.org/packages/1a/3e/eefad0ad42959f226bb79664826883f2687d602a9ae2941a18e0484a74d3/aiohttp-3.13.3-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:80dd4c21b0f6237676449c6baaa1039abae86b91636b6c91a7f8e61c87f89540", size = 1707172, upload-time = "2026-01-03T17:29:49.648Z" }, + { url = "https://files.pythonhosted.org/packages/c5/3a/54a64299fac2891c346cdcf2aa6803f994a2e4beeaf2e5a09dcc54acc842/aiohttp-3.13.3-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:65d2ccb7eabee90ce0503c17716fc77226be026dcc3e65cce859a30db715025b", size = 1805405, upload-time = "2026-01-03T17:29:51.244Z" }, + { url = "https://files.pythonhosted.org/packages/6c/70/ddc1b7169cf64075e864f64595a14b147a895a868394a48f6a8031979038/aiohttp-3.13.3-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5b179331a481cb5529fca8b432d8d3c7001cb217513c94cd72d668d1248688a3", size = 1899449, upload-time = "2026-01-03T17:29:53.938Z" }, + { url = "https://files.pythonhosted.org/packages/a1/7e/6815aab7d3a56610891c76ef79095677b8b5be6646aaf00f69b221765021/aiohttp-3.13.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9d4c940f02f49483b18b079d1c27ab948721852b281f8b015c058100e9421dd1", size = 1748444, upload-time = "2026-01-03T17:29:55.484Z" }, + { url = "https://files.pythonhosted.org/packages/6b/f2/073b145c4100da5511f457dc0f7558e99b2987cf72600d42b559db856fbc/aiohttp-3.13.3-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f9444f105664c4ce47a2a7171a2418bce5b7bae45fb610f4e2c36045d85911d3", size = 1606038, upload-time = "2026-01-03T17:29:57.179Z" }, + { url = "https://files.pythonhosted.org/packages/0a/c1/778d011920cae03ae01424ec202c513dc69243cf2db303965615b81deeea/aiohttp-3.13.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:694976222c711d1d00ba131904beb60534f93966562f64440d0c9d41b8cdb440", size = 1724156, upload-time = "2026-01-03T17:29:58.914Z" }, + { url = "https://files.pythonhosted.org/packages/0e/cb/3419eabf4ec1e9ec6f242c32b689248365a1cf621891f6f0386632525494/aiohttp-3.13.3-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:f33ed1a2bf1997a36661874b017f5c4b760f41266341af36febaf271d179f6d7", size = 1722340, upload-time = "2026-01-03T17:30:01.962Z" }, + { url = "https://files.pythonhosted.org/packages/7a/e5/76cf77bdbc435bf233c1f114edad39ed4177ccbfab7c329482b179cff4f4/aiohttp-3.13.3-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:e636b3c5f61da31a92bf0d91da83e58fdfa96f178ba682f11d24f31944cdd28c", size = 1783041, upload-time = "2026-01-03T17:30:03.609Z" }, + { url = "https://files.pythonhosted.org/packages/9d/d4/dd1ca234c794fd29c057ce8c0566b8ef7fd6a51069de5f06fa84b9a1971c/aiohttp-3.13.3-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:5d2d94f1f5fcbe40838ac51a6ab5704a6f9ea42e72ceda48de5e6b898521da51", size = 1596024, upload-time = "2026-01-03T17:30:05.132Z" }, + { url = "https://files.pythonhosted.org/packages/55/58/4345b5f26661a6180afa686c473620c30a66afdf120ed3dd545bbc809e85/aiohttp-3.13.3-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:2be0e9ccf23e8a94f6f0650ce06042cefc6ac703d0d7ab6c7a917289f2539ad4", size = 1804590, upload-time = "2026-01-03T17:30:07.135Z" }, + { url = "https://files.pythonhosted.org/packages/7b/06/05950619af6c2df7e0a431d889ba2813c9f0129cec76f663e547a5ad56f2/aiohttp-3.13.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9af5e68ee47d6534d36791bbe9b646d2a7c7deb6fc24d7943628edfbb3581f29", size = 1740355, upload-time = "2026-01-03T17:30:09.083Z" }, + { url = "https://files.pythonhosted.org/packages/3e/80/958f16de79ba0422d7c1e284b2abd0c84bc03394fbe631d0a39ffa10e1eb/aiohttp-3.13.3-cp311-cp311-win32.whl", hash = "sha256:a2212ad43c0833a873d0fb3c63fa1bacedd4cf6af2fee62bf4b739ceec3ab239", size = 433701, upload-time = "2026-01-03T17:30:10.869Z" }, + { url = "https://files.pythonhosted.org/packages/dc/f2/27cdf04c9851712d6c1b99df6821a6623c3c9e55956d4b1e318c337b5a48/aiohttp-3.13.3-cp311-cp311-win_amd64.whl", hash = "sha256:642f752c3eb117b105acbd87e2c143de710987e09860d674e068c4c2c441034f", size = 457678, upload-time = "2026-01-03T17:30:12.719Z" }, + { url = "https://files.pythonhosted.org/packages/a0/be/4fc11f202955a69e0db803a12a062b8379c970c7c84f4882b6da17337cc1/aiohttp-3.13.3-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:b903a4dfee7d347e2d87697d0713be59e0b87925be030c9178c5faa58ea58d5c", size = 739732, upload-time = "2026-01-03T17:30:14.23Z" }, + { url = "https://files.pythonhosted.org/packages/97/2c/621d5b851f94fa0bb7430d6089b3aa970a9d9b75196bc93bb624b0db237a/aiohttp-3.13.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:a45530014d7a1e09f4a55f4f43097ba0fd155089372e105e4bff4ca76cb1b168", size = 494293, upload-time = "2026-01-03T17:30:15.96Z" }, + { url = "https://files.pythonhosted.org/packages/5d/43/4be01406b78e1be8320bb8316dc9c42dbab553d281c40364e0f862d5661c/aiohttp-3.13.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:27234ef6d85c914f9efeb77ff616dbf4ad2380be0cda40b4db086ffc7ddd1b7d", size = 493533, upload-time = "2026-01-03T17:30:17.431Z" }, + { url = "https://files.pythonhosted.org/packages/8d/a8/5a35dc56a06a2c90d4742cbf35294396907027f80eea696637945a106f25/aiohttp-3.13.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d32764c6c9aafb7fb55366a224756387cd50bfa720f32b88e0e6fa45b27dcf29", size = 1737839, upload-time = "2026-01-03T17:30:19.422Z" }, + { url = "https://files.pythonhosted.org/packages/bf/62/4b9eeb331da56530bf2e198a297e5303e1c1ebdceeb00fe9b568a65c5a0c/aiohttp-3.13.3-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:b1a6102b4d3ebc07dad44fbf07b45bb600300f15b552ddf1851b5390202ea2e3", size = 1703932, upload-time = "2026-01-03T17:30:21.756Z" }, + { url = "https://files.pythonhosted.org/packages/7c/f6/af16887b5d419e6a367095994c0b1332d154f647e7dc2bd50e61876e8e3d/aiohttp-3.13.3-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c014c7ea7fb775dd015b2d3137378b7be0249a448a1612268b5a90c2d81de04d", size = 1771906, upload-time = "2026-01-03T17:30:23.932Z" }, + { url = "https://files.pythonhosted.org/packages/ce/83/397c634b1bcc24292fa1e0c7822800f9f6569e32934bdeef09dae7992dfb/aiohttp-3.13.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2b8d8ddba8f95ba17582226f80e2de99c7a7948e66490ef8d947e272a93e9463", size = 1871020, upload-time = "2026-01-03T17:30:26Z" }, + { url = "https://files.pythonhosted.org/packages/86/f6/a62cbbf13f0ac80a70f71b1672feba90fdb21fd7abd8dbf25c0105fb6fa3/aiohttp-3.13.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9ae8dd55c8e6c4257eae3a20fd2c8f41edaea5992ed67156642493b8daf3cecc", size = 1755181, upload-time = "2026-01-03T17:30:27.554Z" }, + { url = "https://files.pythonhosted.org/packages/0a/87/20a35ad487efdd3fba93d5843efdfaa62d2f1479eaafa7453398a44faf13/aiohttp-3.13.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:01ad2529d4b5035578f5081606a465f3b814c542882804e2e8cda61adf5c71bf", size = 1561794, upload-time = "2026-01-03T17:30:29.254Z" }, + { url = "https://files.pythonhosted.org/packages/de/95/8fd69a66682012f6716e1bc09ef8a1a2a91922c5725cb904689f112309c4/aiohttp-3.13.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:bb4f7475e359992b580559e008c598091c45b5088f28614e855e42d39c2f1033", size = 1697900, upload-time = "2026-01-03T17:30:31.033Z" }, + { url = "https://files.pythonhosted.org/packages/e5/66/7b94b3b5ba70e955ff597672dad1691333080e37f50280178967aff68657/aiohttp-3.13.3-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:c19b90316ad3b24c69cd78d5c9b4f3aa4497643685901185b65166293d36a00f", size = 1728239, upload-time = "2026-01-03T17:30:32.703Z" }, + { url = "https://files.pythonhosted.org/packages/47/71/6f72f77f9f7d74719692ab65a2a0252584bf8d5f301e2ecb4c0da734530a/aiohttp-3.13.3-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:96d604498a7c782cb15a51c406acaea70d8c027ee6b90c569baa6e7b93073679", size = 1740527, upload-time = "2026-01-03T17:30:34.695Z" }, + { url = "https://files.pythonhosted.org/packages/fa/b4/75ec16cbbd5c01bdaf4a05b19e103e78d7ce1ef7c80867eb0ace42ff4488/aiohttp-3.13.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:084911a532763e9d3dd95adf78a78f4096cd5f58cdc18e6fdbc1b58417a45423", size = 1554489, upload-time = "2026-01-03T17:30:36.864Z" }, + { url = "https://files.pythonhosted.org/packages/52/8f/bc518c0eea29f8406dcf7ed1f96c9b48e3bc3995a96159b3fc11f9e08321/aiohttp-3.13.3-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:7a4a94eb787e606d0a09404b9c38c113d3b099d508021faa615d70a0131907ce", size = 1767852, upload-time = "2026-01-03T17:30:39.433Z" }, + { url = "https://files.pythonhosted.org/packages/9d/f2/a07a75173124f31f11ea6f863dc44e6f09afe2bca45dd4e64979490deab1/aiohttp-3.13.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:87797e645d9d8e222e04160ee32aa06bc5c163e8499f24db719e7852ec23093a", size = 1722379, upload-time = "2026-01-03T17:30:41.081Z" }, + { url = "https://files.pythonhosted.org/packages/3c/4a/1a3fee7c21350cac78e5c5cef711bac1b94feca07399f3d406972e2d8fcd/aiohttp-3.13.3-cp312-cp312-win32.whl", hash = "sha256:b04be762396457bef43f3597c991e192ee7da460a4953d7e647ee4b1c28e7046", size = 428253, upload-time = "2026-01-03T17:30:42.644Z" }, + { url = "https://files.pythonhosted.org/packages/d9/b7/76175c7cb4eb73d91ad63c34e29fc4f77c9386bba4a65b53ba8e05ee3c39/aiohttp-3.13.3-cp312-cp312-win_amd64.whl", hash = "sha256:e3531d63d3bdfa7e3ac5e9b27b2dd7ec9df3206a98e0b3445fa906f233264c57", size = 455407, upload-time = "2026-01-03T17:30:44.195Z" }, + { url = "https://files.pythonhosted.org/packages/97/8a/12ca489246ca1faaf5432844adbfce7ff2cc4997733e0af120869345643a/aiohttp-3.13.3-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:5dff64413671b0d3e7d5918ea490bdccb97a4ad29b3f311ed423200b2203e01c", size = 734190, upload-time = "2026-01-03T17:30:45.832Z" }, + { url = "https://files.pythonhosted.org/packages/32/08/de43984c74ed1fca5c014808963cc83cb00d7bb06af228f132d33862ca76/aiohttp-3.13.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:87b9aab6d6ed88235aa2970294f496ff1a1f9adcd724d800e9b952395a80ffd9", size = 491783, upload-time = "2026-01-03T17:30:47.466Z" }, + { url = "https://files.pythonhosted.org/packages/17/f8/8dd2cf6112a5a76f81f81a5130c57ca829d101ad583ce57f889179accdda/aiohttp-3.13.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:425c126c0dc43861e22cb1c14ba4c8e45d09516d0a3ae0a3f7494b79f5f233a3", size = 490704, upload-time = "2026-01-03T17:30:49.373Z" }, + { url = "https://files.pythonhosted.org/packages/6d/40/a46b03ca03936f832bc7eaa47cfbb1ad012ba1be4790122ee4f4f8cba074/aiohttp-3.13.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7f9120f7093c2a32d9647abcaf21e6ad275b4fbec5b55969f978b1a97c7c86bf", size = 1720652, upload-time = "2026-01-03T17:30:50.974Z" }, + { url = "https://files.pythonhosted.org/packages/f7/7e/917fe18e3607af92657e4285498f500dca797ff8c918bd7d90b05abf6c2a/aiohttp-3.13.3-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:697753042d57f4bf7122cab985bf15d0cef23c770864580f5af4f52023a56bd6", size = 1692014, upload-time = "2026-01-03T17:30:52.729Z" }, + { url = "https://files.pythonhosted.org/packages/71/b6/cefa4cbc00d315d68973b671cf105b21a609c12b82d52e5d0c9ae61d2a09/aiohttp-3.13.3-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:6de499a1a44e7de70735d0b39f67c8f25eb3d91eb3103be99ca0fa882cdd987d", size = 1759777, upload-time = "2026-01-03T17:30:54.537Z" }, + { url = "https://files.pythonhosted.org/packages/fb/e3/e06ee07b45e59e6d81498b591fc589629be1553abb2a82ce33efe2a7b068/aiohttp-3.13.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:37239e9f9a7ea9ac5bf6b92b0260b01f8a22281996da609206a84df860bc1261", size = 1861276, upload-time = "2026-01-03T17:30:56.512Z" }, + { url = "https://files.pythonhosted.org/packages/7c/24/75d274228acf35ceeb2850b8ce04de9dd7355ff7a0b49d607ee60c29c518/aiohttp-3.13.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f76c1e3fe7d7c8afad7ed193f89a292e1999608170dcc9751a7462a87dfd5bc0", size = 1743131, upload-time = "2026-01-03T17:30:58.256Z" }, + { url = "https://files.pythonhosted.org/packages/04/98/3d21dde21889b17ca2eea54fdcff21b27b93f45b7bb94ca029c31ab59dc3/aiohttp-3.13.3-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:fc290605db2a917f6e81b0e1e0796469871f5af381ce15c604a3c5c7e51cb730", size = 1556863, upload-time = "2026-01-03T17:31:00.445Z" }, + { url = "https://files.pythonhosted.org/packages/9e/84/da0c3ab1192eaf64782b03971ab4055b475d0db07b17eff925e8c93b3aa5/aiohttp-3.13.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:4021b51936308aeea0367b8f006dc999ca02bc118a0cc78c303f50a2ff6afb91", size = 1682793, upload-time = "2026-01-03T17:31:03.024Z" }, + { url = "https://files.pythonhosted.org/packages/ff/0f/5802ada182f575afa02cbd0ec5180d7e13a402afb7c2c03a9aa5e5d49060/aiohttp-3.13.3-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:49a03727c1bba9a97d3e93c9f93ca03a57300f484b6e935463099841261195d3", size = 1716676, upload-time = "2026-01-03T17:31:04.842Z" }, + { url = "https://files.pythonhosted.org/packages/3f/8c/714d53bd8b5a4560667f7bbbb06b20c2382f9c7847d198370ec6526af39c/aiohttp-3.13.3-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:3d9908a48eb7416dc1f4524e69f1d32e5d90e3981e4e37eb0aa1cd18f9cfa2a4", size = 1733217, upload-time = "2026-01-03T17:31:06.868Z" }, + { url = "https://files.pythonhosted.org/packages/7d/79/e2176f46d2e963facea939f5be2d26368ce543622be6f00a12844d3c991f/aiohttp-3.13.3-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:2712039939ec963c237286113c68dbad80a82a4281543f3abf766d9d73228998", size = 1552303, upload-time = "2026-01-03T17:31:08.958Z" }, + { url = "https://files.pythonhosted.org/packages/ab/6a/28ed4dea1759916090587d1fe57087b03e6c784a642b85ef48217b0277ae/aiohttp-3.13.3-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:7bfdc049127717581866fa4708791220970ce291c23e28ccf3922c700740fdc0", size = 1763673, upload-time = "2026-01-03T17:31:10.676Z" }, + { url = "https://files.pythonhosted.org/packages/e8/35/4a3daeb8b9fab49240d21c04d50732313295e4bd813a465d840236dd0ce1/aiohttp-3.13.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8057c98e0c8472d8846b9c79f56766bcc57e3e8ac7bfd510482332366c56c591", size = 1721120, upload-time = "2026-01-03T17:31:12.575Z" }, + { url = "https://files.pythonhosted.org/packages/bc/9f/d643bb3c5fb99547323e635e251c609fbbc660d983144cfebec529e09264/aiohttp-3.13.3-cp313-cp313-win32.whl", hash = "sha256:1449ceddcdbcf2e0446957863af03ebaaa03f94c090f945411b61269e2cb5daf", size = 427383, upload-time = "2026-01-03T17:31:14.382Z" }, + { url = "https://files.pythonhosted.org/packages/4e/f1/ab0395f8a79933577cdd996dd2f9aa6014af9535f65dddcf88204682fe62/aiohttp-3.13.3-cp313-cp313-win_amd64.whl", hash = "sha256:693781c45a4033d31d4187d2436f5ac701e7bbfe5df40d917736108c1cc7436e", size = 453899, upload-time = "2026-01-03T17:31:15.958Z" }, + { url = "https://files.pythonhosted.org/packages/99/36/5b6514a9f5d66f4e2597e40dea2e3db271e023eb7a5d22defe96ba560996/aiohttp-3.13.3-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:ea37047c6b367fd4bd632bff8077449b8fa034b69e812a18e0132a00fae6e808", size = 737238, upload-time = "2026-01-03T17:31:17.909Z" }, + { url = "https://files.pythonhosted.org/packages/f7/49/459327f0d5bcd8c6c9ca69e60fdeebc3622861e696490d8674a6d0cb90a6/aiohttp-3.13.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:6fc0e2337d1a4c3e6acafda6a78a39d4c14caea625124817420abceed36e2415", size = 492292, upload-time = "2026-01-03T17:31:19.919Z" }, + { url = "https://files.pythonhosted.org/packages/e8/0b/b97660c5fd05d3495b4eb27f2d0ef18dc1dc4eff7511a9bf371397ff0264/aiohttp-3.13.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c685f2d80bb67ca8c3837823ad76196b3694b0159d232206d1e461d3d434666f", size = 493021, upload-time = "2026-01-03T17:31:21.636Z" }, + { url = "https://files.pythonhosted.org/packages/54/d4/438efabdf74e30aeceb890c3290bbaa449780583b1270b00661126b8aae4/aiohttp-3.13.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:48e377758516d262bde50c2584fc6c578af272559c409eecbdd2bae1601184d6", size = 1717263, upload-time = "2026-01-03T17:31:23.296Z" }, + { url = "https://files.pythonhosted.org/packages/71/f2/7bddc7fd612367d1459c5bcf598a9e8f7092d6580d98de0e057eb42697ad/aiohttp-3.13.3-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:34749271508078b261c4abb1767d42b8d0c0cc9449c73a4df494777dc55f0687", size = 1669107, upload-time = "2026-01-03T17:31:25.334Z" }, + { url = "https://files.pythonhosted.org/packages/00/5a/1aeaecca40e22560f97610a329e0e5efef5e0b5afdf9f857f0d93839ab2e/aiohttp-3.13.3-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:82611aeec80eb144416956ec85b6ca45a64d76429c1ed46ae1b5f86c6e0c9a26", size = 1760196, upload-time = "2026-01-03T17:31:27.394Z" }, + { url = "https://files.pythonhosted.org/packages/f8/f8/0ff6992bea7bd560fc510ea1c815f87eedd745fe035589c71ce05612a19a/aiohttp-3.13.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2fff83cfc93f18f215896e3a190e8e5cb413ce01553901aca925176e7568963a", size = 1843591, upload-time = "2026-01-03T17:31:29.238Z" }, + { url = "https://files.pythonhosted.org/packages/e3/d1/e30e537a15f53485b61f5be525f2157da719819e8377298502aebac45536/aiohttp-3.13.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bbe7d4cecacb439e2e2a8a1a7b935c25b812af7a5fd26503a66dadf428e79ec1", size = 1720277, upload-time = "2026-01-03T17:31:31.053Z" }, + { url = "https://files.pythonhosted.org/packages/84/45/23f4c451d8192f553d38d838831ebbc156907ea6e05557f39563101b7717/aiohttp-3.13.3-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b928f30fe49574253644b1ca44b1b8adbd903aa0da4b9054a6c20fc7f4092a25", size = 1548575, upload-time = "2026-01-03T17:31:32.87Z" }, + { url = "https://files.pythonhosted.org/packages/6a/ed/0a42b127a43712eda7807e7892c083eadfaf8429ca8fb619662a530a3aab/aiohttp-3.13.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7b5e8fe4de30df199155baaf64f2fcd604f4c678ed20910db8e2c66dc4b11603", size = 1679455, upload-time = "2026-01-03T17:31:34.76Z" }, + { url = "https://files.pythonhosted.org/packages/2e/b5/c05f0c2b4b4fe2c9d55e73b6d3ed4fd6c9dc2684b1d81cbdf77e7fad9adb/aiohttp-3.13.3-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:8542f41a62bcc58fc7f11cf7c90e0ec324ce44950003feb70640fc2a9092c32a", size = 1687417, upload-time = "2026-01-03T17:31:36.699Z" }, + { url = "https://files.pythonhosted.org/packages/c9/6b/915bc5dad66aef602b9e459b5a973529304d4e89ca86999d9d75d80cbd0b/aiohttp-3.13.3-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:5e1d8c8b8f1d91cd08d8f4a3c2b067bfca6ec043d3ff36de0f3a715feeedf926", size = 1729968, upload-time = "2026-01-03T17:31:38.622Z" }, + { url = "https://files.pythonhosted.org/packages/11/3b/e84581290a9520024a08640b63d07673057aec5ca548177a82026187ba73/aiohttp-3.13.3-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:90455115e5da1c3c51ab619ac57f877da8fd6d73c05aacd125c5ae9819582aba", size = 1545690, upload-time = "2026-01-03T17:31:40.57Z" }, + { url = "https://files.pythonhosted.org/packages/f5/04/0c3655a566c43fd647c81b895dfe361b9f9ad6d58c19309d45cff52d6c3b/aiohttp-3.13.3-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:042e9e0bcb5fba81886c8b4fbb9a09d6b8a00245fd8d88e4d989c1f96c74164c", size = 1746390, upload-time = "2026-01-03T17:31:42.857Z" }, + { url = "https://files.pythonhosted.org/packages/1f/53/71165b26978f719c3419381514c9690bd5980e764a09440a10bb816ea4ab/aiohttp-3.13.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:2eb752b102b12a76ca02dff751a801f028b4ffbbc478840b473597fc91a9ed43", size = 1702188, upload-time = "2026-01-03T17:31:44.984Z" }, + { url = "https://files.pythonhosted.org/packages/29/a7/cbe6c9e8e136314fa1980da388a59d2f35f35395948a08b6747baebb6aa6/aiohttp-3.13.3-cp314-cp314-win32.whl", hash = "sha256:b556c85915d8efaed322bf1bdae9486aa0f3f764195a0fb6ee962e5c71ef5ce1", size = 433126, upload-time = "2026-01-03T17:31:47.463Z" }, + { url = "https://files.pythonhosted.org/packages/de/56/982704adea7d3b16614fc5936014e9af85c0e34b58f9046655817f04306e/aiohttp-3.13.3-cp314-cp314-win_amd64.whl", hash = "sha256:9bf9f7a65e7aa20dd764151fb3d616c81088f91f8df39c3893a536e279b4b984", size = 459128, upload-time = "2026-01-03T17:31:49.2Z" }, + { url = "https://files.pythonhosted.org/packages/6c/2a/3c79b638a9c3d4658d345339d22070241ea341ed4e07b5ac60fb0f418003/aiohttp-3.13.3-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:05861afbbec40650d8a07ea324367cb93e9e8cc7762e04dd4405df99fa65159c", size = 769512, upload-time = "2026-01-03T17:31:51.134Z" }, + { url = "https://files.pythonhosted.org/packages/29/b9/3e5014d46c0ab0db8707e0ac2711ed28c4da0218c358a4e7c17bae0d8722/aiohttp-3.13.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:2fc82186fadc4a8316768d61f3722c230e2c1dcab4200d52d2ebdf2482e47592", size = 506444, upload-time = "2026-01-03T17:31:52.85Z" }, + { url = "https://files.pythonhosted.org/packages/90/03/c1d4ef9a054e151cd7839cdc497f2638f00b93cbe8043983986630d7a80c/aiohttp-3.13.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:0add0900ff220d1d5c5ebbf99ed88b0c1bbf87aa7e4262300ed1376a6b13414f", size = 510798, upload-time = "2026-01-03T17:31:54.91Z" }, + { url = "https://files.pythonhosted.org/packages/ea/76/8c1e5abbfe8e127c893fe7ead569148a4d5a799f7cf958d8c09f3eedf097/aiohttp-3.13.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:568f416a4072fbfae453dcf9a99194bbb8bdeab718e08ee13dfa2ba0e4bebf29", size = 1868835, upload-time = "2026-01-03T17:31:56.733Z" }, + { url = "https://files.pythonhosted.org/packages/8e/ac/984c5a6f74c363b01ff97adc96a3976d9c98940b8969a1881575b279ac5d/aiohttp-3.13.3-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:add1da70de90a2569c5e15249ff76a631ccacfe198375eead4aadf3b8dc849dc", size = 1720486, upload-time = "2026-01-03T17:31:58.65Z" }, + { url = "https://files.pythonhosted.org/packages/b2/9a/b7039c5f099c4eb632138728828b33428585031a1e658d693d41d07d89d1/aiohttp-3.13.3-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:10b47b7ba335d2e9b1239fa571131a87e2d8ec96b333e68b2a305e7a98b0bae2", size = 1847951, upload-time = "2026-01-03T17:32:00.989Z" }, + { url = "https://files.pythonhosted.org/packages/3c/02/3bec2b9a1ba3c19ff89a43a19324202b8eb187ca1e928d8bdac9bbdddebd/aiohttp-3.13.3-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:3dd4dce1c718e38081c8f35f323209d4c1df7d4db4bab1b5c88a6b4d12b74587", size = 1941001, upload-time = "2026-01-03T17:32:03.122Z" }, + { url = "https://files.pythonhosted.org/packages/37/df/d879401cedeef27ac4717f6426c8c36c3091c6e9f08a9178cc87549c537f/aiohttp-3.13.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:34bac00a67a812570d4a460447e1e9e06fae622946955f939051e7cc895cfab8", size = 1797246, upload-time = "2026-01-03T17:32:05.255Z" }, + { url = "https://files.pythonhosted.org/packages/8d/15/be122de1f67e6953add23335c8ece6d314ab67c8bebb3f181063010795a7/aiohttp-3.13.3-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a19884d2ee70b06d9204b2727a7b9f983d0c684c650254679e716b0b77920632", size = 1627131, upload-time = "2026-01-03T17:32:07.607Z" }, + { url = "https://files.pythonhosted.org/packages/12/12/70eedcac9134cfa3219ab7af31ea56bc877395b1ac30d65b1bc4b27d0438/aiohttp-3.13.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5f8ca7f2bb6ba8348a3614c7918cc4bb73268c5ac2a207576b7afea19d3d9f64", size = 1795196, upload-time = "2026-01-03T17:32:09.59Z" }, + { url = "https://files.pythonhosted.org/packages/32/11/b30e1b1cd1f3054af86ebe60df96989c6a414dd87e27ad16950eee420bea/aiohttp-3.13.3-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:b0d95340658b9d2f11d9697f59b3814a9d3bb4b7a7c20b131df4bcef464037c0", size = 1782841, upload-time = "2026-01-03T17:32:11.445Z" }, + { url = "https://files.pythonhosted.org/packages/88/0d/d98a9367b38912384a17e287850f5695c528cff0f14f791ce8ee2e4f7796/aiohttp-3.13.3-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:a1e53262fd202e4b40b70c3aff944a8155059beedc8a89bba9dc1f9ef06a1b56", size = 1795193, upload-time = "2026-01-03T17:32:13.705Z" }, + { url = "https://files.pythonhosted.org/packages/43/a5/a2dfd1f5ff5581632c7f6a30e1744deda03808974f94f6534241ef60c751/aiohttp-3.13.3-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:d60ac9663f44168038586cab2157e122e46bdef09e9368b37f2d82d354c23f72", size = 1621979, upload-time = "2026-01-03T17:32:15.965Z" }, + { url = "https://files.pythonhosted.org/packages/fa/f0/12973c382ae7c1cccbc4417e129c5bf54c374dfb85af70893646e1f0e749/aiohttp-3.13.3-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:90751b8eed69435bac9ff4e3d2f6b3af1f57e37ecb0fbeee59c0174c9e2d41df", size = 1822193, upload-time = "2026-01-03T17:32:18.219Z" }, + { url = "https://files.pythonhosted.org/packages/3c/5f/24155e30ba7f8c96918af1350eb0663e2430aad9e001c0489d89cd708ab1/aiohttp-3.13.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:fc353029f176fd2b3ec6cfc71be166aba1936fe5d73dd1992ce289ca6647a9aa", size = 1769801, upload-time = "2026-01-03T17:32:20.25Z" }, + { url = "https://files.pythonhosted.org/packages/eb/f8/7314031ff5c10e6ece114da79b338ec17eeff3a079e53151f7e9f43c4723/aiohttp-3.13.3-cp314-cp314t-win32.whl", hash = "sha256:2e41b18a58da1e474a057b3d35248d8320029f61d70a37629535b16a0c8f3767", size = 466523, upload-time = "2026-01-03T17:32:22.215Z" }, + { url = "https://files.pythonhosted.org/packages/b4/63/278a98c715ae467624eafe375542d8ba9b4383a016df8fdefe0ae28382a7/aiohttp-3.13.3-cp314-cp314t-win_amd64.whl", hash = "sha256:44531a36aa2264a1860089ffd4dce7baf875ee5a6079d5fb42e261c704ef7344", size = 499694, upload-time = "2026-01-03T17:32:24.546Z" }, + { url = "https://files.pythonhosted.org/packages/bf/79/446655656861d3e7e2c32bfcf160c7aa9e9dc63776a691b124dba65cdd77/aiohttp-3.13.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:31a83ea4aead760dfcb6962efb1d861db48c34379f2ff72db9ddddd4cda9ea2e", size = 741433, upload-time = "2026-01-03T17:32:26.453Z" }, + { url = "https://files.pythonhosted.org/packages/cb/49/773c4b310b5140d2fb5e79bb0bf40b7b41dad80a288ca1a8759f5f72bda9/aiohttp-3.13.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:988a8c5e317544fdf0d39871559e67b6341065b87fceac641108c2096d5506b7", size = 497332, upload-time = "2026-01-03T17:32:28.37Z" }, + { url = "https://files.pythonhosted.org/packages/bc/31/1dcbc4b83a4e6f76a0ad883f07f21ffbfe29750c89db97381701508c9f45/aiohttp-3.13.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9b174f267b5cfb9a7dba9ee6859cecd234e9a681841eb85068059bc867fb8f02", size = 492365, upload-time = "2026-01-03T17:32:30.234Z" }, + { url = "https://files.pythonhosted.org/packages/5a/b5/b50657496c8754482cd7964e50aaf3aa84b3db61ed45daec4c1aec5b94b4/aiohttp-3.13.3-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:947c26539750deeaee933b000fb6517cc770bbd064bad6033f1cff4803881e43", size = 1660440, upload-time = "2026-01-03T17:32:32.586Z" }, + { url = "https://files.pythonhosted.org/packages/2a/73/9b69e5139d89d75127569298931444ad78ea86a5befd5599780b1e9a6880/aiohttp-3.13.3-cp39-cp39-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:9ebf57d09e131f5323464bd347135a88622d1c0976e88ce15b670e7ad57e4bd6", size = 1632740, upload-time = "2026-01-03T17:32:34.793Z" }, + { url = "https://files.pythonhosted.org/packages/ef/fe/3ea9b5af694b4e3aec0d0613a806132ca744747146fca68e96bf056f61a7/aiohttp-3.13.3-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:4ae5b5a0e1926e504c81c5b84353e7a5516d8778fbbff00429fe7b05bb25cbce", size = 1719782, upload-time = "2026-01-03T17:32:37.737Z" }, + { url = "https://files.pythonhosted.org/packages/fb/c2/46b3b06e60851cbb71efb0f79a3267279cbef7b12c58e68a1e897f269cca/aiohttp-3.13.3-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2ba0eea45eb5cc3172dbfc497c066f19c41bac70963ea1a67d51fc92e4cf9a80", size = 1813527, upload-time = "2026-01-03T17:32:39.973Z" }, + { url = "https://files.pythonhosted.org/packages/36/23/71ceb78c769ed65fe4c697692de232b63dab399210678d2b00961ccb0619/aiohttp-3.13.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bae5c2ed2eae26cc382020edad80d01f36cb8e746da40b292e68fec40421dc6a", size = 1661268, upload-time = "2026-01-03T17:32:42.082Z" }, + { url = "https://files.pythonhosted.org/packages/c4/8d/86e929523d955e85ebab7c0e2b9e0cb63604cfc27dc3280e10d0063cf682/aiohttp-3.13.3-cp39-cp39-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:8a60e60746623925eab7d25823329941aee7242d559baa119ca2b253c88a7bd6", size = 1552742, upload-time = "2026-01-03T17:32:44.622Z" }, + { url = "https://files.pythonhosted.org/packages/3a/ea/3f5987cba1bab6bd151f0d97aa60f0ce04d3c83316692a6bb6ba2fb69f92/aiohttp-3.13.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:e50a2e1404f063427c9d027378472316201a2290959a295169bcf25992d04558", size = 1632918, upload-time = "2026-01-03T17:32:46.749Z" }, + { url = "https://files.pythonhosted.org/packages/be/2c/7e1e85121f2e31ee938cb83a8f32dfafd4908530c10fabd6d46761c12ac7/aiohttp-3.13.3-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:9a9dc347e5a3dc7dfdbc1f82da0ef29e388ddb2ed281bfce9dd8248a313e62b7", size = 1644446, upload-time = "2026-01-03T17:32:49.063Z" }, + { url = "https://files.pythonhosted.org/packages/5d/35/ce6133d423ad0e8ca976a7c848f7146bca3520eea4ccf6b95e2d077c9d20/aiohttp-3.13.3-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:b46020d11d23fe16551466c77823df9cc2f2c1e63cc965daf67fa5eec6ca1877", size = 1689487, upload-time = "2026-01-03T17:32:51.113Z" }, + { url = "https://files.pythonhosted.org/packages/50/f7/ff7a27c15603d460fd1366b3c22054f7ae4fa9310aca40b43bde35867fcd/aiohttp-3.13.3-cp39-cp39-musllinux_1_2_riscv64.whl", hash = "sha256:69c56fbc1993fa17043e24a546959c0178fe2b5782405ad4559e6c13975c15e3", size = 1540715, upload-time = "2026-01-03T17:32:53.38Z" }, + { url = "https://files.pythonhosted.org/packages/17/02/053f11346e5b962e6d8a1c4f8c70c29d5970a1b4b8e7894c68e12c27a57f/aiohttp-3.13.3-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:b99281b0704c103d4e11e72a76f1b543d4946fea7dd10767e7e1b5f00d4e5704", size = 1711835, upload-time = "2026-01-03T17:32:56.088Z" }, + { url = "https://files.pythonhosted.org/packages/fb/71/9b9761ddf276fd6708d13720197cbac19b8d67ecfa9116777924056cfcaa/aiohttp-3.13.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:40c5e40ecc29ba010656c18052b877a1c28f84344825efa106705e835c28530f", size = 1649593, upload-time = "2026-01-03T17:32:58.181Z" }, + { url = "https://files.pythonhosted.org/packages/ae/72/5d817e9ea218acae12a5e3b9ad1178cf0c12fc3570c0b47eea2daf95f9ea/aiohttp-3.13.3-cp39-cp39-win32.whl", hash = "sha256:56339a36b9f1fc708260c76c87e593e2afb30d26de9ae1eb445b5e051b98a7a1", size = 434831, upload-time = "2026-01-03T17:33:00.577Z" }, + { url = "https://files.pythonhosted.org/packages/39/cb/22659d9bf3149b7a2927bc2769cc9c8f8f5a80eba098398e03c199a43a85/aiohttp-3.13.3-cp39-cp39-win_amd64.whl", hash = "sha256:c6b8568a3bb5819a0ad087f16d40e5a3fb6099f39ea1d5625a3edc1e923fc538", size = 457697, upload-time = "2026-01-03T17:33:03.167Z" }, ] [[package]] @@ -185,16 +185,16 @@ wheels = [ [[package]] name = "anyio" -version = "4.12.0" +version = "4.12.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "exceptiongroup", marker = "python_full_version < '3.11' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, { name = "idna" }, { name = "typing-extensions", marker = "python_full_version < '3.13' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/16/ce/8a777047513153587e5434fd752e89334ac33e379aa3497db860eeb60377/anyio-4.12.0.tar.gz", hash = "sha256:73c693b567b0c55130c104d0b43a9baf3aa6a31fc6110116509f27bf75e21ec0", size = 228266, upload-time = "2025-11-28T23:37:38.911Z" } +sdist = { url = "https://files.pythonhosted.org/packages/96/f0/5eb65b2bb0d09ac6776f2eb54adee6abe8228ea05b20a5ad0e4945de8aac/anyio-4.12.1.tar.gz", hash = "sha256:41cfcc3a4c85d3f05c932da7c26d0201ac36f72abd4435ba90d0464a3ffed703", size = 228685, upload-time = "2026-01-06T11:45:21.246Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/7f/9c/36c5c37947ebfb8c7f22e0eb6e4d188ee2d53aa3880f3f2744fb894f0cb1/anyio-4.12.0-py3-none-any.whl", hash = "sha256:dad2376a628f98eeca4881fc56cd06affd18f659b17a747d3ff0307ced94b1bb", size = 113362, upload-time = "2025-11-28T23:36:57.897Z" }, + { url = "https://files.pythonhosted.org/packages/38/0e/27be9fdef66e72d64c0cdc3cc2823101b80585f8119b5c112c2e8f5f7dab/anyio-4.12.1-py3-none-any.whl", hash = "sha256:d405828884fc140aa80a3c667b8beed277f1dfedec42ba031bd6ac3db606ab6c", size = 113592, upload-time = "2026-01-06T11:45:19.497Z" }, ] [[package]] @@ -226,11 +226,11 @@ wheels = [ [[package]] name = "certifi" -version = "2025.11.12" +version = "2026.1.4" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a2/8c/58f469717fa48465e4a50c014a0400602d3c437d7c0c468e17ada824da3a/certifi-2025.11.12.tar.gz", hash = "sha256:d8ab5478f2ecd78af242878415affce761ca6bc54a22a27e026d7c25357c3316", size = 160538, upload-time = "2025-11-12T02:54:51.517Z" } +sdist = { url = "https://files.pythonhosted.org/packages/e0/2d/a891ca51311197f6ad14a7ef42e2399f36cf2f9bd44752b3dc4eab60fdc5/certifi-2026.1.4.tar.gz", hash = "sha256:ac726dd470482006e014ad384921ed6438c457018f4b3d204aea4281258b2120", size = 154268, upload-time = "2026-01-04T02:42:41.825Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/70/7d/9bc192684cea499815ff478dfcdc13835ddf401365057044fb721ec6bddb/certifi-2025.11.12-py3-none-any.whl", hash = "sha256:97de8790030bbd5c2d96b7ec782fc2f7820ef8dba6db909ccf95449f2d062d4b", size = 159438, upload-time = "2025-11-12T02:54:49.735Z" }, + { url = "https://files.pythonhosted.org/packages/e6/ad/3cc14f097111b4de0040c83a525973216457bbeeb63739ef1ed275c1c021/certifi-2026.1.4-py3-none-any.whl", hash = "sha256:9943707519e4add1115f44c2bc244f782c0249876bf51b6599fee1ffbedd685c", size = 152900, upload-time = "2026-01-04T02:42:40.15Z" }, ] [[package]] @@ -457,15 +457,15 @@ wheels = [ [[package]] name = "httpx-aiohttp" -version = "0.1.9" +version = "0.1.12" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "aiohttp" }, { name = "httpx" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/d8/f2/9a86ce9bc48cf57dabb3a3160dfed26d8bbe5a2478a51f9d1dbf89f2f1fc/httpx_aiohttp-0.1.9.tar.gz", hash = "sha256:4ee8b22e6f2e7c80cd03be29eff98bfe7d89bd77f021ce0b578ee76b73b4bfe6", size = 206023, upload-time = "2025-10-15T08:52:57.475Z" } +sdist = { url = "https://files.pythonhosted.org/packages/63/2c/b894861cecf030fb45675ea24aa55b5722e97c602a163d872fca66c5a6d8/httpx_aiohttp-0.1.12.tar.gz", hash = "sha256:81feec51fd82c0ecfa0e9aaf1b1a6c2591260d5e2bcbeb7eb0277a78e610df2c", size = 275945, upload-time = "2025-12-12T10:12:15.283Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/a1/db/5cfa8254a86c34a1ab7fe0dbec9f81bb5ebd831cbdd65aa4be4f37027804/httpx_aiohttp-0.1.9-py3-none-any.whl", hash = "sha256:3dc2845568b07742588710fcf3d72db2cbcdf2acc93376edf85f789c4d8e5fda", size = 6180, upload-time = "2025-10-15T08:52:56.521Z" }, + { url = "https://files.pythonhosted.org/packages/16/8d/85c9701e9af72ca132a1783e2a54364a90c6da832304416a30fc11196ab2/httpx_aiohttp-0.1.12-py3-none-any.whl", hash = "sha256:5b0eac39a7f360fa7867a60bcb46bb1024eada9c01cbfecdb54dc1edb3fb7141", size = 6367, upload-time = "2025-12-12T10:12:14.018Z" }, ] [[package]] @@ -479,14 +479,14 @@ wheels = [ [[package]] name = "importlib-metadata" -version = "8.7.0" +version = "8.7.1" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "zipp" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/76/66/650a33bd90f786193e4de4b3ad86ea60b53c89b669a5c7be931fac31cdb0/importlib_metadata-8.7.0.tar.gz", hash = "sha256:d13b81ad223b890aa16c5471f2ac3056cf76c5f10f82d6f9292f0b415f389000", size = 56641, upload-time = "2025-04-27T15:29:01.736Z" } +sdist = { url = "https://files.pythonhosted.org/packages/f3/49/3b30cad09e7771a4982d9975a8cbf64f00d4a1ececb53297f1d9a7be1b10/importlib_metadata-8.7.1.tar.gz", hash = "sha256:49fef1ae6440c182052f407c8d34a68f72efc36db9ca90dc0113398f2fdde8bb", size = 57107, upload-time = "2025-12-21T10:00:19.278Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/20/b0/36bd937216ec521246249be3bf9855081de4c5e06a0c9b4219dbeda50373/importlib_metadata-8.7.0-py3-none-any.whl", hash = "sha256:e5dd1551894c77868a30651cef00984d50e1002d06942a7101d34870c5f02afd", size = 27656, upload-time = "2025-04-27T15:29:00.214Z" }, + { url = "https://files.pythonhosted.org/packages/fa/5e/f8e9a1d23b9c20a551a8a02ea3637b4642e22c2626e3a13a9a29cdea99eb/importlib_metadata-8.7.1-py3-none-any.whl", hash = "sha256:5a1f80bf1daa489495071efbb095d75a634cf28a8bc299581244063b53176151", size = 27865, upload-time = "2025-12-21T10:00:18.329Z" }, ] [[package]] @@ -770,11 +770,11 @@ wheels = [ [[package]] name = "nodeenv" -version = "1.9.1" +version = "1.10.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/43/16/fc88b08840de0e0a72a2f9d8c6bae36be573e475a6326ae854bcc549fc45/nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f", size = 47437, upload-time = "2024-06-04T18:44:11.171Z" } +sdist = { url = "https://files.pythonhosted.org/packages/24/bf/d1bda4f6168e0b2e9e5958945e01910052158313224ada5ce1fb2e1113b8/nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb", size = 55611, upload-time = "2025-12-20T14:08:54.006Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/d2/1d/1b658dbd2b9fa9c4c9f32accbfc0205d532c8c6194dc0f2a4c0428e7128a/nodeenv-1.9.1-py2.py3-none-any.whl", hash = "sha256:ba11c9782d29c27c70ffbdda2d7415098754709be8a7056d79a737cd901155c9", size = 22314, upload-time = "2024-06-04T18:44:08.352Z" }, + { url = "https://files.pythonhosted.org/packages/88/b2/d0896bdcdc8d28a7fc5717c305f1a861c26e18c05047949fb371034d98bd/nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827", size = 23438, upload-time = "2025-12-20T14:08:52.782Z" }, ] [[package]] @@ -788,11 +788,11 @@ wheels = [ [[package]] name = "pathspec" -version = "0.12.1" +version = "1.0.3" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/ca/bc/f35b8446f4531a7cb215605d100cd88b7ac6f44ab3fc94870c120ab3adbf/pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712", size = 51043, upload-time = "2023-12-10T22:30:45Z" } +sdist = { url = "https://files.pythonhosted.org/packages/4c/b2/bb8e495d5262bfec41ab5cb18f522f1012933347fb5d9e62452d446baca2/pathspec-1.0.3.tar.gz", hash = "sha256:bac5cf97ae2c2876e2d25ebb15078eb04d76e4b98921ee31c6f85ade8b59444d", size = 130841, upload-time = "2026-01-09T15:46:46.009Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08", size = 31191, upload-time = "2023-12-10T22:30:43.14Z" }, + { url = "https://files.pythonhosted.org/packages/32/2b/121e912bd60eebd623f873fd090de0e84f322972ab25a7f9044c056804ed/pathspec-1.0.3-py3-none-any.whl", hash = "sha256:e80767021c1cc524aa3fb14bedda9c34406591343cc42797b386ce7b9354fb6c", size = 55021, upload-time = "2026-01-09T15:46:44.652Z" }, ] [[package]] @@ -935,7 +935,7 @@ wheels = [ [[package]] name = "pydantic" -version = "1.10.24" +version = "1.10.26" source = { registry = "https://pypi.org/simple" } resolution-markers = [ "python_full_version >= '3.10'", @@ -944,44 +944,39 @@ resolution-markers = [ dependencies = [ { name = "typing-extensions", marker = "extra == 'group-18-runloop-api-client-pydantic-v1'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/ae/8d/7b346ed940c3e0f9eee7db9be37915a6dac0d9535d736e2ca47a81a066f3/pydantic-1.10.24.tar.gz", hash = "sha256:7e6d1af1bd3d2312079f28c9baf2aafb4a452a06b50717526e5ac562e37baa53", size = 357314, upload-time = "2025-09-25T01:36:33.065Z" } +sdist = { url = "https://files.pythonhosted.org/packages/7b/da/fd89f987a376c807cd81ea0eff4589aade783bbb702637b4734ef2c743a2/pydantic-1.10.26.tar.gz", hash = "sha256:8c6aa39b494c5af092e690127c283d84f363ac36017106a9e66cb33a22ac412e", size = 357906, upload-time = "2025-12-18T15:47:46.557Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/f9/6e/71eb0c860bf888e73243fbc22be79c47e68180b65b33036efb5a1f1085de/pydantic-1.10.24-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:eef07ea2fba12f9188cfa2c50cb3eaa6516b56c33e2a8cc3cd288b4190ee6c0c", size = 2494239, upload-time = "2025-09-25T01:35:02.451Z" }, - { url = "https://files.pythonhosted.org/packages/fd/1f/a2c09049c2ec33b88b111aa99e4bbfe9e821914dcf2ce662e00fa1423fa8/pydantic-1.10.24-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5a42033fac69b9f1f867ecc3a2159f0e94dceb1abfc509ad57e9e88d49774683", size = 2302370, upload-time = "2025-09-25T01:35:05.386Z" }, - { url = "https://files.pythonhosted.org/packages/70/73/fde9af3a76cc5714880828eee50c0f7f1b263d2c77a74c65ba19325b4706/pydantic-1.10.24-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c626596c1b95dc6d45f7129f10b6743fbb50f29d942d25a22b2ceead670c067d", size = 2960499, upload-time = "2025-09-25T01:35:07.243Z" }, - { url = "https://files.pythonhosted.org/packages/1d/d5/9fd98afa478020e9bad54a9ec6e42ba71f8a1a7f6df4d12ce5be76b0a96a/pydantic-1.10.24-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8057172868b0d98f95e6fcddcc5f75d01570e85c6308702dd2c50ea673bc197b", size = 3031125, upload-time = "2025-09-25T01:35:09.048Z" }, - { url = "https://files.pythonhosted.org/packages/1c/99/2fc6df8644c096dc6e3347e1793868a758df874eaf5ba52ca8b5a80e42d8/pydantic-1.10.24-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:82f951210ebcdb778b1d93075af43adcd04e9ebfd4f44b1baa8eeb21fbd71e36", size = 3099888, upload-time = "2025-09-25T01:35:10.894Z" }, - { url = "https://files.pythonhosted.org/packages/71/71/2f4c115951140f525136089da491b0bb4b7d24de8d697913afedde3f326c/pydantic-1.10.24-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:b66e4892d8ae005f436a5c5f1519ecf837574d8414b1c93860fb3c13943d9b37", size = 3038385, upload-time = "2025-09-25T01:35:12.744Z" }, - { url = "https://files.pythonhosted.org/packages/ec/6d/d3893a9b8479a0ea9357ba4a1eb84a5776a80705b5409bda4ad9e7ca0804/pydantic-1.10.24-cp310-cp310-win_amd64.whl", hash = "sha256:50d9f8a207c07f347d4b34806dc576872000d9a60fd481ed9eb78ea8512e0666", size = 2093504, upload-time = "2025-09-25T01:35:14.439Z" }, - { url = "https://files.pythonhosted.org/packages/bd/b5/1b49b94e99ae4cad5f034c4b33e9ab481e53238fb55b59ffed5c6e6ee4cf/pydantic-1.10.24-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:70152291488f8d2bbcf2027b5c28c27724c78a7949c91b466d28ad75d6d12702", size = 2526778, upload-time = "2025-09-25T01:35:16.448Z" }, - { url = "https://files.pythonhosted.org/packages/87/d8/63fb1850ca93511b324d709f1c5bd31131039f9b93d0bc2ae210285db6d1/pydantic-1.10.24-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:956b30638272c51c85caaff76851b60db4b339022c0ee6eca677c41e3646255b", size = 2307760, upload-time = "2025-09-25T01:35:18.234Z" }, - { url = "https://files.pythonhosted.org/packages/2a/b8/428453ce573b8898afaf39a5ce32f7dbacf54f8aad9ce9c0abf19a1cdb2c/pydantic-1.10.24-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bed9d6eea5fabbc6978c42e947190c7bd628ddaff3b56fc963fe696c3710ccd6", size = 2902586, upload-time = "2025-09-25T01:35:20.118Z" }, - { url = "https://files.pythonhosted.org/packages/96/e0/68b5eb3c26b5e7136a8946f00f6d2eb8ef2fde530fcf6b491c66e3989d0d/pydantic-1.10.24-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:af8e2b3648128b8cadb1a71e2f8092a6f42d4ca123fad7a8d7ce6db8938b1db3", size = 2976378, upload-time = "2025-09-25T01:35:22.077Z" }, - { url = "https://files.pythonhosted.org/packages/93/8c/2c6c46b7bc265ba35bad019c63f77d9ef44fabc026353768d7e6ea16dd51/pydantic-1.10.24-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:076fff9da02ca716e4c8299c68512fdfbeac32fdefc9c160e6f80bdadca0993d", size = 3063515, upload-time = "2025-09-25T01:35:24.048Z" }, - { url = "https://files.pythonhosted.org/packages/84/be/a051e26eff43b6af69f968c1085cdf9069628a7c3614a9836d3ce71327e4/pydantic-1.10.24-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:8f2447ca88a7e14fd4d268857521fb37535c53a367b594fa2d7c2551af905993", size = 2988590, upload-time = "2025-09-25T01:35:25.794Z" }, - { url = "https://files.pythonhosted.org/packages/da/d8/f1aca10d538a0f18d2c99f7e84d3bb5c4abb6bd499272d6c4fc21f39af30/pydantic-1.10.24-cp311-cp311-win_amd64.whl", hash = "sha256:58d42a7c344882c00e3bb7c6c8c6f62db2e3aafa671f307271c45ad96e8ccf7a", size = 2096524, upload-time = "2025-09-25T01:35:27.367Z" }, - { url = "https://files.pythonhosted.org/packages/79/4b/73b59168d0babc14fb40b56795bde269d15709ef33de888e12e4f0add5ea/pydantic-1.10.24-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:17e7610119483f03954569c18d4de16f4e92f1585f20975414033ac2d4a96624", size = 2533707, upload-time = "2025-09-25T01:35:28.953Z" }, - { url = "https://files.pythonhosted.org/packages/6d/36/18e6f421a23ddceecfc5d3800d0e86af05e85574aa9e88cc9e29222db066/pydantic-1.10.24-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:e24435a9970dcb2b35648f2cf57505d4bd414fcca1a404c82e28d948183fe0a6", size = 2322935, upload-time = "2025-09-25T01:35:30.838Z" }, - { url = "https://files.pythonhosted.org/packages/05/14/4d3fc4bea30add2f2f3c287e931b276f7e304bcb322fe5b2c05a76ccdee7/pydantic-1.10.24-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a9e92b9c78d7f3cfa085c21c110e7000894446e24a836d006aabfc6ae3f1813", size = 2779568, upload-time = "2025-09-25T01:35:32.309Z" }, - { url = "https://files.pythonhosted.org/packages/15/32/5349a7b6675d4384f07f9d461d8230de877b2b913529aa20e659c84bab07/pydantic-1.10.24-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ef14dfa7c98b314a3e449e92df6f1479cafe74c626952f353ff0176b075070de", size = 2829163, upload-time = "2025-09-25T01:35:34.294Z" }, - { url = "https://files.pythonhosted.org/packages/f0/00/4d93755e279e8975f7f33adc0af0e9d9aa0db58bcd9c807227d65b396311/pydantic-1.10.24-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:52219b4e70c1db185cfd103a804e416384e1c8950168a2d4f385664c7c35d21a", size = 2912003, upload-time = "2025-09-25T01:35:35.935Z" }, - { url = "https://files.pythonhosted.org/packages/db/0c/c839c2a9cf14185c7b5dcc0959d3c3d4a00da400fe02565abf04a7dff6e0/pydantic-1.10.24-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:5ce0986799248082e9a5a026c9b5d2f9fa2e24d2afb9b0eace9104334a58fdc1", size = 2859825, upload-time = "2025-09-25T01:35:37.657Z" }, - { url = "https://files.pythonhosted.org/packages/cb/0c/f0b8e35033322c176574d6f431455c8d6e3f63811a2c5a00c96b2b97a393/pydantic-1.10.24-cp312-cp312-win_amd64.whl", hash = "sha256:874a78e4ed821258295a472e325eee7de3d91ba7a61d0639ce1b0367a3c63d4c", size = 1969911, upload-time = "2025-09-25T01:35:39.479Z" }, - { url = "https://files.pythonhosted.org/packages/bd/56/9168c282af2bb8bdb102981a9ff0ed41ab4d3735a52b732b2d2ad0e14018/pydantic-1.10.24-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:265788a1120285c4955f8b3d52b3ea6a52c7a74db097c4c13a4d3567f0c6df3c", size = 2589497, upload-time = "2025-09-25T01:35:41.141Z" }, - { url = "https://files.pythonhosted.org/packages/9c/eb/eb4b0e2988a2889a1905c3196f859509e62c208830889d2382928b92fdd2/pydantic-1.10.24-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:d255bebd927e5f1e026b32605684f7b6fc36a13e62b07cb97b29027b91657def", size = 2351231, upload-time = "2025-09-25T01:35:43.221Z" }, - { url = "https://files.pythonhosted.org/packages/1e/be/7451b633ffdc2d28de582a339af2275c3ffcca789dda97d8ac9133f0c616/pydantic-1.10.24-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d6e45dbc79a44e34c2c83ef1fcb56ff663040474dcf4dfc452db24a1de0f7574", size = 2762972, upload-time = "2025-09-25T01:35:45.304Z" }, - { url = "https://files.pythonhosted.org/packages/9e/fb/5de3cfde0b808f2fa0538ec1f1c186f44d905ecbcc96ba22e2cac1f30b23/pydantic-1.10.24-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:af31565b12a7db5bfa5fe8c3a4f8fda4d32f5c2929998b1b241f1c22e9ab6e69", size = 2801015, upload-time = "2025-09-25T01:35:46.774Z" }, - { url = "https://files.pythonhosted.org/packages/2f/6a/9b6b51d19d1af57e8864caff08ce5e8554388b91dc41987ce49315bce3e1/pydantic-1.10.24-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:9c377fc30d9ca40dbff5fd79c5a5e1f0d6fff040fa47a18851bb6b0bd040a5d8", size = 2890844, upload-time = "2025-09-25T01:35:48.724Z" }, - { url = "https://files.pythonhosted.org/packages/27/ca/1ab6b16bd792c8a1fb54949d8b5eef8032d672932ca4afc3048e4febfcdc/pydantic-1.10.24-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:b644d6f14b2ce617d6def21622f9ba73961a16b7dffdba7f6692e2f66fa05d00", size = 2850844, upload-time = "2025-09-25T01:35:50.279Z" }, - { url = "https://files.pythonhosted.org/packages/86/5f/fcc5635818113858a6b37099fed6b860a15b27bb1d0fb270ceb50d0a91b6/pydantic-1.10.24-cp313-cp313-win_amd64.whl", hash = "sha256:0cbbf306124ae41cc153fdc2559b37faa1bec9a23ef7b082c1756d1315ceffe6", size = 1971713, upload-time = "2025-09-25T01:35:52.027Z" }, - { url = "https://files.pythonhosted.org/packages/a9/29/62dd3ffcf7d003f53e834942e9651c2ddd9dc6fb59e6619317e0ed37cf6b/pydantic-1.10.24-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:25fb9a69a21d711deb5acefdab9ff8fb49e6cc77fdd46d38217d433bff2e3de2", size = 2504290, upload-time = "2025-09-25T01:36:16.661Z" }, - { url = "https://files.pythonhosted.org/packages/f2/83/ef9c4be8e7fc96f52320296aed34f7cbe50fa0219833cc2756e611b644f2/pydantic-1.10.24-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6af36a8fb3072526b5b38d3f341b12d8f423188e7d185f130c0079fe02cdec7f", size = 2311007, upload-time = "2025-09-25T01:36:18.75Z" }, - { url = "https://files.pythonhosted.org/packages/1c/b7/ec7da8fbaac8c8100b05301a81fac6b2b7446961edb91bbef4b564834abf/pydantic-1.10.24-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5fc35569dfd15d3b3fc06a22abee0a45fdde0784be644e650a8769cd0b2abd94", size = 2968514, upload-time = "2025-09-25T01:36:20.511Z" }, - { url = "https://files.pythonhosted.org/packages/49/84/9e218a35008fbc32dac2974a35a4bd88d7deb0f5b572cf46ccf003a06310/pydantic-1.10.24-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fac7fbcb65171959973f3136d0792c3d1668bc01fd414738f0898b01f692f1b4", size = 3039539, upload-time = "2025-09-25T01:36:24.359Z" }, - { url = "https://files.pythonhosted.org/packages/b0/2f/b13a8c2d641e3af3fbba136202a9808025ee7cde4b1326ce1aabd1c79d51/pydantic-1.10.24-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:fc3f4a6544517380658b63b144c7d43d5276a343012913b7e5d18d9fba2f12bb", size = 3108949, upload-time = "2025-09-25T01:36:26.138Z" }, - { url = "https://files.pythonhosted.org/packages/1f/57/dccbf080b35b9797f4d477f4c59935e39e4493cd507f31b5ca5ee49c930d/pydantic-1.10.24-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:415c638ca5fd57b915a62dd38c18c8e0afe5adf5527be6f8ce16b4636b616816", size = 3049395, upload-time = "2025-09-25T01:36:27.782Z" }, - { url = "https://files.pythonhosted.org/packages/a2/ff/2a25855a1495fcbe1d3b8c782276994575e98ce2218dbf57c1f2eee7c894/pydantic-1.10.24-cp39-cp39-win_amd64.whl", hash = "sha256:a5bf94042efbc6ab56b18a5921f426ebbeefc04f554a911d76029e7be9057d01", size = 2100530, upload-time = "2025-09-25T01:36:29.932Z" }, - { url = "https://files.pythonhosted.org/packages/46/7f/a168d7077f85f85128aa5636abf13c804c06235c786f1881e659703899a4/pydantic-1.10.24-py3-none-any.whl", hash = "sha256:093768eba26db55a88b12f3073017e3fdee319ef60d3aef5c6c04a4e484db193", size = 166727, upload-time = "2025-09-25T01:36:31.732Z" }, + { url = "https://files.pythonhosted.org/packages/71/08/2587a6d4314e7539eec84acd062cb7b037638edb57a0335d20e4c5b8878c/pydantic-1.10.26-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f7ae36fa0ecef8d39884120f212e16c06bb096a38f523421278e2f39c1784546", size = 2444588, upload-time = "2025-12-18T15:46:28.882Z" }, + { url = "https://files.pythonhosted.org/packages/47/e6/10df5f08c105bcbb4adbee7d1108ff4b347702b110fed058f6a03f1c6b73/pydantic-1.10.26-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d95a76cf503f0f72ed7812a91de948440b2bf564269975738a4751e4fadeb572", size = 2255972, upload-time = "2025-12-18T15:46:31.72Z" }, + { url = "https://files.pythonhosted.org/packages/ba/7d/fdb961e7adc2c31f394feba6f560ef2c74c446f0285e2c2eb87d2b7206c7/pydantic-1.10.26-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:a943ce8e00ad708ed06a1d9df5b4fd28f5635a003b82a4908ece6f24c0b18464", size = 2857175, upload-time = "2025-12-18T15:46:34Z" }, + { url = "https://files.pythonhosted.org/packages/8f/6c/f21e27dda475d4c562bd01b5874284dd3180f336c1e669413b743ca8b278/pydantic-1.10.26-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:465ad8edb29b15c10b779b16431fe8e77c380098badf6db367b7a1d3e572cf53", size = 2947001, upload-time = "2025-12-18T15:46:35.922Z" }, + { url = "https://files.pythonhosted.org/packages/6d/f6/27ea206232cbb6ec24dc4e4e8888a9a734f96a1eaf13504be4b30ef26aa7/pydantic-1.10.26-cp310-cp310-win_amd64.whl", hash = "sha256:80e6be6272839c8a7641d26ad569ab77772809dd78f91d0068dc0fc97f071945", size = 2066217, upload-time = "2025-12-18T15:46:37.614Z" }, + { url = "https://files.pythonhosted.org/packages/1d/c1/d521e64c8130e1ad9d22c270bed3fabcc0940c9539b076b639c88fd32a8d/pydantic-1.10.26-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:116233e53889bcc536f617e38c1b8337d7fa9c280f0fd7a4045947515a785637", size = 2428347, upload-time = "2025-12-18T15:46:39.41Z" }, + { url = "https://files.pythonhosted.org/packages/2c/08/f4b804a00c16e3ea994cb640a7c25c579b4f1fa674cde6a19fa0dfb0ae4f/pydantic-1.10.26-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c3cfdd361addb6eb64ccd26ac356ad6514cee06a61ab26b27e16b5ed53108f77", size = 2212605, upload-time = "2025-12-18T15:46:41.006Z" }, + { url = "https://files.pythonhosted.org/packages/5d/78/0df4b9efef29bbc5e39f247fcba99060d15946b4463d82a5589cf7923d71/pydantic-1.10.26-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:0e4451951a9a93bf9a90576f3e25240b47ee49ab5236adccb8eff6ac943adf0f", size = 2753560, upload-time = "2025-12-18T15:46:43.215Z" }, + { url = "https://files.pythonhosted.org/packages/68/66/6ab6c1d3a116d05d2508fce64f96e35242938fac07544d611e11d0d363a0/pydantic-1.10.26-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9858ed44c6bea5f29ffe95308db9e62060791c877766c67dd5f55d072c8612b5", size = 2859235, upload-time = "2025-12-18T15:46:45.112Z" }, + { url = "https://files.pythonhosted.org/packages/61/4e/f1676bb0fcdf6ed2ce4670d7d1fc1d6c3a06d84497644acfbe02649503f1/pydantic-1.10.26-cp311-cp311-win_amd64.whl", hash = "sha256:ac1089f723e2106ebde434377d31239e00870a7563245072968e5af5cc4d33df", size = 2066646, upload-time = "2025-12-18T15:46:46.816Z" }, + { url = "https://files.pythonhosted.org/packages/02/6c/cd97a5a776c4515e6ee2ae81c2f2c5be51376dda6c31f965d7746ce0019f/pydantic-1.10.26-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:468d5b9cacfcaadc76ed0a4645354ab6f263ec01a63fb6d05630ea1df6ae453f", size = 2433795, upload-time = "2025-12-18T15:46:49.321Z" }, + { url = "https://files.pythonhosted.org/packages/47/12/de20affa30dcef728fcf9cc98e13ff4438c7a630de8d2f90eb38eba0891c/pydantic-1.10.26-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2c1b0b914be31671000ca25cf7ea17fcaaa68cfeadf6924529c5c5aa24b7ab1f", size = 2227387, upload-time = "2025-12-18T15:46:50.877Z" }, + { url = "https://files.pythonhosted.org/packages/7b/1d/9d65dcc5b8c17ba590f1f9f486e9306346831902318b7ee93f63516f4003/pydantic-1.10.26-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:15b13b9f8ba8867095769e1156e0d7fbafa1f65b898dd40fd1c02e34430973cb", size = 2629594, upload-time = "2025-12-18T15:46:53.42Z" }, + { url = "https://files.pythonhosted.org/packages/3f/76/acb41409356789e23e1a7ef58f93821410c96409183ce314ddb58d97f23e/pydantic-1.10.26-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:ad7025ca324ae263d4313998e25078dcaec5f9ed0392c06dedb57e053cc8086b", size = 2745305, upload-time = "2025-12-18T15:46:55.987Z" }, + { url = "https://files.pythonhosted.org/packages/22/72/a98c0c5e527a66057d969fedd61675223c7975ade61acebbca9f1abd6dc0/pydantic-1.10.26-cp312-cp312-win_amd64.whl", hash = "sha256:4482b299874dabb88a6c3759e3d85c6557c407c3b586891f7d808d8a38b66b9c", size = 1937647, upload-time = "2025-12-18T15:46:57.905Z" }, + { url = "https://files.pythonhosted.org/packages/28/b9/17a5a5a421c23ac27486b977724a42c9d5f8b7f0f4aab054251066223900/pydantic-1.10.26-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:1ae7913bb40a96c87e3d3f6fe4e918ef53bf181583de4e71824360a9b11aef1c", size = 2494599, upload-time = "2025-12-18T15:47:00.209Z" }, + { url = "https://files.pythonhosted.org/packages/e6/8e/6e3bd4241076cf227b443d7577245dd5d181ecf40b3182fcb908bc8c197d/pydantic-1.10.26-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:8154c13f58d4de5d3a856bb6c909c7370f41fb876a5952a503af6b975265f4ba", size = 2254391, upload-time = "2025-12-18T15:47:02.268Z" }, + { url = "https://files.pythonhosted.org/packages/a8/30/a1c4092eda2145ecbead6c92db489b223e101e1ba0da82576d0cf73dd422/pydantic-1.10.26-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:f8af0507bf6118b054a9765fb2e402f18a8b70c964f420d95b525eb711122d62", size = 2609445, upload-time = "2025-12-18T15:47:04.909Z" }, + { url = "https://files.pythonhosted.org/packages/3a/2a/0491f1729ee4b7b6bc859ec22f69752f0c09bee1b66ac6f5f701136f34c3/pydantic-1.10.26-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:dcb5a7318fb43189fde6af6f21ac7149c4bcbcfffc54bc87b5becddc46084847", size = 2732124, upload-time = "2025-12-18T15:47:07.464Z" }, + { url = "https://files.pythonhosted.org/packages/2a/56/b59f3b2f84e1df2b04ae768a1bb04d9f0288ff71b67cdcbb07683757b2c0/pydantic-1.10.26-cp313-cp313-win_amd64.whl", hash = "sha256:71cde228bc0600cf8619f0ee62db050d1880dcc477eba0e90b23011b4ee0f314", size = 1939888, upload-time = "2025-12-18T15:47:09.618Z" }, + { url = "https://files.pythonhosted.org/packages/d2/8b/0c3dc02d4b97790b0f199bf933f677c14e7be4a8d21307c5f2daae06aa41/pydantic-1.10.26-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:6b40730cc81d53d515dc0b8bb5c9b43fadb9bed46de4a3c03bd95e8571616dba", size = 2502689, upload-time = "2025-12-18T15:47:12.308Z" }, + { url = "https://files.pythonhosted.org/packages/d4/9d/d31aeea45542b2ae4b09ecba92b88aaba696b801c31919811aa979a1242d/pydantic-1.10.26-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c3bbb9c0eecdf599e4db9b372fa9cc55be12e80a0d9c6d307950a39050cb0e37", size = 2269494, upload-time = "2025-12-18T15:47:14.53Z" }, + { url = "https://files.pythonhosted.org/packages/78/c1/3a4d069593283ca4dd0006039ba33644e21e432cddc09da706ac50441610/pydantic-1.10.26-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:cc2e3fe7bc4993626ef6b6fa855defafa1d6f8996aa1caef2deb83c5ac4d043a", size = 2620047, upload-time = "2025-12-18T15:47:17.089Z" }, + { url = "https://files.pythonhosted.org/packages/e0/0e/340c3d29197d99c15ab04093d43bb9c9d0fd17c2a34b80cb9d36ed732b09/pydantic-1.10.26-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:36d9e46b588aaeb1dcd2409fa4c467fe0b331f3cc9f227b03a7a00643704e962", size = 2747625, upload-time = "2025-12-18T15:47:19.21Z" }, + { url = "https://files.pythonhosted.org/packages/1e/58/f12ab3727339b172c830b32151919456b67787cdfe8808b2568b322fb15c/pydantic-1.10.26-cp314-cp314-win_amd64.whl", hash = "sha256:81ce3c8616d12a7be31b4aadfd3434f78f6b44b75adbfaec2fe1ad4f7f999b8c", size = 1976436, upload-time = "2025-12-18T15:47:21.384Z" }, + { url = "https://files.pythonhosted.org/packages/e1/8a/3a5a6267d5f03617b5c0f1985aa9fdfbafd33a50ef6dadd866a15ed4d123/pydantic-1.10.26-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:502b9d30d18a2dfaf81b7302f6ba0e5853474b1c96212449eb4db912cb604b7d", size = 2457039, upload-time = "2025-12-18T15:47:34.584Z" }, + { url = "https://files.pythonhosted.org/packages/f3/fa/343ac0db26918a033ac6256c036d72c3b6eb1196b7de622e2e8a94b19079/pydantic-1.10.26-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0d8f6087bf697dec3bf7ffcd7fe8362674f16519f3151789f33cbe8f1d19fc15", size = 2266441, upload-time = "2025-12-18T15:47:36.807Z" }, + { url = "https://files.pythonhosted.org/packages/fc/36/1ab48136578608dba2f2a62e452f3db2083b474d4e49be5749c6ae0c123c/pydantic-1.10.26-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:dd40a99c358419910c85e6f5d22f9c56684c25b5e7abc40879b3b4a52f34ae90", size = 2869383, upload-time = "2025-12-18T15:47:38.883Z" }, + { url = "https://files.pythonhosted.org/packages/a2/25/41dbf1bffc31eb242cece8080561a4133eaeb513372dec36a84477a3fb71/pydantic-1.10.26-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:ce3293b86ca9f4125df02ff0a70be91bc7946522467cbd98e7f1493f340616ba", size = 2963582, upload-time = "2025-12-18T15:47:40.854Z" }, + { url = "https://files.pythonhosted.org/packages/61/2f/f072ae160a300c85eb9f059915101fd33dacf12d8df08c2b804acb3b95d1/pydantic-1.10.26-cp39-cp39-win_amd64.whl", hash = "sha256:1a4e3062b71ab1d5df339ba12c48f9ed5817c5de6cb92a961dd5c64bb32e7b96", size = 2075530, upload-time = "2025-12-18T15:47:43.181Z" }, + { url = "https://files.pythonhosted.org/packages/1f/98/556e82f00b98486def0b8af85da95e69d2be7e367cf2431408e108bc3095/pydantic-1.10.26-py3-none-any.whl", hash = "sha256:c43ad70dc3ce7787543d563792426a16fd7895e14be4b194b5665e36459dd917", size = 166975, upload-time = "2025-12-18T15:47:44.927Z" }, ] [[package]] @@ -1182,7 +1177,7 @@ wheels = [ [[package]] name = "pytest" -version = "9.0.1" +version = "9.0.2" source = { registry = "https://pypi.org/simple" } resolution-markers = [ "python_full_version >= '3.14' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2'", @@ -1199,9 +1194,9 @@ dependencies = [ { name = "pygments", marker = "python_full_version >= '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, { name = "tomli", marker = "python_full_version == '3.10.*' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/07/56/f013048ac4bc4c1d9be45afd4ab209ea62822fb1598f40687e6bf45dcea4/pytest-9.0.1.tar.gz", hash = "sha256:3e9c069ea73583e255c3b21cf46b8d3c56f6e3a1a8f6da94ccb0fcf57b9d73c8", size = 1564125, upload-time = "2025-11-12T13:05:09.333Z" } +sdist = { url = "https://files.pythonhosted.org/packages/d1/db/7ef3487e0fb0049ddb5ce41d3a49c235bf9ad299b6a25d5780a89f19230f/pytest-9.0.2.tar.gz", hash = "sha256:75186651a92bd89611d1d9fc20f0b4345fd827c41ccd5c299a868a05d70edf11", size = 1568901, upload-time = "2025-12-06T21:30:51.014Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/0b/8b/6300fb80f858cda1c51ffa17075df5d846757081d11ab4aa35cef9e6258b/pytest-9.0.1-py3-none-any.whl", hash = "sha256:67be0030d194df2dfa7b556f2e56fb3c3315bd5c8822c6951162b92b32ce7dad", size = 373668, upload-time = "2025-11-12T13:05:07.379Z" }, + { url = "https://files.pythonhosted.org/packages/3b/ab/b3226f0bd7cdcf710fbede2b3548584366da3b19b5021e74f5bde2a8fa3f/pytest-9.0.2-py3-none-any.whl", hash = "sha256:711ffd45bf766d5264d487b917733b453d917afd2b0ad65223959f59089f875b", size = 374801, upload-time = "2025-12-06T21:30:49.154Z" }, ] [[package]] @@ -1233,7 +1228,7 @@ resolution-markers = [ ] dependencies = [ { name = "backports-asyncio-runner", marker = "python_full_version == '3.10.*' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "pytest", version = "9.0.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pytest", version = "9.0.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, { name = "typing-extensions", marker = "(python_full_version >= '3.10' and python_full_version < '3.13') or (python_full_version < '3.10' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2') or (python_full_version >= '3.13' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, ] sdist = { url = "https://files.pythonhosted.org/packages/90/2c/8af215c0f776415f3590cac4f9086ccefd6fd463befeae41cd4d3f193e5a/pytest_asyncio-1.3.0.tar.gz", hash = "sha256:d7f52f36d231b80ee124cd216ffb19369aa168fc10095013c6b014a34d3ee9e5", size = 50087, upload-time = "2025-11-10T16:07:47.256Z" } @@ -1248,7 +1243,7 @@ source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "execnet" }, { name = "pytest", version = "8.4.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "pytest", version = "9.0.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pytest", version = "9.0.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, ] sdist = { url = "https://files.pythonhosted.org/packages/78/b4/439b179d1ff526791eb921115fca8e44e596a13efeda518b9d845a619450/pytest_xdist-3.8.0.tar.gz", hash = "sha256:7e578125ec9bc6050861aa93f2d59f1d8d085595d6551c2c90b6f4fad8d3a9f1", size = 88069, upload-time = "2025-07-01T13:30:59.346Z" } wheels = [ @@ -1295,28 +1290,28 @@ wheels = [ [[package]] name = "ruff" -version = "0.14.7" +version = "0.14.13" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/b7/5b/dd7406afa6c95e3d8fa9d652b6d6dd17dd4a6bf63cb477014e8ccd3dcd46/ruff-0.14.7.tar.gz", hash = "sha256:3417deb75d23bd14a722b57b0a1435561db65f0ad97435b4cf9f85ffcef34ae5", size = 5727324, upload-time = "2025-11-28T20:55:10.525Z" } +sdist = { url = "https://files.pythonhosted.org/packages/50/0a/1914efb7903174b381ee2ffeebb4253e729de57f114e63595114c8ca451f/ruff-0.14.13.tar.gz", hash = "sha256:83cd6c0763190784b99650a20fec7633c59f6ebe41c5cc9d45ee42749563ad47", size = 6059504, upload-time = "2026-01-15T20:15:16.918Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/8c/b1/7ea5647aaf90106f6d102230e5df874613da43d1089864da1553b899ba5e/ruff-0.14.7-py3-none-linux_armv6l.whl", hash = "sha256:b9d5cb5a176c7236892ad7224bc1e63902e4842c460a0b5210701b13e3de4fca", size = 13414475, upload-time = "2025-11-28T20:54:54.569Z" }, - { url = "https://files.pythonhosted.org/packages/af/19/fddb4cd532299db9cdaf0efdc20f5c573ce9952a11cb532d3b859d6d9871/ruff-0.14.7-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:3f64fe375aefaf36ca7d7250292141e39b4cea8250427482ae779a2aa5d90015", size = 13634613, upload-time = "2025-11-28T20:55:17.54Z" }, - { url = "https://files.pythonhosted.org/packages/40/2b/469a66e821d4f3de0440676ed3e04b8e2a1dc7575cf6fa3ba6d55e3c8557/ruff-0.14.7-py3-none-macosx_11_0_arm64.whl", hash = "sha256:93e83bd3a9e1a3bda64cb771c0d47cda0e0d148165013ae2d3554d718632d554", size = 12765458, upload-time = "2025-11-28T20:55:26.128Z" }, - { url = "https://files.pythonhosted.org/packages/f1/05/0b001f734fe550bcfde4ce845948ac620ff908ab7241a39a1b39bb3c5f49/ruff-0.14.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3838948e3facc59a6070795de2ae16e5786861850f78d5914a03f12659e88f94", size = 13236412, upload-time = "2025-11-28T20:55:28.602Z" }, - { url = "https://files.pythonhosted.org/packages/11/36/8ed15d243f011b4e5da75cd56d6131c6766f55334d14ba31cce5461f28aa/ruff-0.14.7-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:24c8487194d38b6d71cd0fd17a5b6715cda29f59baca1defe1e3a03240f851d1", size = 13182949, upload-time = "2025-11-28T20:55:33.265Z" }, - { url = "https://files.pythonhosted.org/packages/3b/cf/fcb0b5a195455729834f2a6eadfe2e4519d8ca08c74f6d2b564a4f18f553/ruff-0.14.7-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:79c73db6833f058a4be8ffe4a0913b6d4ad41f6324745179bd2aa09275b01d0b", size = 13816470, upload-time = "2025-11-28T20:55:08.203Z" }, - { url = "https://files.pythonhosted.org/packages/7f/5d/34a4748577ff7a5ed2f2471456740f02e86d1568a18c9faccfc73bd9ca3f/ruff-0.14.7-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:12eb7014fccff10fc62d15c79d8a6be4d0c2d60fe3f8e4d169a0d2def75f5dad", size = 15289621, upload-time = "2025-11-28T20:55:30.837Z" }, - { url = "https://files.pythonhosted.org/packages/53/53/0a9385f047a858ba133d96f3f8e3c9c66a31cc7c4b445368ef88ebeac209/ruff-0.14.7-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6c623bbdc902de7ff715a93fa3bb377a4e42dd696937bf95669118773dbf0c50", size = 14975817, upload-time = "2025-11-28T20:55:24.107Z" }, - { url = "https://files.pythonhosted.org/packages/a8/d7/2f1c32af54c3b46e7fadbf8006d8b9bcfbea535c316b0bd8813d6fb25e5d/ruff-0.14.7-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f53accc02ed2d200fa621593cdb3c1ae06aa9b2c3cae70bc96f72f0000ae97a9", size = 14284549, upload-time = "2025-11-28T20:55:06.08Z" }, - { url = "https://files.pythonhosted.org/packages/92/05/434ddd86becd64629c25fb6b4ce7637dd52a45cc4a4415a3008fe61c27b9/ruff-0.14.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:281f0e61a23fcdcffca210591f0f53aafaa15f9025b5b3f9706879aaa8683bc4", size = 14071389, upload-time = "2025-11-28T20:55:35.617Z" }, - { url = "https://files.pythonhosted.org/packages/ff/50/fdf89d4d80f7f9d4f420d26089a79b3bb1538fe44586b148451bc2ba8d9c/ruff-0.14.7-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:dbbaa5e14148965b91cb090236931182ee522a5fac9bc5575bafc5c07b9f9682", size = 14202679, upload-time = "2025-11-28T20:55:01.472Z" }, - { url = "https://files.pythonhosted.org/packages/77/54/87b34988984555425ce967f08a36df0ebd339bb5d9d0e92a47e41151eafc/ruff-0.14.7-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:1464b6e54880c0fe2f2d6eaefb6db15373331414eddf89d6b903767ae2458143", size = 13147677, upload-time = "2025-11-28T20:55:19.933Z" }, - { url = "https://files.pythonhosted.org/packages/67/29/f55e4d44edfe053918a16a3299e758e1c18eef216b7a7092550d7a9ec51c/ruff-0.14.7-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:f217ed871e4621ea6128460df57b19ce0580606c23aeab50f5de425d05226784", size = 13151392, upload-time = "2025-11-28T20:55:21.967Z" }, - { url = "https://files.pythonhosted.org/packages/36/69/47aae6dbd4f1d9b4f7085f4d9dcc84e04561ee7ad067bf52e0f9b02e3209/ruff-0.14.7-py3-none-musllinux_1_2_i686.whl", hash = "sha256:6be02e849440ed3602d2eb478ff7ff07d53e3758f7948a2a598829660988619e", size = 13412230, upload-time = "2025-11-28T20:55:12.749Z" }, - { url = "https://files.pythonhosted.org/packages/b7/4b/6e96cb6ba297f2ba502a231cd732ed7c3de98b1a896671b932a5eefa3804/ruff-0.14.7-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:19a0f116ee5e2b468dfe80c41c84e2bbd6b74f7b719bee86c2ecde0a34563bcc", size = 14195397, upload-time = "2025-11-28T20:54:56.896Z" }, - { url = "https://files.pythonhosted.org/packages/69/82/251d5f1aa4dcad30aed491b4657cecd9fb4274214da6960ffec144c260f7/ruff-0.14.7-py3-none-win32.whl", hash = "sha256:e33052c9199b347c8937937163b9b149ef6ab2e4bb37b042e593da2e6f6cccfa", size = 13126751, upload-time = "2025-11-28T20:55:03.47Z" }, - { url = "https://files.pythonhosted.org/packages/a8/b5/d0b7d145963136b564806f6584647af45ab98946660d399ec4da79cae036/ruff-0.14.7-py3-none-win_amd64.whl", hash = "sha256:e17a20ad0d3fad47a326d773a042b924d3ac31c6ca6deb6c72e9e6b5f661a7c6", size = 14531726, upload-time = "2025-11-28T20:54:59.121Z" }, - { url = "https://files.pythonhosted.org/packages/1d/d2/1637f4360ada6a368d3265bf39f2cf737a0aaab15ab520fc005903e883f8/ruff-0.14.7-py3-none-win_arm64.whl", hash = "sha256:be4d653d3bea1b19742fcc6502354e32f65cd61ff2fbdb365803ef2c2aec6228", size = 13609215, upload-time = "2025-11-28T20:55:15.375Z" }, + { url = "https://files.pythonhosted.org/packages/c3/ae/0deefbc65ca74b0ab1fd3917f94dc3b398233346a74b8bbb0a916a1a6bf6/ruff-0.14.13-py3-none-linux_armv6l.whl", hash = "sha256:76f62c62cd37c276cb03a275b198c7c15bd1d60c989f944db08a8c1c2dbec18b", size = 13062418, upload-time = "2026-01-15T20:14:50.779Z" }, + { url = "https://files.pythonhosted.org/packages/47/df/5916604faa530a97a3c154c62a81cb6b735c0cb05d1e26d5ad0f0c8ac48a/ruff-0.14.13-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:914a8023ece0528d5cc33f5a684f5f38199bbb566a04815c2c211d8f40b5d0ed", size = 13442344, upload-time = "2026-01-15T20:15:07.94Z" }, + { url = "https://files.pythonhosted.org/packages/4c/f3/e0e694dd69163c3a1671e102aa574a50357536f18a33375050334d5cd517/ruff-0.14.13-py3-none-macosx_11_0_arm64.whl", hash = "sha256:d24899478c35ebfa730597a4a775d430ad0d5631b8647a3ab368c29b7e7bd063", size = 12354720, upload-time = "2026-01-15T20:15:09.854Z" }, + { url = "https://files.pythonhosted.org/packages/c3/e8/67f5fcbbaee25e8fc3b56cc33e9892eca7ffe09f773c8e5907757a7e3bdb/ruff-0.14.13-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9aaf3870f14d925bbaf18b8a2347ee0ae7d95a2e490e4d4aea6813ed15ebc80e", size = 12774493, upload-time = "2026-01-15T20:15:20.908Z" }, + { url = "https://files.pythonhosted.org/packages/6b/ce/d2e9cb510870b52a9565d885c0d7668cc050e30fa2c8ac3fb1fda15c083d/ruff-0.14.13-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ac5b7f63dd3b27cc811850f5ffd8fff845b00ad70e60b043aabf8d6ecc304e09", size = 12815174, upload-time = "2026-01-15T20:15:05.74Z" }, + { url = "https://files.pythonhosted.org/packages/88/00/c38e5da58beebcf4fa32d0ddd993b63dfacefd02ab7922614231330845bf/ruff-0.14.13-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:78d2b1097750d90ba82ce4ba676e85230a0ed694178ca5e61aa9b459970b3eb9", size = 13680909, upload-time = "2026-01-15T20:15:14.537Z" }, + { url = "https://files.pythonhosted.org/packages/61/61/cd37c9dd5bd0a3099ba79b2a5899ad417d8f3b04038810b0501a80814fd7/ruff-0.14.13-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:7d0bf87705acbbcb8d4c24b2d77fbb73d40210a95c3903b443cd9e30824a5032", size = 15144215, upload-time = "2026-01-15T20:15:22.886Z" }, + { url = "https://files.pythonhosted.org/packages/56/8a/85502d7edbf98c2df7b8876f316c0157359165e16cdf98507c65c8d07d3d/ruff-0.14.13-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a3eb5da8e2c9e9f13431032fdcbe7681de9ceda5835efee3269417c13f1fed5c", size = 14706067, upload-time = "2026-01-15T20:14:48.271Z" }, + { url = "https://files.pythonhosted.org/packages/7e/2f/de0df127feb2ee8c1e54354dc1179b4a23798f0866019528c938ba439aca/ruff-0.14.13-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:642442b42957093811cd8d2140dfadd19c7417030a7a68cf8d51fcdd5f217427", size = 14133916, upload-time = "2026-01-15T20:14:57.357Z" }, + { url = "https://files.pythonhosted.org/packages/0d/77/9b99686bb9fe07a757c82f6f95e555c7a47801a9305576a9c67e0a31d280/ruff-0.14.13-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4acdf009f32b46f6e8864af19cbf6841eaaed8638e65c8dac845aea0d703c841", size = 13859207, upload-time = "2026-01-15T20:14:55.111Z" }, + { url = "https://files.pythonhosted.org/packages/7d/46/2bdcb34a87a179a4d23022d818c1c236cb40e477faf0d7c9afb6813e5876/ruff-0.14.13-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:591a7f68860ea4e003917d19b5c4f5ac39ff558f162dc753a2c5de897fd5502c", size = 14043686, upload-time = "2026-01-15T20:14:52.841Z" }, + { url = "https://files.pythonhosted.org/packages/1a/a9/5c6a4f56a0512c691cf143371bcf60505ed0f0860f24a85da8bd123b2bf1/ruff-0.14.13-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:774c77e841cc6e046fc3e91623ce0903d1cd07e3a36b1a9fe79b81dab3de506b", size = 12663837, upload-time = "2026-01-15T20:15:18.921Z" }, + { url = "https://files.pythonhosted.org/packages/fe/bb/b920016ece7651fa7fcd335d9d199306665486694d4361547ccb19394c44/ruff-0.14.13-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:61f4e40077a1248436772bb6512db5fc4457fe4c49e7a94ea7c5088655dd21ae", size = 12805867, upload-time = "2026-01-15T20:14:59.272Z" }, + { url = "https://files.pythonhosted.org/packages/7d/b3/0bd909851e5696cd21e32a8fc25727e5f58f1934b3596975503e6e85415c/ruff-0.14.13-py3-none-musllinux_1_2_i686.whl", hash = "sha256:6d02f1428357fae9e98ac7aa94b7e966fd24151088510d32cf6f902d6c09235e", size = 13208528, upload-time = "2026-01-15T20:15:03.732Z" }, + { url = "https://files.pythonhosted.org/packages/3b/3b/e2d94cb613f6bbd5155a75cbe072813756363eba46a3f2177a1fcd0cd670/ruff-0.14.13-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:e399341472ce15237be0c0ae5fbceca4b04cd9bebab1a2b2c979e015455d8f0c", size = 13929242, upload-time = "2026-01-15T20:15:11.918Z" }, + { url = "https://files.pythonhosted.org/packages/6a/c5/abd840d4132fd51a12f594934af5eba1d5d27298a6f5b5d6c3be45301caf/ruff-0.14.13-py3-none-win32.whl", hash = "sha256:ef720f529aec113968b45dfdb838ac8934e519711da53a0456038a0efecbd680", size = 12919024, upload-time = "2026-01-15T20:14:43.647Z" }, + { url = "https://files.pythonhosted.org/packages/c2/55/6384b0b8ce731b6e2ade2b5449bf07c0e4c31e8a2e68ea65b3bafadcecc5/ruff-0.14.13-py3-none-win_amd64.whl", hash = "sha256:6070bd026e409734b9257e03e3ef18c6e1a216f0435c6751d7a8ec69cb59abef", size = 14097887, upload-time = "2026-01-15T20:15:01.48Z" }, + { url = "https://files.pythonhosted.org/packages/4d/e1/7348090988095e4e39560cfc2f7555b1b2a7357deba19167b600fdf5215d/ruff-0.14.13-py3-none-win_arm64.whl", hash = "sha256:7ab819e14f1ad9fe39f246cfcc435880ef7a9390d81a2b6ac7e01039083dd247", size = 13080224, upload-time = "2026-01-15T20:14:45.853Z" }, ] [[package]] @@ -1327,7 +1322,7 @@ dependencies = [ { name = "anyio" }, { name = "distro" }, { name = "httpx" }, - { name = "pydantic", version = "1.10.24", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'group-18-runloop-api-client-pydantic-v1'" }, + { name = "pydantic", version = "1.10.26", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'group-18-runloop-api-client-pydantic-v1'" }, { name = "pydantic", version = "2.12.5", source = { registry = "https://pypi.org/simple" }, marker = "extra == 'group-18-runloop-api-client-pydantic-v2' or extra != 'group-18-runloop-api-client-pydantic-v1'" }, { name = "sniffio" }, { name = "typing-extensions" }, @@ -1346,7 +1341,7 @@ dev = [ { name = "mypy" }, { name = "pyright" }, { name = "pytest", version = "8.4.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "pytest", version = "9.0.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "pytest", version = "9.0.2", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, { name = "pytest-asyncio", version = "1.2.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, { name = "pytest-asyncio", version = "1.3.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, { name = "pytest-xdist" }, @@ -1354,10 +1349,10 @@ dev = [ { name = "rich" }, { name = "ruff" }, { name = "time-machine", version = "2.19.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, - { name = "time-machine", version = "3.1.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, + { name = "time-machine", version = "3.2.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.10' or (extra == 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2')" }, ] pydantic-v1 = [ - { name = "pydantic", version = "1.10.24", source = { registry = "https://pypi.org/simple" } }, + { name = "pydantic", version = "1.10.26", source = { registry = "https://pypi.org/simple" } }, ] pydantic-v2 = [ { name = "pydantic", version = "2.12.5", source = { registry = "https://pypi.org/simple" } }, @@ -1518,7 +1513,7 @@ wheels = [ [[package]] name = "time-machine" -version = "3.1.0" +version = "3.2.0" source = { registry = "https://pypi.org/simple" } resolution-markers = [ "python_full_version >= '3.14' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra == 'group-18-runloop-api-client-pydantic-v2'", @@ -1526,134 +1521,139 @@ resolution-markers = [ "python_full_version >= '3.10' and extra == 'group-18-runloop-api-client-pydantic-v1' and extra != 'group-18-runloop-api-client-pydantic-v2'", "python_full_version >= '3.10' and extra != 'group-18-runloop-api-client-pydantic-v1' and extra != 'group-18-runloop-api-client-pydantic-v2'", ] -sdist = { url = "https://files.pythonhosted.org/packages/17/bd/a1bb03eb39ce35c966f0dde6559df7348ca0580f7cd3a956fdd7ed0b5080/time_machine-3.1.0.tar.gz", hash = "sha256:90831c2cf9e18e4199abb85fafa0c0ca0c6c15d0894a03ef68d5005a796c4f27", size = 14436, upload-time = "2025-11-21T13:56:33.802Z" } +sdist = { url = "https://files.pythonhosted.org/packages/02/fc/37b02f6094dbb1f851145330460532176ed2f1dc70511a35828166c41e52/time_machine-3.2.0.tar.gz", hash = "sha256:a4ddd1cea17b8950e462d1805a42b20c81eb9aafc8f66b392dd5ce997e037d79", size = 14804, upload-time = "2025-12-17T23:33:02.599Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/0a/c9/0aaa082d6b5c489c22d9db025cbf17016062e953f70a7678d76b520f274f/time_machine-3.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e867178cc87490c578534832c29f048cc954b32a01681237e52ccda704baece5", size = 19046, upload-time = "2025-11-21T13:54:53.273Z" }, - { url = "https://files.pythonhosted.org/packages/30/0d/e825251028c68822a63478c7e44a0dca640daedb15f685a9a3973edf8ae8/time_machine-3.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5d4d4b944e0197c7726844f452fcb3dc17991165e9b4fab779e505b095bb7363", size = 15027, upload-time = "2025-11-21T13:54:54.474Z" }, - { url = "https://files.pythonhosted.org/packages/01/ee/d1e041f85787b835ed70bc7c31000a03d197f831490304f2527e9b840507/time_machine-3.1.0-cp310-cp310-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:9fc81014e6fc989b833e8cae3684b78b1e1f7c0d867c2fbfea785385a806ea6b", size = 32548, upload-time = "2025-11-21T13:54:55.868Z" }, - { url = "https://files.pythonhosted.org/packages/50/c0/12fc339c054e0db1da79c476bb1c3cc0b8796789e90eb8687af96bbdde9b/time_machine-3.1.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:aebd2a55f860b1ef28a2c1efe81454a6fa110ec1a6517c011760132f3cbf35fa", size = 34150, upload-time = "2025-11-21T13:54:56.955Z" }, - { url = "https://files.pythonhosted.org/packages/84/ab/40a2d31d4f742e41fc7f3703da672bbc25b505df3e7ab5df6c11a39e435e/time_machine-3.1.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:02e8018629e12e8064fee4f8fbbb8ae353f5907051965b5721ef189aeb7f833c", size = 35694, upload-time = "2025-11-21T13:54:58.053Z" }, - { url = "https://files.pythonhosted.org/packages/6f/1f/f31b604cb72af2c89311e8152bfe4e64a890785daeb19939bb841ed4cb77/time_machine-3.1.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:2fbbcf9de9a1d3e94e8b6c41ac7e9da46948fbdf489dbc083ea6c28ed045a43a", size = 34500, upload-time = "2025-11-21T13:54:59.428Z" }, - { url = "https://files.pythonhosted.org/packages/4f/1d/dca59c5d54dd0777b342fa708ffb24e0c595b8c47106300bc154dbaa8d98/time_machine-3.1.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:358f0feead47ee74c7747cb5b7f73582cbde1c033c20f9350e58ab4389aa59ff", size = 32605, upload-time = "2025-11-21T13:55:00.877Z" }, - { url = "https://files.pythonhosted.org/packages/f0/af/033b7b29c9364f05e99b4f35152574edc21b2f038589dafd60a60945a017/time_machine-3.1.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:f6d3f9e531127306610433fe62368b9e14621e336da2042d062565d655d97a02", size = 33699, upload-time = "2025-11-21T13:55:02.287Z" }, - { url = "https://files.pythonhosted.org/packages/4e/92/782c75e9f958e2cb33ba30f9a7adeb819811626eb3193e5ade4343ef197d/time_machine-3.1.0-cp310-cp310-win32.whl", hash = "sha256:bd4b4279938472ea18e5580330c10f8d49b8aec34e0df71be46e3be3b0f03f1d", size = 17054, upload-time = "2025-11-21T13:55:04.036Z" }, - { url = "https://files.pythonhosted.org/packages/ce/e6/cbdb32a72d2e122646cd3c62aed47dcddb366196798caa39043985d4e11d/time_machine-3.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:10a0d18b65af008e1cb60e0cc57594e67d3bbfee07204879f0e5864223dfd899", size = 17898, upload-time = "2025-11-21T13:55:05.069Z" }, - { url = "https://files.pythonhosted.org/packages/1f/d2/3663703fc694b07241673391c267629f881d4c025c392d7df09161031ac7/time_machine-3.1.0-cp310-cp310-win_arm64.whl", hash = "sha256:53702d6e594fc395b66517bc75c3d2ad8bfbff1f693d09bb67f8178cdfd21cd5", size = 16630, upload-time = "2025-11-21T13:55:06.178Z" }, - { url = "https://files.pythonhosted.org/packages/67/2b/9f5cea745e6c704cbbd1b6c36e0c73ca3204160e9c79234d66f140b326f6/time_machine-3.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:3b205f91d3907f6bd1747fe5484a3ed931e121e51fec32e4d6a8ee6eb41c37c3", size = 18741, upload-time = "2025-11-21T13:55:07.288Z" }, - { url = "https://files.pythonhosted.org/packages/76/17/7b5d94a119883b56b446980387e8ab83f37037db01696cf236cbc85807dc/time_machine-3.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:7004f2fd396b6d40cbf7c21df82f838445d899a3ed2ecc5b1fb67eea7e3d2fa8", size = 14865, upload-time = "2025-11-21T13:55:08.304Z" }, - { url = "https://files.pythonhosted.org/packages/2c/1e/a6ff6587d520ac20bf7414faf8f53cf094dd9fe450acf3b0c85e0b332c8a/time_machine-3.1.0-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:68c35b3450c27cf0087c90ae872ab41ec8097b76b5fb6b07321fc5873e78f152", size = 30643, upload-time = "2025-11-21T13:55:09.8Z" }, - { url = "https://files.pythonhosted.org/packages/45/50/dcf4272d7f9a4690d9edd983b5690efa8df3cc7671ade9bcf3439adac278/time_machine-3.1.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:2e28aed9da0182c10cb0344aa06fac585f394768c7d088bee781ad2779ea6fe0", size = 32226, upload-time = "2025-11-21T13:55:10.927Z" }, - { url = "https://files.pythonhosted.org/packages/dc/7c/b719ae736568b3f2c9bf8d3bc65bada96b04c9241c628fcb5ab0724a6928/time_machine-3.1.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9d7faced22388578dbed3b4be0603eb00f709857cd57b7b9738cd81fbaf326a9", size = 33883, upload-time = "2025-11-21T13:55:12.32Z" }, - { url = "https://files.pythonhosted.org/packages/e5/5c/f433fe44eadecfe21e4f2bf128d240c15d295592c877490a475960644281/time_machine-3.1.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:2e8a78dd7afc3a081e208e0b8d1a8105cff95d96e4f79da746afdf05fb822e7a", size = 32769, upload-time = "2025-11-21T13:55:13.541Z" }, - { url = "https://files.pythonhosted.org/packages/09/0f/fbc0e1437801315d4bdd8c21f9ef0c51f005a327ab0289ca034658fe78a1/time_machine-3.1.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:8b9dce925dae420d6b66dec4cae00785260dbededec5c89eaedbfba99a2be55b", size = 30765, upload-time = "2025-11-21T13:55:14.706Z" }, - { url = "https://files.pythonhosted.org/packages/3f/c0/87d23d5817d95ed07fe272bb7a5de91177bb18274718d318c73a4aa0a4c2/time_machine-3.1.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:17f0d30a05073cdee68162779870eadf5e7f091bc94ae96d90d8fddbb8020714", size = 31885, upload-time = "2025-11-21T13:55:16.56Z" }, - { url = "https://files.pythonhosted.org/packages/4f/d7/572e38dadab9efe6ec4fff6e063f488866121dc384873d5b04fc5855ca83/time_machine-3.1.0-cp311-cp311-win32.whl", hash = "sha256:9e836e4fa8cb58de80de863335f4566f896b4dcd69d8a400d705857ca8301872", size = 16935, upload-time = "2025-11-21T13:55:17.612Z" }, - { url = "https://files.pythonhosted.org/packages/00/a6/edc968e1429a14d28676adb596f42570aa42def63014ccd3ccaf8d279d43/time_machine-3.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:1d652f85cbd2fd41e4262c27515023cc216589ca0b4aebab458972cce8119cc1", size = 17779, upload-time = "2025-11-21T13:55:18.668Z" }, - { url = "https://files.pythonhosted.org/packages/a0/97/2025eea7792f1be50777d85a2e2974d4416698c0002c419a61fcc6222de8/time_machine-3.1.0-cp311-cp311-win_arm64.whl", hash = "sha256:4be520b8ed752e788f57f72617f12b5bf5103e3db2b062e69b82e7f7f2977c4f", size = 16496, upload-time = "2025-11-21T13:55:19.753Z" }, - { url = "https://files.pythonhosted.org/packages/39/3d/412015d3e2f682548b7222367aa8d7b91d323145234d216847bc56c2d720/time_machine-3.1.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:d3d6606ae81a29c925452f8b56115936aeda34c0a25d40af53cf1b29c66235ef", size = 18851, upload-time = "2025-11-21T13:55:21Z" }, - { url = "https://files.pythonhosted.org/packages/33/98/48f60552570d6d66773dcfbc1d7b8fb305d3e9ae0694dd249f1ae0bc3b77/time_machine-3.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:0265df307778104c44d9114b55246a5b99da03f1dcb791305f9af21b0389ef7b", size = 14955, upload-time = "2025-11-21T13:55:22.408Z" }, - { url = "https://files.pythonhosted.org/packages/4d/7a/6fd1c47d3a1d87919d38f85c12db8f838298acb4ca3d6908f3288bcea0fd/time_machine-3.1.0-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:098da08900bdf6c6bd44b36ec06afd5b92c7a7140cd48c8686a79b6c6fef9da7", size = 32622, upload-time = "2025-11-21T13:55:23.541Z" }, - { url = "https://files.pythonhosted.org/packages/64/74/01641bd3d5f8c4f22710b7070d1dbeaeb501e8549e37419fc8b995bead32/time_machine-3.1.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:092f2e7a2526a02fcbd9c0a4165e0790350a13da4b01b6306b82e9580d83ae69", size = 34172, upload-time = "2025-11-21T13:55:24.638Z" }, - { url = "https://files.pythonhosted.org/packages/35/df/91f39b8bfe42c67dd3e66d8d2baa2c1b10126cc6e217fb3c7b1e777804c5/time_machine-3.1.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b64b6cada6dd2433cdaeda53dd940bdd579e40a8c92c5379527694570bb58b97", size = 35554, upload-time = "2025-11-21T13:55:25.841Z" }, - { url = "https://files.pythonhosted.org/packages/b0/6c/236434de77561003429e90300327b5ac6a6eeaa6d6c967282d28d1983232/time_machine-3.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2776e3300ef499541f9081b4a03ff1b3e7681e51a594572e1bf191773504bd21", size = 34261, upload-time = "2025-11-21T13:55:27.715Z" }, - { url = "https://files.pythonhosted.org/packages/97/76/32eea75715aefbd7ccfeea70285bb5400ecebd8dc3524b9c3491115e2504/time_machine-3.1.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:86e10914592a95e35edeb081975b6527919300bd1b65c04ee7f765db7bf2c1ad", size = 32485, upload-time = "2025-11-21T13:55:29.55Z" }, - { url = "https://files.pythonhosted.org/packages/b0/1b/91c529de2d2c6d7097692b4ae620cbe30bf24a4609d737b5f41d91a77bb0/time_machine-3.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c1362a6672252fb0d79da492dcf75eb7369b37fe595946ee3c2848df2fcc22e7", size = 33674, upload-time = "2025-11-21T13:55:30.636Z" }, - { url = "https://files.pythonhosted.org/packages/d6/af/345dfab6543e79151867daabbc4f4788ee10e408b8bd1361d066d0fea932/time_machine-3.1.0-cp312-cp312-win32.whl", hash = "sha256:50773648c69960e6e8497077875427aeb484d6a57a06399502cc125e349fca19", size = 16962, upload-time = "2025-11-21T13:55:31.73Z" }, - { url = "https://files.pythonhosted.org/packages/7c/9d/79a4ebed58d78cad85a5fc5c4ed4558d4d018d8a2bb7858ea02704b49be7/time_machine-3.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:20e0974e58a40a626d353d6132b7595de3fcb8deb72da4a762071b315cc95f6f", size = 17723, upload-time = "2025-11-21T13:55:32.76Z" }, - { url = "https://files.pythonhosted.org/packages/9a/a2/dd405133427dc47afd95618c3519854147408ed05deb209ba1b6b704689b/time_machine-3.1.0-cp312-cp312-win_arm64.whl", hash = "sha256:da9bced71b5966312f13c423b5b124649f1b08a9400d95018eb6d23311b384b9", size = 16520, upload-time = "2025-11-21T13:55:33.972Z" }, - { url = "https://files.pythonhosted.org/packages/c7/27/8af0187b4f7c574d7c4d7e86dbaece47ac92666fda8717c787849bc48560/time_machine-3.1.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:99d91fc0d4d91be1e1ea92389e1e93b0f43bf60433409616cb43de69be6505a8", size = 18911, upload-time = "2025-11-21T13:55:35.056Z" }, - { url = "https://files.pythonhosted.org/packages/92/35/a948a07659d471be160c8500c2e82ca0576a067d52d86ebe7ef24ea8e141/time_machine-3.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:ff18d291b7e681af3dc2f069a182a367baee510ab9800120a487a01d2ec929a9", size = 14983, upload-time = "2025-11-21T13:55:36.414Z" }, - { url = "https://files.pythonhosted.org/packages/4a/8c/0cc16dd1d058580c00ffa685401756bd6170efe4434d418b724e96e3a0ac/time_machine-3.1.0-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:8fedc78cab733dfe1afeec09bd841aea314249b316eb02f17ad2e617c400fa4d", size = 32709, upload-time = "2025-11-21T13:55:37.628Z" }, - { url = "https://files.pythonhosted.org/packages/20/34/f2f162c67854be20c34ed9c49474b6abd6427108b98c3452533e60ba2526/time_machine-3.1.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:62bb78376c4a13a0463b71bc9ffd81d9e3e6ed9efdbe500716d9c51ae5a2a60c", size = 34299, upload-time = "2025-11-21T13:55:38.999Z" }, - { url = "https://files.pythonhosted.org/packages/8b/2c/314fe33e24bbc46837643d5add7a9843c7cbd4b66f355a94e98c700ddcac/time_machine-3.1.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bc750d300bd8794a0581360632e20dd5896d21b5c1c6b74c7c01c72bebd65df2", size = 35699, upload-time = "2025-11-21T13:55:40.493Z" }, - { url = "https://files.pythonhosted.org/packages/ac/28/c2f5d93024ef712897352e3fb801425325adfb3b2c33d3ba7838c8ea5941/time_machine-3.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:d23623c3223318cb4b43ad07e10b682821c59b6ab99cce3d9db0f80bc2206ead", size = 34359, upload-time = "2025-11-21T13:55:41.672Z" }, - { url = "https://files.pythonhosted.org/packages/25/c6/67a6abd6ab75a6c16275cd8b5bf13053f33fac1de83a5b8e569685d37005/time_machine-3.1.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:48a4ad44202dcafd302310739e086374c8e928d6604bb5812b1f5e755dbcd5e1", size = 32604, upload-time = "2025-11-21T13:55:42.878Z" }, - { url = "https://files.pythonhosted.org/packages/13/c7/1277ebfbcfaea02bbf01a69beac821a6543e1829a47bda52a020b3509ba2/time_machine-3.1.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8b6f8572c1e674d5ae43882ee9f39a03cea86c31cf9904ff3767905d41fc5e5a", size = 33779, upload-time = "2025-11-21T13:55:44.057Z" }, - { url = "https://files.pythonhosted.org/packages/6b/39/773a7456222b391e2f0bc6d049e00d99ea78b1e226b8b36c261e1235f36d/time_machine-3.1.0-cp313-cp313-win32.whl", hash = "sha256:8743edd11d3e2cb2d0244d4e83d96873fd96a375ba75364399f2f64fd95c7ec4", size = 16984, upload-time = "2025-11-21T13:55:45.144Z" }, - { url = "https://files.pythonhosted.org/packages/e9/95/94b9a839586eae1e3afcd575d1dabf81929e44e3886ad6d94deb5e2d5bda/time_machine-3.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:3a99c68a1cc962f76709c2b67efdcf4c97c9ad4a950f694cccb413ab378f9d94", size = 17727, upload-time = "2025-11-21T13:55:46.524Z" }, - { url = "https://files.pythonhosted.org/packages/1f/fd/f1fb569e8c7547c983b4e3259ee40684b0c4fdc882f36864d5eb05d71f72/time_machine-3.1.0-cp313-cp313-win_arm64.whl", hash = "sha256:7be2af8b69892615d897b2c6b546093e45dba7d9cde6af64c17f1e5da4f38dbc", size = 16558, upload-time = "2025-11-21T13:55:47.922Z" }, - { url = "https://files.pythonhosted.org/packages/e9/15/ccb1178e3a0988c320075285fe7b5ab26e51b71b2e5e14eee7158bd04dd6/time_machine-3.1.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:56938d4a24435014d3d9141415aee81699cf1a5419462a24357c7e3181c67f06", size = 19593, upload-time = "2025-11-21T13:55:50.114Z" }, - { url = "https://files.pythonhosted.org/packages/6a/9e/495e1ae27227cc3fc20f5d9e9011c14a3bda515f0c98630b0d0e2c444c4a/time_machine-3.1.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:ecdd9b98305cecfbff29ad9b663f38cbcf728ff023dc1db63cc94bd439890da5", size = 15252, upload-time = "2025-11-21T13:55:51.213Z" }, - { url = "https://files.pythonhosted.org/packages/d6/03/c905659d81c6b071cd8f2a6a6a23b1e25cd2a498167125b95e543fea7cec/time_machine-3.1.0-cp313-cp313t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:e5f0dc8ba33fcd624d11dc4029fa3fd1712f96660ddc629ce61097c71d8f6400", size = 38810, upload-time = "2025-11-21T13:55:52.379Z" }, - { url = "https://files.pythonhosted.org/packages/42/26/393277a6f07472cdb56ee2d8e34f0bdc203f64c8857180b73c4ba9cf0d91/time_machine-3.1.0-cp313-cp313t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:812aad79acf4b3471d997d29a5e7010f0a914740b1fe5b6cefb81b462cb28824", size = 40358, upload-time = "2025-11-21T13:55:54.077Z" }, - { url = "https://files.pythonhosted.org/packages/86/70/0cc738ba7fdaf8d29acd128a124be00c781b33e3ea84f34211f5a2cff4c2/time_machine-3.1.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5b0218aa05865a16c000320cfdac921d0e02992ef51e711325bc366bacdc4aeb", size = 43118, upload-time = "2025-11-21T13:55:55.616Z" }, - { url = "https://files.pythonhosted.org/packages/dc/5a/6c42a046abfcb8996ef3239bbc1cfd7c0051dea166a0f9f01923d1eb1848/time_machine-3.1.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:3544ab394f4149e8884996f1c5047d52dbb08bb2396109c530eee6ecffd6f4c4", size = 41321, upload-time = "2025-11-21T13:55:56.869Z" }, - { url = "https://files.pythonhosted.org/packages/36/3e/1123a93add930d4933ca4f1c3441f1832eba6b9e1b41b9ca3a5d3f9203c7/time_machine-3.1.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:acf41d44e526cae2f62c9c6ac95daef42bdbd7d95bdb3bb60e071b4b61110723", size = 38547, upload-time = "2025-11-21T13:55:58.065Z" }, - { url = "https://files.pythonhosted.org/packages/d1/c8/c98855aa75a6bc49c352e00396e545353db3e5d7c65a6eefca76366d9aac/time_machine-3.1.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:bb7031a367209c223c41ab625172b38362e0ce07f13f1f1e7d75d5194fcdd0d7", size = 39421, upload-time = "2025-11-21T13:55:59.224Z" }, - { url = "https://files.pythonhosted.org/packages/aa/94/f1520be4f125489a9d327848048688c2c13c5705770b98caac63e35cc204/time_machine-3.1.0-cp313-cp313t-win32.whl", hash = "sha256:ecf49c418f854f42171b4f0859906a26ff56d73303dee2e83beb307747e11db1", size = 17436, upload-time = "2025-11-21T13:56:00.395Z" }, - { url = "https://files.pythonhosted.org/packages/be/2f/79e13c341b20e8ceb1629fb2e1ae36063c9dee42f3886be44a54867ad0dc/time_machine-3.1.0-cp313-cp313t-win_amd64.whl", hash = "sha256:ee93cf4c11452bf8211bf12a926d6f5179c241558f6af30c2de2669bf26ba1c1", size = 18505, upload-time = "2025-11-21T13:56:01.54Z" }, - { url = "https://files.pythonhosted.org/packages/72/42/0cdb0b67d44ebfa47f4dbecb65d25522312ee772f59c4d63a0df0c895f34/time_machine-3.1.0-cp313-cp313t-win_arm64.whl", hash = "sha256:9c317eebaa0578a370a29f40152db0ac00bd34b387b54c95bf01fd123bca178d", size = 16852, upload-time = "2025-11-21T13:56:02.977Z" }, - { url = "https://files.pythonhosted.org/packages/f0/14/2f9b4c6ae63662827c48d81c445fedeba4733248a56640747c8e5be55870/time_machine-3.1.0-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:2b07055e5327e04d725557a07a69523d14d2d897877d90781b9c27c70bd8997c", size = 18899, upload-time = "2025-11-21T13:56:04.186Z" }, - { url = "https://files.pythonhosted.org/packages/6a/c2/09a91825ea60413316ece41e448d275a9a4b719bc92b35b6166013dc01bb/time_machine-3.1.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:b71948998e3f709bda9b600b0d250bb4ad677b28fac32475b6093aa5b9e8969f", size = 15027, upload-time = "2025-11-21T13:56:05.299Z" }, - { url = "https://files.pythonhosted.org/packages/f5/65/b737258b39b98406a3ed681cdc025fa788441221c5d24a59897a4752e413/time_machine-3.1.0-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:343dfb0663ccb1e5d5dc6dfb651b7b7233985c73b3a3f6af0fe58c9cf5b0f4ab", size = 32798, upload-time = "2025-11-21T13:56:06.521Z" }, - { url = "https://files.pythonhosted.org/packages/e6/e0/063edd2188a5c7e8f4b1a184dc9e87de955dcfd5cd8f706131739ff0685c/time_machine-3.1.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:3df9b834ec2ee8536a398c15c70f5d54dfe3bbb34344f6549ba29acf80916948", size = 34385, upload-time = "2025-11-21T13:56:07.719Z" }, - { url = "https://files.pythonhosted.org/packages/84/e8/ead05dc304f973b01443829367be3c504f3ff86c394a3fec932c4d720f3f/time_machine-3.1.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9e1ee0725a016f69fa8f0f37d793ba6d2d3870b32e164650a6922caf065f2ce2", size = 35781, upload-time = "2025-11-21T13:56:08.931Z" }, - { url = "https://files.pythonhosted.org/packages/1b/5e/23303d6b13482436d6c37015d17142821adf8e47c1104c0a4c5fc0bdb173/time_machine-3.1.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ed552f135efabca895e678044ce1dbb693e6a399003606e9d6a413b2eaf48a51", size = 34447, upload-time = "2025-11-21T13:56:10.468Z" }, - { url = "https://files.pythonhosted.org/packages/30/be/5ace5c8e2dc0b6899c3e18ebf4301211a50e1addfcbecbf61a100a76ac03/time_machine-3.1.0-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:c93451242de81fe2a96f699dad97aa463250688b10d2e8a72e98208df9bd62b1", size = 32814, upload-time = "2025-11-21T13:56:12.072Z" }, - { url = "https://files.pythonhosted.org/packages/40/cb/b0212b98e422fbb08f7328aabe0c6f59e853146eb61337df8f497dd4a2ad/time_machine-3.1.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:010c2dd1f084eae4687021f7b7fd798abc7a8472f2e783919aafe7b8fe624c8b", size = 33864, upload-time = "2025-11-21T13:56:13.28Z" }, - { url = "https://files.pythonhosted.org/packages/28/53/08ad68c1971257ee0c9b9ec38b1f2ef88ae7565e0c7eb272f9ca3ff40152/time_machine-3.1.0-cp314-cp314-win32.whl", hash = "sha256:9b8e24de4ba47401dcec53733d98db9678a708f6bafb77a64e46636304eca64c", size = 17127, upload-time = "2025-11-21T13:56:14.414Z" }, - { url = "https://files.pythonhosted.org/packages/0c/36/95d5b7fff7e1506f9f4a481df3b17ebae0f3ab4a36669e6a93890df1da5f/time_machine-3.1.0-cp314-cp314-win_amd64.whl", hash = "sha256:6873c903c8de85884655afc49c8465136ea5d6c7500ad2bea31601cf6a48939f", size = 18006, upload-time = "2025-11-21T13:56:15.575Z" }, - { url = "https://files.pythonhosted.org/packages/d2/c8/b30211e36117b4436368927e46dcf1f785626069b11a12cc3ea150337136/time_machine-3.1.0-cp314-cp314-win_arm64.whl", hash = "sha256:9a74b2da34e7e6aaa2db011556f40f8ea26e89a3a1683ffad43ceca1789b8af0", size = 16633, upload-time = "2025-11-21T13:56:16.706Z" }, - { url = "https://files.pythonhosted.org/packages/fe/3d/eeb00cd285102e39cc4eeeb4e78cc1fcff8a89691bdc6a708d4c40fe38cc/time_machine-3.1.0-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:0c688897189b50f0820e2916579c7e88aefef2a86cd17aa05b5b7a6676dbd97e", size = 19578, upload-time = "2025-11-21T13:56:17.853Z" }, - { url = "https://files.pythonhosted.org/packages/3e/91/30710e1883a4c39b1367ef469d6fd18c791bec4ee8783a19af9ac82bc632/time_machine-3.1.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:1715d221c4c49bd2a0bc73868d5543133ab15e02e0d9726d73d802ccf978e1c0", size = 15299, upload-time = "2025-11-21T13:56:18.955Z" }, - { url = "https://files.pythonhosted.org/packages/d4/7f/2311774df6d41dba3934494b6589195a726fec0753a4e8e8eba28e509327/time_machine-3.1.0-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:8cecc83df46ab1095f93ff42dceaddb313e12efd9135cd153d0021a98b570390", size = 38801, upload-time = "2025-11-21T13:56:20.357Z" }, - { url = "https://files.pythonhosted.org/packages/1b/74/5af7e7af3787333c927d860476b505ec8770412e2bb1ba4e2d00a3aa644a/time_machine-3.1.0-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:be63019454e0e30138bfe414f3dd5f626d32b8a265ea99bdc4b107867b68128a", size = 40357, upload-time = "2025-11-21T13:56:21.971Z" }, - { url = "https://files.pythonhosted.org/packages/10/1a/ebcecff1e57f52788989f0734a57eab5e045c9784cfd998040b8ba280f5b/time_machine-3.1.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ac1245d6a4a4ac40e308362e4236c1aad6ead836c97576c7e29167752a5283d0", size = 43101, upload-time = "2025-11-21T13:56:23.555Z" }, - { url = "https://files.pythonhosted.org/packages/99/b3/63883e2d8555358469da098dd1568ec8f6c9b6d7317796cfbf8bc5c59ab2/time_machine-3.1.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:9fde90d14b13396ecaa5ce2366f788f7c01b7bf4ac4246b798c622bc6369b861", size = 41305, upload-time = "2025-11-21T13:56:24.831Z" }, - { url = "https://files.pythonhosted.org/packages/04/a3/d7851676cf7a5d5451b73f271b6b7229688f403488a8dd111b5fe5fde7cf/time_machine-3.1.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:15d83cc338d02dc6e674e24ce40a8c311d75191c86014b0be455a4267f27f00e", size = 38534, upload-time = "2025-11-21T13:56:26.032Z" }, - { url = "https://files.pythonhosted.org/packages/13/dc/ced9245bc633f0c4790a57b3c6089a586f0a208b50f8ec7d001bf8254d49/time_machine-3.1.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:cbbd90494a9bc6626e3180594246cb9557418e32f2cb2c40edf8526a182f5e31", size = 39430, upload-time = "2025-11-21T13:56:28.83Z" }, - { url = "https://files.pythonhosted.org/packages/67/24/bb20ff76ed4e8e09ab65910bf21a315dc7562c8be92250363b25f3ab1dd1/time_machine-3.1.0-cp314-cp314t-win32.whl", hash = "sha256:6c00758d155601d710fa036c8d24d5ad3fb28531933cf70343006cf2be93092a", size = 17674, upload-time = "2025-11-21T13:56:29.969Z" }, - { url = "https://files.pythonhosted.org/packages/2e/64/42573a6da9298efd68a831d4e9eabc8c9c0cac9305bc19bb24a4066bbba0/time_machine-3.1.0-cp314-cp314t-win_amd64.whl", hash = "sha256:e00239b54b05255862e0965e6ae67728e467727ca7dc23d9a6c5a51c7b5b01c8", size = 18792, upload-time = "2025-11-21T13:56:31.123Z" }, - { url = "https://files.pythonhosted.org/packages/35/10/09ad4e5ccc27224ed8377a6f3d191034242c404d0c1ad5f119d79fb18363/time_machine-3.1.0-cp314-cp314t-win_arm64.whl", hash = "sha256:8b47da89595dc3c7f0b52f1e3f3f8da8325037f3746e66d74bebac9f42f2a989", size = 16944, upload-time = "2025-11-21T13:56:32.254Z" }, + { url = "https://files.pythonhosted.org/packages/9c/31/6bf41cb4a326230518d9b76c910dfc11d4fc23444d1cbfdf2d7652bd99f4/time_machine-3.2.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:68142c070e78b62215d8029ec7394905083a4f9aacb0a2a11514ce70b5951b13", size = 19447, upload-time = "2025-12-17T23:31:30.181Z" }, + { url = "https://files.pythonhosted.org/packages/fa/14/d71ce771712e1cbfa15d8c24452225109262b16cb6caaf967e9f60662b67/time_machine-3.2.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:161bbd0648802ffdfcb4bb297ecb26b3009684a47d3a4dedb90bc549df4fa2ad", size = 15432, upload-time = "2025-12-17T23:31:31.381Z" }, + { url = "https://files.pythonhosted.org/packages/8b/d6/dcb43a11f8029561996fad58ff9d3dc5e6d7f32b74f0745a2965d7e4b4f3/time_machine-3.2.0-cp310-cp310-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:1359ba8c258be695ba69253bc84db882fd616fe69b426cc6056536da2c7bf68e", size = 32956, upload-time = "2025-12-17T23:31:32.469Z" }, + { url = "https://files.pythonhosted.org/packages/77/da/d802cd3c335c414f9b11b479f7459aa72df5de6485c799966cfdf8856d53/time_machine-3.2.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:c85b169998ca2c24a78fb214586ec11c4cad56d9c38f55ad8326235cb481c884", size = 34556, upload-time = "2025-12-17T23:31:33.946Z" }, + { url = "https://files.pythonhosted.org/packages/85/ee/51ad553514ab0b940c7c82c6e1519dd10fd06ac07b32039a1d153ef09c88/time_machine-3.2.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:65b9367cb8a10505bc8f67da0da514ba20fa816fc47e11f434f7c60350322b4c", size = 36101, upload-time = "2025-12-17T23:31:35.462Z" }, + { url = "https://files.pythonhosted.org/packages/11/39/938b111b5bb85a2b07502d0f9d8a704fc75bd760d62e76bce23c89ed16c9/time_machine-3.2.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:9faca6a0f1973d7df3233c951fc2a11ff0c54df74087d8aaf41ae3deb19d0893", size = 34905, upload-time = "2025-12-17T23:31:36.543Z" }, + { url = "https://files.pythonhosted.org/packages/dd/50/0951f73b23e76455de0b4a3a58ac5a24bd8d10489624b1c5e03f10c6fc0b/time_machine-3.2.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:213b1ada7f385d467e598999b642eda4a8e89ae10ad5dc4f5d8f672cbf604261", size = 33012, upload-time = "2025-12-17T23:31:37.967Z" }, + { url = "https://files.pythonhosted.org/packages/4f/95/5304912d3dcecc4e14ed222dbe0396352efdf8497534abc3c9edd67a7528/time_machine-3.2.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:160b6afd94c39855af04d39c58e4cf602406abd6d79427ab80e830ea71789cfb", size = 34104, upload-time = "2025-12-17T23:31:39.449Z" }, + { url = "https://files.pythonhosted.org/packages/d4/1c/af56518652ec7adac4ced193b7a42c4ff354fef28a412b3b5ffa5763aead/time_machine-3.2.0-cp310-cp310-win32.whl", hash = "sha256:c15d9ac257c78c124d112e4fc91fa9f3dcb004bdda913c19f0e7368d713cf080", size = 17468, upload-time = "2025-12-17T23:31:40.432Z" }, + { url = "https://files.pythonhosted.org/packages/48/15/0213f00ca3cf6fe1c9fdbd7fd467e801052fc85534f30c0e4684bd474190/time_machine-3.2.0-cp310-cp310-win_amd64.whl", hash = "sha256:3bf0f428487f93b8fe9d27aa01eccc817885da3290b467341b4a4a795e1d1891", size = 18313, upload-time = "2025-12-17T23:31:41.617Z" }, + { url = "https://files.pythonhosted.org/packages/77/e4/811f96aa7a634b2b264d9a476f3400e710744dda503b4ad87a5c76db32c9/time_machine-3.2.0-cp310-cp310-win_arm64.whl", hash = "sha256:347f6be2129fcd35b1c94b9387fcb2cbe7949b1e649228c5f22949a811b78976", size = 17037, upload-time = "2025-12-17T23:31:42.924Z" }, + { url = "https://files.pythonhosted.org/packages/f5/e1/03aae5fbaa53859f665094af696338fc7cae733d926a024af69982712350/time_machine-3.2.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:c188a9dda9fcf975022f1b325b466651b96a4dfc223c523ed7ed8d979f9bf3e8", size = 19143, upload-time = "2025-12-17T23:31:44.258Z" }, + { url = "https://files.pythonhosted.org/packages/75/8f/98cb17bebb52b22ff4ec26984dd44280f9c71353c3bae0640a470e6683e5/time_machine-3.2.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:17245f1cc2dd13f9d63a174be59bb2684a9e5e0a112ab707e37be92068cd655f", size = 15273, upload-time = "2025-12-17T23:31:45.246Z" }, + { url = "https://files.pythonhosted.org/packages/dd/2f/ca11e4a7897234bb9331fcc5f4ed4714481ba4012370cc79a0ae8c42ea0a/time_machine-3.2.0-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:d9bd1de1996e76efd36ae15970206c5089fb3728356794455bd5cd8d392b5537", size = 31049, upload-time = "2025-12-17T23:31:46.613Z" }, + { url = "https://files.pythonhosted.org/packages/cf/ad/d17d83a59943094e6b6c6a3743caaf6811b12203c3e07a30cc7bcc2ab7ee/time_machine-3.2.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:98493cd50e8b7f941eab69b9e18e697ad69db1a0ec1959f78f3d7b0387107e5c", size = 32632, upload-time = "2025-12-17T23:31:47.72Z" }, + { url = "https://files.pythonhosted.org/packages/71/50/d60576d047a0dfb5638cdfb335e9c3deb6e8528544fa0b3966a8480f72b7/time_machine-3.2.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:31f2a33d595d9f91eb9bc7f157f0dc5721f5789f4c4a9e8b852cdedb2a7d9b16", size = 34289, upload-time = "2025-12-17T23:31:48.913Z" }, + { url = "https://files.pythonhosted.org/packages/fa/fe/4afa602dbdebddde6d0ea4a7fe849e49b9bb85dc3fb415725a87ccb4b471/time_machine-3.2.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:9f78ac4213c10fbc44283edd1a29cfb7d3382484f4361783ddc057292aaa1889", size = 33175, upload-time = "2025-12-17T23:31:50.611Z" }, + { url = "https://files.pythonhosted.org/packages/0d/87/c152e23977c1d7d7c94eb3ed3ea45cc55971796205125c6fdff40db2c60f/time_machine-3.2.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:c1326b09e947b360926d529a96d1d9e126ce120359b63b506ecdc6ee20755c23", size = 31170, upload-time = "2025-12-17T23:31:51.645Z" }, + { url = "https://files.pythonhosted.org/packages/80/af/54acf51d0f3ade3b51eab73df6192937c9a938753ef5456dff65eb8630be/time_machine-3.2.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:9f2949f03d15264cc15c38918a2cda8966001f0f4ebe190cbfd9c56d91aed8ac", size = 32292, upload-time = "2025-12-17T23:31:52.803Z" }, + { url = "https://files.pythonhosted.org/packages/cc/bc/3745963f36e75661a807196428639327a366f4332f35f1f775c074d4062f/time_machine-3.2.0-cp311-cp311-win32.whl", hash = "sha256:6dfe48e0499e6e16751476b9799e67be7514e6ef04cdf39571ef95a279645831", size = 17349, upload-time = "2025-12-17T23:31:54.19Z" }, + { url = "https://files.pythonhosted.org/packages/82/a2/057469232a99d1f5a0160ae7c5bae7b095c9168b333dd598fcbcfbc1c87b/time_machine-3.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:809bdf267a29189c304154873620fe0bcc0c9513295fa46b19e21658231c4915", size = 18191, upload-time = "2025-12-17T23:31:55.472Z" }, + { url = "https://files.pythonhosted.org/packages/79/d8/bf9c8de57262ee7130d92a6ed49ed6a6e40a36317e46979428d373630c12/time_machine-3.2.0-cp311-cp311-win_arm64.whl", hash = "sha256:a3f4c17fa90f54902a3f8692c75caf67be87edc3429eeb71cb4595da58198f8e", size = 16905, upload-time = "2025-12-17T23:31:56.658Z" }, + { url = "https://files.pythonhosted.org/packages/71/8b/080c8eedcd67921a52ba5bd0e075362062509ab63c86fc1a0442fad241a6/time_machine-3.2.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:cc4bee5b0214d7dc4ebc91f4a4c600f1a598e9b5606ac751f42cb6f6740b1dbb", size = 19255, upload-time = "2025-12-17T23:31:58.057Z" }, + { url = "https://files.pythonhosted.org/packages/66/17/0e5291e9eb705bf8a5a1305f826e979af307bbeb79def4ddbf4b3f9a81e0/time_machine-3.2.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:3ca036304b4460ae2fdc1b52dd8b1fa7cf1464daa427fc49567413c09aa839c1", size = 15360, upload-time = "2025-12-17T23:31:59.048Z" }, + { url = "https://files.pythonhosted.org/packages/8b/e8/9ab87b71d2e2b62463b9b058b7ae7ac09fb57f8fcd88729dec169d304340/time_machine-3.2.0-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:5442735b41d7a2abc2f04579b4ca6047ed4698a8338a4fec92c7c9423e7938cb", size = 33029, upload-time = "2025-12-17T23:32:00.413Z" }, + { url = "https://files.pythonhosted.org/packages/4b/26/b5ca19da6f25ea905b3e10a0ea95d697c1aeba0404803a43c68f1af253e6/time_machine-3.2.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:97da3e971e505cb637079fb07ab0bcd36e33279f8ecac888ff131f45ef1e4d8d", size = 34579, upload-time = "2025-12-17T23:32:01.431Z" }, + { url = "https://files.pythonhosted.org/packages/79/ca/6ac7ad5f10ea18cc1d9de49716ba38c32132c7b64532430d92ef240c116b/time_machine-3.2.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3cdda6dee4966e38aeb487309bb414c6cb23a81fc500291c77a8fcd3098832e7", size = 35961, upload-time = "2025-12-17T23:32:02.521Z" }, + { url = "https://files.pythonhosted.org/packages/33/67/390dd958bed395ab32d79a9fe61fe111825c0dd4ded54dbba7e867f171e6/time_machine-3.2.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:33d9efd302a6998bcc8baa4d84f259f8a4081105bd3d7f7af7f1d0abd3b1c8aa", size = 34668, upload-time = "2025-12-17T23:32:03.585Z" }, + { url = "https://files.pythonhosted.org/packages/da/57/c88fff034a4e9538b3ae7c68c9cfb283670b14d17522c5a8bc17d29f9a4b/time_machine-3.2.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:3a0b0a33971f14145853c9bd95a6ab0353cf7e0019fa2a7aa1ae9fddfe8eab50", size = 32891, upload-time = "2025-12-17T23:32:04.656Z" }, + { url = "https://files.pythonhosted.org/packages/2d/70/ebbb76022dba0fec8f9156540fc647e4beae1680c787c01b1b6200e56d70/time_machine-3.2.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:2d0be9e5f22c38082d247a2cdcd8a936504e9db60b7b3606855fb39f299e9548", size = 34080, upload-time = "2025-12-17T23:32:06.146Z" }, + { url = "https://files.pythonhosted.org/packages/db/9a/2ca9e7af3df540dc1c79e3de588adeddb7dcc2107829248e6969c4f14167/time_machine-3.2.0-cp312-cp312-win32.whl", hash = "sha256:3f74623648b936fdce5f911caf386c0a0b579456410975de8c0dfeaaffece1d8", size = 17371, upload-time = "2025-12-17T23:32:07.164Z" }, + { url = "https://files.pythonhosted.org/packages/d8/ce/21d23efc9c2151939af1b7ee4e60d86d661b74ef32b8eaa148f6fe8c899c/time_machine-3.2.0-cp312-cp312-win_amd64.whl", hash = "sha256:34e26a41d994b5e4b205136a90e9578470386749cc9a2ecf51ca18f83ce25e23", size = 18132, upload-time = "2025-12-17T23:32:08.447Z" }, + { url = "https://files.pythonhosted.org/packages/2f/34/c2b70be483accf6db9e5d6c3139bce3c38fe51f898ccf64e8d3fe14fbf4d/time_machine-3.2.0-cp312-cp312-win_arm64.whl", hash = "sha256:0615d3d82c418d6293f271c348945c5091a71f37e37173653d5c26d0e74b13a8", size = 16930, upload-time = "2025-12-17T23:32:09.477Z" }, + { url = "https://files.pythonhosted.org/packages/ee/cd/43ad5efc88298af3c59b66769cea7f055567a85071579ed40536188530c1/time_machine-3.2.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:c421a8eb85a4418a7675a41bf8660224318c46cc62e4751c8f1ceca752059090", size = 19318, upload-time = "2025-12-17T23:32:10.518Z" }, + { url = "https://files.pythonhosted.org/packages/b0/f6/084010ef7f4a3f38b5a4900923d7c85b29e797655c4f6ee4ce54d903cca8/time_machine-3.2.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8f4e758f7727d0058c4950c66b58200c187072122d6f7a98b610530a4233ea7b", size = 15390, upload-time = "2025-12-17T23:32:11.625Z" }, + { url = "https://files.pythonhosted.org/packages/25/aa/1cabb74134f492270dc6860cb7865859bf40ecf828be65972827646e91ad/time_machine-3.2.0-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:154bd3f75c81f70218b2585cc12b60762fb2665c507eec5ec5037d8756d9b4e0", size = 33115, upload-time = "2025-12-17T23:32:13.219Z" }, + { url = "https://files.pythonhosted.org/packages/5e/03/78c5d7dfa366924eb4dbfcc3fc917c39a4280ca234b12819cc1f16c03d88/time_machine-3.2.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:d50cfe5ebea422c896ad8d278af9648412b7533b8ea6adeeee698a3fd9b1d3b7", size = 34705, upload-time = "2025-12-17T23:32:14.29Z" }, + { url = "https://files.pythonhosted.org/packages/86/93/d5e877c24541f674c6869ff6e9c56833369796010190252e92c9d7ae5f0f/time_machine-3.2.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:636576501724bd6a9124e69d86e5aef263479e89ef739c5db361469f0463a0a1", size = 36104, upload-time = "2025-12-17T23:32:15.354Z" }, + { url = "https://files.pythonhosted.org/packages/22/1c/d4bae72f388f67efc9609f89b012e434bb19d9549c7a7b47d6c7d9e5c55d/time_machine-3.2.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:40e6f40c57197fcf7ec32d2c563f4df0a82c42cdcc3cab27f688e98f6060df10", size = 34765, upload-time = "2025-12-17T23:32:16.434Z" }, + { url = "https://files.pythonhosted.org/packages/1d/c3/ac378cf301d527d8dfad2f0db6bad0dfb1ab73212eaa56d6b96ee5d9d20b/time_machine-3.2.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:a1bcf0b846bbfc19a79bc19e3fa04d8c7b1e8101c1b70340ffdb689cd801ea53", size = 33010, upload-time = "2025-12-17T23:32:17.532Z" }, + { url = "https://files.pythonhosted.org/packages/06/35/7ce897319accda7a6970b288a9a8c52d25227342a7508505a2b3d235b649/time_machine-3.2.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ae55a56c179f4fe7a62575ad5148b6ed82f6c7e5cf2f9a9ec65f2f5b067db5f5", size = 34185, upload-time = "2025-12-17T23:32:18.566Z" }, + { url = "https://files.pythonhosted.org/packages/bf/28/f922022269749cb02eee2b62919671153c4088994fa955a6b0e50327ff81/time_machine-3.2.0-cp313-cp313-win32.whl", hash = "sha256:a66fe55a107e46916007a391d4030479df8864ec6ad6f6a6528221befc5c886e", size = 17397, upload-time = "2025-12-17T23:32:19.605Z" }, + { url = "https://files.pythonhosted.org/packages/ee/dc/fd87cde397f4a7bea493152f0aca8fd569ec709cad9e0f2ca7011eb8c7f7/time_machine-3.2.0-cp313-cp313-win_amd64.whl", hash = "sha256:30c9ce57165df913e4f74e285a8ab829ff9b7aa3e5ec0973f88f642b9a7b3d15", size = 18139, upload-time = "2025-12-17T23:32:20.991Z" }, + { url = "https://files.pythonhosted.org/packages/75/81/b8ce58233addc5d7d54d2fabc49dcbc02d79e3f079d150aa1bec3d5275ef/time_machine-3.2.0-cp313-cp313-win_arm64.whl", hash = "sha256:89cad7e179e9bdcc84dcf09efe52af232c4cc7a01b3de868356bbd59d95bd9b8", size = 16964, upload-time = "2025-12-17T23:32:22.075Z" }, + { url = "https://files.pythonhosted.org/packages/67/e7/487f0ba5fe6c58186a5e1af2a118dfa2c160fedb37ef53a7e972d410408e/time_machine-3.2.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:59d71545e62525a4b85b6de9ab5c02ee3c61110fd7f636139914a2335dcbfc9c", size = 20000, upload-time = "2025-12-17T23:32:23.058Z" }, + { url = "https://files.pythonhosted.org/packages/e1/17/eb2c0054c8d44dd42df84ccd434539249a9c7d0b8eb53f799be2102500ab/time_machine-3.2.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:999672c621c35362bc28e03ca0c7df21500195540773c25993421fd8d6cc5003", size = 15657, upload-time = "2025-12-17T23:32:24.125Z" }, + { url = "https://files.pythonhosted.org/packages/43/21/93443b5d1dd850f8bb9442e90d817a9033dcce6bfbdd3aabbb9786251c80/time_machine-3.2.0-cp313-cp313t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:5faf7397f0580c7b9d67288522c8d7863e85f0cffadc0f1fccdb2c3dfce5783e", size = 39216, upload-time = "2025-12-17T23:32:25.542Z" }, + { url = "https://files.pythonhosted.org/packages/9f/9e/18544cf8acc72bb1dc03762231c82ecc259733f4bb6770a7bbe5cd138603/time_machine-3.2.0-cp313-cp313t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:d3dd886ec49f1fa5a00e844f5947e5c0f98ce574750c24b7424c6f77fc1c3e87", size = 40764, upload-time = "2025-12-17T23:32:26.643Z" }, + { url = "https://files.pythonhosted.org/packages/27/f7/9fe9ce2795636a3a7467307af6bdf38bb613ddb701a8a5cd50ec713beb5e/time_machine-3.2.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:da0ecd96bc7bbe450acaaabe569d84e81688f1be8ad58d1470e42371d145fb53", size = 43526, upload-time = "2025-12-17T23:32:27.693Z" }, + { url = "https://files.pythonhosted.org/packages/03/c1/a93e975ba9dec22e87ec92d18c28e67d36bd536f9119ffa439b2892b0c9c/time_machine-3.2.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:158220e946c1c4fb8265773a0282c88c35a7e3bb5d78e3561214e3b3231166f3", size = 41727, upload-time = "2025-12-17T23:32:28.985Z" }, + { url = "https://files.pythonhosted.org/packages/5f/fb/e3633e5a6bbed1c76bb2e9810dabc2f8467532ffcd29b9aed404b473061a/time_machine-3.2.0-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:8c1aee29bc54356f248d5d7dfdd131e12ca825e850a08c0ebdb022266d073013", size = 38952, upload-time = "2025-12-17T23:32:30.031Z" }, + { url = "https://files.pythonhosted.org/packages/82/3d/02e9fb2526b3d6b1b45bc8e4d912d95d1cd699d1a3f6df985817d37a0600/time_machine-3.2.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:c8ed2224f09d25b1c2fc98683613aca12f90f682a427eabb68fc824d27014e4a", size = 39829, upload-time = "2025-12-17T23:32:31.075Z" }, + { url = "https://files.pythonhosted.org/packages/85/c8/c14265212436da8e0814c45463987b3f57de3eca4de023cc2eabb0c62ef3/time_machine-3.2.0-cp313-cp313t-win32.whl", hash = "sha256:3498719f8dab51da76d29a20c1b5e52ee7db083dddf3056af7fa69c1b94e1fe6", size = 17852, upload-time = "2025-12-17T23:32:32.079Z" }, + { url = "https://files.pythonhosted.org/packages/1d/bc/8acb13cf6149f47508097b158a9a8bec9ec4530a70cb406124e8023581f5/time_machine-3.2.0-cp313-cp313t-win_amd64.whl", hash = "sha256:e0d90bee170b219e1d15e6a58164aa808f5170090e4f090bd0670303e34181b1", size = 18918, upload-time = "2025-12-17T23:32:33.106Z" }, + { url = "https://files.pythonhosted.org/packages/24/87/c443ee508c2708fd2514ccce9052f5e48888783ce690506919629ebc8eb0/time_machine-3.2.0-cp313-cp313t-win_arm64.whl", hash = "sha256:051de220fdb6e20d648111bbad423d9506fdbb2e44d4429cef3dc0382abf1fc2", size = 17261, upload-time = "2025-12-17T23:32:34.446Z" }, + { url = "https://files.pythonhosted.org/packages/61/70/b4b980d126ed155c78d1879c50d60c8dcbd47bd11cb14ee7be50e0dfc07f/time_machine-3.2.0-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:1398980c017fe5744d66f419e0115ee48a53b00b146d738e1416c225eb610b82", size = 19303, upload-time = "2025-12-17T23:32:35.796Z" }, + { url = "https://files.pythonhosted.org/packages/73/73/eaa33603c69a68fe2b6f54f9dd75481693d62f1d29676531002be06e2d1c/time_machine-3.2.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:4f8f4e35f4191ef70c2ab8ff490761ee9051b891afce2bf86dde3918eb7b537b", size = 15431, upload-time = "2025-12-17T23:32:37.244Z" }, + { url = "https://files.pythonhosted.org/packages/76/10/b81e138e86cc7bab40cdb59d294b341e172201f4a6c84bb0ec080407977a/time_machine-3.2.0-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:6db498686ecf6163c5aa8cf0bcd57bbe0f4081184f247edf3ee49a2612b584f9", size = 33206, upload-time = "2025-12-17T23:32:38.713Z" }, + { url = "https://files.pythonhosted.org/packages/d3/72/4deab446b579e8bd5dca91de98595c5d6bd6a17ce162abf5c5f2ce40d3d8/time_machine-3.2.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:027c1807efb74d0cd58ad16524dec94212fbe900115d70b0123399883657ac0f", size = 34792, upload-time = "2025-12-17T23:32:40.223Z" }, + { url = "https://files.pythonhosted.org/packages/2c/39/439c6b587ddee76d533fe972289d0646e0a5520e14dc83d0a30aeb5565f7/time_machine-3.2.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:92432610c05676edd5e6946a073c6f0c926923123ce7caee1018dc10782c713d", size = 36187, upload-time = "2025-12-17T23:32:41.705Z" }, + { url = "https://files.pythonhosted.org/packages/4b/db/2da4368db15180989bab83746a857bde05ad16e78f326801c142bb747a06/time_machine-3.2.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:c25586b62480eb77ef3d953fba273209478e1ef49654592cd6a52a68dfe56a67", size = 34855, upload-time = "2025-12-17T23:32:42.817Z" }, + { url = "https://files.pythonhosted.org/packages/88/84/120a431fee50bc4c241425bee4d3a4910df4923b7ab5f7dff1bf0c772f08/time_machine-3.2.0-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:6bf3a2fa738d15e0b95d14469a0b8ea42635467408d8b490e263d5d45c9a177f", size = 33222, upload-time = "2025-12-17T23:32:43.94Z" }, + { url = "https://files.pythonhosted.org/packages/f9/ea/89cfda82bb8c57ff91bb9a26751aa234d6d90e9b4d5ab0ad9dce0f9f0329/time_machine-3.2.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ce76b82276d7ad2a66cdc85dad4df19d1422b69183170a34e8fbc4c3f35502f7", size = 34270, upload-time = "2025-12-17T23:32:45.037Z" }, + { url = "https://files.pythonhosted.org/packages/8a/aa/235357da4f69a51a8d35fcbfcfa77cdc7dc24f62ae54025006570bda7e2d/time_machine-3.2.0-cp314-cp314-win32.whl", hash = "sha256:14d6778273c543441863dff712cd1d7803dee946b18de35921eb8df10714539d", size = 17544, upload-time = "2025-12-17T23:32:46.099Z" }, + { url = "https://files.pythonhosted.org/packages/7b/51/6c8405a7276be79693b792cff22ce41067ec05db26a7d02f2d5b06324434/time_machine-3.2.0-cp314-cp314-win_amd64.whl", hash = "sha256:cbf821da96dbc80d349fa9e7c36e670b41d68a878d28c8850057992fed430eef", size = 18423, upload-time = "2025-12-17T23:32:47.468Z" }, + { url = "https://files.pythonhosted.org/packages/d9/03/a3cf419e20c35fc203c6e4fed48b5b667c1a2b4da456d9971e605f73ecef/time_machine-3.2.0-cp314-cp314-win_arm64.whl", hash = "sha256:71c75d71f8e68abc8b669bca26ed2ddd558430a6c171e32b8620288565f18c0e", size = 17050, upload-time = "2025-12-17T23:32:48.91Z" }, + { url = "https://files.pythonhosted.org/packages/86/a1/142de946dc4393f910bf4564b5c3ba819906e1f49b06c9cb557519c849e4/time_machine-3.2.0-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:4e374779021446fc2b5c29d80457ec9a3b1a5df043dc2aae07d7c1415d52323c", size = 19991, upload-time = "2025-12-17T23:32:49.933Z" }, + { url = "https://files.pythonhosted.org/packages/ee/62/7f17def6289901f94726921811a16b9adce46e666362c75d45730c60274f/time_machine-3.2.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:122310a6af9c36e9a636da32830e591e7923e8a07bdd0a43276c3a36c6821c90", size = 15707, upload-time = "2025-12-17T23:32:50.969Z" }, + { url = "https://files.pythonhosted.org/packages/5d/d3/3502fb9bd3acb159c18844b26c43220201a0d4a622c0c853785d07699a92/time_machine-3.2.0-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:ba3eeb0f018cc362dd8128befa3426696a2e16dd223c3fb695fde184892d4d8c", size = 39207, upload-time = "2025-12-17T23:32:52.033Z" }, + { url = "https://files.pythonhosted.org/packages/5a/be/8b27f4aa296fda14a5a2ad7f588ddd450603c33415ab3f8e85b2f1a44678/time_machine-3.2.0-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:77d38ba664b381a7793f8786efc13b5004f0d5f672dae814430445b8202a67a6", size = 40764, upload-time = "2025-12-17T23:32:53.167Z" }, + { url = "https://files.pythonhosted.org/packages/42/cd/fe4c4e5c8ab6d48fab3624c32be9116fb120173a35fe67e482e5cf68b3d2/time_machine-3.2.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f09abeb8f03f044d72712207e0489a62098ad3ad16dac38927fcf80baca4d6a7", size = 43508, upload-time = "2025-12-17T23:32:54.597Z" }, + { url = "https://files.pythonhosted.org/packages/b4/28/5a3ba2fce85b97655a425d6bb20a441550acd2b304c96b2c19d3839f721a/time_machine-3.2.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:6b28367ce4f73987a55e230e1d30a57a3af85da8eb1a140074eb6e8c7e6ef19f", size = 41712, upload-time = "2025-12-17T23:32:55.781Z" }, + { url = "https://files.pythonhosted.org/packages/81/58/e38084be7fdabb4835db68a3a47e58c34182d79fc35df1ecbe0db2c5359f/time_machine-3.2.0-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:903c7751c904581da9f7861c3015bed7cdc40047321291d3694a3cdc783bbca3", size = 38939, upload-time = "2025-12-17T23:32:56.867Z" }, + { url = "https://files.pythonhosted.org/packages/40/d0/ad3feb0a392ef4e0c08bc32024950373ddc0669002cbdcbb9f3bf0c2d114/time_machine-3.2.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:528217cad85ede5f85c8bc78b0341868d3c3cfefc6ecb5b622e1cacb6c73247b", size = 39837, upload-time = "2025-12-17T23:32:58.283Z" }, + { url = "https://files.pythonhosted.org/packages/5b/9e/5f4b2ea63b267bd78f3245e76f5528836611b5f2d30b5e7300a722fe4428/time_machine-3.2.0-cp314-cp314t-win32.whl", hash = "sha256:75724762ffd517e7e80aaec1fad1ff5a7414bd84e2b3ee7a0bacfeb67c14926e", size = 18091, upload-time = "2025-12-17T23:32:59.403Z" }, + { url = "https://files.pythonhosted.org/packages/39/6f/456b1f4d2700ae02b19eba830f870596a4b89b74bac3b6c80666f1b108c5/time_machine-3.2.0-cp314-cp314t-win_amd64.whl", hash = "sha256:2526abbd053c5bca898d1b3e7898eec34626b12206718d8c7ce88fd12c1c9c5c", size = 19208, upload-time = "2025-12-17T23:33:00.488Z" }, + { url = "https://files.pythonhosted.org/packages/2f/22/8063101427ecd3d2652aada4d21d0876b07a3dc789125bca2ee858fec3ed/time_machine-3.2.0-cp314-cp314t-win_arm64.whl", hash = "sha256:7f2fb6784b414edbe2c0b558bfaab0c251955ba27edd62946cce4a01675a992c", size = 17359, upload-time = "2025-12-17T23:33:01.54Z" }, ] [[package]] name = "tomli" -version = "2.3.0" +version = "2.4.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/52/ed/3f73f72945444548f33eba9a87fc7a6e969915e7b1acc8260b30e1f76a2f/tomli-2.3.0.tar.gz", hash = "sha256:64be704a875d2a59753d80ee8a533c3fe183e3f06807ff7dc2232938ccb01549", size = 17392, upload-time = "2025-10-08T22:01:47.119Z" } +sdist = { url = "https://files.pythonhosted.org/packages/82/30/31573e9457673ab10aa432461bee537ce6cef177667deca369efb79df071/tomli-2.4.0.tar.gz", hash = "sha256:aa89c3f6c277dd275d8e243ad24f3b5e701491a860d5121f2cdd399fbb31fc9c", size = 17477, upload-time = "2026-01-11T11:22:38.165Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/b3/2e/299f62b401438d5fe1624119c723f5d877acc86a4c2492da405626665f12/tomli-2.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:88bd15eb972f3664f5ed4b57c1634a97153b4bac4479dcb6a495f41921eb7f45", size = 153236, upload-time = "2025-10-08T22:01:00.137Z" }, - { url = "https://files.pythonhosted.org/packages/86/7f/d8fffe6a7aefdb61bced88fcb5e280cfd71e08939da5894161bd71bea022/tomli-2.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:883b1c0d6398a6a9d29b508c331fa56adbcdff647f6ace4dfca0f50e90dfd0ba", size = 148084, upload-time = "2025-10-08T22:01:01.63Z" }, - { url = "https://files.pythonhosted.org/packages/47/5c/24935fb6a2ee63e86d80e4d3b58b222dafaf438c416752c8b58537c8b89a/tomli-2.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d1381caf13ab9f300e30dd8feadb3de072aeb86f1d34a8569453ff32a7dea4bf", size = 234832, upload-time = "2025-10-08T22:01:02.543Z" }, - { url = "https://files.pythonhosted.org/packages/89/da/75dfd804fc11e6612846758a23f13271b76d577e299592b4371a4ca4cd09/tomli-2.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a0e285d2649b78c0d9027570d4da3425bdb49830a6156121360b3f8511ea3441", size = 242052, upload-time = "2025-10-08T22:01:03.836Z" }, - { url = "https://files.pythonhosted.org/packages/70/8c/f48ac899f7b3ca7eb13af73bacbc93aec37f9c954df3c08ad96991c8c373/tomli-2.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0a154a9ae14bfcf5d8917a59b51ffd5a3ac1fd149b71b47a3a104ca4edcfa845", size = 239555, upload-time = "2025-10-08T22:01:04.834Z" }, - { url = "https://files.pythonhosted.org/packages/ba/28/72f8afd73f1d0e7829bfc093f4cb98ce0a40ffc0cc997009ee1ed94ba705/tomli-2.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:74bf8464ff93e413514fefd2be591c3b0b23231a77f901db1eb30d6f712fc42c", size = 245128, upload-time = "2025-10-08T22:01:05.84Z" }, - { url = "https://files.pythonhosted.org/packages/b6/eb/a7679c8ac85208706d27436e8d421dfa39d4c914dcf5fa8083a9305f58d9/tomli-2.3.0-cp311-cp311-win32.whl", hash = "sha256:00b5f5d95bbfc7d12f91ad8c593a1659b6387b43f054104cda404be6bda62456", size = 96445, upload-time = "2025-10-08T22:01:06.896Z" }, - { url = "https://files.pythonhosted.org/packages/0a/fe/3d3420c4cb1ad9cb462fb52967080575f15898da97e21cb6f1361d505383/tomli-2.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:4dc4ce8483a5d429ab602f111a93a6ab1ed425eae3122032db7e9acf449451be", size = 107165, upload-time = "2025-10-08T22:01:08.107Z" }, - { url = "https://files.pythonhosted.org/packages/ff/b7/40f36368fcabc518bb11c8f06379a0fd631985046c038aca08c6d6a43c6e/tomli-2.3.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d7d86942e56ded512a594786a5ba0a5e521d02529b3826e7761a05138341a2ac", size = 154891, upload-time = "2025-10-08T22:01:09.082Z" }, - { url = "https://files.pythonhosted.org/packages/f9/3f/d9dd692199e3b3aab2e4e4dd948abd0f790d9ded8cd10cbaae276a898434/tomli-2.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:73ee0b47d4dad1c5e996e3cd33b8a76a50167ae5f96a2607cbe8cc773506ab22", size = 148796, upload-time = "2025-10-08T22:01:10.266Z" }, - { url = "https://files.pythonhosted.org/packages/60/83/59bff4996c2cf9f9387a0f5a3394629c7efa5ef16142076a23a90f1955fa/tomli-2.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:792262b94d5d0a466afb5bc63c7daa9d75520110971ee269152083270998316f", size = 242121, upload-time = "2025-10-08T22:01:11.332Z" }, - { url = "https://files.pythonhosted.org/packages/45/e5/7c5119ff39de8693d6baab6c0b6dcb556d192c165596e9fc231ea1052041/tomli-2.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4f195fe57ecceac95a66a75ac24d9d5fbc98ef0962e09b2eddec5d39375aae52", size = 250070, upload-time = "2025-10-08T22:01:12.498Z" }, - { url = "https://files.pythonhosted.org/packages/45/12/ad5126d3a278f27e6701abde51d342aa78d06e27ce2bb596a01f7709a5a2/tomli-2.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e31d432427dcbf4d86958c184b9bfd1e96b5b71f8eb17e6d02531f434fd335b8", size = 245859, upload-time = "2025-10-08T22:01:13.551Z" }, - { url = "https://files.pythonhosted.org/packages/fb/a1/4d6865da6a71c603cfe6ad0e6556c73c76548557a8d658f9e3b142df245f/tomli-2.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b0882799624980785240ab732537fcfc372601015c00f7fc367c55308c186f6", size = 250296, upload-time = "2025-10-08T22:01:14.614Z" }, - { url = "https://files.pythonhosted.org/packages/a0/b7/a7a7042715d55c9ba6e8b196d65d2cb662578b4d8cd17d882d45322b0d78/tomli-2.3.0-cp312-cp312-win32.whl", hash = "sha256:ff72b71b5d10d22ecb084d345fc26f42b5143c5533db5e2eaba7d2d335358876", size = 97124, upload-time = "2025-10-08T22:01:15.629Z" }, - { url = "https://files.pythonhosted.org/packages/06/1e/f22f100db15a68b520664eb3328fb0ae4e90530887928558112c8d1f4515/tomli-2.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:1cb4ed918939151a03f33d4242ccd0aa5f11b3547d0cf30f7c74a408a5b99878", size = 107698, upload-time = "2025-10-08T22:01:16.51Z" }, - { url = "https://files.pythonhosted.org/packages/89/48/06ee6eabe4fdd9ecd48bf488f4ac783844fd777f547b8d1b61c11939974e/tomli-2.3.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5192f562738228945d7b13d4930baffda67b69425a7f0da96d360b0a3888136b", size = 154819, upload-time = "2025-10-08T22:01:17.964Z" }, - { url = "https://files.pythonhosted.org/packages/f1/01/88793757d54d8937015c75dcdfb673c65471945f6be98e6a0410fba167ed/tomli-2.3.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:be71c93a63d738597996be9528f4abe628d1adf5e6eb11607bc8fe1a510b5dae", size = 148766, upload-time = "2025-10-08T22:01:18.959Z" }, - { url = "https://files.pythonhosted.org/packages/42/17/5e2c956f0144b812e7e107f94f1cc54af734eb17b5191c0bbfb72de5e93e/tomli-2.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c4665508bcbac83a31ff8ab08f424b665200c0e1e645d2bd9ab3d3e557b6185b", size = 240771, upload-time = "2025-10-08T22:01:20.106Z" }, - { url = "https://files.pythonhosted.org/packages/d5/f4/0fbd014909748706c01d16824eadb0307115f9562a15cbb012cd9b3512c5/tomli-2.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4021923f97266babc6ccab9f5068642a0095faa0a51a246a6a02fccbb3514eaf", size = 248586, upload-time = "2025-10-08T22:01:21.164Z" }, - { url = "https://files.pythonhosted.org/packages/30/77/fed85e114bde5e81ecf9bc5da0cc69f2914b38f4708c80ae67d0c10180c5/tomli-2.3.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4ea38c40145a357d513bffad0ed869f13c1773716cf71ccaa83b0fa0cc4e42f", size = 244792, upload-time = "2025-10-08T22:01:22.417Z" }, - { url = "https://files.pythonhosted.org/packages/55/92/afed3d497f7c186dc71e6ee6d4fcb0acfa5f7d0a1a2878f8beae379ae0cc/tomli-2.3.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ad805ea85eda330dbad64c7ea7a4556259665bdf9d2672f5dccc740eb9d3ca05", size = 248909, upload-time = "2025-10-08T22:01:23.859Z" }, - { url = "https://files.pythonhosted.org/packages/f8/84/ef50c51b5a9472e7265ce1ffc7f24cd4023d289e109f669bdb1553f6a7c2/tomli-2.3.0-cp313-cp313-win32.whl", hash = "sha256:97d5eec30149fd3294270e889b4234023f2c69747e555a27bd708828353ab606", size = 96946, upload-time = "2025-10-08T22:01:24.893Z" }, - { url = "https://files.pythonhosted.org/packages/b2/b7/718cd1da0884f281f95ccfa3a6cc572d30053cba64603f79d431d3c9b61b/tomli-2.3.0-cp313-cp313-win_amd64.whl", hash = "sha256:0c95ca56fbe89e065c6ead5b593ee64b84a26fca063b5d71a1122bf26e533999", size = 107705, upload-time = "2025-10-08T22:01:26.153Z" }, - { url = "https://files.pythonhosted.org/packages/19/94/aeafa14a52e16163008060506fcb6aa1949d13548d13752171a755c65611/tomli-2.3.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:cebc6fe843e0733ee827a282aca4999b596241195f43b4cc371d64fc6639da9e", size = 154244, upload-time = "2025-10-08T22:01:27.06Z" }, - { url = "https://files.pythonhosted.org/packages/db/e4/1e58409aa78eefa47ccd19779fc6f36787edbe7d4cd330eeeedb33a4515b/tomli-2.3.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4c2ef0244c75aba9355561272009d934953817c49f47d768070c3c94355c2aa3", size = 148637, upload-time = "2025-10-08T22:01:28.059Z" }, - { url = "https://files.pythonhosted.org/packages/26/b6/d1eccb62f665e44359226811064596dd6a366ea1f985839c566cd61525ae/tomli-2.3.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c22a8bf253bacc0cf11f35ad9808b6cb75ada2631c2d97c971122583b129afbc", size = 241925, upload-time = "2025-10-08T22:01:29.066Z" }, - { url = "https://files.pythonhosted.org/packages/70/91/7cdab9a03e6d3d2bb11beae108da5bdc1c34bdeb06e21163482544ddcc90/tomli-2.3.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0eea8cc5c5e9f89c9b90c4896a8deefc74f518db5927d0e0e8d4a80953d774d0", size = 249045, upload-time = "2025-10-08T22:01:31.98Z" }, - { url = "https://files.pythonhosted.org/packages/15/1b/8c26874ed1f6e4f1fcfeb868db8a794cbe9f227299402db58cfcc858766c/tomli-2.3.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:b74a0e59ec5d15127acdabd75ea17726ac4c5178ae51b85bfe39c4f8a278e879", size = 245835, upload-time = "2025-10-08T22:01:32.989Z" }, - { url = "https://files.pythonhosted.org/packages/fd/42/8e3c6a9a4b1a1360c1a2a39f0b972cef2cc9ebd56025168c4137192a9321/tomli-2.3.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b5870b50c9db823c595983571d1296a6ff3e1b88f734a4c8f6fc6188397de005", size = 253109, upload-time = "2025-10-08T22:01:34.052Z" }, - { url = "https://files.pythonhosted.org/packages/22/0c/b4da635000a71b5f80130937eeac12e686eefb376b8dee113b4a582bba42/tomli-2.3.0-cp314-cp314-win32.whl", hash = "sha256:feb0dacc61170ed7ab602d3d972a58f14ee3ee60494292d384649a3dc38ef463", size = 97930, upload-time = "2025-10-08T22:01:35.082Z" }, - { url = "https://files.pythonhosted.org/packages/b9/74/cb1abc870a418ae99cd5c9547d6bce30701a954e0e721821df483ef7223c/tomli-2.3.0-cp314-cp314-win_amd64.whl", hash = "sha256:b273fcbd7fc64dc3600c098e39136522650c49bca95df2d11cf3b626422392c8", size = 107964, upload-time = "2025-10-08T22:01:36.057Z" }, - { url = "https://files.pythonhosted.org/packages/54/78/5c46fff6432a712af9f792944f4fcd7067d8823157949f4e40c56b8b3c83/tomli-2.3.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:940d56ee0410fa17ee1f12b817b37a4d4e4dc4d27340863cc67236c74f582e77", size = 163065, upload-time = "2025-10-08T22:01:37.27Z" }, - { url = "https://files.pythonhosted.org/packages/39/67/f85d9bd23182f45eca8939cd2bc7050e1f90c41f4a2ecbbd5963a1d1c486/tomli-2.3.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:f85209946d1fe94416debbb88d00eb92ce9cd5266775424ff81bc959e001acaf", size = 159088, upload-time = "2025-10-08T22:01:38.235Z" }, - { url = "https://files.pythonhosted.org/packages/26/5a/4b546a0405b9cc0659b399f12b6adb750757baf04250b148d3c5059fc4eb/tomli-2.3.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a56212bdcce682e56b0aaf79e869ba5d15a6163f88d5451cbde388d48b13f530", size = 268193, upload-time = "2025-10-08T22:01:39.712Z" }, - { url = "https://files.pythonhosted.org/packages/42/4f/2c12a72ae22cf7b59a7fe75b3465b7aba40ea9145d026ba41cb382075b0e/tomli-2.3.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c5f3ffd1e098dfc032d4d3af5c0ac64f6d286d98bc148698356847b80fa4de1b", size = 275488, upload-time = "2025-10-08T22:01:40.773Z" }, - { url = "https://files.pythonhosted.org/packages/92/04/a038d65dbe160c3aa5a624e93ad98111090f6804027d474ba9c37c8ae186/tomli-2.3.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:5e01decd096b1530d97d5d85cb4dff4af2d8347bd35686654a004f8dea20fc67", size = 272669, upload-time = "2025-10-08T22:01:41.824Z" }, - { url = "https://files.pythonhosted.org/packages/be/2f/8b7c60a9d1612a7cbc39ffcca4f21a73bf368a80fc25bccf8253e2563267/tomli-2.3.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:8a35dd0e643bb2610f156cca8db95d213a90015c11fee76c946aa62b7ae7e02f", size = 279709, upload-time = "2025-10-08T22:01:43.177Z" }, - { url = "https://files.pythonhosted.org/packages/7e/46/cc36c679f09f27ded940281c38607716c86cf8ba4a518d524e349c8b4874/tomli-2.3.0-cp314-cp314t-win32.whl", hash = "sha256:a1f7f282fe248311650081faafa5f4732bdbfef5d45fe3f2e702fbc6f2d496e0", size = 107563, upload-time = "2025-10-08T22:01:44.233Z" }, - { url = "https://files.pythonhosted.org/packages/84/ff/426ca8683cf7b753614480484f6437f568fd2fda2edbdf57a2d3d8b27a0b/tomli-2.3.0-cp314-cp314t-win_amd64.whl", hash = "sha256:70a251f8d4ba2d9ac2542eecf008b3c8a9fc5c3f9f02c56a9d7952612be2fdba", size = 119756, upload-time = "2025-10-08T22:01:45.234Z" }, - { url = "https://files.pythonhosted.org/packages/77/b8/0135fadc89e73be292b473cb820b4f5a08197779206b33191e801feeae40/tomli-2.3.0-py3-none-any.whl", hash = "sha256:e95b1af3c5b07d9e643909b5abbec77cd9f1217e6d0bca72b0234736b9fb1f1b", size = 14408, upload-time = "2025-10-08T22:01:46.04Z" }, + { url = "https://files.pythonhosted.org/packages/3c/d9/3dc2289e1f3b32eb19b9785b6a006b28ee99acb37d1d47f78d4c10e28bf8/tomli-2.4.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b5ef256a3fd497d4973c11bf142e9ed78b150d36f5773f1ca6088c230ffc5867", size = 153663, upload-time = "2026-01-11T11:21:45.27Z" }, + { url = "https://files.pythonhosted.org/packages/51/32/ef9f6845e6b9ca392cd3f64f9ec185cc6f09f0a2df3db08cbe8809d1d435/tomli-2.4.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5572e41282d5268eb09a697c89a7bee84fae66511f87533a6f88bd2f7b652da9", size = 148469, upload-time = "2026-01-11T11:21:46.873Z" }, + { url = "https://files.pythonhosted.org/packages/d6/c2/506e44cce89a8b1b1e047d64bd495c22c9f71f21e05f380f1a950dd9c217/tomli-2.4.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:551e321c6ba03b55676970b47cb1b73f14a0a4dce6a3e1a9458fd6d921d72e95", size = 236039, upload-time = "2026-01-11T11:21:48.503Z" }, + { url = "https://files.pythonhosted.org/packages/b3/40/e1b65986dbc861b7e986e8ec394598187fa8aee85b1650b01dd925ca0be8/tomli-2.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5e3f639a7a8f10069d0e15408c0b96a2a828cfdec6fca05296ebcdcc28ca7c76", size = 243007, upload-time = "2026-01-11T11:21:49.456Z" }, + { url = "https://files.pythonhosted.org/packages/9c/6f/6e39ce66b58a5b7ae572a0f4352ff40c71e8573633deda43f6a379d56b3e/tomli-2.4.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1b168f2731796b045128c45982d3a4874057626da0e2ef1fdd722848b741361d", size = 240875, upload-time = "2026-01-11T11:21:50.755Z" }, + { url = "https://files.pythonhosted.org/packages/aa/ad/cb089cb190487caa80204d503c7fd0f4d443f90b95cf4ef5cf5aa0f439b0/tomli-2.4.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:133e93646ec4300d651839d382d63edff11d8978be23da4cc106f5a18b7d0576", size = 246271, upload-time = "2026-01-11T11:21:51.81Z" }, + { url = "https://files.pythonhosted.org/packages/0b/63/69125220e47fd7a3a27fd0de0c6398c89432fec41bc739823bcc66506af6/tomli-2.4.0-cp311-cp311-win32.whl", hash = "sha256:b6c78bdf37764092d369722d9946cb65b8767bfa4110f902a1b2542d8d173c8a", size = 96770, upload-time = "2026-01-11T11:21:52.647Z" }, + { url = "https://files.pythonhosted.org/packages/1e/0d/a22bb6c83f83386b0008425a6cd1fa1c14b5f3dd4bad05e98cf3dbbf4a64/tomli-2.4.0-cp311-cp311-win_amd64.whl", hash = "sha256:d3d1654e11d724760cdb37a3d7691f0be9db5fbdaef59c9f532aabf87006dbaa", size = 107626, upload-time = "2026-01-11T11:21:53.459Z" }, + { url = "https://files.pythonhosted.org/packages/2f/6d/77be674a3485e75cacbf2ddba2b146911477bd887dda9d8c9dfb2f15e871/tomli-2.4.0-cp311-cp311-win_arm64.whl", hash = "sha256:cae9c19ed12d4e8f3ebf46d1a75090e4c0dc16271c5bce1c833ac168f08fb614", size = 94842, upload-time = "2026-01-11T11:21:54.831Z" }, + { url = "https://files.pythonhosted.org/packages/3c/43/7389a1869f2f26dba52404e1ef13b4784b6b37dac93bac53457e3ff24ca3/tomli-2.4.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:920b1de295e72887bafa3ad9f7a792f811847d57ea6b1215154030cf131f16b1", size = 154894, upload-time = "2026-01-11T11:21:56.07Z" }, + { url = "https://files.pythonhosted.org/packages/e9/05/2f9bf110b5294132b2edf13fe6ca6ae456204f3d749f623307cbb7a946f2/tomli-2.4.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7d6d9a4aee98fac3eab4952ad1d73aee87359452d1c086b5ceb43ed02ddb16b8", size = 149053, upload-time = "2026-01-11T11:21:57.467Z" }, + { url = "https://files.pythonhosted.org/packages/e8/41/1eda3ca1abc6f6154a8db4d714a4d35c4ad90adc0bcf700657291593fbf3/tomli-2.4.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:36b9d05b51e65b254ea6c2585b59d2c4cb91c8a3d91d0ed0f17591a29aaea54a", size = 243481, upload-time = "2026-01-11T11:21:58.661Z" }, + { url = "https://files.pythonhosted.org/packages/d2/6d/02ff5ab6c8868b41e7d4b987ce2b5f6a51d3335a70aa144edd999e055a01/tomli-2.4.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1c8a885b370751837c029ef9bc014f27d80840e48bac415f3412e6593bbc18c1", size = 251720, upload-time = "2026-01-11T11:22:00.178Z" }, + { url = "https://files.pythonhosted.org/packages/7b/57/0405c59a909c45d5b6f146107c6d997825aa87568b042042f7a9c0afed34/tomli-2.4.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8768715ffc41f0008abe25d808c20c3d990f42b6e2e58305d5da280ae7d1fa3b", size = 247014, upload-time = "2026-01-11T11:22:01.238Z" }, + { url = "https://files.pythonhosted.org/packages/2c/0e/2e37568edd944b4165735687cbaf2fe3648129e440c26d02223672ee0630/tomli-2.4.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7b438885858efd5be02a9a133caf5812b8776ee0c969fea02c45e8e3f296ba51", size = 251820, upload-time = "2026-01-11T11:22:02.727Z" }, + { url = "https://files.pythonhosted.org/packages/5a/1c/ee3b707fdac82aeeb92d1a113f803cf6d0f37bdca0849cb489553e1f417a/tomli-2.4.0-cp312-cp312-win32.whl", hash = "sha256:0408e3de5ec77cc7f81960c362543cbbd91ef883e3138e81b729fc3eea5b9729", size = 97712, upload-time = "2026-01-11T11:22:03.777Z" }, + { url = "https://files.pythonhosted.org/packages/69/13/c07a9177d0b3bab7913299b9278845fc6eaaca14a02667c6be0b0a2270c8/tomli-2.4.0-cp312-cp312-win_amd64.whl", hash = "sha256:685306e2cc7da35be4ee914fd34ab801a6acacb061b6a7abca922aaf9ad368da", size = 108296, upload-time = "2026-01-11T11:22:04.86Z" }, + { url = "https://files.pythonhosted.org/packages/18/27/e267a60bbeeee343bcc279bb9e8fbed0cbe224bc7b2a3dc2975f22809a09/tomli-2.4.0-cp312-cp312-win_arm64.whl", hash = "sha256:5aa48d7c2356055feef06a43611fc401a07337d5b006be13a30f6c58f869e3c3", size = 94553, upload-time = "2026-01-11T11:22:05.854Z" }, + { url = "https://files.pythonhosted.org/packages/34/91/7f65f9809f2936e1f4ce6268ae1903074563603b2a2bd969ebbda802744f/tomli-2.4.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:84d081fbc252d1b6a982e1870660e7330fb8f90f676f6e78b052ad4e64714bf0", size = 154915, upload-time = "2026-01-11T11:22:06.703Z" }, + { url = "https://files.pythonhosted.org/packages/20/aa/64dd73a5a849c2e8f216b755599c511badde80e91e9bc2271baa7b2cdbb1/tomli-2.4.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:9a08144fa4cba33db5255f9b74f0b89888622109bd2776148f2597447f92a94e", size = 149038, upload-time = "2026-01-11T11:22:07.56Z" }, + { url = "https://files.pythonhosted.org/packages/9e/8a/6d38870bd3d52c8d1505ce054469a73f73a0fe62c0eaf5dddf61447e32fa/tomli-2.4.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c73add4bb52a206fd0c0723432db123c0c75c280cbd67174dd9d2db228ebb1b4", size = 242245, upload-time = "2026-01-11T11:22:08.344Z" }, + { url = "https://files.pythonhosted.org/packages/59/bb/8002fadefb64ab2669e5b977df3f5e444febea60e717e755b38bb7c41029/tomli-2.4.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1fb2945cbe303b1419e2706e711b7113da57b7db31ee378d08712d678a34e51e", size = 250335, upload-time = "2026-01-11T11:22:09.951Z" }, + { url = "https://files.pythonhosted.org/packages/a5/3d/4cdb6f791682b2ea916af2de96121b3cb1284d7c203d97d92d6003e91c8d/tomli-2.4.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:bbb1b10aa643d973366dc2cb1ad94f99c1726a02343d43cbc011edbfac579e7c", size = 245962, upload-time = "2026-01-11T11:22:11.27Z" }, + { url = "https://files.pythonhosted.org/packages/f2/4a/5f25789f9a460bd858ba9756ff52d0830d825b458e13f754952dd15fb7bb/tomli-2.4.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4cbcb367d44a1f0c2be408758b43e1ffb5308abe0ea222897d6bfc8e8281ef2f", size = 250396, upload-time = "2026-01-11T11:22:12.325Z" }, + { url = "https://files.pythonhosted.org/packages/aa/2f/b73a36fea58dfa08e8b3a268750e6853a6aac2a349241a905ebd86f3047a/tomli-2.4.0-cp313-cp313-win32.whl", hash = "sha256:7d49c66a7d5e56ac959cb6fc583aff0651094ec071ba9ad43df785abc2320d86", size = 97530, upload-time = "2026-01-11T11:22:13.865Z" }, + { url = "https://files.pythonhosted.org/packages/3b/af/ca18c134b5d75de7e8dc551c5234eaba2e8e951f6b30139599b53de9c187/tomli-2.4.0-cp313-cp313-win_amd64.whl", hash = "sha256:3cf226acb51d8f1c394c1b310e0e0e61fecdd7adcb78d01e294ac297dd2e7f87", size = 108227, upload-time = "2026-01-11T11:22:15.224Z" }, + { url = "https://files.pythonhosted.org/packages/22/c3/b386b832f209fee8073c8138ec50f27b4460db2fdae9ffe022df89a57f9b/tomli-2.4.0-cp313-cp313-win_arm64.whl", hash = "sha256:d20b797a5c1ad80c516e41bc1fb0443ddb5006e9aaa7bda2d71978346aeb9132", size = 94748, upload-time = "2026-01-11T11:22:16.009Z" }, + { url = "https://files.pythonhosted.org/packages/f3/c4/84047a97eb1004418bc10bdbcfebda209fca6338002eba2dc27cc6d13563/tomli-2.4.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:26ab906a1eb794cd4e103691daa23d95c6919cc2fa9160000ac02370cc9dd3f6", size = 154725, upload-time = "2026-01-11T11:22:17.269Z" }, + { url = "https://files.pythonhosted.org/packages/a8/5d/d39038e646060b9d76274078cddf146ced86dc2b9e8bbf737ad5983609a0/tomli-2.4.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:20cedb4ee43278bc4f2fee6cb50daec836959aadaf948db5172e776dd3d993fc", size = 148901, upload-time = "2026-01-11T11:22:18.287Z" }, + { url = "https://files.pythonhosted.org/packages/73/e5/383be1724cb30f4ce44983d249645684a48c435e1cd4f8b5cded8a816d3c/tomli-2.4.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:39b0b5d1b6dd03684b3fb276407ebed7090bbec989fa55838c98560c01113b66", size = 243375, upload-time = "2026-01-11T11:22:19.154Z" }, + { url = "https://files.pythonhosted.org/packages/31/f0/bea80c17971c8d16d3cc109dc3585b0f2ce1036b5f4a8a183789023574f2/tomli-2.4.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a26d7ff68dfdb9f87a016ecfd1e1c2bacbe3108f4e0f8bcd2228ef9a766c787d", size = 250639, upload-time = "2026-01-11T11:22:20.168Z" }, + { url = "https://files.pythonhosted.org/packages/2c/8f/2853c36abbb7608e3f945d8a74e32ed3a74ee3a1f468f1ffc7d1cb3abba6/tomli-2.4.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:20ffd184fb1df76a66e34bd1b36b4a4641bd2b82954befa32fe8163e79f1a702", size = 246897, upload-time = "2026-01-11T11:22:21.544Z" }, + { url = "https://files.pythonhosted.org/packages/49/f0/6c05e3196ed5337b9fe7ea003e95fd3819a840b7a0f2bf5a408ef1dad8ed/tomli-2.4.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:75c2f8bbddf170e8effc98f5e9084a8751f8174ea6ccf4fca5398436e0320bc8", size = 254697, upload-time = "2026-01-11T11:22:23.058Z" }, + { url = "https://files.pythonhosted.org/packages/f3/f5/2922ef29c9f2951883525def7429967fc4d8208494e5ab524234f06b688b/tomli-2.4.0-cp314-cp314-win32.whl", hash = "sha256:31d556d079d72db7c584c0627ff3a24c5d3fb4f730221d3444f3efb1b2514776", size = 98567, upload-time = "2026-01-11T11:22:24.033Z" }, + { url = "https://files.pythonhosted.org/packages/7b/31/22b52e2e06dd2a5fdbc3ee73226d763b184ff21fc24e20316a44ccc4d96b/tomli-2.4.0-cp314-cp314-win_amd64.whl", hash = "sha256:43e685b9b2341681907759cf3a04e14d7104b3580f808cfde1dfdb60ada85475", size = 108556, upload-time = "2026-01-11T11:22:25.378Z" }, + { url = "https://files.pythonhosted.org/packages/48/3d/5058dff3255a3d01b705413f64f4306a141a8fd7a251e5a495e3f192a998/tomli-2.4.0-cp314-cp314-win_arm64.whl", hash = "sha256:3d895d56bd3f82ddd6faaff993c275efc2ff38e52322ea264122d72729dca2b2", size = 96014, upload-time = "2026-01-11T11:22:26.138Z" }, + { url = "https://files.pythonhosted.org/packages/b8/4e/75dab8586e268424202d3a1997ef6014919c941b50642a1682df43204c22/tomli-2.4.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:5b5807f3999fb66776dbce568cc9a828544244a8eb84b84b9bafc080c99597b9", size = 163339, upload-time = "2026-01-11T11:22:27.143Z" }, + { url = "https://files.pythonhosted.org/packages/06/e3/b904d9ab1016829a776d97f163f183a48be6a4deb87304d1e0116a349519/tomli-2.4.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c084ad935abe686bd9c898e62a02a19abfc9760b5a79bc29644463eaf2840cb0", size = 159490, upload-time = "2026-01-11T11:22:28.399Z" }, + { url = "https://files.pythonhosted.org/packages/e3/5a/fc3622c8b1ad823e8ea98a35e3c632ee316d48f66f80f9708ceb4f2a0322/tomli-2.4.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0f2e3955efea4d1cfbcb87bc321e00dc08d2bcb737fd1d5e398af111d86db5df", size = 269398, upload-time = "2026-01-11T11:22:29.345Z" }, + { url = "https://files.pythonhosted.org/packages/fd/33/62bd6152c8bdd4c305ad9faca48f51d3acb2df1f8791b1477d46ff86e7f8/tomli-2.4.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0e0fe8a0b8312acf3a88077a0802565cb09ee34107813bba1c7cd591fa6cfc8d", size = 276515, upload-time = "2026-01-11T11:22:30.327Z" }, + { url = "https://files.pythonhosted.org/packages/4b/ff/ae53619499f5235ee4211e62a8d7982ba9e439a0fb4f2f351a93d67c1dd2/tomli-2.4.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:413540dce94673591859c4c6f794dfeaa845e98bf35d72ed59636f869ef9f86f", size = 273806, upload-time = "2026-01-11T11:22:32.56Z" }, + { url = "https://files.pythonhosted.org/packages/47/71/cbca7787fa68d4d0a9f7072821980b39fbb1b6faeb5f5cf02f4a5559fa28/tomli-2.4.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:0dc56fef0e2c1c470aeac5b6ca8cc7b640bb93e92d9803ddaf9ea03e198f5b0b", size = 281340, upload-time = "2026-01-11T11:22:33.505Z" }, + { url = "https://files.pythonhosted.org/packages/f5/00/d595c120963ad42474cf6ee7771ad0d0e8a49d0f01e29576ee9195d9ecdf/tomli-2.4.0-cp314-cp314t-win32.whl", hash = "sha256:d878f2a6707cc9d53a1be1414bbb419e629c3d6e67f69230217bb663e76b5087", size = 108106, upload-time = "2026-01-11T11:22:34.451Z" }, + { url = "https://files.pythonhosted.org/packages/de/69/9aa0c6a505c2f80e519b43764f8b4ba93b5a0bbd2d9a9de6e2b24271b9a5/tomli-2.4.0-cp314-cp314t-win_amd64.whl", hash = "sha256:2add28aacc7425117ff6364fe9e06a183bb0251b03f986df0e78e974047571fd", size = 120504, upload-time = "2026-01-11T11:22:35.764Z" }, + { url = "https://files.pythonhosted.org/packages/b3/9f/f1668c281c58cfae01482f7114a4b88d345e4c140386241a1a24dcc9e7bc/tomli-2.4.0-cp314-cp314t-win_arm64.whl", hash = "sha256:2b1e3b80e1d5e52e40e9b924ec43d81570f0e7d09d11081b797bc4692765a3d4", size = 99561, upload-time = "2026-01-11T11:22:36.624Z" }, + { url = "https://files.pythonhosted.org/packages/23/d1/136eb2cb77520a31e1f64cbae9d33ec6df0d78bdf4160398e86eec8a8754/tomli-2.4.0-py3-none-any.whl", hash = "sha256:1f776e7d669ebceb01dee46484485f43a4048746235e683bcdffacdf1fb4785a", size = 14477, upload-time = "2026-01-11T11:22:37.446Z" }, ] [[package]] From 656d33be029347998acaebecccc2e4db69045d3f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Feb 2026 23:28:00 +0000 Subject: [PATCH 965/993] feat(benchmarks): scenario scoring timeout (#7300) --- .stats.yml | 4 ++-- .../resources/scenarios/scenarios.py | 16 ++++++++++++++++ .../types/scenario_create_params.py | 3 +++ .../types/scenario_update_params.py | 3 +++ src/runloop_api_client/types/scenario_view.py | 3 +++ tests/api_resources/test_scenarios.py | 4 ++++ 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 73c283357..e67aab9dd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 117 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-15b7fd06098d8cb3639efb3b401a03d7d97a8ab4960b08077aa871f0cacb33d3.yml -openapi_spec_hash: 93ab2fe88f9e57d8f262ad6d1179190e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ddfb27dde3b560eea5c53bfc8489439ace1501a7bb6a44aaeb3fd4859c6b65da.yml +openapi_spec_hash: 47021a450cbaa18b225148c5db188dd4 config_hash: eb28692edd68a6ae95cf92af931c9976 diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index 41777339b..3ec437011 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -93,6 +93,7 @@ def create( reference_output: Optional[str] | Omit = omit, required_environment_variables: Optional[SequenceNotStr[str]] | Omit = omit, required_secret_names: Optional[SequenceNotStr[str]] | Omit = omit, + scorer_timeout_sec: Optional[int] | Omit = omit, validation_type: Optional[Literal["UNSPECIFIED", "FORWARD", "REVERSE", "EVALUATION"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -128,6 +129,8 @@ def create( secret name). If these secrets are not provided or the mapping is incorrect, the scenario will fail to start. + scorer_timeout_sec: Timeout for scoring in seconds. Default 30 minutes (1800s). + validation_type: Validation strategy. extra_headers: Send extra headers @@ -152,6 +155,7 @@ def create( "reference_output": reference_output, "required_environment_variables": required_environment_variables, "required_secret_names": required_secret_names, + "scorer_timeout_sec": scorer_timeout_sec, "validation_type": validation_type, }, scenario_create_params.ScenarioCreateParams, @@ -210,6 +214,7 @@ def update( reference_output: Optional[str] | Omit = omit, required_environment_variables: Optional[SequenceNotStr[str]] | Omit = omit, required_secret_names: Optional[SequenceNotStr[str]] | Omit = omit, + scorer_timeout_sec: Optional[int] | Omit = omit, scoring_contract: Optional[ScoringContractUpdateParam] | Omit = omit, validation_type: Optional[Literal["UNSPECIFIED", "FORWARD", "REVERSE", "EVALUATION"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -243,6 +248,8 @@ def update( required_secret_names: Secrets required to run the scenario. Pass in empty list to clear. + scorer_timeout_sec: Timeout for scoring in seconds. Default 30 minutes (1800s). + scoring_contract: The scoring contract for the Scenario. validation_type: Validation strategy. Pass in empty string to clear. @@ -270,6 +277,7 @@ def update( "reference_output": reference_output, "required_environment_variables": required_environment_variables, "required_secret_names": required_secret_names, + "scorer_timeout_sec": scorer_timeout_sec, "scoring_contract": scoring_contract, "validation_type": validation_type, }, @@ -497,6 +505,7 @@ async def create( reference_output: Optional[str] | Omit = omit, required_environment_variables: Optional[SequenceNotStr[str]] | Omit = omit, required_secret_names: Optional[SequenceNotStr[str]] | Omit = omit, + scorer_timeout_sec: Optional[int] | Omit = omit, validation_type: Optional[Literal["UNSPECIFIED", "FORWARD", "REVERSE", "EVALUATION"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -532,6 +541,8 @@ async def create( secret name). If these secrets are not provided or the mapping is incorrect, the scenario will fail to start. + scorer_timeout_sec: Timeout for scoring in seconds. Default 30 minutes (1800s). + validation_type: Validation strategy. extra_headers: Send extra headers @@ -556,6 +567,7 @@ async def create( "reference_output": reference_output, "required_environment_variables": required_environment_variables, "required_secret_names": required_secret_names, + "scorer_timeout_sec": scorer_timeout_sec, "validation_type": validation_type, }, scenario_create_params.ScenarioCreateParams, @@ -614,6 +626,7 @@ async def update( reference_output: Optional[str] | Omit = omit, required_environment_variables: Optional[SequenceNotStr[str]] | Omit = omit, required_secret_names: Optional[SequenceNotStr[str]] | Omit = omit, + scorer_timeout_sec: Optional[int] | Omit = omit, scoring_contract: Optional[ScoringContractUpdateParam] | Omit = omit, validation_type: Optional[Literal["UNSPECIFIED", "FORWARD", "REVERSE", "EVALUATION"]] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -647,6 +660,8 @@ async def update( required_secret_names: Secrets required to run the scenario. Pass in empty list to clear. + scorer_timeout_sec: Timeout for scoring in seconds. Default 30 minutes (1800s). + scoring_contract: The scoring contract for the Scenario. validation_type: Validation strategy. Pass in empty string to clear. @@ -674,6 +689,7 @@ async def update( "reference_output": reference_output, "required_environment_variables": required_environment_variables, "required_secret_names": required_secret_names, + "scorer_timeout_sec": scorer_timeout_sec, "scoring_contract": scoring_contract, "validation_type": validation_type, }, diff --git a/src/runloop_api_client/types/scenario_create_params.py b/src/runloop_api_client/types/scenario_create_params.py index 464f9bad2..5b503a247 100644 --- a/src/runloop_api_client/types/scenario_create_params.py +++ b/src/runloop_api_client/types/scenario_create_params.py @@ -49,5 +49,8 @@ class ScenarioCreateParams(TypedDict, total=False): scenario will fail to start. """ + scorer_timeout_sec: Optional[int] + """Timeout for scoring in seconds. Default 30 minutes (1800s).""" + validation_type: Optional[Literal["UNSPECIFIED", "FORWARD", "REVERSE", "EVALUATION"]] """Validation strategy.""" diff --git a/src/runloop_api_client/types/scenario_update_params.py b/src/runloop_api_client/types/scenario_update_params.py index 9d0fc65e5..c79cb1721 100644 --- a/src/runloop_api_client/types/scenario_update_params.py +++ b/src/runloop_api_client/types/scenario_update_params.py @@ -42,6 +42,9 @@ class ScenarioUpdateParams(TypedDict, total=False): required_secret_names: Optional[SequenceNotStr[str]] """Secrets required to run the scenario. Pass in empty list to clear.""" + scorer_timeout_sec: Optional[int] + """Timeout for scoring in seconds. Default 30 minutes (1800s).""" + scoring_contract: Optional[ScoringContractUpdateParam] """The scoring contract for the Scenario.""" diff --git a/src/runloop_api_client/types/scenario_view.py b/src/runloop_api_client/types/scenario_view.py index 5c5ba0164..4604bd957 100644 --- a/src/runloop_api_client/types/scenario_view.py +++ b/src/runloop_api_client/types/scenario_view.py @@ -57,5 +57,8 @@ class ScenarioView(BaseModel): If any required secrets are missing, the scenario will fail to start. """ + scorer_timeout_sec: Optional[int] = None + """Timeout for scoring in seconds. Default 30 minutes (1800s).""" + validation_type: Optional[Literal["UNSPECIFIED", "FORWARD", "REVERSE", "EVALUATION"]] = None """Validation strategy.""" diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index 42cbb67b5..5b79fd558 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -93,6 +93,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: reference_output="reference_output", required_environment_variables=["string"], required_secret_names=["string"], + scorer_timeout_sec=0, validation_type="UNSPECIFIED", ) assert_matches_type(ScenarioView, scenario, path=["response"]) @@ -232,6 +233,7 @@ def test_method_update_with_all_params(self, client: Runloop) -> None: reference_output="reference_output", required_environment_variables=["string"], required_secret_names=["string"], + scorer_timeout_sec=0, scoring_contract={ "scoring_function_parameters": [ { @@ -502,6 +504,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - reference_output="reference_output", required_environment_variables=["string"], required_secret_names=["string"], + scorer_timeout_sec=0, validation_type="UNSPECIFIED", ) assert_matches_type(ScenarioView, scenario, path=["response"]) @@ -641,6 +644,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) - reference_output="reference_output", required_environment_variables=["string"], required_secret_names=["string"], + scorer_timeout_sec=0, scoring_contract={ "scoring_function_parameters": [ { From d0484abba547e1f72ff50d4ecaa1291207639205 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Feb 2026 03:51:59 +0000 Subject: [PATCH 966/993] fix: remove duplicate operationId createDevboxTunnel in openapi (#7397) --- .stats.yml | 4 ++-- src/runloop_api_client/resources/devboxes/devboxes.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index e67aab9dd..f64494027 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 117 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ddfb27dde3b560eea5c53bfc8489439ace1501a7bb6a44aaeb3fd4859c6b65da.yml -openapi_spec_hash: 47021a450cbaa18b225148c5db188dd4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-471f0db14911c89a212db3924c2b4eafb7282e665b1a7e92df4a371ed6c0635f.yml +openapi_spec_hash: 832848429246c457f6bda17a58949904 config_hash: eb28692edd68a6ae95cf92af931c9976 diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 05929c2c7..0735e3c8d 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -609,11 +609,11 @@ def enable_tunnel( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> TunnelView: - """Create a V2 tunnel for an existing running Devbox. + """Enable a V2 tunnel for an existing running Devbox. Tunnels provide encrypted URL-based access to the Devbox without exposing internal IDs. The tunnel URL - format is: https://{port}-{tunnel_key}.tunnel.runloop.ai + format is: https://{port}-{tunnel_key}.tunnel.runloop.ai Each Devbox can have one tunnel. @@ -2031,11 +2031,11 @@ async def enable_tunnel( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> TunnelView: - """Create a V2 tunnel for an existing running Devbox. + """Enable a V2 tunnel for an existing running Devbox. Tunnels provide encrypted URL-based access to the Devbox without exposing internal IDs. The tunnel URL - format is: https://{port}-{tunnel_key}.tunnel.runloop.ai + format is: https://{port}-{tunnel_key}.tunnel.runloop.ai Each Devbox can have one tunnel. From 160eadac1599e63745181a70e9948342d4eb1602 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Feb 2026 04:28:52 +0000 Subject: [PATCH 967/993] chore(internal): fix lint error on Python 3.14 --- src/runloop_api_client/_utils/_compat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runloop_api_client/_utils/_compat.py b/src/runloop_api_client/_utils/_compat.py index dd703233c..2c70b299c 100644 --- a/src/runloop_api_client/_utils/_compat.py +++ b/src/runloop_api_client/_utils/_compat.py @@ -26,7 +26,7 @@ def is_union(tp: Optional[Type[Any]]) -> bool: else: import types - return tp is Union or tp is types.UnionType + return tp is Union or tp is types.UnionType # type: ignore[comparison-overlap] def is_typeddict(tp: Type[Any]) -> bool: From da01d87745f3d176975fa7607040c57bb76e298f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Feb 2026 19:14:07 +0000 Subject: [PATCH 968/993] feat(devbox): expose snapshot size (in bytes) (#7444) --- .stats.yml | 4 ++-- src/runloop_api_client/types/devbox_snapshot_view.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f64494027..3e985df2f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 117 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-471f0db14911c89a212db3924c2b4eafb7282e665b1a7e92df4a371ed6c0635f.yml -openapi_spec_hash: 832848429246c457f6bda17a58949904 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c8d61a0c8b88fa30666ba021d1239eb0d549902354513c4741e9216bcbfa8e6d.yml +openapi_spec_hash: 433e6fb4ce076012b696f69ae7596c67 config_hash: eb28692edd68a6ae95cf92af931c9976 diff --git a/src/runloop_api_client/types/devbox_snapshot_view.py b/src/runloop_api_client/types/devbox_snapshot_view.py index 477f99d4e..84cb3e8ee 100644 --- a/src/runloop_api_client/types/devbox_snapshot_view.py +++ b/src/runloop_api_client/types/devbox_snapshot_view.py @@ -26,5 +26,8 @@ class DevboxSnapshotView(BaseModel): name: Optional[str] = None """(Optional) The custom name of the snapshot.""" + size_bytes: Optional[int] = None + """(Optional) The size of the snapshot in bytes, relative to the base blueprint.""" + source_blueprint_id: Optional[str] = None """(Optional) The source Blueprint ID this snapshot was created from.""" From dd1daea313199d776fe283a174c2c227486efe4a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Feb 2026 20:13:05 +0000 Subject: [PATCH 969/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index cce9d1c6d..c523ce19f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.7.0" + ".": "1.8.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 0f3a700eb..8ea0ed19d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "1.7.0" +version = "1.8.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index da0fd9d41..da91dc1ce 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "1.7.0" # x-release-please-version +__version__ = "1.8.0" # x-release-please-version diff --git a/uv.lock b/uv.lock index 84e4265df..d94681d0a 100644 --- a/uv.lock +++ b/uv.lock @@ -1316,7 +1316,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "1.7.0" +version = "1.8.0" source = { editable = "." } dependencies = [ { name = "anyio" }, From 50d37e28e81a69660268e1a76536779fabb55cf3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Feb 2026 03:41:45 +0000 Subject: [PATCH 970/993] chore: format all `api.md` files --- scripts/format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/format b/scripts/format index 1d2f9c6e6..c8e1f69d2 100755 --- a/scripts/format +++ b/scripts/format @@ -11,4 +11,4 @@ uv run ruff check --fix . uv run ruff format echo "==> Formatting docs" -uv run python scripts/utils/ruffen-docs.py README.md api.md +uv run python scripts/utils/ruffen-docs.py README.md $(find . -type f -name api.md) From 722a1ac2878cfb9c11836fef043ea8e99444da37 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Feb 2026 01:44:10 +0000 Subject: [PATCH 971/993] refactor: deprecate and make Nullable total_count and remaining_count of ListViews (#7533) --- .stats.yml | 4 +-- api.md | 2 +- .../resources/devboxes/devboxes.py | 17 ++++++++-- src/runloop_api_client/types/__init__.py | 1 + .../types/agent_list_view.py | 16 +++++++--- .../types/benchmark_job_list_view.py | 6 ++-- .../types/benchmark_run_list_view.py | 8 ++--- .../types/blueprint_list_view.py | 6 ++-- .../types/devbox_list_view.py | 6 ++-- .../types/devbox_shutdown_params.py | 12 +++++++ .../types/devbox_snapshot_list_view.py | 8 ++--- .../types/gateway_config_list_view.py | 9 ++++-- .../types/mcp_config_list_view.py | 9 ++++-- .../types/network_policy_list_view.py | 9 ++++-- .../types/object_list_view.py | 16 +++++++--- .../types/repository_connection_list_view.py | 8 ++--- .../types/scenario_definition_list_view.py | 8 ++--- .../types/scenario_run_list_view.py | 8 ++--- src/runloop_api_client/types/scenario_view.py | 3 ++ .../types/secret_list_view.py | 18 +++++++---- tests/api_resources/test_devboxes.py | 32 ++++++++++++++----- 21 files changed, 139 insertions(+), 67 deletions(-) create mode 100644 src/runloop_api_client/types/devbox_shutdown_params.py diff --git a/.stats.yml b/.stats.yml index 3e985df2f..44040dae9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 117 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c8d61a0c8b88fa30666ba021d1239eb0d549902354513c4741e9216bcbfa8e6d.yml -openapi_spec_hash: 433e6fb4ce076012b696f69ae7596c67 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8704a652545c3831c8b7e246ec17f1a626b59911eb5701ddc922ca6cae1c8d57.yml +openapi_spec_hash: e609bc5ed3fdce498bc7d16921bbba5e config_hash: eb28692edd68a6ae95cf92af931c9976 diff --git a/api.md b/api.md index 8da768ee1..17add5c24 100644 --- a/api.md +++ b/api.md @@ -158,7 +158,7 @@ Methods: - client.devboxes.remove_tunnel(id, \*\*params) -> object - client.devboxes.resume(id) -> DevboxView - client.devboxes.retrieve_resource_usage(id) -> DevboxResourceUsageView -- client.devboxes.shutdown(id) -> DevboxView +- client.devboxes.shutdown(id, \*\*params) -> DevboxView - client.devboxes.snapshot_disk(id, \*\*params) -> DevboxSnapshotView - client.devboxes.snapshot_disk_async(id, \*\*params) -> DevboxSnapshotView - client.devboxes.suspend(id) -> DevboxView diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 0735e3c8d..502a4c9ee 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -21,6 +21,7 @@ devbox_create_params, devbox_update_params, devbox_execute_params, + devbox_shutdown_params, devbox_upload_file_params, devbox_execute_sync_params, devbox_create_tunnel_params, @@ -1144,6 +1145,7 @@ def shutdown( self, id: str, *, + force: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1156,9 +1158,13 @@ def shutdown( This will permanently stop the Devbox. If you want to save the state of the Devbox, you should take a snapshot before shutting down or - should suspend the Devbox instead of shutting down. + should suspend the Devbox instead of shutting down. If the Devbox has any + in-progress snapshots, the shutdown will be rejected with a 409 Conflict unless + force=true is specified. Args: + force: If true, force shutdown even if snapshots are in progress. Defaults to false. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1179,6 +1185,7 @@ def shutdown( extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key, + query=maybe_transform({"force": force}, devbox_shutdown_params.DevboxShutdownParams), ), cast_to=DevboxView, ) @@ -2568,6 +2575,7 @@ async def shutdown( self, id: str, *, + force: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2580,9 +2588,13 @@ async def shutdown( This will permanently stop the Devbox. If you want to save the state of the Devbox, you should take a snapshot before shutting down or - should suspend the Devbox instead of shutting down. + should suspend the Devbox instead of shutting down. If the Devbox has any + in-progress snapshots, the shutdown will be rejected with a 409 Conflict unless + force=true is specified. Args: + force: If true, force shutdown even if snapshots are in progress. Defaults to false. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2603,6 +2615,7 @@ async def shutdown( extra_body=extra_body, timeout=timeout, idempotency_key=idempotency_key, + query=await async_maybe_transform({"force": force}, devbox_shutdown_params.DevboxShutdownParams), ), cast_to=DevboxView, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index e6543484f..2cd10b43d 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -55,6 +55,7 @@ from .blueprint_list_params import BlueprintListParams as BlueprintListParams from .devbox_execute_params import DevboxExecuteParams as DevboxExecuteParams from .blueprint_preview_view import BlueprintPreviewView as BlueprintPreviewView +from .devbox_shutdown_params import DevboxShutdownParams as DevboxShutdownParams from .mcp_config_list_params import McpConfigListParams as McpConfigListParams from .object_download_params import ObjectDownloadParams as ObjectDownloadParams from .repository_list_params import RepositoryListParams as RepositoryListParams diff --git a/src/runloop_api_client/types/agent_list_view.py b/src/runloop_api_client/types/agent_list_view.py index bfb1560e1..9e57a9769 100644 --- a/src/runloop_api_client/types/agent_list_view.py +++ b/src/runloop_api_client/types/agent_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from .._models import BaseModel from .agent_view import AgentView @@ -17,8 +17,14 @@ class AgentListView(BaseModel): has_more: bool """Whether there are more Agents to fetch.""" - remaining_count: int - """The count of remaining Agents.""" + remaining_count: Optional[int] = None + """The count of remaining Agents. - total_count: int - """The total count of Agents.""" + Deprecated: will be removed in a future breaking change. + """ + + total_count: Optional[int] = None + """The total count of Agents. + + Deprecated: will be removed in a future breaking change. + """ diff --git a/src/runloop_api_client/types/benchmark_job_list_view.py b/src/runloop_api_client/types/benchmark_job_list_view.py index 5090fe8e8..f0e1da7d0 100644 --- a/src/runloop_api_client/types/benchmark_job_list_view.py +++ b/src/runloop_api_client/types/benchmark_job_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from .._models import BaseModel from .benchmark_job_view import BenchmarkJobView @@ -14,6 +14,6 @@ class BenchmarkJobListView(BaseModel): jobs: List[BenchmarkJobView] """List of BenchmarkJobs matching filter.""" - remaining_count: int + remaining_count: Optional[int] = None - total_count: int + total_count: Optional[int] = None diff --git a/src/runloop_api_client/types/benchmark_run_list_view.py b/src/runloop_api_client/types/benchmark_run_list_view.py index 0d0ca11e1..e85506bab 100644 --- a/src/runloop_api_client/types/benchmark_run_list_view.py +++ b/src/runloop_api_client/types/benchmark_run_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from .._models import BaseModel from .benchmark_run_view import BenchmarkRunView @@ -11,9 +11,9 @@ class BenchmarkRunListView(BaseModel): has_more: bool - remaining_count: int - runs: List[BenchmarkRunView] """List of BenchmarkRuns matching filter.""" - total_count: int + remaining_count: Optional[int] = None + + total_count: Optional[int] = None diff --git a/src/runloop_api_client/types/blueprint_list_view.py b/src/runloop_api_client/types/blueprint_list_view.py index ba7c6066f..7d97314f5 100644 --- a/src/runloop_api_client/types/blueprint_list_view.py +++ b/src/runloop_api_client/types/blueprint_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from .._models import BaseModel from .blueprint_view import BlueprintView @@ -14,6 +14,6 @@ class BlueprintListView(BaseModel): has_more: bool - remaining_count: int + remaining_count: Optional[int] = None - total_count: int + total_count: Optional[int] = None diff --git a/src/runloop_api_client/types/devbox_list_view.py b/src/runloop_api_client/types/devbox_list_view.py index f4f266240..6bd522ee5 100644 --- a/src/runloop_api_client/types/devbox_list_view.py +++ b/src/runloop_api_client/types/devbox_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from .._models import BaseModel from .devbox_view import DevboxView @@ -14,6 +14,6 @@ class DevboxListView(BaseModel): has_more: bool - remaining_count: int + remaining_count: Optional[int] = None - total_count: int + total_count: Optional[int] = None diff --git a/src/runloop_api_client/types/devbox_shutdown_params.py b/src/runloop_api_client/types/devbox_shutdown_params.py new file mode 100644 index 000000000..1a6af9336 --- /dev/null +++ b/src/runloop_api_client/types/devbox_shutdown_params.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["DevboxShutdownParams"] + + +class DevboxShutdownParams(TypedDict, total=False): + force: str + """If true, force shutdown even if snapshots are in progress. Defaults to false.""" diff --git a/src/runloop_api_client/types/devbox_snapshot_list_view.py b/src/runloop_api_client/types/devbox_snapshot_list_view.py index 3e687f0cc..ca54f2eb1 100644 --- a/src/runloop_api_client/types/devbox_snapshot_list_view.py +++ b/src/runloop_api_client/types/devbox_snapshot_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from .._models import BaseModel from .devbox_snapshot_view import DevboxSnapshotView @@ -11,9 +11,9 @@ class DevboxSnapshotListView(BaseModel): has_more: bool - remaining_count: int - snapshots: List[DevboxSnapshotView] """List of snapshots matching filter.""" - total_count: int + remaining_count: Optional[int] = None + + total_count: Optional[int] = None diff --git a/src/runloop_api_client/types/gateway_config_list_view.py b/src/runloop_api_client/types/gateway_config_list_view.py index 77fce4455..05511971f 100644 --- a/src/runloop_api_client/types/gateway_config_list_view.py +++ b/src/runloop_api_client/types/gateway_config_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from .._models import BaseModel from .gateway_config_view import GatewayConfigView @@ -17,5 +17,8 @@ class GatewayConfigListView(BaseModel): has_more: bool """Whether there are more results available beyond this page.""" - total_count: int - """Total count of GatewayConfigs that match the query.""" + total_count: Optional[int] = None + """Total count of GatewayConfigs that match the query. + + Deprecated: will be removed in a future breaking change. + """ diff --git a/src/runloop_api_client/types/mcp_config_list_view.py b/src/runloop_api_client/types/mcp_config_list_view.py index 72075a255..4992698c5 100644 --- a/src/runloop_api_client/types/mcp_config_list_view.py +++ b/src/runloop_api_client/types/mcp_config_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from .._models import BaseModel from .mcp_config_view import McpConfigView @@ -17,5 +17,8 @@ class McpConfigListView(BaseModel): mcp_configs: List[McpConfigView] """The list of McpConfigs.""" - total_count: int - """Total count of McpConfigs that match the query.""" + total_count: Optional[int] = None + """Total count of McpConfigs that match the query. + + Deprecated: will be removed in a future breaking change. + """ diff --git a/src/runloop_api_client/types/network_policy_list_view.py b/src/runloop_api_client/types/network_policy_list_view.py index 17bc7868f..ba031d0a9 100644 --- a/src/runloop_api_client/types/network_policy_list_view.py +++ b/src/runloop_api_client/types/network_policy_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from .._models import BaseModel from .network_policy_view import NetworkPolicyView @@ -17,5 +17,8 @@ class NetworkPolicyListView(BaseModel): network_policies: List[NetworkPolicyView] """The list of NetworkPolicies.""" - total_count: int - """Total count of items in this response.""" + total_count: Optional[int] = None + """Total count of items in this response. + + Deprecated: will be removed in a future breaking change. + """ diff --git a/src/runloop_api_client/types/object_list_view.py b/src/runloop_api_client/types/object_list_view.py index cfd546c0c..689c0899b 100644 --- a/src/runloop_api_client/types/object_list_view.py +++ b/src/runloop_api_client/types/object_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from .._models import BaseModel from .object_view import ObjectView @@ -17,8 +17,14 @@ class ObjectListView(BaseModel): objects: List[ObjectView] """List of Object entities.""" - remaining_count: int - """Number of Objects remaining after this page.""" + remaining_count: Optional[int] = None + """Number of Objects remaining after this page. - total_count: int - """Total number of Objects across all pages.""" + Deprecated: will be removed in a future breaking change. + """ + + total_count: Optional[int] = None + """Total number of Objects across all pages. + + Deprecated: will be removed in a future breaking change. + """ diff --git a/src/runloop_api_client/types/repository_connection_list_view.py b/src/runloop_api_client/types/repository_connection_list_view.py index 8085c4718..eea040bc4 100644 --- a/src/runloop_api_client/types/repository_connection_list_view.py +++ b/src/runloop_api_client/types/repository_connection_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from .._models import BaseModel from .repository_connection_view import RepositoryConnectionView @@ -11,9 +11,9 @@ class RepositoryConnectionListView(BaseModel): has_more: bool - remaining_count: int - repositories: List[RepositoryConnectionView] """List of repositories matching filter.""" - total_count: int + remaining_count: Optional[int] = None + + total_count: Optional[int] = None diff --git a/src/runloop_api_client/types/scenario_definition_list_view.py b/src/runloop_api_client/types/scenario_definition_list_view.py index 5aa4ac3e4..f39cf1ed9 100644 --- a/src/runloop_api_client/types/scenario_definition_list_view.py +++ b/src/runloop_api_client/types/scenario_definition_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from .._models import BaseModel from .scenario_view import ScenarioView @@ -11,9 +11,9 @@ class ScenarioDefinitionListView(BaseModel): has_more: bool - remaining_count: int - scenarios: List[ScenarioView] """List of Scenarios matching filter.""" - total_count: int + remaining_count: Optional[int] = None + + total_count: Optional[int] = None diff --git a/src/runloop_api_client/types/scenario_run_list_view.py b/src/runloop_api_client/types/scenario_run_list_view.py index db0d16d31..142292dda 100644 --- a/src/runloop_api_client/types/scenario_run_list_view.py +++ b/src/runloop_api_client/types/scenario_run_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from .._models import BaseModel from .scenario_run_view import ScenarioRunView @@ -11,9 +11,9 @@ class ScenarioRunListView(BaseModel): has_more: bool - remaining_count: int - runs: List[ScenarioRunView] """List of ScenarioRuns matching filter.""" - total_count: int + remaining_count: Optional[int] = None + + total_count: Optional[int] = None diff --git a/src/runloop_api_client/types/scenario_view.py b/src/runloop_api_client/types/scenario_view.py index 4604bd957..6685bbce2 100644 --- a/src/runloop_api_client/types/scenario_view.py +++ b/src/runloop_api_client/types/scenario_view.py @@ -31,6 +31,9 @@ class ScenarioView(BaseModel): scoring_contract: ScoringContract """The scoring contract for the Scenario.""" + status: str + """The state of the scenario.""" + environment: Optional[ScenarioEnvironment] = None """The Environment in which the Scenario is run.""" diff --git a/src/runloop_api_client/types/secret_list_view.py b/src/runloop_api_client/types/secret_list_view.py index 4d66fa2e4..2f10bae2c 100644 --- a/src/runloop_api_client/types/secret_list_view.py +++ b/src/runloop_api_client/types/secret_list_view.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from .._models import BaseModel from .secret_view import SecretView @@ -14,11 +14,17 @@ class SecretListView(BaseModel): has_more: bool """True if there are more results available beyond this page.""" - remaining_count: int - """Number of Secrets remaining after this page.""" - secrets: List[SecretView] """List of Secret objects. Values are omitted for security.""" - total_count: int - """Total number of Secrets across all pages.""" + remaining_count: Optional[int] = None + """Number of Secrets remaining after this page. + + Deprecated: will be removed in a future breaking change. + """ + + total_count: Optional[int] = None + """Total number of Secrets across all pages. + + Deprecated: will be removed in a future breaking change. + """ diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 205795c17..f7076796e 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -889,14 +889,22 @@ def test_path_params_retrieve_resource_usage(self, client: Runloop) -> None: @parametrize def test_method_shutdown(self, client: Runloop) -> None: devbox = client.devboxes.shutdown( - "id", + id="id", + ) + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + def test_method_shutdown_with_all_params(self, client: Runloop) -> None: + devbox = client.devboxes.shutdown( + id="id", + force="force", ) assert_matches_type(DevboxView, devbox, path=["response"]) @parametrize def test_raw_response_shutdown(self, client: Runloop) -> None: response = client.devboxes.with_raw_response.shutdown( - "id", + id="id", ) assert response.is_closed is True @@ -907,7 +915,7 @@ def test_raw_response_shutdown(self, client: Runloop) -> None: @parametrize def test_streaming_response_shutdown(self, client: Runloop) -> None: with client.devboxes.with_streaming_response.shutdown( - "id", + id="id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -921,7 +929,7 @@ def test_streaming_response_shutdown(self, client: Runloop) -> None: def test_path_params_shutdown(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): client.devboxes.with_raw_response.shutdown( - "", + id="", ) @parametrize @@ -2072,14 +2080,22 @@ async def test_path_params_retrieve_resource_usage(self, async_client: AsyncRunl @parametrize async def test_method_shutdown(self, async_client: AsyncRunloop) -> None: devbox = await async_client.devboxes.shutdown( - "id", + id="id", + ) + assert_matches_type(DevboxView, devbox, path=["response"]) + + @parametrize + async def test_method_shutdown_with_all_params(self, async_client: AsyncRunloop) -> None: + devbox = await async_client.devboxes.shutdown( + id="id", + force="force", ) assert_matches_type(DevboxView, devbox, path=["response"]) @parametrize async def test_raw_response_shutdown(self, async_client: AsyncRunloop) -> None: response = await async_client.devboxes.with_raw_response.shutdown( - "id", + id="id", ) assert response.is_closed is True @@ -2090,7 +2106,7 @@ async def test_raw_response_shutdown(self, async_client: AsyncRunloop) -> None: @parametrize async def test_streaming_response_shutdown(self, async_client: AsyncRunloop) -> None: async with async_client.devboxes.with_streaming_response.shutdown( - "id", + id="id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -2104,7 +2120,7 @@ async def test_streaming_response_shutdown(self, async_client: AsyncRunloop) -> async def test_path_params_shutdown(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): await async_client.devboxes.with_raw_response.shutdown( - "", + id="", ) @parametrize From 5adedb673e681caceeeea40985ab734fd75c9f4a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 01:02:11 +0000 Subject: [PATCH 972/993] chore(scenarios): make scenario status enum instead of string (#7552) --- .stats.yml | 4 ++-- src/runloop_api_client/types/scenario_view.py | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 44040dae9..27e05a0be 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 117 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-8704a652545c3831c8b7e246ec17f1a626b59911eb5701ddc922ca6cae1c8d57.yml -openapi_spec_hash: e609bc5ed3fdce498bc7d16921bbba5e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1ee005e7d8f97067abb96c6a38af53b69d362f2511ca775a9b78580a9643c253.yml +openapi_spec_hash: 9c54d19abf7993fd55714759f3265f9c config_hash: eb28692edd68a6ae95cf92af931c9976 diff --git a/src/runloop_api_client/types/scenario_view.py b/src/runloop_api_client/types/scenario_view.py index 6685bbce2..3bb470708 100644 --- a/src/runloop_api_client/types/scenario_view.py +++ b/src/runloop_api_client/types/scenario_view.py @@ -31,8 +31,11 @@ class ScenarioView(BaseModel): scoring_contract: ScoringContract """The scoring contract for the Scenario.""" - status: str - """The state of the scenario.""" + status: Literal["active", "archived"] + """Whether the scenario is active or archived. + + Archived scenarios are excluded from listings and cannot be updated. + """ environment: Optional[ScenarioEnvironment] = None """The Environment in which the Scenario is run.""" From 2b9a80a36d13fae7d39d9a9a5267a809bcee273c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 04:14:23 +0000 Subject: [PATCH 973/993] chore: update mock server docs --- CONTRIBUTING.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c428d61d5..9ac1ce602 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -88,8 +88,7 @@ $ pip install ./path-to-wheel-file.whl Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. ```sh -# you will need npm installed -$ npx prism mock path/to/your/openapi.yml +$ ./scripts/mock ``` ```sh From 9ab90d9f2c42396a680d0d0feca0bc9a0497064e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 00:39:49 +0000 Subject: [PATCH 974/993] chore: Add archive method to stainless (#7537) --- .stats.yml | 8 +- api.md | 1 + .../resources/devboxes/devboxes.py | 22 ++++- .../resources/scenarios/scenarios.py | 96 +++++++++++++++++++ .../types/devbox_create_params.py | 6 ++ .../types/devbox_enable_tunnel_params.py | 6 ++ src/runloop_api_client/types/tunnel_view.py | 6 ++ tests/api_resources/test_devboxes.py | 12 ++- tests/api_resources/test_scenarios.py | 76 +++++++++++++++ 9 files changed, 225 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 27e05a0be..a869301e9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 117 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1ee005e7d8f97067abb96c6a38af53b69d362f2511ca775a9b78580a9643c253.yml -openapi_spec_hash: 9c54d19abf7993fd55714759f3265f9c -config_hash: eb28692edd68a6ae95cf92af931c9976 +configured_endpoints: 118 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1a92de99959f20ab5850a7f89db21cb66269b2e0002ffc5e5afbe660d05b0768.yml +openapi_spec_hash: 41e4660f26e27e6ab94d223da4ec1253 +config_hash: cbda3692cb48ab8582a0df1674b9e5c8 diff --git a/api.md b/api.md index 17add5c24..23a3dee64 100644 --- a/api.md +++ b/api.md @@ -274,6 +274,7 @@ Methods: - client.scenarios.retrieve(id) -> ScenarioView - client.scenarios.update(id, \*\*params) -> ScenarioView - client.scenarios.list(\*\*params) -> SyncScenariosCursorIDPage[ScenarioView] +- client.scenarios.archive(id) -> ScenarioView - client.scenarios.list_public(\*\*params) -> SyncScenariosCursorIDPage[ScenarioView] - client.scenarios.start_run(\*\*params) -> ScenarioRunView diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 502a4c9ee..e287e86dc 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -602,6 +602,7 @@ def enable_tunnel( id: str, *, auth_mode: Optional[Literal["open", "authenticated"]] | Omit = omit, + http_keep_alive: Optional[bool] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -621,6 +622,9 @@ def enable_tunnel( Args: auth_mode: Authentication mode for the tunnel. Defaults to 'public' if not specified. + http_keep_alive: When true, HTTP traffic through the tunnel counts as activity for idle lifecycle + policies, resetting the idle timer. Defaults to true if not specified. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -635,7 +639,13 @@ def enable_tunnel( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/v1/devboxes/{id}/enable_tunnel", - body=maybe_transform({"auth_mode": auth_mode}, devbox_enable_tunnel_params.DevboxEnableTunnelParams), + body=maybe_transform( + { + "auth_mode": auth_mode, + "http_keep_alive": http_keep_alive, + }, + devbox_enable_tunnel_params.DevboxEnableTunnelParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -2030,6 +2040,7 @@ async def enable_tunnel( id: str, *, auth_mode: Optional[Literal["open", "authenticated"]] | Omit = omit, + http_keep_alive: Optional[bool] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2049,6 +2060,9 @@ async def enable_tunnel( Args: auth_mode: Authentication mode for the tunnel. Defaults to 'public' if not specified. + http_keep_alive: When true, HTTP traffic through the tunnel counts as activity for idle lifecycle + policies, resetting the idle timer. Defaults to true if not specified. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -2064,7 +2078,11 @@ async def enable_tunnel( return await self._post( f"/v1/devboxes/{id}/enable_tunnel", body=await async_maybe_transform( - {"auth_mode": auth_mode}, devbox_enable_tunnel_params.DevboxEnableTunnelParams + { + "auth_mode": auth_mode, + "http_keep_alive": http_keep_alive, + }, + devbox_enable_tunnel_params.DevboxEnableTunnelParams, ), options=make_request_options( extra_headers=extra_headers, diff --git a/src/runloop_api_client/resources/scenarios/scenarios.py b/src/runloop_api_client/resources/scenarios/scenarios.py index 3ec437011..3eb4849f6 100644 --- a/src/runloop_api_client/resources/scenarios/scenarios.py +++ b/src/runloop_api_client/resources/scenarios/scenarios.py @@ -352,6 +352,48 @@ def list( model=ScenarioView, ) + def archive( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> ScenarioView: + """Archive a previously created Scenario. + + The scenario will no longer appear in + list endpoints but can still be retrieved by ID. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/scenarios/{id}/archive", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ScenarioView, + ) + def list_public( self, *, @@ -764,6 +806,48 @@ def list( model=ScenarioView, ) + async def archive( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, + ) -> ScenarioView: + """Archive a previously created Scenario. + + The scenario will no longer appear in + list endpoints but can still be retrieved by ID. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/scenarios/{id}/archive", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=ScenarioView, + ) + def list_public( self, *, @@ -894,6 +978,9 @@ def __init__(self, scenarios: ScenariosResource) -> None: self.list = to_raw_response_wrapper( scenarios.list, ) + self.archive = to_raw_response_wrapper( + scenarios.archive, + ) self.list_public = to_raw_response_wrapper( scenarios.list_public, ) @@ -926,6 +1013,9 @@ def __init__(self, scenarios: AsyncScenariosResource) -> None: self.list = async_to_raw_response_wrapper( scenarios.list, ) + self.archive = async_to_raw_response_wrapper( + scenarios.archive, + ) self.list_public = async_to_raw_response_wrapper( scenarios.list_public, ) @@ -958,6 +1048,9 @@ def __init__(self, scenarios: ScenariosResource) -> None: self.list = to_streamed_response_wrapper( scenarios.list, ) + self.archive = to_streamed_response_wrapper( + scenarios.archive, + ) self.list_public = to_streamed_response_wrapper( scenarios.list_public, ) @@ -990,6 +1083,9 @@ def __init__(self, scenarios: AsyncScenariosResource) -> None: self.list = async_to_streamed_response_wrapper( scenarios.list, ) + self.archive = async_to_streamed_response_wrapper( + scenarios.archive, + ) self.list_public = async_to_streamed_response_wrapper( scenarios.list_public, ) diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index e6d27eb5d..db651d90a 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -130,3 +130,9 @@ class Tunnel(TypedDict, total=False): auth_mode: Optional[Literal["open", "authenticated"]] """Authentication mode for the tunnel. Defaults to 'public' if not specified.""" + + http_keep_alive: Optional[bool] + """ + When true, HTTP traffic through the tunnel counts as activity for idle lifecycle + policies, resetting the idle timer. Defaults to true if not specified. + """ diff --git a/src/runloop_api_client/types/devbox_enable_tunnel_params.py b/src/runloop_api_client/types/devbox_enable_tunnel_params.py index 9ccc53e75..4906c85ef 100644 --- a/src/runloop_api_client/types/devbox_enable_tunnel_params.py +++ b/src/runloop_api_client/types/devbox_enable_tunnel_params.py @@ -11,3 +11,9 @@ class DevboxEnableTunnelParams(TypedDict, total=False): auth_mode: Optional[Literal["open", "authenticated"]] """Authentication mode for the tunnel. Defaults to 'public' if not specified.""" + + http_keep_alive: Optional[bool] + """ + When true, HTTP traffic through the tunnel counts as activity for idle lifecycle + policies, resetting the idle timer. Defaults to true if not specified. + """ diff --git a/src/runloop_api_client/types/tunnel_view.py b/src/runloop_api_client/types/tunnel_view.py index 540a44e7c..9287cd4d2 100644 --- a/src/runloop_api_client/types/tunnel_view.py +++ b/src/runloop_api_client/types/tunnel_view.py @@ -21,6 +21,12 @@ class TunnelView(BaseModel): create_time_ms: int """Creation time of the tunnel (Unix timestamp milliseconds).""" + http_keep_alive: bool + """ + When true, HTTP traffic through the tunnel counts as activity for idle lifecycle + policies, resetting the idle timer. + """ + tunnel_key: str """The encrypted tunnel key used to construct the tunnel URL. diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index f7076796e..c22f79370 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -107,7 +107,10 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: repo_connection_id="repo_connection_id", secrets={"foo": "string"}, snapshot_id="snapshot_id", - tunnel={"auth_mode": "open"}, + tunnel={ + "auth_mode": "open", + "http_keep_alive": True, + }, ) assert_matches_type(DevboxView, devbox, path=["response"]) @@ -443,6 +446,7 @@ def test_method_enable_tunnel_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.enable_tunnel( id="id", auth_mode="open", + http_keep_alive=True, ) assert_matches_type(TunnelView, devbox, path=["response"]) @@ -1298,7 +1302,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - repo_connection_id="repo_connection_id", secrets={"foo": "string"}, snapshot_id="snapshot_id", - tunnel={"auth_mode": "open"}, + tunnel={ + "auth_mode": "open", + "http_keep_alive": True, + }, ) assert_matches_type(DevboxView, devbox, path=["response"]) @@ -1634,6 +1641,7 @@ async def test_method_enable_tunnel_with_all_params(self, async_client: AsyncRun devbox = await async_client.devboxes.enable_tunnel( id="id", auth_mode="open", + http_keep_alive=True, ) assert_matches_type(TunnelView, devbox, path=["response"]) diff --git a/tests/api_resources/test_scenarios.py b/tests/api_resources/test_scenarios.py index 5b79fd558..736a8395c 100644 --- a/tests/api_resources/test_scenarios.py +++ b/tests/api_resources/test_scenarios.py @@ -319,6 +319,44 @@ def test_streaming_response_list(self, client: Runloop) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_archive(self, client: Runloop) -> None: + scenario = client.scenarios.archive( + "id", + ) + assert_matches_type(ScenarioView, scenario, path=["response"]) + + @parametrize + def test_raw_response_archive(self, client: Runloop) -> None: + response = client.scenarios.with_raw_response.archive( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scenario = response.parse() + assert_matches_type(ScenarioView, scenario, path=["response"]) + + @parametrize + def test_streaming_response_archive(self, client: Runloop) -> None: + with client.scenarios.with_streaming_response.archive( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scenario = response.parse() + assert_matches_type(ScenarioView, scenario, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_archive(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.scenarios.with_raw_response.archive( + "", + ) + @parametrize def test_method_list_public(self, client: Runloop) -> None: scenario = client.scenarios.list_public() @@ -730,6 +768,44 @@ async def test_streaming_response_list(self, async_client: AsyncRunloop) -> None assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_archive(self, async_client: AsyncRunloop) -> None: + scenario = await async_client.scenarios.archive( + "id", + ) + assert_matches_type(ScenarioView, scenario, path=["response"]) + + @parametrize + async def test_raw_response_archive(self, async_client: AsyncRunloop) -> None: + response = await async_client.scenarios.with_raw_response.archive( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + scenario = await response.parse() + assert_matches_type(ScenarioView, scenario, path=["response"]) + + @parametrize + async def test_streaming_response_archive(self, async_client: AsyncRunloop) -> None: + async with async_client.scenarios.with_streaming_response.archive( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + scenario = await response.parse() + assert_matches_type(ScenarioView, scenario, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_archive(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.scenarios.with_raw_response.archive( + "", + ) + @parametrize async def test_method_list_public(self, async_client: AsyncRunloop) -> None: scenario = await async_client.scenarios.list_public() From c2599b604937fcdf493ad879c113da584a702531 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 04:21:08 +0000 Subject: [PATCH 975/993] chore(internal): add request options to SSE classes --- src/runloop_api_client/_response.py | 3 +++ src/runloop_api_client/_streaming.py | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/runloop_api_client/_response.py b/src/runloop_api_client/_response.py index 31591fad8..ddafda4fe 100644 --- a/src/runloop_api_client/_response.py +++ b/src/runloop_api_client/_response.py @@ -152,6 +152,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: ), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -162,6 +163,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=extract_stream_chunk_type(self._stream_cls), response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) @@ -175,6 +177,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T: cast_to=cast_to, response=self.http_response, client=cast(Any, self._client), + options=self._options, ), ) diff --git a/src/runloop_api_client/_streaming.py b/src/runloop_api_client/_streaming.py index 4dcc62b7c..16f910d25 100644 --- a/src/runloop_api_client/_streaming.py +++ b/src/runloop_api_client/_streaming.py @@ -4,7 +4,7 @@ import json import inspect from types import TracebackType -from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, AsyncIterator, cast +from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, Optional, AsyncIterator, cast from typing_extensions import Self, Protocol, TypeGuard, override, get_origin, runtime_checkable import httpx @@ -13,6 +13,7 @@ if TYPE_CHECKING: from ._client import Runloop, AsyncRunloop + from ._models import FinalRequestOptions _T = TypeVar("_T") @@ -22,7 +23,7 @@ class Stream(Generic[_T]): """Provides the core interface to iterate over a synchronous stream response.""" response: httpx.Response - + _options: Optional[FinalRequestOptions] = None _decoder: SSEBytesDecoder def __init__( @@ -31,10 +32,12 @@ def __init__( cast_to: type[_T], response: httpx.Response, client: Runloop, + options: Optional[FinalRequestOptions] = None, ) -> None: self.response = response self._cast_to = cast_to self._client = client + self._options = options self._decoder = client._make_sse_decoder() self._iterator = self.__stream__() @@ -85,7 +88,7 @@ class AsyncStream(Generic[_T]): """Provides the core interface to iterate over an asynchronous stream response.""" response: httpx.Response - + _options: Optional[FinalRequestOptions] = None _decoder: SSEDecoder | SSEBytesDecoder def __init__( @@ -94,10 +97,12 @@ def __init__( cast_to: type[_T], response: httpx.Response, client: AsyncRunloop, + options: Optional[FinalRequestOptions] = None, ) -> None: self.response = response self._cast_to = cast_to self._client = client + self._options = options self._decoder = client._make_sse_decoder() self._iterator = self.__stream__() From 8a25af519eb171c781e127df3abee6831440f0b4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 04:35:11 +0000 Subject: [PATCH 976/993] chore(internal): make `test_proxy_environment_variables` more resilient --- tests/test_client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_client.py b/tests/test_client.py index 3f5426415..f2b774db7 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1002,6 +1002,8 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + # Delete in case our environment has this set + monkeypatch.delenv("HTTP_PROXY", raising=False) client = DefaultHttpxClient() @@ -1953,6 +1955,8 @@ async def test_get_platform(self) -> None: async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") + # Delete in case our environment has this set + monkeypatch.delenv("HTTP_PROXY", raising=False) client = DefaultAsyncHttpxClient() From 2f56557cb68b151cbca97fd30b5de9ae8f669cad Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Feb 2026 04:17:46 +0000 Subject: [PATCH 977/993] chore(internal): make `test_proxy_environment_variables` more resilient to env --- tests/test_client.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index f2b774db7..725862258 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1002,8 +1002,14 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") - # Delete in case our environment has this set + # Delete in case our environment has any proxy env vars set monkeypatch.delenv("HTTP_PROXY", raising=False) + monkeypatch.delenv("ALL_PROXY", raising=False) + monkeypatch.delenv("NO_PROXY", raising=False) + monkeypatch.delenv("http_proxy", raising=False) + monkeypatch.delenv("https_proxy", raising=False) + monkeypatch.delenv("all_proxy", raising=False) + monkeypatch.delenv("no_proxy", raising=False) client = DefaultHttpxClient() @@ -1955,8 +1961,14 @@ async def test_get_platform(self) -> None: async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None: # Test that the proxy environment variables are set correctly monkeypatch.setenv("HTTPS_PROXY", "https://example.org") - # Delete in case our environment has this set + # Delete in case our environment has any proxy env vars set monkeypatch.delenv("HTTP_PROXY", raising=False) + monkeypatch.delenv("ALL_PROXY", raising=False) + monkeypatch.delenv("NO_PROXY", raising=False) + monkeypatch.delenv("http_proxy", raising=False) + monkeypatch.delenv("https_proxy", raising=False) + monkeypatch.delenv("all_proxy", raising=False) + monkeypatch.delenv("no_proxy", raising=False) client = DefaultAsyncHttpxClient() From 26456ab7bfd70020ce81b6a73ba30dc2b705cde4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Feb 2026 19:05:09 +0000 Subject: [PATCH 978/993] feat: Add AI gateway and MCP gateway flags to network policy create (#7638) --- .stats.yml | 4 +-- .../resources/network_policies.py | 36 +++++++++++++++++++ .../types/network_policy_create_params.py | 12 +++++++ .../types/network_policy_update_params.py | 6 ++++ .../types/network_policy_view.py | 9 +++++ tests/api_resources/test_network_policies.py | 8 +++++ 6 files changed, 73 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a869301e9..e8c2e4563 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 118 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-1a92de99959f20ab5850a7f89db21cb66269b2e0002ffc5e5afbe660d05b0768.yml -openapi_spec_hash: 41e4660f26e27e6ab94d223da4ec1253 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-dd0f43e15cb67179deaf86f83ae04c6fae4ff858ee33e82a3b89231566cdc5bb.yml +openapi_spec_hash: 569176c1c4f48efd25a44fa526fad9d1 config_hash: cbda3692cb48ab8582a0df1674b9e5c8 diff --git a/src/runloop_api_client/resources/network_policies.py b/src/runloop_api_client/resources/network_policies.py index 1cda5b42d..388126cee 100644 --- a/src/runloop_api_client/resources/network_policies.py +++ b/src/runloop_api_client/resources/network_policies.py @@ -48,8 +48,10 @@ def create( self, *, name: str, + allow_ai_gateway: Optional[bool] | Omit = omit, allow_all: Optional[bool] | Omit = omit, allow_devbox_to_devbox: Optional[bool] | Omit = omit, + allow_mcp_gateway: Optional[bool] | Omit = omit, allowed_hostnames: Optional[SequenceNotStr[str]] | Omit = omit, description: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -69,6 +71,9 @@ def create( name: The human-readable name for the NetworkPolicy. Must be unique within the account. + allow_ai_gateway: (Optional) If true, allows devbox egress to the AI credential gateway for + credential proxying. Defaults to false. + allow_all: (Optional) If true, all egress traffic is allowed (ALLOW_ALL policy). Defaults to false. @@ -76,6 +81,9 @@ def create( tunnels. Defaults to false. If allow_all is true, this is automatically set to true. + allow_mcp_gateway: (Optional) If true, allows devbox egress to the MCP hub for MCP server access. + Defaults to false. + allowed_hostnames: (Optional) DNS-based allow list with wildcard support. Examples: ['github.com', '*.npmjs.org']. @@ -96,8 +104,10 @@ def create( body=maybe_transform( { "name": name, + "allow_ai_gateway": allow_ai_gateway, "allow_all": allow_all, "allow_devbox_to_devbox": allow_devbox_to_devbox, + "allow_mcp_gateway": allow_mcp_gateway, "allowed_hostnames": allowed_hostnames, "description": description, }, @@ -150,8 +160,10 @@ def update( self, id: str, *, + allow_ai_gateway: Optional[bool] | Omit = omit, allow_all: Optional[bool] | Omit = omit, allow_devbox_to_devbox: Optional[bool] | Omit = omit, + allow_mcp_gateway: Optional[bool] | Omit = omit, allowed_hostnames: Optional[SequenceNotStr[str]] | Omit = omit, description: Optional[str] | Omit = omit, name: Optional[str] | Omit = omit, @@ -168,10 +180,14 @@ def update( All fields are optional. Args: + allow_ai_gateway: If true, allows devbox egress to the AI credential gateway. + allow_all: If true, all egress traffic is allowed (ALLOW_ALL policy). allow_devbox_to_devbox: If true, allows traffic between the account's own devboxes via tunnels. + allow_mcp_gateway: If true, allows devbox egress to the MCP hub. + allowed_hostnames: Updated DNS-based allow list with wildcard support. Examples: ['github.com', '*.npmjs.org']. @@ -195,8 +211,10 @@ def update( f"/v1/network-policies/{id}", body=maybe_transform( { + "allow_ai_gateway": allow_ai_gateway, "allow_all": allow_all, "allow_devbox_to_devbox": allow_devbox_to_devbox, + "allow_mcp_gateway": allow_mcp_gateway, "allowed_hostnames": allowed_hostnames, "description": description, "name": name, @@ -334,8 +352,10 @@ async def create( self, *, name: str, + allow_ai_gateway: Optional[bool] | Omit = omit, allow_all: Optional[bool] | Omit = omit, allow_devbox_to_devbox: Optional[bool] | Omit = omit, + allow_mcp_gateway: Optional[bool] | Omit = omit, allowed_hostnames: Optional[SequenceNotStr[str]] | Omit = omit, description: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -355,6 +375,9 @@ async def create( name: The human-readable name for the NetworkPolicy. Must be unique within the account. + allow_ai_gateway: (Optional) If true, allows devbox egress to the AI credential gateway for + credential proxying. Defaults to false. + allow_all: (Optional) If true, all egress traffic is allowed (ALLOW_ALL policy). Defaults to false. @@ -362,6 +385,9 @@ async def create( tunnels. Defaults to false. If allow_all is true, this is automatically set to true. + allow_mcp_gateway: (Optional) If true, allows devbox egress to the MCP hub for MCP server access. + Defaults to false. + allowed_hostnames: (Optional) DNS-based allow list with wildcard support. Examples: ['github.com', '*.npmjs.org']. @@ -382,8 +408,10 @@ async def create( body=await async_maybe_transform( { "name": name, + "allow_ai_gateway": allow_ai_gateway, "allow_all": allow_all, "allow_devbox_to_devbox": allow_devbox_to_devbox, + "allow_mcp_gateway": allow_mcp_gateway, "allowed_hostnames": allowed_hostnames, "description": description, }, @@ -436,8 +464,10 @@ async def update( self, id: str, *, + allow_ai_gateway: Optional[bool] | Omit = omit, allow_all: Optional[bool] | Omit = omit, allow_devbox_to_devbox: Optional[bool] | Omit = omit, + allow_mcp_gateway: Optional[bool] | Omit = omit, allowed_hostnames: Optional[SequenceNotStr[str]] | Omit = omit, description: Optional[str] | Omit = omit, name: Optional[str] | Omit = omit, @@ -454,10 +484,14 @@ async def update( All fields are optional. Args: + allow_ai_gateway: If true, allows devbox egress to the AI credential gateway. + allow_all: If true, all egress traffic is allowed (ALLOW_ALL policy). allow_devbox_to_devbox: If true, allows traffic between the account's own devboxes via tunnels. + allow_mcp_gateway: If true, allows devbox egress to the MCP hub. + allowed_hostnames: Updated DNS-based allow list with wildcard support. Examples: ['github.com', '*.npmjs.org']. @@ -481,8 +515,10 @@ async def update( f"/v1/network-policies/{id}", body=await async_maybe_transform( { + "allow_ai_gateway": allow_ai_gateway, "allow_all": allow_all, "allow_devbox_to_devbox": allow_devbox_to_devbox, + "allow_mcp_gateway": allow_mcp_gateway, "allowed_hostnames": allowed_hostnames, "description": description, "name": name, diff --git a/src/runloop_api_client/types/network_policy_create_params.py b/src/runloop_api_client/types/network_policy_create_params.py index e1a718a48..91a023188 100644 --- a/src/runloop_api_client/types/network_policy_create_params.py +++ b/src/runloop_api_client/types/network_policy_create_params.py @@ -17,6 +17,12 @@ class NetworkPolicyCreateParams(TypedDict, total=False): Must be unique within the account. """ + allow_ai_gateway: Optional[bool] + """ + (Optional) If true, allows devbox egress to the AI credential gateway for + credential proxying. Defaults to false. + """ + allow_all: Optional[bool] """(Optional) If true, all egress traffic is allowed (ALLOW_ALL policy). @@ -30,6 +36,12 @@ class NetworkPolicyCreateParams(TypedDict, total=False): true. """ + allow_mcp_gateway: Optional[bool] + """(Optional) If true, allows devbox egress to the MCP hub for MCP server access. + + Defaults to false. + """ + allowed_hostnames: Optional[SequenceNotStr[str]] """(Optional) DNS-based allow list with wildcard support. diff --git a/src/runloop_api_client/types/network_policy_update_params.py b/src/runloop_api_client/types/network_policy_update_params.py index 22e9550ff..ad7c62992 100644 --- a/src/runloop_api_client/types/network_policy_update_params.py +++ b/src/runloop_api_client/types/network_policy_update_params.py @@ -11,12 +11,18 @@ class NetworkPolicyUpdateParams(TypedDict, total=False): + allow_ai_gateway: Optional[bool] + """If true, allows devbox egress to the AI credential gateway.""" + allow_all: Optional[bool] """If true, all egress traffic is allowed (ALLOW_ALL policy).""" allow_devbox_to_devbox: Optional[bool] """If true, allows traffic between the account's own devboxes via tunnels.""" + allow_mcp_gateway: Optional[bool] + """If true, allows devbox egress to the MCP hub.""" + allowed_hostnames: Optional[SequenceNotStr[str]] """Updated DNS-based allow list with wildcard support. diff --git a/src/runloop_api_client/types/network_policy_view.py b/src/runloop_api_client/types/network_policy_view.py index 4d743cc8a..197902b02 100644 --- a/src/runloop_api_client/types/network_policy_view.py +++ b/src/runloop_api_client/types/network_policy_view.py @@ -10,6 +10,12 @@ class Egress(BaseModel): """The egress rules for this policy.""" + allow_ai_gateway: bool + """ + If true, allows devbox egress to the AI credential gateway for credential + proxying. + """ + allow_all: bool """If true, all egress traffic is allowed and other fields are ignored. @@ -19,6 +25,9 @@ class Egress(BaseModel): allow_devbox_to_devbox: bool """If true, allows traffic between the account's own devboxes via tunnels.""" + allow_mcp_gateway: bool + """If true, allows devbox egress to the MCP hub for MCP server access.""" + allowed_hostnames: List[str] """DNS-based allow list with wildcard support. diff --git a/tests/api_resources/test_network_policies.py b/tests/api_resources/test_network_policies.py index a528b4256..22a868cc4 100644 --- a/tests/api_resources/test_network_policies.py +++ b/tests/api_resources/test_network_policies.py @@ -31,8 +31,10 @@ def test_method_create(self, client: Runloop) -> None: def test_method_create_with_all_params(self, client: Runloop) -> None: network_policy = client.network_policies.create( name="name", + allow_ai_gateway=True, allow_all=True, allow_devbox_to_devbox=True, + allow_mcp_gateway=True, allowed_hostnames=["string"], description="description", ) @@ -111,8 +113,10 @@ def test_method_update(self, client: Runloop) -> None: def test_method_update_with_all_params(self, client: Runloop) -> None: network_policy = client.network_policies.update( id="id", + allow_ai_gateway=True, allow_all=True, allow_devbox_to_devbox=True, + allow_mcp_gateway=True, allowed_hostnames=["string"], description="description", name="name", @@ -240,8 +244,10 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: network_policy = await async_client.network_policies.create( name="name", + allow_ai_gateway=True, allow_all=True, allow_devbox_to_devbox=True, + allow_mcp_gateway=True, allowed_hostnames=["string"], description="description", ) @@ -320,8 +326,10 @@ async def test_method_update(self, async_client: AsyncRunloop) -> None: async def test_method_update_with_all_params(self, async_client: AsyncRunloop) -> None: network_policy = await async_client.network_policies.update( id="id", + allow_ai_gateway=True, allow_all=True, allow_devbox_to_devbox=True, + allow_mcp_gateway=True, allowed_hostnames=["string"], description="description", name="name", From f00db94fdb2db59cf8664e130673050b61916708 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Feb 2026 22:36:35 +0000 Subject: [PATCH 979/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c523ce19f..c3c95522a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.8.0" + ".": "1.9.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 8ea0ed19d..67bf927e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "1.8.0" +version = "1.9.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index da91dc1ce..f2dd2d557 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "1.8.0" # x-release-please-version +__version__ = "1.9.0" # x-release-please-version diff --git a/uv.lock b/uv.lock index d94681d0a..c713fab5f 100644 --- a/uv.lock +++ b/uv.lock @@ -1316,7 +1316,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "1.8.0" +version = "1.9.0" source = { editable = "." } dependencies = [ { name = "anyio" }, From e997dc606fff7ccf5de0f2ccebd533f23b83514c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Feb 2026 02:12:27 +0000 Subject: [PATCH 980/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c3c95522a..eb4e0dba7 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.9.0" + ".": "1.10.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 67bf927e1..c32527f83 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "1.9.0" +version = "1.10.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index f2dd2d557..d4a154392 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "1.9.0" # x-release-please-version +__version__ = "1.10.0" # x-release-please-version diff --git a/uv.lock b/uv.lock index c713fab5f..c7a40f9be 100644 --- a/uv.lock +++ b/uv.lock @@ -1316,7 +1316,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "1.9.0" +version = "1.10.0" source = { editable = "." } dependencies = [ { name = "anyio" }, From cc9915550efacd7a687780a9d4659438d1a715b5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Feb 2026 04:05:40 +0000 Subject: [PATCH 981/993] fix(devbox): add mcp configs to DevboxView (#7680) --- .stats.yml | 4 ++-- src/runloop_api_client/types/devbox_view.py | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index e8c2e4563..3ce8140cb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 118 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-dd0f43e15cb67179deaf86f83ae04c6fae4ff858ee33e82a3b89231566cdc5bb.yml -openapi_spec_hash: 569176c1c4f48efd25a44fa526fad9d1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-fa81aa937935299daa80a12956d3f4d69344342291689a77f41f14db5efd928e.yml +openapi_spec_hash: e388727b0c2f4debe675845ab26feacd config_hash: cbda3692cb48ab8582a0df1674b9e5c8 diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 68a96dbd7..652dea366 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -7,7 +7,7 @@ from .tunnel_view import TunnelView from .shared.launch_parameters import LaunchParameters -__all__ = ["DevboxView", "StateTransition", "GatewaySpecs"] +__all__ = ["DevboxView", "StateTransition", "GatewaySpecs", "McpSpec"] class StateTransition(BaseModel): @@ -39,6 +39,14 @@ class GatewaySpecs(BaseModel): """The ID of the secret containing the credential.""" +class McpSpec(BaseModel): + mcp_config_id: str + """The ID of the MCP config (e.g., mcp_123abc).""" + + secret_id: str + """The ID of the secret containing the credential.""" + + class DevboxView(BaseModel): """A Devbox represents a virtual development environment. @@ -99,6 +107,13 @@ class DevboxView(BaseModel): initiator_type: Optional[Literal["unknown", "api", "scenario", "scoring_validation"]] = None """The type of initiator that created the Devbox.""" + mcp_specs: Optional[List[McpSpec]] = None + """[Beta] MCP specifications configured for this devbox. + + Each spec links an MCP config to a secret for MCP server access through the MCP + hub. + """ + name: Optional[str] = None """The name of the Devbox.""" From 98afb14cd755e7771e1baa0cb311ccd262d24956 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Feb 2026 04:17:57 +0000 Subject: [PATCH 982/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index eb4e0dba7..e8fdcd657 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.10.0" + ".": "1.10.1" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index c32527f83..0bee9dae9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "1.10.0" +version = "1.10.1" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index d4a154392..7b90f8ec9 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "1.10.0" # x-release-please-version +__version__ = "1.10.1" # x-release-please-version diff --git a/uv.lock b/uv.lock index c7a40f9be..f27169cb8 100644 --- a/uv.lock +++ b/uv.lock @@ -1316,7 +1316,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "1.10.0" +version = "1.10.1" source = { editable = "." } dependencies = [ { name = "anyio" }, From 695c75dd3bf81dd84f3ac11fc03ea89555629f2c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Feb 2026 04:18:52 +0000 Subject: [PATCH 983/993] fix: remove beta docs from gateway-config (#7677) --- .stats.yml | 4 +-- .../resources/gateway_configs.py | 30 +++++++++---------- src/runloop_api_client/types/devbox_view.py | 2 +- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3ce8140cb..b8768eaae 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 118 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-fa81aa937935299daa80a12956d3f4d69344342291689a77f41f14db5efd928e.yml -openapi_spec_hash: e388727b0c2f4debe675845ab26feacd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3bde463fcdfe8cd4bdb47a6e14cf41c7a61e2638071ad093de9c492c96ad36bd.yml +openapi_spec_hash: e790f738711f3a87d006728ccdd26eee config_hash: cbda3692cb48ab8582a0df1674b9e5c8 diff --git a/src/runloop_api_client/resources/gateway_configs.py b/src/runloop_api_client/resources/gateway_configs.py index 38c921fcd..8d88c6fab 100644 --- a/src/runloop_api_client/resources/gateway_configs.py +++ b/src/runloop_api_client/resources/gateway_configs.py @@ -60,9 +60,8 @@ def create( idempotency_key: str | None = None, ) -> GatewayConfigView: """ - [Beta] Create a new GatewayConfig to proxy API requests through the credential - gateway. The config specifies the target endpoint and how credentials should be - applied. + Create a new GatewayConfig to proxy API requests through the credential gateway. + The config specifies the target endpoint and how credentials should be applied. Args: auth_mechanism: How credentials should be applied to proxied requests. Specify the type @@ -118,7 +117,7 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GatewayConfigView: """ - [Beta] Get a specific GatewayConfig by its unique identifier. + Get a specific GatewayConfig by its unique identifier. Args: extra_headers: Send extra headers @@ -155,7 +154,7 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> GatewayConfigView: - """[Beta] Update an existing GatewayConfig. + """Update an existing GatewayConfig. All fields are optional. @@ -216,8 +215,8 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncGatewayConfigsCursorIDPage[GatewayConfigView]: """ - [Beta] List all GatewayConfigs for the authenticated account, including - system-provided configs like 'anthropic' and 'openai'. + List all GatewayConfigs for the authenticated account, including system-provided + configs like 'anthropic' and 'openai'. Args: id: Filter by ID. @@ -269,7 +268,7 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> GatewayConfigView: - """[Beta] Delete an existing GatewayConfig. + """Delete an existing GatewayConfig. This action is irreversible. @@ -335,9 +334,8 @@ async def create( idempotency_key: str | None = None, ) -> GatewayConfigView: """ - [Beta] Create a new GatewayConfig to proxy API requests through the credential - gateway. The config specifies the target endpoint and how credentials should be - applied. + Create a new GatewayConfig to proxy API requests through the credential gateway. + The config specifies the target endpoint and how credentials should be applied. Args: auth_mechanism: How credentials should be applied to proxied requests. Specify the type @@ -393,7 +391,7 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> GatewayConfigView: """ - [Beta] Get a specific GatewayConfig by its unique identifier. + Get a specific GatewayConfig by its unique identifier. Args: extra_headers: Send extra headers @@ -430,7 +428,7 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> GatewayConfigView: - """[Beta] Update an existing GatewayConfig. + """Update an existing GatewayConfig. All fields are optional. @@ -491,8 +489,8 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[GatewayConfigView, AsyncGatewayConfigsCursorIDPage[GatewayConfigView]]: """ - [Beta] List all GatewayConfigs for the authenticated account, including - system-provided configs like 'anthropic' and 'openai'. + List all GatewayConfigs for the authenticated account, including system-provided + configs like 'anthropic' and 'openai'. Args: id: Filter by ID. @@ -544,7 +542,7 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> GatewayConfigView: - """[Beta] Delete an existing GatewayConfig. + """Delete an existing GatewayConfig. This action is irreversible. diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 652dea366..50bec1075 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -96,7 +96,7 @@ class DevboxView(BaseModel): """The failure reason if the Devbox failed, if the Devbox has a 'failure' status.""" gateway_specs: Optional[Dict[str, GatewaySpecs]] = None - """[Beta] Gateway specifications configured for this devbox. + """Gateway specifications configured for this devbox. Map key is the environment variable prefix (e.g., 'GWS_ANTHROPIC'). """ From e851d9d5d8cb6fbfff9b8ee0379aa551af222ef9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Feb 2026 19:50:23 +0000 Subject: [PATCH 984/993] chore: rename AI Gateway to Agent Gateway (#7687) --- .stats.yml | 4 +-- .../resources/devboxes/devboxes.py | 16 +++++------ .../resources/gateway_configs.py | 14 ++++++---- .../resources/network_policies.py | 28 +++++++++---------- .../types/devbox_create_params.py | 12 ++++---- .../types/gateway_config_view.py | 2 +- .../types/network_policy_create_params.py | 6 ++-- .../types/network_policy_update_params.py | 4 +-- .../types/network_policy_view.py | 7 ++--- tests/api_resources/test_network_policies.py | 8 +++--- 10 files changed, 50 insertions(+), 51 deletions(-) diff --git a/.stats.yml b/.stats.yml index b8768eaae..342cea69b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 118 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3bde463fcdfe8cd4bdb47a6e14cf41c7a61e2638071ad093de9c492c96ad36bd.yml -openapi_spec_hash: e790f738711f3a87d006728ccdd26eee +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-439b1a08248ef3bc7457c7b0a9a6218149732535a9f0dd541501fc35e2a3f8c2.yml +openapi_spec_hash: 35b12a086d98484417ce3d2543c47929 config_hash: cbda3692cb48ab8582a0df1674b9e5c8 diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index e287e86dc..a90cc0926 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -203,10 +203,10 @@ def create( file_mounts: Map of paths and file contents to write before setup. Use mounts instead. - gateways: [Beta] (Optional) Gateway specifications for credential proxying. Map key is the - environment variable prefix (e.g., 'GWS_ANTHROPIC'). The gateway will proxy - requests to external APIs using the specified credential without exposing the - real API key. Example: {'GWS_ANTHROPIC': {'gateway': 'anthropic', 'secret': + gateways: (Optional) Agent gateway specifications for credential proxying. Map key is the + environment variable prefix (e.g., 'GWS_ANTHROPIC'). The agent gateway will + proxy requests to external APIs using the specified credential without exposing + the real API key. Example: {'GWS_ANTHROPIC': {'gateway': 'anthropic', 'secret': 'my_claude_key'}} launch_parameters: Parameters to configure the resources and launch time behavior of the Devbox. @@ -1641,10 +1641,10 @@ async def create( file_mounts: Map of paths and file contents to write before setup. Use mounts instead. - gateways: [Beta] (Optional) Gateway specifications for credential proxying. Map key is the - environment variable prefix (e.g., 'GWS_ANTHROPIC'). The gateway will proxy - requests to external APIs using the specified credential without exposing the - real API key. Example: {'GWS_ANTHROPIC': {'gateway': 'anthropic', 'secret': + gateways: (Optional) Agent gateway specifications for credential proxying. Map key is the + environment variable prefix (e.g., 'GWS_ANTHROPIC'). The agent gateway will + proxy requests to external APIs using the specified credential without exposing + the real API key. Example: {'GWS_ANTHROPIC': {'gateway': 'anthropic', 'secret': 'my_claude_key'}} launch_parameters: Parameters to configure the resources and launch time behavior of the Devbox. diff --git a/src/runloop_api_client/resources/gateway_configs.py b/src/runloop_api_client/resources/gateway_configs.py index 8d88c6fab..86ec22ce6 100644 --- a/src/runloop_api_client/resources/gateway_configs.py +++ b/src/runloop_api_client/resources/gateway_configs.py @@ -59,9 +59,10 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> GatewayConfigView: - """ - Create a new GatewayConfig to proxy API requests through the credential gateway. - The config specifies the target endpoint and how credentials should be applied. + """Create a new GatewayConfig to proxy API requests through the agent gateway. + + The + config specifies the target endpoint and how credentials should be applied. Args: auth_mechanism: How credentials should be applied to proxied requests. Specify the type @@ -333,9 +334,10 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, idempotency_key: str | None = None, ) -> GatewayConfigView: - """ - Create a new GatewayConfig to proxy API requests through the credential gateway. - The config specifies the target endpoint and how credentials should be applied. + """Create a new GatewayConfig to proxy API requests through the agent gateway. + + The + config specifies the target endpoint and how credentials should be applied. Args: auth_mechanism: How credentials should be applied to proxied requests. Specify the type diff --git a/src/runloop_api_client/resources/network_policies.py b/src/runloop_api_client/resources/network_policies.py index 388126cee..f50d4fe6d 100644 --- a/src/runloop_api_client/resources/network_policies.py +++ b/src/runloop_api_client/resources/network_policies.py @@ -48,7 +48,7 @@ def create( self, *, name: str, - allow_ai_gateway: Optional[bool] | Omit = omit, + allow_agent_gateway: Optional[bool] | Omit = omit, allow_all: Optional[bool] | Omit = omit, allow_devbox_to_devbox: Optional[bool] | Omit = omit, allow_mcp_gateway: Optional[bool] | Omit = omit, @@ -71,8 +71,8 @@ def create( name: The human-readable name for the NetworkPolicy. Must be unique within the account. - allow_ai_gateway: (Optional) If true, allows devbox egress to the AI credential gateway for - credential proxying. Defaults to false. + allow_agent_gateway: (Optional) If true, allows devbox egress to the agent gateway for credential + proxying. Defaults to false. allow_all: (Optional) If true, all egress traffic is allowed (ALLOW_ALL policy). Defaults to false. @@ -104,7 +104,7 @@ def create( body=maybe_transform( { "name": name, - "allow_ai_gateway": allow_ai_gateway, + "allow_agent_gateway": allow_agent_gateway, "allow_all": allow_all, "allow_devbox_to_devbox": allow_devbox_to_devbox, "allow_mcp_gateway": allow_mcp_gateway, @@ -160,7 +160,7 @@ def update( self, id: str, *, - allow_ai_gateway: Optional[bool] | Omit = omit, + allow_agent_gateway: Optional[bool] | Omit = omit, allow_all: Optional[bool] | Omit = omit, allow_devbox_to_devbox: Optional[bool] | Omit = omit, allow_mcp_gateway: Optional[bool] | Omit = omit, @@ -180,7 +180,7 @@ def update( All fields are optional. Args: - allow_ai_gateway: If true, allows devbox egress to the AI credential gateway. + allow_agent_gateway: If true, allows devbox egress to the agent gateway. allow_all: If true, all egress traffic is allowed (ALLOW_ALL policy). @@ -211,7 +211,7 @@ def update( f"/v1/network-policies/{id}", body=maybe_transform( { - "allow_ai_gateway": allow_ai_gateway, + "allow_agent_gateway": allow_agent_gateway, "allow_all": allow_all, "allow_devbox_to_devbox": allow_devbox_to_devbox, "allow_mcp_gateway": allow_mcp_gateway, @@ -352,7 +352,7 @@ async def create( self, *, name: str, - allow_ai_gateway: Optional[bool] | Omit = omit, + allow_agent_gateway: Optional[bool] | Omit = omit, allow_all: Optional[bool] | Omit = omit, allow_devbox_to_devbox: Optional[bool] | Omit = omit, allow_mcp_gateway: Optional[bool] | Omit = omit, @@ -375,8 +375,8 @@ async def create( name: The human-readable name for the NetworkPolicy. Must be unique within the account. - allow_ai_gateway: (Optional) If true, allows devbox egress to the AI credential gateway for - credential proxying. Defaults to false. + allow_agent_gateway: (Optional) If true, allows devbox egress to the agent gateway for credential + proxying. Defaults to false. allow_all: (Optional) If true, all egress traffic is allowed (ALLOW_ALL policy). Defaults to false. @@ -408,7 +408,7 @@ async def create( body=await async_maybe_transform( { "name": name, - "allow_ai_gateway": allow_ai_gateway, + "allow_agent_gateway": allow_agent_gateway, "allow_all": allow_all, "allow_devbox_to_devbox": allow_devbox_to_devbox, "allow_mcp_gateway": allow_mcp_gateway, @@ -464,7 +464,7 @@ async def update( self, id: str, *, - allow_ai_gateway: Optional[bool] | Omit = omit, + allow_agent_gateway: Optional[bool] | Omit = omit, allow_all: Optional[bool] | Omit = omit, allow_devbox_to_devbox: Optional[bool] | Omit = omit, allow_mcp_gateway: Optional[bool] | Omit = omit, @@ -484,7 +484,7 @@ async def update( All fields are optional. Args: - allow_ai_gateway: If true, allows devbox egress to the AI credential gateway. + allow_agent_gateway: If true, allows devbox egress to the agent gateway. allow_all: If true, all egress traffic is allowed (ALLOW_ALL policy). @@ -515,7 +515,7 @@ async def update( f"/v1/network-policies/{id}", body=await async_maybe_transform( { - "allow_ai_gateway": allow_ai_gateway, + "allow_agent_gateway": allow_agent_gateway, "allow_all": allow_all, "allow_devbox_to_devbox": allow_devbox_to_devbox, "allow_mcp_gateway": allow_mcp_gateway, diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index db651d90a..a38cd6038 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -45,12 +45,12 @@ class DevboxCreateParams(TypedDict, total=False): """Map of paths and file contents to write before setup. Use mounts instead.""" gateways: Optional[Dict[str, Gateways]] - """[Beta] (Optional) Gateway specifications for credential proxying. + """(Optional) Agent gateway specifications for credential proxying. - Map key is the environment variable prefix (e.g., 'GWS_ANTHROPIC'). The gateway - will proxy requests to external APIs using the specified credential without - exposing the real API key. Example: {'GWS_ANTHROPIC': {'gateway': 'anthropic', - 'secret': 'my_claude_key'}} + Map key is the environment variable prefix (e.g., 'GWS_ANTHROPIC'). The agent + gateway will proxy requests to external APIs using the specified credential + without exposing the real API key. Example: {'GWS_ANTHROPIC': {'gateway': + 'anthropic', 'secret': 'my_claude_key'}} """ launch_parameters: Optional[LaunchParameters] @@ -100,7 +100,7 @@ class DevboxCreateParams(TypedDict, total=False): class Gateways(TypedDict, total=False): """ - [Beta] GatewaySpec links a gateway configuration to a secret for credential proxying in a devbox. The gateway will proxy requests to external APIs using the specified credential without exposing the real API key. + GatewaySpec links an agent gateway configuration to a secret for credential proxying in a devbox. The agent gateway will proxy requests to external APIs using the specified credential without exposing the real API key. """ gateway: Required[str] diff --git a/src/runloop_api_client/types/gateway_config_view.py b/src/runloop_api_client/types/gateway_config_view.py index a6e3b3ac4..c8fcc6e3c 100644 --- a/src/runloop_api_client/types/gateway_config_view.py +++ b/src/runloop_api_client/types/gateway_config_view.py @@ -19,7 +19,7 @@ class AuthMechanism(BaseModel): class GatewayConfigView(BaseModel): """ - A GatewayConfig defines a configuration for proxying API requests through the credential gateway. It specifies the target endpoint and how credentials should be applied. + A GatewayConfig defines a configuration for proxying API requests through the agent gateway. It specifies the target endpoint and how credentials should be applied. """ id: str diff --git a/src/runloop_api_client/types/network_policy_create_params.py b/src/runloop_api_client/types/network_policy_create_params.py index 91a023188..0d8b1de2a 100644 --- a/src/runloop_api_client/types/network_policy_create_params.py +++ b/src/runloop_api_client/types/network_policy_create_params.py @@ -17,10 +17,10 @@ class NetworkPolicyCreateParams(TypedDict, total=False): Must be unique within the account. """ - allow_ai_gateway: Optional[bool] + allow_agent_gateway: Optional[bool] """ - (Optional) If true, allows devbox egress to the AI credential gateway for - credential proxying. Defaults to false. + (Optional) If true, allows devbox egress to the agent gateway for credential + proxying. Defaults to false. """ allow_all: Optional[bool] diff --git a/src/runloop_api_client/types/network_policy_update_params.py b/src/runloop_api_client/types/network_policy_update_params.py index ad7c62992..0a622ca3e 100644 --- a/src/runloop_api_client/types/network_policy_update_params.py +++ b/src/runloop_api_client/types/network_policy_update_params.py @@ -11,8 +11,8 @@ class NetworkPolicyUpdateParams(TypedDict, total=False): - allow_ai_gateway: Optional[bool] - """If true, allows devbox egress to the AI credential gateway.""" + allow_agent_gateway: Optional[bool] + """If true, allows devbox egress to the agent gateway.""" allow_all: Optional[bool] """If true, all egress traffic is allowed (ALLOW_ALL policy).""" diff --git a/src/runloop_api_client/types/network_policy_view.py b/src/runloop_api_client/types/network_policy_view.py index 197902b02..0c3e25728 100644 --- a/src/runloop_api_client/types/network_policy_view.py +++ b/src/runloop_api_client/types/network_policy_view.py @@ -10,11 +10,8 @@ class Egress(BaseModel): """The egress rules for this policy.""" - allow_ai_gateway: bool - """ - If true, allows devbox egress to the AI credential gateway for credential - proxying. - """ + allow_agent_gateway: bool + """If true, allows devbox egress to the agent gateway for credential proxying.""" allow_all: bool """If true, all egress traffic is allowed and other fields are ignored. diff --git a/tests/api_resources/test_network_policies.py b/tests/api_resources/test_network_policies.py index 22a868cc4..6a1587cb9 100644 --- a/tests/api_resources/test_network_policies.py +++ b/tests/api_resources/test_network_policies.py @@ -31,7 +31,7 @@ def test_method_create(self, client: Runloop) -> None: def test_method_create_with_all_params(self, client: Runloop) -> None: network_policy = client.network_policies.create( name="name", - allow_ai_gateway=True, + allow_agent_gateway=True, allow_all=True, allow_devbox_to_devbox=True, allow_mcp_gateway=True, @@ -113,7 +113,7 @@ def test_method_update(self, client: Runloop) -> None: def test_method_update_with_all_params(self, client: Runloop) -> None: network_policy = client.network_policies.update( id="id", - allow_ai_gateway=True, + allow_agent_gateway=True, allow_all=True, allow_devbox_to_devbox=True, allow_mcp_gateway=True, @@ -244,7 +244,7 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None: async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None: network_policy = await async_client.network_policies.create( name="name", - allow_ai_gateway=True, + allow_agent_gateway=True, allow_all=True, allow_devbox_to_devbox=True, allow_mcp_gateway=True, @@ -326,7 +326,7 @@ async def test_method_update(self, async_client: AsyncRunloop) -> None: async def test_method_update_with_all_params(self, async_client: AsyncRunloop) -> None: network_policy = await async_client.network_policies.update( id="id", - allow_ai_gateway=True, + allow_agent_gateway=True, allow_all=True, allow_devbox_to_devbox=True, allow_mcp_gateway=True, From 9540d5aff8528dc3d5b210ac381c09af0b055207 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Feb 2026 19:55:33 +0000 Subject: [PATCH 985/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e8fdcd657..9bd8fad44 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.10.1" + ".": "1.10.2" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 0bee9dae9..fa88ea667 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "1.10.1" +version = "1.10.2" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 7b90f8ec9..8db51c16e 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "1.10.1" # x-release-please-version +__version__ = "1.10.2" # x-release-please-version diff --git a/uv.lock b/uv.lock index f27169cb8..a96c1078f 100644 --- a/uv.lock +++ b/uv.lock @@ -1316,7 +1316,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "1.10.1" +version = "1.10.2" source = { editable = "." } dependencies = [ { name = "anyio" }, From 2e854349fb022e80f77a9e2e8210f053e4ecc3a2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 05:17:58 +0000 Subject: [PATCH 986/993] chore(ci): bump uv version --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd82d3f97..d70792ce1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 with: - version: '0.9.13' + version: '0.10.2' - name: Install dependencies run: uv sync --all-extras @@ -46,7 +46,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 with: - version: '0.9.13' + version: '0.10.2' - name: Install dependencies run: uv sync --all-extras @@ -80,7 +80,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 with: - version: '0.9.13' + version: '0.10.2' - name: Bootstrap run: ./scripts/bootstrap From 20999747738ad37736fa7dcf6ab4926164a72883 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 20:03:53 +0000 Subject: [PATCH 987/993] fix: switching to MCP definition to specify a secret name per MCP server (#7715) --- .stats.yml | 4 ++-- .../resources/devboxes/devboxes.py | 22 ++++++++++--------- .../types/devbox_create_params.py | 9 ++++---- src/runloop_api_client/types/devbox_view.py | 10 ++++----- tests/api_resources/test_devboxes.py | 12 +++++----- 5 files changed, 30 insertions(+), 27 deletions(-) diff --git a/.stats.yml b/.stats.yml index 342cea69b..8789b2016 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 118 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-439b1a08248ef3bc7457c7b0a9a6218149732535a9f0dd541501fc35e2a3f8c2.yml -openapi_spec_hash: 35b12a086d98484417ce3d2543c47929 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-132ed160716591bdcd9231c00da8c506d9451a5486b165fc27b2a01d93202082.yml +openapi_spec_hash: c2b44d9e9cda56e32141a7ea3794bbba config_hash: cbda3692cb48ab8582a0df1674b9e5c8 diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index a90cc0926..37c67279e 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -160,7 +160,7 @@ def create( file_mounts: Optional[Dict[str, str]] | Omit = omit, gateways: Optional[Dict[str, devbox_create_params.Gateways]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, - mcp: Optional[Iterable[devbox_create_params.Mcp]] | Omit = omit, + mcp: Optional[Dict[str, devbox_create_params.Mcp]] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, mounts: Optional[Iterable[Mount]] | Omit = omit, name: Optional[str] | Omit = omit, @@ -211,10 +211,11 @@ def create( launch_parameters: Parameters to configure the resources and launch time behavior of the Devbox. - mcp: [Beta] (Optional) MCP specifications for MCP server access. Each spec links an - MCP config to a secret. The devbox will receive environment variables - (RL_MCP_URL, RL_MCP_TOKEN) for accessing MCP servers through the MCP hub. - Example: [{'mcp_config': 'github-readonly', 'secret': 'MY_GITHUB_TOKEN'}] + mcp: [Beta] (Optional) MCP specifications for MCP server access. Map key is the + environment variable name for the MCP token envelope. Each spec links an MCP + config to a secret. The devbox will also receive RL_MCP_URL for the MCP hub + endpoint. Example: {'MCP_SECRET': {'mcp_config': 'github-readonly', 'secret': + 'MY_GITHUB_TOKEN'}} metadata: User defined metadata to attach to the devbox for organization. @@ -1598,7 +1599,7 @@ async def create( file_mounts: Optional[Dict[str, str]] | Omit = omit, gateways: Optional[Dict[str, devbox_create_params.Gateways]] | Omit = omit, launch_parameters: Optional[LaunchParameters] | Omit = omit, - mcp: Optional[Iterable[devbox_create_params.Mcp]] | Omit = omit, + mcp: Optional[Dict[str, devbox_create_params.Mcp]] | Omit = omit, metadata: Optional[Dict[str, str]] | Omit = omit, mounts: Optional[Iterable[Mount]] | Omit = omit, name: Optional[str] | Omit = omit, @@ -1649,10 +1650,11 @@ async def create( launch_parameters: Parameters to configure the resources and launch time behavior of the Devbox. - mcp: [Beta] (Optional) MCP specifications for MCP server access. Each spec links an - MCP config to a secret. The devbox will receive environment variables - (RL_MCP_URL, RL_MCP_TOKEN) for accessing MCP servers through the MCP hub. - Example: [{'mcp_config': 'github-readonly', 'secret': 'MY_GITHUB_TOKEN'}] + mcp: [Beta] (Optional) MCP specifications for MCP server access. Map key is the + environment variable name for the MCP token envelope. Each spec links an MCP + config to a secret. The devbox will also receive RL_MCP_URL for the MCP hub + endpoint. Example: {'MCP_SECRET': {'mcp_config': 'github-readonly', 'secret': + 'MY_GITHUB_TOKEN'}} metadata: User defined metadata to attach to the devbox for organization. diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index a38cd6038..535ea3245 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -56,12 +56,13 @@ class DevboxCreateParams(TypedDict, total=False): launch_parameters: Optional[LaunchParameters] """Parameters to configure the resources and launch time behavior of the Devbox.""" - mcp: Optional[Iterable[Mcp]] + mcp: Optional[Dict[str, Mcp]] """[Beta] (Optional) MCP specifications for MCP server access. - Each spec links an MCP config to a secret. The devbox will receive environment - variables (RL_MCP_URL, RL_MCP_TOKEN) for accessing MCP servers through the MCP - hub. Example: [{'mcp_config': 'github-readonly', 'secret': 'MY_GITHUB_TOKEN'}] + Map key is the environment variable name for the MCP token envelope. Each spec + links an MCP config to a secret. The devbox will also receive RL_MCP_URL for the + MCP hub endpoint. Example: {'MCP_SECRET': {'mcp_config': 'github-readonly', + 'secret': 'MY_GITHUB_TOKEN'}} """ metadata: Optional[Dict[str, str]] diff --git a/src/runloop_api_client/types/devbox_view.py b/src/runloop_api_client/types/devbox_view.py index 50bec1075..cdd37cf1f 100644 --- a/src/runloop_api_client/types/devbox_view.py +++ b/src/runloop_api_client/types/devbox_view.py @@ -7,7 +7,7 @@ from .tunnel_view import TunnelView from .shared.launch_parameters import LaunchParameters -__all__ = ["DevboxView", "StateTransition", "GatewaySpecs", "McpSpec"] +__all__ = ["DevboxView", "StateTransition", "GatewaySpecs", "McpSpecs"] class StateTransition(BaseModel): @@ -39,7 +39,7 @@ class GatewaySpecs(BaseModel): """The ID of the secret containing the credential.""" -class McpSpec(BaseModel): +class McpSpecs(BaseModel): mcp_config_id: str """The ID of the MCP config (e.g., mcp_123abc).""" @@ -107,11 +107,11 @@ class DevboxView(BaseModel): initiator_type: Optional[Literal["unknown", "api", "scenario", "scoring_validation"]] = None """The type of initiator that created the Devbox.""" - mcp_specs: Optional[List[McpSpec]] = None + mcp_specs: Optional[Dict[str, McpSpecs]] = None """[Beta] MCP specifications configured for this devbox. - Each spec links an MCP config to a secret for MCP server access through the MCP - hub. + Map key is the environment variable name for the MCP token envelope. Each spec + links an MCP config to a secret for MCP server access through the MCP hub. """ name: Optional[str] = None diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index c22f79370..585e65074 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -89,12 +89,12 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: "username": "username", }, }, - mcp=[ - { + mcp={ + "foo": { "mcp_config": "mcp_config", "secret": "secret", } - ], + }, metadata={"foo": "string"}, mounts=[ { @@ -1284,12 +1284,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - "username": "username", }, }, - mcp=[ - { + mcp={ + "foo": { "mcp_config": "mcp_config", "secret": "secret", } - ], + }, metadata={"foo": "string"}, mounts=[ { From e54e93f08e95af3fa8dddebb626b0d509bfde59c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 20:35:00 +0000 Subject: [PATCH 988/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 9bd8fad44..083df00ef 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.10.2" + ".": "1.10.3" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index fa88ea667..1be383b35 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "1.10.2" +version = "1.10.3" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 8db51c16e..8592b7e83 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "1.10.2" # x-release-please-version +__version__ = "1.10.3" # x-release-please-version diff --git a/uv.lock b/uv.lock index a96c1078f..dbd4f8e08 100644 --- a/uv.lock +++ b/uv.lock @@ -1316,7 +1316,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "1.10.2" +version = "1.10.3" source = { editable = "." } dependencies = [ { name = "anyio" }, From cc8cad07e5f0b0b13ad1a24b9ab6f7a48c88f7e1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 05:41:45 +0000 Subject: [PATCH 989/993] chore(test): do not count install time for mock server timeout --- scripts/mock | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/mock b/scripts/mock index 0b28f6ea2..bcf3b392b 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,11 +21,22 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then + # Pre-install the package so the download doesn't eat into the startup timeout + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism --version + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & - # Wait for server to come online + # Wait for server to come online (max 30s) echo -n "Waiting for server" + attempts=0 while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + attempts=$((attempts + 1)) + if [ "$attempts" -ge 300 ]; then + echo + echo "Timed out waiting for Prism server to start" + cat .prism.log + exit 1 + fi echo -n "." sleep 0.1 done From 9d785589e2884966a1cabe505b180be23c22aab1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 7 Mar 2026 16:24:26 +0000 Subject: [PATCH 990/993] chore(ci): skip uploading artifacts on stainless-internal branches --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d70792ce1..3a6e2ca5f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,14 +55,18 @@ jobs: run: uv build - name: Get GitHub OIDC Token - if: github.repository == 'stainless-sdks/runloop-python' + if: |- + github.repository == 'stainless-sdks/runloop-python' && + !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc uses: actions/github-script@v8 with: script: core.setOutput('github_token', await core.getIDToken()); - name: Upload tarball - if: github.repository == 'stainless-sdks/runloop-python' + if: |- + github.repository == 'stainless-sdks/runloop-python' && + !startsWith(github.ref, 'refs/heads/stl/') env: URL: https://pkg.stainless.com/s AUTH: ${{ steps.github-oidc.outputs.github_token }} From a3f884a41fe4a6f22ff57d32cb1ca93cbb10900c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 7 Mar 2026 16:27:01 +0000 Subject: [PATCH 991/993] chore: update placeholder string --- tests/api_resources/test_devboxes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 585e65074..f0c41e9a7 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -1083,7 +1083,7 @@ def test_method_upload_file_with_all_params(self, client: Runloop) -> None: devbox = client.devboxes.upload_file( id="id", path="path", - file=b"raw file contents", + file=b"Example data", ) assert_matches_type(object, devbox, path=["response"]) @@ -2278,7 +2278,7 @@ async def test_method_upload_file_with_all_params(self, async_client: AsyncRunlo devbox = await async_client.devboxes.upload_file( id="id", path="path", - file=b"raw file contents", + file=b"Example data", ) assert_matches_type(object, devbox, path=["response"]) From 1ad7026c39c4ed525808e988565c2d1a41c8dd96 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 01:06:14 +0000 Subject: [PATCH 992/993] chore(internal): version bump --- .release-please-manifest.json | 2 +- pyproject.toml | 2 +- src/runloop_api_client/_version.py | 2 +- uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 083df00ef..caf148712 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.10.3" + ".": "1.11.0" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 1be383b35..01a86e12d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "1.10.3" +version = "1.11.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 8592b7e83..93214b609 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "1.10.3" # x-release-please-version +__version__ = "1.11.0" # x-release-please-version diff --git a/uv.lock b/uv.lock index dbd4f8e08..77d91be5f 100644 --- a/uv.lock +++ b/uv.lock @@ -1316,7 +1316,7 @@ wheels = [ [[package]] name = "runloop-api-client" -version = "1.10.3" +version = "1.11.0" source = { editable = "." } dependencies = [ { name = "anyio" }, From 61bc6a7caa6f98445b54bafd86c96f0de955d644 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2026 23:14:27 +0000 Subject: [PATCH 993/993] chore: configure new SDK language --- .stats.yml | 2 +- README.md | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8789b2016..a784436d5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 118 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-132ed160716591bdcd9231c00da8c506d9451a5486b165fc27b2a01d93202082.yml openapi_spec_hash: c2b44d9e9cda56e32141a7ea3794bbba -config_hash: cbda3692cb48ab8582a0df1674b9e5c8 +config_hash: 3bd89c812b96708c461fb98286ebf0b5 diff --git a/README.md b/README.md index a7b0db561..9bc50dca5 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,15 @@ and offers both synchronous and asynchronous clients powered by [httpx](https:// It is generated with [Stainless](https://www.stainless.com/). +## MCP Server + +Use the Runloop MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application. + +[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40runloop%2Fapi-client-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBydW5sb29wL2FwaS1jbGllbnQtbWNwIl0sImVudiI6eyJSVU5MT09QX0FQSV9LRVkiOiJNeSBCZWFyZXIgVG9rZW4ifX0) +[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40runloop%2Fapi-client-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40runloop%2Fapi-client-mcp%22%5D%2C%22env%22%3A%7B%22RUNLOOP_API_KEY%22%3A%22My%20Bearer%20Token%22%7D%7D) + +> Note: You may need to set environment variables in your MCP client. + ## Documentation The REST API documentation can be found on [runloop.ai](https://runloop.ai). The full API of this library can be found in [api.md](api.md).